Skip to content

Commit

Permalink
Added warning re validatorStatuses cache
Browse files Browse the repository at this point in the history
  • Loading branch information
lucassaldanha committed Oct 7, 2024
1 parent 3a8526a commit 4dc234d
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,16 @@ public BeaconState processEpoch(final BeaconState preState) throws EpochProcessi

protected void processEpoch(final BeaconState preState, final MutableBeaconState state)
throws EpochProcessingException {
/*
WARNING: After Electra, it is possible that the validator set is updated within epoch processing
(process_pending_deposits). This means that the validator set in the state can get out of sync with
our validatorStatuses cache. This is not a problem for the current epoch processing, but it can cause
undesired side effects in the future.
Up until Electra, the only function that uses validatorStatuses after process_pending_deposits is
process_effective_balance_updates, and in this particular case it is ok that we don't have the new validators
in validatorStatuses.
*/
final ValidatorStatuses validatorStatuses =
validatorStatusFactory.createValidatorStatuses(preState);

Expand Down

0 comments on commit 4dc234d

Please sign in to comment.