From e44ca0c9e04f1d42cbf9d539134bf531452a9624 Mon Sep 17 00:00:00 2001 From: harkamal Date: Wed, 6 Sep 2023 18:50:20 +0530 Subject: [PATCH] working local build with kaunstinen v2 geth build --- packages/config/src/forkConfig/index.ts | 2 +- packages/params/src/forkName.ts | 2 +- packages/state-transition/src/util/genesis.ts | 9 +++++++++ packages/validator/src/services/block.ts | 1 + 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/config/src/forkConfig/index.ts b/packages/config/src/forkConfig/index.ts index 38c42a3af31d..afe6b6705272 100644 --- a/packages/config/src/forkConfig/index.ts +++ b/packages/config/src/forkConfig/index.ts @@ -66,7 +66,7 @@ export function createForkConfig(config: ChainConfig): ForkConfig { /** Forks in order order of occurence, `phase0` first */ // Note: Downstream code relies on proper ordering. - const forks = {phase0, altair, bellatrix, capella, deneb, verge}; + const forks = {phase0, altair, bellatrix, capella, verge, deneb}; // Prevents allocating an array on every getForkInfo() call const forksAscendingEpochOrder = Object.values(forks); diff --git a/packages/params/src/forkName.ts b/packages/params/src/forkName.ts index 4cdc7bc5bb12..22e075206ff4 100644 --- a/packages/params/src/forkName.ts +++ b/packages/params/src/forkName.ts @@ -46,5 +46,5 @@ export function isForkVerge(fork: ForkName): fork is ForkBlobs { export type ForkBlobs = Exclude; export function isForkBlobs(fork: ForkName): fork is ForkBlobs { - return isForkWithdrawals(fork) && fork !== ForkName.capella; + return isForkWithdrawals(fork) && fork !== ForkName.verge; } diff --git a/packages/state-transition/src/util/genesis.ts b/packages/state-transition/src/util/genesis.ts index b3f001056659..99cbeb7f7a9f 100644 --- a/packages/state-transition/src/util/genesis.ts +++ b/packages/state-transition/src/util/genesis.ts @@ -285,6 +285,15 @@ export function initializeBeaconStateFromEth1( ssz.deneb.ExecutionPayloadHeader.defaultViewDU(); } + if (GENESIS_SLOT >= config.VERGE_FORK_EPOCH) { + const stateVerge = state as CompositeViewDU; + stateVerge.fork.previousVersion = config.VERGE_FORK_VERSION; + stateVerge.fork.currentVersion = config.VERGE_FORK_VERSION; + stateVerge.latestExecutionPayloadHeader = + (executionPayloadHeader as CompositeViewDU) ?? + ssz.verge.ExecutionPayloadHeader.defaultViewDU(); + } + state.commit(); return state; diff --git a/packages/validator/src/services/block.ts b/packages/validator/src/services/block.ts index 81c749297f48..048f107b1e81 100644 --- a/packages/validator/src/services/block.ts +++ b/packages/validator/src/services/block.ts @@ -370,6 +370,7 @@ export class BlockProposingService { } // All subsequent forks are expected to use v2 too + case ForkName.verge: case ForkName.altair: case ForkName.bellatrix: case ForkName.capella: {