The process_exits function verifies the voluntary exits in parallel. If there is a duplicate voluntary exit then
verify!(
validator.exit_epoch == spec.far_future_epoch,
ExitInvalid::AlreadyExited(exit.validator_index)
);
will not trigger, allowing for voluntary exists to be initiated multiple times. The spec requires voluntary exits to not have been initiated.
# Verify exit has not been initiated
assert validator.exit_epoch == FAR_FUTURE_EPOCH
(It seems initiate_validator_exit does not provide protection by silently returning early if the validator already initiated an exit.)
Another good catch. I think this is confirmation that we should go through an remove all the parallel iterators from block processing.
I'm working on fixing this, and improving our block processing tests in the process. I'm going to see if I can improve the ergonomics of the test builders, which have been long considered quite unwieldy :crossed_fingers:
Most helpful comment
I'm working on fixing this, and improving our block processing tests in the process. I'm going to see if I can improve the ergonomics of the test builders, which have been long considered quite unwieldy :crossed_fingers: