Repository navigation
perf(validator): fetch the next epoch's payload committee after the slot's duties - #908
Merged
Merged
Conversation
…lot's duties The epoch refresh asked for the next epoch's payload committee duties at the epoch's first slot, before its duties and normally before its first block, while the node's head state was still in the previous epoch. A gloas state holds the committees of its own epoch and its neighbours (ptc_window), so the epoch after next is out of reach and the node advanced a copy of the head state through two epoch transitions to answer: about 2 s of a core on pq-devnet-0 (measured at slot 23808: one blocking thread busy for 2.05 s, the validator client idle until +2.2 s). Every epoch's first slot published its attestations at 3.2-4.2 s. The refresh now fetches its own epoch's schedule only, and the lookahead is fetched after the slot's duties, bounded by the slot's end, when the head has normally entered the epoch and the node reads it off its state. Held once fetched; a failed fetch is tried again next slot. The gloas fork epoch's committee is still fetched by its own refresh.
This was referenced Nov 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🗒️ Description / Motivation
On pq-devnet-0, every epoch's first slot publishes its attestations at 3.2–4.2 s, about 1.5 s later than other slots. The client's log shows why:
The same ~2 s gap shows in every epoch of the 40 minutes sampled.
The request itself is slow. The epoch refresh runs at the first slot, before its duties and normally before the epoch's first block arrives. It asks for the next epoch's PTC duties (E+1) while the node's head state is still in E−1.
ptc_window), so E+1 is out of its reach.rpc/src/beacon/ptc.rstherefore clones the head state and runsprocess_slotsthrough two epoch transitions.What Changed
crates/validator/src/lib.rsrefresh_ptcfetches its own epoch's schedule only. At the first slot the head is in E−1, so E is in its window, and the node reads it straight from the head state.fetch_ptc_lookaheadfetches E+1 after the slot's duties, next toretry_missing_ptcand bounded by the slot's end like it.Correctness / Behavior Guarantees
dependent_rootis checked when E+1's refresh fetches it again, as before.Tests Added / Run
the_next_epochs_committee_is_fetched_after_the_slots_duties: asked until held, then never again. Never the fork epoch's, and nothing before gloas.the_committee_schedule_is_fetched_for_gloas_epochs_onlyupdated: the fork epoch's refresh asks for its own epoch only.make fmt,make lintclean.Related Issues / PRs
main); see above for why this is not a port of it.pq-devnet-0; each stands alone:Local devnet (all four PRs together, A/B)
Run with ethereum-package
pq(7a29d69e), PQ at genesis, on an arm64 Mac:pq-devnet-0(ba522d44c, 64 validators).ethpandaops/teku:pq-devnet-0, 32 validators).Five epochs ran, and the three nodes justified and finalized together (
just=3 fin=2at 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.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.