Skip to content

Check the XMSS signature of the first PQ block on a pre-fork parent in gossip - #993

Open
tcoratger wants to merge 1 commit into
lambdaclass:pq-devnet-2from
tcoratger:fix/pq-first-block-signature-gossip
Open

tcoratger wants to merge 1 commit into
lambdaclass:pq-devnet-2from
tcoratger:fix/pq-first-block-signature-gossip

Conversation

@tcoratger

@tcoratger tcoratger commented Dec 5, 2026 •

Copy link
Copy Markdown

Description / Motivation

The pq beacon_block gossip rule rejects an invalid proposer signature (p2p-interface.md, Modified beacon_block).
For a PQ block on a pre-PQ parent, precheck_block returns Ok(()), since that state holds BLS keys.
Nothing else checks the signature.

Trace, with EIP8483_FORK_EPOCH == PQ_FORK_EPOCH == E after gloas:

  1. An attacker gossips a block for the first slot of E, with the expected proposer, the right parent and a garbage XMSS signature.
  2. The node accepts it, forwards it and records (slot, proposer) as seen.
  3. The honest block is then ignored as already seen.

What Changed

  • gossip/block.rs: for a PQ block on a pre-PQ parent, check the signature against the parent state advanced to the block's epoch, which runs upgrade_to_pq.
  • If that state cannot be built, or the advance exceeds MAX_VOTE_STATE_ADVANCE_EPOCHS, the block is queued: not forwarded, not marked seen, checked at import.
  • gossip/mod.rs: new QueueReason::ForkStateUnavailable.

Tests Added / Run

  • New a_forged_first_pq_block_on_a_pre_fork_parent_is_rejected: before, Queue(ParentNotReady) from a later rule; after, Reject(BadSignature).
  • cargo test -p ethlambda-state-transition --lib -- gossip::: 209 passed, 1 ignored.
  • cargo fmt, cargo clippy -p ethlambda-state-transition --all-targets -- -D warnings: clean.

🤖 Generated with Claude Code

…n gossip

- A pre-fork parent state holds BLS keys, so the block precheck skipped the XMSS signature.
- A forged block for the fork's first slot was accepted, forwarded and marked as seen.
- The honest block for that slot was then ignored.
- Gossip now checks the signature against the parent state advanced through the PQ upgrade.
- If that state cannot be built within the vote-state bound, the block is queued for import.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tcoratger
tcoratger force-pushed the fix/pq-first-block-signature-gossip branch from f2986d1 to ad6d1d2 Compare December 5, 2026 18:59

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant