celo-org / celo-blockchain

Official repository for the golang Celo Blockchain
https://celo.org
GNU Lesser General Public License v3.0
554 stars 199 forks source link

Hardcode pre gingerbread block gas limits for existing chains #2 #2229

Closed piersy closed 7 months ago

piersy commented 7 months ago

Note that this duplicates #2216 because we force reverted master after #2216 was merged.

Description

Ensures that for mainnet, alfajores and baklava, nodes will return the correct block gas limit up to the gingerbread fork even if they are not archive nodes when running in eth compatibility mode (I.E. --disablerpcethcompatibility is not set). More detail can be found here:

Other changes

A small re-factor of GetBlockByNumber and GetBlockByHash to reduce the depth of nesting.

Tested

CI is passing

Related issues

Backwards compatibility

This change is not backwards compatible with the previous implementations on mainnet, alfajores or baklava which would have returned a zero gas limit for a block if there was no state for that block.

github-actions[bot] commented 7 months ago

Coverage from tests in ./e2e_test/... for ./consensus/istanbul/... at commit 0a9662f1c1d24918858ce4aa65acbef87dd0e05a

coverage: 50.6% of statements across all listed packages
coverage:  63.4% of statements in consensus/istanbul
coverage:  42.7% of statements in consensus/istanbul/announce
coverage:  55.8% 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:  64.2% 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
github-actions[bot] commented 7 months ago
5891 passed, 45 skipped
codecov[bot] commented 7 months ago

Codecov Report

Attention: 53 lines in your changes are missing coverage. Please review.

Comparison is base (8f49d7e) 55.06% compared to head (790f80e) 55.05%.

Files Patch % Lines
internal/ethapi/api.go 0.00% 44 Missing :warning:
params/gas_limts.go 0.00% 9 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2229 +/- ## ========================================== - Coverage 55.06% 55.05% -0.01% ========================================== Files 683 684 +1 Lines 114577 114596 +19 ========================================== Hits 63095 63095 - Misses 47578 47606 +28 + Partials 3904 3895 -9 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.