LPsLux Proposals
Post-Quantum Cryptography
LP-60

Node Benchmark Methodology

Final

How a Lux node's performance is measured and what may be claimed from it — the classical-only cryptographic profile that isolates architecture from post-quantum cost, the measurement protocol for throughput, latency, memory and CPU, and the structural properties each measurement is testing

Category
Core
Created
2026-06-06

Abstract

A performance claim is only as good as the profile it was measured under and the baseline it was measured against. Lux runs post-quantum cryptography by default, so any raw comparison against a classical-crypto implementation measures two things at once — the architectural difference and the post-quantum cost — and attributes the sum to whichever one the author wanted to talk about. This LP specifies the classical-only profile that separates those two quantities, the measurement protocol for throughput, finality latency, memory and CPU, and the structural properties each measurement is designed to confirm or refute. It also states, explicitly, what may not be claimed before the corresponding measurement exists.

The governing rule: we do not invent numbers we have not measured.

1. The classical-only profile

1.1 What it is

The default Lux Network is post-quantum throughout — cert mode PQ-strict or PQ-heavy. Validator identity is ML-DSA-65 hybrid. The handshake is X-Wing. The threshold legs in the certificate include Pulsar (Module-LWE) and optionally Corona (Ring-LWE) and Magnetar (SLH-DSA, hash family). That is the production wire on mainnet.

A classical-only profile is supported for two operational purposes:

  1. Isolating the architectural contribution. Benchmarking a post-quantum node against a classical-crypto reference implementation confounds two independent variables. The classical-only profile removes the post-quantum overhead so the architectural difference stands alone — and, run the other way, gives the post-quantum cost as the residual against the same node in PQ-strict.
  2. Research and teaching deployments, where the question is "what does the ZAP stack plus this consensus family give us, independent of post-quantum cost?"

The classical-only profile reverts no other architectural choice. ZapDB stays. ZAP wire stays. The consensus family stays. GPU-EVM stays. The only thing that flips is the cryptographic suite: BLS-only validator identity (no ML-DSA leg), classical TLS 1.3 X25519 handshake (no ML-KEM-768 leg), BLS-only threshold signatures in the certificate (no Pulsar / Corona / Magnetar legs).

1.2 Cert-mode mapping

ProfileCertificate legsUse
PQ-off (classical)BLS onlyBenchmarks, research, localnet / devnet
PQ-fastBLS ‖ PulsarTestnet, conservative production
PQ-strictBLS ‖ Pulsar ‖ CoronaMainnet default
PQ-heavyBLS ‖ Pulsar ‖ Corona ‖ MagnetarMaximum assurance, cross-family redundancy

Activation is a per-network setting baked into the spawn transaction's pq_profile field. Mainnet is strict-PQ at genesis; localnet and devnet may be classical, or any intermediate mode, for testing. The profile is observable on-chain via the network's spawn record.

1.3 Engaging the profile

The operator-side knob is a Network resource field:

apiVersion: lux.cloud/v1
kind: Network
metadata:
  name: lux-classical-bench
spec:
  networkID: 1337            # localnet
  consensus:
    profile: PQ-off
  validators: [...]

The binary is the same. The genesis-time profile selector configures the validator-identity verifier (BLS-only), the handshake suite (classical TLS) and the certificate verifier (BLS leg only). No build-time flag, no separate binary.

1.4 What the profile is not

It is not a compatibility mode for some other implementation. It is this node in classical crypto shape: ZAP wire stays, ZapDB stays, QUIC transport stays, the consensus family stays, GPU-EVM stays, the multi-VM topology stays.

A "true classical baseline" — disabling ZAP and falling back to a reflective codec — is not supported. That codec is gone from go.mod; there is no compile path back. This is intentional. ZAP is not a feature flag; it is the architecture.

2. What has been measured

