diff --git a/packages/beacon-node/test/spec/specTestVersioning.ts b/packages/beacon-node/test/spec/specTestVersioning.ts index e97770e8146c..7229a0236d84 100644 --- a/packages/beacon-node/test/spec/specTestVersioning.ts +++ b/packages/beacon-node/test/spec/specTestVersioning.ts @@ -15,7 +15,7 @@ import {DownloadTestsOptions} from "@lodestar/spec-test-util/downloadTests"; const __dirname = path.dirname(fileURLToPath(import.meta.url)); export const ethereumConsensusSpecsTests: DownloadTestsOptions = { - specVersion: "v1.5.0-alpha.3", + specVersion: "v1.5.0-alpha.5", // Target directory is the host package root: 'packages/*/spec-tests' outputDir: path.join(__dirname, "../../spec-tests"), specTestsRepoUrl: "https://github.com/ethereum/consensus-spec-tests", diff --git a/packages/beacon-node/test/spec/utils/specTestIterator.ts b/packages/beacon-node/test/spec/utils/specTestIterator.ts index ac0d70307d33..48a002580043 100644 --- a/packages/beacon-node/test/spec/utils/specTestIterator.ts +++ b/packages/beacon-node/test/spec/utils/specTestIterator.ts @@ -65,9 +65,10 @@ export const defaultSkipOpts: SkipOpts = { skippedTestSuites: [ /^capella\/light_client\/single_merkle_proof\/BeaconBlockBody.*/, /^deneb\/light_client\/single_merkle_proof\/BeaconBlockBody.*/, + /^electra\/light_client\/.*/, ], // TODO Electra: Review this test in the next spec test release - skippedTests: [/incorrect_not_enough_consolidation_churn_available/], + skippedTests: [/^deneb\/light_client\/sync\/.*electra_fork.*/], skippedRunners: ["merkle_proof", "networking"], }; diff --git a/packages/state-transition/src/epoch/processPendingBalanceDeposits.ts b/packages/state-transition/src/epoch/processPendingBalanceDeposits.ts index 81da34349e53..bef3ec0b2724 100644 --- a/packages/state-transition/src/epoch/processPendingBalanceDeposits.ts +++ b/packages/state-transition/src/epoch/processPendingBalanceDeposits.ts @@ -2,7 +2,6 @@ import {FAR_FUTURE_EPOCH} from "@lodestar/params"; import {CachedBeaconStateElectra, EpochTransitionCache} from "../types.js"; import {increaseBalance} from "../util/balance.js"; import {getActivationExitChurnLimit} from "../util/validator.js"; -import {getCurrentEpoch} from "../util/epoch.js"; /** * Starting from Electra: @@ -14,8 +13,8 @@ import {getCurrentEpoch} from "../util/epoch.js"; * TODO Electra: Update ssz library to support batch push to `pendingBalanceDeposits` */ export function processPendingBalanceDeposits(state: CachedBeaconStateElectra, cache: EpochTransitionCache): void { + const nextEpoch = state.epochCtx.epoch + 1; const availableForProcessing = state.depositBalanceToConsume + BigInt(getActivationExitChurnLimit(state.epochCtx)); - const currentEpoch = getCurrentEpoch(state); let processedAmount = 0n; let nextDepositIndex = 0; const depositsToPostpone = []; @@ -28,7 +27,7 @@ export function processPendingBalanceDeposits(state: CachedBeaconStateElectra, c // Validator is exiting, postpone the deposit until after withdrawable epoch if (validator.exitEpoch < FAR_FUTURE_EPOCH) { - if (currentEpoch <= validator.withdrawableEpoch) { + if (nextEpoch <= validator.withdrawableEpoch) { depositsToPostpone.push(deposit); } else { // Deposited balance will never become active. Increase balance but do not consume churn diff --git a/packages/state-transition/src/epoch/processPendingConsolidations.ts b/packages/state-transition/src/epoch/processPendingConsolidations.ts index 7d8548046e79..28178a509bba 100644 --- a/packages/state-transition/src/epoch/processPendingConsolidations.ts +++ b/packages/state-transition/src/epoch/processPendingConsolidations.ts @@ -18,6 +18,7 @@ import {switchToCompoundingValidator} from "../util/electra.js"; * */ export function processPendingConsolidations(state: CachedBeaconStateElectra, cache: EpochTransitionCache): void { + const nextEpoch = state.epochCtx.epoch + 1; let nextPendingConsolidation = 0; const validators = state.validators; const cachedBalances = cache.balances; @@ -32,7 +33,7 @@ export function processPendingConsolidations(state: CachedBeaconStateElectra, ca continue; } - if (sourceValidator.withdrawableEpoch > state.epochCtx.epoch) { + if (sourceValidator.withdrawableEpoch > nextEpoch) { break; } // Churn any target excess active balance of target and raise its max