Avoid attestations with incompatible shuffling#5276
Conversation
| if epoch <= spec.MIN_SEED_LOOKAHEAD: | ||
| dependent_slot = spec.GENESIS_SLOT | ||
| else: | ||
| dependent_slot = spec.compute_start_slot_at_epoch(epoch - spec.MIN_SEED_LOOKAHEAD) |
There was a problem hiding this comment.
I think this should be spec.compute_start_slot_at_epoch(epoch - spec.MIN_SEED_LOOKAHEAD) - 1, right? It's the block root at the end of the prior epoch that determines what happens in the epoch transition.
This is defined e.g. in the beacon API spec:
https://ethereum.github.io/beacon-APIs/#/ValidatorRequiredApi/getAttesterDuties
I think this discrepancy is safe in general, because an equal root at the start of epoch - 1 implies an equal root at the end of epoch - 2. We are just potentially missing out on a little bit of test coverage (the case where the start slot roots are different but the end slot roots are still equal).
There was a problem hiding this comment.
Thanks a lot for looking into that! Fixed by #5287
Fixes #5271 by introducing
shuffling_compatibility_filterwhich prevents attestations from being included into a block if a dependent root of an attestation and the block mismatch.