DimensionMethodResult
Binary sizels -la build/luxd35 MB, stripped static
Source treefind . -name '*.go' -not -path './.git/*' | xargs wc -l274 k Go LOC across 1,444 files
Dependency closurels -la go.sum64 kB
gRPC linkagegrep -rln '"google.golang.org/grpc"' --include='*.go' .0 files
Parse, small txgo test -bench, reflective codec vs ZAP offset reads129 ns → 36 ns, 3.6×
Parse, complex txsame1008 ns → 75 ns, 13.4×
Snapshot streamingqualitative: re-encode vs direct buffer~10× write-amplification reduction
Threshold round, n = 64parallel-aggregate correctness fix14 s serial → 356–440 ms parallel. The serial baseline was a bug, not a design point; the parallel number is the honest comparison.

These are the numbers that will be defended. The binary, LOC and linkage measurements are reproducible from the canonical main branch and will not move materially. The parse microbenchmarks are reproducible via go test -bench against the named packages.

3. What has not been measured — the protocol for closing the gap

Full-node throughput, latency and memory numbers do not yet exist. Until they do, the answer is unmeasured, and this section is the protocol, not a placeholder for an estimate.

3.1 Throughput (sustained tx/s)

Hypothesis. At the classical-only profile, a node sustains ≥ 3× the transaction throughput of a reflective-codec architecture at the same hardware budget. The 3× lower bound is the per-transaction parse win compounded by the elimination of the mempool re-marshal and state re-encode hops.

Method.

  • 5-validator cluster on identical bare metal (ConnectX-7 NIC, AMD EPYC 9554, 256 GB RAM, NVMe gen 4).
  • Load generator: 100 k-transaction blast per round, 50/50 simple value transfer and contract call, warm pool of pre-signed transactions.
  • Both sides at equal cryptographic footing — the Lux side on a localnet genesis spawned with pq_profile: PQ-off.
  • Measure peak admission rate over 60 s sustained, 5-validator consensus, no thrashing.
  • 5 runs per side; report median, p99 and standard deviation.

3.2 Block-to-finality latency

Hypothesis. Committee threshold voting plus β-confidence accumulation reaches local finality in O(β) round trips, because each round is a fresh committee sample carrying a threshold vote rather than a repeated single-peer poll. A design that polls one peer at a time needs O(β·k) round trips for the same confidence. At committee size 64, β = 20, and 50 ms intra-AZ RTT, that is roughly 1 s versus 1.25–2.5 s.

Method.

  • Single transaction, single block, fully consumed pool; measure block_received_at_proposer → block_committed_local per validator.
  • 5 validators, identical inter-AZ latency profile, identical hardware.
  • p50 and p99 over 1000 blocks.
  • Classical-only profile on the Lux side.

3.3 Memory (steady-state RSS)

Hypothesis. Runtime heap is smaller because there is (a) no reflection-tagged codec registry, (b) no Protobuf descriptor table, (c) no gRPC service registry, and (d) a ZAP buffer pool (sync.Pool over fixed-size slices) that bounds the allocation profile.

Method.

  • Same 5-validator cluster; steady-state 1000 tx/s for 30 minutes.
  • Sample VmRSS and VmSize from /proc/<pid>/status at 5-minute intervals.
  • go tool pprof heap profile at end of run; publish the heap-by-package breakdown.
  • Report RSS p50 and p99 plus the top-20 heap-by-package.

Binary-side accounting, independent of RSS. The gRPC toolchain that is not linked accounts for roughly 21 MB of code that would otherwise be present:

  • google.golang.org/grpc — ~12 MB, plus ~5 MB of import-side-effect heap at boot
  • google.golang.org/grpc/grpc-gateway/v2 — ~5 MB
  • go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc — ~3 MB
  • connectrpc.com/grpcreflect — ~1 MB
  • github.com/grpc-ecosystem/go-grpc-prometheus — ~0.5 MB

The plugin transport speaks ZAP directly (vms/rpcchainvm/zap/), which is why none of it is needed.

3.4 CPU profile / hot path

Hypothesis. A reflective-codec architecture's CPU profile under sustained load is dominated by codec unmarshal frames called from gossip, consensus and state. The Lux profile has no such frame, because offset-read accessors are inlined arithmetic over the buffer.

Method. 30 s CPU profile at steady-state 1000 tx/s; publish side-by-side flame graphs; report the top-10 self-time frames for each. Expected top frames here: BLS verify, secp256k1 verify, ZAP frame parse (~50 ns/call), storage I/O.

