celo-org / celo-blockchain

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

Fix: RPC calls (gasLimit, gasPrice) use the intial state of the block #2161

Closed gastonponti closed 1 year ago

gastonponti commented 1 year ago

Description

The RPC calls to the gasPriceMinimum and blockLimit (also ethCompatibility flag) before the gingerbreadFork (also the gasPrice for alternative currencies after the fork) require to read state from the block, but instead of reading the state from the beginning of the block, both were using the state of the end of the block This means that the gasPrice/gasLimit of the block N that the client was sending, was actually the gasPrice/gasLimit of the block N+1

Tested

Run tests/e2e

Backwards compatibility

Yes

github-actions[bot] commented 1 year ago
5856 passed, 45 skipped
codecov[bot] commented 1 year ago

Codecov Report

Patch coverage has no change and project coverage change: +0.11 :tada:

Comparison is base (b1bba65) 55.19% compared to head (40bcf46) 55.31%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2161 +/- ## ========================================== + Coverage 55.19% 55.31% +0.11% ========================================== Files 676 676 Lines 113888 113927 +39 ========================================== + Hits 62862 63016 +154 + Misses 47172 47070 -102 + Partials 3854 3841 -13 ``` | [Impacted Files](https://app.codecov.io/gh/celo-org/celo-blockchain/pull/2161?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=celo-org) | Coverage Δ | | |---|---|---| | [eth/api\_backend.go](https://app.codecov.io/gh/celo-org/celo-blockchain/pull/2161?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=celo-org#diff-ZXRoL2FwaV9iYWNrZW5kLmdv) | `0.00% <0.00%> (ø)` | | | [les/api\_backend.go](https://app.codecov.io/gh/celo-org/celo-blockchain/pull/2161?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=celo-org#diff-bGVzL2FwaV9iYWNrZW5kLmdv) | `0.00% <0.00%> (ø)` | | ... and [36 files with indirect coverage changes](https://app.codecov.io/gh/celo-org/celo-blockchain/pull/2161/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=celo-org)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

github-actions[bot] commented 1 year ago

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

coverage: 50.2% of statements across all listed packages
coverage:  60.2% of statements in consensus/istanbul
coverage:  43.1% 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:  64.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.4% 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