Skip to content

Commit

Permalink
Update earlist exit epoch for upgrade to electra
Browse files Browse the repository at this point in the history
  • Loading branch information
terencechain committed Nov 24, 2024
1 parent 415a42a commit 736bd80
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion beacon-chain/core/electra/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/core/electra/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 736bd80

Please sign in to comment.