3.5 What is explicitly not claimed

  • No claim of X× throughput, Y× latency or Z MB memory before §3.1–§3.4 have published numbers.
  • No comparison run under PQ-strict against a classical implementation — that measurement mixes the architectural delta with the post-quantum cost and is not informative. The PQ-strict number is reported separately, against the classical-only number, precisely so the post-quantum cost is visible as its own quantity.
  • No binary-size claim under runtime expansion (UPX, dynamic loading). The measurement is a stripped static binary on Linux amd64, -s -w -trimpath, no UPX, no after-the-fact stripping, both sides built with the same toolchain version.

4. Structural properties under test

Each property below is a mechanism, and each has a measurement that confirms or refutes it. These are the reasons the numbers in §3 are expected to come out the way the hypotheses say; if a measurement disagrees, the mechanism is wrong, not the measurement.

4.1 No marshal on the hot path

There is no per-block, per-transaction, per-validator marshal/unmarshal call. The ZAP buffer that arrives over the wire goes into the mempool as one buffer-pool pointer, into the block as a list of buffer-pool pointers, and into ZapDB as one write of the same buffer. Block identity is sha256(block.Bytes()), where block.Bytes() is the concatenation of buffers that already exist. Nothing is re-encoded.

Test. Profile a validator under load; look for a marshal frame in the top 100 by self time. It is not present. The 3.6×–13.4× per-operation parse win (§2) is the direct measurement of that absence.

4.2 No reflection in the wire format

Reflection in Go is roughly 10× slower than direct field access and forces interface-typed allocations. The accessors here are arithmetic — buf[8:12] for a 4-byte field at offset 8 — inlined, allocation-free, no GC pressure.

Test. Heap allocations per transaction parse: 1 alloc/op, the buffer itself. A reflective codec runs 2–6 allocs/op, one per reflected field group. Inspect with go test -bench -benchmem.

4.3 Little-endian end to end

Native byte order on x86-64 and ARM64 is little-endian. A big-endian wire format requires a byte swap on every field load. The swap is one cycle, but it compounds over millions of field reads per block.

Test. Not easily isolated; the per-operation win is around a nanosecond. Reported as a contributing factor, never as a headline number.

4.4 ZapDB rather than a general key-value store

ZapDB stores ZAP buffers as-is: no key-value serialization layer, no version-db wrapper, no codec round trip on read or write. Snapshot streaming is one age-encrypted streaming write of the buffer pool, with no re-encode.

Test. Snapshot write amplification — ~10× reduction, currently qualitative. Validator-level state write throughput follows §3.1.

4.5 QUIC rather than TCP plus TLS

QUIC's 0-RTT handshake beats TCP + TLS 1.3's 1-RTT (or 2-RTT cold start), and QUIC's stream multiplexing removes the head-of-line blocking TCP suffers under loss. For a mempool gossip workload — every validator concurrently gossiping many small messages to every other — the win is in the tail.

Test. Transaction-gossip latency under 1% packet loss, per §3.2.

4.6 Committee threshold voting rather than repeated single-peer polls

A threshold vote over a freshly sampled committee yields a commitment in one round trip. Confidence then accumulates over β consecutive successful rounds. Because each round samples a fresh committee rather than re-polling the same subset, the confidence gained per round trip is a committee's worth, not a peer's worth — which is the whole O(β) versus O(β·k) difference.

Test. Block-to-decision latency, §3.2. Hypothesis: ~3× at committee size 64, β = 20, 50 ms RTT.

4.7 No gRPC

The gRPC toolchain is not linked at all (§3.3), because the plugin transport is ZAP-native. This is the single largest identifiable component of the binary footprint difference between this design and one that carries a gRPC plugin host, a gRPC gateway, and a gRPC trace exporter.

Test. Binary size — already measured (§2).

5. Where results live

Harness scripts live under the benchmark root in the node repository; CI posts a run on every tagged release, and results are published per dimension (throughput, latency, memory, CPU profile). This LP is the methodology and does not carry numbers beyond §2 — a results document carries the numbers, so that re-measuring never requires amending the standard.

Copyright and related rights waived via CC0.