diff --git a/simulators/ethereum/engine/suites/cancun/config.go b/simulators/ethereum/engine/suites/cancun/config.go index 6b7e993ae4..a0e1c5f06a 100644 --- a/simulators/ethereum/engine/suites/cancun/config.go +++ b/simulators/ethereum/engine/suites/cancun/config.go @@ -103,10 +103,10 @@ func (cs *CancunBaseSpec) GetGenesis() *core.Genesis { } // Add bytecode pre deploy to the EIP-4788 address. - genesis.Alloc[HISTORY_STORAGE_ADDRESS] = core.GenesisAccount{ + genesis.Alloc[BEACON_ROOTS_ADDRESS] = core.GenesisAccount{ Balance: common.Big0, Nonce: 1, - Code: common.Hex2Bytes("3373fffffffffffffffffffffffffffffffffffffffe14604457602036146024575f5ffd5b620180005f350680545f35146037575f5ffd5b6201800001545f5260205ff35b42620180004206555f3562018000420662018000015500"), + Code: common.Hex2Bytes("3373fffffffffffffffffffffffffffffffffffffffe14604457602036146024575f5ffd5b620180005f350680545f35146037575f5ffd5b6201800001545f5260205ff35b6201800042064281555f359062018000015500"), } return genesis diff --git a/simulators/ethereum/engine/suites/cancun/helpers.go b/simulators/ethereum/engine/suites/cancun/helpers.go index a19a76487b..3a1c7dc60a 100644 --- a/simulators/ethereum/engine/suites/cancun/helpers.go +++ b/simulators/ethereum/engine/suites/cancun/helpers.go @@ -131,8 +131,8 @@ func VerifyTransactionFromNode(ctx context.Context, eth client.Eth, tx typ.Trans func BeaconRootStorageIndexes(timestamp uint64) (common.Hash, common.Hash) { // Calculate keys - timestampReduced := timestamp % HISTORICAL_ROOTS_MODULUS - timestampExtended := timestampReduced + HISTORICAL_ROOTS_MODULUS + timestampReduced := timestamp % HISTORY_BUFFER_LENGTH + timestampExtended := timestampReduced + HISTORY_BUFFER_LENGTH return common.BigToHash(new(big.Int).SetUint64(timestampReduced)), common.BigToHash(new(big.Int).SetUint64(timestampExtended)) } diff --git a/simulators/ethereum/engine/suites/cancun/steps.go b/simulators/ethereum/engine/suites/cancun/steps.go index 2951140ee9..15e1e06f19 100644 --- a/simulators/ethereum/engine/suites/cancun/steps.go +++ b/simulators/ethereum/engine/suites/cancun/steps.go @@ -259,7 +259,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 := HISTORY_STORAGE_ADDRESS + precompileAddress := BEACON_ROOTS_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 87f79eb38c..419bea2af8 100644 --- a/simulators/ethereum/engine/suites/cancun/tests.go +++ b/simulators/ethereum/engine/suites/cancun/tests.go @@ -30,8 +30,8 @@ var ( BLOB_COMMITMENT_VERSION_KZG = byte(0x01) // EIP 4788 specific constants - HISTORY_STORAGE_ADDRESS = common.HexToAddress("0x000000000000000000000000000000000000000b") - HISTORICAL_ROOTS_MODULUS = uint64(98304) + BEACON_ROOTS_ADDRESS = common.HexToAddress("0xbEac00dDB15f3B6d645C48263dC93862413A222D") + HISTORY_BUFFER_LENGTH = uint64(98304) // Engine API errors INVALID_PARAMS_ERROR = pInt(-32602)