Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,8 @@ actual_slot = finalized_slot + 1 + relative_index
consensus-specs' and leanVM's known answers), and proves many signatures at
once through `ethlambda_crypto::stark`: the specification's reference (the
signatures concatenated), or real leanVM proofs made in process
(`stark::leanvm`, leanVM `351f7ae4`, bindings v0.19.0, the one release
pq-devnet-1 runs for signer, prover and verifier; `lean_vm` with its
(`stark::leanvm`, leanVM `17cb5cc6`, bindings v0.19.2, the release
pq-devnet-2 runs for signer, prover and verifier; `lean_vm` with its
experimental prover). `run_node` installs leanVM as soon
as `--network` resolves to a network that schedules PQ, on
`--pq-prover-threads` threads (0: one per core, never more than the
Expand All @@ -321,8 +321,9 @@ actual_slot = finalized_slot + 1 + relative_index
seat's 2.4 s proving window. v0.17.0 removed pq-devnet-0's
`leanvm-sidecar`, so the image builds none, and `ethlambda-pq`
(`bin/ethlambda/pq/`) is now a shim that execs `ethlambda`, kept for
launchers that still call it. A proof from another leanVM revision does not
verify, and nothing on the wire says why; the root `leanvm-revision` file
launchers that still call it. A proof from a leanVM revision with another
`PROTOCOL_VERSION` does not verify (v0.19.0 through v0.19.2 share theirs),
and nothing on the wire says why; the root `leanvm-revision` file
names the pin (a test holds it equal to the manifest's `rev`s, and the
Dockerfile reads it). The two encodings do not verify each other's proofs.
Never pass one scheme's key to the other
Expand Down
136 changes: 68 additions & 68 deletions Cargo.lock

Large diffs are not rendered by default.

12 changes: 7 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -133,17 +133,19 @@ keccak = "0.1.6"
# attestation proofs as the PQ devnet makes them, real leanVM STARKs over
# leanXMSS signatures rather than the specification's concatenation
# (`ethlambda_crypto::stark`); and leanVM's leanXMSS, which signs and verifies.
# Pinned to bindings v0.19.0 (351f7ae4), the one release pq-devnet-1 runs for
# its signer, prover and verifier; the devnet takes no other revision.
# Pinned to bindings v0.19.2 (17cb5cc6), the release pq-devnet-2 runs for its
# signer, prover and verifier. It proves the same guest as v0.19.0, which
# pq-devnet-1 ran (`PROTOCOL_VERSION` 1 in both), so the two verify each
# other's proofs and signatures.
# `experimental_prover` is the prover the pq-devnet-0 sidecar ran; it makes
# the same proofs as the stable one, faster. leanVM's `cpu_tiers` is behind
# `ethlambda-crypto`'s `leanvm-cpu-tiers` feature, off by default: it only
# does anything under leanVM's `scripts/tier-rustc` as `RUSTC_WRAPPER`, which
# the Dockerfile sets.
# Not the `leanvm` revision below, which lean consensus proves with.
leanvm_prover = { package = "lean_vm", git = "https://github.com/leanEthereum/leanVM.git", rev = "351f7ae421529ce164ed747eee1f78bdeaec3e80", features = ["experimental_prover"] }
leanvm_claims = { package = "claims", git = "https://github.com/leanEthereum/leanVM.git", rev = "351f7ae421529ce164ed747eee1f78bdeaec3e80" }
leanvm_lean_xmss = { package = "lean_xmss", git = "https://github.com/leanEthereum/leanVM.git", rev = "351f7ae421529ce164ed747eee1f78bdeaec3e80" }
leanvm_prover = { package = "lean_vm", git = "https://github.com/leanEthereum/leanVM.git", rev = "17cb5cc6bb9af2321cfff3a50ccbeaf612e0113b", features = ["experimental_prover"] }
leanvm_claims = { package = "claims", git = "https://github.com/leanEthereum/leanVM.git", rev = "17cb5cc6bb9af2321cfff3a50ccbeaf612e0113b" }
leanvm_lean_xmss = { package = "lean_xmss", git = "https://github.com/leanEthereum/leanVM.git", rev = "17cb5cc6bb9af2321cfff3a50ccbeaf612e0113b" }

# XMSS signatures + recursive aggregation, through leanVM's own facade crate:
# it re-exports the aggregation API, the `xmss` module (keys, signing, and the
Expand Down
2 changes: 1 addition & 1 deletion bin/ethlambda/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ pub(crate) struct MainnetOptions {
/// How many threads leanVM's in-process prover runs on, 0 for one per
/// core. Read only on a network that schedules the PQ fork, whose
/// attestation proofs this node makes and checks with leanVM (bindings
/// v0.19.0) in process.
/// v0.19.2) in process.
#[arg(long, default_value_t = 0)]
pub(crate) pq_prover_threads: usize,

Expand Down
2 changes: 1 addition & 1 deletion crates/common/crypto/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub mod bls;
/// The Beacon Chain PQ fork's leanXMSS signatures (the specification's `xmss`
/// module), over Keccak-256. Not the XMSS of [`signature`].
pub mod lean_xmss;
/// leanVM's own leanXMSS (bindings v0.19.0): what a validator signs with and
/// leanVM's own leanXMSS (bindings v0.19.2): what a validator signs with and
/// what [`lean_xmss::verify`] runs, re-exported so a signer depends on one pin.
pub use leanvm_lean_xmss;
mod metrics;
Expand Down
2 changes: 1 addition & 1 deletion crates/common/crypto/src/stark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//! statement in public-key order, and verification checks each in turn. It
//! is what the specification's fixtures use.
//! - **leanVM** ([`install_leanvm`]): real leanVM proofs, made and checked
//! in this process (bindings v0.19.0), as the PQ devnet's other clients make
//! in this process (bindings v0.19.2), as the PQ devnet's other clients make
//! them. See [`leanvm`].
//!
//! The two encodings are not interchangeable: a node verifies only the proofs
Expand Down
11 changes: 6 additions & 5 deletions crates/common/crypto/src/stark/leanvm.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//! Attestation proofs made and checked by leanVM in this process (bindings
//! v0.19.0, [`LEANVM_REV`]).
//! v0.19.2, [`LEANVM_REV`]).
//!
//! The PQ devnet does not run the specification's reference concatenation:
//! its clients prove with leanVM. pq-devnet-0 did it through a separate
//! `leanvm-sidecar` process; v0.17.0 removed the sidecar, and every client now
//! proves in-process through `lean_vm`'s `setup`, `aggregate` and
//! `AggregateProof::{from_bytes, verify}`. Proofs only verify against a
//! verifier of the same release, and nothing on the wire says so: a proof from
//! another revision simply fails to verify.
//! verifier of the same [`PROTOCOL_VERSION`], and nothing on the wire says
//! so: a proof from a revision with another one simply fails to verify.
//!
//! The mapping from the specification's statements is Lighthouse's, so the
//! two clients' proofs verify against each other:
Expand Down Expand Up @@ -51,8 +51,9 @@ pub const MAX_CHILDREN_PER_AGGREGATE: usize = leanvm_prover::MAX_RECURSIONS;
pub const PROTOCOL_VERSION: u32 = leanvm_prover::PROTOCOL_VERSION;

/// The leanVM revision the workspace proves and verifies with (bindings
/// v0.19.0). Every node of a network must run the same one.
pub const LEANVM_REV: &str = "351f7ae421529ce164ed747eee1f78bdeaec3e80";
/// v0.19.2). Every node of a network must run one with the same
/// [`PROTOCOL_VERSION`]: v0.19.0 through v0.19.2 share theirs.
pub const LEANVM_REV: &str = "17cb5cc6bb9af2321cfff3a50ccbeaf612e0113b";

#[derive(Debug, thiserror::Error)]
pub enum Error {
Expand Down
2 changes: 1 addition & 1 deletion crates/common/telemetry/tests/pq_lifecycle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ async fn full_pq_telemetry_lifecycle_delivers_all_active_event_families_and_heal
genesis_time: 1_799_988_000,
slot_duration: Duration::from_secs(12),
client_commit: "deadbeef",
prover_revision: Some("351f7ae4"),
prover_revision: Some("17cb5cc6"),
prover_backend: Some("leanvm"),
log_inverse_rate: Some(2),
effective_prover_threads: Some(8),
Expand Down
2 changes: 1 addition & 1 deletion crates/net/p2p/src/swarm_adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1057,7 +1057,7 @@ mod tests {
genesis_time: 1_799_988_000,
slot_duration: std::time::Duration::from_secs(12),
client_commit: "deadbeef",
prover_revision: Some("351f7ae4"),
prover_revision: Some("17cb5cc6"),
prover_backend: Some("leanvm"),
log_inverse_rate: Some(2),
effective_prover_threads: Some(8),
Expand Down
30 changes: 18 additions & 12 deletions docs/beacon_pq.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ changes.
| Layer | Where | Status |
| --- | --- | --- |
| leanXMSS sign/verify | `ethlambda_crypto::lean_xmss` | KAT-pinned against consensus-specs and leanVM |
| Attestation proofs | `ethlambda_crypto::stark` | the specification's reference concatenation by default; leanVM proofs made in process (bindings v0.19.0) on a network that schedules PQ (see [Proofs](#proofs)) |
| Attestation proofs | `ethlambda_crypto::stark` | the specification's reference concatenation by default; leanVM proofs made in process (bindings v0.19.2) on a network that schedules PQ (see [Proofs](#proofs)) |
| Containers | `ethlambda_types::beacon::containers::{eip8483, pq}` | SSZ round trips, gaps per the spec; the maximal aggregate, attester slashing and bid encode to `pq.yaml`'s size bounds |
| Fork upgrades | `upgrade::{upgrade_to_eip8483, upgrade_to_pq}` | unit-tested |
| Block processing | `stf::{eip8483, pq}` | unit-tested with real XMSS keys |
Expand Down Expand Up @@ -150,9 +150,11 @@ proofs through one of two backends, chosen once per process:
about 436 signatures per block. The specification's fixtures use it, and so
does any process that never installs leanVM.
- **leanVM** (`stark::install_leanvm`, `stark::leanvm`): real leanVM proofs,
made and checked in this process by `lean_vm` at `351f7ae4` (bindings
v0.19.0, `leanvm::LEANVM_REV`), the one release pq-devnet-1 runs for its
signer, prover and verifier. A statement list maps to leanVM claims as
made and checked in this process by `lean_vm` at `17cb5cc6` (bindings
v0.19.2, `leanvm::LEANVM_REV`), the release pq-devnet-2 runs for its
signer, prover and verifier. It proves the same guest as pq-devnet-1's
v0.19.0 (`PROTOCOL_VERSION` 1 in both), so each verifies the other's
proofs and signatures. A statement list maps to leanVM claims as
Lighthouse maps it: the sorted, deduplicated `(public key, message)` pairs,
the empty proof for no claims, and merges folded sixteen children
(`MAX_RECURSIONS`) at a time. The node installs it itself, as soon as
Expand Down Expand Up @@ -196,8 +198,9 @@ restarted; while it restarted, gossip aggregates were IGNOREd
(`prover_unreachable`). v0.17.0 removed the sidecar and its client API, so
the image builds none, nothing can be unreachable, and `ethlambda-pq` is a
shim that execs `ethlambda` (`LEANVM_THREADS` becomes `--pq-prover-threads`)
for launchers that still call it. A proof from another leanVM revision does
not verify, and nothing on the wire says why: the root `leanvm-revision`
for launchers that still call it. A proof from a leanVM revision with
another `PROTOCOL_VERSION` does not verify (v0.19.0 through v0.19.2 share
theirs), and nothing on the wire says why: the root `leanvm-revision`
file names the pin, and the image records it at
`/usr/local/share/ethlambda/leanvm-revision`.

Expand Down Expand Up @@ -515,12 +518,15 @@ asks for again.
## Running a devnet

ethpandaops/ethereum-package's `pq` branch runs PQ-at-genesis devnets with
ethlambda as beacon node, validator client or both. This branch targets
pq-devnet-1 (`notes.ethereum.org/@ethpandaops/pq-devnet-1`): consensus-specs
`pq` at `4c296784` and leanVM bindings v0.19.0, which every client must run,
since proofs from another revision do not verify. The example below names
pq-devnet-0's images for the other clients; swap in their pq-devnet-1 images
once published (the notes list them as TBD). Build the image from the
ethlambda as beacon node, validator client or both. This branch follows
consensus-specs `pq` at `4c296784`, pq-devnet-1's spec
(`notes.ethereum.org/@ethpandaops/pq-devnet-1`), and runs leanVM bindings
v0.19.2, the release pq-devnet-2 names. The other clients need not run that
release, only one with the same leanVM `PROTOCOL_VERSION`: v0.19.0,
pq-devnet-1's, makes and verifies the same proofs (see [Proofs](#proofs)).
The example below names pq-devnet-0's images for the other clients; swap in
their pq-devnet-1 images once published (the notes list them as TBD). Build
the image from the
repository root (`docker build -t ethlambda:pq-local .`: the node proves in
process, so there is no sidecar to ship), then `kurtosis run
--enclave pq <ethereum-package at pq> --args-file params.yaml` with, for
Expand Down
2 changes: 1 addition & 1 deletion docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ something specific here.
|---|---|---|
| `--network` | `mainnet` | A built-in network name (`mainnet`, `sepolia`, `hoodi` or `plataberget`), or a path to a directory of published network files. A value containing a slash is always a path, so `mainnet` is the built-in and `./mainnet` is a directory. The directory must hold `config.yaml` and `genesis.ssz`, and may hold `bootstrap_nodes.yaml` or `bootstrap_nodes.txt` |
| `--bootnodes` | none: the network's own list alone | Extra bootnodes: ENRs and multiaddrs, comma-separated, and the flag may be repeated. Added to the resolved network's own list, never replacing it. A bad entry is a startup error, and a file path is no longer accepted. See [Bootnodes on `beacon`](#bootnodes-on-beacon) |
| `--pq-prover-threads` | `0` | How many threads leanVM's in-process prover runs on, 0 for one per core; more than the machine's cores are lowered to them with a warning. Read only on a network that schedules PQ, where the node makes and checks the fork's attestation proofs with leanVM bindings v0.19.0 (`351f7ae4`, the release pq-devnet-1/pq-devnet-2 run, and the only one it takes). The node proves and verifies one signature at startup and refuses to start if that fails. The image's `ethlambda-pq` script, pq-devnet-0's sidecar supervisor, is now a shim that execs `ethlambda` and maps `LEANVM_THREADS` to this flag |
| `--pq-prover-threads` | `0` | How many threads leanVM's in-process prover runs on, 0 for one per core; more than the machine's cores are lowered to them with a warning. Read only on a network that schedules PQ, where the node makes and checks the fork's attestation proofs with leanVM bindings v0.19.2 (`17cb5cc6`, the release pq-devnet-2 runs; it verifies the proofs of v0.19.0, which pq-devnet-1 ran, and makes proofs v0.19.0 verifies). The node proves and verifies one signature at startup and refuses to start if that fails. The image's `ethlambda-pq` script, pq-devnet-0's sidecar supervisor, is now a shim that execs `ethlambda` and maps `LEANVM_THREADS` to this flag |
| `--telemetry-events` | off | Comma-separated telemetry event families to export over OTLP Logs (`pq` in `eth.telemetry/0.5`, registry `0.10.0`). Configured via standard `OTEL_EXPORTER_OTLP_LOGS_*` / `OTEL_EXPORTER_OTLP_*`, `OTEL_RESOURCE_ATTRIBUTES` (requiring `eth.node.id`), and `OTEL_SERVICE_NAME` environment variables |

`genesis_validators_root` and `genesis_time`, which the fork digest that keys
Expand Down
2 changes: 1 addition & 1 deletion docs/spec_deviations.md
Original file line number Diff line number Diff line change
Expand Up @@ -1125,7 +1125,7 @@ Two more:
The specification's `stark.VerifyAggregates` checks each signature at its
statement's leaf index, and its reference implementation does (a proof is
the signatures concatenated). The PQ devnet's clients prove with leanVM
instead, in process from bindings v0.19.0 (`ethlambda_crypto::stark::leanvm`,
instead, in process from bindings v0.19.2 (`ethlambda_crypto::stark::leanvm`,
installed on any network that schedules PQ), and a leanVM proof attests only
`(public key, message)` claims (leanEthereum/leanVM#787). So under the
leanVM backend a proof shows each key signed the message at *some* leaf,
Expand Down
2 changes: 1 addition & 1 deletion leanvm-revision
Original file line number Diff line number Diff line change
@@ -1 +1 @@
351f7ae421529ce164ed747eee1f78bdeaec3e80
17cb5cc6bb9af2321cfff3a50ccbeaf612e0113b
Loading