Repository navigation
feat(pq): pq-devnet-2 — ERC-8517 PQ keys, X_COMMITTEE_COUNTS rotation, eth.telemetry/0.4 events - #961
Open
pablodeymo wants to merge 3 commits into
Open
pablodeymo wants to merge 3 commits into
pablodeymo wants to merge 3 commits into
Conversation
… eth.telemetry/0.3 events pq-devnet-2 (notes.ethereum.org/@ethpandaops/pq-devnet-2) relaunches pq-devnet-1 with three changes every client has to carry. ERC-8517 key derivation. PQ keys no longer derive from the BLS signing key. Each account's seed comes from a BIP-39 seed at the all-hardened path m/5326/3600/<chain_id>/<role>/<account> (HMAC-SHA512 under "Ethereum PQ seed", then HKDF-Expand-SHA256 with "leanXMSS key" and, for validators, "VRF key"). Out-of-range seeds, chain ids, roles and accounts are refused, never reduced into range. The validator client loads seeds from ERC-8519 v5 "leanxmss" keystores, from --pq-mnemonic with an account range, or from --pq-seeds-file, and refuses any whose chain id disagrees with the beacon node's DEPOSIT_CHAIN_ID. `ethlambda pq-keys` takes --chain-id and --role and can write the leanXMSS tree caches. The devnet's check values for accounts 0 and 1 are pinned as tests. X_COMMITTEE_COUNTS (consensus-specs #5879). The PQ committee count per slot rotates through the configured list, eight epochs a stage. The list is a Config field stored in a Metadata row of its own, so DB_VERSION stays 10; a resume refuses a changed list. A PQ-at-genesis network is checked at startup for enough validators to fill every stage, and gossipsub's expected aggregators follow the active stage. PQ measurement telemetry. --telemetry-events=pq on `beacon` and `validator` exports the pq.* events of eth.telemetry/0.3 over OTLP Logs (grpc or http/protobuf, configured through OTEL_* variables), with pq_measurement_* exporter-health counters on /metrics.
…istry 0.9.0) The measurement spec moved its wire from eth.telemetry/0.3 to 0.4 on Dec 2 and xatu's sentry takes both (ethpandaops/xatu#1021). 0.4 separates a duty's nominal publication target from the cutoff at which a client gives the duty up: - pq.duty_scheduled names its target as scheduled_publish_unix_ns, for both kinds (was broadcast_unix_ns and proposal_unix_ns). - pq.duty_completed has no `late` flag. Whether a publication was late is the analysis's subtraction, not the client's. - outcome=missed_deadline carries deadline_unix_ns, the cutoff the abandoning path ran against, and no other outcome does. The beacon node's is a committee seat's broadcast time, where it stops proving and discards a proof finished later. The validator client's is the slot's attestation time, where a block not yet handed to the node is abandoned; it is recorded where the budget is set (`propose`), since the proposal service holds only a monotonic deadline. `duty::missed_deadline(key, cutoff)` is now the one way to record an abandonment, so the cutoff cannot be left out. pq.context documents each role's cutoff policy, as the spec asks. The lifecycle test fed hand-written schedules and workloads in shapes no call site builds (and the spec's schema refuses), so it could not notice a record drifting from the contract. It now announces the context a beacon node does (`context_data`, split out of `start`) and uses each call site's shapes, covers an abandoned duty, and with PQ_EVENTS_DUMP writes its records as normalized JSON for the spec's schema and tools.
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
What ethlambda needs for pq-devnet-2 (spec, target launch 08.12.2026). It relaunches pq-devnet-1 at 65,536 validators with three changes every client has to carry:
X_COMMITTEE_COUNTS, consensus-specs#5879). The devnet runs[16, 8, 4, 2, 1], eight epochs a stage.pq.*events of the PQ measurement spec over OTLP Logs, behind--telemetry-events=pq. It is a launch requirement this time. This PR emits wireeth.telemetry/0.4, the spec's current version.Stacked on
pq-devnet-1(#896), the same way that one is stacked onpq-devnet-0.What Changed
1. ERC-8517 PQ keys
Derivation (
ethlambda_crypto::pq_keys):m/5326/3600/<chain_id>/<role>/<account>:HMAC-SHA512("Ethereum PQ seed", seed), then hardened child steps.HKDF-Expand-SHA256(account_seed, "leanXMSS key"), and the VRF seed uses"VRF key".0is a validator and role1a builder. A builder derives no VRF seed.chain_idoutside[1, 2^31), an unsupported role, or an account at or above2^31is refused, never reduced into range.Validator client (
crates/validator,bin/ethlambda/src/validator.rs). It loads account seeds from three sources:"leanxmss"keystores, found in--validators-diror imported throughPOST /eth/v1/keystores.--pq-mnemonicwith--pq-account-min/--pq-account-max, and optionally--pq-passphrase,--pq-chain-idand--pq-role.--pq-seeds-file, which readseth2-val-tools pq-seedsoutput or one hex seed per line.Any entry whose
chain_iddisagrees with the beacon node'sDEPOSIT_CHAIN_IDis refused.--secrets-dirnow defaults to<validators-dir>/secrets. The stored leanXMSS trees are named by XMSS public key instead of BLS public key.ethlambda pq-keys: takes--chain-idand--role, and--write-xmss-cachealso writes the.xmsstree caches. The default file stem now includes the chain id, since the path does.Known answers: the spec's check values for accounts 0 and 1 (chain id
3151908: account seed, leanXMSS seed, VRF seed and public key) are pinned as tests inpq_keys.rs.2.
X_COMMITTEE_COUNTScrates/common/types/src/beacon/config.rs):CommitteeCountsis a list of distinct positive powers of two, kept in file order. The count at an epoch isX_COMMITTEE_COUNTS[(epoch // 8) % len]. An empty or missing list falls back toX_MAX_COMMITTEE_COUNT_PER_SLOT.Metadatarow of its own (config_x_committee_counts), likeGAS_LIMIT_SCHEDULE, soDB_VERSIONstays 10. A resume refuses a changed list.committee_count_per_slot_at_epoch), and the PQ epoch processing and gossip rules use it.genesis.ssz'saggregation_committee_windowmatches the first epochs' counts./eth/v1/config/specserves the list as decimal strings when it is not empty.3.
--telemetry-events=pqethlambda_telemetry::pq_events: the event records, an OTLP Logs exporter overgrpcandhttp/protobufconfigured through the standardOTEL_*variables (OTEL_RESOURCE_ATTRIBUTESmust carryeth.node.id), and thepq_measurement_*exporter-health counters on/metrics.beaconandvalidatortake the flag. The beacon node starts the exporter only on a network that schedules PQ, and flushes it at shutdown.p2p/src/beacon/pq.rs,gossipsub/handler.rs,swarm_adapter.rs), proving (crypto/src/stark.rs,stark/leanvm.rs), the node's aggregation duties (rpc/src/beacon/pq_aggregation.rs) and proposal-time proof merging (pq_attestation_packing.rs).pq.validation_batchis never emitted. The node validates aggregates one by one, andpq.contextdeclaresvalidation_batching: individual.fcbf6a87). The devnet note says 0.3, but the spec moved to 0.4 on Dec 2 and xatu's sentry accepts both (feat(otlp): support measurement wire 0.4 duty timing ethpandaops/xatu#1021), so this emits 0.4:pq.duty_schedulednames its nominal target asscheduled_publish_unix_nsfor both duty kinds.pq.duty_completedhas nolateflag.missed_deadline) carries that cutoff asdeadline_unix_ns. The beacon node's cutoff for a committee seat is the seat's broadcast time. The validator client's cutoff for a proposal is the slot's attestation time.--pq-timing-output) pq-devnet-1 asked for. It is not in this branch, and pq-devnet-2 asks for the OTLP events instead.Docs
docs/beacon_pq.md,docs/cli.md(new flags and apq-keyssection),docs/metrics.md(the exporter-health counters) andCLAUDE.md.Open points
ethereum/consensus-specs@66f143ec. The module headers anddocs/beacon_pq.mdstill name pq-devnet-1's4c296784, and this PR adds only #5879 on top of it. Any other consensus change between the two commits has not been audited here.351f7ae4)."leanxmss"shape here may need to change once clients agree on one.Testing
make fmtandmake lintpass on the first commit. On the second,cargo fmt --checkpasses and clippy passes with-D warningson the crates it touches.cargo test --profile release-fast -p ethlambda-telemetry -p ethlambda-crypto -p ethlambda-types -p ethlambda-validator -p ethlambda-rpcpasses (the crates'#[ignore]d tests were not run).3b9eb6b, wire 0.4):schema.jsonandtools/metadata.py.tools/otlp.py) into the same records.make testand the beacon spec suites (make test-beacon) have not been run.