From 736bd80c0143970465b958a46f4f7d91067b2012 Mon Sep 17 00:00:00 2001 From: terence tsao Date: Sun, 24 Nov 2024 13:41:24 -0800 Subject: [PATCH] Update earlist exit epoch for upgrade to electra --- beacon-chain/core/electra/upgrade.go | 2 +- beacon-chain/core/electra/upgrade_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/beacon-chain/core/electra/upgrade.go b/beacon-chain/core/electra/upgrade.go index 2364db01f43..5eaff157a7f 100644 --- a/beacon-chain/core/electra/upgrade.go +++ b/beacon-chain/core/electra/upgrade.go @@ -187,7 +187,7 @@ func UpgradeToElectra(beaconState state.BeaconState) (state.BeaconState, error) } // [New in Electra:EIP7251] - earliestExitEpoch := time.CurrentEpoch(beaconState) + earliestExitEpoch := helpers.ActivationExitEpoch(time.CurrentEpoch(beaconState)) preActivationIndices := make([]primitives.ValidatorIndex, 0) compoundWithdrawalIndices := make([]primitives.ValidatorIndex, 0) if err = beaconState.ReadFromEveryValidator(func(index int, val state.ReadOnlyValidator) error { diff --git a/beacon-chain/core/electra/upgrade_test.go b/beacon-chain/core/electra/upgrade_test.go index 40f2f754c5a..c80aef5f185 100644 --- a/beacon-chain/core/electra/upgrade_test.go +++ b/beacon-chain/core/electra/upgrade_test.go @@ -159,7 +159,7 @@ func TestUpgradeToElectra(t *testing.T) { eee, err := mSt.EarliestExitEpoch() require.NoError(t, err) - require.Equal(t, primitives.Epoch(1), eee) + require.Equal(t, helpers.ActivationExitEpoch(primitives.Epoch(1)), eee) cbtc, err := mSt.ConsolidationBalanceToConsume() require.NoError(t, err)