From e64bee7033c6d74cb53323b703cb573a739cd9dd Mon Sep 17 00:00:00 2001 From: Ahmad Bitar <33181301+smartprogrammer93@users.noreply.github.com> Date: Mon, 22 Jan 2024 17:48:13 +0300 Subject: [PATCH] Sepolia and Holesky Cancun spec and config (#6571) --- src/Nethermind/Chains/holesky.json | 5 +++++ src/Nethermind/Chains/sepolia.json | 7 ++++++- .../Nethermind.Network.Test/ForkInfoTests.cs | 15 ++++++++++----- .../Nethermind.Runner.Test/ConfigFilesTests.cs | 14 +++++++------- .../Nethermind.Runner/configs/chiado.cfg | 6 +++++- .../Nethermind.Runner/configs/chiado_archive.cfg | 8 ++++++-- .../Nethermind.Runner/configs/holesky.cfg | 4 ++++ .../Nethermind.Runner/configs/holesky_archive.cfg | 4 ++++ .../Nethermind.Runner/configs/sepolia.cfg | 5 +++-- .../Nethermind.Runner/configs/sepolia_archive.cfg | 3 ++- .../ChainSpecBasedSpecProviderTests.cs | 8 ++++++-- .../Nethermind.Specs/HoleskySpecProvider.cs | 8 ++++---- .../Nethermind.Specs/SepoliaSpecProvider.cs | 11 +++++++---- 13 files changed, 69 insertions(+), 29 deletions(-) diff --git a/src/Nethermind/Chains/holesky.json b/src/Nethermind/Chains/holesky.json index a06501a813c..a5effdc1d96 100644 --- a/src/Nethermind/Chains/holesky.json +++ b/src/Nethermind/Chains/holesky.json @@ -39,6 +39,11 @@ "eip3855TransitionTimestamp": "0x6516eac0", "eip3860TransitionTimestamp": "0x6516eac0", "eip4895TransitionTimestamp": "0x6516eac0", + "eip1153TransitionTimestamp": "0x65C36AC0", + "eip4788TransitionTimestamp": "0x65C36AC0", + "eip4844TransitionTimestamp": "0x65C36AC0", + "eip5656TransitionTimestamp": "0x65C36AC0", + "eip6780TransitionTimestamp": "0x65C36AC0", "terminalTotalDifficulty": "0x0", "gasLimitBoundDivisor": "0x400", "maxCodeSize": "0x6000", diff --git a/src/Nethermind/Chains/sepolia.json b/src/Nethermind/Chains/sepolia.json index d8f6741582d..957fdfb0f01 100644 --- a/src/Nethermind/Chains/sepolia.json +++ b/src/Nethermind/Chains/sepolia.json @@ -60,7 +60,12 @@ "eip4895TransitionTimestamp": "0x63FD7D60", "eip3855TransitionTimestamp": "0x63FD7D60", "eip3651TransitionTimestamp": "0x63FD7D60", - "eip3860TransitionTimestamp": "0x63FD7D60" + "eip3860TransitionTimestamp": "0x63FD7D60", + "eip1153TransitionTimestamp": "0x65B97D60", + "eip4788TransitionTimestamp": "0x65B97D60", + "eip4844TransitionTimestamp": "0x65B97D60", + "eip5656TransitionTimestamp": "0x65B97D60", + "eip6780TransitionTimestamp": "0x65B97D60" }, "genesis": { "seal": { diff --git a/src/Nethermind/Nethermind.Network.Test/ForkInfoTests.cs b/src/Nethermind/Nethermind.Network.Test/ForkInfoTests.cs index c262c59599a..cba87a1b979 100644 --- a/src/Nethermind/Nethermind.Network.Test/ForkInfoTests.cs +++ b/src/Nethermind/Nethermind.Network.Test/ForkInfoTests.cs @@ -118,17 +118,22 @@ public void Fork_id_and_hash_as_expected_on_goerli(long head, ulong headTimestam [TestCase(0, 0ul, "0xc61a6098", 1_696_000_704ul, "Unsynced")] [TestCase(1, 1_696_000_703ul, "0xc61a6098", 1_696_000_704ul, "Last genesis spec block")] - [TestCase(2, 1_696_000_704ul, "0xfd4f016b", 0ul, "First Shanghai block")] + [TestCase(2, 1_696_000_704ul, "0xfd4f016b", 1_707_305_664ul, "First Shanghai block")] + [TestCase(3, 1_707_305_663ul, "0xfd4f016b", 1_707_305_664ul, "Future Shanghai timestamp")] + [TestCase(4, 1_707_305_664ul, "0x9b192ad0", 0ul, "First Cancun timestamp")] + [TestCase(5, 1_717_305_664ul, "0x9b192ad0", 0ul, "Future Cancun timestamp")] public void Fork_id_and_hash_as_expected_on_holesky(long head, ulong headTimestamp, string forkHashHex, ulong next, string description) { Test(head, headTimestamp, KnownHashes.HoleskyGenesis, forkHashHex, next, description, HoleskySpecProvider.Instance, "holesky.json"); } [TestCase(0, 0ul, "0xFE3366E7", 1735371ul, "Sepolia genesis")] - [TestCase(1735370, 0ul, "0xFE3366E7", 1735371ul, "Sepolia Last block before MergeForkIdTranstion")] - [TestCase(1735371, 0ul, "0xb96cbd13", 1677557088UL, "First block - Sepolia MergeForkIdTransition")] - [TestCase(1735372, 1677557088ul, "0xf7f9bc08", 0ul, "Shanghai")] - [TestCase(1735372, 2677557088ul, "0xf7f9bc08", 0ul, "Future Shanghai")] + [TestCase(1735370, 0ul, "0xFE3366E7", 1_735_371ul, "Sepolia Last block before MergeForkIdTranstion")] + [TestCase(1735371, 0ul, "0xb96cbd13", 1_677_557_088ul, "First block - Sepolia MergeForkIdTransition")] + [TestCase(1735372, 1_677_557_088ul, "0xf7f9bc08", 1_706_655_072ul, "Shanghai")] + [TestCase(1735372, 1_706_655_071ul, "0xf7f9bc08", 1_706_655_072ul, "Future Shanghai")] + [TestCase(1735373, 1_706_655_072ul, "0x88cf81d9", 0ul, "First Cancun timestamp")] + [TestCase(1735374, 1_716_655_072ul, "0x88cf81d9", 0ul, "Future Cancun timestamp")] public void Fork_id_and_hash_as_expected_on_sepolia(long head, ulong headTimestamp, string forkHashHex, ulong next, string description) { Test(head, headTimestamp, KnownHashes.SepoliaGenesis, forkHashHex, next, description, SepoliaSpecProvider.Instance, "sepolia.json"); diff --git a/src/Nethermind/Nethermind.Runner.Test/ConfigFilesTests.cs b/src/Nethermind/Nethermind.Runner.Test/ConfigFilesTests.cs index f6ed7ececdd..c1c9e2d716c 100644 --- a/src/Nethermind/Nethermind.Runner.Test/ConfigFilesTests.cs +++ b/src/Nethermind/Nethermind.Runner.Test/ConfigFilesTests.cs @@ -189,12 +189,13 @@ public void Network_diag_tracer_disabled_by_default(string configWildcard) } [TestCase("mainnet", 2048)] - [TestCase("holesky", 2048)] + [TestCase("holesky", 1024)] + [TestCase("sepolia", 1024)] [TestCase("gnosis", 2048)] [TestCase("poacore", 2048)] [TestCase("energy", 2048)] - [TestCase("chiado", 2048)] - [TestCase("^mainnet ^holesky ^spaceneth ^volta ^energy ^poacore ^gnosis ^chiado", 1024)] + [TestCase("chiado", 1024)] + [TestCase("^mainnet ^spaceneth ^volta ^energy ^poacore ^gnosis ^chiado", 1024)] [TestCase("spaceneth", 128)] public void Tx_pool_defaults_are_correct(string configWildcard, int poolSize) { @@ -327,11 +328,10 @@ public void Basic_configs_are_as_expected(string configWildcard, bool isProducti } [TestCase("goerli", BlobsSupportMode.StorageWithReorgs)] - [TestCase("^goerli", BlobsSupportMode.Disabled)] - [TestCase("sepolia", BlobsSupportMode.Disabled)] - [TestCase("holesky", BlobsSupportMode.Disabled)] + [TestCase("sepolia", BlobsSupportMode.StorageWithReorgs)] + [TestCase("holesky", BlobsSupportMode.StorageWithReorgs)] + [TestCase("chiado", BlobsSupportMode.StorageWithReorgs)] [TestCase("mainnet", BlobsSupportMode.Disabled)] - [TestCase("chiado", BlobsSupportMode.Disabled)] [TestCase("gnosis", BlobsSupportMode.Disabled)] public void Blob_txs_support_is_correct(string configWildcard, BlobsSupportMode blobsSupportMode) { diff --git a/src/Nethermind/Nethermind.Runner/configs/chiado.cfg b/src/Nethermind/Nethermind.Runner/configs/chiado.cfg index bf562a4a091..5ce75687135 100644 --- a/src/Nethermind/Nethermind.Runner/configs/chiado.cfg +++ b/src/Nethermind/Nethermind.Runner/configs/chiado.cfg @@ -5,6 +5,10 @@ "BaseDbPath": "nethermind_db/chiado", "LogFileName": "chiado.logs.txt" }, + "TxPool": { + "Size": 1024, + "BlobsSupport": "StorageWithReorgs" + }, "JsonRpc": { "Enabled": true, "Port": 8545, @@ -40,4 +44,4 @@ 16 ] } -} \ No newline at end of file +} diff --git a/src/Nethermind/Nethermind.Runner/configs/chiado_archive.cfg b/src/Nethermind/Nethermind.Runner/configs/chiado_archive.cfg index df8b66020c0..982406d8043 100644 --- a/src/Nethermind/Nethermind.Runner/configs/chiado_archive.cfg +++ b/src/Nethermind/Nethermind.Runner/configs/chiado_archive.cfg @@ -2,9 +2,13 @@ "Init": { "MemoryHint": 768000000, "ChainSpecPath": "chainspec/chiado.json", - "BaseDbPath": "nethermind_db/chiado_archive", + "BaseDbPath": "nethermind_db/chiado_archive", "LogFileName": "chiado_archive.logs.txt" }, + "TxPool": { + "Size": 1024, + "BlobsSupport": "StorageWithReorgs" + }, "JsonRpc": { "Enabled": true, "Port": 8545, @@ -44,6 +48,6 @@ "Mode": "None" }, "Merge": { - "FinalTotalDifficulty": "231708131825107706987652208063906496124457284" + "FinalTotalDifficulty": "231708131825107706987652208063906496124457284" } } diff --git a/src/Nethermind/Nethermind.Runner/configs/holesky.cfg b/src/Nethermind/Nethermind.Runner/configs/holesky.cfg index 819128ed83c..eeddcdda65c 100644 --- a/src/Nethermind/Nethermind.Runner/configs/holesky.cfg +++ b/src/Nethermind/Nethermind.Runner/configs/holesky.cfg @@ -5,6 +5,10 @@ "BaseDbPath": "nethermind_db/holesky", "LogFileName": "holesky.logs.txt" }, + "TxPool": { + "Size": 1024, + "BlobsSupport": "StorageWithReorgs" + }, "Sync": { "FastSync": true, "SnapSync": true, diff --git a/src/Nethermind/Nethermind.Runner/configs/holesky_archive.cfg b/src/Nethermind/Nethermind.Runner/configs/holesky_archive.cfg index eb2e77a02a9..b132b980c14 100644 --- a/src/Nethermind/Nethermind.Runner/configs/holesky_archive.cfg +++ b/src/Nethermind/Nethermind.Runner/configs/holesky_archive.cfg @@ -5,6 +5,10 @@ "BaseDbPath": "nethermind_db/holesky_archive", "LogFileName": "holesky_archive.logs.txt" }, + "TxPool": { + "Size": 1024, + "BlobsSupport": "StorageWithReorgs" + }, "Metrics": { "NodeName": "Holesky Archive" }, diff --git a/src/Nethermind/Nethermind.Runner/configs/sepolia.cfg b/src/Nethermind/Nethermind.Runner/configs/sepolia.cfg index c0aff1477e2..bb971b2efb3 100644 --- a/src/Nethermind/Nethermind.Runner/configs/sepolia.cfg +++ b/src/Nethermind/Nethermind.Runner/configs/sepolia.cfg @@ -8,7 +8,8 @@ "MemoryHint": 1024000000 }, "TxPool": { - "Size": 1024 + "Size": 1024, + "BlobsSupport": "StorageWithReorgs" }, "Metrics": { "NodeName": "Sepolia" @@ -38,4 +39,4 @@ "Merge": { "Enabled": true } -} \ No newline at end of file +} diff --git a/src/Nethermind/Nethermind.Runner/configs/sepolia_archive.cfg b/src/Nethermind/Nethermind.Runner/configs/sepolia_archive.cfg index ce210b68bb7..a703ebf4c35 100644 --- a/src/Nethermind/Nethermind.Runner/configs/sepolia_archive.cfg +++ b/src/Nethermind/Nethermind.Runner/configs/sepolia_archive.cfg @@ -8,7 +8,8 @@ "MemoryHint": 1024000000 }, "TxPool": { - "Size": 1024 + "Size": 1024, + "BlobsSupport": "StorageWithReorgs" }, "Metrics": { "NodeName": "Sepolia Archive" diff --git a/src/Nethermind/Nethermind.Specs.Test/ChainSpecStyle/ChainSpecBasedSpecProviderTests.cs b/src/Nethermind/Nethermind.Specs.Test/ChainSpecStyle/ChainSpecBasedSpecProviderTests.cs index 446e075ec6a..3028a8318b4 100644 --- a/src/Nethermind/Nethermind.Specs.Test/ChainSpecStyle/ChainSpecBasedSpecProviderTests.cs +++ b/src/Nethermind/Nethermind.Specs.Test/ChainSpecStyle/ChainSpecBasedSpecProviderTests.cs @@ -127,6 +127,9 @@ public static IEnumerable SepoliaActivations yield return new TestCaseData((ForkActivation)(1735372, 3)) { TestName = "Low timestamp" }; yield return new TestCaseData((ForkActivation)(1735372, 1677557088)) { TestName = "1677557088" }; yield return new TestCaseData((ForkActivation)(1735372, 1677557087)) { TestName = "1677557087" }; + yield return new TestCaseData(new ForkActivation(1735372, SepoliaSpecProvider.CancunTimestamp - 1)) { TestName = "Before Cancun" }; + yield return new TestCaseData(new ForkActivation(1735372, SepoliaSpecProvider.CancunTimestamp)) { TestName = "Cancun" }; + yield return new TestCaseData(new ForkActivation(1735372, SepoliaSpecProvider.CancunTimestamp + 100000000)) { TestName = "Future" }; } } @@ -155,8 +158,9 @@ public static IEnumerable HoleskyActivations yield return new TestCaseData(new ForkActivation(0, HoleskySpecProvider.GenesisTimestamp)) { TestName = "Genesis" }; yield return new TestCaseData(new ForkActivation(1, HoleskySpecProvider.ShanghaiTimestamp)) { TestName = "Shanghai" }; yield return new TestCaseData(new ForkActivation(3, HoleskySpecProvider.ShanghaiTimestamp + 24)) { TestName = "Post Shanghai" }; - //new ForkActivation(4, HoleskySpecProvider.CancunTimestamp), - //new ForkActivation(5, HoleskySpecProvider.CancunTimestamp + 12), + yield return new TestCaseData(new ForkActivation(4, HoleskySpecProvider.CancunTimestamp - 1)) { TestName = "Before Cancun" }; + yield return new TestCaseData(new ForkActivation(5, HoleskySpecProvider.CancunTimestamp)) { TestName = "Cancun" }; + yield return new TestCaseData(new ForkActivation(6, HoleskySpecProvider.CancunTimestamp + 100000000)) { TestName = "Future" }; } } diff --git a/src/Nethermind/Nethermind.Specs/HoleskySpecProvider.cs b/src/Nethermind/Nethermind.Specs/HoleskySpecProvider.cs index 006460e0490..16730cb30f3 100644 --- a/src/Nethermind/Nethermind.Specs/HoleskySpecProvider.cs +++ b/src/Nethermind/Nethermind.Specs/HoleskySpecProvider.cs @@ -12,7 +12,7 @@ public class HoleskySpecProvider : ISpecProvider { public const ulong GenesisTimestamp = 0x65156994; public const ulong ShanghaiTimestamp = 0x6516eac0; - // public const ulong CancunTimestamp = 0x77359400; + public const ulong CancunTimestamp = 0x65C36AC0; private HoleskySpecProvider() { } @@ -21,8 +21,8 @@ public IReleaseSpec GetSpec(ForkActivation forkActivation) return forkActivation.Timestamp switch { null or < ShanghaiTimestamp => GenesisSpec, - // < CancunTimestamp => Shanghai.Instance, - _ => Shanghai.Instance + < CancunTimestamp => Shanghai.Instance, + _ => Cancun.Instance }; } @@ -44,7 +44,7 @@ public void UpdateMergeTransitionInfo(long? blockNumber, UInt256? terminalTotalD public ForkActivation[] TransitionActivations { get; } = { (1, ShanghaiTimestamp), - // (2, CancunTimestamp) + (2, CancunTimestamp) }; public static readonly HoleskySpecProvider Instance = new(); diff --git a/src/Nethermind/Nethermind.Specs/SepoliaSpecProvider.cs b/src/Nethermind/Nethermind.Specs/SepoliaSpecProvider.cs index bb06bbfc850..739eea9d2cf 100644 --- a/src/Nethermind/Nethermind.Specs/SepoliaSpecProvider.cs +++ b/src/Nethermind/Nethermind.Specs/SepoliaSpecProvider.cs @@ -10,15 +10,17 @@ namespace Nethermind.Specs; public class SepoliaSpecProvider : ISpecProvider { public const ulong BeaconChainGenesisTimestamp = 0x62b07d60; - public const ulong ShanghaiBlockTimestamp = 0x63fd7d60; + public const ulong ShanghaiTimestamp = 0x63fd7d60; + public const ulong CancunTimestamp = 0x65B97D60; private SepoliaSpecProvider() { } public IReleaseSpec GetSpec(ForkActivation forkActivation) => forkActivation switch { - { Timestamp: null } or { Timestamp: < ShanghaiBlockTimestamp } => London.Instance, - _ => Shanghai.Instance + { Timestamp: null } or { Timestamp: < ShanghaiTimestamp } => London.Instance, + { Timestamp: < CancunTimestamp } => Shanghai.Instance, + _ => Cancun.Instance }; public void UpdateMergeTransitionInfo(long? blockNumber, UInt256? terminalTotalDifficulty = null) @@ -39,7 +41,8 @@ public void UpdateMergeTransitionInfo(long? blockNumber, UInt256? terminalTotalD public ForkActivation[] TransitionActivations { get; } = { (ForkActivation)1735371, - (1735371, 1677557088) + (1735371, ShanghaiTimestamp), + (1735371, CancunTimestamp), }; public static SepoliaSpecProvider Instance { get; } = new();