Repository navigation
perf(pq): sign a proposal's envelope alongside its block - #909
Merged
Merged
Conversation
A PQ proposal signed the block, published it, and only then signed the envelope, so the envelope waited a whole leanXMSS signature (about 0.3 s of a core, sometimes several times that) after the block: 0.78 s in pq-devnet-0's slot 23740, 0.12 s in slot 23748. The node hands back the block and its envelope together, so the envelope's message is known as soon as the block's. Both signatures now start once the block is recorded in slashing protection, each on its own core. The block is published as soon as its own signature is done, then the envelope. An envelope signed for a block that then fails costs only the slot's envelope leaf, which no other message can use.
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
A PQ proposal signed its block, published it, and only then signed the envelope, so the envelope always waited one more leanXMSS signature after the block. That is about 0.3 s of a core, and sometimes several times that, since the signature's cost is geometric (see #906).
On pq-devnet-0 the gap between
Published a PQ blockandPublished a PQ execution payload envelopewas 0.78 s in slot 23740 and 0.12 s in slot 23748. The envelope gates everything that needs the payload: the next proposer's parent, the PTC'spayload_present, and the execution client.produce_pq_blockhands back the block and its envelope together. So the envelope's signing root is known as soon as the block's, and its signature need not wait.What Changed
crates/validator/src/proposal.rs(propose_pq)pq::signon tokio's blocking pool, signing on the rayon pool).Correctness / Behavior Guarantees
Tests Added / Run
make fmt,make lintclean.Related Issues / PRs
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.