Skip to content

Commit

Permalink
Update the shangai ttd calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
nazarhussain committed Jan 16, 2024
1 parent 96f3e9d commit 87d3e88
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ export async function createExecutionNode<E extends ExecutionClient>(
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,
}),
Expand Down
8 changes: 3 additions & 5 deletions packages/cli/test/utils/simulation/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down

0 comments on commit 87d3e88

Please sign in to comment.