-
Notifications
You must be signed in to change notification settings - Fork 875
Reject attestations to blocks prior to the split #7084
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reject attestations to blocks prior to the split #7084
Conversation
let is_descendant_from_split_block = | ||
split.slot == 0 || fork_choice.is_descendant(split.block_root, attestation_block_root); | ||
|
||
if fork_choice.is_finalized_checkpoint_or_descendant(attestation_block_root) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it might be better to fold these checks into verify_head_block_is_known
, which is already trying to do some checks for descent from finalization. That function currently makes the (wrong) assumption that a block present in fork choice descends from finalization (this isn't true in general because fork choice is sometimes pruned on a delay).
So I think we can add these checks in the case where block_opt
is Some
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the check in verify_head_block_is_known
when block_opt
is Some
a2d3380
to
efaab87
Compare
beacon_node/network/src/network_beacon_processor/gossip_methods.rs
Outdated
Show resolved
Hide resolved
Squashed commit of the following: commit 0a53a24 Merge: 5c56a83 27aabe8 Author: Michael Sproul <[email protected]> Date: Tue Mar 18 16:28:25 2025 +1100 Merge branch 'release-v7.0.0' into reject-attestations-prior-to-split commit 5c56a83 Merge: fb9e049 3a555f5 Author: Eitan Seri-Levi <[email protected]> Date: Thu Mar 13 00:29:08 2025 -0600 Merge branch 'release-v7.0.0' into reject-attestations-prior-to-split commit fb9e049 Merge: f121c4a 9c4fc6e Author: Eitan Seri-Levi <[email protected]> Date: Wed Mar 12 10:35:38 2025 -0600 Merge branch 'release-v7.0.0' into reject-attestations-prior-to-split commit f121c4a Author: Eitan Seri-Levi <[email protected]> Date: Tue Mar 11 11:00:40 2025 -0600 lump into commit b8d2a8c Author: Eitan Seri-Levi <[email protected]> Date: Tue Mar 11 10:58:46 2025 -0600 add is descendant to fork-choice commit 72ef42b Author: Eitan Seri-Levi <[email protected]> Date: Tue Mar 11 10:53:16 2025 -0600 fix descent from split check commit 9d2ebf7 Author: Eitan Seri-Levi <[email protected]> Date: Tue Mar 11 10:46:00 2025 -0600 remove unused error variant, lump finalization check into commit 21478e5 Author: Eitan Seri-Levi <[email protected]> Date: Mon Mar 10 15:25:13 2025 -0600 remove unneeded error variant commit efaab87 Author: Eitan Seri-Levi <[email protected]> Date: Sat Mar 8 11:25:49 2025 -0700 fix test commit b911048 Author: Eitan Seri-Levi <[email protected]> Date: Wed Mar 5 23:42:46 2025 -0700 Reject attestations on gossip that attest to blocks prior to the current split point
Squashed commit of the following: commit 0a53a24 Merge: 5c56a83 27aabe8 Author: Michael Sproul <[email protected]> Date: Tue Mar 18 16:28:25 2025 +1100 Merge branch 'release-v7.0.0' into reject-attestations-prior-to-split commit 5c56a83 Merge: fb9e049 3a555f5 Author: Eitan Seri-Levi <[email protected]> Date: Thu Mar 13 00:29:08 2025 -0600 Merge branch 'release-v7.0.0' into reject-attestations-prior-to-split commit fb9e049 Merge: f121c4a 9c4fc6e Author: Eitan Seri-Levi <[email protected]> Date: Wed Mar 12 10:35:38 2025 -0600 Merge branch 'release-v7.0.0' into reject-attestations-prior-to-split commit f121c4a Author: Eitan Seri-Levi <[email protected]> Date: Tue Mar 11 11:00:40 2025 -0600 lump into commit b8d2a8c Author: Eitan Seri-Levi <[email protected]> Date: Tue Mar 11 10:58:46 2025 -0600 add is descendant to fork-choice commit 72ef42b Author: Eitan Seri-Levi <[email protected]> Date: Tue Mar 11 10:53:16 2025 -0600 fix descent from split check commit 9d2ebf7 Author: Eitan Seri-Levi <[email protected]> Date: Tue Mar 11 10:46:00 2025 -0600 remove unused error variant, lump finalization check into commit 21478e5 Author: Eitan Seri-Levi <[email protected]> Date: Mon Mar 10 15:25:13 2025 -0600 remove unneeded error variant commit efaab87 Author: Eitan Seri-Levi <[email protected]> Date: Sat Mar 8 11:25:49 2025 -0700 fix test commit b911048 Author: Eitan Seri-Levi <[email protected]> Date: Wed Mar 5 23:42:46 2025 -0700 Reject attestations on gossip that attest to blocks prior to the current split point
Closes #7083
Reject and penalize peers for gossiping attestations for blocks prior to the current split point