feat(consensus): Phase 1.4 — Consensus PoA canonical Aura+GRANDPA v0.0.6

Origin Chain runtime canonical ahora produces blocks + finalizes via
Aura+GRANDPA per CHN-1 ratified. PoA Phase 1 substrate fundación bien anclada.

## Pallets añadidos canonical (per SBS-4)

- Index 4 Aura (pallet_aura 39.0.0) — block production canonical PoA per CHN-1
  Round-Robin 6-segundo slots alineados Pi 5 + NVMe SSD. AuraId sr25519.
- Index 5 Grandpa (pallet_grandpa 40.0.0) — finality gadget per CHN-1
  2/3 honest majority irreversible confirmation. GrandpaId Ed25519.

## Primitives consumidas
- sp-consensus-aura 0.42.0 (feature serde canonical)
- sp-consensus-grandpa 23.0.0 → 23.1.0 (feature serde canonical)

## Configs canonical
- pallet_aura::Config: MaxAuthorities 32 + AllowMultipleBlocksPerSlot false
  + SlotDuration = MinimumPeriodTimesTwo (clock↔consensus coupling canonical)
- pallet_grandpa::Config: MaxAuthorities 32 + MaxNominators 0 + KeyOwnerProof
  Void + EquivocationReportSystem () (Phase 1 simple, real Phase 2 NPoS)

## Wiring canonical clock↔consensus
pallet_timestamp::OnTimestampSet = crate::Aura (was ()) — cada nuevo
timestamp triggera Aura slot advance canonical. Materializa 6-segundo block
production deterministic Pi 5.

## Opaque SessionKeys canonical (nuevo opaque.rs module)
impl_opaque_keys! con aura (sr25519) + grandpa (Ed25519) — substrate canonical
pattern para forkless runtime upgrades. Cada validator posee 2 keys canonical.
Pre-Phase 1.5: static keys en genesis chain_spec. Phase 1.5: pallet_session
introduces rotation 4h epochs per CHN-1.

## Filosofía canonical
opaque.rs cita David canon 2026-05-14 "la libertad infinita acota solo donde
empieza la del otro" — opaque types son la frontera canonical entre node
sovereignty + runtime sovereignty. Each layer respeta la libertad del otro.

## Build + tests
- cargo check 6.17s warm cache (Aura+Grandpa deps incremental)
- cargo build --release 8.64s warm cache clean
- ~57 tests passing (count preserved — Aura/Grandpa tests llegan Phase 1.5+)

## Edge case empírico
pallet-aura 39.0.0 + pallet-grandpa 40.0.0 NO exponen feature
runtime-benchmarks en stable2512 canonical. Wire-up benchmark scaffolding
land Phase 1.5+ cuando pallet_session se integre.

## Phase 1 progress
1.1 ✅ + 1.2 ✅ + 1.3 ✅ + 1.4 ✅ (esta). Next: 1.5 pallet_session validator
rotation 4h epochs per CHN-1.

Origin Chain runtime composition canonical actual (6 pallets):
- 0 System + 1 Timestamp + 2 Balances + 3 TransactionPayment
- 4 Aura + 5 Grandpa
- Opaque SessionKeys: aura sr25519 + grandpa Ed25519

Refs: CHARON_ROADMAP_V1 Phase 1.4, CHN-1 ratified Aura+GRANDPA canonical,
SBS-4 ratified extended pallet set

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
davidherranandClaude Opus 4.6 committed 2026-05-20 19:34:34 -05:00
1 parent adab264d54
commit 4988693d4b
7 files changed
+430 -9

No files matched your search

