diff --git a/.gitignore b/.gitignore index 48a353c..888c41b 100644 --- a/.gitignore +++ b/.gitignore @@ -89,7 +89,6 @@ convert-state convert-state-proper convert-trie create-replay -debug-subnet dump-keys extract-raw-genesis extract-real-genesis @@ -113,7 +112,6 @@ migrate-complete migrate-full migrate-proper migrate-rawdb -migrate-subnet pebble-inspect pebble-scan probe @@ -187,4 +185,4 @@ cmd/archive/*/check-balance migrated-ethdb.disabled/ *.mem *.sst -bootstrap-l2 +bootstrap-chain diff --git a/LLM.md b/LLM.md index 22c2d5c..1b268e6 100644 --- a/LLM.md +++ b/LLM.md @@ -37,22 +37,22 @@ The six bad addresses on both files were: | `698495959f5570420BAA955dae5eA2864933ACf` | `0698495959f5570420BAA955dae5eA2864933ACf` | | `7283AA2c30523E9190A17b9598ff65599BAAe17` | `07283AA2c30523E9190A17b9598ff65599BAAe17` | -Symptom: subnet-evm refused to bootstrap the chain — `parsing genesis: +Symptom: the EVM refused to bootstrap the chain — `parsing genesis: hex string of odd length`. The original CreateChainTx (`ZAKw...` on testnet, `2nLY...` on devnet) carries the broken genesis bytes immutably, so we had to re-issue under a new chain name and rewrite the gateway. The 39→40-char fix applied in genesis is now the SAME content -subnet-evm expects. +the EVM expects. -Operators bootstrapping a fresh zoo subnet should pin the post-fix +Operators bootstrapping a fresh zoo chain should pin the post-fix checksums in this file (see `### Verify Checksum`). Mainnet zoo (`zoo-mainnet/genesis.json`) was *not* affected — it has only the treasury account plus the `0x0200…0005` precompile. -### Subnet bootstrap: chain-name collision (P-chain) +### Chain bootstrap: chain-name collision (P-chain) `platform.IsChainNameTaken` is case-insensitive and global across all -subnets. A failed CreateChainTx (e.g. the broken zoo above) still +chains. A failed CreateChainTx (e.g. the broken zoo above) still permanently squats its `BlockchainName` on the P-chain ledger — you cannot reuse the name even after fixing the genesis. Work-around used on zoo testnet/devnet: issue under a throwaway name (`ZOOTEST123` / @@ -158,7 +158,7 @@ The contract that every primary network ships all 10 shards is locked by mainnet/testnet/devnet/localnet is now a load-bearing test edit, not a silent operator switch. -### L2 Chains +### Application Chains | Chain | Mainnet ID | Testnet ID | Devnet ID | Treasury | |-------|-----------|-----------|-----------|----------| @@ -680,7 +680,7 @@ codesign --force --sign - ~/work/lux/node/build/plugins/* ### Plugin filename / VM ID -The Lux EVM plugin has one canonical VM ID for both C-Chain and EVM-based L2 chains: +The Lux EVM plugin has one canonical VM ID for both C-Chain and other EVM chains: ``` mgj786NP7uDwBCcq6YwThhaN8FLyybkCa4zBWTQbNgmK6k9A6 diff --git a/builder/builder.go b/builder/builder.go index 680e87e..07bd32e 100644 --- a/builder/builder.go +++ b/builder/builder.go @@ -340,9 +340,9 @@ func GetConfig(networkID uint32) *genesiscfg.Config { // emitted, and utxoAssetID is returned as ids.Empty. The primary network // then has no native UTXO asset: validator stakes denominated against // ids.Empty have no on-chain asset backing, which is the -// permissioned-set semantics used by L1s whose value capture lives on -// an L2 chain (downstream EVM etc.) with its own asset model. Minting a -// real primary-network asset requires X — there is no other genesis +// permissioned-set semantics used by primary networks whose value capture +// lives on a downstream chain (EVM etc.) with its own asset model. Minting +// a real primary-network asset requires X — there is no other genesis // site for it. func FromConfig(config *genesiscfg.Config) ([]byte, ids.ID, error) { // HRP is needed for X-Chain holder addresses, P-Chain protocol diff --git a/builder/builder_test.go b/builder/builder_test.go index 2a50059..0d43026 100644 --- a/builder/builder_test.go +++ b/builder/builder_test.go @@ -185,11 +185,11 @@ func TestChainAliases(t *testing.T) { // - Strip every chain shard from the same Config — same allocations, // same validators, same network ID — and FromConfig must succeed, // return ids.Empty for utxoAssetID, and produce a P-Chain genesis -// with zero CreateChainTx entries. This is the L1-from-P-only -// boot path: a sovereign L1 (lqd-style) ships only pchain.json + -// network.json and gets a primary-network of just P-Chain, with -// funded addresses and weighted validators ready to issue -// CreateChainTx for whatever L2 chains it wants post-genesis. +// with zero CreateChainTx entries. This is the primary-from-P-only +// boot path: a sovereign primary network (lqd-style) ships only +// pchain.json + network.json and gets a primary-network of just +// P-Chain, with funded addresses and weighted validators ready to +// issue CreateChainTx for whatever chains it wants post-genesis. // // "Shard set = chain set" is the one-way contract; this test pins it. func TestFromConfig_ChainSetIsShardDriven(t *testing.T) { diff --git a/cmd/bootstrap-l2/main.go b/cmd/bootstrap-chain/main.go similarity index 99% rename from cmd/bootstrap-l2/main.go rename to cmd/bootstrap-chain/main.go index 9dfb4a4..df47850 100644 --- a/cmd/bootstrap-l2/main.go +++ b/cmd/bootstrap-chain/main.go @@ -1,7 +1,7 @@ // Copyright (C) 2019-2026, Lux Industries Inc. All rights reserved. // See the file LICENSE for licensing terms. -// Command bootstrap-l2 creates one or more chains on a luxd network using the +// Command bootstrap-chain creates one or more chains on a luxd network using the // canonical BIP44 m/44'/9000'/0'/0/ derivation. For each chain it: // // 1. IssueCreateNetworkTx — chain-owner network with threshold=1 @@ -19,8 +19,7 @@ // only probed for liveness, never re-created. // // Vocabulary: this tool speaks "chain" — the polymorphic primitive produced -// by CreateChainTx, irrespective of L1/L2/L3 level. Three IDs, three roles, -// never aliased: +// by CreateChainTx. Three IDs, three roles, never aliased: // // - `networkID` — identifies a validator network. Comes in two scopes: // * primary networkID (uint32: 1=mainnet, 2=testnet, 3=local, 1337=dev) @@ -31,7 +30,7 @@ // // Usage: // -// MNEMONIC="..." bootstrap-l2 \ +// MNEMONIC="..." bootstrap-chain \ // --uri=http://luxd-0.lux-devnet.svc.cluster.local:9650 \ // --hrp=dev \ // --bip44-idx=5 \ diff --git a/cmd/bootstrap-l2/main_test.go b/cmd/bootstrap-chain/main_test.go similarity index 98% rename from cmd/bootstrap-l2/main_test.go rename to cmd/bootstrap-chain/main_test.go index fb07e98..32783f7 100644 --- a/cmd/bootstrap-l2/main_test.go +++ b/cmd/bootstrap-chain/main_test.go @@ -1,4 +1,4 @@ -// Unit tests for bootstrap-l2's defensive alloc key normalization. +// Unit tests for bootstrap-chain's defensive alloc key normalization. // // The whole point of normalizeAllocKey is to keep the load-and-validate // path single-sourced: every consumer that touches an alloc key (the diff --git a/pkg/genesis/types.go b/pkg/genesis/types.go index c47529f..768d32d 100644 --- a/pkg/genesis/types.go +++ b/pkg/genesis/types.go @@ -34,8 +34,8 @@ type Config struct { // Chains defines additional chains to include in genesis beyond the // built-in alphabet chains (C, D, Q, B, T, Z, G, K). Each entry becomes - // a CreateChainTx in the P-Chain genesis. This allows L1/L2 - // chains to be embedded directly for automatic bootstrap. + // a CreateChainTx in the P-Chain genesis. This allows chains to be + // embedded directly for automatic bootstrap. Chains []ChainEntry `json:"chains,omitempty"` // ChainMapping provides dynamic chain ID configuration per network. @@ -251,7 +251,7 @@ type WarpConfig struct { } // ChainEntry defines an additional chain to create at genesis. -// Used for embedding L1/L2 chains directly in the P-Chain genesis. +// Used for embedding chains directly in the P-Chain genesis. type ChainEntry struct { VMID string `json:"vmID"` // VM ID (base58 encoded) Name string `json:"name"` // Human-readable chain name