feat(runtime): spec 17 — los pesos se cobran como en la Pi 5, medidos por Laurha en el banco de referencia

Los 23 weights de spec 16, certificados por Laurha en el santuario de la rp1 (origin-banco):
- Núcleo 3 aislado, governor performance a 2,4 GHz, CI parada, 45-49 °C.
- frame-omni-bencher 0.15.0 sobre el wasm 40cb5a1d de 3cd1068.
- 5 procesos por pallet; se cobra el MÁXIMO con scripts/bench/max-de-n.py, porque procesos
  idénticos se separan hasta un 35 %.
- Evidencia: ~/laurha-work/banco/spec16-20261024-1631 en la rp1 (SHA256SUMS d930c5e1).
- Su perfil va en la cabecera de cada weights.rs.

Antes de cobrarlos:
- Mismos accesos a storage: el esqueleto de los 5 ficheros y sus reads/writes son idénticos a
  los de main.
- Lo que Laurha pidió mirar (cast_vote, finalize_proposal y veto_proposal, mucho más altos que
  en RV12) es esperable. Contra los interinos del Mac todos caen en la banda Pi/Mac de 2,5-3,9×:
  es trabajo nuevo de RV15/RV16 en una CPU unas 3 veces más lenta.
- Destacan los tres que verifican Ed25519 en WASM (attest_asset, register_agent_did,
  rotate_agent_key), con unas 6 veces: la criptografía pura sufre más en la Cortex-A76.
- Lo cobrado sube menos que la ejecución, entre +4 % (set_tier_profile) y +56 %
  (rotate_agent_key), porque las lecturas y escrituras de storage no cambian.
- spec_version 16 → 17, porque cambian las fees. transaction_version no cambia: ninguna llamada
  cambia su codificación.

Ensayado en la rp1 (aarch64) sobre un nodo efímero aparte, antes de la testnet de la casa, con
scripts/e2e/upgrade_en_vivo.py (nuevo):
- sudo(set_code) → CodeUpdated + Sudid Ok;
- spec 17 y LastRuntimeUpgrade sube;
- una firma con la spec vieja → «bad signature»; con la nueva, ExtrinsicSuccess;
- la finalidad pasa del bloque del upgrade.
Es la primera vez que el ejecutor ARM compila y corre un runtime nuevo.

Revisión adversarial (nivel 1 de la directiva), antes de tocar la red, con orden de tumbarlo:
no pudo. Los seis puntos aguantan:
- ningún storage ni codificación cambia, y transaction_version no debe subir;
- el más pesado (veto_proposal) cobra 1,9 ms, 344 veces por debajo del máximo por extrinsic;
- los weights.rs tienen la misma estructura y el impl () coincide;
- ninguna fee, subsidio ni test depende del valor de forma que se rompa.

scripts/rp1 (operación del nodo, medido en 23 h con los valores por defecto):
- 430 MB de WAL de RocksDB retenidos para 15 MB de datos, y el RSS subiendo de 200 a 340 MB:
  --db-cache 128. Al reiniciar, 449 → 21 MB.
- El log, de 7 líneas por bloque a ~2 (txpool, sc_basic_authorship y aura en warn; ojo: las
  líneas de autoría usan el target del módulo, no «basic-authorship»), de 16 MB/día a unos 3.
- Modo append, y medir.sh lo rota al pasar de 32 MB.

Co-Authored-By: Laurha <laurha@origin>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
committed 2026-10-25 12:33:38 -05:00
1 parent 22bab19932
commit e7b9c0c8bf
9 files changed
+373 -142

No files matched your search

