Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cancun spec and config for mainnet #6679

Merged
merged 4 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/Nethermind/Chains/foundation.json
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@
"eip3855TransitionTimestamp": "0x64373057",
"eip3860TransitionTimestamp": "0x64373057",
"eip4895TransitionTimestamp": "0x64373057",
"eip1153TransitionTimestamp": "0x65F1B057",
"eip4788TransitionTimestamp": "0x65F1B057",
"eip4844TransitionTimestamp": "0x65F1B057",
"eip5656TransitionTimestamp": "0x65F1B057",
"eip6780TransitionTimestamp": "0x65F1B057",
"terminalTotalDifficulty": "C70D808A128D7380000"
},
"genesis": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1554,8 +1554,11 @@ public void Should_return_expected_capabilities_for_mainnet()
nameof(IEngineRpcModule.engine_forkchoiceUpdatedV2),
nameof(IEngineRpcModule.engine_newPayloadV2),
nameof(IEngineRpcModule.engine_getPayloadBodiesByHashV1),
nameof(IEngineRpcModule.engine_getPayloadBodiesByRangeV1)
nameof(IEngineRpcModule.engine_getPayloadBodiesByRangeV1),

nameof(IEngineRpcModule.engine_getPayloadV3),
nameof(IEngineRpcModule.engine_forkchoiceUpdatedV3),
nameof(IEngineRpcModule.engine_newPayloadV3)
};
Assert.That(result, Is.EquivalentTo(expectedMethods));
}
Expand Down
10 changes: 6 additions & 4 deletions src/Nethermind/Nethermind.Network.Test/ForkInfoTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@ public class ForkInfoTests
[TestCase(13_772_999, 0ul, "0xb715077d", 13_773_000ul, "Last London")]
[TestCase(13_773_000, 0ul, "0x20c327fc", 15_050_000ul, "First Arrow Glacier")]
[TestCase(15_049_999, 0ul, "0x20c327fc", 15_050_000ul, "Last Arrow Glacier")]
[TestCase(15_050_000, 0ul, "0xf0afd0e3", 1681338455ul, "First Gray Glacier")]
[TestCase(15_051_000, 0ul, "0xf0afd0e3", 1681338455ul, "Future Gray Glacier")]
[TestCase(15_051_000, 1681338455ul, "0xdce96c2d", 0ul, "First Shanghai timestamp")]
[TestCase(15_051_000, 9981338455ul, "0xdce96c2d", 0ul, "Future Shanghai timestamp")]
[TestCase(15_050_000, 0ul, "0xf0afd0e3", 1_681_338_455ul, "First Gray Glacier")]
[TestCase(15_051_000, 0ul, "0xf0afd0e3", 1_681_338_455ul, "Future Gray Glacier")]
[TestCase(15_051_000, 1_681_338_455ul, "0xdce96c2d", 1_710_338_135ul, "First Shanghai timestamp")]
[TestCase(15_051_000, 1_710_338_134ul, "0xdce96c2d", 1_710_338_135ul, "Future Shanghai timestamp")]
[TestCase(15_051_000, 1_710_338_135ul, "0x9f3d2254", 0ul, "First Cancun timestamp")]
[TestCase(15_051_000, 1_810_338_135ul, "0x9f3d2254", 0ul, "Future Cancun timestamp")]
public void Fork_id_and_hash_as_expected(long head, ulong headTimestamp, string forkHashHex, ulong next, string description)
{
Test(head, headTimestamp, KnownHashes.MainnetGenesis, forkHashHex, next, description, MainnetSpecProvider.Instance, "foundation.json");
Expand Down
6 changes: 3 additions & 3 deletions src/Nethermind/Nethermind.Runner.Test/ConfigFilesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,14 @@ public void Network_diag_tracer_disabled_by_default(string configWildcard)
Test<INetworkConfig, bool>(configWildcard, c => c.DiagTracerEnabled, false);
}

[TestCase("mainnet", 2048)]
[TestCase("mainnet", 1024)]
smartprogrammer93 marked this conversation as resolved.
Show resolved Hide resolved
[TestCase("holesky", 1024)]
[TestCase("sepolia", 1024)]
[TestCase("gnosis", 2048)]
[TestCase("poacore", 2048)]
[TestCase("energy", 2048)]
[TestCase("chiado", 1024)]
[TestCase("^mainnet ^spaceneth ^volta ^energy ^poacore ^gnosis ^chiado", 1024)]
[TestCase("^spaceneth ^volta ^energy ^poacore ^gnosis", 1024)]
[TestCase("spaceneth", 128)]
public void Tx_pool_defaults_are_correct(string configWildcard, int poolSize)
{
Expand Down Expand Up @@ -338,7 +338,7 @@ public void Simulating_block_production_on_every_slot_is_always_disabled(string
[TestCase("sepolia", BlobsSupportMode.StorageWithReorgs)]
[TestCase("holesky", BlobsSupportMode.StorageWithReorgs)]
[TestCase("chiado", BlobsSupportMode.StorageWithReorgs)]
[TestCase("mainnet", BlobsSupportMode.Disabled)]
[TestCase("mainnet", BlobsSupportMode.StorageWithReorgs)]
[TestCase("gnosis", BlobsSupportMode.Disabled)]
public void Blob_txs_support_is_correct(string configWildcard, BlobsSupportMode blobsSupportMode)
{
Expand Down
6 changes: 5 additions & 1 deletion src/Nethermind/Nethermind.Runner/configs/mainnet.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
"LogFileName": "mainnet.logs.txt",
"MemoryHint": 2048000000
},
"TxPool": {
"Size": 1024,
smartprogrammer93 marked this conversation as resolved.
Show resolved Hide resolved
"BlobsSupport": "StorageWithReorgs"
smartprogrammer93 marked this conversation as resolved.
Show resolved Hide resolved
},
"Sync": {
"FastSync": true,
"SnapSync": true,
Expand Down Expand Up @@ -36,4 +40,4 @@
"Merge": {
"Enabled": true
}
}
}
4 changes: 4 additions & 0 deletions src/Nethermind/Nethermind.Runner/configs/mainnet_archive.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
"LogFileName": "mainnet_archive.logs.txt",
"MemoryHint": 4096000000
},
"TxPool": {
"Size": 1024,
smartprogrammer93 marked this conversation as resolved.
Show resolved Hide resolved
"BlobsSupport": "StorageWithReorgs"
},
"Sync": {
"DownloadBodiesInFastSync": false,
"DownloadReceiptsInFastSync": false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,9 @@ public static IEnumerable<TestCaseData> MainnetActivations
yield return new TestCaseData((ForkActivation)(MainnetSpecProvider.ArrowGlacierBlockNumber - 1)) { TestName = "Before GrayGlacier" };
yield return new TestCaseData((ForkActivation)MainnetSpecProvider.ArrowGlacierBlockNumber) { TestName = "GrayGlacier" };
yield return new TestCaseData(MainnetSpecProvider.ShanghaiActivation) { TestName = "Shanghai" };
yield return new TestCaseData(new ForkActivation(99_000_000, 99_681_338_455)) { TestName = "Future" };
yield return new TestCaseData(new ForkActivation(MainnetSpecProvider.ParisBlockNumber, MainnetSpecProvider.CancunBlockTimestamp - 1)) { TestName = "Before Cancun" };
yield return new TestCaseData(MainnetSpecProvider.CancunActivation) { TestName = "Cancun" };
yield return new TestCaseData(new ForkActivation(MainnetSpecProvider.ParisBlockNumber, MainnetSpecProvider.CancunBlockTimestamp + 100000000)) { TestName = "Future" };
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Nethermind/Nethermind.Specs/MainnetSpecProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class MainnetSpecProvider : ISpecProvider
public const ulong GenesisBlockTimestamp = 0x55ba4215;
public const ulong BeaconChainGenesisTimestamp = 0x5fc63057;
public const ulong ShanghaiBlockTimestamp = 0x64373057;
public const ulong CancunBlockTimestamp = ulong.MaxValue - 3;
public const ulong CancunBlockTimestamp = 0x65F1B057;
public const ulong PragueBlockTimestamp = ulong.MaxValue - 2;
public const ulong OsakaBlockTimestamp = ulong.MaxValue - 1;

Expand Down