diff --git a/core/silkworm/chain/config.hpp b/core/silkworm/chain/config.hpp index e270641b8d..c6171525c0 100644 --- a/core/silkworm/chain/config.hpp +++ b/core/silkworm/chain/config.hpp @@ -51,9 +51,9 @@ struct ChainConfig { "berlinBlock", // EVMC_BERLIN "londonBlock", // EVMC_LONDON // there's no evmc_revision for arrowGlacierBlock, nor for grayGlacierBlock - "mergeForkBlock", // EVMC_PARIS, corresponds to FORK_NEXT_VALUE of EIP-3675 - "shanghaiBlock", // EVMC_SHANGHAI - "cancunBlock", // EVMC_CANCUN + "mergeNetsplitBlock", // EVMC_PARIS, corresponds to FORK_NEXT_VALUE of EIP-3675 + "shanghaiBlock", // EVMC_SHANGHAI + "cancunBlock", // EVMC_CANCUN }; static_assert(std::size(kJsonForkNames) == EVMC_MAX_REVISION); @@ -198,6 +198,7 @@ inline constexpr ChainConfig kGoerliConfig{ 4'460'644, // Berlin 5'062'605, // London }, + .terminal_total_difficulty = 10790000, }; inline constexpr ChainConfig kSepoliaConfig{ @@ -205,15 +206,16 @@ inline constexpr ChainConfig kSepoliaConfig{ .seal_engine = SealEngineType::kEthash, .evmc_fork_blocks = { - 0, // Homestead - 0, // Tangerine Whistle - 0, // Spurious Dragon - 0, // Byzantium - 0, // Constantinople - 0, // Petersburg - 0, // Istanbul - 0, // Berlin - 0, // London + 0, // Homestead + 0, // Tangerine Whistle + 0, // Spurious Dragon + 0, // Byzantium + 0, // Constantinople + 0, // Petersburg + 0, // Istanbul + 0, // Berlin + 0, // London + 1735371, // Merge Netsplit }, .muir_glacier_block = 0, .terminal_total_difficulty = 17000000000000000, diff --git a/core/silkworm/chain/config_test.cpp b/core/silkworm/chain/config_test.cpp index 1d1d6c7424..57aa498345 100644 --- a/core/silkworm/chain/config_test.cpp +++ b/core/silkworm/chain/config_test.cpp @@ -151,7 +151,7 @@ TEST_CASE("JSON serialization") { "terminalTotalDifficulty":"39387012740608862000000", "terminalBlockNumber":10000, "terminalBlockHash":"0x6dc57fd586f41ee340124c3a005642af7731a9ca7a7b70d989a7e2833e4ab740", - "mergeForkBlock":10000 + "mergeNetsplitBlock":10000 })"); const std::optional config2{ChainConfig::from_json(merge_test_json)}; diff --git a/core/silkworm/chain/genesis_goerli.cpp b/core/silkworm/chain/genesis_goerli.cpp index daf09b9945..8c69fbe6f7 100644 --- a/core/silkworm/chain/genesis_goerli.cpp +++ b/core/silkworm/chain/genesis_goerli.cpp @@ -1,4 +1,4 @@ -/* Generated from D:\GitHub\silkworm\db\silkworm\common\genesis_goerli.json using silkworm's genesistool*/ +/* Generated from /Users/andrew/silkworm/core/silkworm/chain/genesis_goerli.json using silkworm's genesistool*/ #include static const char genesis_goerli_data_internal[] = { 0x7b, 0x22, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x22, 0x3a, 0x7b, 0x22, 0x30, 0x30, 0x30, 0x30, 0x30, @@ -1021,80 +1021,82 @@ static const char genesis_goerli_data_internal[] = { 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x3a, 0x31, 0x35, 0x36, 0x31, 0x36, 0x35, 0x31, 0x2c, 0x22, 0x62, 0x65, 0x72, 0x6c, 0x69, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x3a, 0x34, 0x34, 0x36, 0x30, 0x36, 0x34, 0x34, 0x2c, 0x22, 0x6c, 0x6f, 0x6e, 0x64, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, -0x6b, 0x22, 0x3a, 0x35, 0x30, 0x36, 0x32, 0x36, 0x30, 0x35, 0x2c, 0x22, 0x63, 0x6c, 0x69, 0x71, -0x75, 0x65, 0x22, 0x3a, 0x7b, 0x22, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x22, 0x3a, 0x31, 0x35, -0x2c, 0x22, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x22, 0x3a, 0x20, 0x33, 0x30, 0x30, 0x30, 0x30, 0x7d, +0x6b, 0x22, 0x3a, 0x35, 0x30, 0x36, 0x32, 0x36, 0x30, 0x35, 0x2c, 0x22, 0x74, 0x65, 0x72, 0x6d, +0x69, 0x6e, 0x61, 0x6c, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, +0x6c, 0x74, 0x79, 0x22, 0x3a, 0x22, 0x31, 0x30, 0x37, 0x39, 0x30, 0x30, 0x30, 0x30, 0x22, 0x2c, +0x22, 0x63, 0x6c, 0x69, 0x71, 0x75, 0x65, 0x22, 0x3a, 0x7b, 0x22, 0x70, 0x65, 0x72, 0x69, 0x6f, +0x64, 0x22, 0x3a, 0x31, 0x35, 0x2c, 0x22, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x22, 0x3a, 0x20, 0x33, +0x30, 0x30, 0x30, 0x30, 0x7d, 0x2c, 0x22, 0x74, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x43, 0x68, +0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x22, 0x3a, 0x7b, 0x22, 0x73, 0x65, 0x63, 0x74, +0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x22, 0x3a, 0x36, 0x36, 0x2c, 0x22, 0x73, 0x65, +0x63, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x22, 0x3a, 0x22, 0x30, 0x78, 0x65, 0x65, +0x61, 0x33, 0x61, 0x37, 0x62, 0x32, 0x63, 0x62, 0x32, 0x37, 0x35, 0x39, 0x35, 0x36, 0x66, 0x33, +0x30, 0x34, 0x39, 0x64, 0x64, 0x32, 0x37, 0x65, 0x36, 0x63, 0x64, 0x61, 0x63, 0x64, 0x38, 0x61, +0x36, 0x65, 0x66, 0x38, 0x36, 0x37, 0x33, 0x38, 0x64, 0x35, 0x39, 0x33, 0x64, 0x35, 0x35, 0x36, +0x65, 0x66, 0x65, 0x65, 0x35, 0x33, 0x36, 0x31, 0x30, 0x31, 0x39, 0x34, 0x37, 0x35, 0x22, 0x2c, +0x22, 0x63, 0x68, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x3a, 0x22, 0x30, 0x78, 0x31, 0x31, 0x37, +0x31, 0x32, 0x61, 0x66, 0x35, 0x30, 0x62, 0x34, 0x30, 0x38, 0x33, 0x64, 0x63, 0x35, 0x39, 0x31, +0x30, 0x65, 0x34, 0x35, 0x32, 0x63, 0x61, 0x36, 0x39, 0x66, 0x62, 0x66, 0x63, 0x30, 0x66, 0x32, +0x39, 0x34, 0x30, 0x37, 0x37, 0x30, 0x62, 0x39, 0x38, 0x34, 0x36, 0x32, 0x30, 0x30, 0x61, 0x35, +0x37, 0x33, 0x66, 0x38, 0x37, 0x61, 0x30, 0x61, 0x66, 0x39, 0x34, 0x65, 0x36, 0x22, 0x2c, 0x22, +0x62, 0x6c, 0x6f, 0x6f, 0x6d, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x3a, 0x22, 0x30, 0x78, 0x33, 0x33, +0x31, 0x62, 0x37, 0x61, 0x37, 0x62, 0x32, 0x37, 0x33, 0x65, 0x38, 0x31, 0x64, 0x61, 0x65, 0x61, +0x63, 0x38, 0x63, 0x61, 0x66, 0x62, 0x39, 0x39, 0x35, 0x32, 0x61, 0x31, 0x36, 0x36, 0x36, 0x39, +0x64, 0x37, 0x66, 0x61, 0x63, 0x63, 0x37, 0x62, 0x65, 0x33, 0x62, 0x30, 0x65, 0x62, 0x64, 0x33, +0x61, 0x37, 0x39, 0x32, 0x62, 0x34, 0x64, 0x38, 0x62, 0x39, 0x35, 0x63, 0x63, 0x35, 0x22, 0x7d, 0x2c, 0x22, 0x74, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, -0x69, 0x6e, 0x74, 0x22, 0x3a, 0x7b, 0x22, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, -0x64, 0x65, 0x78, 0x22, 0x3a, 0x36, 0x36, 0x2c, 0x22, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, -0x48, 0x65, 0x61, 0x64, 0x22, 0x3a, 0x22, 0x30, 0x78, 0x65, 0x65, 0x61, 0x33, 0x61, 0x37, 0x62, -0x32, 0x63, 0x62, 0x32, 0x37, 0x35, 0x39, 0x35, 0x36, 0x66, 0x33, 0x30, 0x34, 0x39, 0x64, 0x64, -0x32, 0x37, 0x65, 0x36, 0x63, 0x64, 0x61, 0x63, 0x64, 0x38, 0x61, 0x36, 0x65, 0x66, 0x38, 0x36, -0x37, 0x33, 0x38, 0x64, 0x35, 0x39, 0x33, 0x64, 0x35, 0x35, 0x36, 0x65, 0x66, 0x65, 0x65, 0x35, -0x33, 0x36, 0x31, 0x30, 0x31, 0x39, 0x34, 0x37, 0x35, 0x22, 0x2c, 0x22, 0x63, 0x68, 0x74, 0x52, -0x6f, 0x6f, 0x74, 0x22, 0x3a, 0x22, 0x30, 0x78, 0x31, 0x31, 0x37, 0x31, 0x32, 0x61, 0x66, 0x35, -0x30, 0x62, 0x34, 0x30, 0x38, 0x33, 0x64, 0x63, 0x35, 0x39, 0x31, 0x30, 0x65, 0x34, 0x35, 0x32, -0x63, 0x61, 0x36, 0x39, 0x66, 0x62, 0x66, 0x63, 0x30, 0x66, 0x32, 0x39, 0x34, 0x30, 0x37, 0x37, -0x30, 0x62, 0x39, 0x38, 0x34, 0x36, 0x32, 0x30, 0x30, 0x61, 0x35, 0x37, 0x33, 0x66, 0x38, 0x37, -0x61, 0x30, 0x61, 0x66, 0x39, 0x34, 0x65, 0x36, 0x22, 0x2c, 0x22, 0x62, 0x6c, 0x6f, 0x6f, 0x6d, -0x52, 0x6f, 0x6f, 0x74, 0x22, 0x3a, 0x22, 0x30, 0x78, 0x33, 0x33, 0x31, 0x62, 0x37, 0x61, 0x37, -0x62, 0x32, 0x37, 0x33, 0x65, 0x38, 0x31, 0x64, 0x61, 0x65, 0x61, 0x63, 0x38, 0x63, 0x61, 0x66, -0x62, 0x39, 0x39, 0x35, 0x32, 0x61, 0x31, 0x36, 0x36, 0x36, 0x39, 0x64, 0x37, 0x66, 0x61, 0x63, -0x63, 0x37, 0x62, 0x65, 0x33, 0x62, 0x30, 0x65, 0x62, 0x64, 0x33, 0x61, 0x37, 0x39, 0x32, 0x62, -0x34, 0x64, 0x38, 0x62, 0x39, 0x35, 0x63, 0x63, 0x35, 0x22, 0x7d, 0x2c, 0x22, 0x74, 0x72, 0x75, -0x73, 0x74, 0x65, 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x72, -0x61, 0x63, 0x6c, 0x65, 0x22, 0x3a, 0x7b, 0x22, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, -0x3a, 0x22, 0x30, 0x78, 0x31, 0x38, 0x63, 0x61, 0x30, 0x65, 0x30, 0x34, 0x35, 0x66, 0x30, 0x64, -0x37, 0x37, 0x32, 0x61, 0x38, 0x35, 0x31, 0x62, 0x63, 0x37, 0x65, 0x34, 0x38, 0x33, 0x35, 0x37, -0x62, 0x63, 0x61, 0x61, 0x62, 0x30, 0x61, 0x30, 0x37, 0x39, 0x35, 0x64, 0x22, 0x2c, 0x22, 0x73, -0x69, 0x67, 0x6e, 0x65, 0x72, 0x73, 0x22, 0x3a, 0x5b, 0x22, 0x30, 0x78, 0x34, 0x37, 0x36, 0x39, -0x62, 0x63, 0x61, 0x64, 0x30, 0x37, 0x65, 0x33, 0x62, 0x39, 0x33, 0x38, 0x62, 0x37, 0x66, 0x34, -0x33, 0x65, 0x62, 0x37, 0x64, 0x32, 0x37, 0x38, 0x62, 0x63, 0x37, 0x63, 0x62, 0x39, 0x65, 0x66, -0x66, 0x62, 0x33, 0x38, 0x22, 0x2c, 0x22, 0x30, 0x78, 0x37, 0x38, 0x64, 0x31, 0x61, 0x64, 0x35, -0x37, 0x31, 0x61, 0x31, 0x61, 0x30, 0x39, 0x64, 0x36, 0x30, 0x64, 0x39, 0x62, 0x62, 0x66, 0x32, -0x35, 0x38, 0x39, 0x34, 0x62, 0x34, 0x34, 0x65, 0x34, 0x63, 0x38, 0x38, 0x35, 0x39, 0x35, 0x39, -0x35, 0x22, 0x2c, 0x22, 0x30, 0x78, 0x32, 0x38, 0x36, 0x38, 0x33, 0x34, 0x39, 0x33, 0x35, 0x66, -0x34, 0x61, 0x38, 0x63, 0x66, 0x62, 0x34, 0x66, 0x66, 0x34, 0x63, 0x37, 0x37, 0x64, 0x35, 0x37, -0x37, 0x30, 0x63, 0x32, 0x37, 0x37, 0x35, 0x61, 0x65, 0x32, 0x62, 0x30, 0x65, 0x37, 0x22, 0x2c, -0x22, 0x30, 0x78, 0x62, 0x38, 0x36, 0x65, 0x32, 0x62, 0x30, 0x61, 0x62, 0x35, 0x61, 0x34, 0x62, -0x31, 0x33, 0x37, 0x33, 0x65, 0x34, 0x30, 0x63, 0x35, 0x31, 0x61, 0x37, 0x63, 0x37, 0x31, 0x32, -0x63, 0x37, 0x30, 0x62, 0x61, 0x32, 0x66, 0x39, 0x66, 0x38, 0x65, 0x22, 0x2c, 0x22, 0x30, 0x78, -0x30, 0x64, 0x66, 0x38, 0x66, 0x61, 0x33, 0x38, 0x37, 0x63, 0x36, 0x30, 0x32, 0x61, 0x65, 0x36, -0x32, 0x35, 0x35, 0x39, 0x63, 0x63, 0x34, 0x61, 0x66, 0x61, 0x34, 0x39, 0x37, 0x32, 0x61, 0x37, -0x30, 0x34, 0x35, 0x64, 0x36, 0x37, 0x30, 0x37, 0x22, 0x5d, 0x2c, 0x22, 0x74, 0x68, 0x72, 0x65, -0x73, 0x68, 0x6f, 0x6c, 0x64, 0x22, 0x3a, 0x20, 0x32, 0x7d, 0x7d, 0x2c, 0x22, 0x64, 0x69, 0x66, -0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x22, 0x3a, 0x22, 0x30, 0x78, 0x31, 0x22, 0x2c, 0x22, -0x65, 0x78, 0x74, 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x22, 0x3a, 0x22, 0x30, 0x78, 0x32, 0x32, -0x34, 0x36, 0x36, 0x63, 0x36, 0x35, 0x37, 0x38, 0x36, 0x39, 0x32, 0x30, 0x36, 0x39, 0x37, 0x33, -0x32, 0x30, 0x36, 0x31, 0x32, 0x30, 0x37, 0x34, 0x36, 0x38, 0x36, 0x39, 0x36, 0x65, 0x36, 0x37, -0x32, 0x32, 0x32, 0x30, 0x32, 0x64, 0x32, 0x30, 0x34, 0x31, 0x36, 0x36, 0x37, 0x32, 0x36, 0x39, -0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x65, 0x30, -0x61, 0x32, 0x62, 0x64, 0x34, 0x32, 0x35, 0x38, 0x64, 0x32, 0x37, 0x36, 0x38, 0x38, 0x33, 0x37, -0x62, 0x61, 0x61, 0x32, 0x36, 0x61, 0x32, 0x38, 0x66, 0x65, 0x37, 0x31, 0x64, 0x63, 0x30, 0x37, -0x39, 0x66, 0x38, 0x34, 0x63, 0x37, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, -0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, -0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, -0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, -0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, -0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, -0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, -0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, -0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x22, 0x2c, 0x22, 0x67, 0x61, 0x73, 0x4c, 0x69, -0x6d, 0x69, 0x74, 0x22, 0x3a, 0x22, 0x30, 0x78, 0x61, 0x30, 0x30, 0x30, 0x30, 0x30, 0x22, 0x2c, -0x22, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x22, 0x3a, 0x22, 0x30, 0x78, 0x30, 0x22, 0x2c, -0x22, 0x6d, 0x69, 0x78, 0x48, 0x61, 0x73, 0x68, 0x22, 0x3a, 0x22, 0x30, 0x78, 0x30, 0x30, 0x30, +0x69, 0x6e, 0x74, 0x4f, 0x72, 0x61, 0x63, 0x6c, 0x65, 0x22, 0x3a, 0x7b, 0x22, 0x61, 0x64, 0x64, +0x72, 0x65, 0x73, 0x73, 0x22, 0x3a, 0x22, 0x30, 0x78, 0x31, 0x38, 0x63, 0x61, 0x30, 0x65, 0x30, +0x34, 0x35, 0x66, 0x30, 0x64, 0x37, 0x37, 0x32, 0x61, 0x38, 0x35, 0x31, 0x62, 0x63, 0x37, 0x65, +0x34, 0x38, 0x33, 0x35, 0x37, 0x62, 0x63, 0x61, 0x61, 0x62, 0x30, 0x61, 0x30, 0x37, 0x39, 0x35, +0x64, 0x22, 0x2c, 0x22, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x73, 0x22, 0x3a, 0x5b, 0x22, 0x30, +0x78, 0x34, 0x37, 0x36, 0x39, 0x62, 0x63, 0x61, 0x64, 0x30, 0x37, 0x65, 0x33, 0x62, 0x39, 0x33, +0x38, 0x62, 0x37, 0x66, 0x34, 0x33, 0x65, 0x62, 0x37, 0x64, 0x32, 0x37, 0x38, 0x62, 0x63, 0x37, +0x63, 0x62, 0x39, 0x65, 0x66, 0x66, 0x62, 0x33, 0x38, 0x22, 0x2c, 0x22, 0x30, 0x78, 0x37, 0x38, +0x64, 0x31, 0x61, 0x64, 0x35, 0x37, 0x31, 0x61, 0x31, 0x61, 0x30, 0x39, 0x64, 0x36, 0x30, 0x64, +0x39, 0x62, 0x62, 0x66, 0x32, 0x35, 0x38, 0x39, 0x34, 0x62, 0x34, 0x34, 0x65, 0x34, 0x63, 0x38, +0x38, 0x35, 0x39, 0x35, 0x39, 0x35, 0x22, 0x2c, 0x22, 0x30, 0x78, 0x32, 0x38, 0x36, 0x38, 0x33, +0x34, 0x39, 0x33, 0x35, 0x66, 0x34, 0x61, 0x38, 0x63, 0x66, 0x62, 0x34, 0x66, 0x66, 0x34, 0x63, +0x37, 0x37, 0x64, 0x35, 0x37, 0x37, 0x30, 0x63, 0x32, 0x37, 0x37, 0x35, 0x61, 0x65, 0x32, 0x62, +0x30, 0x65, 0x37, 0x22, 0x2c, 0x22, 0x30, 0x78, 0x62, 0x38, 0x36, 0x65, 0x32, 0x62, 0x30, 0x61, +0x62, 0x35, 0x61, 0x34, 0x62, 0x31, 0x33, 0x37, 0x33, 0x65, 0x34, 0x30, 0x63, 0x35, 0x31, 0x61, +0x37, 0x63, 0x37, 0x31, 0x32, 0x63, 0x37, 0x30, 0x62, 0x61, 0x32, 0x66, 0x39, 0x66, 0x38, 0x65, +0x22, 0x2c, 0x22, 0x30, 0x78, 0x30, 0x64, 0x66, 0x38, 0x66, 0x61, 0x33, 0x38, 0x37, 0x63, 0x36, +0x30, 0x32, 0x61, 0x65, 0x36, 0x32, 0x35, 0x35, 0x39, 0x63, 0x63, 0x34, 0x61, 0x66, 0x61, 0x34, +0x39, 0x37, 0x32, 0x61, 0x37, 0x30, 0x34, 0x35, 0x64, 0x36, 0x37, 0x30, 0x37, 0x22, 0x5d, 0x2c, +0x22, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x22, 0x3a, 0x20, 0x32, 0x7d, 0x7d, +0x2c, 0x22, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x22, 0x3a, 0x22, 0x30, +0x78, 0x31, 0x22, 0x2c, 0x22, 0x65, 0x78, 0x74, 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x22, 0x3a, +0x22, 0x30, 0x78, 0x32, 0x32, 0x34, 0x36, 0x36, 0x63, 0x36, 0x35, 0x37, 0x38, 0x36, 0x39, 0x32, +0x30, 0x36, 0x39, 0x37, 0x33, 0x32, 0x30, 0x36, 0x31, 0x32, 0x30, 0x37, 0x34, 0x36, 0x38, 0x36, +0x39, 0x36, 0x65, 0x36, 0x37, 0x32, 0x32, 0x32, 0x30, 0x32, 0x64, 0x32, 0x30, 0x34, 0x31, 0x36, +0x36, 0x37, 0x32, 0x36, 0x39, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x65, 0x30, 0x61, 0x32, 0x62, 0x64, 0x34, 0x32, 0x35, 0x38, 0x64, 0x32, 0x37, +0x36, 0x38, 0x38, 0x33, 0x37, 0x62, 0x61, 0x61, 0x32, 0x36, 0x61, 0x32, 0x38, 0x66, 0x65, 0x37, +0x31, 0x64, 0x63, 0x30, 0x37, 0x39, 0x66, 0x38, 0x34, 0x63, 0x37, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x22, 0x2c, 0x22, -0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x22, 0x3a, 0x22, 0x30, 0x78, 0x30, 0x22, 0x2c, 0x22, 0x6e, 0x75, -0x6d, 0x62, 0x65, 0x72, 0x22, 0x3a, 0x22, 0x30, 0x78, 0x30, 0x22, 0x2c, 0x22, 0x70, 0x61, 0x72, -0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x22, 0x3a, 0x22, 0x30, 0x78, 0x30, 0x30, 0x30, 0x30, +0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x3a, 0x22, 0x30, 0x78, 0x61, 0x30, 0x30, +0x30, 0x30, 0x30, 0x22, 0x2c, 0x22, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x22, 0x3a, 0x22, +0x30, 0x78, 0x30, 0x22, 0x2c, 0x22, 0x6d, 0x69, 0x78, 0x48, 0x61, 0x73, 0x68, 0x22, 0x3a, 0x22, +0x30, 0x78, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, +0x30, 0x30, 0x22, 0x2c, 0x22, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x22, 0x3a, 0x22, 0x30, 0x78, 0x30, +0x22, 0x2c, 0x22, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x3a, 0x22, 0x30, 0x78, 0x30, 0x22, +0x2c, 0x22, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x22, 0x3a, 0x22, 0x30, +0x78, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, -0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x22, 0x2c, 0x22, 0x74, -0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x3a, 0x22, 0x30, 0x78, 0x35, 0x63, 0x35, -0x31, 0x61, 0x36, 0x30, 0x37, 0x22, 0x7d }; +0x30, 0x22, 0x2c, 0x22, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x3a, 0x22, +0x30, 0x78, 0x35, 0x63, 0x35, 0x31, 0x61, 0x36, 0x30, 0x37, 0x22, 0x7d }; const char* genesis_goerli_data(void){return &genesis_goerli_data_internal[0];} size_t sizeof_genesis_goerli_data(void){return sizeof(genesis_goerli_data_internal);} diff --git a/core/silkworm/chain/genesis_goerli.json b/core/silkworm/chain/genesis_goerli.json index f504f439ca..f2c61e8bb9 100644 --- a/core/silkworm/chain/genesis_goerli.json +++ b/core/silkworm/chain/genesis_goerli.json @@ -796,6 +796,7 @@ "istanbulBlock": 1561651, "berlinBlock": 4460644, "londonBlock": 5062605, + "terminalTotalDifficulty": "10790000", "clique": { "period": 15, "epoch": 30000 @@ -827,4 +828,4 @@ "number": "0x0", "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "timestamp": "0x5c51a607" -} \ No newline at end of file +} diff --git a/core/silkworm/chain/genesis_sepolia.cpp b/core/silkworm/chain/genesis_sepolia.cpp index ba27d838a3..12a05fb83f 100644 --- a/core/silkworm/chain/genesis_sepolia.cpp +++ b/core/silkworm/chain/genesis_sepolia.cpp @@ -98,20 +98,22 @@ static const char genesis_sepolia_data_internal[] = { 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x3a, 0x30, 0x2c, 0x22, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x22, 0x3a, 0x22, 0x31, 0x37, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, -0x30, 0x30, 0x30, 0x30, 0x30, 0x22, 0x2c, 0x22, 0x65, 0x74, 0x68, 0x61, 0x73, 0x68, 0x22, 0x3a, -0x7b, 0x7d, 0x7d, 0x2c, 0x22, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x22, -0x3a, 0x22, 0x30, 0x78, 0x32, 0x30, 0x30, 0x30, 0x30, 0x22, 0x2c, 0x22, 0x65, 0x78, 0x74, 0x72, -0x61, 0x44, 0x61, 0x74, 0x61, 0x22, 0x3a, 0x22, 0x53, 0x65, 0x70, 0x6f, 0x6c, 0x69, 0x61, 0x2c, -0x20, 0x41, 0x74, 0x68, 0x65, 0x6e, 0x73, 0x2c, 0x20, 0x41, 0x74, 0x74, 0x69, 0x63, 0x61, 0x2c, -0x20, 0x47, 0x72, 0x65, 0x65, 0x63, 0x65, 0x21, 0x22, 0x2c, 0x22, 0x67, 0x61, 0x73, 0x4c, 0x69, -0x6d, 0x69, 0x74, 0x22, 0x3a, 0x22, 0x30, 0x78, 0x31, 0x43, 0x39, 0x43, 0x33, 0x38, 0x30, 0x22, -0x2c, 0x22, 0x6d, 0x69, 0x78, 0x48, 0x61, 0x73, 0x68, 0x22, 0x3a, 0x22, 0x30, 0x78, 0x30, 0x30, +0x30, 0x30, 0x30, 0x30, 0x30, 0x22, 0x2c, 0x22, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x4e, 0x65, 0x74, +0x73, 0x70, 0x6c, 0x69, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x3a, 0x31, 0x37, 0x33, 0x35, +0x33, 0x37, 0x31, 0x2c, 0x22, 0x65, 0x74, 0x68, 0x61, 0x73, 0x68, 0x22, 0x3a, 0x7b, 0x7d, 0x7d, +0x2c, 0x22, 0x64, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x22, 0x3a, 0x22, 0x30, +0x78, 0x32, 0x30, 0x30, 0x30, 0x30, 0x22, 0x2c, 0x22, 0x65, 0x78, 0x74, 0x72, 0x61, 0x44, 0x61, +0x74, 0x61, 0x22, 0x3a, 0x22, 0x53, 0x65, 0x70, 0x6f, 0x6c, 0x69, 0x61, 0x2c, 0x20, 0x41, 0x74, +0x68, 0x65, 0x6e, 0x73, 0x2c, 0x20, 0x41, 0x74, 0x74, 0x69, 0x63, 0x61, 0x2c, 0x20, 0x47, 0x72, +0x65, 0x65, 0x63, 0x65, 0x21, 0x22, 0x2c, 0x22, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, +0x22, 0x3a, 0x22, 0x30, 0x78, 0x31, 0x43, 0x39, 0x43, 0x33, 0x38, 0x30, 0x22, 0x2c, 0x22, 0x6d, +0x69, 0x78, 0x48, 0x61, 0x73, 0x68, 0x22, 0x3a, 0x22, 0x30, 0x78, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, -0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x22, 0x2c, -0x22, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x22, 0x3a, 0x22, 0x30, 0x78, 0x30, 0x22, 0x2c, 0x22, 0x74, -0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x3a, 0x22, 0x30, 0x78, 0x36, 0x31, 0x35, -0x39, 0x41, 0x46, 0x31, 0x39, 0x22, 0x7d }; +0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x22, 0x2c, 0x22, 0x6e, 0x6f, +0x6e, 0x63, 0x65, 0x22, 0x3a, 0x22, 0x30, 0x78, 0x30, 0x22, 0x2c, 0x22, 0x74, 0x69, 0x6d, 0x65, +0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x3a, 0x22, 0x30, 0x78, 0x36, 0x31, 0x35, 0x39, 0x41, 0x46, +0x31, 0x39, 0x22, 0x7d }; const char* genesis_sepolia_data(void){return &genesis_sepolia_data_internal[0];} size_t sizeof_genesis_sepolia_data(void){return sizeof(genesis_sepolia_data_internal);} diff --git a/core/silkworm/chain/genesis_sepolia.json b/core/silkworm/chain/genesis_sepolia.json index fdb960fe4c..97c27fae52 100644 --- a/core/silkworm/chain/genesis_sepolia.json +++ b/core/silkworm/chain/genesis_sepolia.json @@ -60,6 +60,7 @@ "berlinBlock": 0, "londonBlock": 0, "terminalTotalDifficulty": "17000000000000000", + "mergeNetsplitBlock": 1735371, "ethash": {} }, "difficulty": "0x20000", diff --git a/core/silkworm/consensus/engine.cpp b/core/silkworm/consensus/engine.cpp index c25e1f0165..763736d189 100644 --- a/core/silkworm/consensus/engine.cpp +++ b/core/silkworm/consensus/engine.cpp @@ -78,18 +78,28 @@ ValidationResult pre_validate_transaction(const Transaction& txn, uint64_t block return ValidationResult::kOk; } -std::unique_ptr engine_factory(const ChainConfig& chain_config) { - if (chain_config.terminal_total_difficulty.has_value()) { - return std::make_unique(chain_config); - } - +static std::unique_ptr pre_merge_engine(const ChainConfig& chain_config) { switch (chain_config.seal_engine) { case SealEngineType::kEthash: return std::make_unique(chain_config); case SealEngineType::kNoProof: return std::make_unique(chain_config); default: - return {}; + return nullptr; + } +} + +std::unique_ptr engine_factory(const ChainConfig& chain_config) { + std::unique_ptr engine{pre_merge_engine(chain_config)}; + if (!engine) { + return nullptr; + } + + if (chain_config.terminal_total_difficulty.has_value()) { + // TODO(yperbasis): refactor MergeEngine to wrap pre_merge_engine + return std::make_unique(chain_config); + } else { + return engine; } }