Skip to content

Commit d319a0d

Browse files
fix: remove slashValidator gating on active status (#448)
Causing failures on deployment throwing with: ``` 2026-06-26 05:53:29.875 Error: InCorrectCurrentTargetUnslashedBalance 2026-06-26 05:53:29.875 at BeaconChain.verifyBlocksInEpoch (file:///usr/src/lodestar/packages/beacon-node/src/chain/blocks/verifyBlock.ts:176:7) 2026-06-26 05:53:29.875 at JobItemQueue.runJob (file:///usr/src/lodestar/packages/beacon-node/src/util/queue/itemQueue.ts:149:22) 2026-06-26 05:53:29.875 at NativeBeaconStateView.stateTransition (file:///usr/src/lodestar/packages/state-transition/src/stateView/nativeBeaconStateView.ts:661:54) ``` See: https://github.com/ChainSafe/lodestar/blob/848b01419b92832ea4d0d6b32595641e3cf5cd75/packages/state-transition/src/block/slashValidator.ts#L87-L95
1 parent 0088a29 commit d319a0d

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

src/state_transition/block/slash_validator.zig

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ const SlashingsCache = @import("../cache/slashings_cache.zig").SlashingsCache;
1010
const decreaseBalance = @import("../utils/balance.zig").decreaseBalance;
1111
const increaseBalance = @import("../utils/balance.zig").increaseBalance;
1212
const initiateValidatorExit = @import("./initiate_validator_exit.zig").initiateValidatorExit;
13-
const computePreviousEpoch = @import("../utils/epoch.zig").computePreviousEpoch;
14-
const isActiveValidatorView = @import("../utils/validator.zig").isActiveValidatorView;
1513
const getBeaconProposer = @import("../cache/get_beacon_proposer.zig").getBeaconProposer;
1614

1715
/// Same to https://github.com/ethereum/eth2.0-specs/blob/v1.1.0-alpha.5/specs/altair/beacon-chain.md#has_flag
@@ -93,20 +91,16 @@ pub fn slashValidator(
9391
}
9492

9593
if (fork.gte(.altair)) {
96-
const previous_epoch = computePreviousEpoch(epoch);
97-
const is_active_previous_epoch = try isActiveValidatorView(validator, previous_epoch);
98-
const is_active_current_epoch = try isActiveValidatorView(validator, epoch);
99-
10094
var previous_participation = try state.previousEpochParticipation();
101-
if (is_active_previous_epoch and (try previous_participation.get(@intCast(slashed_index))) & TIMELY_TARGET == TIMELY_TARGET) {
95+
if ((try previous_participation.get(@intCast(slashed_index))) & TIMELY_TARGET == TIMELY_TARGET) {
10296
if (epoch_cache.previous_target_unslashed_balance_increments < slashed_effective_balance_increments) {
10397
return error.PreviousTargetUnslashedBalanceUnderflow;
10498
}
10599
epoch_cache.previous_target_unslashed_balance_increments -= slashed_effective_balance_increments;
106100
}
107101

108102
var current_participation = try state.currentEpochParticipation();
109-
if (is_active_current_epoch and (try current_participation.get(@intCast(slashed_index))) & TIMELY_TARGET == TIMELY_TARGET) {
103+
if ((try current_participation.get(@intCast(slashed_index))) & TIMELY_TARGET == TIMELY_TARGET) {
110104
if (epoch_cache.current_target_unslashed_balance_increments < slashed_effective_balance_increments) {
111105
return error.CurrentTargetUnslashedBalanceUnderflow;
112106
}

0 commit comments

Comments
 (0)