Skip to content

Commit 836748d

Browse files
MarekM25Marchhill
authored andcommitted
Holesky & Sepolia Pectra (#8115)
Co-authored-by: Marc Harvey-Hill <[email protected]>
1 parent 8d47177 commit 836748d

File tree

6 files changed

+43
-19
lines changed

6 files changed

+43
-19
lines changed

src/Nethermind/Chains/holesky.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@
4545
"eip4844TransitionTimestamp": "0x65C36AC0",
4646
"eip5656TransitionTimestamp": "0x65C36AC0",
4747
"eip6780TransitionTimestamp": "0x65C36AC0",
48+
"eip2537TransitionTimestamp": "0x67BCEAC0",
49+
"eip2935TransitionTimestamp": "0x67BCEAC0",
50+
"eip6110TransitionTimestamp": "0x67BCEAC0",
51+
"eip7002TransitionTimestamp": "0x67BCEAC0",
52+
"eip7251TransitionTimestamp": "0x67BCEAC0",
53+
"eip7623TransitionTimestamp": "0x67BCEAC0",
54+
"eip7702TransitionTimestamp": "0x67BCEAC0",
4855
"terminalTotalDifficulty": "0x0",
4956
"gasLimitBoundDivisor": "0x400",
5057
"maxCodeSize": "0x6000",

src/Nethermind/Chains/sepolia.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,13 @@
6767
"eip4844TransitionTimestamp": "0x65B97D60",
6868
"eip5656TransitionTimestamp": "0x65B97D60",
6969
"eip6780TransitionTimestamp": "0x65B97D60",
70+
"eip2537TransitionTimestamp": "0x67C7FD60",
71+
"eip2935TransitionTimestamp": "0x67C7FD60",
72+
"eip6110TransitionTimestamp": "0x67C7FD60",
73+
"eip7002TransitionTimestamp": "0x67C7FD60",
74+
"eip7251TransitionTimestamp": "0x67C7FD60",
75+
"eip7623TransitionTimestamp": "0x67C7FD60",
76+
"eip7702TransitionTimestamp": "0x67C7FD60",
7077
"blobSchedule": {
7178
"cancun": {
7279
"target": 3,

src/Nethermind/Nethermind.Network.Test/ForkInfoTests.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,10 @@ public void Fork_id_and_hash_as_expected_with_merge_fork_id(long head, ulong hea
107107
[TestCase(1, 1_696_000_703ul, "0xc61a6098", 1_696_000_704ul, "Last genesis spec block")]
108108
[TestCase(2, 1_696_000_704ul, "0xfd4f016b", 1_707_305_664ul, "First Shanghai block")]
109109
[TestCase(3, 1_707_305_663ul, "0xfd4f016b", 1_707_305_664ul, "Future Shanghai timestamp")]
110-
[TestCase(4, 1_707_305_664ul, "0x9b192ad0", 0ul, "First Cancun timestamp")]
111-
[TestCase(5, 1_717_305_664ul, "0x9b192ad0", 0ul, "Future Cancun timestamp")]
110+
[TestCase(4, 1_707_305_664ul, "0x9b192ad0", 1_740_434_112ul, "First Cancun timestamp")]
111+
[TestCase(5, 1_717_305_664ul, "0x9b192ad0", 1_740_434_112ul, "Future Cancun timestamp")]
112+
[TestCase(5, 1_740_434_112ul, "0xdfbd9bed", 0ul, "First Prague timestamp")]
113+
[TestCase(5, 1_760_434_112ul, "0xdfbd9bed", 0ul, "Future Prague timestamp")]
112114
public void Fork_id_and_hash_as_expected_on_holesky(long head, ulong headTimestamp, string forkHashHex, ulong next, string description)
113115
{
114116
Test(head, headTimestamp, KnownHashes.HoleskyGenesis, forkHashHex, next, description, HoleskySpecProvider.Instance, "holesky.json");
@@ -119,8 +121,10 @@ public void Fork_id_and_hash_as_expected_on_holesky(long head, ulong headTimesta
119121
[TestCase(1735371, 0ul, "0xb96cbd13", 1_677_557_088ul, "First block - Sepolia MergeForkIdTransition")]
120122
[TestCase(1735372, 1_677_557_088ul, "0xf7f9bc08", 1_706_655_072ul, "Shanghai")]
121123
[TestCase(1735372, 1_706_655_071ul, "0xf7f9bc08", 1_706_655_072ul, "Future Shanghai")]
122-
[TestCase(1735373, 1_706_655_072ul, "0x88cf81d9", 0ul, "First Cancun timestamp")]
123-
[TestCase(1735374, 1_716_655_072ul, "0x88cf81d9", 0ul, "Future Cancun timestamp")]
124+
[TestCase(1735373, 1_706_655_072ul, "0x88cf81d9", 1_741_159_776ul, "First Cancun timestamp")]
125+
[TestCase(1735374, 1_716_655_072ul, "0x88cf81d9", 1_741_159_776ul, "Future Cancun timestamp")]
126+
[TestCase(1735373, 1_741_159_776ul, "0xed88b5fd", 0ul, "First Prague timestamp")]
127+
[TestCase(1735374, 1_761_159_776ul, "0xed88b5fd", 0ul, "Future Prague timestamp")]
124128
public void Fork_id_and_hash_as_expected_on_sepolia(long head, ulong headTimestamp, string forkHashHex, ulong next, string description)
125129
{
126130
Test(head, headTimestamp, KnownHashes.SepoliaGenesis, forkHashHex, next, description, SepoliaSpecProvider.Instance, "sepolia.json");

src/Nethermind/Nethermind.Specs.Test/ChainSpecStyle/ChainSpecBasedSpecProviderTests.cs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,10 @@ public static IEnumerable<TestCaseData> SepoliaActivations
137137
yield return new TestCaseData((ForkActivation)(1735372, 1677557088)) { TestName = "1677557088" };
138138
yield return new TestCaseData((ForkActivation)(1735372, 1677557087)) { TestName = "1677557087" };
139139
yield return new TestCaseData(new ForkActivation(1735372, SepoliaSpecProvider.CancunTimestamp - 1)) { TestName = "Before Cancun" };
140-
yield return new TestCaseData(new ForkActivation(1735372, SepoliaSpecProvider.CancunTimestamp)) { TestName = "Cancun" };
141-
yield return new TestCaseData(new ForkActivation(1735372, SepoliaSpecProvider.CancunTimestamp + 100000000)) { TestName = "Future" };
140+
yield return new TestCaseData(new ForkActivation(1735372, SepoliaSpecProvider.CancunTimestamp)) { TestName = "First Cancun" };
141+
yield return new TestCaseData(new ForkActivation(1735372, SepoliaSpecProvider.CancunTimestamp + 100000000)) { TestName = "Cancun" };
142+
yield return new TestCaseData(new ForkActivation(1735372, SepoliaSpecProvider.PragueTimestamp)) { TestName = "First Prague" };
143+
yield return new TestCaseData(new ForkActivation(1735372, SepoliaSpecProvider.PragueTimestamp + 100000000)) { TestName = "Prague" };
142144
}
143145
}
144146

@@ -161,7 +163,6 @@ public void Sepolia_loads_properly(ForkActivation forkActivation)
161163
IReleaseSpec postCancunSpec = provider.GetSpec((2, SepoliaSpecProvider.CancunTimestamp));
162164

163165
VerifyCancunSpecificsForMainnetAndHoleskyAndSepolia(postCancunSpec);
164-
// TODO: add VerifyPragueSpecifics
165166
}
166167

167168
public static IEnumerable<TestCaseData> HoleskyActivations
@@ -173,7 +174,10 @@ public static IEnumerable<TestCaseData> HoleskyActivations
173174
yield return new TestCaseData(new ForkActivation(3, HoleskySpecProvider.ShanghaiTimestamp + 24)) { TestName = "Post Shanghai" };
174175
yield return new TestCaseData(new ForkActivation(4, HoleskySpecProvider.CancunTimestamp - 1)) { TestName = "Before Cancun" };
175176
yield return new TestCaseData(new ForkActivation(5, HoleskySpecProvider.CancunTimestamp)) { TestName = "Cancun" };
176-
yield return new TestCaseData(new ForkActivation(6, HoleskySpecProvider.CancunTimestamp + 100000000)) { TestName = "Future" };
177+
yield return new TestCaseData(new ForkActivation(6, HoleskySpecProvider.CancunTimestamp + 24)) { TestName = "Post Cancun" };
178+
yield return new TestCaseData(new ForkActivation(7, HoleskySpecProvider.PragueTimestamp - 1)) { TestName = "Before Prague" };
179+
yield return new TestCaseData(new ForkActivation(8, HoleskySpecProvider.PragueTimestamp)) { TestName = "Prague" };
180+
yield return new TestCaseData(new ForkActivation(9, HoleskySpecProvider.PragueTimestamp + 100000000)) { TestName = "Future Prague" };
177181
}
178182
}
179183

@@ -193,7 +197,6 @@ public void Holesky_loads_properly(ForkActivation forkActivation)
193197

194198
IReleaseSpec postCancunSpec = provider.GetSpec((2, HoleskySpecProvider.CancunTimestamp));
195199
VerifyCancunSpecificsForMainnetAndHoleskyAndSepolia(postCancunSpec);
196-
// TODO: add VerifyPragueSpecifics
197200
// because genesis time for holesky is set 5 minutes before the launch of the chain. this test fails.
198201
//GetTransitionTimestamps(chainSpec.Parameters).Should().AllSatisfy(
199202
// t => ValidateSlotByTimestamp(t, HoleskySpecProvider.GenesisTimestamp).Should().BeTrue());
@@ -495,11 +498,7 @@ private static void CompareSpecs(IReleaseSpec expectedSpec, IReleaseSpec actualS
495498
.Where(p => p.Name != nameof(IReleaseSpec.Eip1559TransitionBlock))
496499
.Where(p => p.Name != nameof(IReleaseSpec.WithdrawalTimestamp))
497500
.Where(p => p.Name != nameof(IReleaseSpec.Eip4844TransitionTimestamp))
498-
// Skip EIP-4844 parameter validation
499-
.Where(p => p.Name != nameof(IReleaseSpec.BlobBaseFeeUpdateFraction))
500-
.Where(p => p.Name != nameof(IReleaseSpec.MaxBlobCount))
501-
.Where(p => p.Name != nameof(Eip4844Constants.MinBlobGasPrice))
502-
.Where(p => p.Name != nameof(IReleaseSpec.TargetBlobCount))
501+
503502
// handle gnosis specific exceptions
504503
.Where(p => !isGnosis || p.Name != nameof(IReleaseSpec.MaxCodeSize))
505504
.Where(p => !isGnosis || p.Name != nameof(IReleaseSpec.MaxInitCodeSize))

src/Nethermind/Nethermind.Specs/HoleskySpecProvider.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ public class HoleskySpecProvider : ISpecProvider
1313
public const ulong GenesisTimestamp = 0x65156994;
1414
public const ulong ShanghaiTimestamp = 0x6516eac0;
1515
public const ulong CancunTimestamp = 0x65C36AC0;
16+
public const ulong PragueTimestamp = 0x67BCEAC0;
17+
1618

1719
private HoleskySpecProvider() { }
1820

@@ -22,7 +24,8 @@ public IReleaseSpec GetSpec(ForkActivation forkActivation)
2224
{
2325
null or < ShanghaiTimestamp => GenesisSpec,
2426
< CancunTimestamp => Shanghai.Instance,
25-
_ => Cancun.Instance
27+
< PragueTimestamp => Cancun.Instance,
28+
_ => Prague.Instance
2629
};
2730
}
2831

@@ -45,7 +48,8 @@ public void UpdateMergeTransitionInfo(long? blockNumber, UInt256? terminalTotalD
4548
public ForkActivation[] TransitionActivations { get; } =
4649
{
4750
(1, ShanghaiTimestamp),
48-
(2, CancunTimestamp)
51+
(2, CancunTimestamp),
52+
(3, PragueTimestamp)
4953
};
5054

5155
public static readonly HoleskySpecProvider Instance = new();

src/Nethermind/Nethermind.Specs/SepoliaSpecProvider.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public class SepoliaSpecProvider : ISpecProvider
1313
public const ulong BeaconChainGenesisTimestampConst = 0x62b07d60;
1414
public const ulong ShanghaiTimestamp = 0x63fd7d60;
1515
public const ulong CancunTimestamp = 0x65B97D60;
16+
public const ulong PragueTimestamp = 0x67C7FD60;
1617

1718
private SepoliaSpecProvider() { }
1819

@@ -21,7 +22,8 @@ public IReleaseSpec GetSpec(ForkActivation forkActivation) =>
2122
{
2223
{ Timestamp: null } or { Timestamp: < ShanghaiTimestamp } => London.Instance,
2324
{ Timestamp: < CancunTimestamp } => Shanghai.Instance,
24-
_ => Cancun.Instance
25+
{ Timestamp: < PragueTimestamp } => Cancun.Instance,
26+
_ => Prague.Instance
2527
};
2628

2729
public void UpdateMergeTransitionInfo(long? blockNumber, UInt256? terminalTotalDifficulty = null)
@@ -42,11 +44,12 @@ public void UpdateMergeTransitionInfo(long? blockNumber, UInt256? terminalTotalD
4244
public UInt256? TerminalTotalDifficulty { get; private set; } = 17000000000000000;
4345
public IReleaseSpec GenesisSpec => London.Instance;
4446
public ForkActivation[] TransitionActivations { get; } =
45-
{
47+
[
4648
(ForkActivation)1735371,
4749
(1735371, ShanghaiTimestamp),
4850
(1735371, CancunTimestamp),
49-
};
51+
(1735371, PragueTimestamp)
52+
];
5053

5154
public static SepoliaSpecProvider Instance { get; } = new();
5255
}

0 commit comments

Comments
 (0)