From 2f60f62f077339fbc5d22cebaa0c396c0d64f84a Mon Sep 17 00:00:00 2001 From: garyschulte Date: Mon, 1 Nov 2021 14:44:37 -0700 Subject: [PATCH] Quarterly release branch update and cherry-pick (#2983) Signed-off-by: garyschulte --- CHANGELOG.md | 32 +++++++++- .../org/hyperledger/besu/ForkIdsTest.java | 7 ++- .../besu/config/GenesisConfigOptions.java | 3 +- .../besu/config/JsonGenesisConfigOptions.java | 26 ++------ .../besu/config/StubGenesisConfigOptions.java | 21 ++++--- config/src/main/resources/mainnet.json | 1 + .../besu/config/GenesisConfigOptionsTest.java | 9 ++- config/src/test/resources/all_forks.json | 2 +- .../mainnet/MainnetDifficultyCalculators.java | 6 ++ .../mainnet/MainnetProtocolSpecFactory.java | 12 ++++ .../mainnet/MainnetProtocolSpecs.java | 20 +++++++ .../mainnet/ProtocolScheduleBuilder.java | 5 ++ .../mainnet/MainnetProtocolScheduleTest.java | 4 +- .../besu/ethereum/eth/ForkIdTestUtil.java | 14 +++-- .../ethereum/eth/manager/EIP2124Test.java | 60 +++++++++++++++++-- .../ReferenceTestProtocolSchedules.java | 3 +- .../retesteth/methods/TestSetChainParams.java | 3 +- 17 files changed, 171 insertions(+), 57 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c897b9baf1..82efa168ce7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,15 +1,45 @@ # Changelog -## 21.10.0-RC4 +## 21.10.0 ### Additions and Improvements +- The EVM has been factored out into a standalone module, suitable for inclusion as a library. [#2790](https://github.com/hyperledger/besu/pull/2790) +- Low level performance improvements changes to cut worst-case EVM performance in half. [#2796](https://github.com/hyperledger/besu/pull/2796) +- Migrate `ExceptionalHaltReason` from an enum to an interface to allow downstream users of the EVM to add new exceptional halt reasons. [#2810](https://github.com/hyperledger/besu/pull/2810) +- reduces need for JUMPDEST analysis via caching [#2607](https://github.com/hyperledger/besu/pull/2821) +- Add support for custom private key file for public-key export and public-key export-address commands [#2801](https://github.com/hyperledger/besu/pull/2801) +- Add CLI autocomplete scripts. [#2854](https://github.com/hyperledger/besu/pull/2854) +- Added support for PKCS11 keystore on PKI Block Creation. [#2865](https://github.com/hyperledger/besu/pull/2865) +- add support for ArrowGlacier hardfork [#2943](https://github.com/hyperledger/besu/issues/2943) ### Bug Fixes +- Allow BESU_CONFIG_FILE environment to specify TOML file [#2455](https://github.com/hyperledger/besu/issues/2455) +- Fix bug with private contracts not able to call public contracts that call public contracts [#2816](https://github.com/hyperledger/besu/pull/2816) +- Fixes the exit condition for loading a BonsaiPersistedWorldState for a sibling block of the last one persisted [#2967](https://github.com/hyperledger/besu/pull/2967) +- Fixes bonsai getMutable regression affecting fast-sync [#2934](https://github.com/hyperledger/besu/pull/2934) +- Regression in RC1 involving LogOperation and frame memory overwrites [#2908](https://github.com/hyperledger/besu/pull/2908) +- Allow `eth_call` and `eth_estimateGas` to accept contract address as sender. [#2891](https://github.com/hyperledger/besu/pull/2891) - Fixes the exit condition for loading a BonsaiPersistedWorldState for a sibling block of the last one persisted [#2967](https://github.com/hyperledger/besu/pull/2967) - Fixes bonsai getMutable regression affecting fast-sync [#2934](https://github.com/hyperledger/besu/pull/2934) ### Early Access Features +- Enable plugins to expose custom JSON-RPC / WebSocket methods [#1317](https://github.com/hyperledger/besu/issues/1317) + +### Download Link + + +## 21.10.0-RC4 + +### Additions and Improvements +### Bug Fixes +- Fixes the exit condition for loading a BonsaiPersistedWorldState for a sibling block of the last one persisted [#2967](https://github.com/hyperledger/besu/pull/2967) +- Fixes bonsai getMutable regression affecting fast-sync [#2934](https://github.com/hyperledger/besu/pull/2934) + +### Early Access Features +### Download Link +https://hyperledger.jfrog.io/native/besu-binaries/besu/21.10.0-RC4/besu-21.10.0-RC4.zip \ +SHA256: b16e15764b8bc06c5c3f9f19bc8b99fa48e7894aa5a6ccdad65da49bbf564793 ## 21.10.0-RC3 diff --git a/besu/src/test/java/org/hyperledger/besu/ForkIdsTest.java b/besu/src/test/java/org/hyperledger/besu/ForkIdsTest.java index ef42c4162c0..aba0dd6841a 100644 --- a/besu/src/test/java/org/hyperledger/besu/ForkIdsTest.java +++ b/besu/src/test/java/org/hyperledger/besu/ForkIdsTest.java @@ -108,9 +108,10 @@ public static Collection parameters() { new ForkId(Bytes.ofUnsignedInt(0x668db0afL), 9069000L), new ForkId(Bytes.ofUnsignedInt(0x879d6e30L), 9200000L), new ForkId(Bytes.ofUnsignedInt(0xe029e991L), 12244000L), - new ForkId(Bytes.ofUnsignedInt(0xeb440f6L), 12965000), - new ForkId(Bytes.ofUnsignedInt(0xb715077dL), 0L), - new ForkId(Bytes.ofUnsignedInt(0xb715077dL), 0L)) + new ForkId(Bytes.ofUnsignedInt(0xeb440f6L), 12965000L), + new ForkId(Bytes.ofUnsignedInt(0xb715077dL), 13773000L), + new ForkId(Bytes.ofUnsignedInt(0x20c327fc), 0L), + new ForkId(Bytes.ofUnsignedInt(0x20c327fc), 0L)) }, new Object[] { NetworkName.MORDOR, diff --git a/config/src/main/java/org/hyperledger/besu/config/GenesisConfigOptions.java b/config/src/main/java/org/hyperledger/besu/config/GenesisConfigOptions.java index 2b98dabb329..7e7edb2b197 100644 --- a/config/src/main/java/org/hyperledger/besu/config/GenesisConfigOptions.java +++ b/config/src/main/java/org/hyperledger/besu/config/GenesisConfigOptions.java @@ -71,8 +71,7 @@ public interface GenesisConfigOptions { OptionalLong getLondonBlockNumber(); - // TODO EIP-1559 change for the actual fork name when known - OptionalLong getAleutBlockNumber(); + OptionalLong getArrowGlacierBlockNumber(); OptionalLong getEIP1559BlockNumber(); diff --git a/config/src/main/java/org/hyperledger/besu/config/JsonGenesisConfigOptions.java b/config/src/main/java/org/hyperledger/besu/config/JsonGenesisConfigOptions.java index acad2c0b380..3c6f8bdd40b 100644 --- a/config/src/main/java/org/hyperledger/besu/config/JsonGenesisConfigOptions.java +++ b/config/src/main/java/org/hyperledger/besu/config/JsonGenesisConfigOptions.java @@ -252,31 +252,17 @@ public OptionalLong getBerlinBlockNumber() { @Override public OptionalLong getLondonBlockNumber() { - final OptionalLong londonBlock = getOptionalLong("londonblock"); - final OptionalLong calaverasblock = getOptionalLong("calaverasblock"); - if (calaverasblock.isPresent()) { - if (londonBlock.isPresent()) { - throw new RuntimeException( - "Genesis files cannot specify both londonblock and calaverasblock."); - } - return calaverasblock; - } - return londonBlock; + return getOptionalLong("londonblock"); } @Override - public OptionalLong getAleutBlockNumber() { - return getOptionalLong("aleutblock"); + public OptionalLong getArrowGlacierBlockNumber() { + return getOptionalLong("arrowglacierblock"); } @Override - // TODO EIP-1559 change for the actual fork name when known public OptionalLong getEIP1559BlockNumber() { - if (getAleutBlockNumber().isPresent()) { - return getAleutBlockNumber(); - } else { - return getLondonBlockNumber(); - } + return getLondonBlockNumber(); } @Override @@ -405,7 +391,7 @@ public Map asMap() { getMuirGlacierBlockNumber().ifPresent(l -> builder.put("muirGlacierBlock", l)); getBerlinBlockNumber().ifPresent(l -> builder.put("berlinBlock", l)); getLondonBlockNumber().ifPresent(l -> builder.put("londonBlock", l)); - getAleutBlockNumber().ifPresent(l -> builder.put("aleutBlock", l)); + getArrowGlacierBlockNumber().ifPresent(l -> builder.put("arrowGlacierBlock", l)); // classic fork blocks getClassicForkBlock().ifPresent(l -> builder.put("classicForkBlock", l)); @@ -507,7 +493,7 @@ public List getForks() { getMuirGlacierBlockNumber(), getBerlinBlockNumber(), getLondonBlockNumber(), - getAleutBlockNumber(), + getArrowGlacierBlockNumber(), getEcip1015BlockNumber(), getDieHardBlockNumber(), getGothamBlockNumber(), diff --git a/config/src/main/java/org/hyperledger/besu/config/StubGenesisConfigOptions.java b/config/src/main/java/org/hyperledger/besu/config/StubGenesisConfigOptions.java index 66dbb5bf47c..6a6b9947945 100644 --- a/config/src/main/java/org/hyperledger/besu/config/StubGenesisConfigOptions.java +++ b/config/src/main/java/org/hyperledger/besu/config/StubGenesisConfigOptions.java @@ -37,9 +37,8 @@ public class StubGenesisConfigOptions implements GenesisConfigOptions { private OptionalLong muirGlacierBlockNumber = OptionalLong.empty(); private OptionalLong berlinBlockNumber = OptionalLong.empty(); private OptionalLong londonBlockNumber = OptionalLong.empty(); + private OptionalLong arrowGlacierBlockNumber = OptionalLong.empty(); - // TODO EIP-1559 change for the actual fork name when known - private final OptionalLong aleutBlockNumber = OptionalLong.empty(); private OptionalLong classicForkBlock = OptionalLong.empty(); private OptionalLong ecip1015BlockNumber = OptionalLong.empty(); private OptionalLong diehardBlockNumber = OptionalLong.empty(); @@ -180,18 +179,13 @@ public OptionalLong getLondonBlockNumber() { } @Override - // TODO EIP-1559 change for the actual fork name when known - public OptionalLong getAleutBlockNumber() { - return aleutBlockNumber; + public OptionalLong getArrowGlacierBlockNumber() { + return arrowGlacierBlockNumber; } @Override public OptionalLong getEIP1559BlockNumber() { - if (getAleutBlockNumber().isPresent()) { - return getAleutBlockNumber(); - } else { - return getLondonBlockNumber(); - } + return getLondonBlockNumber(); } @Override @@ -294,7 +288,7 @@ public Map asMap() { getMuirGlacierBlockNumber().ifPresent(l -> builder.put("muirGlacierBlock", l)); getBerlinBlockNumber().ifPresent(l -> builder.put("berlinBlock", l)); getLondonBlockNumber().ifPresent(l -> builder.put("londonBlock", l)); - getAleutBlockNumber().ifPresent(l -> builder.put("aleutBlock", l)); + getArrowGlacierBlockNumber().ifPresent(l -> builder.put("arrowGlacierBlock", l)); // classic fork blocks getClassicForkBlock().ifPresent(l -> builder.put("classicForkBlock", l)); getEcip1015BlockNumber().ifPresent(l -> builder.put("ecip1015Block", l)); @@ -415,6 +409,11 @@ public StubGenesisConfigOptions londonBlock(final long blockNumber) { return this; } + public StubGenesisConfigOptions arrowGlacierBlock(final long blockNumber) { + arrowGlacierBlockNumber = OptionalLong.of(blockNumber); + return this; + } + public StubGenesisConfigOptions classicForkBlock(final long blockNumber) { classicForkBlock = OptionalLong.of(blockNumber); return this; diff --git a/config/src/main/resources/mainnet.json b/config/src/main/resources/mainnet.json index 848cda74912..220fdf70adc 100644 --- a/config/src/main/resources/mainnet.json +++ b/config/src/main/resources/mainnet.json @@ -11,6 +11,7 @@ "muirGlacierBlock": 9200000, "berlinBlock": 12244000, "londonBlock": 12965000, + "arrowGlacierBlock": 13773000, "ethash": { } }, diff --git a/config/src/test/java/org/hyperledger/besu/config/GenesisConfigOptionsTest.java b/config/src/test/java/org/hyperledger/besu/config/GenesisConfigOptionsTest.java index ce97367fdc7..c2793cfff1f 100644 --- a/config/src/test/java/org/hyperledger/besu/config/GenesisConfigOptionsTest.java +++ b/config/src/test/java/org/hyperledger/besu/config/GenesisConfigOptionsTest.java @@ -186,10 +186,9 @@ public void shouldGetLondonBlockNumber() { } @Test - public void shouldGetBaikalBlockNumber() { - final GenesisConfigOptions config = fromConfigOptions(singletonMap("calaverasblock", 1000)); - assertThat(config.getEIP1559BlockNumber()).hasValue(1000); - assertThat(config.getLondonBlockNumber()).hasValue(1000); + public void shouldGetArrowGlacierBlockNumber() { + final GenesisConfigOptions config = fromConfigOptions(singletonMap("arrowGlacierBlock", 1000)); + assertThat(config.getArrowGlacierBlockNumber()).hasValue(1000); } @Test @@ -213,7 +212,7 @@ public void shouldNotReturnEmptyOptionalWhenBlockNumberNotSpecified() { assertThat(config.getMuirGlacierBlockNumber()).isEmpty(); assertThat(config.getBerlinBlockNumber()).isEmpty(); assertThat(config.getLondonBlockNumber()).isEmpty(); - assertThat(config.getAleutBlockNumber()).isEmpty(); + assertThat(config.getArrowGlacierBlockNumber()).isEmpty(); assertThat(config.getEcip1049BlockNumber()).isEmpty(); } diff --git a/config/src/test/resources/all_forks.json b/config/src/test/resources/all_forks.json index 1fdf24a5b35..27ae1390263 100644 --- a/config/src/test/resources/all_forks.json +++ b/config/src/test/resources/all_forks.json @@ -11,7 +11,7 @@ "muirGlacierBlock": 9, "berlinBlock": 10, "londonBlock": 11, - "aleutBlock": 99, + "arrowGlacierBlock": 12, "ecip1015Block": 102, "dieHardBlock": 103, "gothamBlock": 104, diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetDifficultyCalculators.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetDifficultyCalculators.java index 3a00b6360b3..ffac7a4c9c9 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetDifficultyCalculators.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetDifficultyCalculators.java @@ -40,6 +40,7 @@ public abstract class MainnetDifficultyCalculators { private static final long CONSTANTINOPLE_FAKE_BLOCK_OFFSET = 4_999_999L; private static final long MUIR_GLACIER_FAKE_BLOCK_OFFSET = 8_999_999L; private static final long LONDON_FAKE_BLOCK_OFFSET = 9_699_999L; + private static final long ARROW_GLACIER_FAKE_BLOCK_OFFSET = 10_699_999L; private MainnetDifficultyCalculators() {} @@ -88,6 +89,11 @@ private MainnetDifficultyCalculators() {} (time, parent, protocolContext) -> calculateThawedDifficulty(time, parent, LONDON_FAKE_BLOCK_OFFSET); + // As per https://eips.ethereum.org/EIPS/eip-4345 + static DifficultyCalculator ARROW_GLACIER = + (time, parent, protocolContext) -> + calculateThawedDifficulty(time, parent, ARROW_GLACIER_FAKE_BLOCK_OFFSET); + private static BigInteger calculateThawedDifficulty( final long time, final BlockHeader parent, final long fakeBlockOffset) { final BigInteger parentDifficulty = difficulty(parent.getDifficulty()); diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetProtocolSpecFactory.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetProtocolSpecFactory.java index 434aa74153e..0a82811fa3d 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetProtocolSpecFactory.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetProtocolSpecFactory.java @@ -150,6 +150,18 @@ public ProtocolSpecBuilder londonDefinition(final GenesisConfigOptions genesisCo evmConfiguration); } + public ProtocolSpecBuilder arrowGlacierDefinition( + final GenesisConfigOptions genesisConfigOptions) { + return MainnetProtocolSpecs.arrowGlacierDefinition( + chainId, + contractSizeLimit, + evmStackSize, + isRevertReasonEnabled, + genesisConfigOptions, + quorumCompatibilityMode, + evmConfiguration); + } + //////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////// // Classic Protocol Specs diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetProtocolSpecs.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetProtocolSpecs.java index 39e3628cb6d..999ccafb371 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetProtocolSpecs.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/MainnetProtocolSpecs.java @@ -568,6 +568,26 @@ static ProtocolSpecBuilder londonDefinition( .name(LONDON_FORK_NAME); } + static ProtocolSpecBuilder arrowGlacierDefinition( + final Optional chainId, + final OptionalInt configContractSizeLimit, + final OptionalInt configStackSizeLimit, + final boolean enableRevertReason, + final GenesisConfigOptions genesisConfigOptions, + final boolean quorumCompatibilityMode, + final EvmConfiguration evmConfiguration) { + return londonDefinition( + chainId, + configContractSizeLimit, + configStackSizeLimit, + enableRevertReason, + genesisConfigOptions, + quorumCompatibilityMode, + evmConfiguration) + .difficultyCalculator(MainnetDifficultyCalculators.ARROW_GLACIER) + .name("ArrowGlacier"); + } + private static TransactionReceipt frontierTransactionReceiptFactory( // ignored because it's always FRONTIER final TransactionType __, diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ProtocolScheduleBuilder.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ProtocolScheduleBuilder.java index b0738851227..173789046b8 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ProtocolScheduleBuilder.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/ProtocolScheduleBuilder.java @@ -232,6 +232,9 @@ private TreeMap buildMilestoneMap( create(config.getMuirGlacierBlockNumber(), specFactory.muirGlacierDefinition()), create(config.getBerlinBlockNumber(), specFactory.berlinDefinition()), create(config.getLondonBlockNumber(), specFactory.londonDefinition(config)), + create( + config.getArrowGlacierBlockNumber(), + specFactory.arrowGlacierDefinition(config)), // Classic Milestones create(config.getEcip1015BlockNumber(), specFactory.tangerineWhistleDefinition()), create(config.getDieHardBlockNumber(), specFactory.dieHardDefinition()), @@ -319,6 +322,8 @@ private void validateEthereumForkOrdering() { validateForkOrder("MuirGlacier", config.getMuirGlacierBlockNumber(), lastForkBlock); lastForkBlock = validateForkOrder("Berlin", config.getBerlinBlockNumber(), lastForkBlock); lastForkBlock = validateForkOrder("London", config.getLondonBlockNumber(), lastForkBlock); + lastForkBlock = + validateForkOrder("ArrowGlacier", config.getArrowGlacierBlockNumber(), lastForkBlock); assert (lastForkBlock >= 0); } diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetProtocolScheduleTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetProtocolScheduleTest.java index 09de0efe939..dc202c64286 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetProtocolScheduleTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/MainnetProtocolScheduleTest.java @@ -47,7 +47,9 @@ public void shouldReturnDefaultProtocolSpecsWhenCustomNumbersAreNotUsed() { Assertions.assertThat(sched.getByBlockNumber(9_200_000L).getName()).isEqualTo("MuirGlacier"); Assertions.assertThat(sched.getByBlockNumber(12_244_000L).getName()).isEqualTo("Berlin"); Assertions.assertThat(sched.getByBlockNumber(12_965_000L).getName()).isEqualTo("London"); - Assertions.assertThat(sched.getByBlockNumber(Long.MAX_VALUE).getName()).isEqualTo("London"); + Assertions.assertThat(sched.getByBlockNumber(13_773_000L).getName()).isEqualTo("ArrowGlacier"); + Assertions.assertThat(sched.getByBlockNumber(Long.MAX_VALUE).getName()) + .isEqualTo("ArrowGlacier"); } @Test diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/ForkIdTestUtil.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/ForkIdTestUtil.java index ee766da075c..924878fd246 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/ForkIdTestUtil.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/ForkIdTestUtil.java @@ -64,7 +64,7 @@ public static class Forks { public static final List MAINNET = Arrays.asList( 1920000L, 1150000L, 2463000L, 2675000L, 2675000L, 4370000L, 7280000L, 7280000L, - 9069000L, 9200000L); + 9069000L, 9200000L, 12244000L, 12965000L, 13773000L); public static final List ROPSTEN = Arrays.asList(0L, 0L, 10L, 1700000L, 4230000L, 4939394L, 6485846L, 7117117L); public static final List RINKEBY = @@ -76,15 +76,19 @@ public static class Forks { public static class ForkIds { public static final List MAINNET = Arrays.asList( - new ForkId(Bytes.fromHexString("0xfc64ec04"), 1150000L), // Unsynced + new ForkId( + Bytes.fromHexString("0xfc64ec04"), 1150000L), // Unsynced / last Frontier block new ForkId(Bytes.fromHexString("0x97c2c34c"), 1920000L), // First Homestead block new ForkId(Bytes.fromHexString("0x91d1f948"), 2463000L), // First DAO block new ForkId(Bytes.fromHexString("0x7a64da13"), 2675000L), // First Tangerine block new ForkId(Bytes.fromHexString("0x3edd5b10"), 4370000L), // First Spurious block new ForkId(Bytes.fromHexString("0xa00bc324"), 7280000L), // First Byzantium block - new ForkId(Bytes.fromHexString("0x668db0af"), 9069000L), - new ForkId(Bytes.fromHexString("0x879d6e30"), 9200000L), - new ForkId(Bytes.fromHexString("0xe029e991"), 0L)); + new ForkId(Bytes.fromHexString("0x668db0af"), 9069000L), // First Petersburg block + new ForkId(Bytes.fromHexString("0x879d6e30"), 9200000L), // First Istanbul block + new ForkId(Bytes.fromHexString("0xe029e991"), 12244000L), // First Muir Glacier block + new ForkId(Bytes.fromHexString("0x0eb440f6"), 12965000L), // First Berlin block + new ForkId(Bytes.fromHexString("0xb715077d"), 13773000L), // First London block + new ForkId(Bytes.fromHexString("0x20c327fc"), 0L)); // First Arrow Glacier block public static final List ROPSTEN = Arrays.asList( new ForkId(Bytes.fromHexString("0x30c7ddbc"), 10L), diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/EIP2124Test.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/EIP2124Test.java index 17506d7c397..861f4b006ec 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/EIP2124Test.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/EIP2124Test.java @@ -153,7 +153,7 @@ public static Collection data() { empty() }, { - "Mainnet // First Istanbul and first Muir Glacier block", + "Mainnet // First Istanbul block", Network.MAINNET, 9069000L, ForkIdTestUtil.wantForkId("0x879d6e30", 9200000L), @@ -161,7 +161,7 @@ public static Collection data() { empty() }, { - "Mainnet // Last Istanbul and first Muir Glacier block", + "Mainnet // Last Istanbul block", Network.MAINNET, 9199999L, ForkIdTestUtil.wantForkId("0x879d6e30", 9200000L), @@ -172,15 +172,63 @@ public static Collection data() { "Mainnet // First Muir Glacier block", Network.MAINNET, 9200000L, - ForkIdTestUtil.wantForkId("0xe029e991", 0L), + ForkIdTestUtil.wantForkId("0xe029e991", 12244000L), Optional.of(ForkIds.MAINNET), empty() }, { - "Mainnet // Future Muir Glacier block", + "Mainnet // Last Muir Glacier block", Network.MAINNET, - 10000000L, - ForkIdTestUtil.wantForkId("0xe029e991", 0L), + 12243999L, + ForkIdTestUtil.wantForkId("0xe029e991", 12244000L), + Optional.of(ForkIds.MAINNET), + empty() + }, + { + "Mainnet // First Berlin block", + Network.MAINNET, + 12244000L, + ForkIdTestUtil.wantForkId("0x0eb440f6", 12965000L), + Optional.of(ForkIds.MAINNET), + empty() + }, + { + "Mainnet // Last Berlin block", + Network.MAINNET, + 12964999L, + ForkIdTestUtil.wantForkId("0x0eb440f6", 12965000L), + Optional.of(ForkIds.MAINNET), + empty() + }, + { + "Mainnet // First London block", + Network.MAINNET, + 12965000L, + ForkIdTestUtil.wantForkId("0xb715077d", 13773000L), + Optional.of(ForkIds.MAINNET), + empty() + }, + { + "Mainnet // Last London block", + Network.MAINNET, + 13772999L, + ForkIdTestUtil.wantForkId("0xb715077d", 13773000L), + Optional.of(ForkIds.MAINNET), + empty() + }, + { + "Mainnet // First Arrow Glacier block", + Network.MAINNET, + 13773000L, + ForkIdTestUtil.wantForkId("0x20c327fc", 0L), + Optional.of(ForkIds.MAINNET), + empty() + }, + { + "Mainnet // Future Arrow Glacier block", + Network.MAINNET, + 20000000L, + ForkIdTestUtil.wantForkId("0x20c327fc", 0L), Optional.of(ForkIds.MAINNET), empty() }, diff --git a/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/ReferenceTestProtocolSchedules.java b/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/ReferenceTestProtocolSchedules.java index 15287e39d6c..0dc1af29514 100644 --- a/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/ReferenceTestProtocolSchedules.java +++ b/ethereum/referencetests/src/main/java/org/hyperledger/besu/ethereum/referencetests/ReferenceTestProtocolSchedules.java @@ -65,7 +65,8 @@ public static ReferenceTestProtocolSchedules create() { builder.put("MuirGlacier", createSchedule(new StubGenesisConfigOptions().muirGlacierBlock(0))); builder.put("Berlin", createSchedule(new StubGenesisConfigOptions().berlinBlock(0))); builder.put("London", createSchedule(new StubGenesisConfigOptions().londonBlock(0))); - builder.put("Baikal", createSchedule(new StubGenesisConfigOptions().londonBlock(0))); + builder.put( + "ArrowGlacier", createSchedule(new StubGenesisConfigOptions().arrowGlacierBlock(0))); return new ReferenceTestProtocolSchedules(builder.build()); } diff --git a/ethereum/retesteth/src/main/java/org/hyperledger/besu/ethereum/retesteth/methods/TestSetChainParams.java b/ethereum/retesteth/src/main/java/org/hyperledger/besu/ethereum/retesteth/methods/TestSetChainParams.java index d52009d60e5..f68f9182b63 100644 --- a/ethereum/retesteth/src/main/java/org/hyperledger/besu/ethereum/retesteth/methods/TestSetChainParams.java +++ b/ethereum/retesteth/src/main/java/org/hyperledger/besu/ethereum/retesteth/methods/TestSetChainParams.java @@ -122,6 +122,8 @@ private static String modifyGenesisFile(final String initialGenesis) { maybeMoveToNumber(params, "istanbulForkBlock", config, "istanbulBlock"); maybeMoveToNumber(params, "muirGlacierForkBlock", config, "muirGlacierBlock"); maybeMoveToNumber(params, "berlinForkBlock", config, "berlinBlock"); + maybeMoveToNumber(params, "londonForkBlock", config, "londonBlock"); + maybeMoveToNumber(params, "arrowGlacierForkBlock", config, "arrowGlacierBlock"); maybeMoveToNumber(params, "chainID", config, "chainId", 1); maybeMove(genesis, "author", chainParamsJson, "coinbase"); @@ -133,7 +135,6 @@ private static String modifyGenesisFile(final String initialGenesis) { maybeMove(genesis, "timestamp", chainParamsJson, "timestamp"); maybeMove(chainParamsJson, "accounts", chainParamsJson, "alloc"); maybeMove(genesis, "baseFeePerGas", chainParamsJson, "baseFeePerGas"); - maybeMoveToNumber(params, "londonForkBlock", config, "londonBlock"); // strip out precompiles with zero balance final JsonObject alloc = chainParamsJson.getJsonObject("alloc");