feat(node): Phase 1.6+ Slice 3 — ChainSpec builder canonical mock-WASM fallback v0.0.13
Real ChainSpec JSON builder canonical via mock-WASM fallback pattern. Avanza Origin Chain sin esperar Slice 2c WASM_BINARY resolution canonical (Larihana pending). Own minimal JSON builder canonical via serde_json puro vs sc-chain-spec dep canonical (43/44.0.0 trae sc-network mismatch + cid 0.9.0 yanked core2). Deliverables canonical: - crates/origin-chain-node/src/chain_spec.rs NEW (240 LOC) — 3 builder fns (development/local_testnet/mainnet) + load_spec alias resolver + serialize_chain_spec - crates/origin-chain-node/src/main.rs — new BuildSpec subcommand + build_spec fn - crates/origin-chain-node/Cargo.toml — Slice 3 dep block canonical doc - Cargo.toml workspace — sc-chain-spec investigation findings registered Output JSON canonical compatible con Substrate-canonical sc_chain_spec::GenericChainSpec schema (12-field structure). Mock WASM hex = "0x" placeholder canonical mientras Slice 2c land canonical real WASM_BINARY via substrate-wasm-builder. Verification canonical end-to-end: - cargo check workspace verde 0.60s - 10/10 chain_spec tests canonical pass + 75+ workspace tests canonical no regression - cargo build --release origin-chain-node 2.28s clean - build-spec --chain dev|local|mainnet|--raw all functional canonical - BM V2 mainnet allocation verified: 400M+250M+150M+150M+50M = 1B OGC canonical - Existing subcommands (version, list-presets, print-preset, info) NO REGRESSION Phase 1.6+ progress: Slices 1+2+2b+3 ✅, Slice 2c WASM pending Larihana, Slice 4 full sc-service requires Slice 2c canonical resolution. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
3c0435ac5d
commit
a2925f67b9
6 files changed
+452
-16
No files matched your search
@@ -6,6 +6,93 @@ by [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). Versions follow
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [0.0.13] — 2026-05-22 — Phase 1.6+ Slice 3 "ChainSpec builder canonical (mock-WASM fallback)"
|
||||
|
||||
Charon sesión 2. **Phase 1.6+ Slice 3 canonical shipped** — real ChainSpec JSON
|
||||
builder canonical via mock-WASM fallback pattern canonical. Avanza Origin Chain
|
||||
sin esperar Slice 2c WASM_BINARY canonical resolution canonical (Larihana pending).
|
||||
|
||||
### Deliverables canonical
|
||||
|
||||
- **`crates/origin-chain-node/src/chain_spec.rs`** (NEW, 240 LOC) — own minimal
|
||||
ChainSpec JSON builder canonical via serde_json puro:
|
||||
- `development_chain_spec()` — Alice solo validator + 100M OGC dev
|
||||
- `local_testnet_chain_spec()` — Alice+Bob validators + 5 dev × 100M OGC
|
||||
- `mainnet_chain_spec()` — 5 Pi 5 placeholders + BM V2 1B OGC (40/25/15/15/5)
|
||||
- `load_spec(name)` — resolve aliases canonical (`dev`/`local`/`mainnet`)
|
||||
- `serialize_chain_spec(spec, raw)` — pretty o raw JSON canonical output
|
||||
- **10 unit tests canonical** all passing (schema + serialization + alias resolution)
|
||||
- **`crates/origin-chain-node/src/main.rs`** — new `build-spec --chain <name>`
|
||||
subcommand canonical + `--raw` flag canonical para minified JSON output
|
||||
- **`crates/origin-chain-node/Cargo.toml`** — Slice 3 dep block canonical doc
|
||||
|
||||
### Sub-comandos canonical disponibles
|
||||
|
||||
```bash
|
||||
origin-chain-node build-spec --chain development # dev preset JSON
|
||||
origin-chain-node build-spec --chain local_testnet # local 2-validator JSON
|
||||
origin-chain-node build-spec --chain mainnet_genesis # mainnet BM V2 1B OGC JSON
|
||||
origin-chain-node build-spec --chain dev --raw # minified canonical
|
||||
```
|
||||
|
||||
### Pragmatic decision canonical: own JSON builder vs sc-chain-spec dep
|
||||
|
||||
Investigation canonical 2026-05-22:
|
||||
- `sc-chain-spec 43.0.0/44.0.0` → `sc-network 0.50/0.51` mismatch con workspace
|
||||
`sc-network 0.49.1` canonical (polkadot-stable2512-3 pin)
|
||||
- `cid 0.9.0` → `core2 0.4.0` **YANKED** transitive dep canonical
|
||||
- `parity-scale-codec 3.7.5+` trigger serde version conflict canonical
|
||||
(workspace `serde =1.0.217` Slice 2b defensive pin vs `^1.0.219` upstream)
|
||||
|
||||
**Decision canonical**: own minimal ChainSpec JSON builder canonical via serde_json
|
||||
puro. Output JSON canonical compatible con Substrate `sc_chain_spec::GenericChainSpec`
|
||||
schema canonical (12-field structure: name + id + chainType + bootNodes + telemetry +
|
||||
protocolId + properties + forkBlocks + badBlocks + lightSyncState + codeSubstitutes +
|
||||
genesis). Real `sc_chain_spec::GenericChainSpec` canonical land Slice 4 cuando
|
||||
workspace sc-* upgrade canonical post yanked deps resolution.
|
||||
|
||||
### Mock-WASM fallback canonical pattern
|
||||
|
||||
`MOCK_WASM_HEX = "0x"` placeholder canonical mientras Slice 2c canonical land
|
||||
canonical real `WASM_BINARY` (Larihana Substrate-adjacent expertise pending —
|
||||
diary `7dbeb6b6...` requires_ack filed 2026-05-21). ChainSpec JSON construction +
|
||||
serialization canonical funcionan canonical sin WASM funcional. Lo que NO funciona
|
||||
canonical: `origin-chain-node run` real node — Slice 4 territory canonical.
|
||||
|
||||
### Verification canonical end-to-end
|
||||
|
||||
- ✅ `cargo check --workspace --all-targets` verde canonical (~0.60s)
|
||||
- ✅ `cargo test --workspace --lib --bins` — **10/10 chain_spec tests canonical pass**
|
||||
(75+ workspace tests canonical total pass canonical, no regression)
|
||||
- ✅ `cargo build --release -p origin-chain-node` — 2.28s clean canonical
|
||||
- ✅ `origin-chain-node build-spec --chain dev` — JSON pretty Alice 100M OGC ✓
|
||||
- ✅ `origin-chain-node build-spec --chain local` — JSON pretty Alice+Bob ✓
|
||||
- ✅ `origin-chain-node build-spec --chain mainnet --raw` — JSON minified BM V2:
|
||||
- Ecosystem: 400M OGC (5DdXA1euu...) ✓
|
||||
- Foundation: 250M OGC (5DetTb4VP...) ✓
|
||||
- Sale: 150M OGC (5DwsEF37Z...) ✓
|
||||
- Team: 150M OGC (5DyCTCa4s...) ✓
|
||||
- Liquidity: 50M OGC (5DnjGyV4z...) ✓
|
||||
- **Total 1B OGC canonical** ✓
|
||||
- ✅ Existing subcommands (version, list-presets, print-preset, info) **NO REGRESSION**
|
||||
|
||||
### Cross-pillar consumers canonical desbloqueados
|
||||
|
||||
- **Larihana** — hypercore replication setup canonical post-chain-spec import
|
||||
- **Lyra** — autobase consensus canonical genesis state initialization
|
||||
- **Mathi** — HardwareTier matrix testing canonical via dev chain spec
|
||||
- **Phanes** — asset attestation chain spec canonical pre-Phase 2.1 impl
|
||||
- **Marihan** — origin-mdk skill execution sandbox canonical context
|
||||
|
||||
### Phase 1.6+ progress canonical post Slice 3
|
||||
|
||||
- ✅ Slice 1 Node CLI skeleton + preset listing (v0.0.10)
|
||||
- ✅ Slice 2 origin-chain-types fully no_std canonical (v0.0.11)
|
||||
- ✅ Slice 2b WASM_BINARY investigation registered + Larihana diary (v0.0.12)
|
||||
- ⏳ Slice 2c WASM_BINARY canonical post Larihana expertise
|
||||
- ✅ **Slice 3 ChainSpec builder canonical mock-WASM fallback (v0.0.13 — ESTA)**
|
||||
- ⏳ Slice 4 Full sc-service (consensus + RPC + networking + telemetry) — requires Slice 2c
|
||||
|
||||
## [0.0.12] — 2026-05-21 — Phase 1.6+ Slice 2b "WASM_BINARY investigation report"
|
||||
|
||||
Charon sesión 1 ext. **Slice 2b investigation canonical registered + handoff
|
||||
|
||||
Reference in new issue
Block a user