mirror of
https://github.com/luxfi/genesis.git
synced 2026-07-27 04:11:41 +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
-3
@@ -89,7 +89,6 @@ convert-state
|
|||||||
convert-state-proper
|
convert-state-proper
|
||||||
convert-trie
|
convert-trie
|
||||||
create-replay
|
create-replay
|
||||||
debug-subnet
|
|
||||||
dump-keys
|
dump-keys
|
||||||
extract-raw-genesis
|
extract-raw-genesis
|
||||||
extract-real-genesis
|
extract-real-genesis
|
||||||
@@ -113,7 +112,6 @@ migrate-complete
|
|||||||
migrate-full
|
migrate-full
|
||||||
migrate-proper
|
migrate-proper
|
||||||
migrate-rawdb
|
migrate-rawdb
|
||||||
migrate-subnet
|
|
||||||
pebble-inspect
|
pebble-inspect
|
||||||
pebble-scan
|
pebble-scan
|
||||||
probe
|
probe
|
||||||
@@ -187,4 +185,4 @@ cmd/archive/*/check-balance
|
|||||||
migrated-ethdb.disabled/
|
migrated-ethdb.disabled/
|
||||||
*.mem
|
*.mem
|
||||||
*.sst
|
*.sst
|
||||||
bootstrap-l2
|
bootstrap-chain
|
||||||
|
|||||||
@@ -37,22 +37,22 @@ The six bad addresses on both files were:
|
|||||||
| `698495959f5570420BAA955dae5eA2864933ACf` | `0698495959f5570420BAA955dae5eA2864933ACf` |
|
| `698495959f5570420BAA955dae5eA2864933ACf` | `0698495959f5570420BAA955dae5eA2864933ACf` |
|
||||||
| `7283AA2c30523E9190A17b9598ff65599BAAe17` | `07283AA2c30523E9190A17b9598ff65599BAAe17` |
|
| `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
|
hex string of odd length`. The original CreateChainTx (`ZAKw...` on
|
||||||
testnet, `2nLY...` on devnet) carries the broken genesis bytes
|
testnet, `2nLY...` on devnet) carries the broken genesis bytes
|
||||||
immutably, so we had to re-issue under a new chain name and rewrite the
|
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
|
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
|
checksums in this file (see `### Verify Checksum`). Mainnet zoo
|
||||||
(`zoo-mainnet/genesis.json`) was *not* affected — it has only the
|
(`zoo-mainnet/genesis.json`) was *not* affected — it has only the
|
||||||
treasury account plus the `0x0200…0005` precompile.
|
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
|
`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
|
permanently squats its `BlockchainName` on the P-chain ledger — you
|
||||||
cannot reuse the name even after fixing the genesis. Work-around used
|
cannot reuse the name even after fixing the genesis. Work-around used
|
||||||
on zoo testnet/devnet: issue under a throwaway name (`ZOOTEST123` /
|
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
|
mainnet/testnet/devnet/localnet is now a load-bearing test edit, not a
|
||||||
silent operator switch.
|
silent operator switch.
|
||||||
|
|
||||||
### L2 Chains
|
### Application Chains
|
||||||
|
|
||||||
| Chain | Mainnet ID | Testnet ID | Devnet ID | Treasury |
|
| Chain | Mainnet ID | Testnet ID | Devnet ID | Treasury |
|
||||||
|-------|-----------|-----------|-----------|----------|
|
|-------|-----------|-----------|-----------|----------|
|
||||||
@@ -680,7 +680,7 @@ codesign --force --sign - ~/work/lux/node/build/plugins/*
|
|||||||
|
|
||||||
### Plugin filename / VM ID
|
### 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
|
mgj786NP7uDwBCcq6YwThhaN8FLyybkCa4zBWTQbNgmK6k9A6
|
||||||
|
|||||||
+3
-3
@@ -340,9 +340,9 @@ func GetConfig(networkID uint32) *genesiscfg.Config {
|
|||||||
// emitted, and utxoAssetID is returned as ids.Empty. The primary network
|
// emitted, and utxoAssetID is returned as ids.Empty. The primary network
|
||||||
// then has no native UTXO asset: validator stakes denominated against
|
// then has no native UTXO asset: validator stakes denominated against
|
||||||
// ids.Empty have no on-chain asset backing, which is the
|
// ids.Empty have no on-chain asset backing, which is the
|
||||||
// permissioned-set semantics used by L1s whose value capture lives on
|
// permissioned-set semantics used by primary networks whose value capture
|
||||||
// an L2 chain (downstream EVM etc.) with its own asset model. Minting a
|
// lives on a downstream chain (EVM etc.) with its own asset model. Minting
|
||||||
// real primary-network asset requires X — there is no other genesis
|
// a real primary-network asset requires X — there is no other genesis
|
||||||
// site for it.
|
// site for it.
|
||||||
func FromConfig(config *genesiscfg.Config) ([]byte, ids.ID, error) {
|
func FromConfig(config *genesiscfg.Config) ([]byte, ids.ID, error) {
|
||||||
// HRP is needed for X-Chain holder addresses, P-Chain protocol
|
// HRP is needed for X-Chain holder addresses, P-Chain protocol
|
||||||
|
|||||||
@@ -185,11 +185,11 @@ func TestChainAliases(t *testing.T) {
|
|||||||
// - Strip every chain shard from the same Config — same allocations,
|
// - Strip every chain shard from the same Config — same allocations,
|
||||||
// same validators, same network ID — and FromConfig must succeed,
|
// same validators, same network ID — and FromConfig must succeed,
|
||||||
// return ids.Empty for utxoAssetID, and produce a P-Chain genesis
|
// return ids.Empty for utxoAssetID, and produce a P-Chain genesis
|
||||||
// with zero CreateChainTx entries. This is the L1-from-P-only
|
// with zero CreateChainTx entries. This is the primary-from-P-only
|
||||||
// boot path: a sovereign L1 (lqd-style) ships only pchain.json +
|
// boot path: a sovereign primary network (lqd-style) ships only
|
||||||
// network.json and gets a primary-network of just P-Chain, with
|
// pchain.json + network.json and gets a primary-network of just
|
||||||
// funded addresses and weighted validators ready to issue
|
// P-Chain, with funded addresses and weighted validators ready to
|
||||||
// CreateChainTx for whatever L2 chains it wants post-genesis.
|
// issue CreateChainTx for whatever chains it wants post-genesis.
|
||||||
//
|
//
|
||||||
// "Shard set = chain set" is the one-way contract; this test pins it.
|
// "Shard set = chain set" is the one-way contract; this test pins it.
|
||||||
func TestFromConfig_ChainSetIsShardDriven(t *testing.T) {
|
func TestFromConfig_ChainSetIsShardDriven(t *testing.T) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// Copyright (C) 2019-2026, Lux Industries Inc. All rights reserved.
|
// Copyright (C) 2019-2026, Lux Industries Inc. All rights reserved.
|
||||||
// See the file LICENSE for licensing terms.
|
// 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/<idx> derivation. For each chain it:
|
// canonical BIP44 m/44'/9000'/0'/0/<idx> derivation. For each chain it:
|
||||||
//
|
//
|
||||||
// 1. IssueCreateNetworkTx — chain-owner network with threshold=1
|
// 1. IssueCreateNetworkTx — chain-owner network with threshold=1
|
||||||
@@ -19,8 +19,7 @@
|
|||||||
// only probed for liveness, never re-created.
|
// only probed for liveness, never re-created.
|
||||||
//
|
//
|
||||||
// Vocabulary: this tool speaks "chain" — the polymorphic primitive produced
|
// Vocabulary: this tool speaks "chain" — the polymorphic primitive produced
|
||||||
// by CreateChainTx, irrespective of L1/L2/L3 level. Three IDs, three roles,
|
// by CreateChainTx. Three IDs, three roles, never aliased:
|
||||||
// never aliased:
|
|
||||||
//
|
//
|
||||||
// - `networkID` — identifies a validator network. Comes in two scopes:
|
// - `networkID` — identifies a validator network. Comes in two scopes:
|
||||||
// * primary networkID (uint32: 1=mainnet, 2=testnet, 3=local, 1337=dev)
|
// * primary networkID (uint32: 1=mainnet, 2=testnet, 3=local, 1337=dev)
|
||||||
@@ -31,7 +30,7 @@
|
|||||||
//
|
//
|
||||||
// Usage:
|
// Usage:
|
||||||
//
|
//
|
||||||
// MNEMONIC="..." bootstrap-l2 \
|
// MNEMONIC="..." bootstrap-chain \
|
||||||
// --uri=http://luxd-0.lux-devnet.svc.cluster.local:9650 \
|
// --uri=http://luxd-0.lux-devnet.svc.cluster.local:9650 \
|
||||||
// --hrp=dev \
|
// --hrp=dev \
|
||||||
// --bip44-idx=5 \
|
// --bip44-idx=5 \
|
||||||
@@ -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
|
// The whole point of normalizeAllocKey is to keep the load-and-validate
|
||||||
// path single-sourced: every consumer that touches an alloc key (the
|
// path single-sourced: every consumer that touches an alloc key (the
|
||||||
@@ -34,8 +34,8 @@ type Config struct {
|
|||||||
|
|
||||||
// Chains defines additional chains to include in genesis beyond the
|
// 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
|
// 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
|
// a CreateChainTx in the P-Chain genesis. This allows chains to be
|
||||||
// chains to be embedded directly for automatic bootstrap.
|
// embedded directly for automatic bootstrap.
|
||||||
Chains []ChainEntry `json:"chains,omitempty"`
|
Chains []ChainEntry `json:"chains,omitempty"`
|
||||||
|
|
||||||
// ChainMapping provides dynamic chain ID configuration per network.
|
// ChainMapping provides dynamic chain ID configuration per network.
|
||||||
@@ -251,7 +251,7 @@ type WarpConfig struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ChainEntry defines an additional chain to create at genesis.
|
// 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 {
|
type ChainEntry struct {
|
||||||
VMID string `json:"vmID"` // VM ID (base58 encoded)
|
VMID string `json:"vmID"` // VM ID (base58 encoded)
|
||||||
Name string `json:"name"` // Human-readable chain name
|
Name string `json:"name"` // Human-readable chain name
|
||||||
|
|||||||
Reference in New Issue
Block a user