diff --git a/src/Nethermind/Chains/sepolia.json b/src/Nethermind/Chains/sepolia.json index 4d16f771ce0..17c70cff6f9 100644 --- a/src/Nethermind/Chains/sepolia.json +++ b/src/Nethermind/Chains/sepolia.json @@ -56,7 +56,11 @@ "eip3529Transition": "0x0", "eip3541Transition": "0x0", "terminalTotalDifficulty": "3C6568F12E8000", - "mergeForkIdTransition": "0x1A7ACB" + "mergeForkIdTransition": "0x1A7ACB", + "eip4895TransitionTimestamp": "0x63FD7D60", + "eip3855TransitionTimestamp": "0x63FD7D60", + "eip3651TransitionTimestamp": "0x63FD7D60", + "eip3860TransitionTimestamp": "0x63FD7D60" }, "genesis": { "seal": { diff --git a/src/Nethermind/Nethermind.Network.Test/ForkInfoTests.cs b/src/Nethermind/Nethermind.Network.Test/ForkInfoTests.cs index c6903f1497e..229bc2a1a98 100644 --- a/src/Nethermind/Nethermind.Network.Test/ForkInfoTests.cs +++ b/src/Nethermind/Nethermind.Network.Test/ForkInfoTests.cs @@ -151,7 +151,9 @@ public void Fork_id_and_hash_as_expected_on_ropsten(long head, ulong headTimesta [TestCase(0, 0ul, "0xFE3366E7", 1735371ul, "Sepolia genesis")] [TestCase(1735370, 0ul, "0xFE3366E7", 1735371ul, "Sepolia Last block before MergeForkIdTranstion")] - [TestCase(1735371, 0ul, "0xb96cbd13", 0ul, "First block - Sepolia MergeForkIdTransition")] + [TestCase(1735371, 0ul, "0xb96cbd13", 1677557088UL, "First block - Sepolia MergeForkIdTransition")] + [TestCase(1735372, 1677557088ul, "0xf7f9bc08", 0ul, "Shanghai")] + [TestCase(1735372, 2677557088ul, "0xf7f9bc08", 0ul, "Future Shanghai")] 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.Specs.Test/ChainSpecStyle/ChainSpecBasedSpecProviderTests.cs b/src/Nethermind/Nethermind.Specs.Test/ChainSpecStyle/ChainSpecBasedSpecProviderTests.cs index ed6de055c5a..72a482fb378 100644 --- a/src/Nethermind/Nethermind.Specs.Test/ChainSpecStyle/ChainSpecBasedSpecProviderTests.cs +++ b/src/Nethermind/Nethermind.Specs.Test/ChainSpecStyle/ChainSpecBasedSpecProviderTests.cs @@ -178,7 +178,11 @@ public void Sepolia_loads_properly() List forkActivationsToTest = new() { - (ForkActivation)120_000_000, // far in the future + new ForkActivation(2, 0), + new ForkActivation(120_000_000, 0), + new ForkActivation(1735372, 3), + new ForkActivation(1735372, 1677557088), + new ForkActivation(1735372, 1677557087) }; CompareSpecProviders(sepolia, provider, forkActivationsToTest); diff --git a/src/Nethermind/Nethermind.Specs.Test/ChainSpecStyle/ChainSpecLoaderTests.cs b/src/Nethermind/Nethermind.Specs.Test/ChainSpecStyle/ChainSpecLoaderTests.cs index 1dea66ad0af..bd85eb9815a 100644 --- a/src/Nethermind/Nethermind.Specs.Test/ChainSpecStyle/ChainSpecLoaderTests.cs +++ b/src/Nethermind/Nethermind.Specs.Test/ChainSpecStyle/ChainSpecLoaderTests.cs @@ -315,6 +315,21 @@ public void Can_load_spaceneth() chainSpec.GrayGlacierBlockNumber.Should().Be(null); } + [Test] + public void Can_load_sepolia() + { + string path = Path.Combine(TestContext.CurrentContext.WorkDirectory, "../../../../", "Chains/sepolia.json"); + ChainSpec chainSpec = LoadChainSpec(path); + + Assert.AreEqual(11155111, chainSpec.NetworkId, $"{nameof(chainSpec.NetworkId)}"); + Assert.AreEqual("Sepolia Testnet", chainSpec.Name, $"{nameof(chainSpec.Name)}"); + Assert.AreEqual("sepolia", chainSpec.DataDir, $"{nameof(chainSpec.Name)}"); + Assert.AreEqual("Ethash", chainSpec.SealEngineType, "engine"); + + chainSpec.LondonBlockNumber.Should().Be(0L); + chainSpec.ShanghaiTimestamp.Should().Be(1677557088); + } + [Test] public void Can_load_posdao_with_openethereum_pricing_transitions() { diff --git a/src/Nethermind/Nethermind.Specs/SepoliaSpecProvider.cs b/src/Nethermind/Nethermind.Specs/SepoliaSpecProvider.cs index f5e654ac464..d523cb7cfa3 100644 --- a/src/Nethermind/Nethermind.Specs/SepoliaSpecProvider.cs +++ b/src/Nethermind/Nethermind.Specs/SepoliaSpecProvider.cs @@ -26,7 +26,14 @@ public void UpdateMergeTransitionInfo(long? blockNumber, UInt256? terminalTotalD public UInt256? TerminalTotalDifficulty => _terminalTotalDifficulty; public IReleaseSpec GenesisSpec => London.Instance; - public IReleaseSpec GetSpec(ForkActivation forkActivation) => London.Instance; + public const ulong ShanghaiBlockTimestamp = 1677557088; + + public IReleaseSpec GetSpec(ForkActivation forkActivation) => + forkActivation switch + { + { Timestamp: null } or { Timestamp: < ShanghaiBlockTimestamp } => London.Instance, + _ => Shanghai.Instance + }; public long? DaoBlockNumber => null; @@ -34,7 +41,7 @@ public void UpdateMergeTransitionInfo(long? blockNumber, UInt256? terminalTotalD public ulong NetworkId => Core.BlockchainIds.Rinkeby; public ulong ChainId => NetworkId; - public ForkActivation[] TransitionActivations { get; } = { (ForkActivation)1735371 }; + public ForkActivation[] TransitionActivations { get; } = { (ForkActivation)1735371, new ForkActivation(1735371, 1677557088) }; private SepoliaSpecProvider() { }