forked from dominant-strategies/go-quai
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GasLimit adjustment logic updated and network specific gas ceil is used
Previously the gas adjustment was being done using arbitrary code which I couldn't track from Geth. And the variables were being used in a wrong way. PROBLEM: To be specific, genesis gas limit was set to the min gas limit and Parent gas limit was given as an input to the CalcGasLimit function. This meant that the gas limit would never adjust and it will always stay the same as the genesis gas limit set in the genesis block. SOLUTION: Gas limit should adjust based on the usage, and by default a spike in the gas limit shouldn't be allowed This Commit does exactly that. CalcGasLimit takes parent gas limit and the desired gas limit and returns the gas limit after adjustment, either adding/subtracting a fixed proportion of the parent gas limit to the parent gas limit. If the percentage of gas used is less than 80 percent adjust downwards to default GasFloor and otherwise adjust upwards to the GasCeil Since this is not consensus, a Node operator can change this default behavior if he chooses to do so, he can increase or decrease within the allowable range.
- Loading branch information
1 parent
c6ead67
commit af53114
Showing
6 changed files
with
80 additions
and
50 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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