From 87d3e885a309b16e4ea2c11d8bfa724fa6798116 Mon Sep 17 00:00:00 2001 From: Nazar Hussain Date: Sat, 13 Jan 2024 15:35:52 +0100 Subject: [PATCH] Update the shangai ttd calculation --- .../cli/test/utils/simulation/execution_clients/index.ts | 3 +-- packages/cli/test/utils/simulation/utils/index.ts | 8 +++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/packages/cli/test/utils/simulation/execution_clients/index.ts b/packages/cli/test/utils/simulation/execution_clients/index.ts index 62e35284677b..b0d4086e663d 100644 --- a/packages/cli/test/utils/simulation/execution_clients/index.ts +++ b/packages/cli/test/utils/simulation/execution_clients/index.ts @@ -29,9 +29,8 @@ export async function createExecutionNode( shanghaiTime: options.shanghaiTime ?? getEstimatedShanghaiTime({ - genesisDelaySeconds: forkConfig.GENESIS_DELAY, capellaForkEpoch: forkConfig.CAPELLA_FORK_EPOCH, - eth1GenesisTime: options.genesisTime, + genesisTime: options.genesisTime, secondsPerSlot: forkConfig.SECONDS_PER_SLOT, additionalSlots: 0, }), diff --git a/packages/cli/test/utils/simulation/utils/index.ts b/packages/cli/test/utils/simulation/utils/index.ts index 9afd174d860b..dfa66bed6580 100644 --- a/packages/cli/test/utils/simulation/utils/index.ts +++ b/packages/cli/test/utils/simulation/utils/index.ts @@ -100,21 +100,19 @@ export const getEstimatedTTD = ({ }; export const getEstimatedShanghaiTime = ({ - genesisDelaySeconds, - eth1GenesisTime, + genesisTime, secondsPerSlot, capellaForkEpoch, additionalSlots, }: { - genesisDelaySeconds: number; - eth1GenesisTime: number; + genesisTime: number; secondsPerSlot: number; capellaForkEpoch: number; additionalSlots: number; }): number => { const secondsTillCapella = capellaForkEpoch * activePreset.SLOTS_PER_EPOCH * secondsPerSlot; - return eth1GenesisTime + genesisDelaySeconds + secondsTillCapella + additionalSlots * secondsPerSlot; + return genesisTime + secondsTillCapella + additionalSlots * secondsPerSlot; }; export const squeezeString = (val: string, length: number, sep = "..."): string => {