diff --git a/node/cli/src/chain_spec/dev.rs b/node/cli/src/chain_spec/dev.rs index 6a8fa3cd6..4d8b2fd68 100644 --- a/node/cli/src/chain_spec/dev.rs +++ b/node/cli/src/chain_spec/dev.rs @@ -308,6 +308,10 @@ pub fn development_genesis_config( max_instructions_per_programs: INITIAL_MAX_INSTRUCTIONS_PER_PROGRAM, total_signers: TOTAL_SIGNERS, threshold: SIGNER_THRESHOLD, + accepted_mrtd_values: vec![ + BoundedVec::try_from([0; 48].to_vec()).unwrap(), + BoundedVec::try_from([1; 48].to_vec()).unwrap(), + ], ..Default::default() }, "programs": ProgramsConfig { diff --git a/node/cli/src/chain_spec/integration_tests.rs b/node/cli/src/chain_spec/integration_tests.rs index c5dd75816..1c8c833bf 100644 --- a/node/cli/src/chain_spec/integration_tests.rs +++ b/node/cli/src/chain_spec/integration_tests.rs @@ -247,6 +247,10 @@ pub fn integration_tests_genesis_config( max_instructions_per_programs: INITIAL_MAX_INSTRUCTIONS_PER_PROGRAM, total_signers: TOTAL_SIGNERS, threshold: SIGNER_THRESHOLD, + accepted_mrtd_values: vec![ + BoundedVec::try_from([0; 48].to_vec()).unwrap(), + BoundedVec::try_from([1; 48].to_vec()).unwrap(), + ], ..Default::default() }, "programs": ProgramsConfig { diff --git a/node/cli/src/chain_spec/testnet.rs b/node/cli/src/chain_spec/testnet.rs index a3ec871ac..fb5848420 100644 --- a/node/cli/src/chain_spec/testnet.rs +++ b/node/cli/src/chain_spec/testnet.rs @@ -37,7 +37,7 @@ use sc_telemetry::TelemetryEndpoints; use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId; use sp_consensus_babe::AuthorityId as BabeId; use sp_core::{crypto::UncheckedInto, sr25519}; -use sp_runtime::Perbill; +use sp_runtime::{BoundedVec, Perbill}; /// The AccountID of a Threshold Signature server. This is to meant to be registered on-chain. type TssAccountId = sp_runtime::AccountId32; @@ -446,6 +446,10 @@ pub fn testnet_genesis_config( max_instructions_per_programs: INITIAL_MAX_INSTRUCTIONS_PER_PROGRAM, total_signers: TOTAL_SIGNERS, threshold: SIGNER_THRESHOLD, + accepted_mrtd_values: vec![ + BoundedVec::try_from([0; 48].to_vec()).unwrap(), + BoundedVec::try_from([1; 48].to_vec()).unwrap(), + ], ..Default::default() }, "programs": ProgramsConfig { diff --git a/pallets/attestation/Cargo.toml b/pallets/attestation/Cargo.toml index 0b3b25065..6149b527c 100644 --- a/pallets/attestation/Cargo.toml +++ b/pallets/attestation/Cargo.toml @@ -22,6 +22,7 @@ frame-benchmarking={ version="29.0.0", default-features=false, optional=true } sp-std ={ version="14.0.0", default-features=false } pallet-session ={ version="29.0.0", default-features=false, optional=true } +pallet-parameters={ version="0.2.0", path="../parameters", default-features=false } entropy-shared={ version="0.2.0", path="../../crates/shared", features=[ "wasm-no-std", ], default-features=false } @@ -37,7 +38,6 @@ pallet-timestamp ={ version="28.0.0", default-features=false } sp-npos-elections ={ version="27.0.0", default-features=false } frame-election-provider-support={ version="29.0.0", default-features=false } pallet-staking-reward-curve ={ version="11.0.0" } -pallet-parameters ={ version="0.2.0", path="../parameters", default-features=false } tdx-quote ={ git="https://github.com/entropyxyz/tdx-quote", features=["mock"] } rand_core ="0.6.4" @@ -51,6 +51,7 @@ std=[ 'log/std', 'pallet-staking-extension/std', 'pallet-balances/std', + 'pallet-parameters/std', 'sp-io/std', "sp-runtime/std", ] diff --git a/pallets/attestation/src/lib.rs b/pallets/attestation/src/lib.rs index e98d315ff..ebab0a19e 100644 --- a/pallets/attestation/src/lib.rs +++ b/pallets/attestation/src/lib.rs @@ -121,6 +121,8 @@ pub mod pallet { NoStashAccount, /// Cannot lookup associated TS server info NoServerInfo, + /// Unacceptable VM image running + BadMrtdValue, } #[pallet::call] @@ -167,8 +169,11 @@ pub mod pallet { Error::::IncorrectInputData ); - // TODO #982 Check measurements match current release of entropy-tss - let _mrtd = quote.mrtd(); + // Check build-time measurement matches a current-supported release of entropy-tss + let mrtd_value = BoundedVec::try_from(quote.mrtd().to_vec()) + .map_err(|_| Error::::BadMrtdValue)?; + let accepted_mrtd_values = pallet_parameters::Pallet::::accepted_mrtd_values(); + ensure!(accepted_mrtd_values.contains(&mrtd_value), Error::::BadMrtdValue); // TODO #982 Check that the attestation public key matches that from PCK certificate let _attestation_key = quote.attestation_key; diff --git a/pallets/attestation/src/mock.rs b/pallets/attestation/src/mock.rs index fea3719bc..086153d1f 100644 --- a/pallets/attestation/src/mock.rs +++ b/pallets/attestation/src/mock.rs @@ -29,7 +29,7 @@ use sp_runtime::{ curve::PiecewiseLinear, testing::{TestXt, UintAuthorityId}, traits::{BlakeTwo256, ConvertInto, IdentityLookup}, - BuildStorage, Perbill, + BoundedVec, BuildStorage, Perbill, }; use sp_staking::{EraIndex, SessionIndex}; use std::cell::RefCell; @@ -352,5 +352,16 @@ pub fn new_test_ext() -> sp_io::TestExternalities { }; pallet_staking_extension.assimilate_storage(&mut t).unwrap(); + let pallet_parameters = pallet_parameters::GenesisConfig:: { + request_limit: 5u32, + max_instructions_per_programs: 5u64, + total_signers: 3u8, + threshold: 2u8, + accepted_mrtd_values: vec![BoundedVec::try_from([0; 48].to_vec()).unwrap()], + _config: Default::default(), + }; + + pallet_parameters.assimilate_storage(&mut t).unwrap(); + t.into() } diff --git a/pallets/parameters/src/benchmarking.rs b/pallets/parameters/src/benchmarking.rs index 0d24fa885..a0ff82bc1 100644 --- a/pallets/parameters/src/benchmarking.rs +++ b/pallets/parameters/src/benchmarking.rs @@ -16,6 +16,7 @@ use frame_benchmarking::benchmarks; use frame_support::assert_ok; use frame_system::EventRecord; +use sp_std::vec; use super::*; #[allow(unused)] @@ -65,6 +66,17 @@ benchmarks! { assert_last_event::(Event::SignerInfoChanged{ signer_info }.into()); } + change_accepted_mrtd_values { + let origin = T::UpdateOrigin::try_successful_origin().unwrap(); + let accepted_mrtd_values = vec![BoundedVec::try_from([0; 48].to_vec()).unwrap()]; + }: { + assert_ok!( + >::change_accepted_mrtd_values(origin, accepted_mrtd_values.clone()) + ); + } + verify { + assert_last_event::(Event::AcceptedMrtdValuesChanged{ accepted_mrtd_values }.into()); + } impl_benchmark_test_suite!(Parameters, crate::mock::new_test_ext(), crate::mock::Runtime); } diff --git a/pallets/parameters/src/lib.rs b/pallets/parameters/src/lib.rs index cad018b12..4be3c7614 100644 --- a/pallets/parameters/src/lib.rs +++ b/pallets/parameters/src/lib.rs @@ -13,7 +13,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -//! # Programs Parameters +//! # Parameters Pallet //! //! ## Overview //! @@ -37,6 +37,7 @@ use entropy_shared::MAX_SIGNERS; use frame_support::pallet_prelude::*; use frame_system::pallet_prelude::*; use sp_runtime::DispatchResult; +use sp_std::vec::Vec; #[cfg(test)] mod mock; @@ -67,6 +68,8 @@ pub mod module { type WeightInfo: WeightInfo; } + pub type MrtdValues = Vec>>; + #[pallet::genesis_config] #[derive(frame_support::DefaultNoBound)] pub struct GenesisConfig { @@ -74,6 +77,7 @@ pub mod module { pub max_instructions_per_programs: u64, pub threshold: u8, pub total_signers: u8, + pub accepted_mrtd_values: MrtdValues, #[serde(skip)] pub _config: sp_std::marker::PhantomData, } @@ -83,6 +87,10 @@ pub mod module { fn build(&self) { assert!(self.threshold > 0, "Threhsold too low"); assert!(self.total_signers >= self.threshold, "Threshold is larger then signer"); + assert!( + !self.accepted_mrtd_values.is_empty(), + "At least one accepted MRTD value is required" + ); RequestLimit::::put(self.request_limit); MaxInstructionsPerPrograms::::put(self.max_instructions_per_programs); let signer_info = SignersSize { @@ -91,6 +99,7 @@ pub mod module { last_session_change: 0, }; SignersInfo::::put(signer_info); + AcceptedMrtdValues::::put(self.accepted_mrtd_values.clone()); } } @@ -128,6 +137,8 @@ pub mod module { MaxInstructionsPerProgramsChanged { max_instructions_per_programs: u64 }, /// Signer Info changed SignerInfoChanged { signer_info: SignersSize }, + /// Accepted MRTD values changed + AcceptedMrtdValuesChanged { accepted_mrtd_values: MrtdValues }, } /// The request limit a user can ask to a specific set of TSS in a block @@ -145,6 +156,12 @@ pub mod module { #[pallet::getter(fn signers_info)] pub type SignersInfo = StorageValue<_, SignersSize, ValueQuery>; + /// Accepted values of the TDX build-time measurement register - from the currently-supported + /// releases of entropy-tss + #[pallet::storage] + #[pallet::getter(fn accepted_mrtd_values)] + pub type AcceptedMrtdValues = StorageValue<_, MrtdValues, ValueQuery>; + #[pallet::pallet] #[pallet::without_storage_info] pub struct Pallet(_); @@ -205,5 +222,17 @@ pub mod module { Self::deposit_event(Event::SignerInfoChanged { signer_info }); Ok(()) } + + #[pallet::call_index(3)] + #[pallet::weight( ::WeightInfo::change_accepted_mrtd_values())] + pub fn change_accepted_mrtd_values( + origin: OriginFor, + accepted_mrtd_values: MrtdValues, + ) -> DispatchResult { + T::UpdateOrigin::ensure_origin(origin)?; + AcceptedMrtdValues::::put(&accepted_mrtd_values); + Self::deposit_event(Event::AcceptedMrtdValuesChanged { accepted_mrtd_values }); + Ok(()) + } } } diff --git a/pallets/parameters/src/mock.rs b/pallets/parameters/src/mock.rs index 726bbe025..812da2b27 100644 --- a/pallets/parameters/src/mock.rs +++ b/pallets/parameters/src/mock.rs @@ -138,6 +138,7 @@ pub fn new_test_ext() -> sp_io::TestExternalities { max_instructions_per_programs: 5u64, total_signers: 5u8, threshold: 3u8, + accepted_mrtd_values: vec![BoundedVec::try_from([0; 48].to_vec()).unwrap()], _config: Default::default(), }; pallet_parameters.assimilate_storage(&mut t).unwrap(); diff --git a/pallets/parameters/src/weights.rs b/pallets/parameters/src/weights.rs index 1cef038d8..b78620c33 100644 --- a/pallets/parameters/src/weights.rs +++ b/pallets/parameters/src/weights.rs @@ -13,13 +13,13 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -//! Autogenerated weights for pallet_transaction_pause +//! Autogenerated weights for `pallet_parameters` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-11-02, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 33.0.0 +//! DATE: 2024-08-30, STEPS: `5`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `hcastano`, CPU: `` -//! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 +//! HOSTNAME: `turnip`, CPU: `Intel(R) Core(TM) i7-4710MQ CPU @ 2.50GHz` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 // Executed Command: // ./target/release/entropy @@ -27,106 +27,128 @@ // pallet // --chain // dev -// --wasm-execution=compiled -// --pallet -// pallet_transaction_pause -// --extrinsic -// * -// --steps -// 50 -// --repeat -// 20 -// --template -// .maintain/frame-weight-template.hbs -// --output -// pallets/transaction-pause/src/weights.rs +// --pallet=pallet_parameters +// --extrinsic=change_mrtd_values +// --steps=5 +// --repeat=2 +// --header=.maintain/AGPL-3.0-header.txt +// --output=./runtime/src/weights/ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] #![allow(missing_docs)] -use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use frame_support::{traits::Get, weights::{constants::RocksDbWeight, Weight}}; use core::marker::PhantomData; /// Weight functions needed for pallet_transaction_pause. pub trait WeightInfo { - fn change_request_limit() -> Weight; - fn max_instructions_per_programs() -> Weight; - fn change_signers_info() -> Weight; + fn change_request_limit() -> Weight; + fn max_instructions_per_programs() -> Weight; + fn change_signers_info() -> Weight; + fn change_accepted_mrtd_values() -> Weight; } -/// Weights for pallet_transaction_pause using the Substrate node and recommended hardware. +/// Weight functions for `pallet_parameters`. pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { - /// Storage: `Parameters::RequestLimit` (r:0 w:1) - /// Proof: `Parameters::RequestLimit` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - fn change_request_limit() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 5_000_000 picoseconds. - Weight::from_parts(6_000_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Parameters::MaxInstructionsPerPrograms` (r:0 w:1) - /// Proof: `Parameters::MaxInstructionsPerPrograms` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - fn max_instructions_per_programs() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Parameters::SignersInfo` (r:0 w:1) - /// Proof: `Parameters::SignersInfo` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - fn change_signers_info() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 4_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - .saturating_add(T::DbWeight::get().writes(1)) - } + /// Storage: `Parameters::RequestLimit` (r:0 w:1) + /// Proof: `Parameters::RequestLimit` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn change_request_limit() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 5_000_000 picoseconds. + Weight::from_parts(6_000_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) + } + + /// Storage: `Parameters::MaxInstructionsPerPrograms` (r:0 w:1) + /// Proof: `Parameters::MaxInstructionsPerPrograms` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn max_instructions_per_programs() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) + } + + /// Storage: `Parameters::SignersInfo` (r:0 w:1) + /// Proof: `Parameters::SignersInfo` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn change_signers_info() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 4_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) + } + + /// Storage: `Parameters::AcceptedMrtdValues` (r:0 w:1) + /// Proof: `Parameters::AcceptedMrtdValues` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn change_accepted_mrtd_values() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 14_134_000 picoseconds. + Weight::from_parts(22_719_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) + } } // For backwards compatibility and tests impl WeightInfo for () { - /// Storage: `Parameters::RequestLimit` (r:0 w:1) - /// Proof: `Parameters::RequestLimit` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - fn change_request_limit() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 5_000_000 picoseconds. - Weight::from_parts(6_000_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - .saturating_add(RocksDbWeight::get().writes(1)) - } - /// Storage: `Parameters::MaxInstructionsPerPrograms` (r:0 w:1) - /// Proof: `Parameters::MaxInstructionsPerPrograms` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - fn max_instructions_per_programs() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - .saturating_add(RocksDbWeight::get().writes(1)) - } - /// Storage: `Parameters::SignersInfo` (r:0 w:1) - /// Proof: `Parameters::SignersInfo` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - fn change_signers_info() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 4_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - .saturating_add(RocksDbWeight::get().writes(1)) - } + /// Storage: `Parameters::RequestLimit` (r:0 w:1) + /// Proof: `Parameters::RequestLimit` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn change_request_limit() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 5_000_000 picoseconds. + Weight::from_parts(6_000_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(RocksDbWeight::get().writes(1)) + } + + /// Storage: `Parameters::MaxInstructionsPerPrograms` (r:0 w:1) + /// Proof: `Parameters::MaxInstructionsPerPrograms` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn max_instructions_per_programs() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(RocksDbWeight::get().writes(1)) + } + + /// Storage: `Parameters::SignersInfo` (r:0 w:1) + /// Proof: `Parameters::SignersInfo` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn change_signers_info() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 4_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(RocksDbWeight::get().writes(1)) + } + + /// Storage: `Parameters::AcceptedMrtdValues` (r:0 w:1) + /// Proof: `Parameters::AcceptedMrtdValues` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn change_accepted_mrtd_values() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 14_134_000 picoseconds. + Weight::from_parts(22_719_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(RocksDbWeight::get().writes(1)) + } } diff --git a/pallets/registry/src/mock.rs b/pallets/registry/src/mock.rs index dc5b75608..3d2c10f19 100644 --- a/pallets/registry/src/mock.rs +++ b/pallets/registry/src/mock.rs @@ -29,9 +29,10 @@ use sp_runtime::{ curve::PiecewiseLinear, testing::{TestXt, UintAuthorityId}, traits::{BlakeTwo256, ConvertInto, IdentityLookup}, - BuildStorage, Perbill, + BoundedVec, BuildStorage, Perbill, }; use sp_staking::{EraIndex, SessionIndex}; +use sp_std::vec; use std::cell::RefCell; use crate as pallet_registry; @@ -387,6 +388,7 @@ pub fn new_test_ext() -> sp_io::TestExternalities { max_instructions_per_programs: 5u64, total_signers: 3u8, threshold: 2u8, + accepted_mrtd_values: vec![BoundedVec::try_from([0; 48].to_vec()).unwrap()], _config: Default::default(), } .assimilate_storage(&mut t) diff --git a/pallets/staking/src/mock.rs b/pallets/staking/src/mock.rs index 372866da4..0d1fe7159 100644 --- a/pallets/staking/src/mock.rs +++ b/pallets/staking/src/mock.rs @@ -31,9 +31,10 @@ use sp_runtime::{ curve::PiecewiseLinear, testing::{TestXt, UintAuthorityId}, traits::{BlakeTwo256, ConvertInto, IdentityLookup, OpaqueKeys, Zero}, - BuildStorage, KeyTypeId, Perbill, + BoundedVec, BuildStorage, KeyTypeId, Perbill, }; use sp_staking::{EraIndex, SessionIndex}; +use sp_std::vec; use crate as pallet_staking_extension; @@ -411,6 +412,7 @@ pub fn new_test_ext() -> sp_io::TestExternalities { max_instructions_per_programs: 5u64, total_signers: 3u8, threshold: 2u8, + accepted_mrtd_values: vec![BoundedVec::try_from([0; 48].to_vec()).unwrap()], _config: Default::default(), } .assimilate_storage(&mut t) diff --git a/runtime/src/weights/pallet_parameters.rs b/runtime/src/weights/pallet_parameters.rs index 20c750acb..24ae04b49 100644 --- a/runtime/src/weights/pallet_parameters.rs +++ b/runtime/src/weights/pallet_parameters.rs @@ -16,9 +16,9 @@ //! Autogenerated weights for `pallet_parameters` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 33.0.0 -//! DATE: 2024-07-16, STEPS: `5`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-08-30, STEPS: `5`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `Jesses-MacBook-Pro.local`, CPU: `` +//! HOSTNAME: `turnip`, CPU: `Intel(R) Core(TM) i7-4710MQ CPU @ 2.50GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 // Executed Command: @@ -28,7 +28,7 @@ // --chain // dev // --pallet=pallet_parameters -// --extrinsic=* +// --extrinsic=change_accepted_mrtd_values // --steps=5 // --repeat=2 // --header=.maintain/AGPL-3.0-header.txt @@ -45,36 +45,50 @@ use core::marker::PhantomData; /// Weight functions for `pallet_parameters`. pub struct WeightInfo(PhantomData); impl pallet_parameters::WeightInfo for WeightInfo { - /// Storage: `Parameters::RequestLimit` (r:0 w:1) - /// Proof: `Parameters::RequestLimit` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - fn change_request_limit() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 4_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Parameters::MaxInstructionsPerPrograms` (r:0 w:1) - /// Proof: `Parameters::MaxInstructionsPerPrograms` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - fn max_instructions_per_programs() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Parameters::SignersInfo` (r:0 w:1) - /// Proof: `Parameters::SignersInfo` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - fn change_signers_info() -> Weight { + /// Storage: `Parameters::RequestLimit` (r:0 w:1) + /// Proof: `Parameters::RequestLimit` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn change_request_limit() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 5_000_000 picoseconds. + Weight::from_parts(6_000_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) + } + + /// Storage: `Parameters::MaxInstructionsPerPrograms` (r:0 w:1) + /// Proof: `Parameters::MaxInstructionsPerPrograms` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn max_instructions_per_programs() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) + } + + /// Storage: `Parameters::SignersInfo` (r:0 w:1) + /// Proof: `Parameters::SignersInfo` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn change_signers_info() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 4_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) + } + + /// Storage: `Parameters::AcceptedMrtdValues` (r:0 w:1) + /// Proof: `Parameters::AcceptedMrtdValues` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn change_accepted_mrtd_values() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_000_000 picoseconds. - Weight::from_parts(4_000_000, 0) + // Minimum execution time: 14_134_000 picoseconds. + Weight::from_parts(22_719_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) }