diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/statetransition/epoch/AbstractEpochProcessor.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/statetransition/epoch/AbstractEpochProcessor.java index a86908ae8e9..0efe8a1ea4d 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/statetransition/epoch/AbstractEpochProcessor.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/statetransition/epoch/AbstractEpochProcessor.java @@ -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);