mirror of
https://github.com/luxfi/node.git
synced 2026-07-27 03:06:23 +00:00
scrub: subnet/l2 → chain (canonical vocabulary, forward-only)
Wire-format codec IDs unchanged. CLI aliases deleted; chain is the command. No backwards-compat shims, no deprecation comments.
This commit is contained in:
+1
-1
@@ -204,7 +204,7 @@ Wallet, CLI, EVM, DeFi, threshold cryptography, and the first key management sys
|
||||
| `lux/threshold` | 2021-02-16 | Threshold ECDSA (tECDSA) library |
|
||||
| `lux/erc20-go` | 2021-05-21 | ERC-20 Go bindings |
|
||||
| `lux/netrunner` | 2021-10-22 | Network testing framework (2,384 commits) |
|
||||
| `lux/evm` | 2021-12-15 | Subnet EVM (1,632 commits) |
|
||||
| `lux/evm` | 2021-12-15 | App chain EVM (1,632 commits) |
|
||||
| `lux/devops` / `lux/lux-ops` | 2022-01-28 | Infrastructure automation |
|
||||
| `lux/ledger` | 2022-03-14 | Ledger hardware wallet integration |
|
||||
| `lux/lpm` | 2022-03-28 | Lux Plugin Manager |
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# Deploy all 4 subnet chains (Zoo, Hanzo, SPC, Pars) to mainnet + testnet
|
||||
# Usage: ./deploy-subnets.sh [mainnet|testnet|devnet|both]
|
||||
# Deploy all 4 app chains (Zoo, Hanzo, SPC, Pars) to mainnet + testnet
|
||||
# Usage: ./deploy-chains.sh [mainnet|testnet|devnet|both]
|
||||
#
|
||||
# Prerequisites:
|
||||
# - macOS keychain must have mainnet-key-02 key (will prompt for approval)
|
||||
@@ -21,7 +21,7 @@ if [ ! -f "$DEPLOY_BIN" ]; then
|
||||
fi
|
||||
|
||||
# Use mainnet-key-02 (NOT 01!) because 01's funds are all staked by initialStakers
|
||||
# mainnet-key-02 has 70M LUX unlocked on P-chain, sufficient for subnet creation
|
||||
# mainnet-key-02 has 70M LUX unlocked on P-chain, sufficient for chain creation
|
||||
KEY_NAME="mainnet-key-02"
|
||||
echo "Extracting $KEY_NAME from keychain..."
|
||||
echo "(Approve the macOS keychain dialog that appears)"
|
||||
@@ -39,7 +39,7 @@ deploy_network() {
|
||||
local network=$1
|
||||
echo ""
|
||||
echo "=============================="
|
||||
echo "Deploying subnets to $network"
|
||||
echo "Deploying chains to $network"
|
||||
echo "=============================="
|
||||
|
||||
PRIVATE_KEY="$KEY" "$DEPLOY_BIN" \
|
||||
@@ -77,7 +77,7 @@ echo ""
|
||||
echo "All deployments complete!"
|
||||
echo ""
|
||||
echo "Next steps:"
|
||||
echo " 1. Copy the Subnet IDs and Blockchain IDs from output above"
|
||||
echo " 1. Copy the Chain IDs and Blockchain IDs from output above"
|
||||
echo " 2. Update Helm values files:"
|
||||
echo " ~/work/lux/devops/charts/lux/values-mainnet.yaml"
|
||||
echo " ~/work/lux/devops/charts/lux/values-testnet.yaml"
|
||||
@@ -55,9 +55,9 @@ func NewMultiNetworkNode() *MultiNetworkNode {
|
||||
ChainID: "2JVSBoinj9C2J33VntvzYtVJNZdN2NKiwwKjcumHUWEb5DbBrm",
|
||||
Active: true,
|
||||
},
|
||||
200200: { // Zoo L2 Chain ID
|
||||
200200: { // Zoo chain Chain ID
|
||||
NetworkID: 200200,
|
||||
NetworkName: "Zoo Network (L2)",
|
||||
NetworkName: "Zoo Network",
|
||||
RPCPort: 2000,
|
||||
Validators: 5,
|
||||
ChainID: "2ebCneCbwthjQ1rYT41nhd7M76Hc6YmosMAQrTFhBq8qeqh6tt",
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#!/bin/bash
|
||||
# Import RLP blocks for subnet chains after deployment
|
||||
# Usage: ./import-subnet-rlp.sh [mainnet|testnet|both]
|
||||
# Import RLP blocks for chains after deployment
|
||||
# Usage: ./import-chain-rlp.sh [mainnet|testnet|both]
|
||||
#
|
||||
# Prerequisites:
|
||||
# - Subnets must be deployed (run deploy-subnets.sh first)
|
||||
# - Nodes must be tracking the subnet chains
|
||||
# - Chains must be deployed (run deploy-chains.sh first)
|
||||
# - Nodes must be tracking the chains
|
||||
# - Blockchain IDs must be set in the node config
|
||||
|
||||
set -e
|
||||
@@ -37,7 +37,7 @@ import_rlp() {
|
||||
local ns="lux-$network"
|
||||
kubectl --context do-sfo3-lux-k8s exec -n "$ns" luxd-0 -- \
|
||||
wget -q -O /tmp/import.rlp "$rpc_url" 2>/dev/null || true
|
||||
echo "NOTE: For subnet chain import, you may need to use admin.importChain RPC"
|
||||
echo "NOTE: For chain import, you may need to use admin.importChain RPC"
|
||||
echo " or copy the RLP file to the node and import manually."
|
||||
}
|
||||
}
|
||||
@@ -46,20 +46,20 @@ TARGET="${1:-both}"
|
||||
|
||||
case "$TARGET" in
|
||||
mainnet)
|
||||
echo "=== Importing subnet RLP blocks to mainnet ==="
|
||||
echo "=== Importing chain RLP blocks to mainnet ==="
|
||||
import_rlp mainnet zoo-mainnet 200200 zoo-mainnet-200200.rlp "$MAINNET_RPC"
|
||||
import_rlp mainnet spc-mainnet 36911 spc-mainnet-36911.rlp "$MAINNET_RPC"
|
||||
;;
|
||||
testnet)
|
||||
echo "=== Importing subnet RLP blocks to testnet ==="
|
||||
echo "=== Importing chain RLP blocks to testnet ==="
|
||||
import_rlp testnet zoo-testnet 200201 zoo-testnet-200201.rlp "$TESTNET_RPC"
|
||||
;;
|
||||
both|all)
|
||||
echo "=== Importing subnet RLP blocks to mainnet ==="
|
||||
echo "=== Importing chain RLP blocks to mainnet ==="
|
||||
import_rlp mainnet zoo-mainnet 200200 zoo-mainnet-200200.rlp "$MAINNET_RPC"
|
||||
import_rlp mainnet spc-mainnet 36911 spc-mainnet-36911.rlp "$MAINNET_RPC"
|
||||
echo ""
|
||||
echo "=== Importing subnet RLP blocks to testnet ==="
|
||||
echo "=== Importing chain RLP blocks to testnet ==="
|
||||
import_rlp testnet zoo-testnet 200201 zoo-testnet-200201.rlp "$TESTNET_RPC"
|
||||
;;
|
||||
*)
|
||||
@@ -51,7 +51,7 @@ type Ping struct {
|
||||
}
|
||||
|
||||
// ChainPingEntry is the per-chain payload in Ping/Pong.
|
||||
// In Lux's L1/L2 model each chain is its own validator set, so the legacy
|
||||
// In Lux's chain model each chain is its own validator set, so the legacy
|
||||
// (chain, network) pair collapses to a single chain identifier.
|
||||
type ChainPingEntry struct {
|
||||
ChainId []byte
|
||||
|
||||
+2
-2
@@ -148,8 +148,8 @@ type Config struct {
|
||||
// This allows chains to be sequenced by a different validator set than their own.
|
||||
// Examples:
|
||||
// - C-Chain → returns PrimaryNetworkID (sequenced by primary network validators)
|
||||
// - Zoo L2 (self-sequenced) → returns ZooChainID
|
||||
// - Zoo L2 (Lux-sequenced) → returns the Lux network's sequencerID
|
||||
// - Zoo chain (self-sequenced) → returns ZooChainID
|
||||
// - Zoo chain (Lux-sequenced) → returns the Lux network's sequencerID
|
||||
// Default: returns chainID (self-sequenced).
|
||||
SequencerIDForChain func(chainID ids.ID) ids.ID `json:"-"`
|
||||
|
||||
|
||||
+6
-6
@@ -220,7 +220,7 @@ type network struct {
|
||||
router ExternalHandler
|
||||
|
||||
// blockchainToNetwork maps blockchain IDs to their chain network IDs.
|
||||
// This is needed for chain gossip: when gossiping a block for an L2
|
||||
// This is needed for chain gossip: when gossiping a block for another chain
|
||||
// blockchain, we need to know which chain network's validator set to
|
||||
// use for peer sampling, and which network ID to check in peers'
|
||||
// trackedChains. Protected by peersLock.
|
||||
@@ -598,13 +598,13 @@ func kemSessionScheme(p *consensusconfig.ChainSecurityProfile) kem.KeyExchangeID
|
||||
|
||||
// sequencerID returns the validator-set identity that sequences chainID.
|
||||
// This resolves the distinction between:
|
||||
// - chainID: execution domain (C-Chain, Zoo L2, etc.)
|
||||
// - chainID: execution domain (C-Chain, Zoo chain, etc.)
|
||||
// - sequencerID: validator-set / sequencing authority for a given chain
|
||||
//
|
||||
// For example:
|
||||
// - C-Chain is sequenced by PrimaryNetworkID validators
|
||||
// - A self-sequenced L2 uses its own chainID as sequencerID
|
||||
// - L2 blockchains map to their chain ID for validator lookups
|
||||
// - A self-sequenced chain uses its own chainID as sequencerID
|
||||
// - non-primary chains map to their chain ID for validator lookups
|
||||
func (n *network) sequencerID(chainID ids.ID) ids.ID {
|
||||
// Primary network is a special routing concept; membership is still primary.
|
||||
if chainID == constants.PrimaryNetworkID {
|
||||
@@ -1305,7 +1305,7 @@ func (n *network) samplePeers(
|
||||
isPrimaryNetwork := chainID == constants.PrimaryNetworkID || ids.IsNativeChain(chainID)
|
||||
containsChainID := isPrimaryNetwork || trackedChains.Contains(chainID)
|
||||
|
||||
// For L2 blockchains, also check if the peer tracks the chain ID.
|
||||
// For non-primary chains, also check if the peer tracks the chain ID.
|
||||
// Peers advertise chain IDs (not blockchain IDs) in their tracked chains,
|
||||
// but gossip uses blockchain IDs as the chainID parameter.
|
||||
if !containsChainID {
|
||||
@@ -1942,7 +1942,7 @@ func (n *network) TrackedChains() set.Set[ids.ID] {
|
||||
|
||||
// RegisterBlockchainNetwork registers a mapping from a blockchain ID to its
|
||||
// chain network ID. This allows the gossip layer to correctly resolve which
|
||||
// validator set to use when gossiping blocks for L2 chains, and to check
|
||||
// validator set to use when gossiping blocks for non-primary chains, and to check
|
||||
// whether peers are tracking the chain network that owns the blockchain.
|
||||
func (n *network) RegisterBlockchainNetwork(blockchainID, networkID ids.ID) {
|
||||
n.peersLock.Lock()
|
||||
|
||||
+1
-1
@@ -705,7 +705,7 @@ func (n *Node) initNetworking(reg metric.Registerer) error {
|
||||
// strict-PQ chains. Nil on legacy / classical-compat networks.
|
||||
n.Config.NetworkConfig.SecurityProfile = n.securityProfile
|
||||
// Map native chains (P/C/X/etc.) to the primary network validator set.
|
||||
// For L2 chains, return ids.Empty to let blockchainToNetwork map resolve
|
||||
// For non-primary chains, return ids.Empty to let blockchainToNetwork map resolve
|
||||
// the correct chain ID. Returning chainID here would short-circuit the
|
||||
// lookup and cause chain messages to be sequenced under the wrong ID,
|
||||
// preventing block propagation to other nodes.
|
||||
|
||||
@@ -110,7 +110,7 @@ func (v *ValidatorManager) Connected(nodeID ids.NodeID, nodeVersion *version.App
|
||||
}
|
||||
|
||||
// Also add to ALL tracked chain validator sets so chain consensus
|
||||
// engines can find validators for their chains. Without this, L2
|
||||
// engines can find validators for their chains. Without this, non-primary
|
||||
// chains can't gossip blocks because the validator set is empty.
|
||||
for _, networkID := range v.trackedNetworks {
|
||||
networkTxID := ids.Empty
|
||||
|
||||
@@ -47,7 +47,7 @@ type Network struct {
|
||||
Nets []*Net
|
||||
}
|
||||
|
||||
// Net represents a net (L2 chain) in the network
|
||||
// Net represents a net (non-primary chain) in the network
|
||||
type Net struct {
|
||||
ChainID ids.ID
|
||||
Chains []*Chain
|
||||
|
||||
@@ -22,7 +22,7 @@ import (
|
||||
const (
|
||||
// MaxTxSize is the maximum number of bytes a transaction can use to be
|
||||
// allowed into the mempool. Increased from 64 KiB to 2 MiB to support
|
||||
// large genesis configurations (e.g., ZOO L2 genesis is ~613 KiB).
|
||||
// large genesis configurations (e.g., ZOO chain genesis is ~613 KiB).
|
||||
MaxTxSize = 2 * constants.MiB
|
||||
|
||||
// droppedTxIDsCacheSize is the maximum number of dropped txIDs to cache
|
||||
|
||||
Reference in New Issue
Block a user