From c23eb24325fcad62ef8c5c986549b97e45044323 Mon Sep 17 00:00:00 2001 From: Justin Florentine Date: Thu, 8 Feb 2024 20:17:10 -0500 Subject: [PATCH] timestamp set for dencun on mainnet. (#6545) * timestamp set for dencun on mainnet, lfg. --------- Signed-off-by: Justin Florentine --- .../org/hyperledger/besu/ForkIdsNetworkConfigTest.java | 5 +++-- config/src/main/resources/mainnet.json | 1 + .../besu/ethereum/mainnet/DifficultyCalculatorTests.java | 7 ++++++- .../evm/precompile/KZGPointEvalPrecompiledContract.java | 2 -- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/besu/src/test/java/org/hyperledger/besu/ForkIdsNetworkConfigTest.java b/besu/src/test/java/org/hyperledger/besu/ForkIdsNetworkConfigTest.java index a6c0c4919c8..c6657345077 100644 --- a/besu/src/test/java/org/hyperledger/besu/ForkIdsNetworkConfigTest.java +++ b/besu/src/test/java/org/hyperledger/besu/ForkIdsNetworkConfigTest.java @@ -107,8 +107,9 @@ public static Collection parameters() { new ForkId(Bytes.ofUnsignedInt(0xb715077dL), 13773000L), new ForkId(Bytes.ofUnsignedInt(0x20c327fcL), 15050000L), new ForkId(Bytes.ofUnsignedInt(0xf0afd0e3L), 1681338455L), - new ForkId(Bytes.ofUnsignedInt(0xdce96c2dL), 0L), - new ForkId(Bytes.ofUnsignedInt(0xdce96c2dL), 0L)) + new ForkId(Bytes.ofUnsignedInt(0xdce96c2dL), 1710338135L), + new ForkId(Bytes.ofUnsignedInt(0x9f3d2254L), 0L), + new ForkId(Bytes.ofUnsignedInt(0x9f3d2254L), 0L)) }, new Object[] { NetworkName.MORDOR, diff --git a/config/src/main/resources/mainnet.json b/config/src/main/resources/mainnet.json index 645ddb09d47..ab35a5aba35 100644 --- a/config/src/main/resources/mainnet.json +++ b/config/src/main/resources/mainnet.json @@ -15,6 +15,7 @@ "grayGlacierBlock": 15050000, "terminalTotalDifficulty": 58750000000000000000000, "shanghaiTime": 1681338455, + "cancunTime": 1710338135, "ethash": { }, "discovery": { diff --git a/ethereum/referencetests/src/reference-test/java/org/hyperledger/besu/ethereum/mainnet/DifficultyCalculatorTests.java b/ethereum/referencetests/src/reference-test/java/org/hyperledger/besu/ethereum/mainnet/DifficultyCalculatorTests.java index da9bcda0b14..fd2616a9c23 100644 --- a/ethereum/referencetests/src/reference-test/java/org/hyperledger/besu/ethereum/mainnet/DifficultyCalculatorTests.java +++ b/ethereum/referencetests/src/reference-test/java/org/hyperledger/besu/ethereum/mainnet/DifficultyCalculatorTests.java @@ -31,6 +31,8 @@ import java.io.IOException; import java.nio.charset.StandardCharsets; +import java.util.Collections; +import java.util.HashMap; import java.util.Map; import java.util.stream.Stream; @@ -46,12 +48,15 @@ public class DifficultyCalculatorTests { public static Stream getTestParametersForConfig() throws IOException { + Map postMergeOverrides = new HashMap<>(); + postMergeOverrides.put("shanghaiTime", "999999999999"); + postMergeOverrides.put("cancunTime","999999999999"); return Stream.of( Arguments.of( "/BasicTests/difficultyMainNetwork.json", MainnetProtocolSchedule.fromConfig( GenesisConfigFile.mainnet() - .getConfigOptions(Map.of("shanghaiTime", "999999999999")), + .getConfigOptions(postMergeOverrides), EvmConfiguration.DEFAULT)), Arguments.of( "/DifficultyTests/dfGrayGlacier/difficultyGrayGlacierForkBlock.json", diff --git a/evm/src/main/java/org/hyperledger/besu/evm/precompile/KZGPointEvalPrecompiledContract.java b/evm/src/main/java/org/hyperledger/besu/evm/precompile/KZGPointEvalPrecompiledContract.java index 25968d67b1d..ded0da3ef5f 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/precompile/KZGPointEvalPrecompiledContract.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/precompile/KZGPointEvalPrecompiledContract.java @@ -79,8 +79,6 @@ public static void init() { "Loading network trusted setup from classpath resource {}", trustedSetupResourceName); CKZG4844JNI.loadTrustedSetupFromResource( trustedSetupResourceName, KZGPointEvalPrecompiledContract.class); - } else { - throw new IllegalStateException("KZG trusted setup was already loaded"); } }