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

`mycelo genesis` gingerbread activation fix #2169

Closed palango closed 1 year ago

palango commented 1 year ago

Description

Fixes gingerbread activation in mycelo.

This results in this genesis config, instead of gingerbreadBlock not being set:

[...]
   "churritoBlock": 0,
   "donutBlock": 0,
   "espressoBlock": 0,
   "gingerbreadBlock": 1,
[...]
github-actions[bot] commented 1 year ago

5861 passed, 1 failed, 45 skipped

Test failures:
  TestTransactionPoolUnderpricing: core
timestamp=2023-08-22T00:36:33+0000 severity=debug   msg="Registering method handler"            method=getAddressFor
timestamp=2023-08-22T00:36:33+0000 severity=debug   msg="Registering method handler"            method=blockGasLimit
timestamp=2023-08-22T00:36:33+0000 severity=debug   msg="Registering method handler"            method=getUptimeLookbackWindow
timestamp=2023-08-22T00:36:33+0000 severity=debug   msg="Registering method handler"            method=intrinsicGasForAlternativeFeeCurrency
timestamp=2023-08-22T00:36:33+0000 severity=debug   msg="EVM call successful"                   to=0x000000000000000000000000000000000000ce10 method=getAddressFor                         input=0xdd9272338b91d837e1684f7353d73b6197230894243cf869282f722841df96b441303f37 output=0x0000000000000000000000000000000000000000000000000000000000000001
timestamp=2023-08-22T00:36:33+0000 severity=debug   msg="EVM call successful"                   to=0x0000000000000000000000000000000000000001 method=blockGasLimit                         input=0x7877a797 output=0x0000000000000000000000000000000000000000000000000000000001312d00
tx_pool_test.go:1929: failed to add well priced transaction: txpool is full
timestamp=2023-08-22T00:36:34+0000 severity=info    msg="Transaction pool stopped"
This test report was produced by the test-summary action.  Made with ❤️ in Cambridge.
codecov[bot] commented 1 year ago

Codecov Report

Patch coverage has no change and project coverage change: +0.14% :tada:

Comparison is base (df29f4c) 55.08% compared to head (4b8818f) 55.23%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2169 +/- ## ========================================== + Coverage 55.08% 55.23% +0.14% ========================================== Files 678 678 Lines 114321 114321 ========================================== + Hits 62978 63141 +163 + Misses 47448 47316 -132 + Partials 3895 3864 -31 ``` [see 34 files with indirect coverage changes](https://app.codecov.io/gh/celo-org/celo-blockchain/pull/2169/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: Have feedback on the report? Share it here.

github-actions[bot] commented 1 year ago

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

coverage: 46.8% of statements across all listed packages
coverage:  57.2% of statements in consensus/istanbul
coverage:  23.7% of statements in consensus/istanbul/announce
coverage:  54.3% 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.8% of statements in consensus/istanbul/core
coverage:  45.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
gastonponti commented 1 year ago

We have 2 things there 1) the zero as disabled in the core contract 2) the way we have to set the base fee for the specific block of the hardfork

For 1), I didn't wanted to change the logic of what the other team was auditing nor add some hacky ways as infinite o something similar just because of a contract limitation

For 2), the way to calculate the block N depends on the block N-1, and the activation block, is the one that instead of using the block N-1, consumes the state at the beginning of the block So, if we activate the block in the genesis, it means that the block 1 will rely on searching the baseFee on the genesis, and, I didn't wanted to avoid adding the baseFee in the genesis block If starts with 1, it's going to search for the state already set in the genesis, and will work as it should

I thought that it was not going to generate any issue, mostly because the chain construction starts at block 1, so technically, any block is constructed as gingerbread, but maybe I should have explained it better

gastonponti commented 1 year ago

Unit tests are passing but are flaky in github actions