diff --git a/simulators/ethereum/engine/suites/cancun/config.go b/simulators/ethereum/engine/suites/cancun/config.go index c626d9020a..d845ff3471 100644 --- a/simulators/ethereum/engine/suites/cancun/config.go +++ b/simulators/ethereum/engine/suites/cancun/config.go @@ -92,10 +92,11 @@ func (bs *CancunBaseSpec) GetGenesis() *core.Genesis { } } - // Add 1 wei to the 4788 stateful precompile so its account is not deleted at the end of - // block execution. - genesis.Alloc[common.BigToAddress(new(big.Int).SetUint64(uint64(HISTORY_STORAGE_ADDRESS)))] = core.GenesisAccount{ - Balance: big.NewInt(1), + // Add bytecode pre deploy to the EIP-4788 address. + genesis.Alloc[HISTORY_STORAGE_ADDRESS] = core.GenesisAccount{ + Balance: common.Big0, + Nonce: 1, + Code: common.Hex2Bytes("0x3373fffffffffffffffffffffffffffffffffffffffe14604457602036146024575f5ffd5b620180005f350680545f35146037575f5ffd5b6201800001545f5260205ff35b42620180004206555f3562018000420662018000015500"), } return genesis diff --git a/simulators/ethereum/engine/suites/cancun/steps.go b/simulators/ethereum/engine/suites/cancun/steps.go index 20192e4528..c5d4c098f1 100644 --- a/simulators/ethereum/engine/suites/cancun/steps.go +++ b/simulators/ethereum/engine/suites/cancun/steps.go @@ -258,7 +258,7 @@ func VerifyBeaconRootStorage(ctx context.Context, testEngine *test.TestEngineCli // Read the storage keys from the stateful precompile that stores the beacon roots and verify // that the beacon root is the same as the one in the payload blockNumber := new(big.Int).SetUint64(payload.Number) - precompileAddress := common.BytesToAddress([]byte{HISTORY_STORAGE_ADDRESS}) + precompileAddress := HISTORY_STORAGE_ADDRESS timestampKey, beaconRootKey := BeaconRootStorageIndexes(payload.Timestamp) diff --git a/simulators/ethereum/engine/suites/cancun/tests.go b/simulators/ethereum/engine/suites/cancun/tests.go index 7e06a5841c..e87b7f7988 100644 --- a/simulators/ethereum/engine/suites/cancun/tests.go +++ b/simulators/ethereum/engine/suites/cancun/tests.go @@ -31,7 +31,7 @@ var ( BLOB_COMMITMENT_VERSION_KZG = byte(0x01) // EIP 4788 specific constants - HISTORY_STORAGE_ADDRESS = uint8(0x0B) + HISTORY_STORAGE_ADDRESS = common.HexToAddress("0x000000000000000000000000000000000000000b") HISTORICAL_ROOTS_MODULUS = uint64(98304) // Engine API errors