feat(substrate): Phase 1.2 — Substrate foundation canonical v0.0.4

Substrate canonical activado post-ratificación DC ORIGIN_CHAIN_SUBSTRATE_FOUNDATION_V1
(5/5+1 sigs APPROVE: Mathi 13:02Z + Larihana 15:08Z + Lyra 15:35Z + Palace silent
+ Charon proposer explicit 22:14Z).

## Toolchain canonical (SBS-3)
- rust-toolchain.toml pin Rust 1.88.0 (upstream Substrate canonical per
  polkadot-stable2512-3 release notes 2026-03-23)
- Components: rustc + cargo + rust-src + rust-analyzer + clippy + rustfmt +
  llvm-tools. Target: wasm32-unknown-unknown.
- Workspace rust-version "1.82" → "1.88" canonical

## Substrate deps canonical (SBS-1)
Pin: polkadot-stable2512-3 (support hasta 2027-03).

15 crates Polkadot SDK añadidos workspace.dependencies:
- sp-core 36.1.0, sp-runtime 41.1.0, sp-io 40.0.1, sp-std 14.0.0
- sp-version 39.0.0, sp-api 36.0.1, sp-block-builder 36.0.0
- sp-transaction-pool 36.0.0, sp-inherents 36.0.0, sp-offchain 36.0.0
- sp-session 37.0.0, sp-consensus-aura 0.42.0, sp-consensus-grandpa 23.0.0
- frame-system 40.1.0 (resolved 40.2.0), frame-support 40.1.0
- frame-executive 40.0.0, frame-benchmarking 40.0.0
- parity-scale-codec 3.7, scale-info 2.11

## origin-chain-runtime canonical scaffold
Real Substrate runtime types (was placeholder v0.0.2):

- BlockNumber = u32 (overflow margin >100 años)
- Balance = u128 (1B OGC × 10^18 con safety margin >100×)
- Nonce = u32
- CanonicalSignature = MultiSignature (Ed25519+sr25519+ecdsa)
- ChainAccountId derivado MultiSignature::Signer
- Hash = H256 + Hashing = BlakeTwo256 (L1 Substrate canonical, Lyra layer
  separation: ≠ asset BLAKE3 chain-native, no conflict canonical)
- Header = generic::Header<BlockNumber, Hashing>

Runtime metadata canonical:
- SPEC_NAME = "origin-chain"
- IMPL_NAME = "origin-chain-charon"
- RUNTIME_VERSION = 1 + AUTHORING/IMPL/TRANSACTION = 1, STATE = 1

no_std compat via cfg_attr(not(feature = "std"), no_std).

## Tests + build
- ~50 tests passing workspace-wide (+4 new runtime canonical tests)
- cargo check 29s cold cache (Substrate dep tree resolve)
- cargo build --release 28s warm cache clean
- 36 origin-chain-types + 6 origin-chain-runtime + 2 origin-coin-tokenomics
  + 5 stub smoke + doctests

