From 3377cb4058b6d04889299c8c7c4d055533689f09 Mon Sep 17 00:00:00 2001 From: nisdas Date: Fri, 8 Mar 2024 20:07:26 +0800 Subject: [PATCH 1/6] add them --- .../stateutil/unrealized_justification.go | 15 +++++++++++++++ .../justification_and_finalization.go | 5 +++++ .../justification_and_finalization.go | 5 +++++ .../justification_and_finalization.go | 5 +++++ .../justification_and_finalization.go | 6 +++++- .../spectest/shared/deneb/rewards/BUILD.bazel | 1 + .../shared/deneb/rewards/rewards_penalties.go | 18 ++++++++++++++++++ 7 files changed, 54 insertions(+), 1 deletion(-) diff --git a/beacon-chain/state/stateutil/unrealized_justification.go b/beacon-chain/state/stateutil/unrealized_justification.go index 81d9b8aa2e15..4254d89d336d 100644 --- a/beacon-chain/state/stateutil/unrealized_justification.go +++ b/beacon-chain/state/stateutil/unrealized_justification.go @@ -51,5 +51,20 @@ func UnrealizedCheckpointBalances(cp, pp []byte, validators ValReader, currentEp } } } + activeBalance, prevTarget, currentTarget = ensureLowerBound(activeBalance, prevTarget, currentTarget) return activeBalance, prevTarget, currentTarget, nil } + +func ensureLowerBound(activeCurrEpoch, prevTargetAttested, currTargetAttested uint64) (uint64, uint64, uint64) { + ebi := params.BeaconConfig().EffectiveBalanceIncrement + if ebi > activeCurrEpoch { + activeCurrEpoch = ebi + } + if ebi > prevTargetAttested { + prevTargetAttested = ebi + } + if ebi > currTargetAttested { + currTargetAttested = ebi + } + return activeCurrEpoch, prevTargetAttested, currTargetAttested +} diff --git a/testing/spectest/shared/altair/epoch_processing/justification_and_finalization.go b/testing/spectest/shared/altair/epoch_processing/justification_and_finalization.go index 2b7ad59efaa7..75e4859b167f 100644 --- a/testing/spectest/shared/altair/epoch_processing/justification_and_finalization.go +++ b/testing/spectest/shared/altair/epoch_processing/justification_and_finalization.go @@ -35,6 +35,11 @@ func processJustificationAndFinalizationPrecomputeWrapper(t *testing.T, st state require.NoError(t, err) _, bp, err = altair.ProcessEpochParticipation(ctx, st, bp, vp) require.NoError(t, err) + activeBal, targetPrevious, targetCurrent, err := st.UnrealizedCheckpointBalances() + require.NoError(t, err) + require.Equal(t, bp.ActiveCurrentEpoch, activeBal) + require.Equal(t, bp.CurrentEpochTargetAttested, targetCurrent) + require.Equal(t, bp.PrevEpochTargetAttested, targetPrevious) st, err = precompute.ProcessJustificationAndFinalizationPreCompute(st, bp) require.NoError(t, err, "Could not process justification") diff --git a/testing/spectest/shared/bellatrix/epoch_processing/justification_and_finalization.go b/testing/spectest/shared/bellatrix/epoch_processing/justification_and_finalization.go index 8ec021a38601..36f8d6c0327d 100644 --- a/testing/spectest/shared/bellatrix/epoch_processing/justification_and_finalization.go +++ b/testing/spectest/shared/bellatrix/epoch_processing/justification_and_finalization.go @@ -35,6 +35,11 @@ func processJustificationAndFinalizationPrecomputeWrapper(t *testing.T, st state require.NoError(t, err) _, bp, err = altair.ProcessEpochParticipation(ctx, st, bp, vp) require.NoError(t, err) + activeBal, targetPrevious, targetCurrent, err := st.UnrealizedCheckpointBalances() + require.NoError(t, err) + require.Equal(t, bp.ActiveCurrentEpoch, activeBal) + require.Equal(t, bp.CurrentEpochTargetAttested, targetCurrent) + require.Equal(t, bp.PrevEpochTargetAttested, targetPrevious) st, err = precompute.ProcessJustificationAndFinalizationPreCompute(st, bp) require.NoError(t, err, "Could not process justification") diff --git a/testing/spectest/shared/capella/epoch_processing/justification_and_finalization.go b/testing/spectest/shared/capella/epoch_processing/justification_and_finalization.go index bbb5e5b78dad..b818d5f34e18 100644 --- a/testing/spectest/shared/capella/epoch_processing/justification_and_finalization.go +++ b/testing/spectest/shared/capella/epoch_processing/justification_and_finalization.go @@ -35,6 +35,11 @@ func processJustificationAndFinalizationPrecomputeWrapper(t *testing.T, st state require.NoError(t, err) _, bp, err = altair.ProcessEpochParticipation(ctx, st, bp, vp) require.NoError(t, err) + activeBal, targetPrevious, targetCurrent, err := st.UnrealizedCheckpointBalances() + require.NoError(t, err) + require.Equal(t, bp.ActiveCurrentEpoch, activeBal) + require.Equal(t, bp.CurrentEpochTargetAttested, targetCurrent) + require.Equal(t, bp.PrevEpochTargetAttested, targetPrevious) st, err = precompute.ProcessJustificationAndFinalizationPreCompute(st, bp) require.NoError(t, err, "Could not process justification") diff --git a/testing/spectest/shared/deneb/epoch_processing/justification_and_finalization.go b/testing/spectest/shared/deneb/epoch_processing/justification_and_finalization.go index b6f9bb243482..574feddc5db6 100644 --- a/testing/spectest/shared/deneb/epoch_processing/justification_and_finalization.go +++ b/testing/spectest/shared/deneb/epoch_processing/justification_and_finalization.go @@ -32,7 +32,11 @@ func processJustificationAndFinalizationPrecomputeWrapper(t *testing.T, st state require.NoError(t, err) _, bp, err = altair.ProcessEpochParticipation(ctx, st, bp, vp) require.NoError(t, err) - + activeBal, targetPrevious, targetCurrent, err := st.UnrealizedCheckpointBalances() + require.NoError(t, err) + require.Equal(t, bp.ActiveCurrentEpoch, activeBal) + require.Equal(t, bp.CurrentEpochTargetAttested, targetCurrent) + require.Equal(t, bp.PrevEpochTargetAttested, targetPrevious) st, err = precompute.ProcessJustificationAndFinalizationPreCompute(st, bp) require.NoError(t, err, "Could not process justification") diff --git a/testing/spectest/shared/deneb/rewards/BUILD.bazel b/testing/spectest/shared/deneb/rewards/BUILD.bazel index 4cb111008637..aa66b963300f 100644 --- a/testing/spectest/shared/deneb/rewards/BUILD.bazel +++ b/testing/spectest/shared/deneb/rewards/BUILD.bazel @@ -9,6 +9,7 @@ go_library( deps = [ "//beacon-chain/core/altair:go_default_library", "//beacon-chain/core/helpers:go_default_library", + "//beacon-chain/core/time:go_default_library", "//beacon-chain/state/state-native:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//testing/require:go_default_library", diff --git a/testing/spectest/shared/deneb/rewards/rewards_penalties.go b/testing/spectest/shared/deneb/rewards/rewards_penalties.go index abc8369dd0dd..cb8317fdba15 100644 --- a/testing/spectest/shared/deneb/rewards/rewards_penalties.go +++ b/testing/spectest/shared/deneb/rewards/rewards_penalties.go @@ -67,11 +67,29 @@ func runPrecomputeRewardsAndPenaltiesTest(t *testing.T, testFolderPath string) { require.NoError(t, preBeaconStateBase.UnmarshalSSZ(preBeaconStateSSZ), "Failed to unmarshal") preBeaconState, err := state_native.InitializeFromProtoDeneb(preBeaconStateBase) require.NoError(t, err) + // currentEpoch := time.CurrentEpoch(preBeaconState) vp, bp, err := altair.InitializePrecomputeValidators(ctx, preBeaconState) require.NoError(t, err) + vp, bp, err = altair.ProcessEpochParticipation(ctx, preBeaconState, bp, vp) require.NoError(t, err) + // vals := preBeaconState.Validators() + /* + for i, v := range vals { + activeCurrent := v.ActivationEpoch <= currentEpoch && currentEpoch < v.ExitEpoch + require.Equal(t, activeCurrent, vp[i].IsActiveCurrentEpoch, fmt.Sprintf("index %d has a mismatch", i)) + activePrevious := v.ActivationEpoch+1 <= currentEpoch && currentEpoch <= v.ExitEpoch + require.Equal(t, activePrevious, vp[i].IsActivePrevEpoch, fmt.Sprintf("index %d has a mismatch", i)) + } + */ + + activeBal, targetPrevious, targetCurrent, err := preBeaconState.UnrealizedCheckpointBalances() + require.NoError(t, err) + require.Equal(t, bp.ActiveCurrentEpoch, activeBal) + require.Equal(t, bp.CurrentEpochTargetAttested, targetCurrent) + require.Equal(t, bp.PrevEpochTargetAttested, targetPrevious) + deltas, err := altair.AttestationsDelta(preBeaconState, bp, vp) require.NoError(t, err) From 3485e6cfea5c043479635246855282438452654c Mon Sep 17 00:00:00 2001 From: Potuz Date: Fri, 8 Mar 2024 10:08:01 -0300 Subject: [PATCH 2/6] Ensure activation epoch does not overflow --- beacon-chain/state/stateutil/unrealized_justification.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beacon-chain/state/stateutil/unrealized_justification.go b/beacon-chain/state/stateutil/unrealized_justification.go index 4254d89d336d..0c6792ba2ab4 100644 --- a/beacon-chain/state/stateutil/unrealized_justification.go +++ b/beacon-chain/state/stateutil/unrealized_justification.go @@ -43,7 +43,7 @@ func UnrealizedCheckpointBalances(cp, pp []byte, validators ValReader, currentEp return 0, 0, 0, err } } - activePrevious := v.ActivationEpoch+1 <= currentEpoch && currentEpoch <= v.ExitEpoch + activePrevious := v.ActivationEpoch < params.BeaconConfig().FarFutureEpoch && v.ActivationEpoch+1 <= currentEpoch && currentEpoch <= v.ExitEpoch if activePrevious && ((pp[i]>>targetIdx)&1) == 1 { prevTarget, err = math.Add64(prevTarget, v.EffectiveBalance) if err != nil { From f6a1ba6165ae6fd02fa1b02903da72d991da7ecb Mon Sep 17 00:00:00 2001 From: nisdas Date: Fri, 8 Mar 2024 21:21:12 +0800 Subject: [PATCH 3/6] add them all in --- .../shared/altair/rewards/rewards_penalties.go | 7 +++++++ .../shared/bellatrix/rewards/rewards_penalties.go | 7 +++++++ .../shared/capella/rewards/rewards_penalties.go | 7 +++++++ testing/spectest/shared/deneb/rewards/BUILD.bazel | 1 - .../spectest/shared/deneb/rewards/rewards_penalties.go | 10 ---------- 5 files changed, 21 insertions(+), 11 deletions(-) diff --git a/testing/spectest/shared/altair/rewards/rewards_penalties.go b/testing/spectest/shared/altair/rewards/rewards_penalties.go index ec4a7fca62df..3162f5f086d5 100644 --- a/testing/spectest/shared/altair/rewards/rewards_penalties.go +++ b/testing/spectest/shared/altair/rewards/rewards_penalties.go @@ -76,6 +76,13 @@ func runPrecomputeRewardsAndPenaltiesTest(t *testing.T, testFolderPath string) { require.NoError(t, err) vp, bp, err = altair.ProcessEpochParticipation(ctx, preBeaconState, bp, vp) require.NoError(t, err) + + activeBal, targetPrevious, targetCurrent, err := preBeaconState.UnrealizedCheckpointBalances() + require.NoError(t, err) + require.Equal(t, bp.ActiveCurrentEpoch, activeBal) + require.Equal(t, bp.CurrentEpochTargetAttested, targetCurrent) + require.Equal(t, bp.PrevEpochTargetAttested, targetPrevious) + deltas, err := altair.AttestationsDelta(preBeaconState, bp, vp) require.NoError(t, err) diff --git a/testing/spectest/shared/bellatrix/rewards/rewards_penalties.go b/testing/spectest/shared/bellatrix/rewards/rewards_penalties.go index 3ae1f613eb09..624d73b3f2ae 100644 --- a/testing/spectest/shared/bellatrix/rewards/rewards_penalties.go +++ b/testing/spectest/shared/bellatrix/rewards/rewards_penalties.go @@ -80,6 +80,13 @@ func runPrecomputeRewardsAndPenaltiesTest(t *testing.T, testFolderPath string) { require.NoError(t, err) vp, bp, err = altair.ProcessEpochParticipation(ctx, preBeaconState, bp, vp) require.NoError(t, err) + + activeBal, targetPrevious, targetCurrent, err := preBeaconState.UnrealizedCheckpointBalances() + require.NoError(t, err) + require.Equal(t, bp.ActiveCurrentEpoch, activeBal) + require.Equal(t, bp.CurrentEpochTargetAttested, targetCurrent) + require.Equal(t, bp.PrevEpochTargetAttested, targetPrevious) + deltas, err := altair.AttestationsDelta(preBeaconState, bp, vp) require.NoError(t, err) diff --git a/testing/spectest/shared/capella/rewards/rewards_penalties.go b/testing/spectest/shared/capella/rewards/rewards_penalties.go index cdb60a471011..1651cd64630e 100644 --- a/testing/spectest/shared/capella/rewards/rewards_penalties.go +++ b/testing/spectest/shared/capella/rewards/rewards_penalties.go @@ -80,6 +80,13 @@ func runPrecomputeRewardsAndPenaltiesTest(t *testing.T, testFolderPath string) { require.NoError(t, err) vp, bp, err = altair.ProcessEpochParticipation(ctx, preBeaconState, bp, vp) require.NoError(t, err) + + activeBal, targetPrevious, targetCurrent, err := preBeaconState.UnrealizedCheckpointBalances() + require.NoError(t, err) + require.Equal(t, bp.ActiveCurrentEpoch, activeBal) + require.Equal(t, bp.CurrentEpochTargetAttested, targetCurrent) + require.Equal(t, bp.PrevEpochTargetAttested, targetPrevious) + deltas, err := altair.AttestationsDelta(preBeaconState, bp, vp) require.NoError(t, err) diff --git a/testing/spectest/shared/deneb/rewards/BUILD.bazel b/testing/spectest/shared/deneb/rewards/BUILD.bazel index aa66b963300f..4cb111008637 100644 --- a/testing/spectest/shared/deneb/rewards/BUILD.bazel +++ b/testing/spectest/shared/deneb/rewards/BUILD.bazel @@ -9,7 +9,6 @@ go_library( deps = [ "//beacon-chain/core/altair:go_default_library", "//beacon-chain/core/helpers:go_default_library", - "//beacon-chain/core/time:go_default_library", "//beacon-chain/state/state-native:go_default_library", "//proto/prysm/v1alpha1:go_default_library", "//testing/require:go_default_library", diff --git a/testing/spectest/shared/deneb/rewards/rewards_penalties.go b/testing/spectest/shared/deneb/rewards/rewards_penalties.go index cb8317fdba15..41bda166ce1f 100644 --- a/testing/spectest/shared/deneb/rewards/rewards_penalties.go +++ b/testing/spectest/shared/deneb/rewards/rewards_penalties.go @@ -67,22 +67,12 @@ func runPrecomputeRewardsAndPenaltiesTest(t *testing.T, testFolderPath string) { require.NoError(t, preBeaconStateBase.UnmarshalSSZ(preBeaconStateSSZ), "Failed to unmarshal") preBeaconState, err := state_native.InitializeFromProtoDeneb(preBeaconStateBase) require.NoError(t, err) - // currentEpoch := time.CurrentEpoch(preBeaconState) vp, bp, err := altair.InitializePrecomputeValidators(ctx, preBeaconState) require.NoError(t, err) vp, bp, err = altair.ProcessEpochParticipation(ctx, preBeaconState, bp, vp) require.NoError(t, err) - // vals := preBeaconState.Validators() - /* - for i, v := range vals { - activeCurrent := v.ActivationEpoch <= currentEpoch && currentEpoch < v.ExitEpoch - require.Equal(t, activeCurrent, vp[i].IsActiveCurrentEpoch, fmt.Sprintf("index %d has a mismatch", i)) - activePrevious := v.ActivationEpoch+1 <= currentEpoch && currentEpoch <= v.ExitEpoch - require.Equal(t, activePrevious, vp[i].IsActivePrevEpoch, fmt.Sprintf("index %d has a mismatch", i)) - } - */ activeBal, targetPrevious, targetCurrent, err := preBeaconState.UnrealizedCheckpointBalances() require.NoError(t, err) From bcc415f3ace81e9b6a5ce90196ea9b9c5cb05499 Mon Sep 17 00:00:00 2001 From: Potuz Date: Fri, 8 Mar 2024 10:24:59 -0300 Subject: [PATCH 4/6] better check for overflow --- beacon-chain/state/stateutil/unrealized_justification.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beacon-chain/state/stateutil/unrealized_justification.go b/beacon-chain/state/stateutil/unrealized_justification.go index 0c6792ba2ab4..7ca4eac6b14f 100644 --- a/beacon-chain/state/stateutil/unrealized_justification.go +++ b/beacon-chain/state/stateutil/unrealized_justification.go @@ -43,7 +43,7 @@ func UnrealizedCheckpointBalances(cp, pp []byte, validators ValReader, currentEp return 0, 0, 0, err } } - activePrevious := v.ActivationEpoch < params.BeaconConfig().FarFutureEpoch && v.ActivationEpoch+1 <= currentEpoch && currentEpoch <= v.ExitEpoch + activePrevious := v.ActivationEpoch < currentEpoch && currentEpoch <= v.ExitEpoch if activePrevious && ((pp[i]>>targetIdx)&1) == 1 { prevTarget, err = math.Add64(prevTarget, v.EffectiveBalance) if err != nil { From b022a446344cd0a13ebfc94774b917b2c6bdaa08 Mon Sep 17 00:00:00 2001 From: nisdas Date: Fri, 8 Mar 2024 21:46:23 +0800 Subject: [PATCH 5/6] fix tests --- .../unrealized_justification_test.go | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/beacon-chain/state/stateutil/unrealized_justification_test.go b/beacon-chain/state/stateutil/unrealized_justification_test.go index f6a3500c51a6..e87c240ecc76 100644 --- a/beacon-chain/state/stateutil/unrealized_justification_test.go +++ b/beacon-chain/state/stateutil/unrealized_justification_test.go @@ -29,8 +29,8 @@ func TestState_UnrealizedCheckpointBalances(t *testing.T) { active, previous, current, err := UnrealizedCheckpointBalances(cp, pp, NewValSliceReader(validators), 0) require.NoError(tt, err) require.Equal(tt, expectedActive, active) - require.Equal(tt, uint64(0), current) - require.Equal(tt, uint64(0), previous) + require.Equal(tt, params.BeaconConfig().EffectiveBalanceIncrement, current) + require.Equal(tt, params.BeaconConfig().EffectiveBalanceIncrement, previous) }) t.Run("bad votes in last two epochs", func(tt *testing.T) { @@ -39,8 +39,8 @@ func TestState_UnrealizedCheckpointBalances(t *testing.T) { active, previous, current, err := UnrealizedCheckpointBalances(cp, pp, NewValSliceReader(validators), 1) require.NoError(tt, err) require.Equal(tt, expectedActive, active) - require.Equal(tt, uint64(0), current) - require.Equal(tt, uint64(0), previous) + require.Equal(tt, params.BeaconConfig().EffectiveBalanceIncrement, current) + require.Equal(tt, params.BeaconConfig().EffectiveBalanceIncrement, previous) }) t.Run("two votes in last epoch", func(tt *testing.T) { @@ -50,7 +50,7 @@ func TestState_UnrealizedCheckpointBalances(t *testing.T) { require.NoError(tt, err) require.Equal(tt, expectedActive, active) require.Equal(tt, 2*params.BeaconConfig().MaxEffectiveBalance, current) - require.Equal(tt, uint64(0), previous) + require.Equal(tt, params.BeaconConfig().EffectiveBalanceIncrement, previous) }) t.Run("two votes in previous epoch", func(tt *testing.T) { @@ -59,7 +59,7 @@ func TestState_UnrealizedCheckpointBalances(t *testing.T) { active, previous, current, err := UnrealizedCheckpointBalances(cp, pp, NewValSliceReader(validators), 1) require.NoError(tt, err) require.Equal(tt, expectedActive, active) - require.Equal(tt, uint64(0), current) + require.Equal(tt, params.BeaconConfig().EffectiveBalanceIncrement, current) require.Equal(tt, 2*params.BeaconConfig().MaxEffectiveBalance, previous) }) @@ -118,8 +118,8 @@ func TestState_MVSlice_UnrealizedCheckpointBalances(t *testing.T) { active, previous, current, err := UnrealizedCheckpointBalances(cp, pp, NewValMultiValueSliceReader(mv, &testObject{id: 0}), 0) require.NoError(tt, err) require.Equal(tt, expectedActive, active) - require.Equal(tt, uint64(0), current) - require.Equal(tt, uint64(0), previous) + require.Equal(tt, params.BeaconConfig().EffectiveBalanceIncrement, current) + require.Equal(tt, params.BeaconConfig().EffectiveBalanceIncrement, previous) }) t.Run("bad votes in last two epochs", func(tt *testing.T) { @@ -128,8 +128,8 @@ func TestState_MVSlice_UnrealizedCheckpointBalances(t *testing.T) { active, previous, current, err := UnrealizedCheckpointBalances(cp, pp, NewValMultiValueSliceReader(mv, &testObject{id: 0}), 1) require.NoError(tt, err) require.Equal(tt, expectedActive, active) - require.Equal(tt, uint64(0), current) - require.Equal(tt, uint64(0), previous) + require.Equal(tt, params.BeaconConfig().EffectiveBalanceIncrement, current) + require.Equal(tt, params.BeaconConfig().EffectiveBalanceIncrement, previous) }) t.Run("two votes in last epoch", func(tt *testing.T) { @@ -139,7 +139,7 @@ func TestState_MVSlice_UnrealizedCheckpointBalances(t *testing.T) { require.NoError(tt, err) require.Equal(tt, expectedActive, active) require.Equal(tt, 2*params.BeaconConfig().MaxEffectiveBalance, current) - require.Equal(tt, uint64(0), previous) + require.Equal(tt, params.BeaconConfig().EffectiveBalanceIncrement, previous) }) t.Run("two votes in previous epoch", func(tt *testing.T) { @@ -148,7 +148,7 @@ func TestState_MVSlice_UnrealizedCheckpointBalances(t *testing.T) { active, previous, current, err := UnrealizedCheckpointBalances(cp, pp, NewValMultiValueSliceReader(mv, &testObject{id: 0}), 1) require.NoError(tt, err) require.Equal(tt, expectedActive, active) - require.Equal(tt, uint64(0), current) + require.Equal(tt, params.BeaconConfig().EffectiveBalanceIncrement, current) require.Equal(tt, 2*params.BeaconConfig().MaxEffectiveBalance, previous) }) From 6cd20e5dd16be4d04c1364ff238d322f0687bbce Mon Sep 17 00:00:00 2001 From: nisdas Date: Fri, 8 Mar 2024 21:50:01 +0800 Subject: [PATCH 6/6] fix tests --- .../state/state-native/getters_participation_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/beacon-chain/state/state-native/getters_participation_test.go b/beacon-chain/state/state-native/getters_participation_test.go index c30fdaa80b76..b5aac094ed3a 100644 --- a/beacon-chain/state/state-native/getters_participation_test.go +++ b/beacon-chain/state/state-native/getters_participation_test.go @@ -35,8 +35,8 @@ func TestState_UnrealizedCheckpointBalances(t *testing.T) { active, previous, current, err := state.UnrealizedCheckpointBalances() require.NoError(t, err) require.Equal(t, allActive, active) - require.Equal(t, uint64(0), current) - require.Equal(t, uint64(0), previous) + require.Equal(t, params.BeaconConfig().EffectiveBalanceIncrement, current) + require.Equal(t, params.BeaconConfig().EffectiveBalanceIncrement, previous) // Add some votes in the last two epochs: base.CurrentEpochParticipation[0] = 0xFF @@ -58,7 +58,7 @@ func TestState_UnrealizedCheckpointBalances(t *testing.T) { active, previous, current, err = state.UnrealizedCheckpointBalances() require.NoError(t, err) require.Equal(t, allActive, active) - require.Equal(t, uint64(0), current) + require.Equal(t, params.BeaconConfig().EffectiveBalanceIncrement, current) require.Equal(t, params.BeaconConfig().MaxEffectiveBalance, previous) }