Handle forks that require a predefined contract in the state at genesis #244
Labels
question
Further information is requested
scope:forks
Scope: Changes ethereum_test_forks package
type:feat
type: Feature
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:
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 fillingalloc
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
The text was updated successfully, but these errors were encountered: