Skip to content

Commit 25e26aa

Browse files
committed
Chiado Pectra (#8276)
1 parent 5cda523 commit 25e26aa

6 files changed

Lines changed: 31 additions & 8 deletions

File tree

src/Nethermind/Chains/chiado.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,25 @@
8383
"transactionPermissionContract": "0x4000000000000000000000000000000000000001",
8484
"transactionPermissionContractTransition": "0x0",
8585
"terminalTotalDifficulty": "231707791542740786049188744689299064356246512",
86+
"eip2537TransitionTimestamp": "0x67C96E4C",
87+
"eip2935TransitionTimestamp": "0x67C96E4C",
88+
"eip6110TransitionTimestamp": "0x67C96E4C",
89+
"eip7002TransitionTimestamp": "0x67C96E4C",
90+
"eip7251TransitionTimestamp": "0x67C96E4C",
91+
"eip7623TransitionTimestamp": "0x67C96E4C",
92+
"eip7702TransitionTimestamp": "0x67C96E4C",
93+
"eip4844FeeCollectorTransitionTimestamp": "0x67C96E4C",
94+
"depositContractAddress": "0xb97036A26259B7147018913bD58a774cf91acf25",
8695
"blobSchedule": {
8796
"cancun": {
8897
"target": 1,
8998
"max": 2,
9099
"baseFeeUpdateFraction": "0x10fafa"
100+
},
101+
"prague": {
102+
"target": 1,
103+
"max": 2,
104+
"baseFeeUpdateFraction": "0x10fafa"
91105
}
92106
}
93107
},

src/Nethermind/Chains/gnosis.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
"transactionPermissionContract": "0x7Dd7032AA75A37ea0b150f57F899119C7379A78b",
9191
"transactionPermissionContractTransition": 9186425,
9292
"terminalTotalDifficulty": "8626000000000000000000058750000000000000000000",
93+
"depositContractAddress": "0x0B98057eA310F4d31F2a452B414647007d1645d9",
9394
"blobSchedule": {
9495
"cancun": {
9596
"target": 1,

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,10 @@ public void Fork_id_and_hash_as_expected_on_gnosis(long head, ulong headTimestam
157157

158158
[TestCase(0L, 0UL, "0x50d39d7b", ChiadoSpecProvider.ShanghaiTimestamp, "Chiado genesis")]
159159
[TestCase(3945317, ChiadoSpecProvider.ShanghaiTimestamp, "0xa15a4252", ChiadoSpecProvider.CancunTimestamp, "First Shanghai timestamp")]
160-
[TestCase(4_000_000, ChiadoSpecProvider.CancunTimestamp, "0x5fbc16bc", 0ul, "First Cancun timestamp")]
161-
[TestCase(5_000_000, 9984930320ul, "0x5fbc16bc", 0ul, "Future Cancun timestamp")]
160+
[TestCase(4_000_000, ChiadoSpecProvider.CancunTimestamp, "0x5fbc16bc", 1741254220ul, "First Cancun timestamp")]
161+
[TestCase(5_000_000, 1741254219u, "0x5fbc16bc", 1741254220ul, "Future Cancun timestamp")]
162+
[TestCase(5_000_000, 1741254220u, "0x8BA51786", 0ul, "First Prague timestamp")]
163+
[TestCase(5_000_000, 1741254420u, "0x8BA51786", 0ul, "Future Prague timestamp")]
162164
public void Fork_id_and_hash_as_expected_on_chiado(long head, ulong headTimestamp, string forkHashHex, ulong next, string description)
163165
{
164166
ChainSpecLoader loader = new ChainSpecLoader(new EthereumJsonSerializer());

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,9 @@ public static IEnumerable<TestCaseData> ChiadoActivations
229229
yield return new TestCaseData((ForkActivation)(1, ChiadoSpecProvider.CancunTimestamp - 1)) { TestName = "Before Cancun" };
230230
yield return new TestCaseData((ForkActivation)(1, ChiadoSpecProvider.CancunTimestamp)) { TestName = "Cancun" };
231231
yield return new TestCaseData((ForkActivation)(1, ChiadoSpecProvider.CancunTimestamp + 100000000)) { TestName = "Future" };
232-
// yield return new TestCaseData((ForkActivation)(1, ChiadoSpecProvider.PragueTimestamp - 1)) { TestName = "Before Prague" };
233-
// yield return new TestCaseData((ForkActivation)(1, ChiadoSpecProvider.PragueTimestamp)) { TestName = "Prague" };
234-
// yield return new TestCaseData((ForkActivation)(1, ChiadoSpecProvider.PragueTimestamp + 100000000)) { TestName = "Future" };
232+
yield return new TestCaseData((ForkActivation)(1, ChiadoSpecProvider.PragueTimestamp - 1)) { TestName = "Before Prague" };
233+
yield return new TestCaseData((ForkActivation)(1, ChiadoSpecProvider.PragueTimestamp)) { TestName = "Prague" };
234+
yield return new TestCaseData((ForkActivation)(1, ChiadoSpecProvider.PragueTimestamp + 100000000)) { TestName = "Future" };
235235
}
236236
}
237237

@@ -260,9 +260,10 @@ public void Chiado_loads_properly(ForkActivation forkActivation)
260260

261261
VerifyGnosisShanghaiSpecifics(preShanghaiSpec, postShanghaiSpec);
262262
VerifyGnosisCancunSpecifics(postCancunSpec);
263-
// VerifyGnosisPragueSpecifics(prePragueSpec, postPragueSpec, ChiadoSpecProvider.FeeCollector);
263+
VerifyGnosisPragueSpecifics(prePragueSpec, postPragueSpec, ChiadoSpecProvider.FeeCollector);
264264
GetTransitionTimestamps(chainSpec.Parameters).Should().AllSatisfy(
265265
static t => ValidateSlotByTimestamp(t, ChiadoSpecProvider.BeaconChainGenesisTimestampConst, GnosisBlockTime).Should().BeTrue());
266+
Assert.That(postPragueSpec.DepositContractAddress, Is.EqualTo(new Address("0xb97036A26259B7147018913bD58a774cf91acf25")));
266267
}
267268

268269
public static IEnumerable<TestCaseData> GnosisActivations
@@ -325,7 +326,9 @@ public void Gnosis_loads_properly(ForkActivation forkActivation)
325326

326327
VerifyGnosisShanghaiSpecifics(preShanghaiSpec, postShanghaiSpec);
327328
VerifyGnosisCancunSpecifics(postCancunSpec);
329+
// ToDo uncomment in Pectra
328330
// VerifyGnosisPragueSpecifics(prePragueSpec, postPragueSpec, GnosisSpecProvider.FeeCollector);
331+
// Assert.That(postPragueSpec.DepositContractAddress, Is.EqualTo(new Address("0x0B98057eA310F4d31F2a452B414647007d1645d9")));
329332
GetTransitionTimestamps(chainSpec.Parameters).Should().AllSatisfy(
330333
static t => ValidateSlotByTimestamp(t, GnosisSpecProvider.BeaconChainGenesisTimestampConst, GnosisBlockTime).Should().BeTrue());
331334
}

src/Nethermind/Nethermind.Specs/ChiadoSpecProvider.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ public class ChiadoSpecProvider : ISpecProvider
1414
public const ulong BeaconChainGenesisTimestampConst = 0x6343ee4c;
1515
public const ulong ShanghaiTimestamp = 0x646e0e4c;
1616
public const ulong CancunTimestamp = 0x65ba8e4c;
17-
//TODO correct this timestamp!
18-
public const ulong PragueTimestamp = ulong.MaxValue - 2;
17+
public const ulong PragueTimestamp = 0x67C96E4C;
18+
1919
public static readonly Address FeeCollector = new("0x1559000000000000000000000000000000000000");
2020

2121
private ChiadoSpecProvider() { }

src/Nethermind/Nethermind.Specs/GnosisForks/18_PragueGnosis.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ public class PragueGnosis : Forks.Prague
1313
protected PragueGnosis() : base()
1414
{
1515
IsEip4844FeeCollectorEnabled = true;
16+
BlobBaseFeeUpdateFraction = 0x10fafa;
17+
TargetBlobCount = 1;
18+
MaxBlobCount = 2;
1619
}
1720

1821
public new static IReleaseSpec Instance => LazyInitializer.EnsureInitialized(ref _instance, static () => new PragueGnosis());

0 commit comments

Comments
 (0)