Skip to content
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

Harden against finalized block spam #4277

Closed

Conversation

michaelsproul
Copy link
Member

Proposed Changes

  • Remove a double block root calculation for blocks that are prior to finalization based on their slot. We just plumb the error through from block_verification.rs. This has the potential to halve the time spent rejecting these messages (from 10-20ms to 5-10ms).
  • Increase the peer penalty for blocks that are prior to finalization. They are still Ignored though rather than rejected, as that's what the spec requires.
  • Increase the peer penalty for blocks that conflict with finalization (side chains that are obsoleted by finalization). They are now Rejected, which also aligns with the spec.

Additional Info

  • Remove check_block_against_anchor_slot. I added it in 2021 when I implemented checkpoint sync, but it's superfluous because the anchor slot is always <= the finalized slot, so any block caught by the anchor check will be caught by the finalized slot check.
  • There are a few other places we could plumb through the block root: BlockIsAlreadyKnown, RepeatProposal, NotFinalizedDescendant, BlockIsNotLaterThanParent, TooManySkippedSlots are all prior to the proposer signature check.

@michaelsproul michaelsproul added work-in-progress PR is a work-in-progress optimization Something to make Lighthouse run more efficiently. labels May 9, 2023
@michaelsproul
Copy link
Member Author

Note to self after recent discussions: if we allow checkpoint sync from a state newer than finalized, then we do need the separate anchor slot check 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
optimization Something to make Lighthouse run more efficiently. work-in-progress PR is a work-in-progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant