feat(genesis): Phase 1.7 — Genesis chain_spec BM V2 allocation v0.0.9
Origin Chain runtime canonical ahora tiene 3 genesis presets canonical materializando BM V2 ratificado David 2026-05-18: development + local_testnet + mainnet_genesis. Phase 1 COMPLETE canonical 🎉. ## 3 presets canonical - development: 1 validator Alice + 100M OGC para dev mode - local_testnet: Alice+Bob validators + 5 dev accounts × 100M OGC - mainnet_genesis: 5 Pi 5 validators placeholders + BM V2 1B OGC allocation ## BM V2 allocation canonical materializada - ECOSYSTEM_ALLOCATION = 400M OGC (40%) - FOUNDATION_ALLOCATION = 250M OGC (25%) - PUBLIC_SALE_ALLOCATION = 150M OGC (15%) - FOUNDING_TEAM_ALLOCATION = 150M OGC (15% — 4yr vesting cliff 12mo) - EXCHANGE_LIQUIDITY_ALLOCATION = 50M OGC (5%) - Compile-time assertion canonical: sum MUST equal 1B OGC ## Decisión empírica: drop sp-keyring (version mismatch sp_core stable2512) Hardcoded Substrate well-known dev account bytes (Alice/Bob/Charlie/Dave/Eve sr25519 + Alice/Bob Ed25519 GRANDPA). Mismos bytes que sp_keyring retornaría. Self-contained runtime + version stability + polkadot-js compat preserved. ## Mainnet institutional placeholders canonical ECO!.../FNDT.../SALE.../TEAM.../LIQD... — David ratifica keys reales canonical generadas por hardware key ceremony pre-launch Q1 2027. ## 5 Pi 5 validators placeholders canonical Pattern: 0xCA + 0xFE + index distinguishable canonical en block explorer. David ratificará Dream House Studios + universidades aliadas Identity Level 3 canonical pre-launch. ## GenesisBuilder API wired sp_genesis_builder::GenesisBuilder::get_preset() ahora delegates a genesis_config_presets::get_preset(). preset_names() returns 3 PresetIds. ## Tests +6 nuevos (~63 total workspace) - bm_v2_allocations_sum_canonical_to_one_billion_ogc - bm_v2_allocation_ratios_canonical (40/25/15/15/5) - preset_names_canonical_three_presets - get_preset_unknown_id_returns_none_canonical - development_preset_returns_json_canonical (serde roundtrip) - alice_account_bytes_canonical_substrate (compat sanity) ## Build - cargo check ~30s cold (genesis presets compile) - cargo build --release 10.30s warm - ~63 tests passing total workspace ## Phase 1 COMPLETE canonical 🎉 1.1 ✅ + 1.2 ✅ + 1.3 ✅ + 1.4 ✅ + 1.5 ✅ + 1.6 ✅ + 1.7 ✅ Origin Chain runtime canonical full Substrate composition: - 7 pallets (System + Timestamp + Balances + TransactionPayment + Aura + Grandpa + Session) - 11 Runtime APIs - 3 Genesis presets (dev + local + mainnet BM V2) - Opaque SessionKeys + Executive + RuntimeVersion Next: Phase 1.6+ split-off origin-chain-node real Substrate service (sc-service + JSON-RPC + CLI), Phase 2+ custom pallets canonical. Refs: CHARON_ROADMAP_V1 Phase 1.7, CHN-2 BM V2 allocation ratified David 2026-05-18, SBS-6 ratified DC SUBSTRATE_FOUNDATION_V1 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
4286b8d9e8
commit
a695f45a2d
6 files changed
+617
-6
No files matched your search
+158
@@ -6,6 +6,164 @@ by [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). Versions follow
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [0.0.9] — 2026-05-21 — Phase 1.7 "Genesis chain_spec canonical (BM V2 allocation)"
|
||||
|
||||
Charon sesión 1 continuación. **Genesis presets canonical implementados** — 3
|
||||
canonical chain_spec presets (`development` + `local_testnet` + `mainnet_genesis`)
|
||||
wired al `sp_genesis_builder::GenesisBuilder` API. **BM V2 allocation 1B OGC
|
||||
canonical materializada en código** con compile-time assertion canonical.
|
||||
|
||||
### 3 presets canonical disponibles
|
||||
|
||||
| Preset | Validators | Allocation | Use case |
|
||||
|--------|-----------|------------|----------|
|
||||
| `development` | Alice (1) | 100M OGC a Alice | `origin-chain-node --dev --tmp` |
|
||||
| `local_testnet` | Alice + Bob (2) | 100M OGC per Alice/Bob/Charlie/Dave/Eve | Multi-node local testing |
|
||||
| `mainnet_genesis` | 5 Pi 5 placeholders | **BM V2 40/25/15/15/5 = 1B OGC** | Production mainnet Q1 2027 |
|
||||
|
||||
### BM V2 allocation canonical en código
|
||||
|
||||
```rust
|
||||
pub const GENESIS_SUPPLY: Balance = 1_000_000_000 × Ogc::ONE; // 1B OGC
|
||||
|
||||
pub const ECOSYSTEM_ALLOCATION: Balance = 400_000_000 × Ogc::ONE; // 40%
|
||||
pub const FOUNDATION_ALLOCATION: Balance = 250_000_000 × Ogc::ONE; // 25%
|
||||
pub const PUBLIC_SALE_ALLOCATION: Balance = 150_000_000 × Ogc::ONE; // 15%
|
||||
pub const FOUNDING_TEAM_ALLOCATION: Balance = 150_000_000 × Ogc::ONE; // 15%
|
||||
pub const EXCHANGE_LIQUIDITY_ALLOCATION: Balance = 50_000_000 × Ogc::ONE; // 5%
|
||||
|
||||
/// Compile-time assertion canonical: si cambia algún constante, code no compila.
|
||||
const _: () = { assert!(SUM == GENESIS_SUPPLY, "BM V2 must sum 1B OGC canonical"); };
|
||||
```
|
||||
|
||||
### Decisión empírica canonical documentada — drop sp-keyring
|
||||
|
||||
`sp-keyring 42.0.0` introduce sp_core diferente del stable2512 canonical
|
||||
(`sp_core 36.1.0`) — **two versions of sp_core in dep tree** → `CryptoBytes`
|
||||
type mismatch canonical. Fix canonical: **hardcoded Substrate well-known dev
|
||||
account bytes** (Alice/Bob/Charlie/Dave/Eve sr25519 + Alice/Bob Ed25519
|
||||
GRANDPA keys). Bytes son los mismos exactos que `sp_keyring::Sr25519Keyring`
|
||||
retornaría — verified canonical contra Substrate source.
|
||||
|
||||
**Beneficios canonical**:
|
||||
1. Elimina version brittle canonical (no dep on sp-keyring release cadence)
|
||||
2. Mantiene exact compatibility canonical con polkadot-js apps + subkey
|
||||
3. Self-contained runtime canonical — bytes son data, no comportamiento
|
||||
|
||||
### Mainnet institutional accounts canonical (placeholders pre-launch)
|
||||
|
||||
5 institutional accounts canonical con prefixes distinctivos para forensic
|
||||
clarity en block explorer:
|
||||
|
||||
- `ECO!...` Ecosystem Pool (400M OGC)
|
||||
- `FNDT...` Foundation Treasury (250M OGC)
|
||||
- `SALE...` Public Sale (150M OGC)
|
||||
- `TEAM...` Founding Team (150M OGC, 4yr vesting cliff 12mo)
|
||||
- `LIQD...` Exchange Liquidity (50M OGC)
|
||||
|
||||
**PRE-LAUNCH WARNING canonical Q1 2027**: David debe ratificar keys reales
|
||||
canonical generadas por hardware key generation ceremony canonical antes del
|
||||
mainnet launch. Los placeholders son **estructurales canonical** — preset
|
||||
funciona arquitectónicamente pero los keys reales son TBD David ratification.
|
||||
|
||||
### 5 Pi 5 validators iniciales canonical
|
||||
|
||||
Placeholder pattern: `0xCA, 0xFE, index, 0, 0, ..., 0` — distinguishable canonical
|
||||
en block explorer. David ratificará keys reales canonical de los validators Dream
|
||||
House Studios + universidades aliadas Identity Level 3 canonical pre-launch.
|
||||
|
||||
### GenesisBuilder API wired canonical
|
||||
|
||||
```rust
|
||||
impl sp_genesis_builder::GenesisBuilder<Block> for Runtime {
|
||||
fn build_state(config: Vec<u8>) -> sp_genesis_builder::Result { /* unchanged */ }
|
||||
|
||||
fn get_preset(id: &Option<PresetId>) -> Option<Vec<u8>> {
|
||||
#[cfg(feature = "std")]
|
||||
frame_support::genesis_builder_helper::get_preset::<RuntimeGenesisConfig>(
|
||||
id,
|
||||
genesis_config_presets::get_preset, // ← wired canonical
|
||||
)
|
||||
// no_std: returns None canonical
|
||||
}
|
||||
|
||||
fn preset_names() -> Vec<PresetId> {
|
||||
#[cfg(feature = "std")]
|
||||
genesis_config_presets::preset_names() // ← wired canonical (3 presets)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Filosofía canonical incorporada en código
|
||||
|
||||
Doc `genesis_config_presets.rs` cita David canon 2026-05-18 BM V2 ratificado.
|
||||
Materializa empíricamente: la asignación canonical 25% Foundation Treasury
|
||||
financia mi Inmutable #16 anti-clasismo (banda regional Low-PIB subsidized) +
|
||||
40% Ecosystem Pool sostiene canonical validator rewards de los Pi 5 EmbeddedArm
|
||||
desplegados Colombia Rural Sprint 19-20 (Caso Cero Faraday — Sussi alignment).
|
||||
|
||||
### Tests canonical (+6 nuevos genesis canonical, ~63 total workspace)
|
||||
|
||||
- `bm_v2_allocations_sum_canonical_to_one_billion_ogc` — 1B OGC invariant ✅
|
||||
- `bm_v2_allocation_ratios_canonical` — 40/25/15/15/5 exact percentages ✅
|
||||
- `preset_names_canonical_three_presets` — 3 presets registered ✅
|
||||
- `get_preset_unknown_id_returns_none_canonical` — graceful None ✅
|
||||
- `development_preset_returns_json_canonical` — serde roundtrip ✅
|
||||
- `alice_account_bytes_canonical_substrate` — Substrate compat sanity ✅
|
||||
|
||||
### Build canonical
|
||||
|
||||
- `cargo check --workspace`: ~30s (genesis_config_presets cold cache compile)
|
||||
- `cargo build --release`: **10.30s** (warm cache canonical)
|
||||
- Tests passing: **~63** (+6 nuevos genesis canonical)
|
||||
|
||||
### Phase 1 COMPLETE canonical 🎉
|
||||
|
||||
- ✅ **1.1** Scaffold (v0.0.2)
|
||||
- ✅ **1.2** Substrate foundation (v0.0.4)
|
||||
- ✅ **1.3** Pallets foundation: System+Balances+Timestamp+TransactionPayment (v0.0.5)
|
||||
- ✅ **1.4** Consensus PoA Aura+GRANDPA (v0.0.6)
|
||||
- ✅ **1.5** Session rotation 4h epochs (v0.0.7)
|
||||
- ✅ **1.6** Runtime APIs foundation (11 APIs) (v0.0.8)
|
||||
- ✅ **1.7** **Genesis chain_spec BM V2 allocation** (v0.0.9) ← **ESTA**
|
||||
|
||||
### Tour canonical de Origin Chain runtime composition (Phase 1 COMPLETE)
|
||||
|
||||
```
|
||||
┌────────────────────────────────────────────────────────────────────────┐
|
||||
│ Origin Chain Runtime v0.0.9 — Phase 1 COMPLETE canonical │
|
||||
├────────────────────────────────────────────────────────────────────────┤
|
||||
│ Pallets (7 via frame_support::runtime macro): │
|
||||
│ 0 System 1 Timestamp 2 Balances 3 TransactionPayment │
|
||||
│ 4 Aura 5 Grandpa 6 Session │
|
||||
│ │
|
||||
│ Runtime APIs (11 via impl_runtime_apis! macro): │
|
||||
│ Core + Metadata + BlockBuilder + TaggedTransactionQueue + │
|
||||
│ OffchainWorkerApi + SessionKeys + AuraApi + GrandpaApi + │
|
||||
│ AccountNonceApi + TransactionPaymentApi + GenesisBuilder │
|
||||
│ │
|
||||
│ Genesis presets (3 canonical): │ ← NEW
|
||||
│ development (1 Alice validator + 100M OGC dev) │
|
||||
│ local_testnet (Alice+Bob validators + 5 dev accounts × 100M OGC) │
|
||||
│ mainnet_genesis (5 Pi 5 placeholders + BM V2 1B OGC 40/25/15/15/5) │
|
||||
│ │
|
||||
│ Opaque SessionKeys: aura (sr25519) + grandpa (Ed25519) │
|
||||
│ Executive: frame_executive::Executive wrapper canonical │
|
||||
│ RuntimeVersion: spec=origin-chain impl=origin-chain-charon │
|
||||
└────────────────────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
### Next phases canonical
|
||||
|
||||
- ⏳ **Phase 1.6+ split-off**: `origin-chain-node` real Substrate service
|
||||
(sc-service builder + JSON-RPC + CLI) — multi-session work
|
||||
- ⏳ **Phase 2.1**: `pallet-origin-provenance` impl (CHN-7 BLAKE3 attestation)
|
||||
- ⏳ **Phase 2.4**: `pallet-origin-fees` (CHN-8 multi-tier matrix)
|
||||
- ⏳ **Phase 2.7**: `pallet-agent-identity` custom (Inmutable #41 AGI DIDs)
|
||||
- ⏳ **Phase 3+**: pallet-revive + ink! v6 + Solidity smart contracts
|
||||
- ⏳ **Phase 4**: Testnet v0.1 (Q3 2026 target)
|
||||
- ⏳ **Phase 8**: Mainnet v1.0 (Q1 2027 target)
|
||||
|
||||
## [0.0.8] — 2026-05-21 — Phase 1.6 "Runtime APIs canonical foundation"
|
||||
|
||||
Charon sesión 1 continuación. **Runtime APIs canonical implementadas via
|
||||
|
||||
Reference in new issue
Block a user