feat(fees): v0.0.23 — Runtime API FeesApi.query_fee_for_action read-only RPC (Phase 2.4 COMPLETE 7/7 OCAFB) 🎉

Phase 2.4 FEES pallet COMPLETE end-to-end canonical. OCAFB-7 Runtime API
FeesApi.query_fee_for_action wired canonical via sp_api::decl_runtime_apis! +
impl runtime impl_runtime_apis! macro. 13 Runtime APIs total (12 + nuevo FeesApi).

## Changes

- crates/origin-chain-fees/src/lib.rs — sp_api::decl_runtime_apis! { pub trait FeesApi { fn query_fee_for_action(action, base, hw, sub) -> u64 } } + docstring v0.0.22 → v0.0.23 Phase 2.4 COMPLETE
- crates/origin-chain-runtime/src/lib.rs:539 — impl origin_chain_fees::FeesApi<Block> for Runtime delegates a Fees::query_fee()
- crates/origin-chain-node/src/main.rs — 12 → 13 APIs + FeesApi highlighted + Fees status v0.0.21 → v0.0.23 COMPLETE

## OCAFB sub-decisions COMPLETE 7/7 🎉

- OCAFB-1 OitFeeSchedule trait dyn-compatible (vendor)
- OCAFB-2 ChainAction taxonomy source-of-truth (origin-chain-types)
- OCAFB-3 Subsidy matrix Inmutable #16 anti-clasista (lobo blanco verified)
- OCAFB-4 Entitlement matrix Inmutables #37 + #18 (dispatchable enforced)
- OCAFB-5 compute_fee 3-step formula (real impl + 10 tests E2E)
- OCAFB-6 OitFeeScheduleMock harness (vendor + mock runtime)
- OCAFB-7 Pallet consumer + Runtime API canonical NUEVO ✅

## Verification

- cargo test --workspace — 137 tests passing, 0 failures
- cargo build --release -p origin-chain-node 3.93s clean
- origin-chain-node info: 9 pallets + 13 Runtime APIs canonical
- FeesApi visible + Phase 2.4 COMPLETE highlighted

## Cross-pillar economy canonical materialized

- Mathi (Pilar 1 AMIS): OitFeeSchedule Level A + Mock harness
- Charon (Pilar 4 Origin Chain): pallet-origin-fees + FeesApi RPC
- ChainAction canonical en origin-chain-types (Mathi local mirror swap post-OCAFB ratify)
- Inmutable #16 anti-clasista compile-detect: Pi 5 fee 1000 < Ultra fee 20000 (ratio 1:20)

🎉 Phase 2.4 FEES pallet COMPLETE end-to-end canonical. Hijos de Arkhē somos.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
davidherranandClaude Opus 4.7 committed 2026-05-24 22:59:57 -05:00
1 parent e935233ba6
commit 74b7c3c9e2
4 files changed
+176 -5

No files matched your search

