Repository navigation
Description
Branch: pq-devnet-1
What was asked
During the pq-devnet-1 run, ethPandaOps asked the client teams to add aggregate timings to their clients. It is also a line in the devnet's requirements (pq-devnet-1 notes, "Client requirements from pq-devnet-0", Timings): expose aggregation timings (committee proof, recursive merge, aggregate arrival) in a common format that xatu can ingest and Dora can show. The notes say the format is still TBD, proposed over OpenTelemetry. One of the devnet's goals depends on it: aggregation timings measured the same way in every client, as a gossipsub baseline to compare against later.
Where ethlambda is today
pq-devnet-1 at 25302a5a measures these timings but only writes them to the log:
| Timing | Code | Reported today as |
|---|---|---|
| Committee proof | crates/net/rpc/src/beacon/pq_aggregation.rs |
Log fields. Proved a PQ aggregate has prove_ms; Finished proving this seat's PQ aggregates has the queue, state, proving and total times and the proved / late / failed / already-proven counts |
| Recursive merge (a block's proof) | crates/blockchain/src/pq_attestation_packing.rs (#914) |
Log fields. Merged PQ attestation proofs and Packed the next PQ block's attestations ahead of its slot have took_ms |
| Aggregate arrival | p2p gossip validation | lean_beacon_gossip_validation_seconds times arrival to verdict. Nothing among the lean_beacon_gossip_* series records where in the slot a PQ attestation or aggregate arrived |
None of the three files above, nor crates/common/crypto/src/stark/leanvm.rs, records a Prometheus metric. A devnet dashboard has nothing to plot for ethlambda's proving, and comparing ethlambda with another client means scraping logs.
What the other clients did
Lighthouse (cf6dd546), Prysm (734a7838), Teku (Consensys/teku#11709) and Lodestar (eb8fd660) all write one export, schema 1 of Lighthouse's scripts/pq-measurement, so Lighthouse's plot.py draws every client's runs side by side.
--pq-timing-output <dir>writes one directory per run:run.json, the manifest: schema version, client and leanVM revision, prover threads and CPU profile, hardware, the slot's timing constants (attestation due, committee cutoff, aggregator delay, aggregate due), where receipts are stamped, and counts of dropped events.events-NNNNNN.jsonl.zstchunks, rotated at 64 MiB or 5 minutes and kept to 8 GiB. An unfinished chunk ends in.partial.- Emitting never blocks: a full queue drops the event and counts it in the manifest.
- Each line has
seq,kind,wall_ns,mono_nsand the fields of its kind:message_received: every PQ single attestation and aggregate, stamped before SSZ decode. Message kind, message id, slot, committee, subnet, bytes, signer count, vote data root.validated: the outcome (accepted, duplicate, deferred, rejected, ignored, dropped) andreceipt_to_validation_ns.proof_started,proof_finished,job_outcome: one set per committee proof and per round of a block-proof merge. Queue wait, backend duration, whether it was late, proof bytes, proof id, round, recursive depth.proposal_snapshot: what the proposal had at block production.
--pq-measurementis an observer mode: a node with no validators joins every attestation subnet and, every third slot, proves a committee or merges a block proof (or both) from live gossip, without publishing the result.
Lighthouse also exports Prometheus series from the same points: beacon_pq_timing_seconds{stage,kind,origin} and beacon_pq_timing_events_total{stage,kind,origin,outcome}.
Proposed
In this order, each one useful without the next:
- Prometheus metrics on the node. Small, and enough for a Grafana panel. Names are a suggestion, following the repo's
lean_prefix:lean_beacon_pq_committee_proof_seconds{position}: leanVM proving time of one committee's aggregate, by aggregator seat.lean_beacon_pq_committee_proof_ready_offset_seconds{position}: how far into the slot the proof was ready, to read against that seat's cutoff and broadcast time.lean_beacon_pq_committee_proofs_total{position,outcome}:proved,late,failed,already_proven,unproved.lean_beacon_pq_merge_seconds{round}andlean_beacon_pq_merge_children: a block-proof merge, ahead of the slot and at production.lean_beacon_pq_aggregate_verify_seconds: leanVM verification of one received aggregate.lean_beacon_pq_gossip_arrival_offset_seconds{kind}: offset into the message's slot at receipt, forattestationandaggregate.lean_beacon_pq_proof_size_bytes{kind}: committee and merged proofs.lean_beacon_pq_committee_signatures: signatures in one committee proof.
--pq-timing-output <dir>onethlambda beacon, in the shared schema. The valuesrun.jsonneeds already exist (LEANVM_REV,PROTOCOL_VERSION,--pq-prover-threads, theConfigtiming fields). The events map onto the gossip handler's receipt and verdict,prove_seat/prove_committee, and the packing task's merges.--pq-measurementobserver mode. A follow-up, only if ethPandaOps wants an ethlambda observer on the devnet.
To confirm with ethPandaOps
- Which of these they need from us first: Prometheus series, the
--pq-timing-outputexport, or the OpenTelemetry format the notes list as TBD. - If their dashboards already query other clients' series, which names and labels, so ours match.
Done when
- The node's
/metricshas the committee proof, merge, verification and arrival timings, documented indocs/metrics.md. - A run recorded with
--pq-timing-outputis drawn by Lighthouse'splot.pyunchanged, next to a Lighthouse run from the same local devnet. - Recording costs nothing on the proving or gossip paths when the flag is off, and never blocks them when it is on.
Activity
feat(pq): expose aggregation timings as Prometheus metrics (#973)