mirror of
https://github.com/luxfi/node.git
synced 2026-07-27 03:39:39 +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/threshold` | 2021-02-16 | Threshold ECDSA (tECDSA) library |
|
||||||
| `lux/erc20-go` | 2021-05-21 | ERC-20 Go bindings |
|
| `lux/erc20-go` | 2021-05-21 | ERC-20 Go bindings |
|
||||||
| `lux/netrunner` | 2021-10-22 | Network testing framework (2,384 commits) |
|
| `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/devops` / `lux/lux-ops` | 2022-01-28 | Infrastructure automation |
|
||||||
| `lux/ledger` | 2022-03-14 | Ledger hardware wallet integration |
|
| `lux/ledger` | 2022-03-14 | Ledger hardware wallet integration |
|
||||||
| `lux/lpm` | 2022-03-28 | Lux Plugin Manager |
|
| `lux/lpm` | 2022-03-28 | Lux Plugin Manager |
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Deploy all 4 subnet chains (Zoo, Hanzo, SPC, Pars) to mainnet + testnet
|
# Deploy all 4 app chains (Zoo, Hanzo, SPC, Pars) to mainnet + testnet
|
||||||
# Usage: ./deploy-subnets.sh [mainnet|testnet|devnet|both]
|
# Usage: ./deploy-chains.sh [mainnet|testnet|devnet|both]
|
||||||
#
|
#
|
||||||
# Prerequisites:
|
# Prerequisites:
|
||||||
# - macOS keychain must have mainnet-key-02 key (will prompt for approval)
|
# - macOS keychain must have mainnet-key-02 key (will prompt for approval)
|
||||||
@@ -21,7 +21,7 @@ if [ ! -f "$DEPLOY_BIN" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Use mainnet-key-02 (NOT 01!) because 01's funds are all staked by initialStakers
|
# 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"
|
KEY_NAME="mainnet-key-02"
|
||||||
echo "Extracting $KEY_NAME from keychain..."
|
echo "Extracting $KEY_NAME from keychain..."
|
||||||
echo "(Approve the macOS keychain dialog that appears)"
|
echo "(Approve the macOS keychain dialog that appears)"
|
||||||
@@ -39,7 +39,7 @@ deploy_network() {
|
|||||||
local network=$1
|
local network=$1
|
||||||
echo ""
|
echo ""
|
||||||
echo "=============================="
|
echo "=============================="
|
||||||
echo "Deploying subnets to $network"
|
echo "Deploying chains to $network"
|
||||||
echo "=============================="
|
echo "=============================="
|
||||||
|
|
||||||
PRIVATE_KEY="$KEY" "$DEPLOY_BIN" \
|
PRIVATE_KEY="$KEY" "$DEPLOY_BIN" \
|
||||||
@@ -77,7 +77,7 @@ echo ""
|
|||||||
echo "All deployments complete!"
|
echo "All deployments complete!"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Next steps:"
|
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 " 2. Update Helm values files:"
|
||||||
echo " ~/work/lux/devops/charts/lux/values-mainnet.yaml"
|
echo " ~/work/lux/devops/charts/lux/values-mainnet.yaml"
|
||||||
echo " ~/work/lux/devops/charts/lux/values-testnet.yaml"
|
echo " ~/work/lux/devops/charts/lux/values-testnet.yaml"
|
||||||
@@ -55,9 +55,9 @@ func NewMultiNetworkNode() *MultiNetworkNode {
|
|||||||
ChainID: "2JVSBoinj9C2J33VntvzYtVJNZdN2NKiwwKjcumHUWEb5DbBrm",
|
ChainID: "2JVSBoinj9C2J33VntvzYtVJNZdN2NKiwwKjcumHUWEb5DbBrm",
|
||||||
Active: true,
|
Active: true,
|
||||||
},
|
},
|
||||||
200200: { // Zoo L2 Chain ID
|
200200: { // Zoo chain Chain ID
|
||||||
NetworkID: 200200,
|
NetworkID: 200200,
|
||||||
NetworkName: "Zoo Network (L2)",
|
NetworkName: "Zoo Network",
|
||||||
RPCPort: 2000,
|
RPCPort: 2000,
|
||||||
Validators: 5,
|
Validators: 5,
|
||||||
ChainID: "2ebCneCbwthjQ1rYT41nhd7M76Hc6YmosMAQrTFhBq8qeqh6tt",
|
ChainID: "2ebCneCbwthjQ1rYT41nhd7M76Hc6YmosMAQrTFhBq8qeqh6tt",
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Import RLP blocks for subnet chains after deployment
|
# Import RLP blocks for chains after deployment
|
||||||
# Usage: ./import-subnet-rlp.sh [mainnet|testnet|both]
|
# Usage: ./import-chain-rlp.sh [mainnet|testnet|both]
|
||||||
#
|
#
|
||||||
# Prerequisites:
|
# Prerequisites:
|
||||||
# - Subnets must be deployed (run deploy-subnets.sh first)
|
# - Chains must be deployed (run deploy-chains.sh first)
|
||||||
# - Nodes must be tracking the subnet chains
|
# - Nodes must be tracking the chains
|
||||||
# - Blockchain IDs must be set in the node config
|
# - Blockchain IDs must be set in the node config
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
@@ -37,7 +37,7 @@ import_rlp() {
|
|||||||
local ns="lux-$network"
|
local ns="lux-$network"
|
||||||
kubectl --context do-sfo3-lux-k8s exec -n "$ns" luxd-0 -- \
|
kubectl --context do-sfo3-lux-k8s exec -n "$ns" luxd-0 -- \
|
||||||
wget -q -O /tmp/import.rlp "$rpc_url" 2>/dev/null || true
|
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."
|
echo " or copy the RLP file to the node and import manually."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -46,20 +46,20 @@ TARGET="${1:-both}"
|
|||||||
|
|
||||||
case "$TARGET" in
|
case "$TARGET" in
|
||||||
mainnet)
|
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 zoo-mainnet 200200 zoo-mainnet-200200.rlp "$MAINNET_RPC"
|
||||||
import_rlp mainnet spc-mainnet 36911 spc-mainnet-36911.rlp "$MAINNET_RPC"
|
import_rlp mainnet spc-mainnet 36911 spc-mainnet-36911.rlp "$MAINNET_RPC"
|
||||||
;;
|
;;
|
||||||
testnet)
|
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"
|
import_rlp testnet zoo-testnet 200201 zoo-testnet-200201.rlp "$TESTNET_RPC"
|
||||||
;;
|
;;
|
||||||
both|all)
|
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 zoo-mainnet 200200 zoo-mainnet-200200.rlp "$MAINNET_RPC"
|
||||||
import_rlp mainnet spc-mainnet 36911 spc-mainnet-36911.rlp "$MAINNET_RPC"
|
import_rlp mainnet spc-mainnet 36911 spc-mainnet-36911.rlp "$MAINNET_RPC"
|
||||||
echo ""
|
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"
|
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.
|
// 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.
|
// (chain, network) pair collapses to a single chain identifier.
|
||||||
type ChainPingEntry struct {
|
type ChainPingEntry struct {
|
||||||
ChainId []byte
|
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.
|
// This allows chains to be sequenced by a different validator set than their own.
|
||||||
// Examples:
|
// Examples:
|
||||||
// - C-Chain → returns PrimaryNetworkID (sequenced by primary network validators)
|
// - C-Chain → returns PrimaryNetworkID (sequenced by primary network validators)
|
||||||
// - Zoo L2 (self-sequenced) → returns ZooChainID
|
// - Zoo chain (self-sequenced) → returns ZooChainID
|
||||||
// - Zoo L2 (Lux-sequenced) → returns the Lux network's sequencerID
|
// - Zoo chain (Lux-sequenced) → returns the Lux network's sequencerID
|
||||||
// Default: returns chainID (self-sequenced).
|
// Default: returns chainID (self-sequenced).
|
||||||
SequencerIDForChain func(chainID ids.ID) ids.ID `json:"-"`
|
SequencerIDForChain func(chainID ids.ID) ids.ID `json:"-"`
|
||||||
|
|
||||||
|
|||||||
+6
-6
@@ -220,7 +220,7 @@ type network struct {
|
|||||||
router ExternalHandler
|
router ExternalHandler
|
||||||
|
|
||||||
// blockchainToNetwork maps blockchain IDs to their chain network IDs.
|
// 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
|
// blockchain, we need to know which chain network's validator set to
|
||||||
// use for peer sampling, and which network ID to check in peers'
|
// use for peer sampling, and which network ID to check in peers'
|
||||||
// trackedChains. Protected by peersLock.
|
// trackedChains. Protected by peersLock.
|
||||||
@@ -598,13 +598,13 @@ func kemSessionScheme(p *consensusconfig.ChainSecurityProfile) kem.KeyExchangeID
|
|||||||
|
|
||||||
// sequencerID returns the validator-set identity that sequences chainID.
|
// sequencerID returns the validator-set identity that sequences chainID.
|
||||||
// This resolves the distinction between:
|
// 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
|
// - sequencerID: validator-set / sequencing authority for a given chain
|
||||||
//
|
//
|
||||||
// For example:
|
// For example:
|
||||||
// - C-Chain is sequenced by PrimaryNetworkID validators
|
// - C-Chain is sequenced by PrimaryNetworkID validators
|
||||||
// - A self-sequenced L2 uses its own chainID as sequencerID
|
// - A self-sequenced chain uses its own chainID as sequencerID
|
||||||
// - L2 blockchains map to their chain ID for validator lookups
|
// - non-primary chains map to their chain ID for validator lookups
|
||||||
func (n *network) sequencerID(chainID ids.ID) ids.ID {
|
func (n *network) sequencerID(chainID ids.ID) ids.ID {
|
||||||
// Primary network is a special routing concept; membership is still primary.
|
// Primary network is a special routing concept; membership is still primary.
|
||||||
if chainID == constants.PrimaryNetworkID {
|
if chainID == constants.PrimaryNetworkID {
|
||||||
@@ -1305,7 +1305,7 @@ func (n *network) samplePeers(
|
|||||||
isPrimaryNetwork := chainID == constants.PrimaryNetworkID || ids.IsNativeChain(chainID)
|
isPrimaryNetwork := chainID == constants.PrimaryNetworkID || ids.IsNativeChain(chainID)
|
||||||
containsChainID := isPrimaryNetwork || trackedChains.Contains(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,
|
// Peers advertise chain IDs (not blockchain IDs) in their tracked chains,
|
||||||
// but gossip uses blockchain IDs as the chainID parameter.
|
// but gossip uses blockchain IDs as the chainID parameter.
|
||||||
if !containsChainID {
|
if !containsChainID {
|
||||||
@@ -1942,7 +1942,7 @@ func (n *network) TrackedChains() set.Set[ids.ID] {
|
|||||||
|
|
||||||
// RegisterBlockchainNetwork registers a mapping from a blockchain ID to its
|
// RegisterBlockchainNetwork registers a mapping from a blockchain ID to its
|
||||||
// chain network ID. This allows the gossip layer to correctly resolve which
|
// 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.
|
// whether peers are tracking the chain network that owns the blockchain.
|
||||||
func (n *network) RegisterBlockchainNetwork(blockchainID, networkID ids.ID) {
|
func (n *network) RegisterBlockchainNetwork(blockchainID, networkID ids.ID) {
|
||||||
n.peersLock.Lock()
|
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.
|
// strict-PQ chains. Nil on legacy / classical-compat networks.
|
||||||
n.Config.NetworkConfig.SecurityProfile = n.securityProfile
|
n.Config.NetworkConfig.SecurityProfile = n.securityProfile
|
||||||
// Map native chains (P/C/X/etc.) to the primary network validator set.
|
// 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
|
// the correct chain ID. Returning chainID here would short-circuit the
|
||||||
// lookup and cause chain messages to be sequenced under the wrong ID,
|
// lookup and cause chain messages to be sequenced under the wrong ID,
|
||||||
// preventing block propagation to other nodes.
|
// 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
|
// 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.
|
// chains can't gossip blocks because the validator set is empty.
|
||||||
for _, networkID := range v.trackedNetworks {
|
for _, networkID := range v.trackedNetworks {
|
||||||
networkTxID := ids.Empty
|
networkTxID := ids.Empty
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ type Network struct {
|
|||||||
Nets []*Net
|
Nets []*Net
|
||||||
}
|
}
|
||||||
|
|
||||||
// Net represents a net (L2 chain) in the network
|
// Net represents a net (non-primary chain) in the network
|
||||||
type Net struct {
|
type Net struct {
|
||||||
ChainID ids.ID
|
ChainID ids.ID
|
||||||
Chains []*Chain
|
Chains []*Chain
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import (
|
|||||||
const (
|
const (
|
||||||
// MaxTxSize is the maximum number of bytes a transaction can use to be
|
// 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
|
// 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
|
MaxTxSize = 2 * constants.MiB
|
||||||
|
|
||||||
// droppedTxIDsCacheSize is the maximum number of dropped txIDs to cache
|
// droppedTxIDsCacheSize is the maximum number of dropped txIDs to cache
|
||||||
|
|||||||
Reference in New Issue
Block a user