fix: reject attestation source epochs below the min-span lookback - #9999
fix: reject attestation source epochs below the min-span lookback#9999wemeetagain wants to merge 2 commits into
Conversation
Min-span entries are only written within 4096 epochs below each recorded source epoch, so min-max surround cannot detect a surround vote with an older source epoch. Reject any source epoch below the lookback window of the latest recorded attestation, read with a single reverse-range query that also replaces the same-target point read in the common case. Validate an interchange against existing spans before storing its attestations so a rejected import leaves nothing behind.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 090158476d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Performance Report✔️ no performance regression detected Full benchmark results
|
…e beyond the lookback The source epoch check relies on the highest target attestation having the highest source epoch. Min-max surround does not detect a surround vote beyond its lookback on import, so validate that explicitly before storing the interchange. Restore the original import write order, partial state left behind by a rejected interchange is tracked separately.
Motivation
MinMaxSurroundonly writes min-span entries for epochs within 4096 of each recorded source epoch (#5454), so a surround vote with an older source epoch is not detected. The comment there points to the minimal strategy as the backstop, but its lower bound is only written by interchange import.Description
SOURCE_BELOW_MIN_SPAN_LOOKBACK). Inside the window min-max spans are complete, so behaviour there is unchanged and the EIP-3076 vectors pass as before.AI-assisted with Claude Code, reviewed and tested locally.