Repository navigation
feat(pq): pq-devnet-1 — leanVM bindings v0.19.0 in process, consensus-specs pq at 4c296784 - #896
Draft
pablodeymo wants to merge 27 commits into
Draft
pablodeymo wants to merge 27 commits into
pablodeymo wants to merge 27 commits into
Conversation
…e deadline The duty loop slept until ATTESTATION_DUE_BPS(_GLOAS) every slot, so every vote went out after the deadline, behind every client that votes on the block. Follow the first beacon node's head events and cut the wait short once a head at the slot is reported, as the honest-validator guide asks. The deadline stays the fallback.
…e executor post_pq_attestations ran one leanXMSS verification after another on the async handler, so the last vote of a validator client's batch waited for every other one's and the worker thread was held throughout. Run it on spawn_blocking, check the batch with rayon, and publish in submission order.
…ys at the deadline" This reverts commit 24a9e5a.
…its payload does
The validator client signed attestations, sync committee messages and PTC
votes at their clock offsets only. The specification asks for whichever
comes first: the slot's block (its payload and blob data, for the PTC
vote) or the offset. Every other validator client the issue surveys
attests on the block by default.
beacon_node/events.rs reads GET /eth/v1/events with Response::chunk and a
small SSE parser (reqwest's stream feature would change Cargo.lock), on a
client of its own with a connect timeout and a 60 s idle timeout.
head_monitor.rs reads every configured node's stream, one connection per
topic (head, plus execution_payload_available when gloas is scheduled),
reconnecting with backoff, and wakes each duty on the earlier of its event
and its clock offset. The early attempt signs only when the node's answer
names the event's block (and, for the PTC vote, says payload_present and
blob_data_available); otherwise nothing is recorded, and the duty asks
again on the next report about the slot it has not tried (the answering
node's own, typically) or runs at its deadline, so each duty is still
signed at most once a slot. The services gained a fetch half and a sign
half for that check. A stream that idles out (quiet by design before
gloas, on a node with no keep-alives) reopens with debug logging only.
The duty loop's sleep to the first duty now ends on the block too, and
the PTC vote runs beside attest+aggregate rather than after the
aggregation. --disable-event-stream turns it all off.
ethlambda_validator_duty_triggers_total{duty,trigger} counts what started
each duty.
Closes #829.
…treams that end at once The open-stream gauge was incremented when a stream opened and decremented after it ended, so a reader aborted mid-stream (HeadMonitor's drop) left its stream counted. It is now a guard dropped with the reader's future. A node that keeps handing out streams that break or close before delivering any event logged a warning and an info line on every reconnect, forever. The first such end still warns; later ones, and the reopens between them, log at debug until a stream delivers an event or goes quiet, as repeated refused subscriptions already did. Docs: CLAUDE.md's gloas validator-client sentence and the comment above the proposer preparations still described the offsets as start times.
…pre-duty wait on a payload too An early attempt's request (attestation data, head root, payload attestation data) was awaited past the deadline: one still out then, and answering a mismatch, started the deadline attempt late. Each is now bounded by the deadline and dropped there, counted as a mismatch, so from the deadline on a duty runs exactly as it would with no event. The duty loop's wait before the slot's duties watched head reports only, so with a node's head stream down and its payload stream up the committee vote waited for the first duty's offset. `report_within` (was `head_within`) ends on either topic's report for the slot. A refused subscription's body excerpt bounded each piece's read rather than the whole read, so a body trickled a byte at a time could hold the reconnect for many minutes. One timeout now covers the whole read. Docs: the PTC deadline's doc in slot_clock.rs, the sync committee module doc, and spec_deviations.md, whose "signs a sync committee message at the deadline only" entry is no longer a deviation and is removed.
…ecar pq-devnet-1 runs one leanVM release for signer, prover and verifier: bindings v0.17.0 (1e997c99), which removed leanvm-sidecar and its client API in favour of lean_vm's in-process setup/aggregate/from_bytes. A proof from another revision does not verify. - claims and lean_xmss move to 1e997c99 (no wire change); leanvm_sidecar becomes lean_vm with the experimental prover, the one the pq-devnet-0 sidecar ran. cpu_tiers stays off: it needs leanVM's tier-rustc wrapper, and the node's own CPU baseline already gives the prover its clmul. - stark::sidecar becomes stark::leanvm: same Lighthouse claim mapping, merges folded MAX_RECURSIONS at a time, verification in process. With nothing to be unreachable, try_verify_aggregates, SidecarUnreachable and the prover_unreachable IGNORE go. - The node installs the backend itself once --network says PQ is scheduled; --pq-prover-socket becomes --pq-prover-threads. - The image no longer builds a sidecar. ethlambda-pq stays as a shim that execs ethlambda (LEANVM_THREADS -> --pq-prover-threads), so pq-devnet-0 launchers keep working; the publish workflow's leanvm_rev input goes.
… has them Reverts e033029 (the move back to pq-devnet-0's unstaggered aggregators): pq-devnet-1 runs consensus-specs pq at or after 4595f0fc, which staggers a committee's aggregators by their seat in its aggregation committee (AGGREGATION_CUTOFF_BPS, AGGREGATE_DUE_BPS_PQ, AGGREGATOR_DELAY_BPS) and has one skip an aggregate a received one already covers. Merged with what landed since the revert: - The node's prover proves per seat, with the per-pass cost line of cd849e3 (now per seat) and b28ae83's genesis rule: the first slot to seal is the wall clock's until its last seat's cutoff, so a node started before genesis still proves slot 0. - The validator client's seats sign in parallel off the duty task, as 908e88d has them. - Tests on the runtime preset accessors; aggregator_position in the test duty helpers #880 brought. Config's layout is 8's again; DB_VERSION goes to 10 rather than back to 8, so a pq-devnet-0 (version 9) directory is refused rather than misread.
…q b5d422b2 has them Reverts beb567c (the move back to pq-devnet-0's revealed leaves): from b5d422b2 a VRF leaf is keccak256("VRF_LEAF" || secret || le64(slot)) over the slot's secret keccak256("VRF_SECRET" || seed || le64(slot)), and the proof reveals the secret, not the leaf. leanVM bindings v0.17.0's lean_vrf, pq-devnet-1's release, follows the same rule. A VRF tree a pq-devnet-0 validator client stored is refused at load (WrongSeed: both stored formats are re-derived from the seed) and hashed again under the new rule, so an upgraded directory never proves with one. tooling/pq-devnet stays deleted (5c2fab2: ethereum-package's pq branch runs ethlambda); CLAUDE.md keeps the current text until the docs pass.
…nsus-specs pq af898d07 has it A temporary, testing-only config key that replaces MAX_COMMITTEES_PER_SLOT_PQ in PQ's get_committee_count_per_slot, so a small devnet can put its validators into fewer, larger committees. Mainnet 16 and minimal 4, each equal to its preset's MAX_COMMITTEES_PER_SLOT_PQ, which it may not exceed. The state transition counts committees from a state alone, so the cap is selected once per process from the network's config.yaml, beside the preset (network::select_committee_cap, after select_preset), and read through config::x_max_committee_count_per_slot(). Unset, as in the spec tests, it is the preset's value, which the specification's configs equal. A value outside 1..=MAX_COMMITTEES_PER_SLOT_PQ is moved into range with a warning. A resume refuses a changed cap, since it reshuffles every PQ committee. The field rides on DB_VERSION 10 (still unreleased).
…specs pq 4c296784 has them compute_legacy_xmss_pubkey and compute_legacy_vrf_root hash the BLS key and domain byte with keccak256, the VRF tree's hash, rather than sha256; the RANDAO mix and aggregation committee seeds stay on sha256. The fork upgrade gives these to every validator and builder that registered no PQ key, and a deposit for a new one looks its key up by them. ethlambda_crypto::keccak256 wraps sha3's Keccak256; a test checks it against the VRF tree's single-block permutation and the empty-input digest, and another that the legacy keys are no longer the sha256 ones.
…ings v0.17.0 The spec pin moves from b5d422b2 to 4c296784 in every module doc, the preset test and the docs (no preset changed in between; 9bd63ad0 and 32919f0f only wrap and reformat the xmss/stark calls). docs/beacon_pq.md describes in-process proving and what became of the sidecar and its supervisor, the committee cap, the keccak256 legacy keys, and running pq-devnet-1; cli.md swaps --pq-prover-socket for --pq-prover-threads; metrics.md loses prover_unreachable; CLAUDE.md follows, DB_VERSION 10 included.
# Conflicts: # crates/validator/src/head_monitor.rs
MegaRedHand
marked this pull request as draft
November 25, 2026 19:31
leanVM now runs in the node's own process, on the threads that import blocks and judge gossip, where pq-devnet-0's sidecar could crash on an input and be restarted. Every call into it goes through guarded(), which turns a panic into a proof that does not verify, or one that was not made, instead of an unwind through the chain actor. LeanVmBackend::setup now ends with a self-check: one throwaway signature proved and verified, and checked not to verify against another claim. A prover that cannot run on the machine is reported at startup, not at the first aggregation duty. measure() proves the same input several rounds over, for pq-prover-check. More prover threads than cores are lowered to the cores with a warning rather than oversubscribed. Tests: garbage and truncated bytes in a proof's place verify against nothing; a signature at another leaf than its statement's is refused; the leanVM pin is the same in the constant, the manifest and leanvm-revision. The end-to-end prover test stays ignored for a plain cargo test (minutes unoptimized) and make test-consensus, so CI, runs it by name.
…s host A seat has the window from its cutoff to its broadcast to prove in, 2.4 s of a 12-second slot, and leanVM makes one proof at a time. Whether a host keeps up depends on its cores and on which CPU instructions the build uses, which nothing showed before a devnet's first aggregation duty. The command starts the prover as the node does, proves and verifies an aggregate of --signatures claims --rounds times, and reports each round against that window. No network, no data directory.
…e above it is refused Two things the first version of the cap got wrong: - An absent key parsed as mainnet's 16, like every key, and was then lowered to the preset's value with a warning. A minimal network whose config.yaml predates the key (every pq-devnet-0 one) warned at each start about a value its file never set. An absent key now takes the preset's MAX_COMMITTEES_PER_SLOT_PQ, which the specification's configs equal, and the config says so afterwards, so the data directory and /eth/v1/config/spec hold what the node runs on. - A value above the preset's was lowered with a warning. The specification says it must not exceed it, and a node that quietly ran another cap than the file's would shuffle other committees than peers that refused or ran it. It is now a startup error naming both values. Also restores the doc comment of Config's Default impl, which the cap's statics had been inserted under.
A committee's seats are staggered 0.6 s apart and one node can hold several. Unless a vote arrived between two cutoffs, the later seat collected exactly what the earlier one proved, and proving it again took the prover, which makes one proof at a time, as long again for an aggregate insert_proven would not keep and should_broadcast_aggregate rules out once the earlier seat has broadcast. The held aggregate still answers the later seat's request. PqSignaturePool::is_proven says so, and the seat's cost line counts already_proven.
The node holds an aggregate request for up to three seconds while the proof asked for is still being made. Seats were served one after another, so a held request for the seat due at 7.2 s kept the seats due at 7.8, 8.4 and 9.0 s from even asking until 10.2 s. Each seat now waits for its own time and runs on its own. The mock can hold pq_aggregate requests and records when each arrived.
Without them leanVM's prover runs on the build's portable baseline (x86-64-v3 with PCLMULQDQ), and on a host with AVX-512, GFNI or VPCLMULQDQ says so on stderr at the first proof: slower than the CPU allows, and slower than the other clients' leanVM builds, which pick a tier at run time. The leanvm-cpu-tiers feature compiles the prover once more per tier. A tier only gets its instructions under leanVM's scripts/tier-rustc as RUSTC_WRAPPER, which the Dockerfile fetches at the pinned revision and sets before cargo chef cook; every other crate is compiled as before. Off by default, so an ordinary build does not compile the copies; the image builds with it. Cargo.lock gains the tier crates.
…ules; seats Also corrects the memory note: the node's jemalloc returns a proof's buffers like any freed memory. It is leanVM's own builds that keep them (dirty_decay_ms:-1), which MALLOC_CONF can ask of the node too.
MegaRedHand
added a commit
that referenced
this pull request
Nov 26, 2026
#896 adds the same helper at the same place; identical lines merge cleanly when pq-devnet-0 is merged into pq-devnet-1.
Two commits since the last merge: - ba522d4 starts the gloas and PQ payload build a third of a slot ahead. Taken as is. - a3732f4 gave the sidecar client a pool of verifying connections, so gossip validation and block production's check of a merged proof stopped waiting for each other. There is no sidecar here: leanVM verifies in process, on the calling thread, under no lock, which is that change's whole effect already. Its file stays deleted. pq_proposal.rs: two comments still spoke of the proving sidecar.
…1 launches on pq-devnet-1 moved from v0.17.0 to v0.19.0 for every client, and takes no other revision. Between the two: - v0.18.0: setup picks the experimental prover's CPU tier (so a build that leaves some of the CPU unused says so at startup, not at the first proof), and faster leanXMSS key generation and signing. - v0.19.0: lean_xmss::MAX_CACHED_BOTTOM_TREES is renamed DEFAULT_BOTTOM_TREE_CACHE_SIZE and is 8, not 4 (only a comment named it here); signing hashes chain steps in batches; PROTOCOL_VERSION, bumped on every STARK-breaking change, which the prover's startup line and pq-prover-check now report (1). No wire or file format changes: the proved program, the verifier's tag, the claim encoding and the key cache layout are the same, and a cache file with two bottom trees (xmss_cache_url's 14696-byte records) still loads. scripts/tier-rustc is unchanged. Also corrects the manifest comment that still said cpu_tiers was not enabled.
pq-devnet-1 asks clients to sign in parallel on every core and publish each attestation as it is signed, not once the whole batch is done: pq-devnet-0's attestations went out five to ten seconds into the slot that way and missed the aggregation cutoff. ethlambda already signed a duty's keys in parallel, and then published the batch in one request. Normally that is a few signatures' time, but a key that has to build a bottom tree at signing time takes seconds, and every other key's vote waited for it. pq::sign_each hands each signature over the moment it exists (one leaf record flush for the batch, as before). AttestationService publishes it with whatever else was signed by then, each request on its own, so none waits for a slower key or for an earlier request's answer. Failing every request is the error the single request used to be; failing some is logged and the rest count as published. Other forks, and PQ's PTC votes and aggregates, publish as before.
Brings pq-devnet-0's improvements of 2026-11-26 to pq-devnet-1: - #906: publish each attestation as soon as it is signed; - #907: sign the payload committee's votes after the slot's attestations; - #908: fetch the next epoch's payload committee after the slot's duties; - #909: sign a proposal's envelope alongside its block; - #899: park votes for a block still importing, and check them again once it lands; - #914: merge a block's attestation proofs ahead of its slot. Resolution: - #906 and 065f80e are two implementations of the same change. pq-devnet-1's is kept (pq::sign_each returning a receiver, concurrent submissions in publish_pq_as_signed). #906's callback sign_each, sign_streamed and their tests are dropped, and its per-vote delay metric (ethlambda_validator_attestation_vote_delay_seconds) is recorded on each accepted submission of pq-devnet-1's loop. - #914's packing code moves unchanged into the blockchain crate. It merges through PqPacked::merge, which on this branch proves in process. Its docs say leanVM instead of the sidecar, and why a packing a third of a slot ahead comes after the node's own aggregator seats' proofs. - docs/beacon_pq.md: the Proposing paragraph describes packing ahead with leanVM in process; the known gaps drop the merge-ahead item and keep pq-devnet-1's interop one.
3 tasks done
…Q self-build target) (#953) ## Problem pq-devnet-1's `config.yaml` schedules a gas limit of 200M from epoch 0 through `GAS_LIMIT_SCHEDULE` ([EIP-8261](https://eips.ethereum.org/EIPS/eip-8261)). Devops reported that ethlambda votes the gas limit down. The chain shows something more specific: **ethlambda never moves it.** Over slots 20213–23212, each canonical block's gas limit compared with its parent's (Dora's slots API): | Client | Raises | Lowers | Keeps | |---|---|---|---| | lighthouse | 444 | 0 | 0 | | teku | 437 | 0 | 0 | | lodestar | 405 | 0 | 0 | | grandine | 281 | 0 | 0 | | **ethlambda** | 0 | 0 | **272** | | prysm | 0 | 0 | 472 | | nimbus | 0 | 273 | 0 | | silver | 0 | 267 | 0 | | unlabelled proposer | 0 | 102 | 0 | Two things in this branch cause it: 1. **The validator client never reads the schedule.** Its default target gas limit is a fixed 60M, and the ansible deployment doesn't pass `--gas-limit`. It signs 60M into every PQ proposer preference. 2. **The beacon node's PQ self-build ignores the preferences anyway.** `prepare_pq_proposal` builds every PQ payload toward `parent_bid.gas_limit`, so whatever a preference says, ethlambda's own blocks keep the parent's limit. Gloas's self-build does read the preferences (`prepare_gloas_proposal_on`); the PQ one never did. ## What this does ### 1. `GAS_LIMIT_SCHEDULE` (port of #873) **Beacon node:** - Parses `GAS_LIMIT_SCHEDULE` into `Config` and serves it on `/eth/v1/config/spec`. - Stores it in a `Metadata` row of its own, so the `config` row's encoding and `DB_VERSION` (10) don't change. - A directory written before this change resumes and gains the row. **Validator client:** - `--gas-limit` no longer has a default. - Each validator's gas limit resolves in this order: its own override, then `--gas-limit`, then the schedule's value for the duty's epoch, then 60M. - The epoch is the proposal's for preferences, BLS and PQ alike. `publish_pq_epoch` is a call site #873 never saw. **Differences from #873:** - **No chain check:** this branch doesn't have it (#854). The schedule is followed by a small module of its own instead; see part 3. - **Test helper:** `gas_limit_schedule_text` moved from `chain_check` to `proposer_settings`. - **`dto` tests:** they use a local `spec_with` in place of main's `complete_spec`, since this branch's spec parser accepts absent keys. - **Docs:** comments that said `DB_VERSION` 7 now say 10. ### 2. PQ payloads follow the proposer's preferences (new) - **The rule:** `prepare_pq_proposal` takes the PQ builder market. When it holds the proposer's own signed preferences for the slot, under the slot's dependent root, it builds toward their `target_gas_limit`, as gloas's self-build does. Otherwise it keeps the parent's limit, as before. - **Callers:** both pass the node's one PQ market: the `pq_blocks` endpoint, and the chain actor's payload preparation ahead of the slot (`PayloadPreparation::pq_builder_market`, wired in `main.rs`). - **Prepared builds:** the actor's `AttributesKey` now includes the PQ preferences, so a build prepared before they arrived is redone. Production and preparation still ask for the same attributes. - **Fee recipient:** unchanged, still `prepare_beacon_proposer`'s. ### 3. The schedule is read off every beacon node, every epoch (review fix) Before this change, the schedule came from whichever node answered the startup `/eth/v1/config/spec`. If that node served no `GAS_LIMIT_SCHEDULE`, or one `check_rules` refuses, every preference targeted 60M until a restart, even with another node serving the right schedule. Nothing was logged. `crates/validator/src/gas_limit_schedule.rs` now: - **Asks every node:** all `--beacon-nodes` at once, taking the first non-empty schedule in that order. - **Repeats every epoch:** it reads at startup and again each epoch on its own task, aborted when the client stops. A node that comes up, or starts serving the key, later is followed without a restart. - **Keeps a held schedule** while no node serves one. A node restarted on an old build is likelier than the network dropping its schedule. - **Warns** when no node serves a schedule while gloas is scheduled and `--gas-limit` is unset, once per run of empty reads. ### Not done EIP-8261 says a client SHOULD warn when an operator's gas limit is above the scheduled value. #873 doesn't, and neither does this. ## Checked - **Real config:** the beacon node from this branch, started on `ethpandaops/pq-devnets`' `network-configs/devnet-1/metadata`, serves `"GAS_LIMIT_SCHEDULE": [{"EPOCH": "0", "GAS_LIMIT": "200000000"}]`, no longer among its ignored keys. - **New tests:** - `a_pq_preference_carries_the_scheduled_gas_limit` (validator). - `a_pq_proposal_takes_the_gas_target_of_its_proposers_own_preferences` (blockchain): the proposer's own preference is used; none held, another validator's, or another dependent root fall back to the parent's limit. - **Reviewer's scenario, real binaries:** a beacon node on pq-devnet-1's config, behind a proxy that strips `GAS_LIMIT_SCHEDULE`, is listed first, then the node itself. The previous build started with `gas_limit_schedule=[]`, silently. This one logs `Took the gas limit schedule a beacon node serves … node=1 schedule=[0: 200000000]`. With only the stripped node it warns `No beacon node serves a usable GAS_LIMIT_SCHEDULE while gloas is scheduled …`. - **`gas_limit_schedule` unit tests:** - the first serving node wins over an empty or down one; - order decides between two serving nodes; - a schedule is followed when it appears, kept when it disappears, and replaced by another; - no answer changes nothing; - the warning is given once per run, and only when it matters. - **Suites:** `cargo test` for `ethlambda-validator`, `ethlambda-types`, `ethlambda-storage` (with `rocksdb`), `ethlambda-rpc`, `ethlambda-blockchain --lib` and the `ethlambda` binary all pass. That includes #873's tests. `make fmt` and `make lint` are clean. - **Not yet run on a devnet.** The expected result is that ethlambda's blocks join the "raises" column, at the usual ~1/1024 per block, toward 200M.
This branch has not been deployed
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
Everything ethlambda needs for pq-devnet-1 (
notes.ethereum.org/@ethpandaops/pq-devnet-1, target launch 27.11.2026). It relaunches pq-devnet-0 with two changes:leanEthereum/leanVM@351f7ae4) on Nov 26; this branch is on v0.19.0 (commit 15). Proofs from any other revision are not accepted. v0.17.0 is the release that removed theleanvm-sidecarin favour of in-process proving (setup(threads),aggregate,from_bytes).pq4595f0fc, "Stagger aggregators and skip redundant aggregates"). The spec pin is "TBD, at or after4595f0fc".Spec pin: consensus-specs
pqhead,4c296784. Every commit after4595f0fcchanges consensus, so the pin is a real choice. Head is the most likely landing point, and any later pin includes all of these anyway:4595f0fcf8f43aceb5d422b2e03f4185af898d07X_MAX_COMMITTEE_COUNT_PER_SLOTcaps PQ committees099909729bd63ad0,32919f0fxmss_*/stark_*wrappers, reformatting (no behaviour change)4c296784keccak256, notsha2569fa5f2a1Builds on #891 (the #880 port: attest on the block, PTC on the payload, parallel PQ attestation checks), already squash-merged into
pq-devnet-0, so pq-devnet-1 also gets the attestation-latency fixes. This branch was cut before that squash and has since mergedpq-devnet-0back in (8391a4d0). #891's content is identical to the squash, so this PR's diff is only the devnet-1 work below.The PR is three passes. Commits 1–6 are the devnet-1 work itself. Commits 14–16 are launch prep from the devops checklist of Nov 26 (leanVM v0.19.0, publish-on-sign). Commits 7–13 are a review pass over the first six: hardening that matters now that the prover runs inside the node, two fixes to my own first version of the committee cap, less wasted proving, and the image built to run the prover as fast as the host allows.
What Changed
First pass: pq-devnet-1
1.
40193875feat(pq): prove in process with leanVM bindings v0.17.0, drop the sidecar(The pin is v0.19.0 since commit 15; everything else here stands.)
Cargo.toml,Cargo.lock,leanvm-revision):claimsandlean_xmssmove to1e997c99. Their wire formats did not change: claims bytes and leanXMSS key, signature and cache sizes are all the same.leanvm_sidecaris replaced byleanvm_prover = lean_vmwithexperimental_prover, the prover pq-devnet-0's sidecar was built with. It makes the same proofs as the stable prover.cpu_tierswas off in this commit. Commit 12 turns it on for the image.jemalloclinksconflict, and leanVM'sallocatorcrate is not pulled in.crates/common/crypto/src/stark/sidecar.rs→stark/leanvm.rs:(pubkey, message)pairs, the empty proof for no claims, and a refusal of signatures made at another leaf.MAX_RECURSIONS(16) children at a time.lean_vm::aggregate, and verifying throughAggregateProof::from_bytes(..).verify(..).LeanVmConfig { threads, log_inv_rate: 2 }(Lighthouse's default rate), with the rate checked against leanVM's bounds.stark.rs:install_leanvmreplacesinstall_sidecar. With nothing left that can be unreachable,try_verify_aggregates,SidecarUnreachable, the gossipIgnoreReason::ProverUnreachableand itsprover_unreachablelabel are removed. A bad proof is now alwaysREJECT.bin/ethlambda:--networkresolves to a network that schedules PQ, and before anything can verify a proof.--pq-prover-socketis replaced by--pq-prover-threads(default 0, one thread per core).leanvm-revisionat/usr/local/share/ethlambda/leanvm-revision.bin/ethlambda/pq/ethlambda-pqbecomes a shim that execsethlambdaand mapsLEANVM_THREADSto--pq-prover-threads. ethereum-package'spqbranch launchesethlambda-pq beacon …, so it keeps working unchanged.leanvm_revinput goes.2.
f8f43acefeat(pq): staggered aggregators again (4595f0fc)This reverts
e033029d, the revert that took pq-devnet-0 back to2f43bc0f, and merges it with what landed since:AGGREGATION_CUTOFF_BPS/AGGREGATE_DUE_BPS_PQ/AGGREGATOR_DELAY_BPScome back (4000 / 6000 / 500, checked against the spec'sconfigs/mainnet.yaml), along withget_aggregation_cutoff_ms/get_pq_aggregate_due_ms.aggregator_positionagain.aggregate_attestationanswers 404 for an aggregate already covered (should_broadcast_aggregate).rpc/src/beacon/pq_aggregation.rs, merged by hand):b28ae833's genesis fix, rebased on the last seat's cutoff, so a node started before genesis still proves slot 0. It also keeps the guard against resealing a slot.cd849e37cost line is now per seat.908e88dfdoes.DB_VERSION→ 10, not back to 8.Config's layout is 8's again, but a number stands for one history, and a pq-devnet-0 (v9) directory is refused rather than misread.3.
e03f4185feat(pq): VRF leaves commit to revealed secrets (b5d422b2)beb567c9:secret = keccak256("VRF_SECRET" ‖ seed ‖ le64(i))leaf = keccak256("VRF_LEAF" ‖ secret ‖ le64(i))lean_vrfuses the same rule.WrongSeed: both stored formats are re-derived from the seed) and hashed again, so an upgraded directory never proves with an old-rule tree.tooling/pq-devnet/stays deleted (5c2fab24).4.
09990972feat(pq):X_MAX_COMMITTEE_COUNT_PER_SLOT(af898d07)Configfield, mainnet 16 and minimal 4, each equal to its preset'sMAX_COMMITTEES_PER_SLOT_PQ. It replaces that preset value in PQ'sget_committee_count_per_slot.process_attestation. So the cap is selected once per process from the network'sconfig.yaml, next to the preset (network::select_committee_cap, right afterselect_preset/check_constants, on both the built-in and the directory paths), and read throughconfig::x_max_committee_count_per_slot().ShufflingKeyalready carries the cap, so cached shufflings stay correct.first_config_difference), since a new cap reshuffles every PQ committee.5.
9fa5f2a1feat(pq): keccak256 legacy keys (4c296784)compute_legacy_xmss_pubkeyandcompute_legacy_vrf_rootnow hashpubkey ‖ domainwithkeccak256. The RANDAO mix and the aggregation committee seeds stay on SHA-256, as the spec says.ethlambda_crypto::keccak256(sha3'sKeccak256).6.
b8d430bcdocs(pq): pq-devnet-1 pin and docs (+8391a4d0, the merge ofpq-devnet-0)b5d422b2…becomes4c296784bb6ff54cbdcf72ebdda2a1057cce8893in every module doc and in the preset test. No preset file changed between the two.docs/beacon_pq.md:cl_extra_params: [--pq-prover-threads=2]replacingLEANVM_THREADS;docs/cli.md,docs/metrics.md,docs/spec_deviations.mdandCLAUDE.mdfollow.pq-devnet-0's new "published files in use" notes and adds that VRF states published for pq-devnet-0's rule show asloaded=0 hashed=N.Second pass: review of the above
7.
7a9d4318fix(pq): catch leanVM panics, check the prover at startup, test it in CIleanvm::guarded(catch_unwind): a panic in the verifier reads as a proof that does not verify, one in the prover as a proof that was not made, and both logleanVM panicked. leanVM's proving lock tolerates poisoning; verification takes no lock, so it keeps working whatever a panic left behind.LeanVmBackend::setupends by proving and verifying one throwaway signature, and checks the proof does not verify against another claim. A prover that cannot run on the host stops the node at startup instead of silently missing every aggregation duty. Costs about 60 ms here.--pq-prover-threadsthan cores is lowered to the cores with a warning (leanVM would oversubscribe; its own bindings refuse it).#[ignore]for a plaincargo test, which takes 160 s on it unoptimized, andmake test-consensus(so CI) now runs it by name underrelease-fast, where it takes about 1.4 s. It also checks that garbage, truncated and bit-flipped bytes in a proof's place verify against nothing, and that a signature at another leaf than its statement's is refused.LEANVM_REV, the threerevs in the workspace manifest and the rootleanvm-revisionfile equal.8.
16a19515feat(pq):ethlambda pq-prover-check--signaturesclaims (default 128)--roundstimes, and reports each round against that window. No network, no data directory.release-fast: 128 signatures in about 0.28 s, 512 in about 0.86 s, verification about 6 ms, proofs 160–200 KB.9.
dd187f98fix(pq): the committee cap's absent and too-large casesTwo things commit 4 got wrong:
config.yamlpredates the key (every pq-devnet-0 one) would warn at each start about a value its file never set. An absent key now takes the preset'sMAX_COMMITTEES_PER_SLOT_PQ, which the spec's configs equal, and the value is written into the config, so the data directory and/eth/v1/config/spechold what the node runs on.get_committee_count_per_slothas it.Config'sDefaultimpl, which commit 4 had accidentally attached to the cap's static.10.
3e56b1d5perf(pq): a later seat does not re-prove what an earlier one provedinsert_provenwould not keep andshould_broadcast_aggregaterules out anyway.PqSignaturePool::is_provendetects it; the seat's cost line gainsalready_proven. The held aggregate still answers the later seat's request.11.
ffbfc20afix(validator): PQ seats publish side by side12.
3d6d0f1dperf(pq): the image's prover is built with leanVM's CPU tiersleanvm-cpu-tiers(off by default, so an ordinary build does not compile the extra copies). A tier only gets its instructions under leanVM'sscripts/tier-rustcasRUSTC_WRAPPER; the Dockerfile fetches it at the pinned revision and sets it beforecargo chef cook. Every other crate keeps the baseline in.cargo/config.toml.FEATURESis nowleanvm-cpu-tiers. The shadow variant passes its ownFEATURES, so it is unaffected.Cargo.lockgains the 42 tier crates.13.
22d16f45docsdocs/beacon_pq.md,docs/cli.md(newpq-prover-checksection) andCLAUDE.mdfollow.dirty_decay_ms:-1), not of the node, whose jemalloc returns them like any freed memory. The note now says so, and thatMALLOC_CONF=dirty_decay_ms:-1makes the same trade for the whole node. Not measured.Third pass: launch prep (Nov 26)
14.
787d5aa8merge ofpq-devnet-0ba522d44(start the gloas and PQ payload build a third of a slot ahead): taken as is.a3732f4b(a pool of verifying connections to the sidecar, so gossip validation and block production's proof check stop waiting for each other): there is no sidecar here. In process, leanVM verifies on the calling thread under no lock, which is that change's whole effect already. Its file stays deleted.15.
6039075echore(pq): leanVM bindings v0.19.0 (351f7ae4)revs,leanvm-revisionandLEANVM_REVmove together (the pin-consistency test holds them equal).setupnow picks the prover's CPU tier, so a build that leaves some of the CPU unused says so at startup, not at the first proof.MAX_CACHED_BOTTOM_TREESis renamedDEFAULT_BOTTOM_TREE_CACHE_SIZEand is 8, not 4. Only a comment named it here.PROTOCOL_VERSION(1), bumped on every STARK-breaking change. The prover's startup line andpq-prover-checknow report it.xmss_cache_url's 14696-byte records still load.scripts/tier-rustcis unchanged and exists at the new pin.16.
065f80e5feat(validator): publish each PQ attestation as soon as it is signedpq::sign_eachhands each signature over the moment it exists (still one leaf-record flush for the batch).AttestationService::publish_pq_as_signedpublishes it with whatever else was signed by then, each request on its own, so none waits for a slower key or for an earlier request's answer.Correctness / Behavior Guarantees
ForkName::Pq.REJECT. TheIGNOREfor "prover unreachable" existed only because a separate process could be down.pq-devnet-1use keccak256 (spec head,4c296784); Lodestar's and Grandine'spq-devnet-1still use sha256. The devnet's spec commit is "TBD". It only matters when a BLS-keyed deposit is processed after genesis, but then the two groups would disagree on the new validator's key. If the devnet pins before4c296784, commit 5 is the one to revert.DB_VERSION10. pq-devnet-0 directories (v9) are refused, so pq-devnet-1 starts fresh, which a relaunch does anyway.b5d422b2's VRF rule and4c296784's keccak legacy keys.Tests Added / Run
stark::leanvm::tests::leanvm_proofs_merge_and_verify(ignored by default, real leanVM): two committee proofs made in process and merged; the merged proof verifies against the concatenated statements and fails against a subset, the wrong order, or a truncated proof. Run and passing.CommitteeBits.keccak256(pubkey ‖ domain)and no longer equal the SHA-256 ones.cargo fmt --all --checkcargo clippy --workspace --all-targets -- -D warnings--lib, rpc, validator, p2p, and theethlambdabinary: all passingPqSignaturePool::is_proven: proven once the held aggregate has every signer, not after a new vote, not for another vote's group.pq-prover-check: the 2.4 s window from mainnet's timing.pq::sign_eachanswers every request once, at its position, with the bytes the batch signer makes; an unsignable request is an error at its own position only.pqversion, and the third costs only itself.065f80e5):make lint: pass.make test(test-consensus+test-node): pass, 4,171 tests, none failing. It includes the end-to-end leanVM prover test on v0.19.0.ethlambda pq-prover-check --signatures 128on v0.19.0: 270–276 ms per round,protocol_version=1.ethpandaops/ethlambda:pq-devnet-1-065f80e, built by ethPandaOps from this branch's head):ethlambda/v1.0.0-pq-devnet-1-065f80eand carries leanVM351f7ae4.pq-prover-checkinside it on arm64: self-check passes, 128 signatures prove in 0.7–1.0 s with every core busy elsewhere (window 2.4 s),protocol_version=1.LEANVM_TIER=armsha3forced: proves fine, so the CPU-tier build (wrapper +leanvm-cpu-tiers, with fat LTO) is in the image and runs.pqbranch):ethlambda pq-keysfor the new VRF rule and served to the genesis generator and the validator clients, since the package's published files are still pq-devnet-0's.leanXMSS keys: 0 from cache, 32 fetched, 0 derived. Validator clients: leanXMSScached=16 built=0 refused=0from ethPandaOps' published cache (so that file loads under v0.19.0), VRFloaded=16 hashed=0.acceptonly, for blocks, payload envelopes, aggregates (leanVM proofs checked by the other node), attestations, PTC votes and proposer preferences..github/tests/pq-devnet-1.yaml). It cannot pass for any new-rule client until ethPandaOps publishes genesis VRF roots and.vrffiles forb5d422b2; the published ones were checked to be the old rule's.pq-prover-checkon an x86-64 host, where the AVX-512 / GFNI tiers would be used.Related Issues / PRs
notes.ethereum.org/@ethpandaops/pq-devnet-1pqat4c296784; the staggered aggregators are4595f0fc.✅ Verification Checklist
cargo fmt --all --check: cleanmake linton the final tree (065f80e5): cleanmake teston the final tree: passing065f80e5)pq-prover-checkinside the published image (arm64)pq-prover-checkon an x86-64 host