Network Record and Atomic L1 Spawn
One Network shape covering every position in the network tree, driven by two data fields (networkID + validators), with an atomic P-Chain transaction that materializes a network with its validators, chains, and PQ cert profile in one commit-or-revert step
Abstract
LP-1020 specifies (1) the canonical Network shape — one Kind that covers
every position in the network tree (L2 hosted, anchored, and independent) —
and (2) the atomic P-Chain transaction that materializes a network at any
level. Mode is purely derived; there is no sovereign: bool and no
mode: enum — validators > 0 says the same thing in fewer bits. The atomic
tx binds the PQ cert profile at genesis and either fully commits or fully
reverts.
The spawn tx is the general CreateNetworkTx (LP-1010),
which subsumes network creation and sovereign-L1 birth into ONE constructor.
It carries a single anchor pointer, parent (the network you spawn under;
the new network's own ID is derived from the tx hash). Sovereignty is
derived from validators (>0 ⇒ own set + on-chain manager; ==0 ⇒
inherited / restaked from parent). manager lives on the network record,
so an inherited L2 may still hold local admin. validators are
NetworkValidator values, genesis chains are NetworkChain values — the
same components CreateChainTx reuses. One shape, one tx, any depth:
parent = Primary is an L1, a child of an L1 is an L2, recurse. level =
depth, never stored.
Promotion is the separate ConvertNetworkTx endomorphism (Network → Network: inherited→sovereign, re-anchor parent). Create births; Convert
promotes; both are first-class and share the NetworkValidator component.
Network security modes (normative)
Every network builds on the permissionless (open-stake), leaderless (no proposer) substrate. Its security is two orthogonal axes — a mode is a point in this space, not a named kind:
Security = Security
{ restakeParent :: Bool -- inherit parent's validator set (shared security)
, ownSet :: Maybe ValidatorSet -- own validators (additive; ∅ = pure restake)
}
ValidatorSet = ValidatorSet
{ admission :: Open Threshold -- permissionless: stake ≥ floor ⇒ validator (leaderless-native)
| Gated -- a manager admits/removes
, manager :: PChain Owner -- P-Chain txs, gated by control keys
| Contract ChainRef Address -- EVM staking contract, via warp
, genesis :: [Validator]
}
Invariant: restakeParent || ownSet ≠ ∅ (a network must have some
security). Sovereign is derived (ownSet ≠ ∅), never a flag.
restakeParent, admission, and manager are independent, non-redundant
data.
Canonical modes — points in the space:
| Mode | restakeParent | admission | manager | Validator-change tx |
|---|---|---|---|---|
| Restaked L2 | ✓ | — | — | none — inherits parent |
| Permissionless sovereign L1 | — | Open(floor) | PChain | AddPermissionlessValidatorTx |
| Contract-governed L1 | — | Gated | Contract(ref,addr) | RegisterL1ValidatorTx + warp |
| Permissioned / PoA L1 | — | Gated | PChain(owner) | AddChainValidatorTx |
| Hybrid L2 | ✓ | Open/Gated | either | restake + own set |
The network record declares its Security; the executor gates which
validator-change txs it accepts by manager. No new machinery — every
management path already has its tx in the P-Chain set
(LP-1010). A network migrates between modes
with ConvertNetworkTx (e.g. restaked-L2 → permissionless-sovereign-L1, or
swap PChain ↔ Contract manager) without re-genesis.
Canonical implementation — security.Mode
The normative encoding is the github.com/luxfi/node/vms/platformvm/security
package: one definition (pure values, stdlib-only, no zap/tx/state deps),
composed by the tx wire, the executor, and state.
type Admission uint8 // NoOwnSet | Open | Gated
type Manager uint8 // PChain | Contract
type Mode struct {
RestakeParent bool // axis 1 — restake parent's validator set
Admission Admission // axis 2a — NoOwnSet is the ∅ own-set (Maybe flattened to a sentinel)
Threshold uint64 // Open-admission minimum stake
Manager Manager // axis 2b — PChain (owner-authorised P-chain txs) | Contract (EVM staking contract)
}
func (Mode) Sovereign() bool // DERIVED: Admission != NoOwnSet — never a stored flag
func (Mode) Valid() error // enforces the invariant: RestakeParent || Admission != NoOwnSet
The Haskell Maybe ValidatorSet above is flattened to the Admission
sentinel NoOwnSet (no separate optional field). CreateNetworkTx
(∅→Network) and ConvertNetworkTx (Network→Network promote) each carry a
Mode on the native-ZAP struct-is-wire buffer — no codec, no version.
The executor reads Mode off the wire and gates validator-change txs by
Mode.Manager.
Chains are not part of the spawn tx. CreateNetworkTx births the network
(owner + security + own validator set); a chain is created by the
one-and-only chain constructor, CreateChainTx. An L1 spawn is therefore
block-atomic: a single block carrying CreateNetworkTx + N
CreateChainTx. This decomplects network-creation from chain-creation (they
are orthogonal concerns) and keeps exactly one way to create a chain.
Mode.Manager == Contract names the host chain of the staking contract by a
direct managerChainID (symmetric with ConvertNetworkTx); that chain is
created by its own CreateChainTx in the same block.
Motivation
Shape — kill the four authoring traps
The pre-LP-1020 design carried four authoring traps:
- Two kinds. L1 and L2 were distinct kinds, requiring separate manifests and orchestration paths.
- Implicit-root confusion. A network's primary anchor was implicit in the upstream config — the validator never re-affirmed which root it was anchored to, leading to mainnet/testnet/devnet crosstalk in shared-codebase tenants.
parentfield divergence. Earlier drafts carried aparent: <uint32>field separate fromnetworkID, so the operator had to reconcile two pointers that always meant the same thing (parent == networkIDfor the network the instance is on).sovereign: boolflag. A redundant flag —validators > 0already says the same thing in fewer bits.
LP-1020 collapses all four. One shape. Two data fields. Mode is derived.
Atomic spawn — one tx, not a sequence
Spawning a sovereign L1 by hand means submitting a sequence of P-Chain transactions: allocate the network ID, register each validator, register each chain (EVM, DEX, FHE, …), then establish the validator set. Partial failure at any point leaves the network half-spawned, so operators have to write idempotent re-run scripts. The atomic primitive replaces the sequence with one tx that the executor either fully commits or fully reverts. The PQ-profile selector binds the Quasar cert mode into the spawn record at network birth.
Specification
The canonical Network record
apiVersion: lux.cloud/v1
kind: Network
metadata:
name: <instance-name> # e.g. "lux-main", "hanzo-l2"
spec:
networkID: <uint32> # what network this instance is on / part of.
# Matches luxd's LUX_NETWORK_ID env var.
# {1,2,3,1337} RESERVED for Lux primaries.
# For a primary itself: networkID = its own value.
# For a chain on a primary: networkID = primary's ID.
# For an independent network: networkID = own value.
evmChainID: <uint64> # this instance's EVM chain ID (omit for X/P chains)
validators: <int> # 0 = no own consensus (chains served by existing set)
# N = emit N validator pods that participate in networkID
chains: []ChainRef # opaque CB58 blockchainIDs hosted by this instance
That is the whole shape. Optional fields (validatorTemplate, indexer,
explorer, bridge, bootnode, labels, annotations,
imagePullSecrets) configure how those pods are run — not what mode the
record is in.
Mode-derivation table
Mode is pure data → behavior:
networkID ∈ {1,2,3,1337} | validators | Mode |
|---|---|---|
| YES | 0 | L2 — chains served by the Lux primary's existing set |
| YES | > 0 | Anchored — N validators participate in the Lux primary (covers both "the primary itself" and "sovereign L1 anchored to it") |
| NO | > 0 | Independent — own primary, fully independent of Lux |
networkID == 0 or validators < 0 are invalid; the operator rejects.
The "Anchored" row intentionally covers both "the primary itself" and "sovereign L1 anchored to it". From the operator's perspective these are identical workloads: bond N validators against the Lux primary's stake registry. Whether those validators ARE the primary's genesis set is a fact about the genesis blob, not the record.
Recursion (L3+) deferred
Chain-on-chain (L3, L4, …) is not in v1. When a real L3 use case emerges, add
a single optional parentChainID: <uint32> field that points at the parent
chain's evmChainID. Not before. Speculative abstractions are
anti-LP-1020.
Why no separate promote primitive in the operator API
Promotion is an edit to the record: bump validators from 0 to N. The
reconciler sees the diff and issues the appropriate P-Chain tx —
CreateNetworkTx at spawn, ConvertNetworkTx for an existing L2. Two diff
paths, no new operator API surface.
Validator-manager pattern
When validators > 0, the on-L1 native-token staking manager owns
validator-set rotation (register / weight churn / end-of-validation /
rewards). The Solidity contract lives at the canonical address
0x0200000000000000000000000000000000000010 on every L1's primary EVM chain.
Source: ~/work/lux/standard/contracts/validators/ — ValidatorManager.sol
(base), PoSValidatorManager.sol (PoS extension),
NativeTokenStakingManager.sol (concrete instance bound to the L1's native
token).
The manager exposes seven core actions:
| Action | Purpose | Caller |
|---|---|---|
initializeValidatorSet | Seed initial set from spawn-time ConversionData | Anyone after L1 spawn |
initializeValidatorRegistration | Lock stake + send RegisterL1ValidatorMessage Warp tx | New validator |
completeValidatorRegistration | Acknowledge P-Chain registration ack | Anyone with Warp ack |
initializeEndValidation | Begin un-stake; emit L1ValidatorWeightMessage(0) | Validator owner |
completeEndValidation | Burn stake or release after P-Chain ack | Anyone with Warp ack |
initializeDelegatorRegistration | Lock delegator stake | Delegator |
completeEndDelegation | Release delegator stake + rewards | Delegator |
The contracts use ERC-7201 namespaced storage. A namespace string hashes to the slot pointer, so the strings are frozen at their deployed values: changing one moves the slot and an in-place upgrade would read empty storage and lose the entire validator set. Human-facing Solidity identifiers (events, errors, struct names) use the Network/L1 vocabulary; the namespace strings do not move.
Atomic spawn transaction
~/work/lux/node/vms/platformvm/txs/create_network_tx.go:
type CreateNetworkTx struct {
BaseTx
Owner fx.Owner
Validators []*NetworkValidator
Chains []*NetworkChain
ManagerChainIdx uint32
ManagerAddress types.JSONByteSlice
PQProfile uint8
}
PQProfile selects the cert composition bound at network birth:
| Byte | Operator name | Cert legs |
|---|---|---|
0 | PQ-fast | BLS ‖ Pulsar |
1 | PQ-strict | BLS ‖ Pulsar ‖ Corona |
2 | PQ-heavy | BLS ‖ Pulsar ‖ Corona ‖ Magnetar |
ZK is profile-orthogonal — attached or absent independently per chain — so a PQ-fast cert may or may not carry a ZK leg.
A validator whose configured Quasar profile does not match the spawn-time
PQProfile refuses to participate in the L1's first round; the L1 cannot
reach finality until enough validators reconfigure or the L1 is delisted by
an Owner-rotation tx.
The per-chain manifest entry:
type NetworkChain struct {
BlockchainName string
VMID ids.ID
FxIDs []ids.ID
GenesisData []byte
}
The per-validator record:
type NetworkValidator struct {
NodeID types.JSONByteSlice
Weight uint64
RemainingBalanceOwner message.PChainOwner
DeactivationOwner message.PChainOwner
Start uint64
End uint64
Owner message.PChainOwner
InitialBalance uint64
DelegationFee uint32
BLSPublicKey [48]byte
BLSPoP [96]byte
}
Start, End, Owner, InitialBalance, DelegationFee follow the
canonical AddPermissionlessValidator shape. BLSPublicKey + BLSPoP are
the proof-of-possession pair for the validator's BLS12-381 G1 public key
(LP-7320), bound at
genesis so the L1's Quasar BLS leg is operational from round 1.
Atomicity contract
Either ALL of
Validators[]are seeded into the validator-manager contract AND ALL ofChains[]are registered AND the sovereign L1 is elected, OR none of these state changes commit.
The standard-tx executor at
~/work/lux/node/vms/platformvm/txs/executor/standard_tx_executor.go
implements CreateNetworkTx(*CreateNetworkTx) error (declared on the
Visitor interface at ~/work/lux/node/vms/platformvm/txs/visitor.go). The
executor must:
- Verify inputs fund the BaseTx fee + the sum of every
Validators[i].InitialBalance+ the chain-create fees. - Derive the new network ID from the tx hash. Reject if it collides with
constants.PrimaryNetworkID. - Verify the
PQProfilebyte names a registered Quasar profile. - Verify every
Validators[i]is well-formed (BLS PoP valid, NodeID non-empty, Weight non-zero) and verifyValidators[]is sorted-and-unique. - Verify every
Chains[i]is well-formed (VMID non-empty, FxIDs sorted-and-unique, GenesisData ≤MaxGenesisLen, BlockchainName ≤MaxNameLen). - Verify
ManagerChainIdx < len(Chains)andlen(ManagerAddress) ≤ MaxChainAddressLength. - Stage every state-write in a single
diff(commit-or-revert). - On any failure in steps 1-7, return error WITHOUT applying any state-write. The diff is dropped intact.
Operator-driven lifecycle
The reconciler (~/work/lux/operator/go/internal/controller/network.go)
dispatches on Spec.HasOwnValidatorSet() — which is just
Spec.Validators > 0. No flag branching, no parent lookup, no mode enum:
validators == 0→ emit no workloads; the chains listed in this record are served by the existing validator set on the network identified bySpec.NetworkID.validators > 0→ emit a StatefulSet with N validator pods + headless + ClusterIP services. The validators participate in the network identified bySpec.NetworkID(Anchored vs Independent depending on whetherSpec.NetworkID∈ {1, 2, 3, 1337}).
Promotion (L2 → Sovereign L1) is bumping validators from 0 to N. The
operator's diff handler issues ConvertNetworkTx against the parent P-Chain,
transfers validator-set authority from the parent's manager to the new on-L1
NativeTokenStakingManager, seeds the new manager from the record's spec,
and boots the new validator pods. The L1's chains continue producing blocks
throughout — no chain halt.
Operator CLI surface
The atomic tx unlocks a one-command spawn from
~/work/lux/cli/cmd/l1cmd/create.go:
lux chain spawn \
--validators 5 \
--chains evm,dex,fhe \
--pq-mode heavy \
--manager-chain evm \
--manager-address 0x...
The CLI:
- Resolves the validator set from local keystore or from a bring-your-own-validators flag.
- Generates per-chain genesis blobs from named templates.
- Maps
--pq-modeto thePQProfilebyte. - Submits the
CreateNetworkTxand waits for finality.
Per-network EVM chainID per env
The canonical map per brand × env is implemented in
~/work/lux/genesis/configs/chain_id_map.go (function
EVMChainID(family, env) and string-input convenience
EVMChainIDFor(brand, env)):
| Brand | Mainnet (networkID=1) | Testnet (networkID=2) | Devnet (networkID=3) | Localnet (networkID=1337) |
|---|---|---|---|---|
| Lux primary EVM (C-Chain) | 96369 | 96368 | 96370 | 31337 |
| Hanzo L2 | 36963 | 36962 | 36964 | TBD |
| Zoo L2 | 200200 | 200201 | 200202 | TBD |
| SPC L2 | 36911 | 36910 | 36912 | TBD |
| Pars sovereign / independent | 494949 | 494950 | 494951 | TBD |
| Osage | TBD | TBD | TBD | TBD |
Operators must NEVER reuse a chainID across brand × env — the EVM chainID is
the EIP-155 replay-protection root, and reuse would allow cross-network
replay attacks. The chainID is bound at network creation in
NetworkSpec.EVMChainID and baked into the EVM genesis blob the operator
passes to CreateNetworkTx.Chains[i].GenesisData, so validators cannot
disagree on chainID — it is consensus-bound from round 1.
Warp interop
Cross-network calls (L1↔L2↔primary) flow through the Warp precompile at
0x0200000000000000000000000000000000000005. The receiving network verifies
a BLS-aggregated signature over the source network's validator set; no
destination tracking or per-pair registration required. Warp message header:
sourceChainID— the L1's blockchain ID (NOT EVM chainID).originSenderAddress— the sending contract's address, oraddress(0)for P-Chain-origin messages.payload— opaque bytes; the receiving contract decodes per its own schema.
PQ-ready churn semantics
Validator BLS signatures move to Pulsar hybrid (classical BLS12-381 + Pulsar
lattice) over the activation timeline. The
ValidatorManager._initializeValidatorRegistration path verifies PQ-side
proofs of possession alongside the classical leg when the network's
PQProfile is non-zero. A validator without a Pulsar key cannot register on
a PQ-profile L1 — the manager reverts with InvalidBLSKeyLength.
Failure-mode tests
The executor must fail-and-revert in each of these cases. Each case is a test
in ~/work/lux/node/vms/platformvm/txs/executor/:
| Failure | Expected state |
|---|---|
| Underfunded BaseTx | No state change |
| Derived network ID equals PrimaryNetworkID | No state change |
PQProfile byte unrecognized | No state change |
| Validators not sorted/unique | No state change |
| Any Validators[i].Verify() fails | No state change |
len(Chains) > MaxNetworkChains | No state change |
| Any Chains[i].Verify() fails | No state change |
ManagerChainIdx >= len(Chains) | No state change |
len(ManagerAddress) > MaxChainAddressLength | No state change |
Manager-side revert paths (tested in
~/work/lux/standard/contracts/validators/test/):
| Failure | Manager response |
|---|---|
| Underweight registration | InvalidStakeAmount |
Duplicate nodeID registration | NodeAlreadyRegistered |
Weight churn > maximumChurnPercentage per period | MaxChurnRateExceeded |
End-validation called before minStakeDuration | MinStakeDurationNotPassed |
| Non-owner ends a PoS validation | UnauthorizedOwner |
| Warp message from wrong source chain | InvalidWarpSourceChainID |
messageNonce violates the monotonic constraint | InvalidNonce |
Rationale
Why one field instead of two
The earlier draft (parent: <uint32> + networkID: <uint32>) carried two
pointers that, for every realistic configuration, meant the same thing: "what
network is this instance on / part of". The operator had to reconcile the two
fields, validate they agreed where they overlapped, and document which one
was authoritative. By collapsing to a single networkID that matches
LUX_NETWORK_ID semantically, there is no reconcile step, no validation
rule, no docstring ambiguity. The data carries its own meaning.
Why validators instead of sovereign: bool
A sovereign: bool field communicates the same information as
validators > 0 but with worse downstream ergonomics:
- The operator cannot distinguish "set to false explicitly" from "not set"
without a tri-state.
validatorsis an integer with a clear zero point. - A
sovereign: boolwould have to be validated againstvalidators(you cannot havesovereign: true, validators: 0). The integer needs no such rule. - The pod-template surface already inspects
validatorsto size the StatefulSet. A separate flag is redundant data.
One field, one truth.
Why atomicity matters
A half-spawned L1 is observable on Lux primary: validators are registered but no chain manifest exists, or chains exist but the sovereign election did not complete. Without atomicity, operators must write reconciliation tooling to detect and complete or abort half-spawned L1s. The atomic primitive eliminates the failure mode.
Why PQ profile binds at spawn
A node-side runtime profile knob is a misconfiguration trap. LP-1020 binds the profile to the network's registration record on Lux primary; a validator that reads the spawn record knows unambiguously which Quasar profile it must run. A misconfigured validator self-detects at first round.
Why per-validator InitialBalance
The per-validator balance is the L1's seed-fund into the validator's native account on the L1 (NOT on Lux primary). It funds the validator's first round's gas without requiring a post-spawn bridge transfer. Tenants commonly want to seed validators with operating capital from genesis; LP-1020 makes this an inline field, not a follow-up tx.
Why MaxNetworkChains = 16
The cap is set by tx-size considerations: a 16-chain manifest with the
worst-case GenesisData = MaxGenesisLen per chain is still under the P-Chain
mempool's per-tx ceiling. Practical L1s ship 1-5 chains (EVM + maybe DEX +
maybe FHE); the cap is a guard, not a working limit.
Why operator-driven
A manual ceremony for L1 spawn — clicking through a CLI wizard, copying
genesis blobs by hand — is error-prone and not auditable. The operator takes
a single record apply as the source of truth, reconciles it declaratively,
and any cluster observer can kubectl get network -o yaml to see the
canonical state. No tribal knowledge required.
Why the storage namespace strings are frozen
ERC-7201 namespaced storage uses a hash of the namespace string as the slot pointer. Changing a string would break in-place upgrades of already-deployed managers: the new contract would read from a different slot, losing all validator state. Human-facing Solidity identifiers are free to change; the namespace strings are not.
Test Cases
Network happy path (Anchored / Sovereign L1)
~/work/lux/operator/go/internal/controller/network_test.go:
- Apply a Network record with
networkID: 1, validators: 5. - Operator issues one
CreateNetworkTxagainst P-Chain. - Operator boots 5 validator pods; each becomes ready.
- Status reports
phase: Ready,mode: Anchored,activeValidators: 5,chainCount: len(spec.chains).
Network happy path (L2)
Same file:
- Apply a Network record with
networkID: 1, validators: 0. - Operator issues
CreateChainTxper entry inspec.chains[]. - Operator updates the parent's
LuxNetwork.spec.tenantNetworks[]to include the L2's blockchain IDs. - Parent's validators add the L2's chains to their
--track-chainson next reload. - Status reports
phase: Ready,mode: L2, without any per-L2 validator pods.
Network happy path (Independent)
- Apply a Network record with
networkID: 999001, validators: 5. - Operator emits a StatefulSet that runs an independent primary (no P-Chain interaction with Lux mainnet).
- Status reports
mode: Independent,activeValidators: 5.
L2 → Anchored promotion
~/work/lux/operator/go/internal/controller/network_promotion_test.go:
- Apply a Network record with
networkID: 1, validators: 0; observephase: Ready, mode: L2. - Patch to
validators: 5. - Operator issues
ConvertNetworkTx. - Operator deploys 5 new validator pods.
- Status reports
phase: Promoting → Ready, mode: Anchored. - The L1's chains continue producing blocks throughout (no chain halt).
Mode-derivation unit table
~/work/lux/operator/go/api/v1/network_mode_test.go exhaustively covers the
(networkID, validators) → mode mapping for every canonical brand × env
combination plus negative cases. The test is the floor that prevents anyone
from re-introducing parent or sovereign: bool without breaking the suite.
Wire round-trip
CreateNetworkTx is covered by the ZAP build/parse suite
(LP-1010). The test must:
- Build a valid
CreateNetworkTxwith 5 validators, 3 chains,PQProfile = 2. - Take
Bytes(). Parsethe buffer.- Assert field equality on every field, including the nested
NetworkValidatorandNetworkChainrecords. - Assert
Bytes()returns the same underlying buffer with no copy.
Executor happy path
~/work/lux/node/vms/platformvm/txs/executor/standard_tx_executor_test.go:
- Funds an account on P-Chain.
- Submits a well-formed
CreateNetworkTx. - Asserts the post-tx state shows: (a) new network ID registered, (b) all validators seeded into the manager contract, (c) all chains registered, (d) sovereign election complete.
Executor failure modes
~/work/lux/node/vms/platformvm/txs/executor/create_network_failure_test.go
exercises each of the nine failure cases listed in §Specification →
Failure-mode tests. Each test asserts NO partial state visible
post-execution.
Staking-manager unit tests
The test suite at ~/work/lux/standard/contracts/validators/test/ covers:
initializeValidatorRegistrationhappy path + nine failure modes.- Churn-tracker monotonicity under concurrent registrations.
- Delegator reward calculation with uptime proof.
- End-validation with and without uptime proof.
forceInitializeEndValidationover-rewards-vs-eligibility branches.
Reference Implementation
Go (operator + node)
~/work/lux/operator/go/api/v1/network_types.go—NetworkSpecwith the two-field shape and mode derivation.~/work/lux/operator/go/internal/controller/network.go— reconciler dispatching onHasOwnValidatorSet().~/work/lux/operator/go/api/v1/network_mode_test.go— mode-derivation lock-in tests.~/work/lux/node/vms/platformvm/security/— thesecurity.Modepackage.~/work/lux/node/vms/platformvm/txs/create_network_tx.go—CreateNetworkTx,NetworkChain,MaxNetworkChains = 16, the canonical error set,SyntacticVerify, and theVisit(visitor Visitor)dispatcher.~/work/lux/node/vms/platformvm/txs/visitor.go— theVisitorinterface declaration that the executor implements.~/work/lux/node/vms/platformvm/txs/convert_network_tx.go—ConvertNetworkTxand the sharedNetworkValidator.~/work/lux/cli/cmd/l1cmd/create.go— operator CLI entry point.
Rust (tenant operator mirrors)
~/work/lux/operator/rust/src/crd.rs—NetworkSpecmirror with identical JSON shape.~/work/lux/operator/rust/src/controllers/network.rs— reconciler.
Solidity (on-L1 staking manager)
~/work/lux/standard/contracts/validators/ValidatorManager.sol— base class with the storage layout + Warp messaging.~/work/lux/standard/contracts/validators/PoSValidatorManager.sol— PoS extension with delegation + uptime + rewards.~/work/lux/standard/contracts/validators/NativeTokenStakingManager.sol— concrete instance bound to the L1's native token via the native-minter precompile.~/work/lux/standard/contracts/validators/ValidatorMessages.sol— Warp message codec.
Canonical chainID map
~/work/lux/genesis/configs/chain_id_map.go— typedEVMChainID(family, env)+ string-inputEVMChainIDFor(brand, env).~/work/lux/genesis/configs/chain_id_map_test.go— lock-in tests for every brand × env cell.
Security Considerations
Atomicity is load-bearing
The atomicity contract is the load-bearing security property. A naive executor that committed each step incrementally would leak half-state on partial-failure paths; a hostile actor could mint a half-spawned L1 record and use it to confuse downstream tooling (genesis verifiers, light clients, bridge contracts) without ever running a real L1.
PQ-profile binding closes a cert-substitution attack
The PQ-profile spawn-bind closes a subtle attack: an attacker who runs N validators with a weaker profile could censor a stronger-profile L1's rounds by emitting weaker-profile certs that the network rejects. With the profile bound to the registration record AND verified by the on-L1 manager, every honest validator can locally check the cert profile against the spawn-time pin and refuse to participate if its own config mismatches.
Churn-rate bounded by manager, not by P-Chain
The manager enforces maximumChurnPercentage per churnPeriodSeconds. A
hostile validator that floods the L1 with registration messages cannot exceed
the churn rate — the manager reverts at _checkAndUpdateChurnTracker. The
P-Chain sees only the Warp messages that the manager actually emits, so the
parent network's mempool is naturally bounded.
Two fields, two values to validate
The record's surface area is two fields. There are only two ways to
misconfigure it: (a) a non-canonical networkID for an instance the user
thought was a Lux primary; (b) a validators count below 0 or above the
operator's per-cluster cap. Both are statically detectable at apply time by
the admission webhook. No silent modes.
Promotion atomicity
ConvertNetworkTx is a single atomic state transition on the parent P-Chain.
A partial failure leaves both old (L2-tracking) and new (L1-validating)
states inconsistent only if the executor silently commits a partial diff —
forbidden by the standard tx executor's commit-or-revert contract
(§Atomicity contract).
Social-coordination cost
The atomic spawn does NOT eliminate the social-coordination cost of bringing N validators online simultaneously. Operators must still pre-stage validator daemons. The atomicity is at the chain state level, not at the operator-side rollout level.
Copyright
Copyright and related rights waived via CC0.