Skip to content

perf(pq): sign the payload committee's votes after the slot's attestations - #907

Merged
MegaRedHand merged 2 commits into
pq-devnet-0from
pq/ptc-after-attestations
Nov 26, 2026
Merged

MegaRedHand merged 2 commits into
pq-devnet-0from
pq/ptc-after-attestations

Conversation

@MegaRedHand

@MegaRedHand MegaRedHand commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

🗒️ Description / Motivation

On pq-devnet-0, each ethlambda node signs about 20 attestations and 15 payload timeliness committee (PTC) votes per slot. A leanXMSS signature costs about 0.3 s of a core (see #906 for the measurement).

Since #891, both duties start on the slot's block or payload, which arrive within a fraction of a second of each other. So both sign at once, on the same rayon pool and the same 8 cores.

  • The two batches finish together. In the client's logs, Published attestations and Published PQ payload attestations land within 20 ms of each other in about 80% of slots.
  • The PTC votes hold the attestations back. Sampled per thread on the box, slot 23757 had 27 attestations and 23 votes. The cores were busy from 0.75 s to 3.0 s, and the attestations were published at 3.23 s. With the cores to themselves, the attestations would have needed about 1.2 s of that window.
  • The votes are not urgent. Attestations are due a quarter into the slot (3 s). PTC votes are due three quarters in (9 s).

So at PQ, the PTC vote now starts only once the slot's attestations are out.

What Changed

  • crates/validator/src/lib.rs
    • In serve_slot_duties, at a PQ slot, the PTC vote waits for a oneshot that attest_and_aggregate sends once the attestation duty has published, failed or given up.
    • The signal goes before the aggregation's wait, so the vote is not held until the aggregate is due.
    • The vote then runs as before: its trigger (execution_payload_available, already seen by then in the usual case) or its 9 s deadline.
    • With no attester duty in the slot, the sender is dropped unsent, which releases the vote at once.
  • crates/validator/src/slot_clock.rs: SlotClock::is_pq.

Correctness / Behavior Guarantees

  • Pre-PQ forks are unchanged. A BLS signature costs microseconds, so the vote does not wait there.
  • The vote can be held at most until the attestation duty ends. That is its 3 s offset when no block comes, or the end of the slot in the worst case, a timeout the attestation duty already has. The vote's own budget is the end of the slot either way, and its trigger reads reports already seen, so a payload that arrived while it waited still starts it at once.
  • Nothing about what is signed changes, only when.

Tests Added / Run

  • slot_clock::tests::pq_starts_at_its_fork_epoch.
  • The existing serve_slot_duties tests (a committee member with no attester duty still votes; no vote before gloas) still cover the non-PQ paths.
  • make fmt, make lint clean.
  • Local A/B devnet: see below.

Related Issues / PRs

Local devnet (all four PRs together, A/B)

Run with ethereum-package pq (7a29d69e), PQ at genesis, on an arm64 Mac:

Five epochs ran, and the three nodes justified and finalized together (just=3 fin=2 at slot 132, one head). Justification needs more than 107 of the 160 votes, so the new client's streamed votes counted. There were no warnings on any node beyond startup notices, and zero signing, attestation, PTC or envelope failures on either client.

new baseline
vote delay (per vote) p50 / p90 0.49 s / 0.88 s 0.70 s / 1.05 s
submissions per slot (median) 2 1
first PTC publish minus last attestation, p50 (min) +0.29 s (+0.03 s) +0.01 s (−0.61 s)
envelope after its block, p50 / mean / max 0.05 / 0.11 / 0.41 s (44 proposals) 0.15 / 0.21 / 0.69 s (55)
next epoch's PTC duties fetched after the slot's duties, +6.2–6.5 s at the refresh, +0.14–0.18 s

On this small network each client signs only about two votes per slot, so the streaming gain is smaller than on pq-devnet-0's twenty. The node there answers the early PTC request in 0.15 s, so the 2 s state advance only shows at pq-devnet-0's 10,000 validators. Both effects are expected to be larger on the real devnet.

…tions

A leanXMSS signature costs about 0.3 s of a core. A devnet host's twenty
attestations and fifteen payload committee votes per slot used to sign at
once on the same cores, so both batches finished within milliseconds of each
other, a second or more after the block. The attestations are due a quarter
into the slot, the votes three quarters in.

At a PQ slot the committee vote now starts once the slot's attestations are
out, or their duty failed or gave up, and before the aggregation's wait, so
the attestations get the cores to themselves. Earlier forks are unchanged:
a BLS signature costs microseconds.
#896 adds the same helper at the same place; identical lines merge
cleanly when pq-devnet-0 is merged into pq-devnet-1.
@MegaRedHand
MegaRedHand merged commit c57d005 into pq-devnet-0 Nov 26, 2026
11 checks passed
@MegaRedHand
MegaRedHand deleted the pq/ptc-after-attestations branch November 26, 2026 22:46
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