Skip to content
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

Handle forks that require a predefined contract in the state at genesis #244

Closed
marioevz opened this issue Aug 7, 2023 · 2 comments
Closed
Labels
question Further information is requested scope:forks Scope: Changes ethereum_test_forks package type:feat type: Feature

Comments

@marioevz
Copy link
Member

marioevz commented Aug 7, 2023

Starting from Cancun fork, it is possible that EIP 4788 will require bytecode at a predefined address that contains the logic to retrieve the beacon root for the users, and this account will be called by a system transaction at the beginning of each block.

For our tests it is important that this account is added automatically for tests at genesis because, currently, every test defines the entirety of the alloc dictionary for the tests, but it seems like this could set for a scenario where this expected account with the EIP 4788 logic could be forgotten to be included by the test writer, resulting in potentially unexpected behavior from clients.

I have two potential solutions for this:

  1. We add an alloc function to the forks, and before cancun it returns {}, after cancun it returns {"0x000..0b": {"code": "0x1234..."..., and this is appended to every test automatically while filling
  2. We add a default alloc that:
    a) all tests must inherit and build upon (This still could be forgotten by test writers)
    b) is automatically appended during BlockchainTest and StateTest genesis generation
@danceratopz danceratopz added question Further information is requested scope:forks Scope: Changes ethereum_test_forks package type:feat type: Feature labels Sep 26, 2023
@danceratopz
Copy link
Member

@marioevz: Solved using 1. in #246, as far as I can tell?

@marioevz
Copy link
Member Author

Yes that is correct, closing 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested scope:forks Scope: Changes ethereum_test_forks package type:feat type: Feature
Projects
None yet
Development

No branches or pull requests

2 participants