- 
                Notifications
    You must be signed in to change notification settings 
- Fork 518
Eval: Move congestion monitoring and fee escalation on-chain #6400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Draft
      
      
            jannotti
  wants to merge
  6
  commits into
  algorand:master
  
    
      
        
          
  
    
      Choose a base branch
      
     
    
      
        
      
      
        
          
          
        
        
          
            
              
              
              
  
           
        
        
          
            
              
              
           
        
       
     
  
        
          
            
          
            
          
        
       
    
      
from
jannotti:on-chain-congestion
  
      
      
   
  
    
  
  
  
 
  
      
    base: master
Could not load branches
            
              
  
    Branch not found: {{ refName }}
  
            
                
      Loading
              
            Could not load tags
            
            
              Nothing to show
            
              
  
            
                
      Loading
              
            Are you sure you want to change the base?
            Some commits from the old base branch may be removed from the timeline,
            and old review comments may become outdated.
          
          
  
     Draft
                    Changes from all commits
      Commits
    
    
            Show all changes
          
          
            6 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      2fd275b
              
                Add, maintain, and validate new Load and BaseFee header fields
              
              
                jannotti d1de62b
              
                Remove the old "out of protocol" congestion checking
              
              
                jannotti 8747acf
              
                Actually use the base fee from the block header for txn validity
              
              
                jannotti 0aa5a00
              
                Use SummarizeFees pervasively, and eliminate EnableFeePooling
              
              
                jannotti ee194e4
              
                Use Micros to clean up code, add tests
              
              
                jannotti 76b307d
              
                Switch to CongestionFee so that 0 is common case
              
              
                jannotti File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      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
    
  
  
    
              Large diffs are not rendered by default.
      
      Oops, something went wrong.
      
    
  
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
|  | @@ -102,11 +102,6 @@ type ConsensusParams struct { | |
| // a way of making the spender subsidize the cost of storing this transaction. | ||
| MinTxnFee uint64 | ||
|  | ||
| // EnableFeePooling specifies that the sum of the fees in a | ||
| // group must exceed one MinTxnFee per Txn, rather than check that | ||
| // each Txn has a MinFee. | ||
| EnableFeePooling bool | ||
|  | ||
| 
      Comment on lines
    
      -105
     to 
      -109
    
   There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't need this any more, so I removed it for clarity. It enabled strictly more permissive fee handling, so we can pretend it was always true. | ||
| // EnableAppCostPooling specifies that the sum of fees for application calls | ||
| // in a group is checked against the sum of the budget for application calls, | ||
| // rather than check each individual app call is within the budget. | ||
|  | @@ -577,6 +572,10 @@ type ConsensusParams struct { | |
| // available. This parameters can be removed and assumed true after the | ||
| // first consensus release in which it is set true. | ||
| EnableInnerClawbackWithoutSenderHolding bool | ||
|  | ||
| // CongestionFees enables header values that track Load and a running | ||
| // CongestionFee that grows/shrinks when blocks are more/less than half full | ||
| CongestionFees bool | ||
| } | ||
|  | ||
| // ProposerPayoutRules puts several related consensus parameters in one place. The same | ||
|  | @@ -1181,7 +1180,6 @@ func initConsensusProtocols() { | |
| // "reachability" between accounts and creatables, so we | ||
| // retain 4 x 4 as worst case. | ||
|  | ||
| v28.EnableFeePooling = true | ||
| v28.EnableKeyregCoherencyCheck = true | ||
|  | ||
| Consensus[protocol.ConsensusV28] = v28 | ||
|  | @@ -1461,6 +1459,7 @@ func initConsensusProtocols() { | |
| vFuture.ApprovedUpgrades = map[protocol.ConsensusVersion]uint64{} | ||
|  | ||
| vFuture.LogicSigVersion = 13 // When moving this to a release, put a new higher LogicSigVersion here | ||
| vFuture.CongestionFees = true | ||
|  | ||
| Consensus[protocol.ConsensusFuture] = vFuture | ||
|  | ||
|  | ||
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
      
      Oops, something went wrong.
        
    
  
      
      Oops, something went wrong.
        
    
  
  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.
  
    
  
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doubles the speed of
make api