Skip to content

Pack the pooled slashings into a PQ block - #1008

Open
tcoratger wants to merge 2 commits into
lambdaclass:pq-devnet-2from
tcoratger:fix/pq-slash-pack
Open

tcoratger wants to merge 2 commits into
lambdaclass:pq-devnet-2from
tcoratger:fix/pq-slash-pack

Conversation

@tcoratger

Copy link
Copy Markdown

Description / Motivation

PQ block production left both slashing lists of the body empty, so this node never included a slashing in a block it proposed.
PQ's process_operations takes up to MAX_PROPOSER_SLASHINGS proposer slashings and MAX_ATTESTER_SLASHINGS_ELECTRA attester slashings.

What Changed

  • pq_block_production.rs: pack_pq_slashings picks the pool's PQ slashings as pack_operations picks electra's.
    Each is kept only if PQ's process_proposer_slashing or process_attester_slashing accepts it on a scratch state with the earlier ones applied, so a slashing whose validators are all slashed already is skipped.
    Attester slashings are ranked by how many validators they slash, and both lists are capped at the limits above.
  • block_production.rs: pack_each and would_slash are shared with it; would_slash takes the two index lists, so electra's behaviour is unchanged.
  • pq_proposal.rs: the block packs them.
    A block that fails to build is built again without its attestations, as before, and then also without its slashings.
  • operation.rs (first commit): the operation pool holds PQ slashings in lists of their own.
    It is shared verbatim with Pool the PQ slashings that gossip accepts #1006 and Accept the PQ attester slashing on the Beacon API #1007, which fill the pool from gossip and from the Beacon API; whichever merges first, the others drop it on rebase.

Tests Added / Run

  • pq_slashings_are_packed_once_and_only_while_they_slash: of three proposer slashings, a second one for the same proposer and one for a slashed proposer are skipped; of three attester slashings, one with a failing proof and one for a slashed validator are skipped.
    The packed ones then process on the state.
    Of 17 valid proposer slashings the first 16 are packed, and of two valid attester slashings the one slashing two validators is.
  • cargo test --profile release-fast -p ethlambda-state-transition -p ethlambda-rpc: all passed.
  • cargo fmt --all --check and cargo clippy --profile release-fast -p ethlambda-state-transition -p ethlambda-rpc --all-targets -- -D warnings: clean.

🤖 Generated with Claude Code

tcoratger and others added 2 commits December 6, 2026 21:14
The PQ proposer and attester slashings carry their own containers, so the
pool keeps them in two lists of their own, keyed and pruned as the other
forks' slashings are.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PQ block production left both slashing lists empty, so this node never
included a slashing in a block it proposed.
It now packs the pool's PQ proposer and attester slashings as electra's
are packed: each kept only if PQ's process function accepts it on a scratch
state with the earlier ones applied, attester slashings ranked by how many
validators they slash, and the lists capped at MAX_PROPOSER_SLASHINGS and
MAX_ATTESTER_SLASHINGS_ELECTRA.
A block that fails to build is built again without its slashings, as it
already was without its attestations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

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