-
Notifications
You must be signed in to change notification settings - Fork 465
/
Copy pathHoleskySpecProvider.cs
51 lines (43 loc) · 1.69 KB
/
HoleskySpecProvider.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// SPDX-FileCopyrightText: 2022 Demerzel Solutions Limited
// SPDX-License-Identifier: LGPL-3.0-only
using Nethermind.Core;
using Nethermind.Core.Specs;
using Nethermind.Int256;
using Nethermind.Specs.Forks;
namespace Nethermind.Specs;
public class HoleskySpecProvider : ISpecProvider
{
public const ulong GenesisTimestamp = 0x65046360;
public const ulong ShanghaiTimestamp = 0x6505e360;
// public const ulong CancunTimestamp = 0x77359400;
private HoleskySpecProvider() { }
public IReleaseSpec GetSpec(ForkActivation forkActivation)
{
return forkActivation.Timestamp switch
{
null or < ShanghaiTimestamp => GenesisSpec,
// < CancunTimestamp => Shanghai.Instance,
_ => Shanghai.Instance
};
}
public void UpdateMergeTransitionInfo(long? blockNumber, UInt256? terminalTotalDifficulty = null)
{
if (blockNumber is not null)
MergeBlockNumber = (ForkActivation)blockNumber;
if (terminalTotalDifficulty is not null)
TerminalTotalDifficulty = terminalTotalDifficulty;
}
public ulong NetworkId => BlockchainIds.Holesky;
public ulong ChainId => NetworkId;
public long? DaoBlockNumber => null;
public ForkActivation? MergeBlockNumber { get; private set; } = (0, GenesisTimestamp);
public ulong TimestampFork => ShanghaiTimestamp;
public UInt256? TerminalTotalDifficulty { get; private set; } = 0;
public IReleaseSpec GenesisSpec { get; } = London.Instance;
public ForkActivation[] TransitionActivations { get; } =
{
(1, ShanghaiTimestamp),
// (2, CancunTimestamp)
};
public static readonly HoleskySpecProvider Instance = new();
}