From 3afd3ca27ece2f9b63132b794a25a40914d1bded Mon Sep 17 00:00:00 2001 From: Sally MacFarlane Date: Wed, 27 Sep 2023 01:43:23 +1000 Subject: [PATCH] updated beacon root and modulus to match DRAFT eip (#5941) Signed-off-by: Sally MacFarlane --- .../ethereum/mainnet/ParentBeaconBlockRootHelper.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ParentBeaconBlockRootHelper.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ParentBeaconBlockRootHelper.java index 5bae221bcfd..80eb7a19e9f 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ParentBeaconBlockRootHelper.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ParentBeaconBlockRootHelper.java @@ -25,17 +25,17 @@ public interface ParentBeaconBlockRootHelper { // Modulus to use for the timestamp to store the root - public static final long HISTORICAL_ROOTS_MODULUS = 98304; + public static final long HISTORY_BUFFER_LENGTH = 8191; public static final Address BEACON_ROOTS_ADDRESS = - Address.fromHexString("0xbEAC020008aFF7331c0A389CB2AAb67597567d7a"); + Address.fromHexString("0x000F3df6D732807Ef1319fB7B8bB8522d0Beac02"); static void storeParentBeaconBlockRoot( final WorldUpdater worldUpdater, final long timestamp, final Bytes32 root) { /* see EIP-4788: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-4788.md */ - final long timestampReduced = timestamp % HISTORICAL_ROOTS_MODULUS; - final long timestampExtended = timestampReduced + HISTORICAL_ROOTS_MODULUS; + final long timestampReduced = timestamp % HISTORY_BUFFER_LENGTH; + final long timestampExtended = timestampReduced + HISTORY_BUFFER_LENGTH; final UInt256 timestampIndex = UInt256.valueOf(timestampReduced); final UInt256 rootIndex = UInt256.valueOf(timestampExtended);