Files
arkhe-origin-chain/crates/origin-chain-runtime/Cargo.toml
T
davidherranandClaude Opus 4.6 4286b8d9e8 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>
2026-05-20 19:54:46 -05:00

111 lines
3.3 KiB
TOML

[package]
name = "origin-chain-runtime"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
authors.workspace = true
repository.workspace = true
homepage.workspace = true
description = "Origin Chain Substrate runtime canonical. Pilar 4: System+Balances+Timestamp+TransactionPayment+Aura+Grandpa pallets integrated (Phase 1.4 v0.0.6 consensus PoA per CHN-1). Roadmap: session+identity+provenance+ink!+bridges+governance progressivos."
[dependencies]
# Origin Chain canonical traits + types
origin-chain-types.workspace = true
# Substrate Primitives canonical (SBS-1 polkadot-stable2512-3)
sp-core.workspace = true
sp-runtime.workspace = true
sp-std.workspace = true
sp-version.workspace = true
sp-api.workspace = true
sp-block-builder.workspace = true
sp-inherents.workspace = true
# Consensus primitives canonical (Phase 1.4 per CHN-1 Aura+GRANDPA)
sp-consensus-aura.workspace = true
sp-consensus-grandpa.workspace = true
# FRAME canonical
frame-system.workspace = true
frame-support.workspace = true
frame-executive.workspace = true
frame-metadata-hash-extension.workspace = true
# FRAME pallets Phase 1.3 (per SBS-4 ratified)
pallet-balances.workspace = true
pallet-timestamp.workspace = true
pallet-transaction-payment.workspace = true
# FRAME pallets Phase 1.4 — Consensus PoA per CHN-1 ratified
pallet-aura.workspace = true
pallet-grandpa.workspace = true
# FRAME pallets Phase 1.5 — Session rotation per CHN-1 4h epochs
pallet-session.workspace = true
# pallet-identity DEFERRED a Phase 2.7 (canonical decision empírica 2026-05-21)
# pallet-identity.workspace = true
# RuntimeAPI canonical (sp_api::impl_runtime_apis! consumers)
sp-offchain.workspace = true
sp-genesis-builder.workspace = true
sp-transaction-pool.workspace = true
sp-session.workspace = true
frame-system-rpc-runtime-api.workspace = true
pallet-transaction-payment-rpc-runtime-api.workspace = true
# SCALE codec canonical
parity-scale-codec.workspace = true
scale-info.workspace = true
# Logging
log.workspace = true
# Serialization opcional
serde = { workspace = true, optional = true }
[features]
default = ["std"]
std = [
"sp-core/std",
"sp-runtime/std",
"sp-std/std",
"sp-version/std",
"sp-api/std",
"sp-block-builder/std",
"sp-inherents/std",
"sp-consensus-aura/std",
"sp-consensus-grandpa/std",
"frame-system/std",
"frame-support/std",
"frame-executive/std",
"frame-metadata-hash-extension/std",
"pallet-balances/std",
"pallet-timestamp/std",
"pallet-transaction-payment/std",
"pallet-aura/std",
"pallet-grandpa/std",
"pallet-session/std",
"sp-offchain/std",
"sp-genesis-builder/std",
"sp-transaction-pool/std",
"sp-session/std",
"frame-system-rpc-runtime-api/std",
"pallet-transaction-payment-rpc-runtime-api/std",
"parity-scale-codec/std",
"scale-info/std",
"serde",
]
runtime-benchmarks = [
"frame-system/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"pallet-balances/runtime-benchmarks",
"pallet-timestamp/runtime-benchmarks",
"pallet-transaction-payment/runtime-benchmarks",
# pallet-aura 39.0.0 + pallet-grandpa 40.0.0 NO exponen feature
# runtime-benchmarks en stable2512 canonical. Wire-up canonical Phase 1.5+
# cuando pallet_session se integre + benchmark scaffolding land.
"pallet-grandpa/try-runtime",
]