-
Notifications
You must be signed in to change notification settings - Fork 205
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
Fix genesis block gingerbread fields #2245
Conversation
Coverage from tests in coverage: 50.7% of statements across all listed packagescoverage: 63.2% of statements in consensus/istanbul coverage: 42.7% of statements in consensus/istanbul/announce coverage: 55.7% of statements in consensus/istanbul/backend coverage: 0.0% of statements in consensus/istanbul/backend/backendtest coverage: 24.3% of statements in consensus/istanbul/backend/internal/replica coverage: 65.0% of statements in consensus/istanbul/core coverage: 50.0% of statements in consensus/istanbul/db coverage: 0.0% of statements in consensus/istanbul/proxy coverage: 64.2% of statements in consensus/istanbul/uptime coverage: 51.8% of statements in consensus/istanbul/validator coverage: 79.2% of statements in consensus/istanbul/validator/random |
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2245 +/- ##
==========================================
- Coverage 55.10% 48.87% -6.24%
==========================================
Files 683 206 -477
Lines 114538 27316 -87222
==========================================
- Hits 63121 13350 -49771
+ Misses 47528 13247 -34281
+ Partials 3889 719 -3170 ☔ View full report in Codecov by Sentry. |
This allows the genesis block to have the baseFee set when operating in eth compatibility mode.
This allows the genesis block to have the gasLimit set when operating in eth compatibility mode.
Originally it was not possible to set the baseFeeOpCodeActivationBlock to zero in the GasPriceMinimum contract but the contract was later updated to allow this. This means we can set the gingerbread block to be 0 and consequently remove the check we had in our test infrastructure that prevented setting the gingerbread block to zero.
36f2a26
to
fe0c2ea
Compare
These got missed in the previous commit
Previously they were getting block 1, but somethimes the block had not yet been mined.
Previously it was getting block 1, but somethimes the block had not yet been mined.
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.
Nice one!
Description
This PR fixes the way the the gasLimit and gasPriceMinimum are retrieved from state such that for all non genesis blocks the value returned is the value present in the state of the parent block, and for the genesis block the value returned is the value present in the state of the genesis block (because the genesis has no parent). Prior to this fix requesting the gasLimit or gasPrice minimum for the genesis block would result in an error because we would try to get the state for the genesis block's parent which of course did not exist.
It also removes a restriction in the mycelo genesis package (used by e2e tests) that prevented us from setting the gingerbread activation block to zero. This restriction was in place because originally it was not possible to set the baseFeeOpCodeActivationBlock (AKA the gingerbread block) to zero in the GasPriceMinimum contract but the contract was later updated to allow this.
It also updates all e2e tests that were setting the gingerbread block to 1 to now use 0.
These fixes fix a number of flakily failing eth compatibility and gingerbread tests, that would fail if run on the genesis block.
Tested
Two end to end tests have been added to verify the new behaviour
Backwards compatibility
This is non backwards compatible, since it is changing the gasLimit and baseFee values that people will see on the genesis block when running in eth compatibility mode. They will now see the values defined in the genesis state rather than zero.