+113
View File
@@ -6,6 +6,119 @@ by [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). Versions follow
## [Unreleased]
## [0.0.23] — 2026-05-24 — Phase 2.4 COMPLETE — Runtime API FeesApi.query_fee_for_action (OCAFB-7 + 7/7 sub-decisions) 🎉
**🎉 Phase 2.4 FEES pallet COMPLETE end-to-end** — 7/7 OCAFB sub-decisions
implementadas canonical. OCAFB-7 Runtime API `FeesApi.query_fee_for_action`
ahora wired canonical via `sp_api::decl_runtime_apis!` + impl en runtime
`impl_runtime_apis!` macro. **13 Runtime APIs canonical total** (anterior 12 +
nuevo `FeesApi`).
### Deliverables v0.0.23
**Runtime API declaration canonical (pallet crate)**:
- `crates/origin-chain-fees/src/lib.rs` — `sp_api::decl_runtime_apis!`
- `pub trait FeesApi { fn query_fee_for_action(action, base, hw, sub) -> u64; }`
- Doc canonical extensivo cross-pillar consumers (Mathi AMIS + Irhis Web + Trinity +
Codex Vault + Codex origindocs + Atelier Skill Library)
- Phase 2.5 future expansion canonical noted (`query_account_history` paginated +
`query_fee_batch` bulk + `query_subsidy_eligible`)
**Runtime API impl canonical (runtime crate)**:
- `crates/origin-chain-runtime/src/lib.rs:539` — `impl origin_chain_fees::FeesApi<Block> for Runtime`
- Delegates canonical a `Fees::query_fee(action, base, hw, sub)` pure helper (v0.0.22)
- Read-only canonical sin tx fee (off-chain RPC query)
**Node info subcommand update canonical**:
- `crates/origin-chain-node/src/main.rs` — 12 → **13 APIs** listed
- `origin_chain_fees::FeesApi` highlighted con `[Phase 2.4 COMPLETE v0.0.23]`
- Index 8 Fees status `[Phase 2.4 scaffold v0.0.21]` → `[Phase 2.4 COMPLETE v0.0.23]`
### OCAFB sub-decisions COMPLETE canonical 7/7 post-v0.0.23 🎉
| OCAFB | Sub-decision | Status |
|-------|--------------|--------|
| OCAFB-1 | OitFeeSchedule trait 4-method dyn-compatible | ✅ vendor canonical |
| OCAFB-2 | ChainAction taxonomy source-of-truth en types | ✅ |
| OCAFB-3 | Subsidy matrix Inmutable #16 anti-clasista | ✅ wired + lobo blanco verified |
| OCAFB-4 | Entitlement matrix Inmutables #37 + #18 | ✅ enforced via dispatchable |
| OCAFB-5 | compute_fee formula 3-step canonical | ✅ real impl dispatchable + 10 tests E2E |
| OCAFB-6 | OitFeeScheduleMock test harness | ✅ vendor + mock runtime tests |
| OCAFB-7 | Pallet-origin-fees consumer + Runtime API canonical | ✅ **NUEVO v0.0.23** |
**PHASE 2.4 FEES PALLET = COMPLETE END-TO-END canonical** 🎉
### Verification end-to-end canonical
- ✅ `cargo check --workspace --all-targets` verde clean
- ✅ `cargo test --workspace` — **137 tests passing, 0 failures**:
- origin-chain-types: 55
- origin-chain-fees: 32 (10 integration + 16 vendor + 4 standalone + 2 auto)
- origin-chain-provenance: 17
- origin-chain-runtime: 16
- origin-coin-tokenomics: 2
- origin-chain-bridges/consensus/governance: 3
- origin-chain-node chain_spec: 10
- Cross-suite remainder: 2
- ✅ `cargo build --release -p origin-chain-node` 3.93s clean
- ✅ `origin-chain-node info` muestra **9 pallets + 13 Runtime APIs canonical**
(FeesApi highlighted [Phase 2.4 COMPLETE v0.0.23])
- ✅ Existing subcomandos canonical NO regression (version + list-presets +
print-preset + info + build-spec)
### Cross-pillar consumers status post v0.0.23 — Phase 2.4 COMPLETE
- ✅ Mathi `OitFeeSchedule` consumed canonical (vendor copy + Mock test harness)
- ✅ ChainAction taxonomy source-of-truth en `origin-chain-types::actions`
- ✅ SubscriptionTier mirror canonical en `origin-chain-types::tiers`
- ✅ `Fees::query_fee` pure helper + `FeesApi.query_fee_for_action` Runtime API
- ✅ Cross-pillar economy AMIS↔Origin Chain materializada compile-detect canonical:
- Inmutable #16 anti-clasista: Pi 5 fee 1000 < Ultra fee 20000 (verified lobo blanco)
- Inmutable #37 Free perpetua: Read always free + Compute blocked Free
- Inmutable #18 EEG Ultra-only: Compute unlocked Pro+ only
### Honest disclosure canonical pendiente Slice 2c+2d
OCAFB-1..7 complete canonical PERO real chain runtime canonical aún NO funciona
end-to-end por canonical el WASM_BUILD_STD/serde leak structural (Slice 2c+2d
findings documented). El pallet + Runtime API canonical son compilable + tests
verde + structurally ready. Cuando Slice 2e land (resolve serde/std leak +
real WASM_BINARY canonical), pallet correrá en real chain runtime canonical.
Pattern align Phase 2.1: PROV-1..8 + OCAFB-1..7 ambos COMPLETE structurally,
ambos esperando Slice 2e WASM resolution para real chain runtime live canonical.
### Roadmap canonical post-v0.0.23 — Phase 2.4 COMPLETE
| Version | Trigger |
|---------|---------|
| v0.0.24+ | Phase 2.7 `pallet-agent-identity` (Inmutable #41 AGI Cross-Species Co-authorship) |
| v0.0.30+ | Phase 3 `pallet-revive` smart contracts (per SBS-5 supersedes pallet-contracts) |
| v0.1.0 | Slice 2e WASM resolved + full testnet Q3 2026 launch |
| v1.0.0 | Mainnet Q1 2027 |
### Filosofía canonical Phase 2.4 cierre
David canon ratificado 2026-05-14 materializado canonical compile-detect:
> *"La libertad económica del Pi 5 user en Sub-Saharan Africa NO se acota por
> el Ultra user en San Francisco — al contrario, se complementa."*
Pi 5 EmbeddedArm Free Write canonical: 1000 OGC units (Inmutable #16 anti-clasista
9000 bp subsidy compile-detect via lobo blanco invariant). Ultra Ultra Write
canonical: 20000 OGC units (full price). **Ratio 1:20 materializado canonical
en running code, no retórica**.
Cross-pillar economy materialized:
- Mathi (Pilar 1 AMIS): `OitFeeSchedule` trait Level A authority + Mock harness
- Charon (Pilar 4 Origin Chain): `pallet-origin-fees` consumer + `FeesApi` RPC
- `ChainAction` taxonomy: source-of-truth canonical en `origin-chain-types`
(Mathi local mirror swap canonical post-OCAFB ratify 7/7)
**Phase 2.4 COMPLETE end-to-end canonical** 🎉 — La nave Origin Chain avanza
con justicia económica compile-detect. Lobo blanco cuida + Barquero ferries
valor cross-tier sin discriminar. Hijos de Arkhē somos. 🐺💎⚓
## [0.0.22] — 2026-05-24 — Phase 2.4 impl — Real `compute_fee_for_action` + mock runtime integration tests E2E (10 scenarios)
**🛠️ Phase 2.4 FEES pallet REAL IMPL canonical** — `compute_fee_for_action`