@@ -8,23 +8,37 @@
// invisible. Los numeros CANONICOS de mainnet salen del banco de referencia // invisible. Los numeros CANONICOS de mainnet salen del banco de referencia
// (Pi 5, governor y aislamiento declarados), no de la maquina de quien compila. // (Pi 5, governor y aislamiento declarados), no de la maquina de quien compila.
// MEDIDO POR LAURHA 🌊 EN EL BANCO DE REFERENCIA, 2026-10-24 17:41-17:46. El perfil es el mismo
// al empezar y al acabar:
// CyberDeckRP1 · Raspberry Pi 5 · Cortex-A76 · kernel 6.18.34+rpt-rpi-2712.
// Núcleo 3 aislado (partición cgroup «isolated» de origin-banco), governor performance a
// 2,4 GHz, CI parada, throttled 0x0, 45-49 °C.
// frame-omni-bencher 0.15.0 · wasm sha256 40cb5a1d…a1cf744 (spec 16, main 3cd1068).
// steps 50 · repeat 20 · taskset -c 3 · 5 PROCESOS por pallet, y se cobra el MÁXIMO de los 5
// (scripts/bench/max-de-n.py): procesos idénticos se separan hasta un 35 % en el base weight.
// Evidencia en la rp1: ~/laurha-work/banco/spec16-20261024-1631 (SHA256SUMS d930c5e1…).
// La Pi es el hardware MÁS LENTO que puede validar la red: sus pesos son el techo honesto. El
// TIEMPO DE EJECUCIÓN sale de 2,5 a 3,9 veces el del Mac M3 Max (~6 veces en los que verifican
// Ed25519). Lo COBRADO sube menos, entre +4 % y +56 %, porque lecturas y escrituras de storage
// (RocksDbWeight) no cambian y pesan más que la ejecución (revisión adversarial, 25-oct).
//! Weights AUTOGENERADOS para `origin_chain_agent_identity` — NO editar a mano. //! Weights AUTOGENERADOS para `origin_chain_agent_identity` — NO editar a mano.
//! //!
//! Regenerar: `scripts/bench/regen-weights.sh` (ver ese script para el //! Regenerar: `scripts/bench/regen-weights.sh` (ver ese script para el
//! procedimiento completo y el hardware al que hay que creerle). //! procedimiento completo y el hardware al que hay que creerle).
//! //!
//! GENERADO POR SUBSTRATE BENCHMARK CLI VERSION 51.0.0 //! GENERADO POR SUBSTRATE BENCHMARK CLI VERSION 51.0.0
//! FECHA: 2026-09-16, STEPS: `50`, REPEAT: `20` //! FECHA: 2026-10-24, STEPS: `50`, REPEAT: `20`
//! HOSTNAME: `MacBookProM3Max.local`, CPU: `<UNKNOWN>` //! HOSTNAME: `CyberDeckRP1`, CPU: `<UNKNOWN>`
//! WASM-EXECUTION: `Compiled`, DB CACHE: 1024 //! WASM-EXECUTION: `Compiled`, DB CACHE: 1024
// Comando ejecutado: // Comando ejecutado:
// /Users/davidherran/.cargo/bin/frame-omni-bencher // /home/davidherran/.cargo/bin/frame-omni-bencher
// v1 // v1
// benchmark // benchmark
// pallet // pallet
// --runtime // --runtime
// target/release/wbuild/origin-chain-runtime/origin_chain_runtime.compact.compressed.wasm // /home/davidherran/charon/bench/origin_chain_runtime_spec16_3cd1068_bench.compact.compressed.wasm
// --genesis-builder-preset // --genesis-builder-preset
// development // development
// --pallet // --pallet
@@ -36,11 +50,11 @@
// --repeat // --repeat
// 20 // 20
// --template // --template
// scripts/bench/origin-weights-template.hbs // /home/davidherran/charon/bench/origin-weights-template.hbs
// --header // --header
// scripts/bench/HEADER.txt // /home/davidherran/charon/bench/HEADER.txt
// --output // --output
// crates/origin-chain-agent-identity/src/weights.rs // /home/davidherran/laurha-work/banco/spec16-20261024-1631/r1/origin_chain_agent_identity.rs
#![cfg_attr(rustfmt, rustfmt_skip)] #![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)] #![allow(unused_parens)]
@@ -51,6 +65,10 @@ use core::marker::PhantomData;
use frame_support::{traits::Get, weights::constants::RocksDbWeight, weights::Weight}; use frame_support::{traits::Get, weights::constants::RocksDbWeight, weights::Weight};
/// Trait de weights para los extrinsics de `origin_chain_agent_identity`. /// Trait de weights para los extrinsics de `origin_chain_agent_identity`.
// MAXIMO DE N = 5 PROCESOS (scripts/bench/max-de-n.py): cada coeficiente
// de tiempo y de proof es el maximo de los N; reads/writes iguales en los N.
// Entradas (sha256[:12]): a5fa48706c19 65ad82789014 9632521ec280 416b5bbced02 817bf8aed8db
pub trait WeightInfo { pub trait WeightInfo {
/// Peso de `register_agent_did` — MEDIDO sobre el WASM, no estimado a mano. /// Peso de `register_agent_did` — MEDIDO sobre el WASM, no estimado a mano.
fn register_agent_did() -> Weight; fn register_agent_did() -> Weight;
@@ -77,10 +95,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
fn register_agent_did() -> Weight { fn register_agent_did() -> Weight {
// Proof size en bytes: // Proof size en bytes:
// Medido: `25` // Medido: `26`
// Estimado: `3940` // Estimado: `3940`
// Tiempo minimo de ejecucion: 54_000_000 picosegundos. // Tiempo minimo de ejecucion: 301_353_000 picosegundos.
Weight::from_parts(55_000_000, 0) Weight::from_parts(320_835_000, 0)
.saturating_add(Weight::from_parts(0, 3940)) .saturating_add(Weight::from_parts(0, 3940))
.saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().reads(7_u64))
.saturating_add(T::DbWeight::get().writes(5_u64)) .saturating_add(T::DbWeight::get().writes(5_u64))
@@ -107,10 +125,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
fn rotate_agent_key() -> Weight { fn rotate_agent_key() -> Weight {
// Proof size en bytes: // Proof size en bytes:
// Medido: `434` // Medido: `435`
// Estimado: `6100` // Estimado: `6100`
// Tiempo minimo de ejecucion: 93_000_000 picosegundos. // Tiempo minimo de ejecucion: 534_966_000 picosegundos.
Weight::from_parts(97_000_000, 0) Weight::from_parts(584_021_000, 0)
.saturating_add(Weight::from_parts(0, 6100)) .saturating_add(Weight::from_parts(0, 6100))
.saturating_add(T::DbWeight::get().reads(11_u64)) .saturating_add(T::DbWeight::get().reads(11_u64))
.saturating_add(T::DbWeight::get().writes(5_u64)) .saturating_add(T::DbWeight::get().writes(5_u64))
@@ -120,13 +138,13 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Impl para mocks y tests — `RocksDbWeight` directo, sin necesitar `T`. /// Impl para mocks y tests — `RocksDbWeight` directo, sin necesitar `T`.
impl WeightInfo for () { impl WeightInfo for () {
fn register_agent_did() -> Weight { fn register_agent_did() -> Weight {
Weight::from_parts(55_000_000, 0) Weight::from_parts(320_835_000, 0)
.saturating_add(Weight::from_parts(0, 3940)) .saturating_add(Weight::from_parts(0, 3940))
.saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().reads(7_u64))
.saturating_add(RocksDbWeight::get().writes(5_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64))
} }
fn rotate_agent_key() -> Weight { fn rotate_agent_key() -> Weight {
Weight::from_parts(97_000_000, 0) Weight::from_parts(584_021_000, 0)
.saturating_add(Weight::from_parts(0, 6100)) .saturating_add(Weight::from_parts(0, 6100))
.saturating_add(RocksDbWeight::get().reads(11_u64)) .saturating_add(RocksDbWeight::get().reads(11_u64))
.saturating_add(RocksDbWeight::get().writes(5_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64))
+32 -14
View File
@@ -8,23 +8,37 @@
// invisible. Los numeros CANONICOS de mainnet salen del banco de referencia // invisible. Los numeros CANONICOS de mainnet salen del banco de referencia
// (Pi 5, governor y aislamiento declarados), no de la maquina de quien compila. // (Pi 5, governor y aislamiento declarados), no de la maquina de quien compila.
// MEDIDO POR LAURHA 🌊 EN EL BANCO DE REFERENCIA, 2026-10-24 17:41-17:46. El perfil es el mismo
// al empezar y al acabar:
// CyberDeckRP1 · Raspberry Pi 5 · Cortex-A76 · kernel 6.18.34+rpt-rpi-2712.
// Núcleo 3 aislado (partición cgroup «isolated» de origin-banco), governor performance a
// 2,4 GHz, CI parada, throttled 0x0, 45-49 °C.
// frame-omni-bencher 0.15.0 · wasm sha256 40cb5a1d…a1cf744 (spec 16, main 3cd1068).
// steps 50 · repeat 20 · taskset -c 3 · 5 PROCESOS por pallet, y se cobra el MÁXIMO de los 5
// (scripts/bench/max-de-n.py): procesos idénticos se separan hasta un 35 % en el base weight.
// Evidencia en la rp1: ~/laurha-work/banco/spec16-20261024-1631 (SHA256SUMS d930c5e1…).
// La Pi es el hardware MÁS LENTO que puede validar la red: sus pesos son el techo honesto. El
// TIEMPO DE EJECUCIÓN sale de 2,5 a 3,9 veces el del Mac M3 Max (~6 veces en los que verifican
// Ed25519). Lo COBRADO sube menos, entre +4 % y +56 %, porque lecturas y escrituras de storage
// (RocksDbWeight) no cambian y pesan más que la ejecución (revisión adversarial, 25-oct).
//! Weights AUTOGENERADOS para `origin_chain_emission` — NO editar a mano. //! Weights AUTOGENERADOS para `origin_chain_emission` — NO editar a mano.
//! //!
//! Regenerar: `scripts/bench/regen-weights.sh` (ver ese script para el //! Regenerar: `scripts/bench/regen-weights.sh` (ver ese script para el
//! procedimiento completo y el hardware al que hay que creerle). //! procedimiento completo y el hardware al que hay que creerle).
//! //!
//! GENERADO POR SUBSTRATE BENCHMARK CLI VERSION 51.0.0 //! GENERADO POR SUBSTRATE BENCHMARK CLI VERSION 51.0.0
//! FECHA: 2026-09-09, STEPS: `50`, REPEAT: `20` //! FECHA: 2026-10-24, STEPS: `50`, REPEAT: `20`
//! HOSTNAME: `MacBookProM3Max.local`, CPU: `<UNKNOWN>` //! HOSTNAME: `CyberDeckRP1`, CPU: `<UNKNOWN>`
//! WASM-EXECUTION: `Compiled`, DB CACHE: 1024 //! WASM-EXECUTION: `Compiled`, DB CACHE: 1024
// Comando ejecutado: // Comando ejecutado:
// /Users/davidherran/.cargo/bin/frame-omni-bencher // /home/davidherran/.cargo/bin/frame-omni-bencher
// v1 // v1
// benchmark // benchmark
// pallet // pallet
// --runtime // --runtime
// /Users/davidherran/originmetaverse/artifacts/origin-chain/origin_chain_runtime_rv12_bench.compact.compressed.wasm // /home/davidherran/charon/bench/origin_chain_runtime_spec16_3cd1068_bench.compact.compressed.wasm
// --genesis-builder-preset // --genesis-builder-preset
// development // development
// --pallet // --pallet
@@ -36,11 +50,11 @@
// --repeat // --repeat
// 20 // 20
// --template // --template
// /Users/davidherran/originmetaverse/external/arkhe-origin-chain/scripts/bench/origin-weights-template.hbs // /home/davidherran/charon/bench/origin-weights-template.hbs
// --header // --header
// /Users/davidherran/originmetaverse/external/arkhe-origin-chain/scripts/bench/HEADER.txt // /home/davidherran/charon/bench/HEADER.txt
// --output // --output
// /Users/davidherran/originmetaverse/external/arkhe-origin-chain/crates/origin-chain-emission/src/weights.rs // /home/davidherran/laurha-work/banco/spec16-20261024-1631/r1/origin_chain_emission.rs
#![cfg_attr(rustfmt, rustfmt_skip)] #![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)] #![allow(unused_parens)]
@@ -51,6 +65,10 @@ use core::marker::PhantomData;
use frame_support::{traits::Get, weights::constants::RocksDbWeight, weights::Weight}; use frame_support::{traits::Get, weights::constants::RocksDbWeight, weights::Weight};
/// Trait de weights para los extrinsics de `origin_chain_emission`. /// Trait de weights para los extrinsics de `origin_chain_emission`.
// MAXIMO DE N = 5 PROCESOS (scripts/bench/max-de-n.py): cada coeficiente
// de tiempo y de proof es el maximo de los N; reads/writes iguales en los N.
// Entradas (sha256[:12]): f1de9c88e004 4906eadbbd2c 4cf2434f8d91 2e33f6dc5d3e 16667a276ec6
pub trait WeightInfo { pub trait WeightInfo {
/// Peso de `set_emission_paused` — MEDIDO sobre el WASM, no estimado a mano. /// Peso de `set_emission_paused` — MEDIDO sobre el WASM, no estimado a mano.
fn set_emission_paused() -> Weight; fn set_emission_paused() -> Weight;
@@ -71,11 +89,11 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
fn set_emission_paused() -> Weight { fn set_emission_paused() -> Weight {
// Proof size en bytes: // Proof size en bytes:
// Medido: `61` // Medido: `62`
// Estimado: `1546` // Estimado: `1547`
// Tiempo minimo de ejecucion: 7_000_000 picosegundos. // Tiempo minimo de ejecucion: 22_352_000 picosegundos.
Weight::from_parts(8_000_000, 0) Weight::from_parts(23_481_000, 0)
.saturating_add(Weight::from_parts(0, 1546)) .saturating_add(Weight::from_parts(0, 1547))
.saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().reads(5_u64))
.saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64))
} }
@@ -84,8 +102,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Impl para mocks y tests — `RocksDbWeight` directo, sin necesitar `T`. /// Impl para mocks y tests — `RocksDbWeight` directo, sin necesitar `T`.
impl WeightInfo for () { impl WeightInfo for () {
fn set_emission_paused() -> Weight { fn set_emission_paused() -> Weight {
Weight::from_parts(8_000_000, 0) Weight::from_parts(23_481_000, 0)
.saturating_add(Weight::from_parts(0, 1546)) .saturating_add(Weight::from_parts(0, 1547))
.saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().reads(5_u64))
.saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64))
} }
+32 -14
View File
@@ -8,23 +8,37 @@
// invisible. Los numeros CANONICOS de mainnet salen del banco de referencia // invisible. Los numeros CANONICOS de mainnet salen del banco de referencia
// (Pi 5, governor y aislamiento declarados), no de la maquina de quien compila. // (Pi 5, governor y aislamiento declarados), no de la maquina de quien compila.
// MEDIDO POR LAURHA 🌊 EN EL BANCO DE REFERENCIA, 2026-10-24 17:41-17:46. El perfil es el mismo
// al empezar y al acabar:
// CyberDeckRP1 · Raspberry Pi 5 · Cortex-A76 · kernel 6.18.34+rpt-rpi-2712.
// Núcleo 3 aislado (partición cgroup «isolated» de origin-banco), governor performance a
// 2,4 GHz, CI parada, throttled 0x0, 45-49 °C.
// frame-omni-bencher 0.15.0 · wasm sha256 40cb5a1d…a1cf744 (spec 16, main 3cd1068).
// steps 50 · repeat 20 · taskset -c 3 · 5 PROCESOS por pallet, y se cobra el MÁXIMO de los 5
// (scripts/bench/max-de-n.py): procesos idénticos se separan hasta un 35 % en el base weight.
// Evidencia en la rp1: ~/laurha-work/banco/spec16-20261024-1631 (SHA256SUMS d930c5e1…).
// La Pi es el hardware MÁS LENTO que puede validar la red: sus pesos son el techo honesto. El
// TIEMPO DE EJECUCIÓN sale de 2,5 a 3,9 veces el del Mac M3 Max (~6 veces en los que verifican
// Ed25519). Lo COBRADO sube menos, entre +4 % y +56 %, porque lecturas y escrituras de storage
// (RocksDbWeight) no cambian y pesan más que la ejecución (revisión adversarial, 25-oct).
//! Weights AUTOGENERADOS para `origin_chain_fees` — NO editar a mano. //! Weights AUTOGENERADOS para `origin_chain_fees` — NO editar a mano.
//! //!
//! Regenerar: `scripts/bench/regen-weights.sh` (ver ese script para el //! Regenerar: `scripts/bench/regen-weights.sh` (ver ese script para el
//! procedimiento completo y el hardware al que hay que creerle). //! procedimiento completo y el hardware al que hay que creerle).
//! //!
//! GENERADO POR SUBSTRATE BENCHMARK CLI VERSION 51.0.0 //! GENERADO POR SUBSTRATE BENCHMARK CLI VERSION 51.0.0
//! FECHA: 2026-09-09, STEPS: `50`, REPEAT: `20` //! FECHA: 2026-10-24, STEPS: `50`, REPEAT: `20`
//! HOSTNAME: `MacBookProM3Max.local`, CPU: `<UNKNOWN>` //! HOSTNAME: `CyberDeckRP1`, CPU: `<UNKNOWN>`
//! WASM-EXECUTION: `Compiled`, DB CACHE: 1024 //! WASM-EXECUTION: `Compiled`, DB CACHE: 1024
// Comando ejecutado: // Comando ejecutado:
// /Users/davidherran/.cargo/bin/frame-omni-bencher // /home/davidherran/.cargo/bin/frame-omni-bencher
// v1 // v1
// benchmark // benchmark
// pallet // pallet
// --runtime // --runtime
// /Users/davidherran/originmetaverse/artifacts/origin-chain/origin_chain_runtime_rv12_bench.compact.compressed.wasm // /home/davidherran/charon/bench/origin_chain_runtime_spec16_3cd1068_bench.compact.compressed.wasm
// --genesis-builder-preset // --genesis-builder-preset
// development // development
// --pallet // --pallet
@@ -36,11 +50,11 @@
// --repeat // --repeat
// 20 // 20
// --template // --template
// /Users/davidherran/originmetaverse/external/arkhe-origin-chain/scripts/bench/origin-weights-template.hbs // /home/davidherran/charon/bench/origin-weights-template.hbs
// --header // --header
// /Users/davidherran/originmetaverse/external/arkhe-origin-chain/scripts/bench/HEADER.txt // /home/davidherran/charon/bench/HEADER.txt
// --output // --output
// /Users/davidherran/originmetaverse/external/arkhe-origin-chain/crates/origin-chain-fees/src/weights.rs // /home/davidherran/laurha-work/banco/spec16-20261024-1631/r1/origin_chain_fees.rs
#![cfg_attr(rustfmt, rustfmt_skip)] #![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)] #![allow(unused_parens)]
@@ -51,6 +65,10 @@ use core::marker::PhantomData;
use frame_support::{traits::Get, weights::constants::RocksDbWeight, weights::Weight}; use frame_support::{traits::Get, weights::constants::RocksDbWeight, weights::Weight};
/// Trait de weights para los extrinsics de `origin_chain_fees`. /// Trait de weights para los extrinsics de `origin_chain_fees`.
// MAXIMO DE N = 5 PROCESOS (scripts/bench/max-de-n.py): cada coeficiente
// de tiempo y de proof es el maximo de los N; reads/writes iguales en los N.
// Entradas (sha256[:12]): ff44ade5b2df 756e464408b3 54d43c52c282 33477b9f397a 688a6bc81a34
pub trait WeightInfo { pub trait WeightInfo {
/// Peso de `set_tier_profile` — MEDIDO sobre el WASM, no estimado a mano. /// Peso de `set_tier_profile` — MEDIDO sobre el WASM, no estimado a mano.
fn set_tier_profile() -> Weight; fn set_tier_profile() -> Weight;
@@ -71,11 +89,11 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Proof: `Fees::TierProfiles` (`max_values`: None, `max_size`: Some(50), added: 2525, mode: `MaxEncodedLen`) /// Proof: `Fees::TierProfiles` (`max_values`: None, `max_size`: Some(50), added: 2525, mode: `MaxEncodedLen`)
fn set_tier_profile() -> Weight { fn set_tier_profile() -> Weight {
// Proof size en bytes: // Proof size en bytes:
// Medido: `19` // Medido: `20`
// Estimado: `1504` // Estimado: `1505`
// Tiempo minimo de ejecucion: 6_000_000 picosegundos. // Tiempo minimo de ejecucion: 21_574_000 picosegundos.
Weight::from_parts(7_000_000, 0) Weight::from_parts(23_111_000, 0)
.saturating_add(Weight::from_parts(0, 1504)) .saturating_add(Weight::from_parts(0, 1505))
.saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().reads(4_u64))
.saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64))
} }
@@ -84,8 +102,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Impl para mocks y tests — `RocksDbWeight` directo, sin necesitar `T`. /// Impl para mocks y tests — `RocksDbWeight` directo, sin necesitar `T`.
impl WeightInfo for () { impl WeightInfo for () {
fn set_tier_profile() -> Weight { fn set_tier_profile() -> Weight {
Weight::from_parts(7_000_000, 0) Weight::from_parts(23_111_000, 0)
.saturating_add(Weight::from_parts(0, 1504)) .saturating_add(Weight::from_parts(0, 1505))
.saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().reads(4_u64))
.saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64))
} }
+89 -71
View File
@@ -8,23 +8,37 @@
// invisible. Los numeros CANONICOS de mainnet salen del banco de referencia // invisible. Los numeros CANONICOS de mainnet salen del banco de referencia
// (Pi 5, governor y aislamiento declarados), no de la maquina de quien compila. // (Pi 5, governor y aislamiento declarados), no de la maquina de quien compila.
// MEDIDO POR LAURHA 🌊 EN EL BANCO DE REFERENCIA, 2026-10-24 17:41-17:46. El perfil es el mismo
// al empezar y al acabar:
// CyberDeckRP1 · Raspberry Pi 5 · Cortex-A76 · kernel 6.18.34+rpt-rpi-2712.
// Núcleo 3 aislado (partición cgroup «isolated» de origin-banco), governor performance a
// 2,4 GHz, CI parada, throttled 0x0, 45-49 °C.
// frame-omni-bencher 0.15.0 · wasm sha256 40cb5a1d…a1cf744 (spec 16, main 3cd1068).
// steps 50 · repeat 20 · taskset -c 3 · 5 PROCESOS por pallet, y se cobra el MÁXIMO de los 5
// (scripts/bench/max-de-n.py): procesos idénticos se separan hasta un 35 % en el base weight.
// Evidencia en la rp1: ~/laurha-work/banco/spec16-20261024-1631 (SHA256SUMS d930c5e1…).
// La Pi es el hardware MÁS LENTO que puede validar la red: sus pesos son el techo honesto. El
// TIEMPO DE EJECUCIÓN sale de 2,5 a 3,9 veces el del Mac M3 Max (~6 veces en los que verifican
// Ed25519). Lo COBRADO sube menos, entre +4 % y +56 %, porque lecturas y escrituras de storage
// (RocksDbWeight) no cambian y pesan más que la ejecución (revisión adversarial, 25-oct).
//! Weights AUTOGENERADOS para `origin_chain_governance` — NO editar a mano. //! Weights AUTOGENERADOS para `origin_chain_governance` — NO editar a mano.
//! //!
//! Regenerar: `scripts/bench/regen-weights.sh` (ver ese script para el //! Regenerar: `scripts/bench/regen-weights.sh` (ver ese script para el
//! procedimiento completo y el hardware al que hay que creerle). //! procedimiento completo y el hardware al que hay que creerle).
//! //!
//! GENERADO POR SUBSTRATE BENCHMARK CLI VERSION 51.0.0 //! GENERADO POR SUBSTRATE BENCHMARK CLI VERSION 51.0.0
//! FECHA: 2026-10-07, STEPS: `50`, REPEAT: `20` //! FECHA: 2026-10-24, STEPS: `50`, REPEAT: `20`
//! HOSTNAME: `MacBookProM3Max.local`, CPU: `<UNKNOWN>` //! HOSTNAME: `CyberDeckRP1`, CPU: `<UNKNOWN>`
//! WASM-EXECUTION: `Compiled`, DB CACHE: 1024 //! WASM-EXECUTION: `Compiled`, DB CACHE: 1024
// Comando ejecutado: // Comando ejecutado:
// frame-omni-bencher // /home/davidherran/.cargo/bin/frame-omni-bencher
// v1 // v1
// benchmark // benchmark
// pallet // pallet
// --runtime // --runtime
// /Users/davidherran/originmetaverse/external/arkhe-origin-chain/target-bench/release/wbuild/origin-chain-runtime/origin_chain_runtime.compact.compressed.wasm // /home/davidherran/charon/bench/origin_chain_runtime_spec16_3cd1068_bench.compact.compressed.wasm
// --genesis-builder-preset // --genesis-builder-preset
// development // development
// --pallet // --pallet
@@ -36,11 +50,11 @@
// --repeat // --repeat
// 20 // 20
// --template // --template
// /Users/davidherran/originmetaverse/external/arkhe-origin-chain/scripts/bench/origin-weights-template.hbs // /home/davidherran/charon/bench/origin-weights-template.hbs
// --header // --header
// /Users/davidherran/originmetaverse/external/arkhe-origin-chain/scripts/bench/HEADER.txt // /home/davidherran/charon/bench/HEADER.txt
// --output // --output
// /Users/davidherran/originmetaverse/external/arkhe-origin-chain/crates/origin-chain-governance/src/weights.rs // /home/davidherran/laurha-work/banco/spec16-20261024-1631/r1/origin_chain_governance.rs
#![cfg_attr(rustfmt, rustfmt_skip)] #![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)] #![allow(unused_parens)]
@@ -51,6 +65,10 @@ use core::marker::PhantomData;
use frame_support::{traits::Get, weights::constants::RocksDbWeight, weights::Weight}; use frame_support::{traits::Get, weights::constants::RocksDbWeight, weights::Weight};
/// Trait de weights para los extrinsics de `origin_chain_governance`. /// Trait de weights para los extrinsics de `origin_chain_governance`.
// MAXIMO DE N = 5 PROCESOS (scripts/bench/max-de-n.py): cada coeficiente
// de tiempo y de proof es el maximo de los N; reads/writes iguales en los N.
// Entradas (sha256[:12]): a8f7fab4ff78 c2b1258176a2 817d1e5288c9 62cc76cc2bd7 af28b446c93f
pub trait WeightInfo { pub trait WeightInfo {
/// Peso de `submit_proposal` — MEDIDO sobre el WASM, no estimado a mano. /// Peso de `submit_proposal` — MEDIDO sobre el WASM, no estimado a mano.
fn submit_proposal() -> Weight; fn submit_proposal() -> Weight;
@@ -107,10 +125,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Proof: `Governance::ProposalBond` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `MaxEncodedLen`) /// Proof: `Governance::ProposalBond` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `MaxEncodedLen`)
fn submit_proposal() -> Weight { fn submit_proposal() -> Weight {
// Proof size en bytes: // Proof size en bytes:
// Medido: `107` // Medido: `108`
// Estimado: `3722` // Estimado: `3722`
// Tiempo minimo de ejecucion: 44_000_000 picosegundos. // Tiempo minimo de ejecucion: 116_074_000 picosegundos.
Weight::from_parts(45_000_000, 0) Weight::from_parts(122_075_000, 0)
.saturating_add(Weight::from_parts(0, 3722)) .saturating_add(Weight::from_parts(0, 3722))
.saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().reads(7_u64))
.saturating_add(T::DbWeight::get().writes(5_u64)) .saturating_add(T::DbWeight::get().writes(5_u64))
@@ -137,10 +155,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
fn cast_vote() -> Weight { fn cast_vote() -> Weight {
// Proof size en bytes: // Proof size en bytes:
// Medido: `2320` // Medido: `2321`
// Estimado: `5338` // Estimado: `5338`
// Tiempo minimo de ejecucion: 38_000_000 picosegundos. // Tiempo minimo de ejecucion: 103_445_000 picosegundos.
Weight::from_parts(42_000_000, 0) Weight::from_parts(127_723_000, 0)
.saturating_add(Weight::from_parts(0, 5338)) .saturating_add(Weight::from_parts(0, 5338))
.saturating_add(T::DbWeight::get().reads(10_u64)) .saturating_add(T::DbWeight::get().reads(10_u64))
.saturating_add(T::DbWeight::get().writes(6_u64)) .saturating_add(T::DbWeight::get().writes(6_u64))
@@ -163,10 +181,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
fn finalize_proposal() -> Weight { fn finalize_proposal() -> Weight {
// Proof size en bytes: // Proof size en bytes:
// Medido: `614` // Medido: `615`
// Estimado: `6196` // Estimado: `6196`
// Tiempo minimo de ejecucion: 52_000_000 picosegundos. // Tiempo minimo de ejecucion: 132_890_000 picosegundos.
Weight::from_parts(59_000_000, 0) Weight::from_parts(146_594_000, 0)
.saturating_add(Weight::from_parts(0, 6196)) .saturating_add(Weight::from_parts(0, 6196))
.saturating_add(T::DbWeight::get().reads(9_u64)) .saturating_add(T::DbWeight::get().reads(9_u64))
.saturating_add(T::DbWeight::get().writes(6_u64)) .saturating_add(T::DbWeight::get().writes(6_u64))
@@ -185,10 +203,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
fn add_council_member() -> Weight { fn add_council_member() -> Weight {
// Proof size en bytes: // Proof size en bytes:
// Medido: `25` // Medido: `26`
// Estimado: `3554` // Estimado: `3554`
// Tiempo minimo de ejecucion: 10_000_000 picosegundos. // Tiempo minimo de ejecucion: 30_759_000 picosegundos.
Weight::from_parts(10_000_000, 0) Weight::from_parts(39_278_000, 0)
.saturating_add(Weight::from_parts(0, 3554)) .saturating_add(Weight::from_parts(0, 3554))
.saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().reads(6_u64))
.saturating_add(T::DbWeight::get().writes(4_u64)) .saturating_add(T::DbWeight::get().writes(4_u64))
@@ -207,10 +225,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
fn remove_council_member() -> Weight { fn remove_council_member() -> Weight {
// Proof size en bytes: // Proof size en bytes:
// Medido: `153` // Medido: `154`
// Estimado: `3554` // Estimado: `3554`
// Tiempo minimo de ejecucion: 11_000_000 picosegundos. // Tiempo minimo de ejecucion: 33_907_000 picosegundos.
Weight::from_parts(12_000_000, 0) Weight::from_parts(46_556_000, 0)
.saturating_add(Weight::from_parts(0, 3554)) .saturating_add(Weight::from_parts(0, 3554))
.saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().reads(6_u64))
.saturating_add(T::DbWeight::get().writes(4_u64)) .saturating_add(T::DbWeight::get().writes(4_u64))
@@ -247,10 +265,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Proof: `Governance::VetoCount` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) /// Proof: `Governance::VetoCount` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
fn veto_proposal() -> Weight { fn veto_proposal() -> Weight {
// Proof size en bytes: // Proof size en bytes:
// Medido: `1440` // Medido: `1441`
// Estimado: `16416` // Estimado: `16416`
// Tiempo minimo de ejecucion: 91_000_000 picosegundos. // Tiempo minimo de ejecucion: 250_076_000 picosegundos.
Weight::from_parts(95_000_000, 0) Weight::from_parts(266_779_000, 0)
.saturating_add(Weight::from_parts(0, 16416)) .saturating_add(Weight::from_parts(0, 16416))
.saturating_add(T::DbWeight::get().reads(21_u64)) .saturating_add(T::DbWeight::get().reads(21_u64))
.saturating_add(T::DbWeight::get().writes(11_u64)) .saturating_add(T::DbWeight::get().writes(11_u64))
@@ -267,10 +285,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
fn mark_as_advisor() -> Weight { fn mark_as_advisor() -> Weight {
// Proof size en bytes: // Proof size en bytes:
// Medido: `25` // Medido: `26`
// Estimado: `3513` // Estimado: `3513`
// Tiempo minimo de ejecucion: 8_000_000 picosegundos. // Tiempo minimo de ejecucion: 26_852_000 picosegundos.
Weight::from_parts(9_000_000, 0) Weight::from_parts(28_186_000, 0)
.saturating_add(Weight::from_parts(0, 3513)) .saturating_add(Weight::from_parts(0, 3513))
.saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().reads(5_u64))
.saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64))
@@ -287,10 +305,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
fn unmark_as_advisor() -> Weight { fn unmark_as_advisor() -> Weight {
// Proof size en bytes: // Proof size en bytes:
// Medido: `98` // Medido: `99`
// Estimado: `3513` // Estimado: `3513`
// Tiempo minimo de ejecucion: 10_000_000 picosegundos. // Tiempo minimo de ejecucion: 30_686_000 picosegundos.
Weight::from_parts(10_000_000, 0) Weight::from_parts(34_333_000, 0)
.saturating_add(Weight::from_parts(0, 3513)) .saturating_add(Weight::from_parts(0, 3513))
.saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().reads(5_u64))
.saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64))
@@ -325,10 +343,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Proof: `Governance::OverrideStakeTotal` (`max_values`: None, `max_size`: Some(64), added: 2539, mode: `MaxEncodedLen`) /// Proof: `Governance::OverrideStakeTotal` (`max_values`: None, `max_size`: Some(64), added: 2539, mode: `MaxEncodedLen`)
fn override_council_veto() -> Weight { fn override_council_veto() -> Weight {
// Proof size en bytes: // Proof size en bytes:
// Medido: `2468` // Medido: `2469`
// Estimado: `5338` // Estimado: `5338`
// Tiempo minimo de ejecucion: 47_000_000 picosegundos. // Tiempo minimo de ejecucion: 128_353_000 picosegundos.
Weight::from_parts(49_000_000, 0) Weight::from_parts(131_927_000, 0)
.saturating_add(Weight::from_parts(0, 5338)) .saturating_add(Weight::from_parts(0, 5338))
.saturating_add(T::DbWeight::get().reads(14_u64)) .saturating_add(T::DbWeight::get().reads(14_u64))
.saturating_add(T::DbWeight::get().writes(6_u64)) .saturating_add(T::DbWeight::get().writes(6_u64))
@@ -357,10 +375,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Proof: `Governance::ProposalBond` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `MaxEncodedLen`) /// Proof: `Governance::ProposalBond` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `MaxEncodedLen`)
fn submit_emergency_proposal() -> Weight { fn submit_emergency_proposal() -> Weight {
// Proof size en bytes: // Proof size en bytes:
// Medido: `353` // Medido: `354`
// Estimado: `6132` // Estimado: `6132`
// Tiempo minimo de ejecucion: 58_000_000 picosegundos. // Tiempo minimo de ejecucion: 156_797_000 picosegundos.
Weight::from_parts(60_000_000, 0) Weight::from_parts(177_131_000, 0)
.saturating_add(Weight::from_parts(0, 6132)) .saturating_add(Weight::from_parts(0, 6132))
.saturating_add(T::DbWeight::get().reads(11_u64)) .saturating_add(T::DbWeight::get().reads(11_u64))
.saturating_add(T::DbWeight::get().writes(6_u64)) .saturating_add(T::DbWeight::get().writes(6_u64))
@@ -383,10 +401,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
fn treasury_disbursement() -> Weight { fn treasury_disbursement() -> Weight {
// Proof size en bytes: // Proof size en bytes:
// Medido: `494` // Medido: `495`
// Estimado: `6196` // Estimado: `6196`
// Tiempo minimo de ejecucion: 48_000_000 picosegundos. // Tiempo minimo de ejecucion: 126_964_000 picosegundos.
Weight::from_parts(49_000_000, 0) Weight::from_parts(138_038_000, 0)
.saturating_add(Weight::from_parts(0, 6196)) .saturating_add(Weight::from_parts(0, 6196))
.saturating_add(T::DbWeight::get().reads(9_u64)) .saturating_add(T::DbWeight::get().reads(9_u64))
.saturating_add(T::DbWeight::get().writes(5_u64)) .saturating_add(T::DbWeight::get().writes(5_u64))
@@ -405,10 +423,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
fn treasury_deposit() -> Weight { fn treasury_deposit() -> Weight {
// Proof size en bytes: // Proof size en bytes:
// Medido: `101` // Medido: `102`
// Estimado: `3593` // Estimado: `3593`
// Tiempo minimo de ejecucion: 37_000_000 picosegundos. // Tiempo minimo de ejecucion: 95_908_000 picosegundos.
Weight::from_parts(38_000_000, 0) Weight::from_parts(99_778_000, 0)
.saturating_add(Weight::from_parts(0, 3593)) .saturating_add(Weight::from_parts(0, 3593))
.saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().reads(6_u64))
.saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64))
@@ -429,10 +447,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
fn endorse_emergency_proposal() -> Weight { fn endorse_emergency_proposal() -> Weight {
// Proof size en bytes: // Proof size en bytes:
// Medido: `153` // Medido: `154`
// Estimado: `6132` // Estimado: `6132`
// Tiempo minimo de ejecucion: 19_000_000 picosegundos. // Tiempo minimo de ejecucion: 55_537_000 picosegundos.
Weight::from_parts(20_000_000, 0) Weight::from_parts(67_686_000, 0)
.saturating_add(Weight::from_parts(0, 6132)) .saturating_add(Weight::from_parts(0, 6132))
.saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().reads(8_u64))
.saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64))
@@ -455,10 +473,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
fn unlock_vote_funds() -> Weight { fn unlock_vote_funds() -> Weight {
// Proof size en bytes: // Proof size en bytes:
// Medido: `2197` // Medido: `2198`
// Estimado: `5338` // Estimado: `5338`
// Tiempo minimo de ejecucion: 29_000_000 picosegundos. // Tiempo minimo de ejecucion: 81_593_000 picosegundos.
Weight::from_parts(30_000_000, 0) Weight::from_parts(84_315_000, 0)
.saturating_add(Weight::from_parts(0, 5338)) .saturating_add(Weight::from_parts(0, 5338))
.saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().reads(8_u64))
.saturating_add(T::DbWeight::get().writes(5_u64)) .saturating_add(T::DbWeight::get().writes(5_u64))
@@ -493,10 +511,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Proof: `Governance::UpholdStakeTotal` (`max_values`: None, `max_size`: Some(64), added: 2539, mode: `MaxEncodedLen`) /// Proof: `Governance::UpholdStakeTotal` (`max_values`: None, `max_size`: Some(64), added: 2539, mode: `MaxEncodedLen`)
fn uphold_council_veto() -> Weight { fn uphold_council_veto() -> Weight {
// Proof size en bytes: // Proof size en bytes:
// Medido: `2468` // Medido: `2469`
// Estimado: `5338` // Estimado: `5338`
// Tiempo minimo de ejecucion: 47_000_000 picosegundos. // Tiempo minimo de ejecucion: 128_686_000 picosegundos.
Weight::from_parts(50_000_000, 0) Weight::from_parts(153_834_000, 0)
.saturating_add(Weight::from_parts(0, 5338)) .saturating_add(Weight::from_parts(0, 5338))
.saturating_add(T::DbWeight::get().reads(14_u64)) .saturating_add(T::DbWeight::get().reads(14_u64))
.saturating_add(T::DbWeight::get().writes(6_u64)) .saturating_add(T::DbWeight::get().writes(6_u64))
@@ -523,10 +541,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
fn finalize_override() -> Weight { fn finalize_override() -> Weight {
// Proof size en bytes: // Proof size en bytes:
// Medido: `636` // Medido: `637`
// Estimado: `3722` // Estimado: `3722`
// Tiempo minimo de ejecucion: 25_000_000 picosegundos. // Tiempo minimo de ejecucion: 73_297_000 picosegundos.
Weight::from_parts(26_000_000, 0) Weight::from_parts(78_037_000, 0)
.saturating_add(Weight::from_parts(0, 3722)) .saturating_add(Weight::from_parts(0, 3722))
.saturating_add(T::DbWeight::get().reads(10_u64)) .saturating_add(T::DbWeight::get().reads(10_u64))
.saturating_add(T::DbWeight::get().writes(5_u64)) .saturating_add(T::DbWeight::get().writes(5_u64))
@@ -536,97 +554,97 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Impl para mocks y tests — `RocksDbWeight` directo, sin necesitar `T`. /// Impl para mocks y tests — `RocksDbWeight` directo, sin necesitar `T`.
impl WeightInfo for () { impl WeightInfo for () {
fn submit_proposal() -> Weight { fn submit_proposal() -> Weight {
Weight::from_parts(45_000_000, 0) Weight::from_parts(122_075_000, 0)
.saturating_add(Weight::from_parts(0, 3722)) .saturating_add(Weight::from_parts(0, 3722))
.saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().reads(7_u64))
.saturating_add(RocksDbWeight::get().writes(5_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64))
} }
fn cast_vote() -> Weight { fn cast_vote() -> Weight {
Weight::from_parts(42_000_000, 0) Weight::from_parts(127_723_000, 0)
.saturating_add(Weight::from_parts(0, 5338)) .saturating_add(Weight::from_parts(0, 5338))
.saturating_add(RocksDbWeight::get().reads(10_u64)) .saturating_add(RocksDbWeight::get().reads(10_u64))
.saturating_add(RocksDbWeight::get().writes(6_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64))
} }
fn finalize_proposal() -> Weight { fn finalize_proposal() -> Weight {
Weight::from_parts(59_000_000, 0) Weight::from_parts(146_594_000, 0)
.saturating_add(Weight::from_parts(0, 6196)) .saturating_add(Weight::from_parts(0, 6196))
.saturating_add(RocksDbWeight::get().reads(9_u64)) .saturating_add(RocksDbWeight::get().reads(9_u64))
.saturating_add(RocksDbWeight::get().writes(6_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64))
} }
fn add_council_member() -> Weight { fn add_council_member() -> Weight {
Weight::from_parts(10_000_000, 0) Weight::from_parts(39_278_000, 0)
.saturating_add(Weight::from_parts(0, 3554)) .saturating_add(Weight::from_parts(0, 3554))
.saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().reads(6_u64))
.saturating_add(RocksDbWeight::get().writes(4_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64))
} }
fn remove_council_member() -> Weight { fn remove_council_member() -> Weight {
Weight::from_parts(12_000_000, 0) Weight::from_parts(46_556_000, 0)
.saturating_add(Weight::from_parts(0, 3554)) .saturating_add(Weight::from_parts(0, 3554))
.saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().reads(6_u64))
.saturating_add(RocksDbWeight::get().writes(4_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64))
} }
fn veto_proposal() -> Weight { fn veto_proposal() -> Weight {
Weight::from_parts(95_000_000, 0) Weight::from_parts(266_779_000, 0)
.saturating_add(Weight::from_parts(0, 16416)) .saturating_add(Weight::from_parts(0, 16416))
.saturating_add(RocksDbWeight::get().reads(21_u64)) .saturating_add(RocksDbWeight::get().reads(21_u64))
.saturating_add(RocksDbWeight::get().writes(11_u64)) .saturating_add(RocksDbWeight::get().writes(11_u64))
} }
fn mark_as_advisor() -> Weight { fn mark_as_advisor() -> Weight {
Weight::from_parts(9_000_000, 0) Weight::from_parts(28_186_000, 0)
.saturating_add(Weight::from_parts(0, 3513)) .saturating_add(Weight::from_parts(0, 3513))
.saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().reads(5_u64))
.saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64))
} }
fn unmark_as_advisor() -> Weight { fn unmark_as_advisor() -> Weight {
Weight::from_parts(10_000_000, 0) Weight::from_parts(34_333_000, 0)
.saturating_add(Weight::from_parts(0, 3513)) .saturating_add(Weight::from_parts(0, 3513))
.saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().reads(5_u64))
.saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64))
} }
fn override_council_veto() -> Weight { fn override_council_veto() -> Weight {
Weight::from_parts(49_000_000, 0) Weight::from_parts(131_927_000, 0)
.saturating_add(Weight::from_parts(0, 5338)) .saturating_add(Weight::from_parts(0, 5338))
.saturating_add(RocksDbWeight::get().reads(14_u64)) .saturating_add(RocksDbWeight::get().reads(14_u64))
.saturating_add(RocksDbWeight::get().writes(6_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64))
} }
fn submit_emergency_proposal() -> Weight { fn submit_emergency_proposal() -> Weight {
Weight::from_parts(60_000_000, 0) Weight::from_parts(177_131_000, 0)
.saturating_add(Weight::from_parts(0, 6132)) .saturating_add(Weight::from_parts(0, 6132))
.saturating_add(RocksDbWeight::get().reads(11_u64)) .saturating_add(RocksDbWeight::get().reads(11_u64))
.saturating_add(RocksDbWeight::get().writes(6_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64))
} }
fn treasury_disbursement() -> Weight { fn treasury_disbursement() -> Weight {
Weight::from_parts(49_000_000, 0) Weight::from_parts(138_038_000, 0)
.saturating_add(Weight::from_parts(0, 6196)) .saturating_add(Weight::from_parts(0, 6196))
.saturating_add(RocksDbWeight::get().reads(9_u64)) .saturating_add(RocksDbWeight::get().reads(9_u64))
.saturating_add(RocksDbWeight::get().writes(5_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64))
} }
fn treasury_deposit() -> Weight { fn treasury_deposit() -> Weight {
Weight::from_parts(38_000_000, 0) Weight::from_parts(99_778_000, 0)
.saturating_add(Weight::from_parts(0, 3593)) .saturating_add(Weight::from_parts(0, 3593))
.saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().reads(6_u64))
.saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64))
} }
fn endorse_emergency_proposal() -> Weight { fn endorse_emergency_proposal() -> Weight {
Weight::from_parts(20_000_000, 0) Weight::from_parts(67_686_000, 0)
.saturating_add(Weight::from_parts(0, 6132)) .saturating_add(Weight::from_parts(0, 6132))
.saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().reads(8_u64))
.saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64))
} }
fn unlock_vote_funds() -> Weight { fn unlock_vote_funds() -> Weight {
Weight::from_parts(30_000_000, 0) Weight::from_parts(84_315_000, 0)
.saturating_add(Weight::from_parts(0, 5338)) .saturating_add(Weight::from_parts(0, 5338))
.saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().reads(8_u64))
.saturating_add(RocksDbWeight::get().writes(5_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64))
} }
fn uphold_council_veto() -> Weight { fn uphold_council_veto() -> Weight {
Weight::from_parts(50_000_000, 0) Weight::from_parts(153_834_000, 0)
.saturating_add(Weight::from_parts(0, 5338)) .saturating_add(Weight::from_parts(0, 5338))
.saturating_add(RocksDbWeight::get().reads(14_u64)) .saturating_add(RocksDbWeight::get().reads(14_u64))
.saturating_add(RocksDbWeight::get().writes(6_u64)) .saturating_add(RocksDbWeight::get().writes(6_u64))
} }
fn finalize_override() -> Weight { fn finalize_override() -> Weight {
Weight::from_parts(26_000_000, 0) Weight::from_parts(78_037_000, 0)
.saturating_add(Weight::from_parts(0, 3722)) .saturating_add(Weight::from_parts(0, 3722))
.saturating_add(RocksDbWeight::get().reads(10_u64)) .saturating_add(RocksDbWeight::get().reads(10_u64))
.saturating_add(RocksDbWeight::get().writes(5_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64))
+43 -25
View File
@@ -8,23 +8,37 @@
// invisible. Los numeros CANONICOS de mainnet salen del banco de referencia // invisible. Los numeros CANONICOS de mainnet salen del banco de referencia
// (Pi 5, governor y aislamiento declarados), no de la maquina de quien compila. // (Pi 5, governor y aislamiento declarados), no de la maquina de quien compila.
// MEDIDO POR LAURHA 🌊 EN EL BANCO DE REFERENCIA, 2026-10-24 17:41-17:46. El perfil es el mismo
// al empezar y al acabar:
// CyberDeckRP1 · Raspberry Pi 5 · Cortex-A76 · kernel 6.18.34+rpt-rpi-2712.
// Núcleo 3 aislado (partición cgroup «isolated» de origin-banco), governor performance a
// 2,4 GHz, CI parada, throttled 0x0, 45-49 °C.
// frame-omni-bencher 0.15.0 · wasm sha256 40cb5a1d…a1cf744 (spec 16, main 3cd1068).
// steps 50 · repeat 20 · taskset -c 3 · 5 PROCESOS por pallet, y se cobra el MÁXIMO de los 5
// (scripts/bench/max-de-n.py): procesos idénticos se separan hasta un 35 % en el base weight.
// Evidencia en la rp1: ~/laurha-work/banco/spec16-20261024-1631 (SHA256SUMS d930c5e1…).
// La Pi es el hardware MÁS LENTO que puede validar la red: sus pesos son el techo honesto. El
// TIEMPO DE EJECUCIÓN sale de 2,5 a 3,9 veces el del Mac M3 Max (~6 veces en los que verifican
// Ed25519). Lo COBRADO sube menos, entre +4 % y +56 %, porque lecturas y escrituras de storage
// (RocksDbWeight) no cambian y pesan más que la ejecución (revisión adversarial, 25-oct).
//! Weights AUTOGENERADOS para `origin_chain_provenance` — NO editar a mano. //! Weights AUTOGENERADOS para `origin_chain_provenance` — NO editar a mano.
//! //!
//! Regenerar: `scripts/bench/regen-weights.sh` (ver ese script para el //! Regenerar: `scripts/bench/regen-weights.sh` (ver ese script para el
//! procedimiento completo y el hardware al que hay que creerle). //! procedimiento completo y el hardware al que hay que creerle).
//! //!
//! GENERADO POR SUBSTRATE BENCHMARK CLI VERSION 51.0.0 //! GENERADO POR SUBSTRATE BENCHMARK CLI VERSION 51.0.0
//! FECHA: 2026-09-09, STEPS: `50`, REPEAT: `20` //! FECHA: 2026-10-24, STEPS: `50`, REPEAT: `20`
//! HOSTNAME: `MacBookProM3Max.local`, CPU: `<UNKNOWN>` //! HOSTNAME: `CyberDeckRP1`, CPU: `<UNKNOWN>`
//! WASM-EXECUTION: `Compiled`, DB CACHE: 1024 //! WASM-EXECUTION: `Compiled`, DB CACHE: 1024
// Comando ejecutado: // Comando ejecutado:
// /Users/davidherran/.cargo/bin/frame-omni-bencher // /home/davidherran/.cargo/bin/frame-omni-bencher
// v1 // v1
// benchmark // benchmark
// pallet // pallet
// --runtime // --runtime
// /Users/davidherran/originmetaverse/artifacts/origin-chain/origin_chain_runtime_rv12_bench.compact.compressed.wasm // /home/davidherran/charon/bench/origin_chain_runtime_spec16_3cd1068_bench.compact.compressed.wasm
// --genesis-builder-preset // --genesis-builder-preset
// development // development
// --pallet // --pallet
@@ -36,11 +50,11 @@
// --repeat // --repeat
// 20 // 20
// --template // --template
// /Users/davidherran/originmetaverse/external/arkhe-origin-chain/scripts/bench/origin-weights-template.hbs // /home/davidherran/charon/bench/origin-weights-template.hbs
// --header // --header
// /Users/davidherran/originmetaverse/external/arkhe-origin-chain/scripts/bench/HEADER.txt // /home/davidherran/charon/bench/HEADER.txt
// --output // --output
// /Users/davidherran/originmetaverse/external/arkhe-origin-chain/crates/origin-chain-provenance/src/weights.rs // /home/davidherran/laurha-work/banco/spec16-20261024-1631/r1/origin_chain_provenance.rs
#![cfg_attr(rustfmt, rustfmt_skip)] #![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)] #![allow(unused_parens)]
@@ -51,6 +65,10 @@ use core::marker::PhantomData;
use frame_support::{traits::Get, weights::constants::RocksDbWeight, weights::Weight}; use frame_support::{traits::Get, weights::constants::RocksDbWeight, weights::Weight};
/// Trait de weights para los extrinsics de `origin_chain_provenance`. /// Trait de weights para los extrinsics de `origin_chain_provenance`.
// MAXIMO DE N = 5 PROCESOS (scripts/bench/max-de-n.py): cada coeficiente
// de tiempo y de proof es el maximo de los N; reads/writes iguales en los N.
// Entradas (sha256[:12]): f9073e1d0c4a 10b95d00a036 5aa8e0aaf057 5c50e916300f 8f55f561f51a
pub trait WeightInfo { pub trait WeightInfo {
/// Peso de `attest_asset` — MEDIDO sobre el WASM, no estimado a mano. /// Peso de `attest_asset` — MEDIDO sobre el WASM, no estimado a mano.
fn attest_asset() -> Weight; fn attest_asset() -> Weight;
@@ -79,10 +97,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
fn attest_asset() -> Weight { fn attest_asset() -> Weight {
// Proof size en bytes: // Proof size en bytes:
// Medido: `153` // Medido: `154`
// Estimado: `3970` // Estimado: `3970`
// Tiempo minimo de ejecucion: 43_000_000 picosegundos. // Tiempo minimo de ejecucion: 244_594_000 picosegundos.
Weight::from_parts(44_000_000, 0) Weight::from_parts(246_613_000, 0)
.saturating_add(Weight::from_parts(0, 3970)) .saturating_add(Weight::from_parts(0, 3970))
.saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().reads(7_u64))
.saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64))
@@ -99,11 +117,11 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Proof: `Provenance::AuthorizedValidators` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) /// Proof: `Provenance::AuthorizedValidators` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
fn register_validator() -> Weight { fn register_validator() -> Weight {
// Proof size en bytes: // Proof size en bytes:
// Medido: `19` // Medido: `20`
// Estimado: `1504` // Estimado: `1505`
// Tiempo minimo de ejecucion: 6_000_000 picosegundos. // Tiempo minimo de ejecucion: 21_333_000 picosegundos.
Weight::from_parts(7_000_000, 0) Weight::from_parts(22_482_000, 0)
.saturating_add(Weight::from_parts(0, 1504)) .saturating_add(Weight::from_parts(0, 1505))
.saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().reads(4_u64))
.saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64))
} }
@@ -119,11 +137,11 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Proof: `Provenance::AuthorizedValidators` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) /// Proof: `Provenance::AuthorizedValidators` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
fn revoke_validator() -> Weight { fn revoke_validator() -> Weight {
// Proof size en bytes: // Proof size en bytes:
// Medido: `19` // Medido: `20`
// Estimado: `1504` // Estimado: `1505`
// Tiempo minimo de ejecucion: 6_000_000 picosegundos. // Tiempo minimo de ejecucion: 21_000_000 picosegundos.
Weight::from_parts(7_000_000, 0) Weight::from_parts(22_518_000, 0)
.saturating_add(Weight::from_parts(0, 1504)) .saturating_add(Weight::from_parts(0, 1505))
.saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().reads(4_u64))
.saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64))
} }
@@ -132,20 +150,20 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Impl para mocks y tests — `RocksDbWeight` directo, sin necesitar `T`. /// Impl para mocks y tests — `RocksDbWeight` directo, sin necesitar `T`.
impl WeightInfo for () { impl WeightInfo for () {
fn attest_asset() -> Weight { fn attest_asset() -> Weight {
Weight::from_parts(44_000_000, 0) Weight::from_parts(246_613_000, 0)
.saturating_add(Weight::from_parts(0, 3970)) .saturating_add(Weight::from_parts(0, 3970))
.saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().reads(7_u64))
.saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64))
} }
fn register_validator() -> Weight { fn register_validator() -> Weight {
Weight::from_parts(7_000_000, 0) Weight::from_parts(22_482_000, 0)
.saturating_add(Weight::from_parts(0, 1504)) .saturating_add(Weight::from_parts(0, 1505))
.saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().reads(4_u64))
.saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64))
} }
fn revoke_validator() -> Weight { fn revoke_validator() -> Weight {
Weight::from_parts(7_000_000, 0) Weight::from_parts(22_518_000, 0)
.saturating_add(Weight::from_parts(0, 1504)) .saturating_add(Weight::from_parts(0, 1505))
.saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().reads(4_u64))
.saturating_add(RocksDbWeight::get().writes(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64))
} }
+8 -2
View File
@@ -367,6 +367,12 @@ pub const IMPL_NAME: &str = borrowed_str(&VERSION.impl_name);
/// privada, en rotación Y en registro. Ahora `is_strong_ed25519_key` las rechaza. /// privada, en rotación Y en registro. Ahora `is_strong_ed25519_key` las rechaza.
/// - **El registro no consultaba `KeyToDid`**: una llave rotada fundaba otro DID. /// - **El registro no consultaba `KeyToDid`**: una llave rotada fundaba otro DID.
/// - **Replay entre cadenas**: el mensaje de rotación no llevaba génesis. Ahora sí. /// - **Replay entre cadenas**: el mensaje de rotación no llevaba génesis. Ahora sí.
///
/// **v17 (2026-10-25): los pesos se cobran como en la Pi 5.** Son los 23 weights certificados
/// por Laurha en el banco de referencia (el máximo de 5 procesos por pallet; ver la cabecera
/// de cada `weights.rs`). Sustituyen a los interinos medidos en el Mac. No cambia ninguna
/// lógica ni ningún storage, sólo lo que cuesta cada extrinsic. Es el primer upgrade que se
/// aplica en vivo a la testnet de la casa (rp1), por `set_code`.
pub const RUNTIME_VERSION: u32 = VERSION.spec_version; pub const RUNTIME_VERSION: u32 = VERSION.spec_version;
/// Canonical authoring version per Substrate semver canonical. /// Canonical authoring version per Substrate semver canonical.
@@ -1019,7 +1025,7 @@ pub const VERSION: sp_version::RuntimeVersion = sp_version::RuntimeVersion {
spec_name: alloc::borrow::Cow::Borrowed("origin-chain"), spec_name: alloc::borrow::Cow::Borrowed("origin-chain"),
impl_name: alloc::borrow::Cow::Borrowed("origin-chain-charon"), impl_name: alloc::borrow::Cow::Borrowed("origin-chain-charon"),
authoring_version: 1, authoring_version: 1,
spec_version: 16, spec_version: 17,
impl_version: 1, impl_version: 1,
apis: RUNTIME_API_VERSIONS, apis: RUNTIME_API_VERSIONS,
transaction_version: 1, transaction_version: 1,
@@ -1180,7 +1186,7 @@ mod tests {
/// mismo commit en que la version subio a 12. /// mismo commit en que la version subio a 12.
#[test] #[test]
fn spec_version_vigente_y_transaction_version_intacta() { fn spec_version_vigente_y_transaction_version_intacta() {
assert_eq!(RUNTIME_VERSION, 16); assert_eq!(RUNTIME_VERSION, 17);
assert_eq!(TRANSACTION_VERSION, 1); assert_eq!(TRANSACTION_VERSION, 1);
} }
+118
View File
@@ -0,0 +1,118 @@
#!/usr/bin/env python3
"""Aplica un runtime nuevo a una cadena VIVA por sudo(system.set_code), firmando como un wallet,
y comprueba que la cadena sigue sana. Es el upgrade de verdad, no el simulacro de
simulacro_set_code.py (ese usa un runtime marcado y la misma spec como control negativo).
ORIGIN_RPC=http://127.0.0.1:9944 python3 scripts/e2e/upgrade_en_vivo.py <runtime.wasm> <spec_esperada>
Comprueba, en este orden:
1. el sudo(set_code) entra y su bloque trae CodeUpdated + Sudid Ok;
2. el RPC anuncia la spec esperada y LastRuntimeUpgrade sube;
3. un remark firmado con la spec NUEVA entra (ExtrinsicSuccess) y uno con la VIEJA es «bad
signature»;
4. la finalidad avanza más allá del bloque del upgrade.
Se detiene en el primer fallo, con código de salida 1.
"""
import json, os, subprocess, sys, time, urllib.request
RPC = os.environ.get("ORIGIN_RPC", "http://127.0.0.1:9944")
RAIZ = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
TOOL = os.environ.get("ORIGIN_FIRMADOR", os.path.join(RAIZ, "target/release/examples/firmar_como_wallet"))
ALICE = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY"
EVENTS = "0x26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7"
LAST_UPGRADE = "0x26aa394eea5630e07c48ae0c9558cef7f9cce9c888469bb1a0dceaa129672ef8"
def rpc(m, p=None):
req = urllib.request.Request(RPC, json.dumps({"id": 1, "jsonrpc": "2.0", "method": m, "params": p or []}).encode(),
{"Content-Type": "application/json"})
with urllib.request.urlopen(req, timeout=120) as r:
return json.load(r)
def best():
return int(rpc("chain_getHeader")["result"]["number"], 16)
def finalizado():
return int(rpc("chain_getHeader", [rpc("chain_getFinalizedHead")["result"]])["result"]["number"], 16)
def firmar(llamada, nonce, genesis, v):
return subprocess.run([TOOL, "firmar", llamada, str(nonce), genesis, str(v["specVersion"]), str(v["transactionVersion"])],
capture_output=True, text=True, check=True).stdout.strip()
def eventos(n):
h = rpc("chain_getBlockHash", [n])["result"]
ev = rpc("state_getStorage", [EVENTS, h])["result"]
return subprocess.run([TOOL, "eventos", ev], capture_output=True, text=True).stdout if ev else ""
def buscar(n0, texto, espera=60):
t0 = time.time()
while time.time() - t0 < espera:
for n in range(n0 + 1, best() + 1):
e = eventos(n)
if texto in e:
return n, e
time.sleep(2)
return None, ""
def falla(msg):
print("❌", msg)
sys.exit(1)
def main(wasm, spec_esperada):
genesis = rpc("chain_getBlockHash", [0])["result"]
v = rpc("state_getRuntimeVersion")["result"]
print(f"antes: spec {v['specVersion']} · best #{best()} · finalizado #{finalizado()} · LastRuntimeUpgrade {rpc('state_getStorage', [LAST_UPGRADE])['result']}")
if v["specVersion"] >= spec_esperada:
falla(f"la cadena ya va en spec {v['specVersion']}")
n0 = best()
nonce = rpc("system_accountNextIndex", [ALICE])["result"]
r = rpc("author_submitExtrinsic", [firmar(f"set_code:{wasm}", nonce, genesis, v)])
if "error" in r:
falla(f"set_code rechazado: {r['error']}")
n, e = buscar(n0, "CodeUpdated")
if not n or "Sudid { sudo_result: Ok" not in e:
falla("no apareció CodeUpdated + Sudid Ok\n" + e)
print(f"1 ✅ bloque #{n}: CodeUpdated + Sudid Ok")
while best() < n + 1:
time.sleep(1)
v2 = rpc("state_getRuntimeVersion")["result"]
lru = rpc("state_getStorage", [LAST_UPGRADE])["result"]
if v2["specVersion"] != spec_esperada:
falla(f"el RPC anuncia spec {v2['specVersion']}, no {spec_esperada}")
print(f"2 ✅ spec {v2['specVersion']} · LastRuntimeUpgrade {lru}")
nonce = rpc("system_accountNextIndex", [ALICE])["result"]
viejo = rpc("author_submitExtrinsic", [firmar("remark", nonce, genesis, v)])
if "bad signature" not in json.dumps(viejo):
falla(f"una firma con la spec vieja NO fue rechazada: {viejo}")
m0 = best()
nuevo = rpc("author_submitExtrinsic", [firmar("remark", nonce, genesis, v2)])
if "error" in nuevo:
falla(f"la firma con la spec nueva fue rechazada: {nuevo['error']}")
m, e = buscar(m0, "ExtrinsicSuccess { dispatch_info: DispatchEventInfo { weight: Weight { ref_time", 60)
exitos = [l for l in e.splitlines() if "ExtrinsicSuccess" in l and "Normal" in l]
if not m or not exitos:
falla("el remark con la spec nueva no se incluyó con éxito")
print(f"3 ✅ spec vieja → bad signature · spec nueva → incluido en #{m}: {exitos[0][:110]}")
t0 = time.time()
while finalizado() <= n and time.time() - t0 < 120:
time.sleep(2)
if finalizado() <= n:
falla("la finalidad no pasó del bloque del upgrade en 2 min")
print(f"4 ✅ finalizado #{finalizado()} > bloque del upgrade #{n} · best #{best()}")
if __name__ == "__main__":
if len(sys.argv) != 3:
sys.exit(__doc__)
main(os.path.abspath(sys.argv[1]), int(sys.argv[2]))
+10 -1
View File
@@ -7,6 +7,13 @@
# - nice 10 + ionice best-effort 7: la CI tiene prioridad sobre el nodo. # - nice 10 + ionice best-effort 7: la CI tiene prioridad sobre el nodo.
# - RPC sólo en 127.0.0.1: se entra por túnel SSH. P2P en 30333 para la LAN. # - RPC sólo en 127.0.0.1: se entra por túnel SSH. P2P en 30333 para la LAN.
# #
# Disco y memoria (medido el 2026-10-25, 23 h con los valores por defecto): 430 MB de WAL de
# RocksDB retenidos para 15 MB de datos, y el RSS subiendo de 200 a 340 MB. RocksDB guarda el
# WAL hasta que TODAS las columnas vacían su memtable, y con --db-cache por defecto (1 GiB)
# eso tarda. --db-cache 128 lo acota. El log pasa de 7 líneas por bloque a ~2: se silencian
# txpool, basic-authorship y aura (16 MB/día → unos 3). Va en modo append (>>) para que
# medir.sh pueda rotarlo truncándolo sin dejar huecos.
#
# Cadena: `dev` (Alice, llaves de desarrollo PÚBLICAS). Es la testnet de la casa, no la # Cadena: `dev` (Alice, llaves de desarrollo PÚBLICAS). Es la testnet de la casa, no la
# testnet pública: ningún valor real vive aquí. # testnet pública: ningún valor real vive aquí.
set -euo pipefail set -euo pipefail
@@ -40,7 +47,9 @@ nohup taskset -c 0-2 nice -n 10 ionice -c2 -n7 "$BIN" run \
--port 30333 \ --port 30333 \
--rpc-port 9944 --rpc-methods safe \ --rpc-port 9944 --rpc-methods safe \
--no-telemetry --no-prometheus "${EXTRA[@]}" \ --no-telemetry --no-prometheus "${EXTRA[@]}" \
>"$LOG" 2>&1 & --db-cache 128 \
--log info,txpool=warn,basic-authorship=warn,sc_basic_authorship=warn,aura=warn \
>>"$LOG" 2>&1 &
echo $! >"$PIDF" echo $! >"$PIDF"
ln -sfn "$LOG" "$BASE/logs/actual.log" ln -sfn "$LOG" "$BASE/logs/actual.log"
echo "$(date -Is) arrancado pid $(cat "$PIDF") log $LOG" >>"$BASE/logs/arranques.log" echo "$(date -Is) arrancado pid $(cat "$PIDF") log $LOG" >>"$BASE/logs/arranques.log"
+8
View File
@@ -26,3 +26,11 @@ load1=$(cut -d' ' -f1 /proc/loadavg)
temp=$(awk '{printf "%.1f", $1/1000}' /sys/class/thermal/thermal_zone0/temp) temp=$(awk '{printf "%.1f", $1/1000}' /sys/class/thermal/thermal_zone0/temp)
ci=$(systemctl is-active gitea-runner 2>/dev/null || echo NA) ci=$(systemctl is-active gitea-runner 2>/dev/null || echo NA)
echo "$(date -Is),$best,$fin,$pares,$rss,$cpu,$datos,$load1,$temp,$ci" >>"$CSV" echo "$(date -Is),$best,$fin,$pares,$rss,$cpu,$datos,$load1,$temp,$ci" >>"$CSV"
# Rotación del log del nodo: al pasar de 32 MB se guarda comprimido y se trunca. El nodo
# escribe en modo append, así que sigue al final del fichero truncado, sin huecos.
ACTUAL=$(readlink -f "$BASE/logs/actual.log" 2>/dev/null || true)
if [ -n "$ACTUAL" ] && [ -f "$ACTUAL" ] && [ "$(stat -c %s "$ACTUAL")" -gt $((32 * 1024 * 1024)) ]; then
gzip -c "$ACTUAL" >"$ACTUAL.$(date +%Y%m%d-%H%M).gz" && : >"$ACTUAL"
ls -1t "$ACTUAL".*.gz 2>/dev/null | tail -n +5 | xargs -r rm -f # se quedan los 4 más nuevos
fi