feat(runtime-apis): Phase 1.6 — Runtime APIs canonical foundation v0.0.8

Runtime canonical ahora expone 11 APIs foundational via impl_runtime_apis!
macro necesarias para origin-chain-node binary interactuar via sc-service.

## Decisión canonical empírica: pallet_identity DEFERRED a Phase 2.7

pallet-identity 41.0.0 (stable2512) usa ReservableCurrency trait deprecated en
stable2512 (replaced por fungible::Mutate). Compat work es scope Phase 2.7
cuando custom pallet_agent_identity introduce AGI DIDs (Inmutable #41).

Wallet creation FREE perpetua per Inmutable #37 YA materializado via
pallet_balances — account existe con 1 MILLI_OGC EXISTENTIAL_DEPOSIT.
Identity metadata (name + email + GitHub + avatar) viene Phase 2.7.

## 11 APIs canonical implementadas
- sp_api::Core (version + execute_block + initialize_block)
- sp_api::Metadata (runtime metadata canonical)
- sp_block_builder::BlockBuilder (apply_extrinsic + finalize_block + inherents)
- sp_transaction_pool::TaggedTransactionQueue (validate_transaction)
- sp_offchain::OffchainWorkerApi (offchain_worker)
- sp_session::SessionKeys (generate + decode_into_raw_public_keys)
- sp_consensus_aura::AuraApi (slot_duration + authorities)
- sp_consensus_grandpa::GrandpaApi (grandpa_authorities + current_set_id +
  equivocation stubs Phase 1 PoA returning None)
- frame_system_rpc_runtime_api::AccountNonceApi (account_nonce)
- pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi
  (query_info + query_fee_details + query_weight_to_fee + query_length_to_fee)
- sp_genesis_builder::GenesisBuilder (build_state + get_preset + preset_names)

## Foundation types nuevos canonical
- pub const VERSION: RuntimeVersion canonical (consumed por sp_api::Core::version)
  - spec_name "origin-chain" + impl_name "origin-chain-charon"
  - apis RUNTIME_API_VERSIONS auto-generado por macro
  - state_version 1 (stable2509+ canonical)
- pub type Executive = frame_executive::Executive<...> wrapper canonical

## Compile fix iteración
EquivocationProof type signature: cambió de <Hash, Header> a <Hash, BlockNumber>
canonical per trait signature stable2512. Doc clarifies Phase 1 PoA equivocation
returns None — Phase 2 NPoS introduce real per CHN-3 slashing.

## Build + tests
- cargo check 0.75s warm cache (impl_runtime_apis incremental)
- cargo build --release 9.23s warm cache clean
- ~57 tests passing

## Filosofía canonical
Doc impl_runtime_apis cita David canon 2026-05-14 "la libertad infinita acota
solo donde empieza la del otro" — APIs son la frontera canonical entre runtime
sovereignty + node sovereignty. Forkless upgrades materializados.

## Phase 1 progress
1.1 ✅ + 1.2 ✅ + 1.3 ✅ + 1.4 ✅ + 1.5 ✅ + 1.6 ✅ (esta). Next: 1.7
genesis chain_spec.rs BM V2 allocation (40/25/15/15/5) + origin-chain-node
real Substrate service multi-session work.

Origin Chain runtime canonical actual: 7 pallets + 11 Runtime APIs + Executive
+ RuntimeVersion + opaque SessionKeys = foundation completa para node binary.

Refs: CHARON_ROADMAP_V1 Phase 1.6, Decisión empírica pallet_identity defer,
SBS-4 ratified, arkhe-origin-chain commit pending tag v0.0.8

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
davidherranandClaude Opus 4.6 committed 2026-05-20 19:54:46 -05:00
1 parent 926650308c
commit 4286b8d9e8
6 files changed
+450 -1

No files matched your search

Generated
+51
View File
@@ -1311,6 +1311,17 @@ dependencies = [
"sp-weights",
]
[[package]]
name = "frame-system-rpc-runtime-api"
version = "36.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "244a5015742d349a814bc7f2aa999a9ec47924374a22672cfc3043a1eb87295f"
dependencies = [
"docify",
"parity-scale-codec",
"sp-api",
]
[[package]]
name = "frame-try-runtime"
version = "0.46.0"
@@ -2083,6 +2094,7 @@ dependencies = [
"frame-metadata-hash-extension",
"frame-support",
"frame-system",
"frame-system-rpc-runtime-api",
"log",
"origin-chain-types",
"pallet-aura",
@@ -2091,6 +2103,7 @@ dependencies = [
"pallet-session",
"pallet-timestamp",
"pallet-transaction-payment",
"pallet-transaction-payment-rpc-runtime-api",
"parity-scale-codec",
"scale-info",
"serde",
@@ -2099,9 +2112,13 @@ dependencies = [
"sp-consensus-aura",
"sp-consensus-grandpa",
"sp-core",
"sp-genesis-builder",
"sp-inherents",
"sp-offchain",
"sp-runtime",
"sp-session",
"sp-std",
"sp-transaction-pool",
"sp-version",
]
@@ -2252,6 +2269,19 @@ dependencies = [
"sp-runtime",
]
[[package]]
name = "pallet-transaction-payment-rpc-runtime-api"
version = "40.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e3bd3329d44b44623b7615cc069b292f2a1fe5c0f4a6625c36cc906f2a43fcc1"
dependencies = [
"pallet-transaction-payment",
"parity-scale-codec",
"sp-api",
"sp-runtime",
"sp-weights",
]
[[package]]
name = "parity-bip39"
version = "2.0.1"
@@ -3304,6 +3334,17 @@ dependencies = [
"scale-info",
]
[[package]]
name = "sp-offchain"
version = "36.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fe5ac60e48200d7b7f61681320deaf06bdced47cfd5f1cb4589b533b58fa4da4"
dependencies = [
"sp-api",
"sp-core",
"sp-runtime",
]
[[package]]
name = "sp-panic-handler"
version = "13.0.2"
@@ -3472,6 +3513,16 @@ dependencies = [
"tracing-subscriber",
]
[[package]]
name = "sp-transaction-pool"
version = "36.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "05fe2b97ebbbdbaab7200914f5fa3e3493972fceb39d3fb9324bc5b63f60a994"
dependencies = [
"sp-api",
"sp-runtime",
]
[[package]]
name = "sp-trie"
version = "39.1.1"