Files
arkhe-origin-chain/crates/origin-chain-runtime/Cargo.toml
T
davidherranandClaude Opus 4.6 926650308c feat(session): Phase 1.5 — Session rotation 4h epochs canonical v0.0.7
Origin Chain runtime canonical ahora emite SessionEvent::NewSession cada 4
horas exactas per CHN-1 ratified. Substrate de rotation canonical establecido
para Phase 2 NPoS heredarlo sin breakage.

## Pallet añadido (per SBS-4)
- Index 6 Session (pallet_session 40.0.1) — validator session rotation per
  CHN-1 4h epochs. Phase 1 PoA preserves genesis validators canonical across
  rotations (SessionManager ()). Phase 2 NPoS introducira pallet_staking como
  SessionManager para rotation real per nominator stake + Pi 5 hardware tier
  weight.

## Configs canonical pallet_session
- SessionPeriod = BLOCK_HASH_COUNT (2400 bloques × 6s = 14400s = 4h exactas)
- SessionOffset = 0 (sesiones start at block 0)
- ValidatorId = ChainAccountId
- ValidatorIdOf = AccountIdIsValidatorId (custom identity converter Phase 1 PoA)
- ShouldEndSession/NextSessionRotation = PeriodicSessions<SessionPeriod, SessionOffset>
- SessionManager = () (preserves genesis Phase 1 PoA)
- SessionHandler = <opaque::SessionKeys as OpaqueKeys>::KeyTypeIdProviders
- Keys = opaque::SessionKeys (aura sr25519 + grandpa Ed25519)
- DisablingStrategy = () (Phase 2 NPoS introduce real slashing-based disable)

## Custom converter canonical
AccountIdIsValidatorId struct nueva — identity mapping AccountId → ValidatorId
Phase 1 PoA trivial. Phase 2 NPoS reemplazara con pallet_staking::StashOf<Self>
para real Stash/Controller separation canonical.

## Filosofía canonical
SessionPeriod = 4h es la frontera temporal canonical: cada 4h el chain
reflexiona on-chain quienes son los validators activos. Esta cadencia
institucional canonical es la minima necesaria para que Phase 2 NPoS pueda
evolucionar el set sin re-launching genesis. David canon 2026-05-14
materializado temporalmente.

## Build + tests
- cargo check 1.63s warm cache (pallet_session incremental)
- cargo build --release 7.70s warm cache clean
- ~57 tests passing (count preserved — session tests Phase 1.7 chain_spec)

## Decision empirica
pallet_session::Config::DisablingStrategy es nuevo stable2512 canonical (no
estaba en versiones anteriores). Phase 1 PoA: () preserva behavior original.
Phase 2 NPoS: UpToLimitWithReEnablingDisablingStrategy per CHN-3.

## Phase 1 progress
1.1 ✅ + 1.2 ✅ + 1.3 ✅ + 1.4 ✅ + 1.5 ✅ (esta). Next: 1.6 pallet_identity
Ed25519 DID + origin-chain-node real service.

7 pallets composed canonical:
- 0 System + 1 Timestamp + 2 Balances + 3 TransactionPayment
- 4 Aura + 5 Grandpa + 6 Session ← NEW
- Opaque SessionKeys consumed by pallet_session::Config::Keys ← NEW WIRE

Refs: CHARON_ROADMAP_V1 Phase 1.5, CHN-1 4h epoch rotation canonical, SBS-4
extended, arkhe-origin-chain commit pending

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-20 19:40:54 -05:00

94 lines
2.7 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
# 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",
"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",
]