node

module
v1.37.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2026 License: BSD-3-Clause

README

node

github.com/luxfi/node — the Lux node, in three languages, with the differentials that hold them to the same answers.

What it is

The Go node lives here. It is not fetched and not vendored: cmd/luxd and everything under it are this module, so the repository is the thing its import path names rather than a host that reaches outside itself for it. It runs the primary network's chains — P X C Q Z A B G K M F, and D through its plugin — and make luxd RUNTIME=go builds it.

Rust and C++ sit beside it. runtime/{rust,cpp} name the checkouts they build and the exact invocation; neither is a copy or a fork. chains/{rust,cpp}/* hold the chain ports, and chains/rust/xvm is the X-Chain in Rust — a real port against the Rust node's VM seam, not a shim.

That arrangement is the point: the reference implementation and the two ports are one checkout, so parity is something you run rather than something you assert.

Opting into a chain

Some chains cost an operator something that validating the primary network did not ask for — co-location with a matcher, an HSM, a GPU, a custody role — so the node runs them only when named:

luxd --chains=D,B,M      # by letter or alias; an unknown name is refused at boot

Without it, D, B and M decline even under --track-all-chains. A chain becomes permissionless by dropping Consent from its row in node/vms.go.

What is not here

The D-Chain matcher, the F-Chain's FHE implementation and the GPU kernels are in luxfi/compute, which is private. Those three are ours; the rest of this repository forks public work and anyone building on this network has to be able to read and run it, so the two do not share a visibility.

chains/{rust,cpp}/{dexvm,fhevm} and gpu/ are shims naming that checkout — the same arrangement runtime/rust and runtime/cpp already use. The differential builds them from $(COMPUTE), so the rows below still measure them; they are simply not stored here. The pure-Go DEX in luxfi/dex is the public one and is unaffected.

The differentials

The point of the repository. One corpus, three implementations, a runner that understands nothing and compares strings.

make chains        # 725 P/X/Q/Z/D/F wire vectors, all three languages
make precompiles   # 268 EVM precompile calls, all three languages
make bench         # the same chain corpus, timed

Each runtime already tests itself, and each passes. That is the problem a differential exists for: a suite written against an implementation agrees with the implementation it was written against, so a fork between two of them is invisible from inside either one. make chains found thirteen when it was first run; make precompiles found the BLS12-381 layout on its first three-way run.

A run fails if any implementation printed no row at all. Silence is not agreement — with four voices, three answering is still a comparison, it agrees, and the fourth's absence would read as a pass.

The chains, and where each language stands

Six chains, three languages. The differential compares all three against a corpus the Go reference itself generated, so a row here is a measurement, not a claim.

chain vectors Go Rust C++
P — platformvm 159 42,398 33,859 31,217
X — xvm 49 13,306 18,894 17,148
Q — quantumvm 81 2,919 7,071 9,239
Z — zkvm 137 8,047 10,814 9,284
D — dexvm 35 1,966 6,303 7,200
F — fhevm 264 3,497 15,834 13,208

Source lines, non-test. All six exist in all three languages, and make chains agrees on every field of all 725 vectors, each answered by at least two running implementations. A field a port declines is reported, never counted as agreement.

Read the line counts as shape, not as progress: a port is larger than its reference where the reference leans on a runtime the port has to state for itself, and smaller where the reference carries history the port does not. Agreement on the corpus is the measurement that means something.

How a network is named

A network is a committee: one line per validator carrying the post-quantum identity it is named by, the BLS key it votes with, and the proof it holds that key. A node id is derived from the identity, a weight is one, and file order is the order --peers addresses line up with. Nothing in the file is taken on trust — the proof is checked when the set is built.

The commitment to a set is a SHA-256 over its validators sorted by node id, each written nodeID || weight || len(key) || key. That encoding is written once per language and no more: validators.SetRoot in Go, Committee::root in Rust. Two writings of it would agree until they didn't.

Thirteen .zap schemas generate the wire readers and builders for all three languages.

Build

make luxd RUNTIME=go      # bin/go/luxd    — ./cmd/luxd
make luxd RUNTIME=rust    # bin/rust/luxd  — lux-rs/node
make luxd RUNTIME=cpp     # bin/cpp/luxd   — lux-cpp/node
make all                  # all three plus gpu; nonzero exit unless 3/3
make conformance          # the pop/verdict corpus, all three languages

Every sub-build's exit code is checked. cargo and ctest have both reported stale success through a wrapper that did not look, so nothing here trusts a green Makefile over a red sub-build.

Where the detail is

LLM.md — what each runtime actually is, what the differentials found, and conformance/README.md and conformance/PRECOMPILE.md — how each harness works and what its verdicts mean. docs/ where present.

AGENTS.md, CLAUDE.md and GEMINI.md are symlinks to LLM.md. One document, whoever is reading.

Licence

BSD 3-Clause.

Directories

Path Synopsis
lru
bootstrap_sync.go — the node-side wiring for INITIAL SYNC.
bootstrap_sync.go — the node-side wiring for INITIAL SYNC.
cmd
backup command
Command backup provides CLI tools for database backup and restore operations.
Command backup provides CLI tools for database backup and restore operations.
blscheck command
ceremony command
config command
Command config provides utilities for working with luxd configuration.
Command config provides utilities for working with luxd configuration.
gen_zoo_addr command
genesishash command
keytoaddr command
luxd command
luxd — Lux Network node daemon.
luxd — Lux Network node daemon.
pqkeygen command
pqkeygen provisions the strict-PQ staking keypairs a local luxd needs: ML-DSA-65 (FIPS 204) staking key + ML-KEM-768 (FIPS 203) handshake key.
pqkeygen provisions the strict-PQ staking keypairs a local luxd needs: ML-DSA-65 (FIPS 204) staking key + ML-KEM-768 (FIPS 203) handshake key.
repair-proposervm command
Command repair-proposervm is a fail-closed surgical tool to reconcile a proposervm chain-state DB onto a known-canonical outer block at a single height.
Command repair-proposervm is a fail-closed surgical tool to reconcile a proposervm chain-state DB onto a known-canonical outer block at a single height.
wire command
wire writes down the ZAP wire of the messages this node's RPC answers with.
wire writes down the ZAP wire of the messages this node's RPC answers with.
spec
Package spec provides a machine-readable specification of all luxd configuration flags.
Package spec provides a machine-readable specification of all luxd configuration flags.
conformance
bench command
The cross-language benchmark.
The cross-language benchmark.
runner command
The cross-language differential runner.
The cross-language differential runner.
Package consensus provides node-side consensus integration for the Lux node.
Package consensus provides node-side consensus integration for the Lux node.
quasar
Package quasar is the node-side integration of the luxfi/consensus Quasar post-quantum finality-certificate layer.
Package quasar is the node-side integration of the luxfi/consensus Quasar post-quantum finality-certificate layer.
db
rpcdb
Package rpcdb is luxd's canonical Layer C home for the rpcdb service: one Service implementation backed by a database.Database, with a transport adapter per supported wire protocol.
Package rpcdb is luxd's canonical Layer C home for the rpcdb service: one Service implementation backed by a database.Database, with a transport adapter per supported wire protocol.
Package errors provides common error types and utilities for the Lux node.
Package errors provides common error types and utilities for the Lux node.
examples
multi-network command
The gas package implements dynamic gas pricing specified in LP-103: https://github.com/luxfi/LPs/tree/main/LPs/103-dynamic-fees
The gas package implements dynamic gas pricing specified in LP-103: https://github.com/luxfi/LPs/tree/main/LPs/103-dynamic-fees
genesis
builder
Package builder provides genesis byte generation for Lux networks.
Package builder provides genesis byte generation for Lux networks.
internal
kem
Package kem implements post-quantum key encapsulation for the Lux node peer handshake.
Package kem implements post-quantum key encapsulation for the Lux node peer handshake.
peer
Package peer is a generated GoMock package.
Package peer is a generated GoMock package.
tracker/trackermock
Package trackermock provides mock implementations for testing
Package trackermock provides mock implementations for testing
Package message is a generated GoMock package.
Package message is a generated GoMock package.
messagemock
Package messagemock is a generated GoMock package.
Package messagemock is a generated GoMock package.
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
proto
p2p
Package p2p re-exports P2P types from the ZAP wire format implementation.
Package p2p re-exports P2P types from the ZAP wire format implementation.
sync
Package sync re-exports sync types from the ZAP wire format implementation.
Package sync re-exports sync types from the ZAP wire format implementation.
vm
Package security provides security validation and protection utilities
Package security provides security validation and protection utilities
server
http
Package server is a generated GoMock package.
Package server is a generated GoMock package.
http/servermock
Package servermock is a generated GoMock package.
Package servermock is a generated GoMock package.
service
admin
Operating a node.
Operating a node.
backup
Package backup provides database backup and restore functionality.
Package backup provides database backup and restore functionality.
info
What this node will tell anyone who asks.
What this node will tell anyone who asks.
security
Package security exposes the chain-wide ChainSecurityProfile to operators, dApps, and auditors through the security JSON-RPC namespace at /v1/security and two REST sidecars at /v1/security/profile and /v1/security/block/{n}.
Package security exposes the chain-wide ChainSecurityProfile to operators, dApps, and auditors through the security JSON-RPC namespace at /v1/security and two REST sidecars at /v1/security/profile and /v1/security/block/{n}.
Package staking includes a thin HTTP client to the external Lux KMS service (~/work/lux/kms, github.com/luxfi/kms).
Package staking includes a thin HTTP client to the external Lux KMS service (~/work/lux/kms, github.com/luxfi/kms).
fixture/e2e
Package e2e provides testing infrastructure for end-to-end tests
Package e2e provides testing infrastructure for end-to-end tests
Package trace provides tracing primitives.
Package trace provides tracing primitives.
Package upgrade publishes the canonical Lux genesis-activation timestamp and the runtime tunables consumed at chain birth.
Package upgrade publishes the canonical Lux genesis-activation timestamp and the runtime tunables consumed at chain birth.
bimap
Package bimap is an in-memory bi-directional map.
Package bimap is an in-memory bi-directional map.
filesystem
Package filesystem is a generated GoMock package.
Package filesystem is a generated GoMock package.
filesystem/filesystemmock
Package filesystemmock is a generated GoMock package.
Package filesystemmock is a generated GoMock package.
hashing
Package hashing is a generated GoMock package.
Package hashing is a generated GoMock package.
hashing/hashingmock
Package hashingmock is a generated GoMock package.
Package hashingmock is a generated GoMock package.
ips
iterator/iteratormock
Package iteratormock is a generated GoMock package.
Package iteratormock is a generated GoMock package.
resource/resourcemock
Package resourcemock is a generated GoMock package.
Package resourcemock is a generated GoMock package.
vms
artifacts
Package artifacts defines canonical artifact types for cross-chain settlement per the v1.1 Unified Quantum-Safe PoS Ecosystem specification.
Package artifacts defines canonical artifact types for cross-chain settlement per the v1.1 Unified Quantum-Safe PoS Ecosystem specification.
bridgevm/state/bridgevmroot
Package bridgevmroot computes the bridgevm_state_root in native Go, byte-identical to the lux-private GPU bridgevm_transition kernel (ops/bridgevm/cuda/bridgevm_transition.cu + bridgevm_kernels_common.cuh) and every backend's CPU oracle.
Package bridgevmroot computes the bridgevm_state_root in native Go, byte-identical to the lux-private GPU bridgevm_transition kernel (ops/bridgevm/cuda/bridgevm_transition.cu + bridgevm_kernels_common.cuh) and every backend's CPU oracle.
components/gas
The gas package implements dynamic gas pricing specified in LP-103: https://github.com/luxfi/LPs/tree/main/LPs/103-dynamic-fees
The gas package implements dynamic gas pricing specified in LP-103: https://github.com/luxfi/LPs/tree/main/LPs/103-dynamic-fees
components/lux
Package lux owns the luxd-side ZAP wire dispatcher for the cross-fx UTXO factory.
Package lux owns the luxd-side ZAP wire dispatcher for the cross-fx UTXO factory.
components/lux/luxmock
Package luxmock is a generated GoMock package.
Package luxmock is a generated GoMock package.
components/verify
Package verify is a generated GoMock package.
Package verify is a generated GoMock package.
components/verify/verifymock
Package verifymock is a generated GoMock package.
Package verifymock is a generated GoMock package.
da
Package da provides Data Availability layer infrastructure for the Lux blockchain.
Package da provides Data Availability layer infrastructure for the Lux blockchain.
evm/lp176
LP176 implements the fee logic specified here: https://github.com/luxfi/lps/blob/main/LPs/176-dynamic-evm-gas-limit-and-price-discovery-updates/README.md
LP176 implements the fee logic specified here: https://github.com/luxfi/lps/blob/main/LPs/176-dynamic-evm-gas-limit-and-price-discovery-updates/README.md
evm/lp176/lp176
LP176 implements the fee logic specified here: https://github.com/luxfi/LPs/blob/main/LPs/176-dynamic-evm-gas-limit-and-price-discovery-updates/README.md
LP176 implements the fee logic specified here: https://github.com/luxfi/LPs/blob/main/LPs/176-dynamic-evm-gas-limit-and-price-discovery-updates/README.md
evm/lp226
LP-226 implements the dynamic minimum block delay mechanism specified here: https://github.com/luxfi/lps/blob/main/LPs/226-dynamic-minimum-block-times/README.md
LP-226 implements the dynamic minimum block delay mechanism specified here: https://github.com/luxfi/lps/blob/main/LPs/226-dynamic-minimum-block-times/README.md
evm/lp226/lp226
LP-226 implements the dynamic minimum block delay mechanism specified here: https://github.com/luxfi/LPs/blob/main/LPs/226-dynamic-minimum-block-times/README.md
LP-226 implements the dynamic minimum block delay mechanism specified here: https://github.com/luxfi/LPs/blob/main/LPs/226-dynamic-minimum-block-times/README.md
fx
mldsafx
Package mldsafx is the node-side bridge for the ML-DSA (FIPS 204) feature extension.
Package mldsafx is the node-side bridge for the ML-DSA (FIPS 204) feature extension.
platformvm/adopt
Package adopt is the register of networks Lux did not create.
Package adopt is the register of networks Lux did not create.
platformvm/block
Package block is a generated GoMock package.
Package block is a generated GoMock package.
platformvm/block/executor
Package executor is a generated GoMock package.
Package executor is a generated GoMock package.
platformvm/block/executor/executormock
Package executormock is a generated GoMock package.
Package executormock is a generated GoMock package.
platformvm/fx
Package fx is a generated GoMock package.
Package fx is a generated GoMock package.
platformvm/fx/fxmock
Package fxmock is a generated GoMock package.
Package fxmock is a generated GoMock package.
platformvm/security
Package security is the network security model for Lux L1/L2 networks (LP-018 §"Network security modes").
Package security is the network security model for Lux L1/L2 networks (LP-018 §"Network security modes").
platformvm/signer/signermock
Package signermock is a generated GoMock package.
Package signermock is a generated GoMock package.
platformvm/stakingparams
Package stakingparams is the node-policy the validator set governs, plus the pure rule that decides whether a proposed change is admissible.
Package stakingparams is the node-policy the validator set governs, plus the pure rule that decides whether a proposed change is admissible.
platformvm/state
Package state is a generated GoMock package.
Package state is a generated GoMock package.
platformvm/txs
Package txs is a generated GoMock package.
Package txs is a generated GoMock package.
platformvm/txs/bench
Package bench holds the reflection codec-vs-native-ZAP benchmark harness for the platformvm txs.
Package bench holds the reflection codec-vs-native-ZAP benchmark harness for the platformvm txs.
platformvm/txs/fee
Package fee implements gas complexity calculations for platform transactions.
Package fee implements gas complexity calculations for platform transactions.
platformvm/txs/mempool
Package mempool is a generated GoMock package.
Package mempool is a generated GoMock package.
platformvm/utxo
Package utxo is a generated GoMock package.
Package utxo is a generated GoMock package.
platformvm/utxo/utxomock
Package utxomock is a generated GoMock package.
Package utxomock is a generated GoMock package.
platformvm/warp/zwarp
Package zwarp provides ZAP transport for warp messaging.
Package zwarp provides ZAP transport for warp messaging.
proposervm
height_backfill.go — RECOVERY for a proposervm finality index that sits BELOW the inner VM's accepted tip.
height_backfill.go — RECOVERY for a proposervm finality index that sits BELOW the inner VM's accepted tip.
proposervm/lp181
LP181 implements the epoch logic specified here: https://github.com/luxfi/LPs/blob/main/LPs/181-p-chain-epoched-views/README.md
LP181 implements the epoch logic specified here: https://github.com/luxfi/LPs/blob/main/LPs/181-p-chain-epoched-views/README.md
proposervm/proposer
Package proposer is a generated GoMock package.
Package proposer is a generated GoMock package.
proposervm/proposer/proposermock
Package proposermock is a generated GoMock package.
Package proposermock is a generated GoMock package.
proposervm/scheduler
Package scheduler is a generated GoMock package.
Package scheduler is a generated GoMock package.
proposervm/scheduler/schedulermock
Package schedulermock is a generated GoMock package.
Package schedulermock is a generated GoMock package.
proposervm/state
Package state is a generated GoMock package.
Package state is a generated GoMock package.
proposervm/state/statemock
Package statemock is a generated GoMock package.
Package statemock is a generated GoMock package.
rpcchainvm/commonmock
Package commonmock is a generated GoMock package.
Package commonmock is a generated GoMock package.
rpcchainvm/sender
Package sender provides p2p.Sender implementations over ZAP and gRPC transports.
Package sender provides p2p.Sender implementations over ZAP and gRPC transports.
rpcchainvm/zap
Package zap provides ZAP transport implementation for VM RPC.
Package zap provides ZAP transport implementation for VM RPC.
txs/auth
Package auth is the canonical credential-policy gate for P-chain and X-chain mempool admission.
Package auth is the canonical credential-policy gate for P-chain and X-chain mempool admission.
types/fee
Package fee defines the unified FeePolicy interface that every Lux VM accepting user-submitted transactions MUST satisfy.
Package fee defines the unified FeePolicy interface that every Lux VM accepting user-submitted transactions MUST satisfy.
vmsmock
Package vmsmock is a generated GoMock package.
Package vmsmock is a generated GoMock package.
xvm
xvm/block
Package block is a generated GoMock package.
Package block is a generated GoMock package.
xvm/block/executor
Package executor is a generated GoMock package.
Package executor is a generated GoMock package.
xvm/block/executor/executormock
Package executormock is a generated GoMock package.
Package executormock is a generated GoMock package.
xvm/genesis
Package genesis builds X-Chain (XVM) genesis bytes from a small, caller-supplied descriptor.
Package genesis builds X-Chain (XVM) genesis bytes from a small, caller-supplied descriptor.
xvm/metrics/metricsmock
Package metricsmock is a generated GoMock package.
Package metricsmock is a generated GoMock package.
xvm/state
Package state is a generated GoMock package.
Package state is a generated GoMock package.
xvm/state/statemock
Package statemock is a generated GoMock package.
Package statemock is a generated GoMock package.
xvm/state/xvmroot
Package xvmroot computes the xvm execution_root in native Go, byte-identical to the lux-private GPU xvm_root_update kernel (ops/xvm/cuda/xvm_roots.cu) and every backend's CPU oracle.
Package xvmroot computes the xvm execution_root in native Go, byte-identical to the lux-private GPU xvm_root_update kernel (ops/xvm/cuda/xvm_roots.cu) and every backend's CPU oracle.
xvm/txs
Package txs is the X-chain (xvm) transaction package for the luxfi/node binary.
Package txs is the X-chain (xvm) transaction package for the luxfi/node binary.
xvm/txs/mempool/mempoolmock
Package mempoolmock is a generated GoMock package.
Package mempoolmock is a generated GoMock package.
xvm/txs/txsmock
Package txsmock is a generated GoMock package.
Package txsmock is a generated GoMock package.
network/primary/examples/bootstrap-hanzo command
bootstrap-hanzo creates the hanzo chain on testnet/devnet using a BIP-44 m/44'/9000'/0'/0/<idx> key derived from MNEMONIC.
bootstrap-hanzo creates the hanzo chain on testnet/devnet using a BIP-44 m/44'/9000'/0'/0/<idx> key derived from MNEMONIC.
network/primary/examples/deploy-chains command
deploy-chains creates chains on the Lux network using the SDK wallet.
deploy-chains creates chains on the Lux network using the SDK wallet.
network/primary/examples/heartbeat-tx command
heartbeat-tx submits one zero-value self-transfer EVM transaction per configured chain.
heartbeat-tx submits one zero-value self-transfer EVM transaction per configured chain.
network/primary/examples/keyutil
Package keyutil provides utilities for loading private keys that integrate with the Lux CLI key management system (~/.lux/keys/).
Package keyutil provides utilities for loading private keys that integrate with the Lux CLI key management system (~/.lux/keys/).
network/primary/examples/trigger-block command
trigger-block: submits a P-chain transfer to force block production on testnet
trigger-block: submits a P-chain transfer to force block production on testnet
x
merkledb
Package merkledb is a generated GoMock package.
Package merkledb is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL