This repository was archived by the owner on Nov 15, 2023. It is now read-only.
  
  
  - 
                Notifications
    You must be signed in to change notification settings 
- Fork 2.7k
PhragMMS election. #6685
          
     Merged
      
      
    
                
     Merged
            
            PhragMMS election. #6685
Conversation
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
    
      
        
      
      
  
    5 tasks
  
              
                    kianenigma
  
              
              commented
              
                  
                    Jul 19, 2020 
                  
              
              
            
            
              
                    kianenigma
  
              
              commented
              
                  
                    Jul 19, 2020 
                  
              
              
            
            
              
                    kianenigma
  
              
              commented
              
                  
                    Jul 20, 2020 
                  
              
              
            
            
| The changes here might have something to do with the bug being found here #4593 | 
| @kianenigma needs resolving and doesn't build. | 
…nto kiz-impl-phragmms
              
                    gui1117
  
              
              reviewed
              
                  
                    Jul 27, 2020 
                  
              
              
            
            
              
                    gui1117
  
              
              reviewed
              
                  
                    Jul 27, 2020 
                  
              
              
            
            
              
                    gui1117
  
              
              reviewed
              
                  
                    Jul 27, 2020 
                  
              
              
            
            
              
                    kianenigma
  
              
              commented
              
                  
                    Sep 15, 2020 
                  
              
              
            
            
| @thiolliere / @shawntabrizi little things might have changed due to audit. I will finalize and merge this probably tomorrow. A brief re-review could potentially be very very valuable. | 
| bot merge | 
| Waiting for commit status. | 
| Merge failed:  | 
| bot merge | 
| Trying merge. | 
              This pull request was closed.
            
          
  
      Sign up for free
      to subscribe to this conversation on GitHub.
      Already have an account?
      Sign in.
  
      Labels
      
    A0-please_review
  Pull request needs code review. 
  
    B0-silent
  Changes should not be mentioned in any release notes 
  
    C1-low
  PR touches the given topic and has a low impact on builders. 
  
    D1-audited 👍
  PR contains changes to fund-managing logic that has been properly reviewed and externally audited 
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Next step of #6242
This adds the new election algorithm proposed to be used in staking by w3f, PhragMMS. Research paper here.
TestExternalitiesbackend). This is not unexpected. I put some timings into the code and the main reason why this is slow isbalanceing, which runs two iterations per candidate that we pick. In short, the current election (seq-phragmen + balancing) us runing 5-10 balancing rounds now, while this will runstaking::validator_count() * N, where I've setN = 2for now, which is still a damn 800 rounds. This is fine, but we should expect some spikes in CPU usage once it is deployed. I will detail these stuff in the follow up PR.Some follow ups:
Rational128is a target of revision in a follow up, and this struct need to be double checked and fuzzed.