Generated
+164
View File
@@ -1085,6 +1085,22 @@ dependencies = [
"winapi",
]
[[package]]
name = "finality-grandpa"
version = "0.16.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b4f8f43dc520133541781ec03a8cab158ae8b7f7169cdf22e9050aa6cf0fbdfc"
dependencies = [
"either",
"futures",
"futures-timer",
"log",
"num-traits",
"parity-scale-codec",
"parking_lot",
"scale-info",
]
[[package]]
name = "find-msvc-tools"
version = "0.1.9"
@@ -1393,6 +1409,12 @@ version = "0.3.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393"
[[package]]
name = "futures-timer"
version = "3.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "af43fadb8a98512d547e37b4e92e0ced13e205c061b87b4623eff01d918d6968"
[[package]]
name = "futures-util"
version = "0.3.32"
@@ -2063,7 +2085,9 @@ dependencies = [
"frame-system",
"log",
"origin-chain-types",
"pallet-aura",
"pallet-balances",
"pallet-grandpa",
"pallet-timestamp",
"pallet-transaction-payment",
"parity-scale-codec",
@@ -2071,6 +2095,8 @@ dependencies = [
"serde",
"sp-api",
"sp-block-builder",
"sp-consensus-aura",
"sp-consensus-grandpa",
"sp-core",
"sp-inherents",
"sp-runtime",
@@ -2095,6 +2121,37 @@ dependencies = [
"origin-chain-types",
]
[[package]]
name = "pallet-aura"
version = "39.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4afcad52b78910d4acb9b260758f69d6167c2e5e03040bd87f42fa2e182f9bad"
dependencies = [
"frame-support",
"frame-system",
"log",
"pallet-timestamp",
"parity-scale-codec",
"scale-info",
"sp-application-crypto",
"sp-consensus-aura",
"sp-runtime",
]
[[package]]
name = "pallet-authorship"
version = "40.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d08ec7786d0232e2f92f36e9e20c7414f3b4d763a35569c0b9c32ed90ed62c50"
dependencies = [
"frame-support",
"frame-system",
"impl-trait-for-tuples",
"parity-scale-codec",
"scale-info",
"sp-runtime",
]
[[package]]
name = "pallet-balances"
version = "41.1.1"
@@ -2112,6 +2169,51 @@ dependencies = [
"sp-runtime",
]
[[package]]
name = "pallet-grandpa"
version = "40.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7248e836db9e07b2262b83bd638e0070f5d2357d63519920317473ad90d3fac2"
dependencies = [
"frame-benchmarking",
"frame-support",
"frame-system",
"log",
"pallet-authorship",
"pallet-session",
"parity-scale-codec",
"scale-info",
"sp-application-crypto",
"sp-consensus-grandpa",
"sp-core",
"sp-io",
"sp-runtime",
"sp-session",
"sp-staking",
]
[[package]]
name = "pallet-session"
version = "40.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "35361f753986d6fe6654b3e5d283700c4f0bb082221c6aaf299912a29679c880"
dependencies = [
"frame-support",
"frame-system",
"impl-trait-for-tuples",
"log",
"pallet-timestamp",
"parity-scale-codec",
"scale-info",
"sp-core",
"sp-io",
"sp-runtime",
"sp-session",
"sp-staking",
"sp-state-machine",
"sp-trie",
]
[[package]]
name = "pallet-timestamp"
version = "39.0.0"
@@ -2982,6 +3084,53 @@ dependencies = [
"sp-runtime",
]
[[package]]
name = "sp-consensus-aura"
version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d4f3b3414e7620ad72d0000b520e0570dca38dc63e160c95164ff3f789020cc1"
dependencies = [
"async-trait",
"parity-scale-codec",
"scale-info",
"sp-api",
"sp-application-crypto",
"sp-consensus-slots",
"sp-inherents",
"sp-runtime",
"sp-timestamp",
]
[[package]]
name = "sp-consensus-grandpa"
version = "23.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c1e969d551ce631fbaf190a4457c295ef70c50bae657602f2377e433f9454868"
dependencies = [
"finality-grandpa",
"log",
"parity-scale-codec",
"scale-info",
"serde",
"sp-api",
"sp-application-crypto",
"sp-core",
"sp-keystore",
"sp-runtime",
]
[[package]]
name = "sp-consensus-slots"
version = "0.42.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bc83d9e7b1d58e1d020c20d7208b00d21fa73dcf92721114eae432b9f01e62d5"
dependencies = [
"parity-scale-codec",
"scale-info",
"serde",
"sp-timestamp",
]
[[package]]
name = "sp-core"
version = "36.1.0"
@@ -3228,6 +3377,21 @@ dependencies = [
"syn 2.0.117",
]
[[package]]
name = "sp-session"
version = "38.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a4158c5558192b56cf5ba2ea028cbdbf0fc7c65258e5aa7653bdfad6e68ed21"
dependencies = [
"parity-scale-codec",
"scale-info",
"sp-api",
"sp-core",
"sp-keystore",
"sp-runtime",
"sp-staking",
]
[[package]]
name = "sp-staking"
version = "38.0.0"