node

module
v1.37.0 Latest Latest
Warning

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

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

README

node

Three node runtimes — Go, Rust and C++ — one build entry point, and the differentials that hold them to the same answers.

What it is

node imports three existing implementations rather than adding a fourth. Nothing under runtime/ or gpu/ is a copy or a fork; each is a README naming the checkout it builds and the exact invocation. Delete this repository and every one of them is exactly as it was.

The exception is chains/, where a port had no clean home. chains/rust/xvm is the X-Chain in Rust — a real port against the Rust node's VM seam, not a shim — and chains/{rust,cpp}/* hold the chain ports the differentials compare.

The differentials

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

make chains        # 629 P/X/Q/Z/D/F wire vectors, all three languages
make precompiles   # 237 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 compared field of all 725 vectors with no implementation silent.

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.

What stops the three sharing one network

Measured, not assumed:

luxd-rust and luxd-cpp are both hosts, but they form a committee differently. The Rust host publishes a validator line — a post-quantum identity and its BLS key — and takes a committee file plus --peers. The C++ host takes --index I --n N --base-port P and derives its peers positionally. Neither can read the other's committee, so they do not yet meet on one mesh.

luxd-go is not a host at all. It is the C-Chain VM plugin, so it cannot be a third validator until a Go host exists to run it.

Two things have to land before three implementations can co-finalise a block: one committee format both hosts read, and a Go host. Everything else the differential needs already agrees.

On the clean cut

node's reason for existing says luxfi/node carries ava-labs lineage. That was true of its history and is no longer true of its dependency closure: a go list -deps ./main over luxfi/node returns 1,051 packages and zero matching ava-labs or avalanche. The lineage claim is about where the code came from; the closure is clean today, and the two are different questions worth keeping apart when deciding what this repository may import.

What the three are, and are not

luxd-rust and luxd-cpp are full node hosts — they take a committee and serve. luxd-go is the C-Chain VM plugin, not a daemon: the Go node host that luxfi/node ships is not part of this repository's clean cut, and no replacement for it has been built here yet. Until one is, the three cannot stand up as peers on one network, and the differential compares them as libraries rather than as validators.

The wire is no longer written by hand in any of them. Thirteen .zap schemas generate the readers and builders for all three languages; the five hand-written implementations that preceded them are deleted.

Build

make luxd RUNTIME=go      # bin/luxd-go    — chains/evm, the C-Chain VM plugin
make luxd RUNTIME=rust    # bin/luxd-rust  — lux-rs/node, a full host
make luxd RUNTIME=cpp     # bin/luxd-cpp   — lux-cpp/node, a full host
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 the gaps stated plainly. 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
luxd command
luxd — Lux Network node daemon.
luxd — Lux Network node daemon.
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.
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.
Package gpu is the one place a Lux chain asks for a primitive.
Package gpu is the one place a Lux chain asks for a primitive.
internal
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.
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
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