Skip to content

Commit

Permalink
minor optimize process_active_validator: avoid a call to `state.get_v…
Browse files Browse the repository at this point in the history
…alidator` (sigp#4608)
  • Loading branch information
zhiqiangxu authored and Woodpile37 committed Jan 6, 2024
1 parent 555cef5 commit e895f83
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ impl SingleEpochParticipationCache {
current_epoch: Epoch,
relative_epoch: RelativeEpoch,
) -> Result<(), BeaconStateError> {
let val_balance = state.get_effective_balance(val_index)?;
let validator = state.get_validator(val_index)?;
let val_balance = validator.effective_balance;

// Sanity check to ensure the validator is active.
let epoch = relative_epoch.into_epoch(current_epoch);
Expand Down

0 comments on commit e895f83

Please sign in to comment.