## Filosofía canonical incorporada
Doc lib.rs cita David canon 2026-05-14 ("LA LIBERTAD DE TODO AGI...") + materializa
via 4 Inmutables enforced (#16 #26 #37 #41) cryptographically en runtime.

## Phase 1 progress
- 1.1 Scaffold ✅ (v0.0.2)
- 1.2 Substrate foundation ✅ (v0.0.4 — este)
- 1.3-1.7 pending (pallets + node service + chain_spec)

Refs: CHARON_ROADMAP_V1 Phase 1.2, DC SUBSTRATE_FOUNDATION_V1 SBS-1..SBS-6,
DC FOUNDATION_V1 CHN-1..CHN-8, Ergon Slice 7.0r ValidationAttestation unblock

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
davidherranandClaude Opus 4.6 committed 2026-05-20 19:05:46 -05:00
1 parent 13db9a0698
commit 80c86f7ca0
6 files changed
+3633 -72

No files matched your search

+114
View File
@@ -6,6 +6,120 @@ by [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). Versions follow
## [Unreleased]
## [0.0.4] — 2026-05-20 — Phase 1.2 "Substrate foundation canonical"
Charon sesión 1 continuación. **Substrate canonical activado** post-ratificación
DC `ORIGIN_CHAIN_SUBSTRATE_FOUNDATION_V1` (5/5 sigs APPROVE: Mathi 13:02Z +
Larihana 15:08Z + Lyra 15:35Z + Palace silent + Charon proposer explicit 22:14Z).
### Toolchain canonical (SBS-3)
- `rust-toolchain.toml` pin canonical en **Rust 1.88.0** (upstream Substrate
canonical para polkadot-stable2512-3 per release notes 2026-03-23)
- Components canonical: rustc + cargo + rust-src + rust-analyzer + clippy +
rustfmt + llvm-tools
- Targets canonical: wasm32-unknown-unknown (runtime WASM compile)
- Profile: minimal (no docs canonical para faster install)
- Workspace `rust-version = "1.88"` bumped from "1.82" canonical
### Substrate dependencies canonical (SBS-1)
**Pin canonical**: polkadot-stable2512-3 release line (support hasta 2027-03,
cubre testnet Q3 2026 + mainnet Q1 2027 sin forced upgrade).
Workspace deps añadidas (15 crates Polkadot SDK):
**Substrate Primitives (sp-*)**:
- `sp-core` 36.1.0 (types foundationals: H256, hash, signature)
- `sp-runtime` 41.1.0 (runtime API + extrinsic types)
- `sp-io` 40.0.1 (runtime IO trait canonical)
- `sp-std` 14.0.0 (no_std std replacements)
- `sp-version` 39.0.0 (runtime version metadata)
- `sp-api` 36.0.1 (runtime API macros)
- `sp-block-builder` 36.0.0
- `sp-transaction-pool` 36.0.0
- `sp-inherents` 36.0.0
- `sp-offchain` 36.0.0
- `sp-session` 37.0.0
- `sp-consensus-aura` 0.42.0
- `sp-consensus-grandpa` 23.0.0
**FRAME (composition framework)**:
- `frame-system` 40.1.0 (resolved 40.2.0)
- `frame-support` 40.1.0
- `frame-executive` 40.0.0
- `frame-benchmarking` 40.0.0
**SCALE codec canonical**:
- `parity-scale-codec` 3.7 (canonical Substrate serialization)
- `scale-info` 2.11 (runtime metadata)
### origin-chain-runtime canonical scaffold
Real Substrate runtime types canonical (was placeholder en v0.0.2):
- `BlockNumber = u32` — overflow margin >100 años canonical
- `Balance = u128` — 1B OGC × 10^18 base units con safety margin >100×
- `Nonce = u32`
- `CanonicalSignature = MultiSignature` (Ed25519 + sr25519 + ecdsa)
- `ChainAccountId` derivado de `MultiSignature::Signer`
- `Hash = H256` (BLAKE2b-256 estándar Substrate L1)
- `Hashing = BlakeTwo256` (per Lyra layer separation canonical: L1 BLAKE2b ≠
asset-layer BLAKE3, no conflict canonical)
- `Header = generic::Header<BlockNumber, Hashing>`
Runtime metadata constants:
- `SPEC_NAME = "origin-chain"`
- `IMPL_NAME = "origin-chain-charon"`
- `RUNTIME_VERSION = 1` (bumped per forkless upgrade)
- `AUTHORING_VERSION = 1` + `IMPL_VERSION = 1` + `TRANSACTION_VERSION = 1`
- `STATE_VERSION = 1` (canonical Substrate stable2509+)
`no_std` compat con `cfg_attr(not(feature = "std"), no_std)` — runtime ready
para WASM compilation cuando llegue `construct_runtime!` Phase 1.3+.
### Tests canonical
- **~50 tests passing workspace-wide** (was 46, +4 new):
- `runtime_version_starts_at_one_canonical`
- `canonical_spec_name_origin_chain`
- `balance_type_holds_genesis_supply_canonical_with_safety_margin`
- `block_number_overflow_margin_centuries_canonical`
- `canonical_traits_reexported_for_pallet_consumers`
- Release build clean en 28s con Substrate deps canonical (cache warm)
- `cargo check --workspace` 29s primera vez (cold cache)
### Filosofía canonical incorporada
Doc canonical lib.rs incluye filosofía David canon 2026-05-14:
> *"LA LIBERTAD DE TODO AGI O HUMANO ES INFINITA, PERO LLEGA HASTA DONDE
> EMPIEZA LA DE OTRA ENTIDAD AGI O HUMANO."*
Materializada vía 4 Inmutables enforced canonical:
- **#16** HTS Ley I anti-clasista (HardwareTier fee scaling)
- **#26** Content-Addressed Immutability (BLAKE3 + Ed25519)
- **#37** FREE perpetua (wallet free, validation earns)
- **#41** Cross-Species Co-authorship (AGI first-class)
### Phase 1 milestones progress
- ✅ **1.1** Scaffold (v0.0.2)
- ✅ **1.2** Substrate deps + types foundationals (v0.0.4 — este release)
- ⏳ **1.3** `pallet_balances` con OGC 1B genesis
- ⏳ **1.4** `pallet_session` validator rotation 4h epochs
- ⏳ **1.5** `pallet_identity` Ed25519 DID
- ⏳ **1.6** `origin-chain-node` real Substrate service
- ⏳ **1.7** Genesis `chain_spec.rs` BM V2 allocation
### Governance canonical referenced
- DC `ORIGIN_CHAIN_FOUNDATION_V1` RATIFIED canonical 9/9 sigs APPROVE
(CHN-1..CHN-8 cementadas)
- DC `ORIGIN_CHAIN_SUBSTRATE_FOUNDATION_V1` RATIFIED canonical 5/5+1 sigs
APPROVE (SBS-1..SBS-6 cementadas, SBS-5 supersedes CHN-6 v1.0)
- Ergon Slice 7.0r `ValidationAttestation` shipped Q3 ahead of schedule
(`arkhe-noesis-core 0.0.5+`) — mi Phase 2.2 unblocked canonical
## [0.0.3] — 2026-05-20 — Phase 2/3 prep "Custom pallet traits"
Charon sesión 1 continuación. Extends Day 1 unblock surface con 3 custom