feat(types): Phase 1.6+ Slice 2 — origin-chain-types fully no_std v0.0.11
origin-chain-types ahora fully no_std-compatible canonical — preparado para WASM runtime build canonical Slice 2b. ## Refactor sistemático canonical - src/lib.rs: #![cfg_attr(not(feature = "std"), no_std)] + extern crate alloc - src/errors.rs: String → alloc::string::String - src/provenance.rs: Vec<AccountId> → alloc::vec::Vec<AccountId> - src/pallets.rs: Vec<AssetAttestation> → alloc::vec::Vec<AssetAttestation> - Cargo.toml: [features] default=["std"] + std=["thiserror/std", "serde/std"] ## Workspace deps bump canonical (no_std-compatible) - thiserror 1.0 → 2.0 default-features=false (no_std support nativo) - serde 1.0 → =1.0.219 default-features=false (pin canonical para evitar serde_core breaking change canonical post-1.0.220) - log 0.4 → default-features=false - serde-big-array default-features=false ## Decisión empírica DEFERRED: WASM_BINARY a Slice 2b dedicated substrate-wasm-builder retry encountered serde 1.0.x alloc/serde_core feature conflict durante isolated WASM build (duplicate exchange_malloc lang item entre rustup stdlib alloc + wbuild dir alloc). Investigation requires deep Rust toolchain debugging — Slice 2b dedicated session merece DC propio. Investigation canonical scope para Slice 2b: 1. substrate-wasm-builder 25.x o 27.x version regression test 2. cargo workspace.metadata.wasm-builder section config 3. RUSTFLAGS -Z build-std=core,alloc nightly approach 4. Fallback: pre-built WASM binary loaded from file 5. Possible upstream issue paritytech/polkadot-sdk ## Filosofía canonical origin-chain-types era barrera canonical para hermanos consumers WASM runtimes. Esa barrera canonical ya NO existe post-refactor. Forward compatibility canonical preservada para Trinity 3D + Codex Vault + Ethos credential minting + AGI co-authoring canonical futuras integrations. David canon 2026-05-14 "la libertad infinita acota solo donde empieza la del otro" — la liberación arquitectónica del no_std sucede ahora. ## Build - cargo check workspace 17.06s warm - cargo build --release 1m 38s cold rebuild (serde version regress full recompile triggered) - origin-chain-node binary canonical ejecuta 4 subcommands - Full workspace test OOM (signal 137) — per-crate testing deferred ## Phase 1.6+ progress - Slice 1 ✅ (v0.0.10 CLI skeleton) - Slice 2 ✅ (v0.0.11 ESTA no_std refactor) - Slice 2b ⏳ WASM_BINARY dedicated debug - Slice 3 ⏳ sc_service::ChainSpec - Slice 4 ⏳ Full sc-service (consensus + RPC + networking) Refs: CHARON_ROADMAP_V1 Phase 1.6+ Slice 2, no_std refactor canonical preparation para WASM runtime build canonical Slice 2b Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
8a24a86ee6
commit
4a1f7bd834
11 files changed
+248
-81
No files matched your search
@@ -61,9 +61,18 @@ log.workspace = true
|
||||
serde = { workspace = true, optional = true }
|
||||
serde_json.workspace = true
|
||||
|
||||
[build-dependencies]
|
||||
# Slice 2 v0.0.11 retry: substrate-wasm-builder DEFERRED nuevamente — serde 1.0.x
|
||||
# alloc/serde_core feature conflicts canonical con substrate-wasm-builder isolated
|
||||
# WASM build canonical (duplicate `exchange_malloc` lang item canonical entre
|
||||
# rustup stdlib alloc + wbuild dir alloc canonical). Investigation canonical:
|
||||
# requires deep Rust toolchain debugging — Slice 2b dedicated.
|
||||
# substrate-wasm-builder = { workspace = true, optional = true }
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
std = [
|
||||
"origin-chain-types/std",
|
||||
"sp-core/std",
|
||||
"sp-runtime/std",
|
||||
"sp-std/std",
|
||||
@@ -93,6 +102,7 @@ std = [
|
||||
"parity-scale-codec/std",
|
||||
"scale-info/std",
|
||||
"serde",
|
||||
# "substrate-wasm-builder", # DEFERRED Slice 2b debugging canonical
|
||||
]
|
||||
runtime-benchmarks = [
|
||||
"frame-system/runtime-benchmarks",
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
//! # Build script canonical
|
||||
//!
|
||||
//! Currently no-op canonical. `substrate-wasm-builder` retry canonical para
|
||||
//! v0.0.11 encountered `serde 1.0.x` alloc/serde_core feature conflict canonical
|
||||
//! durante isolated WASM build canonical. Deferred a Slice 2b dedicated debug
|
||||
//! session canonical (requires deep Rust toolchain investigation canonical).
|
||||
|
||||
fn main() {
|
||||
// Placeholder canonical — WASM build land Slice 2b dedicated.
|
||||
}
|
||||
@@ -50,17 +50,23 @@ pub mod genesis_config_presets;
|
||||
pub mod opaque;
|
||||
|
||||
// ============================================================
|
||||
// WASM binary canonical — DEFERRED a v0.0.11+ (canonical decision empírica)
|
||||
// WASM binary canonical (Slice 2 v0.0.11 — DEFERRED Slice 2b)
|
||||
// ============================================================
|
||||
//
|
||||
// `WASM_BINARY` via `substrate-wasm-builder` requiere que TODAS las dependencias
|
||||
// transitivas del runtime sean no_std-compatible canonical. Actualmente
|
||||
// `origin-chain-types` no es fully no_std canonical (uses std `String` + `Vec`
|
||||
// directly sin `alloc::` prefix). Refactor canonical es Phase 1.6+ Slice 2
|
||||
// (substantial scope canonical: 5-10+ files affected canonical).
|
||||
// `substrate-wasm-builder` canonical encounters `serde 1.0.x` alloc/serde_core
|
||||
// feature conflict canonical durante isolated WASM build (`liballoc.rmeta`
|
||||
// duplicate lang item `exchange_malloc` canonical entre rustup stdlib +
|
||||
// wbuild dir).
|
||||
//
|
||||
// Mientras canonical: el `chain_spec.rs` node-side puede usar mock-WASM o
|
||||
// pre-built WASM file canonical (path-loaded en runtime canonical).
|
||||
// Investigation canonical requires deep Rust toolchain debugging canonical
|
||||
// — Slice 2b dedicated:
|
||||
// 1. Try substrate-wasm-builder 25.x or 27.x (version regression)
|
||||
// 2. Try serde 1.0.219 pinned + workspace.resolver = "2" explicit
|
||||
// 3. Try cargo workspace.metadata.wasm-builder section canonical
|
||||
// 4. Fallback canonical: prebuilt WASM binary loaded from file canonical
|
||||
//
|
||||
// Mientras canonical: `chain_spec.rs` Phase 1.6+ Slice 3 puede usar mock-WASM
|
||||
// canonical o pre-built WASM file canonical para development chain specs canonical.
|
||||
|
||||
// Re-export canonical traits + types desde origin-chain-types (single-crate surface).
|
||||
pub use origin_chain_types::{
|
||||
|
||||
@@ -7,14 +7,22 @@ license.workspace = true
|
||||
authors.workspace = true
|
||||
repository.workspace = true
|
||||
homepage.workspace = true
|
||||
description = "Canonical traits + types for Origin Chain. Day 1 unblock interfaces for all siblings consuming Pilar 4."
|
||||
description = "Canonical traits + types for Origin Chain. Day 1 unblock interfaces for all siblings consuming Pilar 4. Fully no_std-compatible canonical Slice 2 (v0.0.11)."
|
||||
keywords.workspace = true
|
||||
categories = ["no-std", "cryptography::cryptocurrencies"]
|
||||
|
||||
[dependencies]
|
||||
thiserror.workspace = true
|
||||
serde = { workspace = true, features = ["derive"] }
|
||||
serde-big-array = "0.5"
|
||||
# no_std-compatible deps canonical (Slice 2 v0.0.11)
|
||||
thiserror = { workspace = true }
|
||||
serde = { workspace = true }
|
||||
serde-big-array = { version = "0.5", default-features = false }
|
||||
|
||||
[dev-dependencies]
|
||||
serde_json = "1"
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
std = [
|
||||
"thiserror/std",
|
||||
"serde/std",
|
||||
]
|
||||
@@ -1,6 +1,8 @@
|
||||
//! Canonical chain error type. All `Result` returns in this crate flow through
|
||||
//! `ChainError` so callers have a single match arm.
|
||||
|
||||
extern crate alloc;
|
||||
|
||||
use thiserror::Error;
|
||||
|
||||
/// Canonical chain operation error.
|
||||
@@ -63,7 +65,7 @@ pub enum ChainError {
|
||||
|
||||
/// Catch-all for runtime-specific errors not covered above. Use sparingly.
|
||||
#[error("chain error: {0}")]
|
||||
Other(String),
|
||||
Other(alloc::string::String),
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
@@ -34,8 +34,11 @@
|
||||
//! - **#26** Content-Addressed Immutability — [`AssetHash`] BLAKE3 canonical
|
||||
//! - **#37** Origin FREE Tier Perpetua — wallet creation always free, validation earns OGC
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
#![deny(missing_docs)]
|
||||
|
||||
extern crate alloc;
|
||||
|
||||
pub mod accounts;
|
||||
pub mod assets;
|
||||
pub mod errors;
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
//! live in `pallet-origin-*` crates that will be added to the workspace at
|
||||
//! their respective phases (Substrate deps required).
|
||||
|
||||
extern crate alloc;
|
||||
|
||||
use crate::{AccountId, AssetAttestation, AssetHash, AssetQualityTier, ChainError, HardwareTier, Ogc, OperationKind};
|
||||
|
||||
// ============================================================================
|
||||
@@ -35,7 +37,7 @@ pub trait OriginProvenance {
|
||||
|
||||
/// Batch-attest a set of assets in a single extrinsic. Bounded length (max
|
||||
/// 64 per call to avoid block-weight overrun on Pi 5 validators).
|
||||
fn batch_attest(&self, attestations: Vec<AssetAttestation>) -> Result<u32, ChainError>;
|
||||
fn batch_attest(&self, attestations: alloc::vec::Vec<AssetAttestation>) -> Result<u32, ChainError>;
|
||||
|
||||
/// Query whether an asset hash exists in the provenance ledger without
|
||||
/// fetching the full attestation. Cheaper than `verify_provenance` —
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
//! Charon validates the signature, anchors the attestation in a Merkle root, and
|
||||
//! emits an event that Palace KG observes for cross-substrate provenance.
|
||||
|
||||
extern crate alloc;
|
||||
|
||||
use crate::{AccountId, AssetHash, ChainError, Signature};
|
||||
|
||||
/// Canonical attestation record stored on-chain. Compact (~100 bytes) so it fits
|
||||
@@ -25,7 +27,7 @@ pub struct AssetAttestation {
|
||||
/// Optional AGI co-author chain. Empty for purely human-authored assets;
|
||||
/// populated for Synthesizer / Forge / Skill outputs that include AGI input
|
||||
/// (per Inmutable #41 cross-species co-authorship).
|
||||
pub agent_chain: Vec<AccountId>,
|
||||
pub agent_chain: alloc::vec::Vec<AccountId>,
|
||||
}
|
||||
|
||||
/// Canonical provenance ledger. Consumed by Trinity (Phanes), Codex,
|
||||
|
||||
Reference in new issue
Block a user