From 8e6902bc65880b4093884e03f6aa75971cfc1ea5 Mon Sep 17 00:00:00 2001 From: 4meta5 Date: Mon, 7 Oct 2024 12:28:31 -0400 Subject: [PATCH 01/24] init by starting to bound all task pallet extrinsics --- pallets/tasks/src/lib.rs | 13 ++++++------- primitives/src/task.rs | 15 ++++++++++++--- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/pallets/tasks/src/lib.rs b/pallets/tasks/src/lib.rs index 20bc9c8aa..875d7d804 100644 --- a/pallets/tasks/src/lib.rs +++ b/pallets/tasks/src/lib.rs @@ -51,7 +51,6 @@ mod tests; #[polkadot_sdk::frame_support::pallet] pub mod pallet { use crate::queue::*; - use scale_info::prelude::string::String; use polkadot_sdk::{ frame_support, frame_system, pallet_balances, pallet_treasury, sp_runtime, sp_std, @@ -68,8 +67,8 @@ pub mod pallet { use sp_std::vec::Vec; use time_primitives::{ - AccountId, Balance, BatchBuilder, BatchId, GatewayMessage, GatewayOp, GmpEvent, MessageId, - NetworkId, NetworksInterface, PublicKey, ShardId, ShardsInterface, Task, TaskId, + AccountId, Balance, BatchBuilder, BatchId, ErrorMsg, GatewayMessage, GatewayOp, GmpEvent, + MessageId, NetworkId, NetworksInterface, PublicKey, ShardId, ShardsInterface, Task, TaskId, TaskResult, TasksInterface, TssPublicKey, TssSignature, }; @@ -194,7 +193,7 @@ pub mod pallet { #[pallet::storage] pub type TaskOutput = - StorageMap<_, Blake2_128Concat, TaskId, Result<(), String>, OptionQuery>; + StorageMap<_, Blake2_128Concat, TaskId, Result<(), ErrorMsg>, OptionQuery>; #[pallet::storage] pub type TaskNetwork = @@ -245,7 +244,7 @@ pub mod pallet { /// the record id that uniquely identify TaskCreated(TaskId), /// Task succeeded with optional error message - TaskResult(TaskId, Result<(), String>), + TaskResult(TaskId, Result<(), ErrorMsg>), /// Set the maximum number of assigned tasks for all shards on the network ShardTaskLimitSet(NetworkId, u32), /// Set the network batch size @@ -414,7 +413,7 @@ pub mod pallet { task_id } - fn finish_task(network: NetworkId, task_id: TaskId, result: Result<(), String>) { + fn finish_task(network: NetworkId, task_id: TaskId, result: Result<(), ErrorMsg>) { TaskOutput::::insert(task_id, result.clone()); if let Some(shard) = TaskShard::::take(task_id) { ShardTasks::::remove(shard, task_id); @@ -614,7 +613,7 @@ pub mod pallet { /// Retrieves the result of a given task. /// Look up the `TaskResult` associated with the provided `task_id` in the storage. - pub fn get_task_result(task_id: TaskId) -> Option> { + pub fn get_task_result(task_id: TaskId) -> Option> { TaskOutput::::get(task_id) } diff --git a/primitives/src/task.rs b/primitives/src/task.rs index c41dfc432..19ebd0e9a 100644 --- a/primitives/src/task.rs +++ b/primitives/src/task.rs @@ -1,7 +1,8 @@ use crate::{BatchId, GmpEvent, TssSignature, ANLOG}; use core::ops::Range; +use polkadot_sdk::{sp_core::ConstU32, sp_runtime::BoundedVec}; use scale_codec::{Decode, Encode}; -use scale_info::{prelude::string::String, prelude::vec::Vec, TypeInfo}; +use scale_info::{prelude::vec::Vec, TypeInfo}; #[cfg(feature = "std")] use serde::{Deserialize, Serialize}; @@ -60,15 +61,23 @@ pub fn encode_gmp_events(task_id: TaskId, events: &[GmpEvent]) -> Vec { (task_id, events).encode() } +// TODO: review if sensible +const MAX_GMP_EVENTS: u32 = 10_000; +const MAX_ERROR_LEN: u32 = 5_000; +/// Bounded vec alias for GMP events submitted in results +pub type GmpEvents = BoundedVec>; +/// Bounded vec alias for SubmitGatewayMessage error +pub type ErrorMsg = BoundedVec>; + #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] #[derive(Debug, Clone, Decode, Encode, TypeInfo, PartialEq)] pub enum TaskResult { ReadGatewayEvents { - events: Vec, + events: GmpEvents, #[cfg_attr(feature = "std", serde(with = "crate::shard::serde_tss_signature"))] signature: TssSignature, }, SubmitGatewayMessage { - error: String, + error: ErrorMsg, }, } From 332021d299b35bb7d6009d9767850492df67ce76 Mon Sep 17 00:00:00 2001 From: 4meta5 Date: Mon, 7 Oct 2024 13:03:23 -0400 Subject: [PATCH 02/24] tasks pallet unit tests and benchmarking updated with boundedvecs --- pallets/tasks/src/benchmarking.rs | 6 +++--- pallets/tasks/src/tests.rs | 18 ++++++++++++------ primitives/src/task.rs | 5 ++--- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/pallets/tasks/src/benchmarking.rs b/pallets/tasks/src/benchmarking.rs index 431f97025..59f5cfa34 100644 --- a/pallets/tasks/src/benchmarking.rs +++ b/pallets/tasks/src/benchmarking.rs @@ -8,8 +8,8 @@ use pallet_shards::{ShardCommitment, ShardState}; use polkadot_sdk::{frame_benchmarking, frame_support, frame_system, sp_std}; use sp_std::vec; use time_primitives::{ - NetworkId, ShardStatus, ShardsInterface, Task, TaskResult, TasksInterface, TssPublicKey, - TssSignature, + GmpEvents, NetworkId, ShardStatus, ShardsInterface, Task, TaskResult, TasksInterface, + TssPublicKey, TssSignature, }; // Generated by running tests::bench_helper::print_valid_result @@ -45,7 +45,7 @@ benchmarks! { create_simple_task::(); Pallet::::assign_task(0, 0); Pallet::::on_initialize(frame_system::Pallet::::block_number()); - let result = TaskResult::ReadGatewayEvents { events: vec![], signature: SIGNATURE }; + let result = TaskResult::ReadGatewayEvents { events: GmpEvents::truncate_from(vec![]), signature: SIGNATURE }; }: _(RawOrigin::Signed([0u8; 32].into()), 0, result) verify {} schedule_tasks { diff --git a/pallets/tasks/src/tests.rs b/pallets/tasks/src/tests.rs index 9ccc597fa..4065bd143 100644 --- a/pallets/tasks/src/tests.rs +++ b/pallets/tasks/src/tests.rs @@ -5,10 +5,11 @@ use frame_support::assert_ok; use frame_system::RawOrigin; use pallet_shards::{ShardCommitment, ShardState}; use polkadot_sdk::{frame_support, frame_system}; +use scale_codec::Encode; use time_primitives::{ - traits::IdentifyAccount, GatewayMessage, GatewayOp, GmpEvent, GmpMessage, MockTssSigner, - NetworkId, PublicKey, ShardId, ShardStatus, ShardsInterface, Task, TaskId, TaskResult, - TasksInterface, TssPublicKey, TssSignature, + traits::IdentifyAccount, ErrorMsg, GatewayMessage, GatewayOp, GmpEvent, GmpEvents, GmpMessage, + MockTssSigner, NetworkId, PublicKey, ShardId, ShardStatus, ShardsInterface, Task, TaskId, + TaskResult, TasksInterface, TssPublicKey, TssSignature, }; const ETHEREUM: NetworkId = 0; @@ -42,7 +43,7 @@ fn register_shard(shard: ShardId) { fn submit_gateway_events(shard: ShardId, task_id: TaskId, events: &[GmpEvent]) { let signature = MockTssSigner::new(shard).sign_gmp_events(task_id, events); let result = TaskResult::ReadGatewayEvents { - events: events.to_vec(), + events: GmpEvents::truncate_from(events.to_vec()), signature, }; assert_ok!(Tasks::submit_task_result( @@ -56,7 +57,9 @@ fn submit_submission_error(account: PublicKey, task: TaskId, error: &str) { assert_ok!(Tasks::submit_task_result( RawOrigin::Signed(account.into_account()).into(), task, - TaskResult::SubmitGatewayMessage { error: error.to_string() } + TaskResult::SubmitGatewayMessage { + error: ErrorMsg::truncate_from(error.encode()) + } )); } @@ -225,7 +228,10 @@ fn test_msg_execution_error_completes_submit_task() { assert!(Tasks::get_task_result(1).is_none()); let account = Tasks::get_task_submitter(1).unwrap(); submit_submission_error(account, 1, "error message"); - assert_eq!(Tasks::get_task_result(1), Some(Err("error message".to_string()))); + assert_eq!( + Tasks::get_task_result(1), + Some(Err(ErrorMsg::truncate_from("error message".encode()))) + ); }) } diff --git a/primitives/src/task.rs b/primitives/src/task.rs index 19ebd0e9a..55ed504c0 100644 --- a/primitives/src/task.rs +++ b/primitives/src/task.rs @@ -61,9 +61,8 @@ pub fn encode_gmp_events(task_id: TaskId, events: &[GmpEvent]) -> Vec { (task_id, events).encode() } -// TODO: review if sensible -const MAX_GMP_EVENTS: u32 = 10_000; -const MAX_ERROR_LEN: u32 = 5_000; +const MAX_GMP_EVENTS: u32 = 1_000; +const MAX_ERROR_LEN: u32 = 500; /// Bounded vec alias for GMP events submitted in results pub type GmpEvents = BoundedVec>; /// Bounded vec alias for SubmitGatewayMessage error From 3106d5afb90a1384017b38b7541d16367d6755f9 Mon Sep 17 00:00:00 2001 From: 4meta5 Date: Mon, 7 Oct 2024 16:09:55 -0400 Subject: [PATCH 03/24] rm strings from tasksapi and runtimeapis altogether --- primitives/src/lib.rs | 2 +- runtimes/mainnet/src/lib.rs | 9 ++++----- runtimes/testnet/src/lib.rs | 7 +++---- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/primitives/src/lib.rs b/primitives/src/lib.rs index 4c22a0c0e..c21b118eb 100644 --- a/primitives/src/lib.rs +++ b/primitives/src/lib.rs @@ -117,7 +117,7 @@ sp_api::decl_runtime_apis! { fn get_task(task_id: TaskId) -> Option; fn get_task_shard(task_id: TaskId) -> Option; fn get_task_submitter(task_id: TaskId) -> Option; - fn get_task_result(task_id: TaskId) -> Option>; + fn get_task_result(task_id: TaskId) -> Option>; fn get_batch_message(batch_id: BatchId) -> Option; } diff --git a/runtimes/mainnet/src/lib.rs b/runtimes/mainnet/src/lib.rs index 598364811..b6056e88c 100644 --- a/runtimes/mainnet/src/lib.rs +++ b/runtimes/mainnet/src/lib.rs @@ -60,7 +60,6 @@ use pallet_session::historical as pallet_session_historical; pub use pallet_transaction_payment::{CurrencyAdapter, Multiplier, TargetedFeeAdjustment}; use pallet_transaction_payment::{FeeDetails, RuntimeDispatchInfo}; -use scale_info::prelude::string::String; use sp_api::impl_runtime_apis; use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId; use sp_consensus_grandpa::AuthorityId as GrandpaId; @@ -86,9 +85,9 @@ use static_assertions::const_assert; pub use time_primitives::{ AccountId, Balance, BatchId, BlockHash, BlockNumber, ChainName, ChainNetwork, Commitment, - Gateway, GatewayMessage, MemberStatus, MembersInterface, Moment, NetworkId, NetworksInterface, - Nonce, PeerId, ProofOfKnowledge, PublicKey, ShardId, ShardStatus, Signature, Task, TaskId, - TaskResult, TssPublicKey, TssSignature, ANLOG, + ErrorMsg, Gateway, GatewayMessage, MemberStatus, MembersInterface, Moment, NetworkId, + NetworksInterface, Nonce, PeerId, ProofOfKnowledge, PublicKey, ShardId, ShardStatus, Signature, + Task, TaskId, TaskResult, TssPublicKey, TssSignature, ANLOG, }; /// Constant values used within the runtime. @@ -1846,7 +1845,7 @@ impl_runtime_apis! { Tasks::get_task_submitter(task_id) } - fn get_task_result(task_id: TaskId) -> Option>{ + fn get_task_result(task_id: TaskId) -> Option>{ Tasks::get_task_result(task_id) } diff --git a/runtimes/testnet/src/lib.rs b/runtimes/testnet/src/lib.rs index cc5717dca..f76bf8004 100644 --- a/runtimes/testnet/src/lib.rs +++ b/runtimes/testnet/src/lib.rs @@ -32,7 +32,6 @@ use frame_support::{ }; use frame_system::EnsureRootWithSuccess; use frame_system::{limits::BlockWeights, EnsureRoot}; -use scale_info::prelude::string::String; use pallet_election_provider_multi_phase::{GeometricDepositBase, SolutionAccuracyOf}; use pallet_grandpa::{ @@ -73,8 +72,8 @@ pub use runtime_common::{ BABE_GENESIS_EPOCH_CONFIG, }; pub use time_primitives::{ - AccountId, Balance, BatchId, BlockNumber, ChainName, ChainNetwork, Commitment, Gateway, - GatewayMessage, MemberStatus, MembersInterface, NetworkId, NetworksInterface, PeerId, + AccountId, Balance, BatchId, BlockNumber, ChainName, ChainNetwork, Commitment, ErrorMsg, + Gateway, GatewayMessage, MemberStatus, MembersInterface, NetworkId, NetworksInterface, PeerId, ProofOfKnowledge, PublicKey, ShardId, ShardStatus, Signature, Task, TaskId, TaskResult, TssPublicKey, TssSignature, ANLOG, }; @@ -1482,7 +1481,7 @@ impl_runtime_apis! { Tasks::get_task_submitter(task_id) } - fn get_task_result(task_id: TaskId) -> Option> { + fn get_task_result(task_id: TaskId) -> Option>{ Tasks::get_task_result(task_id) } From 533c7ceb4081e65e23d38866c070e851b0f6db0d Mon Sep 17 00:00:00 2001 From: 4meta5 Date: Mon, 7 Oct 2024 18:01:54 -0400 Subject: [PATCH 04/24] bound shard commitment --- pallets/shards/src/lib.rs | 2 +- pallets/shards/src/tests.rs | 6 +++--- primitives/src/shard.rs | 6 +++++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/pallets/shards/src/lib.rs b/pallets/shards/src/lib.rs index 7b55650c8..da98afc09 100644 --- a/pallets/shards/src/lib.rs +++ b/pallets/shards/src/lib.rs @@ -441,7 +441,7 @@ pub mod pallet { /// /// # Flow /// 1. Retrieve and return the commitment from [`ShardCommitment`] storage. - pub fn get_shard_commitment(shard_id: ShardId) -> Option> { + pub fn get_shard_commitment(shard_id: ShardId) -> Option { ShardCommitment::::get(shard_id) } } diff --git a/pallets/shards/src/tests.rs b/pallets/shards/src/tests.rs index e04563acc..322d7b29b 100644 --- a/pallets/shards/src/tests.rs +++ b/pallets/shards/src/tests.rs @@ -13,7 +13,7 @@ use schnorr_evm::proof_of_knowledge::construct_proof_of_knowledge; use schnorr_evm::VerifyingKey; use time_primitives::{ - AccountId, NetworkId, PeerId, PublicKey, ShardId, ShardStatus, ShardsInterface, + AccountId, Commitment, NetworkId, PeerId, PublicKey, ShardId, ShardStatus, ShardsInterface, }; const ETHEREUM: NetworkId = 0; @@ -88,7 +88,7 @@ fn create_shard(shard_id: ShardId, shard: &[Member], threshold: u16) { assert_ok!(Shards::commit( RawOrigin::Signed(member.account_id.clone()).into(), shard_id as _, - member.commitment(threshold), + Commitment::truncate_from(member.commitment(threshold)), member.proof_of_knowledge(), )); roll(1); @@ -139,7 +139,7 @@ fn test_register_shard() { assert_ok!(Shards::commit( RawOrigin::Signed(member.account_id.clone()).into(), shard_id as _, - member.commitment(threshold), + Commitment::truncate_from(member.commitment(threshold)), member.proof_of_knowledge(), )); } diff --git a/primitives/src/shard.rs b/primitives/src/shard.rs index 1662ef323..e2ddaee87 100644 --- a/primitives/src/shard.rs +++ b/primitives/src/shard.rs @@ -5,6 +5,7 @@ use crate::{ }; #[cfg(feature = "std")] use futures::channel::oneshot; +use polkadot_sdk::{sp_core::ConstU32, sp_runtime::BoundedVec}; #[cfg(feature = "std")] use serde::{Deserialize, Serialize}; @@ -13,13 +14,16 @@ use scale_info::prelude::string::String; use scale_info::prelude::vec::Vec; use scale_info::TypeInfo; +/// Absolute upper bound for shard sizes +const MAX_SHARD_SIZE: u32 = 100; + pub type TssPublicKey = [u8; 33]; pub type TssSignature = [u8; 64]; pub type TssHash = [u8; 32]; pub type PeerId = [u8; 32]; pub type ShardId = u64; pub type ProofOfKnowledge = [u8; 65]; -pub type Commitment = Vec; +pub type Commitment = BoundedVec>; #[cfg(feature = "std")] pub mod serde_tss_public_key { From ec02eac32c93252fb59a0e188e68ad71fa6e2ca6 Mon Sep 17 00:00:00 2001 From: 4meta5 Date: Mon, 7 Oct 2024 18:04:07 -0400 Subject: [PATCH 05/24] update shards benchmark to use bounded commitment --- pallets/shards/src/benchmarking.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pallets/shards/src/benchmarking.rs b/pallets/shards/src/benchmarking.rs index 013668482..42c430b01 100644 --- a/pallets/shards/src/benchmarking.rs +++ b/pallets/shards/src/benchmarking.rs @@ -69,7 +69,7 @@ pub fn get_commitment(member: [u8; 32]) -> Commitment { panic!("Invalid member") }, }; - vec![commitment] + Commitment::truncate_from(vec![commitment]) } pub fn get_proof_of_knowledge(member: [u8; 32]) -> ProofOfKnowledge { match member { From 334fefff67fa348feb3346bb027333844c342cf5 Mon Sep 17 00:00:00 2001 From: 4meta5 Date: Mon, 7 Oct 2024 18:13:45 -0400 Subject: [PATCH 06/24] network register network replace unbounded strings --- pallets/networks/src/benchmarking.rs | 16 ++++++++-------- pallets/networks/src/tests.rs | 7 ++++--- primitives/src/network.rs | 9 ++++++--- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/pallets/networks/src/benchmarking.rs b/pallets/networks/src/benchmarking.rs index 6f55d3ed0..e47737b2a 100644 --- a/pallets/networks/src/benchmarking.rs +++ b/pallets/networks/src/benchmarking.rs @@ -4,11 +4,11 @@ use crate::Pallet; use frame_system::RawOrigin; use polkadot_sdk::frame_benchmarking::benchmarks; use polkadot_sdk::frame_system; +use scale_codec::Encode; use scale_info::prelude::string::String; -use time_primitives::{Network, NetworkConfig}; - -//TODO: choose & enforce MAX in code -const MAX_LENGTH: u32 = 1000; +use time_primitives::{ + ChainName, ChainNetwork, Network, NetworkConfig, CHAIN_NAME_LEN, CHAIN_NET_LEN, +}; fn mock_network_config() -> NetworkConfig { NetworkConfig { @@ -22,8 +22,8 @@ fn mock_network_config() -> NetworkConfig { fn mock_network(chain_name: String, chain_network: String) -> Network { Network { id: 42, - chain_name, - chain_network, + chain_name: ChainName::truncate_from(chain_name.as_str().encode()), + chain_network: ChainNetwork::truncate_from(chain_network.as_str().encode()), gateway: [0; 32], gateway_block: 99, config: mock_network_config(), @@ -32,8 +32,8 @@ fn mock_network(chain_name: String, chain_network: String) -> Network { benchmarks! { register_network { - let a in 1..MAX_LENGTH; - let b in 1..MAX_LENGTH; + let a in 1..CHAIN_NAME_LEN; + let b in 1..CHAIN_NET_LEN; let mut name = String::new(); let mut network = String::new(); for _ in 0..a { diff --git a/pallets/networks/src/tests.rs b/pallets/networks/src/tests.rs index 5a36c4241..5821dd136 100644 --- a/pallets/networks/src/tests.rs +++ b/pallets/networks/src/tests.rs @@ -3,7 +3,8 @@ use crate::{mock::*, Error}; use frame_support::{assert_noop, assert_ok}; use frame_system::RawOrigin; use polkadot_sdk::{frame_support, frame_system}; -use time_primitives::{Network, NetworkConfig}; +use scale_codec::Encode; +use time_primitives::{ChainName, ChainNetwork, Network, NetworkConfig}; fn mock_network_config() -> NetworkConfig { NetworkConfig { @@ -17,8 +18,8 @@ fn mock_network_config() -> NetworkConfig { fn mock_network() -> Network { Network { id: 42, - chain_name: "Ethereum".into(), - chain_network: "Mainnet".into(), + chain_name: ChainName::truncate_from("Ethereum".encode()), + chain_network: ChainNetwork::truncate_from("Mainnet".encode()), gateway: [0; 32], gateway_block: 99, config: mock_network_config(), diff --git a/primitives/src/network.rs b/primitives/src/network.rs index 7b7989df7..0f4395571 100644 --- a/primitives/src/network.rs +++ b/primitives/src/network.rs @@ -1,12 +1,15 @@ use crate::Gateway; +use polkadot_sdk::{sp_core::ConstU32, sp_runtime::BoundedVec}; use scale_codec::{Decode, Encode}; -use scale_info::prelude::string::String; use scale_info::TypeInfo; use serde::{Deserialize, Serialize}; +pub const CHAIN_NAME_LEN: u32 = 50; +pub const CHAIN_NET_LEN: u32 = 50; + pub type NetworkId = u16; -pub type ChainName = String; -pub type ChainNetwork = String; +pub type ChainName = BoundedVec>; +pub type ChainNetwork = BoundedVec>; #[derive(Clone, Debug, Eq, PartialEq, Encode, Decode, TypeInfo, Serialize, Deserialize)] pub struct Network { From 0685724eefafbbb42cfdbc46233913dde24c2230 Mon Sep 17 00:00:00 2001 From: 4meta5 Date: Mon, 7 Oct 2024 18:22:05 -0400 Subject: [PATCH 07/24] dmail bound path and to fields --- pallets/dmail/src/benchmarking.rs | 19 ++++++++----------- pallets/dmail/src/tests.rs | 6 +++--- primitives/src/dmail.rs | 9 ++++++--- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/pallets/dmail/src/benchmarking.rs b/pallets/dmail/src/benchmarking.rs index 203fa1cc3..0167ec77c 100644 --- a/pallets/dmail/src/benchmarking.rs +++ b/pallets/dmail/src/benchmarking.rs @@ -3,21 +3,16 @@ use crate::Pallet; use scale_info::prelude::string::String; +use frame_system::RawOrigin; use polkadot_sdk::frame_benchmarking::benchmarks; use polkadot_sdk::frame_system; - -use frame_system::RawOrigin; -use time_primitives::AccountId; - -//TODO: choose & enforce MAX in code -const MAX_LENGTH: u32 = 1000; -pub const ALICE: [u8; 32] = [1u8; 32]; +use scale_codec::Encode; +use time_primitives::{DmailPath, DmailTo, DMAIL_PATH_LEN, DMAIL_TO_LEN}; benchmarks! { send_email { - let a in 1..MAX_LENGTH; - let b in 1..MAX_LENGTH; - let caller: AccountId = ALICE.into(); + let a in 1..DMAIL_TO_LEN; + let b in 1..DMAIL_PATH_LEN; let mut to = String::new(); let mut path = String::new(); @@ -27,7 +22,9 @@ benchmarks! { for _ in 0..b { path.push('b'); } - }: _(RawOrigin::Signed(caller), to, path) + let to = DmailTo::truncate_from(to.as_str().encode()); + let path = DmailPath::truncate_from(path.as_str().encode()); + }: _(RawOrigin::Signed([0u8; 32].into()), to, path) verify {} impl_benchmark_test_suite!(Pallet, crate::mock::new_test_ext(), crate::mock::Test); diff --git a/pallets/dmail/src/tests.rs b/pallets/dmail/src/tests.rs index 69e165d0a..7718790be 100644 --- a/pallets/dmail/src/tests.rs +++ b/pallets/dmail/src/tests.rs @@ -5,13 +5,13 @@ use polkadot_sdk::{frame_support, frame_system}; use frame_support::assert_ok; use frame_system::RawOrigin; - +use scale_codec::Encode; use time_primitives::{DmailMessage, DmailPath, DmailTo}; #[test] fn test_dmail_event() { - let to: DmailTo = "Self".into(); - let path: DmailPath = "//self".into(); + let to: DmailTo = DmailTo::truncate_from("Self".encode()); + let path: DmailPath = DmailPath::truncate_from("//self".encode()); let sender: AccountId = [1; 32].into(); let event = DmailMessage { owner: sender.clone(), diff --git a/primitives/src/dmail.rs b/primitives/src/dmail.rs index b4bd8bfe6..6f61ca0dd 100644 --- a/primitives/src/dmail.rs +++ b/primitives/src/dmail.rs @@ -1,10 +1,13 @@ +use crate::AccountId; +use polkadot_sdk::{sp_core::ConstU32, sp_runtime::BoundedVec}; use scale_codec::{Decode, Encode}; use scale_info::{prelude::string::String, TypeInfo}; -use crate::AccountId; +pub const DMAIL_TO_LEN: u32 = 100; +pub const DMAIL_PATH_LEN: u32 = 100; -pub type DmailTo = String; -pub type DmailPath = String; +pub type DmailTo = BoundedVec>; +pub type DmailPath = BoundedVec>; #[derive(Encode, Decode, TypeInfo, PartialEq, Eq, Clone, Debug)] pub struct DmailMessage { From f6279ca99c37829545a0fb26256d864b185a66ce Mon Sep 17 00:00:00 2001 From: 4meta5 Date: Tue, 8 Oct 2024 19:30:56 -0400 Subject: [PATCH 08/24] fix --- pallets/tasks/src/benchmarking.rs | 6 +++--- pallets/tasks/src/tests.rs | 8 ++++---- primitives/src/dmail.rs | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pallets/tasks/src/benchmarking.rs b/pallets/tasks/src/benchmarking.rs index 59f5cfa34..a1db585a2 100644 --- a/pallets/tasks/src/benchmarking.rs +++ b/pallets/tasks/src/benchmarking.rs @@ -8,8 +8,8 @@ use pallet_shards::{ShardCommitment, ShardState}; use polkadot_sdk::{frame_benchmarking, frame_support, frame_system, sp_std}; use sp_std::vec; use time_primitives::{ - GmpEvents, NetworkId, ShardStatus, ShardsInterface, Task, TaskResult, TasksInterface, - TssPublicKey, TssSignature, + Commitment, GmpEvents, NetworkId, ShardStatus, ShardsInterface, Task, TaskResult, + TasksInterface, TssPublicKey, TssSignature, }; // Generated by running tests::bench_helper::print_valid_result @@ -32,7 +32,7 @@ fn create_simple_task() { 1, ); ShardState::::insert(0, ShardStatus::Online); - ShardCommitment::::insert(0, vec![PUBKEY]); + ShardCommitment::::insert(0, Commitment::truncate_from(vec![PUBKEY])); Pallet::::shard_online(0, ETHEREUM); Pallet::::create_task(ETHEREUM, Task::ReadGatewayEvents { blocks: 0..10 }); } diff --git a/pallets/tasks/src/tests.rs b/pallets/tasks/src/tests.rs index 4065bd143..ad1dc8bfd 100644 --- a/pallets/tasks/src/tests.rs +++ b/pallets/tasks/src/tests.rs @@ -7,9 +7,9 @@ use pallet_shards::{ShardCommitment, ShardState}; use polkadot_sdk::{frame_support, frame_system}; use scale_codec::Encode; use time_primitives::{ - traits::IdentifyAccount, ErrorMsg, GatewayMessage, GatewayOp, GmpEvent, GmpEvents, GmpMessage, - MockTssSigner, NetworkId, PublicKey, ShardId, ShardStatus, ShardsInterface, Task, TaskId, - TaskResult, TasksInterface, TssPublicKey, TssSignature, + traits::IdentifyAccount, Commitment, ErrorMsg, GatewayMessage, GatewayOp, GmpEvent, GmpEvents, + GmpMessage, MockTssSigner, NetworkId, PublicKey, ShardId, ShardStatus, ShardsInterface, Task, + TaskId, TaskResult, TasksInterface, TssPublicKey, TssSignature, }; const ETHEREUM: NetworkId = 0; @@ -21,7 +21,7 @@ fn create_shard(network: NetworkId, n: u8, t: u16) -> ShardId { } let shard_id = Shards::create_shard(network, members, t).0; let pub_key = MockTssSigner::new(shard_id).public_key(); - ShardCommitment::::insert(shard_id, vec![pub_key]); + ShardCommitment::::insert(shard_id, Commitment::truncate_from(vec![pub_key])); ShardState::::insert(shard_id, ShardStatus::Online); Tasks::shard_online(shard_id, network); shard_id diff --git a/primitives/src/dmail.rs b/primitives/src/dmail.rs index 6f61ca0dd..dfdd091d3 100644 --- a/primitives/src/dmail.rs +++ b/primitives/src/dmail.rs @@ -1,10 +1,10 @@ use crate::AccountId; use polkadot_sdk::{sp_core::ConstU32, sp_runtime::BoundedVec}; use scale_codec::{Decode, Encode}; -use scale_info::{prelude::string::String, TypeInfo}; +use scale_info::TypeInfo; -pub const DMAIL_TO_LEN: u32 = 100; -pub const DMAIL_PATH_LEN: u32 = 100; +pub const DMAIL_TO_LEN: u32 = 64; +pub const DMAIL_PATH_LEN: u32 = 64; pub type DmailTo = BoundedVec>; pub type DmailPath = BoundedVec>; From 5805057577f4f62d529c5f31b19703b7a6b7545e Mon Sep 17 00:00:00 2001 From: Github Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 9 Oct 2024 06:06:36 +0000 Subject: [PATCH 09/24] runtimes: update pallet weights --- runtimes/mainnet/src/weights/dmail.rs | 22 ++++++++++----------- runtimes/mainnet/src/weights/elections.rs | 6 +++--- runtimes/mainnet/src/weights/members.rs | 14 ++++++------- runtimes/mainnet/src/weights/networks.rs | 22 ++++++++++----------- runtimes/mainnet/src/weights/shards.rs | 18 ++++++++--------- runtimes/mainnet/src/weights/tasks.rs | 24 +++++++++++------------ runtimes/mainnet/src/weights/timegraph.rs | 10 +++++----- runtimes/testnet/src/weights/dmail.rs | 22 ++++++++++----------- runtimes/testnet/src/weights/elections.rs | 6 +++--- runtimes/testnet/src/weights/members.rs | 14 ++++++------- runtimes/testnet/src/weights/networks.rs | 24 +++++++++++------------ runtimes/testnet/src/weights/shards.rs | 18 ++++++++--------- runtimes/testnet/src/weights/tasks.rs | 24 +++++++++++------------ runtimes/testnet/src/weights/timegraph.rs | 10 +++++----- 14 files changed, 113 insertions(+), 121 deletions(-) diff --git a/runtimes/mainnet/src/weights/dmail.rs b/runtimes/mainnet/src/weights/dmail.rs index 20ecdf751..8a9d5026b 100644 --- a/runtimes/mainnet/src/weights/dmail.rs +++ b/runtimes/mainnet/src/weights/dmail.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_dmail` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -33,20 +33,20 @@ use core::marker::PhantomData; /// Weight functions for `pallet_dmail`. pub struct WeightInfo(PhantomData); impl pallet_dmail::WeightInfo for WeightInfo { - /// The range of component `a` is `[1, 1000]`. - /// The range of component `b` is `[1, 1000]`. - /// The range of component `a` is `[1, 1000]`. - /// The range of component `b` is `[1, 1000]`. + /// The range of component `a` is `[1, 64]`. + /// The range of component `b` is `[1, 64]`. + /// The range of component `a` is `[1, 64]`. + /// The range of component `b` is `[1, 64]`. fn send_email(a: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 8_306_000 picoseconds. - Weight::from_parts(8_154_792, 0) + // Minimum execution time: 7_234_000 picoseconds. + Weight::from_parts(9_606_857, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 64 - .saturating_add(Weight::from_parts(1_709, 0).saturating_mul(a.into())) - // Standard Error: 64 - .saturating_add(Weight::from_parts(1_390, 0).saturating_mul(b.into())) + // Standard Error: 1_599 + .saturating_add(Weight::from_parts(10_503, 0).saturating_mul(a.into())) + // Standard Error: 1_599 + .saturating_add(Weight::from_parts(5_718, 0).saturating_mul(b.into())) } } diff --git a/runtimes/mainnet/src/weights/elections.rs b/runtimes/mainnet/src/weights/elections.rs index d8d21243d..69d134511 100644 --- a/runtimes/mainnet/src/weights/elections.rs +++ b/runtimes/mainnet/src/weights/elections.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_elections` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -43,8 +43,8 @@ impl pallet_elections::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `123` // Estimated: `3588` - // Minimum execution time: 12_032_000 picoseconds. - Weight::from_parts(12_934_000, 0) + // Minimum execution time: 12_073_000 picoseconds. + Weight::from_parts(12_965_000, 0) .saturating_add(Weight::from_parts(0, 3588)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/runtimes/mainnet/src/weights/members.rs b/runtimes/mainnet/src/weights/members.rs index 99808a445..080a70087 100644 --- a/runtimes/mainnet/src/weights/members.rs +++ b/runtimes/mainnet/src/weights/members.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_members` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -57,8 +57,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `244` // Estimated: `3709` - // Minimum execution time: 65_983_000 picoseconds. - Weight::from_parts(69_980_000, 0) + // Minimum execution time: 60_554_000 picoseconds. + Weight::from_parts(62_817_000, 0) .saturating_add(Weight::from_parts(0, 3709)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) @@ -73,8 +73,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `293` // Estimated: `3758` - // Minimum execution time: 23_444_000 picoseconds. - Weight::from_parts(24_496_000, 0) + // Minimum execution time: 21_550_000 picoseconds. + Weight::from_parts(22_702_000, 0) .saturating_add(Weight::from_parts(0, 3758)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -101,8 +101,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `380` // Estimated: `3845` - // Minimum execution time: 60_433_000 picoseconds. - Weight::from_parts(63_148_000, 0) + // Minimum execution time: 55_224_000 picoseconds. + Weight::from_parts(66_935_000, 0) .saturating_add(Weight::from_parts(0, 3845)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) diff --git a/runtimes/mainnet/src/weights/networks.rs b/runtimes/mainnet/src/weights/networks.rs index 9a27bb420..775a37673 100644 --- a/runtimes/mainnet/src/weights/networks.rs +++ b/runtimes/mainnet/src/weights/networks.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_networks` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -59,19 +59,17 @@ impl pallet_networks::WeightInfo for WeightInfo { /// Proof: `Tasks::ReadEventsTask` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::TaskNetwork` (r:0 w:1) /// Proof: `Tasks::TaskNetwork` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `a` is `[1, 1000]`. - /// The range of component `b` is `[1, 1000]`. - /// The range of component `a` is `[1, 1000]`. - /// The range of component `b` is `[1, 1000]`. - fn register_network(_a: u32, b: u32, ) -> Weight { + /// The range of component `a` is `[1, 50]`. + /// The range of component `b` is `[1, 50]`. + /// The range of component `a` is `[1, 50]`. + /// The range of component `b` is `[1, 50]`. + fn register_network(_a: u32, _b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `118` // Estimated: `3583` - // Minimum execution time: 57_528_000 picoseconds. - Weight::from_parts(67_875_460, 0) + // Minimum execution time: 53_269_000 picoseconds. + Weight::from_parts(67_088_521, 0) .saturating_add(Weight::from_parts(0, 3583)) - // Standard Error: 582 - .saturating_add(Weight::from_parts(2_239, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(13)) } @@ -89,8 +87,8 @@ impl pallet_networks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `277` // Estimated: `3742` - // Minimum execution time: 22_822_000 picoseconds. - Weight::from_parts(24_496_000, 0) + // Minimum execution time: 21_631_000 picoseconds. + Weight::from_parts(24_386_000, 0) .saturating_add(Weight::from_parts(0, 3742)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(4)) diff --git a/runtimes/mainnet/src/weights/shards.rs b/runtimes/mainnet/src/weights/shards.rs index 1936e3a17..07a89bf2e 100644 --- a/runtimes/mainnet/src/weights/shards.rs +++ b/runtimes/mainnet/src/weights/shards.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_shards` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -47,8 +47,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `757` // Estimated: `11647` - // Minimum execution time: 523_901_000 picoseconds. - Weight::from_parts(575_157_000, 0) + // Minimum execution time: 517_770_000 picoseconds. + Weight::from_parts(545_942_000, 0) .saturating_add(Weight::from_parts(0, 11647)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) @@ -69,8 +69,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `591` // Estimated: `11481` - // Minimum execution time: 63_900_000 picoseconds. - Weight::from_parts(74_540_000, 0) + // Minimum execution time: 60_204_000 picoseconds. + Weight::from_parts(64_511_000, 0) .saturating_add(Weight::from_parts(0, 11481)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) @@ -99,8 +99,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `453` // Estimated: `11343` - // Minimum execution time: 75_850_000 picoseconds. - Weight::from_parts(81_784_000, 0) + // Minimum execution time: 72_355_000 picoseconds. + Weight::from_parts(74_830_000, 0) .saturating_add(Weight::from_parts(0, 11343)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(14)) @@ -111,8 +111,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `6` // Estimated: `3471` - // Minimum execution time: 3_676_000 picoseconds. - Weight::from_parts(3_907_000, 0) + // Minimum execution time: 3_437_000 picoseconds. + Weight::from_parts(5_370_000, 0) .saturating_add(Weight::from_parts(0, 3471)) .saturating_add(T::DbWeight::get().reads(1)) } diff --git a/runtimes/mainnet/src/weights/tasks.rs b/runtimes/mainnet/src/weights/tasks.rs index fc1c9c7fe..83e468e8a 100644 --- a/runtimes/mainnet/src/weights/tasks.rs +++ b/runtimes/mainnet/src/weights/tasks.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_tasks` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -41,8 +41,6 @@ impl pallet_tasks::WeightInfo for WeightInfo { /// Proof: `Tasks::TaskShard` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Shards::ShardNetwork` (r:1 w:0) /// Proof: `Shards::ShardNetwork` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Networks::NetworkGatewayAddress` (r:1 w:0) - /// Proof: `Networks::NetworkGatewayAddress` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Shards::ShardCommitment` (r:1 w:0) /// Proof: `Shards::ShardCommitment` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Networks::NetworkBatchSize` (r:1 w:0) @@ -69,12 +67,12 @@ impl pallet_tasks::WeightInfo for WeightInfo { /// Proof: `Tasks::TaskNetwork` (`max_values`: None, `max_size`: None, mode: `Measured`) fn submit_task_result() -> Weight { // Proof Size summary in bytes: - // Measured: `1381` - // Estimated: `12271` - // Minimum execution time: 635_821_000 picoseconds. - Weight::from_parts(685_121_000, 0) - .saturating_add(Weight::from_parts(0, 12271)) - .saturating_add(T::DbWeight::get().reads(20)) + // Measured: `1380` + // Estimated: `12270` + // Minimum execution time: 629_707_000 picoseconds. + Weight::from_parts(686_184_000, 0) + .saturating_add(Weight::from_parts(0, 12270)) + .saturating_add(T::DbWeight::get().reads(19)) .saturating_add(T::DbWeight::get().writes(14)) } /// Storage: `Tasks::ReadEventsTask` (r:2 w:0) @@ -107,11 +105,11 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3665` // Estimated: `9197` - // Minimum execution time: 76_194_000 picoseconds. - Weight::from_parts(143_303_681, 0) + // Minimum execution time: 76_053_000 picoseconds. + Weight::from_parts(135_064_095, 0) .saturating_add(Weight::from_parts(0, 9197)) - // Standard Error: 115 - .saturating_add(Weight::from_parts(7_783, 0).saturating_mul(b.into())) + // Standard Error: 100 + .saturating_add(Weight::from_parts(8_089, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(13)) .saturating_add(T::DbWeight::get().writes(3)) } diff --git a/runtimes/mainnet/src/weights/timegraph.rs b/runtimes/mainnet/src/weights/timegraph.rs index 51f69927d..332d6fb47 100644 --- a/runtimes/mainnet/src/weights/timegraph.rs +++ b/runtimes/mainnet/src/weights/timegraph.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_timegraph` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -41,8 +41,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `3593` - // Minimum execution time: 65_263_000 picoseconds. - Weight::from_parts(66_885_000, 0) + // Minimum execution time: 63_699_000 picoseconds. + Weight::from_parts(69_870_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -55,8 +55,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `3593` - // Minimum execution time: 65_902_000 picoseconds. - Weight::from_parts(67_226_000, 0) + // Minimum execution time: 63_569_000 picoseconds. + Weight::from_parts(69_861_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/runtimes/testnet/src/weights/dmail.rs b/runtimes/testnet/src/weights/dmail.rs index 86059c967..a2776734b 100644 --- a/runtimes/testnet/src/weights/dmail.rs +++ b/runtimes/testnet/src/weights/dmail.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_dmail` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -33,20 +33,18 @@ use core::marker::PhantomData; /// Weight functions for `pallet_dmail`. pub struct WeightInfo(PhantomData); impl pallet_dmail::WeightInfo for WeightInfo { - /// The range of component `a` is `[1, 1000]`. - /// The range of component `b` is `[1, 1000]`. - /// The range of component `a` is `[1, 1000]`. - /// The range of component `b` is `[1, 1000]`. - fn send_email(a: u32, b: u32, ) -> Weight { + /// The range of component `a` is `[1, 64]`. + /// The range of component `b` is `[1, 64]`. + /// The range of component `a` is `[1, 64]`. + /// The range of component `b` is `[1, 64]`. + fn send_email(_a: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 8_026_000 picoseconds. - Weight::from_parts(8_734_292, 0) + // Minimum execution time: 7_442_000 picoseconds. + Weight::from_parts(9_122_500, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 97 - .saturating_add(Weight::from_parts(858, 0).saturating_mul(a.into())) - // Standard Error: 97 - .saturating_add(Weight::from_parts(997, 0).saturating_mul(b.into())) + // Standard Error: 1_336 + .saturating_add(Weight::from_parts(18_364, 0).saturating_mul(b.into())) } } diff --git a/runtimes/testnet/src/weights/elections.rs b/runtimes/testnet/src/weights/elections.rs index c32d68431..f4b976bbe 100644 --- a/runtimes/testnet/src/weights/elections.rs +++ b/runtimes/testnet/src/weights/elections.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_elections` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -43,8 +43,8 @@ impl pallet_elections::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `123` // Estimated: `3588` - // Minimum execution time: 12_233_000 picoseconds. - Weight::from_parts(14_056_000, 0) + // Minimum execution time: 12_172_000 picoseconds. + Weight::from_parts(13_184_000, 0) .saturating_add(Weight::from_parts(0, 3588)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/runtimes/testnet/src/weights/members.rs b/runtimes/testnet/src/weights/members.rs index e2b0e2555..2915cc08b 100644 --- a/runtimes/testnet/src/weights/members.rs +++ b/runtimes/testnet/src/weights/members.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_members` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -57,8 +57,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `244` // Estimated: `3709` - // Minimum execution time: 63_728_000 picoseconds. - Weight::from_parts(75_172_000, 0) + // Minimum execution time: 66_133_000 picoseconds. + Weight::from_parts(68_698_000, 0) .saturating_add(Weight::from_parts(0, 3709)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) @@ -73,8 +73,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `293` // Estimated: `3758` - // Minimum execution time: 22_552_000 picoseconds. - Weight::from_parts(25_057_000, 0) + // Minimum execution time: 23_043_000 picoseconds. + Weight::from_parts(24_115_000, 0) .saturating_add(Weight::from_parts(0, 3758)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -101,8 +101,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `380` // Estimated: `3845` - // Minimum execution time: 58_929_000 picoseconds. - Weight::from_parts(96_210_000, 0) + // Minimum execution time: 59_742_000 picoseconds. + Weight::from_parts(62_566_000, 0) .saturating_add(Weight::from_parts(0, 3845)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) diff --git a/runtimes/testnet/src/weights/networks.rs b/runtimes/testnet/src/weights/networks.rs index b5664fd0b..1fe44495c 100644 --- a/runtimes/testnet/src/weights/networks.rs +++ b/runtimes/testnet/src/weights/networks.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_networks` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -59,19 +59,19 @@ impl pallet_networks::WeightInfo for WeightInfo { /// Proof: `Tasks::ReadEventsTask` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::TaskNetwork` (r:0 w:1) /// Proof: `Tasks::TaskNetwork` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `a` is `[1, 1000]`. - /// The range of component `b` is `[1, 1000]`. - /// The range of component `a` is `[1, 1000]`. - /// The range of component `b` is `[1, 1000]`. - fn register_network(a: u32, _b: u32, ) -> Weight { + /// The range of component `a` is `[1, 50]`. + /// The range of component `b` is `[1, 50]`. + /// The range of component `a` is `[1, 50]`. + /// The range of component `b` is `[1, 50]`. + fn register_network(_a: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `118` // Estimated: `3583` - // Minimum execution time: 58_479_000 picoseconds. - Weight::from_parts(83_677_227, 0) + // Minimum execution time: 54_001_000 picoseconds. + Weight::from_parts(63_811_734, 0) .saturating_add(Weight::from_parts(0, 3583)) - // Standard Error: 857 - .saturating_add(Weight::from_parts(306, 0).saturating_mul(a.into())) + // Standard Error: 17_263 + .saturating_add(Weight::from_parts(105_314, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(13)) } @@ -89,8 +89,8 @@ impl pallet_networks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `277` // Estimated: `3742` - // Minimum execution time: 23_053_000 picoseconds. - Weight::from_parts(26_610_000, 0) + // Minimum execution time: 21_320_000 picoseconds. + Weight::from_parts(22_081_000, 0) .saturating_add(Weight::from_parts(0, 3742)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(4)) diff --git a/runtimes/testnet/src/weights/shards.rs b/runtimes/testnet/src/weights/shards.rs index f3802ccca..3ff7fbf74 100644 --- a/runtimes/testnet/src/weights/shards.rs +++ b/runtimes/testnet/src/weights/shards.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_shards` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -47,8 +47,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `757` // Estimated: `11647` - // Minimum execution time: 529_191_000 picoseconds. - Weight::from_parts(612_456_000, 0) + // Minimum execution time: 512_859_000 picoseconds. + Weight::from_parts(520_954_000, 0) .saturating_add(Weight::from_parts(0, 11647)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) @@ -69,8 +69,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `591` // Estimated: `11481` - // Minimum execution time: 62_176_000 picoseconds. - Weight::from_parts(68_717_000, 0) + // Minimum execution time: 59_290_000 picoseconds. + Weight::from_parts(62_227_000, 0) .saturating_add(Weight::from_parts(0, 11481)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) @@ -99,8 +99,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `453` // Estimated: `11343` - // Minimum execution time: 74_419_000 picoseconds. - Weight::from_parts(78_317_000, 0) + // Minimum execution time: 71_062_000 picoseconds. + Weight::from_parts(74_329_000, 0) .saturating_add(Weight::from_parts(0, 11343)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(14)) @@ -111,8 +111,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `6` // Estimated: `3471` - // Minimum execution time: 3_667_000 picoseconds. - Weight::from_parts(3_867_000, 0) + // Minimum execution time: 3_446_000 picoseconds. + Weight::from_parts(3_687_000, 0) .saturating_add(Weight::from_parts(0, 3471)) .saturating_add(T::DbWeight::get().reads(1)) } diff --git a/runtimes/testnet/src/weights/tasks.rs b/runtimes/testnet/src/weights/tasks.rs index fb394db88..cb475cb35 100644 --- a/runtimes/testnet/src/weights/tasks.rs +++ b/runtimes/testnet/src/weights/tasks.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_tasks` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -41,8 +41,6 @@ impl pallet_tasks::WeightInfo for WeightInfo { /// Proof: `Tasks::TaskShard` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Shards::ShardNetwork` (r:1 w:0) /// Proof: `Shards::ShardNetwork` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Networks::NetworkGatewayAddress` (r:1 w:0) - /// Proof: `Networks::NetworkGatewayAddress` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Shards::ShardCommitment` (r:1 w:0) /// Proof: `Shards::ShardCommitment` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Networks::NetworkBatchSize` (r:1 w:0) @@ -69,12 +67,12 @@ impl pallet_tasks::WeightInfo for WeightInfo { /// Proof: `Tasks::TaskNetwork` (`max_values`: None, `max_size`: None, mode: `Measured`) fn submit_task_result() -> Weight { // Proof Size summary in bytes: - // Measured: `1381` - // Estimated: `12271` - // Minimum execution time: 661_105_000 picoseconds. - Weight::from_parts(739_063_000, 0) - .saturating_add(Weight::from_parts(0, 12271)) - .saturating_add(T::DbWeight::get().reads(20)) + // Measured: `1380` + // Estimated: `12270` + // Minimum execution time: 623_897_000 picoseconds. + Weight::from_parts(638_574_000, 0) + .saturating_add(Weight::from_parts(0, 12270)) + .saturating_add(T::DbWeight::get().reads(19)) .saturating_add(T::DbWeight::get().writes(14)) } /// Storage: `Tasks::ReadEventsTask` (r:2 w:0) @@ -107,11 +105,11 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3665` // Estimated: `9197` - // Minimum execution time: 80_151_000 picoseconds. - Weight::from_parts(146_706_263, 0) + // Minimum execution time: 74_490_000 picoseconds. + Weight::from_parts(135_321_848, 0) .saturating_add(Weight::from_parts(0, 9197)) - // Standard Error: 109 - .saturating_add(Weight::from_parts(7_616, 0).saturating_mul(b.into())) + // Standard Error: 106 + .saturating_add(Weight::from_parts(8_091, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(13)) .saturating_add(T::DbWeight::get().writes(3)) } diff --git a/runtimes/testnet/src/weights/timegraph.rs b/runtimes/testnet/src/weights/timegraph.rs index a804b84c4..94fe397c3 100644 --- a/runtimes/testnet/src/weights/timegraph.rs +++ b/runtimes/testnet/src/weights/timegraph.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_timegraph` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -41,8 +41,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `3593` - // Minimum execution time: 63_069_000 picoseconds. - Weight::from_parts(89_106_000, 0) + // Minimum execution time: 61_184_000 picoseconds. + Weight::from_parts(63_950_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -55,8 +55,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `3593` - // Minimum execution time: 62_978_000 picoseconds. - Weight::from_parts(99_425_000, 0) + // Minimum execution time: 59_882_000 picoseconds. + Weight::from_parts(62_277_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) From bf9bc8e2a774a3c9bef5f6f4d8f336f76e9d259e Mon Sep 17 00:00:00 2001 From: 4meta5 Date: Thu, 10 Oct 2024 23:15:50 -0400 Subject: [PATCH 10/24] fix testnet test setup for network struct --- runtimes/testnet/src/tests.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtimes/testnet/src/tests.rs b/runtimes/testnet/src/tests.rs index afabdd7e4..af2dbe9af 100644 --- a/runtimes/testnet/src/tests.rs +++ b/runtimes/testnet/src/tests.rs @@ -32,8 +32,8 @@ fn get_peer_id(random_num: [u8; 32]) -> [u8; 32] { fn network() -> Network { Network { id: ETHEREUM, - chain_name: "ethereum".into(), - chain_network: "dev".into(), + chain_name: ChainName::truncate_from("ethereum".encode()), + chain_network: ChainNetwork::truncate_from("dev".encode()), gateway: [0u8; 32], gateway_block: 0, config: NetworkConfig { From 496bd600c715411890adfeef24515fde7e94c629 Mon Sep 17 00:00:00 2001 From: 4meta5 Date: Thu, 10 Oct 2024 23:47:06 -0400 Subject: [PATCH 11/24] fix --- pallets/tasks/src/benchmarking.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pallets/tasks/src/benchmarking.rs b/pallets/tasks/src/benchmarking.rs index 0574a7f62..c5f39d9ca 100644 --- a/pallets/tasks/src/benchmarking.rs +++ b/pallets/tasks/src/benchmarking.rs @@ -32,7 +32,7 @@ fn create_simple_task() { 1, ); ShardState::::insert(shard_id, ShardStatus::Online); - ShardCommitment::::insert(shard_id, vec![PUBKEY]); + ShardCommitment::::insert(shard_id, Commitment::truncate_from(vec![PUBKEY])); Pallet::::shard_online(shard_id, ETHEREUM); Pallet::::create_task(ETHEREUM, Task::ReadGatewayEvents { blocks: 0..10 }); } From 71bc841178bc30ba0a5521d92668e4d457803c06 Mon Sep 17 00:00:00 2001 From: 4meta5 Date: Fri, 11 Oct 2024 00:11:39 -0400 Subject: [PATCH 12/24] fix another merge conflict --- runtimes/testnet/src/weights/dmail.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtimes/testnet/src/weights/dmail.rs b/runtimes/testnet/src/weights/dmail.rs index dde78fefd..f4cca84ba 100644 --- a/runtimes/testnet/src/weights/dmail.rs +++ b/runtimes/testnet/src/weights/dmail.rs @@ -37,7 +37,7 @@ impl pallet_dmail::WeightInfo for WeightInfo { /// The range of component `b` is `[1, 64]`. /// The range of component `a` is `[1, 64]`. /// The range of component `b` is `[1, 64]`. - fn send_email(_a: u32, b: u32, ) -> Weight { + fn send_email(a: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` From d7d6c0f99b7ad7014b06c1c2cd9dae7b88b5ff32 Mon Sep 17 00:00:00 2001 From: Github Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 05:22:07 +0000 Subject: [PATCH 13/24] runtimes: update pallet weights --- runtimes/mainnet/src/weights/dmail.rs | 14 ++++----- runtimes/mainnet/src/weights/elections.rs | 6 ++-- runtimes/mainnet/src/weights/members.rs | 14 ++++----- runtimes/mainnet/src/weights/networks.rs | 26 ++++++++-------- runtimes/mainnet/src/weights/shards.rs | 18 +++++------ runtimes/mainnet/src/weights/tasks.rs | 38 +++++++++++------------ runtimes/mainnet/src/weights/timegraph.rs | 10 +++--- runtimes/testnet/src/weights/dmail.rs | 14 ++++----- runtimes/testnet/src/weights/elections.rs | 6 ++-- runtimes/testnet/src/weights/members.rs | 14 ++++----- runtimes/testnet/src/weights/networks.rs | 18 +++++------ runtimes/testnet/src/weights/shards.rs | 18 +++++------ runtimes/testnet/src/weights/tasks.rs | 38 +++++++++++------------ runtimes/testnet/src/weights/timegraph.rs | 10 +++--- 14 files changed, 121 insertions(+), 123 deletions(-) diff --git a/runtimes/mainnet/src/weights/dmail.rs b/runtimes/mainnet/src/weights/dmail.rs index a29b1fa41..a734a1ac8 100644 --- a/runtimes/mainnet/src/weights/dmail.rs +++ b/runtimes/mainnet/src/weights/dmail.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_dmail` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-11, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -41,12 +41,12 @@ impl pallet_dmail::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 8_194_000 picoseconds. - Weight::from_parts(6_902_453, 0) + // Minimum execution time: 7_134_000 picoseconds. + Weight::from_parts(8_002_439, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 89 - .saturating_add(Weight::from_parts(2_112, 0).saturating_mul(a.into())) - // Standard Error: 89 - .saturating_add(Weight::from_parts(1_764, 0).saturating_mul(b.into())) + // Standard Error: 1_124 + .saturating_add(Weight::from_parts(5_479, 0).saturating_mul(a.into())) + // Standard Error: 1_124 + .saturating_add(Weight::from_parts(7_546, 0).saturating_mul(b.into())) } } diff --git a/runtimes/mainnet/src/weights/elections.rs b/runtimes/mainnet/src/weights/elections.rs index 7dcea34dd..a0bcb7db5 100644 --- a/runtimes/mainnet/src/weights/elections.rs +++ b/runtimes/mainnet/src/weights/elections.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_elections` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-11, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -43,8 +43,8 @@ impl pallet_elections::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `123` // Estimated: `3588` - // Minimum execution time: 12_043_000 picoseconds. - Weight::from_parts(15_699_000, 0) + // Minimum execution time: 12_182_000 picoseconds. + Weight::from_parts(13_385_000, 0) .saturating_add(Weight::from_parts(0, 3588)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/runtimes/mainnet/src/weights/members.rs b/runtimes/mainnet/src/weights/members.rs index 4a8174dea..962a1859b 100644 --- a/runtimes/mainnet/src/weights/members.rs +++ b/runtimes/mainnet/src/weights/members.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_members` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-11, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -57,8 +57,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `244` // Estimated: `3709` - // Minimum execution time: 62_598_000 picoseconds. - Weight::from_parts(71_073_000, 0) + // Minimum execution time: 64_452_000 picoseconds. + Weight::from_parts(66_093_000, 0) .saturating_add(Weight::from_parts(0, 3709)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) @@ -73,8 +73,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `293` // Estimated: `3758` - // Minimum execution time: 22_793_000 picoseconds. - Weight::from_parts(25_318_000, 0) + // Minimum execution time: 22_272_000 picoseconds. + Weight::from_parts(23_183_000, 0) .saturating_add(Weight::from_parts(0, 3758)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -101,8 +101,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `380` // Estimated: `3845` - // Minimum execution time: 58_098_000 picoseconds. - Weight::from_parts(62_848_000, 0) + // Minimum execution time: 58_599_000 picoseconds. + Weight::from_parts(60_023_000, 0) .saturating_add(Weight::from_parts(0, 3845)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) diff --git a/runtimes/mainnet/src/weights/networks.rs b/runtimes/mainnet/src/weights/networks.rs index e032398b7..b0b63d474 100644 --- a/runtimes/mainnet/src/weights/networks.rs +++ b/runtimes/mainnet/src/weights/networks.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_networks` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-11, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -59,21 +59,21 @@ impl pallet_networks::WeightInfo for WeightInfo { /// Proof: `Tasks::ReadEventsTask` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::TaskNetwork` (r:0 w:1) /// Proof: `Tasks::TaskNetwork` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `a` is `[1, 1000]`. - /// The range of component `b` is `[1, 1000]`. - /// The range of component `a` is `[1, 1000]`. - /// The range of component `b` is `[1, 1000]`. + /// The range of component `a` is `[1, 50]`. + /// The range of component `b` is `[1, 50]`. + /// The range of component `a` is `[1, 50]`. + /// The range of component `b` is `[1, 50]`. fn register_network(a: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `118` // Estimated: `3583` - // Minimum execution time: 59_722_000 picoseconds. - Weight::from_parts(53_225_243, 0) + // Minimum execution time: 52_307_000 picoseconds. + Weight::from_parts(55_666_940, 0) .saturating_add(Weight::from_parts(0, 3583)) - // Standard Error: 951 - .saturating_add(Weight::from_parts(14_180, 0).saturating_mul(a.into())) - // Standard Error: 951 - .saturating_add(Weight::from_parts(8_256, 0).saturating_mul(b.into())) + // Standard Error: 9_831 + .saturating_add(Weight::from_parts(34_555, 0).saturating_mul(a.into())) + // Standard Error: 9_831 + .saturating_add(Weight::from_parts(40_085, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(13)) } @@ -91,8 +91,8 @@ impl pallet_networks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `277` // Estimated: `3742` - // Minimum execution time: 22_993_000 picoseconds. - Weight::from_parts(33_282_000, 0) + // Minimum execution time: 20_688_000 picoseconds. + Weight::from_parts(21_630_000, 0) .saturating_add(Weight::from_parts(0, 3742)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(4)) diff --git a/runtimes/mainnet/src/weights/shards.rs b/runtimes/mainnet/src/weights/shards.rs index f25de6c64..33abc3625 100644 --- a/runtimes/mainnet/src/weights/shards.rs +++ b/runtimes/mainnet/src/weights/shards.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_shards` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-11, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -47,8 +47,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `757` // Estimated: `11647` - // Minimum execution time: 514_212_000 picoseconds. - Weight::from_parts(526_125_000, 0) + // Minimum execution time: 515_523_000 picoseconds. + Weight::from_parts(529_200_000, 0) .saturating_add(Weight::from_parts(0, 11647)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) @@ -69,8 +69,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `591` // Estimated: `11481` - // Minimum execution time: 59_812_000 picoseconds. - Weight::from_parts(63_157_000, 0) + // Minimum execution time: 61_725_000 picoseconds. + Weight::from_parts(66_133_000, 0) .saturating_add(Weight::from_parts(0, 11481)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) @@ -99,8 +99,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `453` // Estimated: `11343` - // Minimum execution time: 71_615_000 picoseconds. - Weight::from_parts(75_992_000, 0) + // Minimum execution time: 75_942_000 picoseconds. + Weight::from_parts(78_025_000, 0) .saturating_add(Weight::from_parts(0, 11343)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(14)) @@ -111,8 +111,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `6` // Estimated: `3471` - // Minimum execution time: 3_507_000 picoseconds. - Weight::from_parts(3_807_000, 0) + // Minimum execution time: 3_707_000 picoseconds. + Weight::from_parts(3_917_000, 0) .saturating_add(Weight::from_parts(0, 3471)) .saturating_add(T::DbWeight::get().reads(1)) } diff --git a/runtimes/mainnet/src/weights/tasks.rs b/runtimes/mainnet/src/weights/tasks.rs index 9e31a0022..02792defd 100644 --- a/runtimes/mainnet/src/weights/tasks.rs +++ b/runtimes/mainnet/src/weights/tasks.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_tasks` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-11, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -69,8 +69,8 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1380` // Estimated: `12270` - // Minimum execution time: 624_318_000 picoseconds. - Weight::from_parts(698_456_000, 0) + // Minimum execution time: 621_113_000 picoseconds. + Weight::from_parts(632_674_000, 0) .saturating_add(Weight::from_parts(0, 12270)) .saturating_add(T::DbWeight::get().reads(19)) .saturating_add(T::DbWeight::get().writes(14)) @@ -81,33 +81,33 @@ impl pallet_tasks::WeightInfo for WeightInfo { /// Proof: `Networks::NetworkShardTaskLimit` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::TaskShard` (r:1 w:1) /// Proof: `Tasks::TaskShard` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Tasks::NetworkShards` (r:10001 w:0) + /// Storage: `Tasks::NetworkShards` (r:1501 w:0) /// Proof: `Tasks::NetworkShards` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::ShardTaskCount` (r:1 w:1) /// Proof: `Tasks::ShardTaskCount` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::Tasks` (r:1 w:0) /// Proof: `Tasks::Tasks` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Shards::ShardCommitment` (r:10000 w:0) + /// Storage: `Shards::ShardCommitment` (r:1500 w:0) /// Proof: `Shards::ShardCommitment` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::ShardRegistered` (r:1 w:0) /// Proof: `Tasks::ShardRegistered` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::ShardTasks` (r:0 w:1) /// Proof: `Tasks::ShardTasks` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `b` is `[1, 10000]`. - /// The range of component `b` is `[1, 10000]`. + /// The range of component `b` is `[1, 1500]`. + /// The range of component `b` is `[1, 1500]`. fn schedule_tasks(b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `4412 + b * (91 ±0)` - // Estimated: `10028 + b * (2566 ±0)` - // Minimum execution time: 59_763_000 picoseconds. - Weight::from_parts(63_449_000, 0) - .saturating_add(Weight::from_parts(0, 10028)) - // Standard Error: 10_361 - .saturating_add(Weight::from_parts(11_731_446, 0).saturating_mul(b.into())) + // Measured: `2647 + b * (92 ±0)` + // Estimated: `8309 + b * (2568 ±0)` + // Minimum execution time: 61_124_000 picoseconds. + Weight::from_parts(62_858_000, 0) + .saturating_add(Weight::from_parts(0, 8309)) + // Standard Error: 4_891 + .saturating_add(Weight::from_parts(10_569_998, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(3)) - .saturating_add(Weight::from_parts(0, 2566).saturating_mul(b.into())) + .saturating_add(Weight::from_parts(0, 2568).saturating_mul(b.into())) } /// Storage: `Tasks::ReadEventsTask` (r:2 w:0) /// Proof: `Tasks::ReadEventsTask` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -123,11 +123,11 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `958` // Estimated: `6794 + b * (1 ±0)` - // Minimum execution time: 25_137_000 picoseconds. - Weight::from_parts(43_753_099, 0) + // Minimum execution time: 26_249_000 picoseconds. + Weight::from_parts(45_243_749, 0) .saturating_add(Weight::from_parts(0, 6794)) - // Standard Error: 345 - .saturating_add(Weight::from_parts(14_169, 0).saturating_mul(b.into())) + // Standard Error: 409 + .saturating_add(Weight::from_parts(12_293, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) } diff --git a/runtimes/mainnet/src/weights/timegraph.rs b/runtimes/mainnet/src/weights/timegraph.rs index cf569c93a..fb76695d5 100644 --- a/runtimes/mainnet/src/weights/timegraph.rs +++ b/runtimes/mainnet/src/weights/timegraph.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_timegraph` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-11, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -41,8 +41,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `3593` - // Minimum execution time: 62_948_000 picoseconds. - Weight::from_parts(91_992_000, 0) + // Minimum execution time: 61_545_000 picoseconds. + Weight::from_parts(63_007_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -55,8 +55,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `3593` - // Minimum execution time: 62_627_000 picoseconds. - Weight::from_parts(68_719_000, 0) + // Minimum execution time: 60_192_000 picoseconds. + Weight::from_parts(62_297_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/runtimes/testnet/src/weights/dmail.rs b/runtimes/testnet/src/weights/dmail.rs index f4cca84ba..12cf2386d 100644 --- a/runtimes/testnet/src/weights/dmail.rs +++ b/runtimes/testnet/src/weights/dmail.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_dmail` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-11, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -37,16 +37,14 @@ impl pallet_dmail::WeightInfo for WeightInfo { /// The range of component `b` is `[1, 64]`. /// The range of component `a` is `[1, 64]`. /// The range of component `b` is `[1, 64]`. - fn send_email(a: u32, b: u32, ) -> Weight { + fn send_email(_a: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 8_006_000 picoseconds. - Weight::from_parts(7_871_314, 0) + // Minimum execution time: 7_003_000 picoseconds. + Weight::from_parts(7_842_896, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 74 - .saturating_add(Weight::from_parts(941, 0).saturating_mul(a.into())) - // Standard Error: 74 - .saturating_add(Weight::from_parts(1_044, 0).saturating_mul(b.into())) + // Standard Error: 1_028 + .saturating_add(Weight::from_parts(3_663, 0).saturating_mul(b.into())) } } diff --git a/runtimes/testnet/src/weights/elections.rs b/runtimes/testnet/src/weights/elections.rs index ddfd2dd3e..3c9846346 100644 --- a/runtimes/testnet/src/weights/elections.rs +++ b/runtimes/testnet/src/weights/elections.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_elections` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-11, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -43,8 +43,8 @@ impl pallet_elections::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `123` // Estimated: `3588` - // Minimum execution time: 11_972_000 picoseconds. - Weight::from_parts(14_357_000, 0) + // Minimum execution time: 12_223_000 picoseconds. + Weight::from_parts(19_336_000, 0) .saturating_add(Weight::from_parts(0, 3588)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/runtimes/testnet/src/weights/members.rs b/runtimes/testnet/src/weights/members.rs index d84085ead..089e38dc3 100644 --- a/runtimes/testnet/src/weights/members.rs +++ b/runtimes/testnet/src/weights/members.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_members` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-11, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -57,8 +57,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `244` // Estimated: `3709` - // Minimum execution time: 61_496_000 picoseconds. - Weight::from_parts(64_841_000, 0) + // Minimum execution time: 60_805_000 picoseconds. + Weight::from_parts(62_798_000, 0) .saturating_add(Weight::from_parts(0, 3709)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) @@ -73,8 +73,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `293` // Estimated: `3758` - // Minimum execution time: 22_101_000 picoseconds. - Weight::from_parts(23_594_000, 0) + // Minimum execution time: 21_961_000 picoseconds. + Weight::from_parts(22_662_000, 0) .saturating_add(Weight::from_parts(0, 3758)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -101,8 +101,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `380` // Estimated: `3845` - // Minimum execution time: 57_117_000 picoseconds. - Weight::from_parts(60_143_000, 0) + // Minimum execution time: 54_893_000 picoseconds. + Weight::from_parts(56_846_000, 0) .saturating_add(Weight::from_parts(0, 3845)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) diff --git a/runtimes/testnet/src/weights/networks.rs b/runtimes/testnet/src/weights/networks.rs index 756a5edb0..bf33808b7 100644 --- a/runtimes/testnet/src/weights/networks.rs +++ b/runtimes/testnet/src/weights/networks.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_networks` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-11, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -59,16 +59,16 @@ impl pallet_networks::WeightInfo for WeightInfo { /// Proof: `Tasks::ReadEventsTask` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::TaskNetwork` (r:0 w:1) /// Proof: `Tasks::TaskNetwork` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `a` is `[1, 1000]`. - /// The range of component `b` is `[1, 1000]`. - /// The range of component `a` is `[1, 1000]`. - /// The range of component `b` is `[1, 1000]`. + /// The range of component `a` is `[1, 50]`. + /// The range of component `b` is `[1, 50]`. + /// The range of component `a` is `[1, 50]`. + /// The range of component `b` is `[1, 50]`. fn register_network(_a: u32, _b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `118` // Estimated: `3583` - // Minimum execution time: 55_634_000 picoseconds. - Weight::from_parts(96_580_843, 0) + // Minimum execution time: 53_359_000 picoseconds. + Weight::from_parts(58_371_896, 0) .saturating_add(Weight::from_parts(0, 3583)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(13)) @@ -87,8 +87,8 @@ impl pallet_networks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `277` // Estimated: `3742` - // Minimum execution time: 21_421_000 picoseconds. - Weight::from_parts(27_320_000, 0) + // Minimum execution time: 20_859_000 picoseconds. + Weight::from_parts(21_850_000, 0) .saturating_add(Weight::from_parts(0, 3742)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(4)) diff --git a/runtimes/testnet/src/weights/shards.rs b/runtimes/testnet/src/weights/shards.rs index 4e513a617..aeef7a382 100644 --- a/runtimes/testnet/src/weights/shards.rs +++ b/runtimes/testnet/src/weights/shards.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_shards` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-11, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -47,8 +47,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `757` // Estimated: `11647` - // Minimum execution time: 511_876_000 picoseconds. - Weight::from_parts(533_108_000, 0) + // Minimum execution time: 514_162_000 picoseconds. + Weight::from_parts(540_751_000, 0) .saturating_add(Weight::from_parts(0, 11647)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) @@ -69,8 +69,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `591` // Estimated: `11481` - // Minimum execution time: 58_870_000 picoseconds. - Weight::from_parts(61_526_000, 0) + // Minimum execution time: 60_093_000 picoseconds. + Weight::from_parts(63_980_000, 0) .saturating_add(Weight::from_parts(0, 11481)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) @@ -99,8 +99,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `453` // Estimated: `11343` - // Minimum execution time: 71_064_000 picoseconds. - Weight::from_parts(73_317_000, 0) + // Minimum execution time: 72_244_000 picoseconds. + Weight::from_parts(75_312_000, 0) .saturating_add(Weight::from_parts(0, 11343)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(14)) @@ -111,8 +111,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `6` // Estimated: `3471` - // Minimum execution time: 3_536_000 picoseconds. - Weight::from_parts(3_796_000, 0) + // Minimum execution time: 3_597_000 picoseconds. + Weight::from_parts(3_877_000, 0) .saturating_add(Weight::from_parts(0, 3471)) .saturating_add(T::DbWeight::get().reads(1)) } diff --git a/runtimes/testnet/src/weights/tasks.rs b/runtimes/testnet/src/weights/tasks.rs index 1acdb99ff..fd598d744 100644 --- a/runtimes/testnet/src/weights/tasks.rs +++ b/runtimes/testnet/src/weights/tasks.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_tasks` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-11, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -69,8 +69,8 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1380` // Estimated: `12270` - // Minimum execution time: 632_823_000 picoseconds. - Weight::from_parts(686_694_000, 0) + // Minimum execution time: 625_390_000 picoseconds. + Weight::from_parts(652_198_000, 0) .saturating_add(Weight::from_parts(0, 12270)) .saturating_add(T::DbWeight::get().reads(19)) .saturating_add(T::DbWeight::get().writes(14)) @@ -81,33 +81,33 @@ impl pallet_tasks::WeightInfo for WeightInfo { /// Proof: `Networks::NetworkShardTaskLimit` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::TaskShard` (r:1 w:1) /// Proof: `Tasks::TaskShard` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Tasks::NetworkShards` (r:10001 w:0) + /// Storage: `Tasks::NetworkShards` (r:1501 w:0) /// Proof: `Tasks::NetworkShards` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::ShardTaskCount` (r:1 w:1) /// Proof: `Tasks::ShardTaskCount` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::Tasks` (r:1 w:0) /// Proof: `Tasks::Tasks` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Shards::ShardCommitment` (r:10000 w:0) + /// Storage: `Shards::ShardCommitment` (r:1500 w:0) /// Proof: `Shards::ShardCommitment` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::ShardRegistered` (r:1 w:0) /// Proof: `Tasks::ShardRegistered` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::ShardTasks` (r:0 w:1) /// Proof: `Tasks::ShardTasks` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `b` is `[1, 10000]`. - /// The range of component `b` is `[1, 10000]`. + /// The range of component `b` is `[1, 1500]`. + /// The range of component `b` is `[1, 1500]`. fn schedule_tasks(b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `4412 + b * (91 ±0)` - // Estimated: `10028 + b * (2566 ±0)` - // Minimum execution time: 60_142_000 picoseconds. - Weight::from_parts(62_126_000, 0) - .saturating_add(Weight::from_parts(0, 10028)) - // Standard Error: 10_840 - .saturating_add(Weight::from_parts(11_935_194, 0).saturating_mul(b.into())) + // Measured: `2647 + b * (92 ±0)` + // Estimated: `8309 + b * (2568 ±0)` + // Minimum execution time: 60_193_000 picoseconds. + Weight::from_parts(62_306_000, 0) + .saturating_add(Weight::from_parts(0, 8309)) + // Standard Error: 6_407 + .saturating_add(Weight::from_parts(10_782_488, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(3)) - .saturating_add(Weight::from_parts(0, 2566).saturating_mul(b.into())) + .saturating_add(Weight::from_parts(0, 2568).saturating_mul(b.into())) } /// Storage: `Tasks::ReadEventsTask` (r:2 w:0) /// Proof: `Tasks::ReadEventsTask` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -123,11 +123,11 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `958` // Estimated: `6794 + b * (1 ±0)` - // Minimum execution time: 25_127_000 picoseconds. - Weight::from_parts(46_252_164, 0) + // Minimum execution time: 26_288_000 picoseconds. + Weight::from_parts(44_071_848, 0) .saturating_add(Weight::from_parts(0, 6794)) - // Standard Error: 461 - .saturating_add(Weight::from_parts(13_225, 0).saturating_mul(b.into())) + // Standard Error: 454 + .saturating_add(Weight::from_parts(14_141, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) } diff --git a/runtimes/testnet/src/weights/timegraph.rs b/runtimes/testnet/src/weights/timegraph.rs index c8aa40fec..8642b29d9 100644 --- a/runtimes/testnet/src/weights/timegraph.rs +++ b/runtimes/testnet/src/weights/timegraph.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_timegraph` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-11, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -41,8 +41,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `3593` - // Minimum execution time: 62_337_000 picoseconds. - Weight::from_parts(66_425_000, 0) + // Minimum execution time: 59_792_000 picoseconds. + Weight::from_parts(61_916_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -55,8 +55,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `3593` - // Minimum execution time: 63_148_000 picoseconds. - Weight::from_parts(71_112_000, 0) + // Minimum execution time: 60_203_000 picoseconds. + Weight::from_parts(61_876_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) From 6236bd456c7a9e1f2faa068da1875b29b443154b Mon Sep 17 00:00:00 2001 From: Github Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 12 Oct 2024 15:40:07 +0000 Subject: [PATCH 14/24] runtimes: update pallet weights --- runtimes/mainnet/src/weights/dmail.rs | 14 ++++----- runtimes/mainnet/src/weights/elections.rs | 6 ++-- runtimes/mainnet/src/weights/members.rs | 14 ++++----- runtimes/mainnet/src/weights/networks.rs | 16 ++++------ runtimes/mainnet/src/weights/shards.rs | 18 +++++------ runtimes/mainnet/src/weights/tasks.rs | 38 +++++++++++------------ runtimes/mainnet/src/weights/timegraph.rs | 10 +++--- runtimes/testnet/src/weights/dmail.rs | 14 +++++---- runtimes/testnet/src/weights/elections.rs | 6 ++-- runtimes/testnet/src/weights/members.rs | 14 ++++----- runtimes/testnet/src/weights/networks.rs | 10 +++--- runtimes/testnet/src/weights/shards.rs | 18 +++++------ runtimes/testnet/src/weights/tasks.rs | 38 +++++++++++------------ runtimes/testnet/src/weights/timegraph.rs | 10 +++--- 14 files changed, 112 insertions(+), 114 deletions(-) diff --git a/runtimes/mainnet/src/weights/dmail.rs b/runtimes/mainnet/src/weights/dmail.rs index a734a1ac8..248fc659b 100644 --- a/runtimes/mainnet/src/weights/dmail.rs +++ b/runtimes/mainnet/src/weights/dmail.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_dmail` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-11, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -41,12 +41,12 @@ impl pallet_dmail::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_134_000 picoseconds. - Weight::from_parts(8_002_439, 0) + // Minimum execution time: 6_813_000 picoseconds. + Weight::from_parts(6_457_675, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 1_124 - .saturating_add(Weight::from_parts(5_479, 0).saturating_mul(a.into())) - // Standard Error: 1_124 - .saturating_add(Weight::from_parts(7_546, 0).saturating_mul(b.into())) + // Standard Error: 1_307 + .saturating_add(Weight::from_parts(19_455, 0).saturating_mul(a.into())) + // Standard Error: 1_307 + .saturating_add(Weight::from_parts(25_413, 0).saturating_mul(b.into())) } } diff --git a/runtimes/mainnet/src/weights/elections.rs b/runtimes/mainnet/src/weights/elections.rs index a0bcb7db5..94a9b9640 100644 --- a/runtimes/mainnet/src/weights/elections.rs +++ b/runtimes/mainnet/src/weights/elections.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_elections` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-11, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -43,8 +43,8 @@ impl pallet_elections::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `123` // Estimated: `3588` - // Minimum execution time: 12_182_000 picoseconds. - Weight::from_parts(13_385_000, 0) + // Minimum execution time: 12_343_000 picoseconds. + Weight::from_parts(22_392_000, 0) .saturating_add(Weight::from_parts(0, 3588)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/runtimes/mainnet/src/weights/members.rs b/runtimes/mainnet/src/weights/members.rs index 962a1859b..88628d51d 100644 --- a/runtimes/mainnet/src/weights/members.rs +++ b/runtimes/mainnet/src/weights/members.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_members` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-11, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -57,8 +57,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `244` // Estimated: `3709` - // Minimum execution time: 64_452_000 picoseconds. - Weight::from_parts(66_093_000, 0) + // Minimum execution time: 64_810_000 picoseconds. + Weight::from_parts(70_523_000, 0) .saturating_add(Weight::from_parts(0, 3709)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) @@ -73,8 +73,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `293` // Estimated: `3758` - // Minimum execution time: 22_272_000 picoseconds. - Weight::from_parts(23_183_000, 0) + // Minimum execution time: 22_552_000 picoseconds. + Weight::from_parts(25_298_000, 0) .saturating_add(Weight::from_parts(0, 3758)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -101,8 +101,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `380` // Estimated: `3845` - // Minimum execution time: 58_599_000 picoseconds. - Weight::from_parts(60_023_000, 0) + // Minimum execution time: 56_996_000 picoseconds. + Weight::from_parts(60_903_000, 0) .saturating_add(Weight::from_parts(0, 3845)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) diff --git a/runtimes/mainnet/src/weights/networks.rs b/runtimes/mainnet/src/weights/networks.rs index b0b63d474..f2890ceeb 100644 --- a/runtimes/mainnet/src/weights/networks.rs +++ b/runtimes/mainnet/src/weights/networks.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_networks` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-11, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -63,17 +63,13 @@ impl pallet_networks::WeightInfo for WeightInfo { /// The range of component `b` is `[1, 50]`. /// The range of component `a` is `[1, 50]`. /// The range of component `b` is `[1, 50]`. - fn register_network(a: u32, b: u32, ) -> Weight { + fn register_network(_a: u32, _b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `118` // Estimated: `3583` - // Minimum execution time: 52_307_000 picoseconds. - Weight::from_parts(55_666_940, 0) + // Minimum execution time: 54_371_000 picoseconds. + Weight::from_parts(68_798_719, 0) .saturating_add(Weight::from_parts(0, 3583)) - // Standard Error: 9_831 - .saturating_add(Weight::from_parts(34_555, 0).saturating_mul(a.into())) - // Standard Error: 9_831 - .saturating_add(Weight::from_parts(40_085, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(13)) } @@ -91,8 +87,8 @@ impl pallet_networks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `277` // Estimated: `3742` - // Minimum execution time: 20_688_000 picoseconds. - Weight::from_parts(21_630_000, 0) + // Minimum execution time: 21_530_000 picoseconds. + Weight::from_parts(22_533_000, 0) .saturating_add(Weight::from_parts(0, 3742)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(4)) diff --git a/runtimes/mainnet/src/weights/shards.rs b/runtimes/mainnet/src/weights/shards.rs index 33abc3625..1099c25b9 100644 --- a/runtimes/mainnet/src/weights/shards.rs +++ b/runtimes/mainnet/src/weights/shards.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_shards` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-11, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -47,8 +47,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `757` // Estimated: `11647` - // Minimum execution time: 515_523_000 picoseconds. - Weight::from_parts(529_200_000, 0) + // Minimum execution time: 511_937_000 picoseconds. + Weight::from_parts(539_068_000, 0) .saturating_add(Weight::from_parts(0, 11647)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) @@ -69,8 +69,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `591` // Estimated: `11481` - // Minimum execution time: 61_725_000 picoseconds. - Weight::from_parts(66_133_000, 0) + // Minimum execution time: 59_461_000 picoseconds. + Weight::from_parts(61_224_000, 0) .saturating_add(Weight::from_parts(0, 11481)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) @@ -99,8 +99,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `453` // Estimated: `11343` - // Minimum execution time: 75_942_000 picoseconds. - Weight::from_parts(78_025_000, 0) + // Minimum execution time: 70_921_000 picoseconds. + Weight::from_parts(76_703_000, 0) .saturating_add(Weight::from_parts(0, 11343)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(14)) @@ -111,8 +111,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `6` // Estimated: `3471` - // Minimum execution time: 3_707_000 picoseconds. - Weight::from_parts(3_917_000, 0) + // Minimum execution time: 3_436_000 picoseconds. + Weight::from_parts(4_899_000, 0) .saturating_add(Weight::from_parts(0, 3471)) .saturating_add(T::DbWeight::get().reads(1)) } diff --git a/runtimes/mainnet/src/weights/tasks.rs b/runtimes/mainnet/src/weights/tasks.rs index 02792defd..36ed8e75d 100644 --- a/runtimes/mainnet/src/weights/tasks.rs +++ b/runtimes/mainnet/src/weights/tasks.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_tasks` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-11, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -69,8 +69,8 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1380` // Estimated: `12270` - // Minimum execution time: 621_113_000 picoseconds. - Weight::from_parts(632_674_000, 0) + // Minimum execution time: 625_850_000 picoseconds. + Weight::from_parts(651_048_000, 0) .saturating_add(Weight::from_parts(0, 12270)) .saturating_add(T::DbWeight::get().reads(19)) .saturating_add(T::DbWeight::get().writes(14)) @@ -81,33 +81,33 @@ impl pallet_tasks::WeightInfo for WeightInfo { /// Proof: `Networks::NetworkShardTaskLimit` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::TaskShard` (r:1 w:1) /// Proof: `Tasks::TaskShard` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Tasks::NetworkShards` (r:1501 w:0) + /// Storage: `Tasks::NetworkShards` (r:501 w:0) /// Proof: `Tasks::NetworkShards` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::ShardTaskCount` (r:1 w:1) /// Proof: `Tasks::ShardTaskCount` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::Tasks` (r:1 w:0) /// Proof: `Tasks::Tasks` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Shards::ShardCommitment` (r:1500 w:0) + /// Storage: `Shards::ShardCommitment` (r:500 w:0) /// Proof: `Shards::ShardCommitment` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::ShardRegistered` (r:1 w:0) /// Proof: `Tasks::ShardRegistered` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::ShardTasks` (r:0 w:1) /// Proof: `Tasks::ShardTasks` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `b` is `[1, 1500]`. - /// The range of component `b` is `[1, 1500]`. + /// The range of component `b` is `[1, 500]`. + /// The range of component `b` is `[1, 500]`. fn schedule_tasks(b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `2647 + b * (92 ±0)` - // Estimated: `8309 + b * (2568 ±0)` - // Minimum execution time: 61_124_000 picoseconds. - Weight::from_parts(62_858_000, 0) - .saturating_add(Weight::from_parts(0, 8309)) - // Standard Error: 4_891 - .saturating_add(Weight::from_parts(10_569_998, 0).saturating_mul(b.into())) + // Measured: `1538 + b * (95 ±0)` + // Estimated: `7370 + b * (2571 ±0)` + // Minimum execution time: 59_692_000 picoseconds. + Weight::from_parts(40_535_221, 0) + .saturating_add(Weight::from_parts(0, 7370)) + // Standard Error: 15_013 + .saturating_add(Weight::from_parts(10_375_135, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(3)) - .saturating_add(Weight::from_parts(0, 2568).saturating_mul(b.into())) + .saturating_add(Weight::from_parts(0, 2571).saturating_mul(b.into())) } /// Storage: `Tasks::ReadEventsTask` (r:2 w:0) /// Proof: `Tasks::ReadEventsTask` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -123,11 +123,11 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `958` // Estimated: `6794 + b * (1 ±0)` - // Minimum execution time: 26_249_000 picoseconds. - Weight::from_parts(45_243_749, 0) + // Minimum execution time: 24_615_000 picoseconds. + Weight::from_parts(40_636_421, 0) .saturating_add(Weight::from_parts(0, 6794)) - // Standard Error: 409 - .saturating_add(Weight::from_parts(12_293, 0).saturating_mul(b.into())) + // Standard Error: 320 + .saturating_add(Weight::from_parts(18_435, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) } diff --git a/runtimes/mainnet/src/weights/timegraph.rs b/runtimes/mainnet/src/weights/timegraph.rs index fb76695d5..60bc53eb1 100644 --- a/runtimes/mainnet/src/weights/timegraph.rs +++ b/runtimes/mainnet/src/weights/timegraph.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_timegraph` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-11, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -41,8 +41,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `3593` - // Minimum execution time: 61_545_000 picoseconds. - Weight::from_parts(63_007_000, 0) + // Minimum execution time: 61_375_000 picoseconds. + Weight::from_parts(65_894_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -55,8 +55,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `3593` - // Minimum execution time: 60_192_000 picoseconds. - Weight::from_parts(62_297_000, 0) + // Minimum execution time: 62_317_000 picoseconds. + Weight::from_parts(65_713_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/runtimes/testnet/src/weights/dmail.rs b/runtimes/testnet/src/weights/dmail.rs index 12cf2386d..2474f7a5b 100644 --- a/runtimes/testnet/src/weights/dmail.rs +++ b/runtimes/testnet/src/weights/dmail.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_dmail` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-11, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -37,14 +37,16 @@ impl pallet_dmail::WeightInfo for WeightInfo { /// The range of component `b` is `[1, 64]`. /// The range of component `a` is `[1, 64]`. /// The range of component `b` is `[1, 64]`. - fn send_email(_a: u32, b: u32, ) -> Weight { + fn send_email(a: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_003_000 picoseconds. - Weight::from_parts(7_842_896, 0) + // Minimum execution time: 7_093_000 picoseconds. + Weight::from_parts(9_159_733, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 1_028 - .saturating_add(Weight::from_parts(3_663, 0).saturating_mul(b.into())) + // Standard Error: 1_419 + .saturating_add(Weight::from_parts(851, 0).saturating_mul(a.into())) + // Standard Error: 1_419 + .saturating_add(Weight::from_parts(813, 0).saturating_mul(b.into())) } } diff --git a/runtimes/testnet/src/weights/elections.rs b/runtimes/testnet/src/weights/elections.rs index 3c9846346..beb756f84 100644 --- a/runtimes/testnet/src/weights/elections.rs +++ b/runtimes/testnet/src/weights/elections.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_elections` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-11, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -43,8 +43,8 @@ impl pallet_elections::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `123` // Estimated: `3588` - // Minimum execution time: 12_223_000 picoseconds. - Weight::from_parts(19_336_000, 0) + // Minimum execution time: 12_384_000 picoseconds. + Weight::from_parts(13_966_000, 0) .saturating_add(Weight::from_parts(0, 3588)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/runtimes/testnet/src/weights/members.rs b/runtimes/testnet/src/weights/members.rs index 089e38dc3..41ae22dcf 100644 --- a/runtimes/testnet/src/weights/members.rs +++ b/runtimes/testnet/src/weights/members.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_members` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-11, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -57,8 +57,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `244` // Estimated: `3709` - // Minimum execution time: 60_805_000 picoseconds. - Weight::from_parts(62_798_000, 0) + // Minimum execution time: 60_944_000 picoseconds. + Weight::from_parts(63_850_000, 0) .saturating_add(Weight::from_parts(0, 3709)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) @@ -73,8 +73,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `293` // Estimated: `3758` - // Minimum execution time: 21_961_000 picoseconds. - Weight::from_parts(22_662_000, 0) + // Minimum execution time: 22_222_000 picoseconds. + Weight::from_parts(23_855_000, 0) .saturating_add(Weight::from_parts(0, 3758)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -101,8 +101,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `380` // Estimated: `3845` - // Minimum execution time: 54_893_000 picoseconds. - Weight::from_parts(56_846_000, 0) + // Minimum execution time: 56_436_000 picoseconds. + Weight::from_parts(59_050_000, 0) .saturating_add(Weight::from_parts(0, 3845)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) diff --git a/runtimes/testnet/src/weights/networks.rs b/runtimes/testnet/src/weights/networks.rs index bf33808b7..492cce9c4 100644 --- a/runtimes/testnet/src/weights/networks.rs +++ b/runtimes/testnet/src/weights/networks.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_networks` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-11, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -67,8 +67,8 @@ impl pallet_networks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `118` // Estimated: `3583` - // Minimum execution time: 53_359_000 picoseconds. - Weight::from_parts(58_371_896, 0) + // Minimum execution time: 53_861_000 picoseconds. + Weight::from_parts(60_735_804, 0) .saturating_add(Weight::from_parts(0, 3583)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(13)) @@ -87,8 +87,8 @@ impl pallet_networks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `277` // Estimated: `3742` - // Minimum execution time: 20_859_000 picoseconds. - Weight::from_parts(21_850_000, 0) + // Minimum execution time: 21_601_000 picoseconds. + Weight::from_parts(22_413_000, 0) .saturating_add(Weight::from_parts(0, 3742)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(4)) diff --git a/runtimes/testnet/src/weights/shards.rs b/runtimes/testnet/src/weights/shards.rs index aeef7a382..4f2d0e336 100644 --- a/runtimes/testnet/src/weights/shards.rs +++ b/runtimes/testnet/src/weights/shards.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_shards` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-11, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -47,8 +47,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `757` // Estimated: `11647` - // Minimum execution time: 514_162_000 picoseconds. - Weight::from_parts(540_751_000, 0) + // Minimum execution time: 521_515_000 picoseconds. + Weight::from_parts(527_687_000, 0) .saturating_add(Weight::from_parts(0, 11647)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) @@ -69,8 +69,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `591` // Estimated: `11481` - // Minimum execution time: 60_093_000 picoseconds. - Weight::from_parts(63_980_000, 0) + // Minimum execution time: 59_351_000 picoseconds. + Weight::from_parts(61_616_000, 0) .saturating_add(Weight::from_parts(0, 11481)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) @@ -99,8 +99,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `453` // Estimated: `11343` - // Minimum execution time: 72_244_000 picoseconds. - Weight::from_parts(75_312_000, 0) + // Minimum execution time: 71_804_000 picoseconds. + Weight::from_parts(74_118_000, 0) .saturating_add(Weight::from_parts(0, 11343)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(14)) @@ -111,8 +111,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `6` // Estimated: `3471` - // Minimum execution time: 3_597_000 picoseconds. - Weight::from_parts(3_877_000, 0) + // Minimum execution time: 3_477_000 picoseconds. + Weight::from_parts(3_687_000, 0) .saturating_add(Weight::from_parts(0, 3471)) .saturating_add(T::DbWeight::get().reads(1)) } diff --git a/runtimes/testnet/src/weights/tasks.rs b/runtimes/testnet/src/weights/tasks.rs index fd598d744..f2f9f6399 100644 --- a/runtimes/testnet/src/weights/tasks.rs +++ b/runtimes/testnet/src/weights/tasks.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_tasks` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-11, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -69,8 +69,8 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1380` // Estimated: `12270` - // Minimum execution time: 625_390_000 picoseconds. - Weight::from_parts(652_198_000, 0) + // Minimum execution time: 630_578_000 picoseconds. + Weight::from_parts(647_882_000, 0) .saturating_add(Weight::from_parts(0, 12270)) .saturating_add(T::DbWeight::get().reads(19)) .saturating_add(T::DbWeight::get().writes(14)) @@ -81,33 +81,33 @@ impl pallet_tasks::WeightInfo for WeightInfo { /// Proof: `Networks::NetworkShardTaskLimit` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::TaskShard` (r:1 w:1) /// Proof: `Tasks::TaskShard` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Tasks::NetworkShards` (r:1501 w:0) + /// Storage: `Tasks::NetworkShards` (r:501 w:0) /// Proof: `Tasks::NetworkShards` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::ShardTaskCount` (r:1 w:1) /// Proof: `Tasks::ShardTaskCount` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::Tasks` (r:1 w:0) /// Proof: `Tasks::Tasks` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Shards::ShardCommitment` (r:1500 w:0) + /// Storage: `Shards::ShardCommitment` (r:500 w:0) /// Proof: `Shards::ShardCommitment` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::ShardRegistered` (r:1 w:0) /// Proof: `Tasks::ShardRegistered` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Tasks::ShardTasks` (r:0 w:1) /// Proof: `Tasks::ShardTasks` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `b` is `[1, 1500]`. - /// The range of component `b` is `[1, 1500]`. + /// The range of component `b` is `[1, 500]`. + /// The range of component `b` is `[1, 500]`. fn schedule_tasks(b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `2647 + b * (92 ±0)` - // Estimated: `8309 + b * (2568 ±0)` - // Minimum execution time: 60_193_000 picoseconds. - Weight::from_parts(62_306_000, 0) - .saturating_add(Weight::from_parts(0, 8309)) - // Standard Error: 6_407 - .saturating_add(Weight::from_parts(10_782_488, 0).saturating_mul(b.into())) + // Measured: `1538 + b * (95 ±0)` + // Estimated: `7370 + b * (2571 ±0)` + // Minimum execution time: 59_231_000 picoseconds. + Weight::from_parts(1_113_078, 0) + .saturating_add(Weight::from_parts(0, 7370)) + // Standard Error: 11_139 + .saturating_add(Weight::from_parts(10_548_784, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(3)) - .saturating_add(Weight::from_parts(0, 2568).saturating_mul(b.into())) + .saturating_add(Weight::from_parts(0, 2571).saturating_mul(b.into())) } /// Storage: `Tasks::ReadEventsTask` (r:2 w:0) /// Proof: `Tasks::ReadEventsTask` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -123,11 +123,11 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `958` // Estimated: `6794 + b * (1 ±0)` - // Minimum execution time: 26_288_000 picoseconds. - Weight::from_parts(44_071_848, 0) + // Minimum execution time: 24_506_000 picoseconds. + Weight::from_parts(40_342_829, 0) .saturating_add(Weight::from_parts(0, 6794)) - // Standard Error: 454 - .saturating_add(Weight::from_parts(14_141, 0).saturating_mul(b.into())) + // Standard Error: 332 + .saturating_add(Weight::from_parts(18_157, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) } diff --git a/runtimes/testnet/src/weights/timegraph.rs b/runtimes/testnet/src/weights/timegraph.rs index 8642b29d9..0f79aac2e 100644 --- a/runtimes/testnet/src/weights/timegraph.rs +++ b/runtimes/testnet/src/weights/timegraph.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_timegraph` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-11, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -41,8 +41,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `3593` - // Minimum execution time: 59_792_000 picoseconds. - Weight::from_parts(61_916_000, 0) + // Minimum execution time: 59_802_000 picoseconds. + Weight::from_parts(60_934_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -55,8 +55,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `3593` - // Minimum execution time: 60_203_000 picoseconds. - Weight::from_parts(61_876_000, 0) + // Minimum execution time: 59_472_000 picoseconds. + Weight::from_parts(60_914_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) From 7340918ee855373c1d6ea17105e2235681a155d6 Mon Sep 17 00:00:00 2001 From: Amar Singh Date: Sat, 12 Oct 2024 13:14:53 -0400 Subject: [PATCH 15/24] Update shard.rs --- primitives/src/shard.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/primitives/src/shard.rs b/primitives/src/shard.rs index f6ba19a42..cc1ff0a32 100644 --- a/primitives/src/shard.rs +++ b/primitives/src/shard.rs @@ -13,7 +13,7 @@ use scale_codec::{Decode, Encode}; use scale_info::prelude::vec::Vec; use scale_info::TypeInfo; -/// Absolute upper bound for shard sizes +/// Upper bound for shard sizes const MAX_SHARD_SIZE: u32 = 100; pub type TssPublicKey = [u8; 33]; From 673055c37d33696a45f6c5288ab36a7c07eb79bf Mon Sep 17 00:00:00 2001 From: Amar Singh Date: Thu, 17 Oct 2024 13:32:53 -0400 Subject: [PATCH 16/24] Update subxt to bounded types (#1212) --- pallets/dmail/src/benchmarking.rs | 7 ++++--- pallets/dmail/src/lib.rs | 2 +- pallets/dmail/src/tests.rs | 7 ++++--- pallets/networks/src/benchmarking.rs | 7 ++++--- pallets/networks/src/lib.rs | 2 +- pallets/networks/src/tests.rs | 7 ++++--- pallets/shards/src/benchmarking.rs | 10 +++++----- pallets/shards/src/lib.rs | 12 ++++++------ pallets/shards/src/tests.rs | 8 ++++---- pallets/tasks/src/benchmarking.rs | 7 ++++--- pallets/tasks/src/lib.rs | 4 ++-- pallets/tasks/src/tests.rs | 11 ++++++----- primitives/src/dmail.rs | 6 ++++-- primitives/src/network.rs | 6 ++++-- primitives/src/shard.rs | 3 ++- primitives/src/task.rs | 8 ++++++-- runtimes/testnet/src/tests.rs | 8 +++----- tc-subxt/metadata/build.rs | 7 +++++++ 18 files changed, 71 insertions(+), 51 deletions(-) diff --git a/pallets/dmail/src/benchmarking.rs b/pallets/dmail/src/benchmarking.rs index 0167ec77c..c140e07a1 100644 --- a/pallets/dmail/src/benchmarking.rs +++ b/pallets/dmail/src/benchmarking.rs @@ -5,8 +5,9 @@ use scale_info::prelude::string::String; use frame_system::RawOrigin; use polkadot_sdk::frame_benchmarking::benchmarks; -use polkadot_sdk::frame_system; +use polkadot_sdk::{frame_system, sp_runtime}; use scale_codec::Encode; +use sp_runtime::BoundedVec; use time_primitives::{DmailPath, DmailTo, DMAIL_PATH_LEN, DMAIL_TO_LEN}; benchmarks! { @@ -22,8 +23,8 @@ benchmarks! { for _ in 0..b { path.push('b'); } - let to = DmailTo::truncate_from(to.as_str().encode()); - let path = DmailPath::truncate_from(path.as_str().encode()); + let to = DmailTo(BoundedVec::truncate_from(to.as_str().encode())); + let path = DmailPath(BoundedVec::truncate_from(path.as_str().encode())); }: _(RawOrigin::Signed([0u8; 32].into()), to, path) verify {} diff --git a/pallets/dmail/src/lib.rs b/pallets/dmail/src/lib.rs index 2ff7a93cf..edde1b530 100644 --- a/pallets/dmail/src/lib.rs +++ b/pallets/dmail/src/lib.rs @@ -49,7 +49,7 @@ pub mod pallet { #[pallet::call] impl Pallet { #[pallet::call_index(0)] - #[pallet::weight(T::WeightInfo::send_email(to.len() as u32, path.len() as u32))] + #[pallet::weight(T::WeightInfo::send_email(to.0.len() as u32, path.0.len() as u32))] pub fn send_email(origin: OriginFor, to: DmailTo, path: DmailPath) -> DispatchResult { let owner = ensure_signed(origin)?; let message = DmailMessage { owner, to, path }; diff --git a/pallets/dmail/src/tests.rs b/pallets/dmail/src/tests.rs index 7718790be..1d7c98764 100644 --- a/pallets/dmail/src/tests.rs +++ b/pallets/dmail/src/tests.rs @@ -1,17 +1,18 @@ use crate::mock::*; use crate::Event; -use polkadot_sdk::{frame_support, frame_system}; +use polkadot_sdk::{frame_support, frame_system, sp_runtime}; use frame_support::assert_ok; use frame_system::RawOrigin; use scale_codec::Encode; +use sp_runtime::BoundedVec; use time_primitives::{DmailMessage, DmailPath, DmailTo}; #[test] fn test_dmail_event() { - let to: DmailTo = DmailTo::truncate_from("Self".encode()); - let path: DmailPath = DmailPath::truncate_from("//self".encode()); + let to: DmailTo = DmailTo(BoundedVec::truncate_from("Self".encode())); + let path: DmailPath = DmailPath(BoundedVec::truncate_from("//self".encode())); let sender: AccountId = [1; 32].into(); let event = DmailMessage { owner: sender.clone(), diff --git a/pallets/networks/src/benchmarking.rs b/pallets/networks/src/benchmarking.rs index e47737b2a..8bb08e870 100644 --- a/pallets/networks/src/benchmarking.rs +++ b/pallets/networks/src/benchmarking.rs @@ -3,9 +3,10 @@ use crate::Pallet; use frame_system::RawOrigin; use polkadot_sdk::frame_benchmarking::benchmarks; -use polkadot_sdk::frame_system; +use polkadot_sdk::{frame_system, sp_runtime}; use scale_codec::Encode; use scale_info::prelude::string::String; +use sp_runtime::BoundedVec; use time_primitives::{ ChainName, ChainNetwork, Network, NetworkConfig, CHAIN_NAME_LEN, CHAIN_NET_LEN, }; @@ -22,8 +23,8 @@ fn mock_network_config() -> NetworkConfig { fn mock_network(chain_name: String, chain_network: String) -> Network { Network { id: 42, - chain_name: ChainName::truncate_from(chain_name.as_str().encode()), - chain_network: ChainNetwork::truncate_from(chain_network.as_str().encode()), + chain_name: ChainName(BoundedVec::truncate_from(chain_name.as_str().encode())), + chain_network: ChainNetwork(BoundedVec::truncate_from(chain_network.as_str().encode())), gateway: [0; 32], gateway_block: 99, config: mock_network_config(), diff --git a/pallets/networks/src/lib.rs b/pallets/networks/src/lib.rs index 288d0cb5b..c8ae27f87 100644 --- a/pallets/networks/src/lib.rs +++ b/pallets/networks/src/lib.rs @@ -200,7 +200,7 @@ pub mod pallet { /// 3. Emit the [`Event::NetworkRegistered`] event with the new `NetworkId`. /// 4. Return `Ok(())` to indicate success. #[pallet::call_index(0)] - #[pallet::weight(T::WeightInfo::register_network(network.chain_name.len() as u32, network.chain_network.len() as u32))] + #[pallet::weight(T::WeightInfo::register_network(network.chain_name.0.len() as u32, network.chain_network.0.len() as u32))] pub fn register_network(origin: OriginFor, network: Network) -> DispatchResult { T::AdminOrigin::ensure_origin(origin)?; Self::insert_network(&network)?; diff --git a/pallets/networks/src/tests.rs b/pallets/networks/src/tests.rs index 5821dd136..3f81799f4 100644 --- a/pallets/networks/src/tests.rs +++ b/pallets/networks/src/tests.rs @@ -2,8 +2,9 @@ use crate::{self as pallet_networks}; use crate::{mock::*, Error}; use frame_support::{assert_noop, assert_ok}; use frame_system::RawOrigin; -use polkadot_sdk::{frame_support, frame_system}; +use polkadot_sdk::{frame_support, frame_system, sp_runtime}; use scale_codec::Encode; +use sp_runtime::BoundedVec; use time_primitives::{ChainName, ChainNetwork, Network, NetworkConfig}; fn mock_network_config() -> NetworkConfig { @@ -18,8 +19,8 @@ fn mock_network_config() -> NetworkConfig { fn mock_network() -> Network { Network { id: 42, - chain_name: ChainName::truncate_from("Ethereum".encode()), - chain_network: ChainNetwork::truncate_from("Mainnet".encode()), + chain_name: ChainName(BoundedVec::truncate_from("Ethereum".encode())), + chain_network: ChainNetwork(BoundedVec::truncate_from("Mainnet".encode())), gateway: [0; 32], gateway_block: 99, config: mock_network_config(), diff --git a/pallets/shards/src/benchmarking.rs b/pallets/shards/src/benchmarking.rs index 42c430b01..2b3f9376c 100644 --- a/pallets/shards/src/benchmarking.rs +++ b/pallets/shards/src/benchmarking.rs @@ -1,13 +1,13 @@ use super::*; use crate::Pallet; -use polkadot_sdk::{ - frame_benchmarking, frame_support, frame_system, pallet_balances, sp_core, sp_std, -}; - use frame_benchmarking::benchmarks; use frame_support::traits::{Currency, Get}; use frame_system::RawOrigin; +use polkadot_sdk::{ + frame_benchmarking, frame_support, frame_system, pallet_balances, sp_core, sp_runtime, sp_std, +}; +use sp_runtime::BoundedVec; use sp_std::vec; use sp_std::vec::Vec; @@ -69,7 +69,7 @@ pub fn get_commitment(member: [u8; 32]) -> Commitment { panic!("Invalid member") }, }; - Commitment::truncate_from(vec![commitment]) + Commitment(BoundedVec::truncate_from(vec![commitment])) } pub fn get_proof_of_knowledge(member: [u8; 32]) -> ProofOfKnowledge { match member { diff --git a/pallets/shards/src/lib.rs b/pallets/shards/src/lib.rs index da98afc09..66e53dcb3 100644 --- a/pallets/shards/src/lib.rs +++ b/pallets/shards/src/lib.rs @@ -254,10 +254,10 @@ pub mod pallet { ); let threshold = ShardThreshold::::get(shard_id).unwrap_or_default(); ensure!( - commitment.len() == threshold as usize, + commitment.0.len() == threshold as usize, Error::::CommitmentLenNotEqualToThreshold ); - for c in &commitment { + for c in &commitment.0 { ensure!( VerifyingKey::from_bytes(*c).is_ok(), Error::::InvalidVerifyingKeyInCommitment @@ -267,7 +267,7 @@ pub mod pallet { T::Members::member_peer_id(&member).ok_or(Error::::MemberPeerIdNotFound)?; schnorr_evm::proof_of_knowledge::verify_proof_of_knowledge( &peer_id, - &commitment, + &commitment.0, proof_of_knowledge, ) .map_err(|_| Error::::InvalidProofOfKnowledge)?; @@ -277,7 +277,7 @@ pub mod pallet { .filter_map(|(_, status)| status.commitment().cloned()) .reduce(|mut group_commitment, commitment| { for (group_commitment, commitment) in - group_commitment.iter_mut().zip(commitment.iter()) + group_commitment.0.iter_mut().zip(commitment.0.iter()) { *group_commitment = VerifyingKey::new( VerifyingKey::from_bytes(*group_commitment) @@ -327,7 +327,7 @@ pub mod pallet { .all(|(_, status)| status == MemberStatus::Ready) { >::insert(shard_id, ShardStatus::Online); - Self::deposit_event(Event::ShardOnline(shard_id, commitment[0])); + Self::deposit_event(Event::ShardOnline(shard_id, commitment.0[0])); T::Tasks::shard_online(shard_id, network); } Ok(()) @@ -612,7 +612,7 @@ pub mod pallet { /// 1. Retrieves the commitment [`Vec`] associated with the `shard_id` from [`ShardCommitment`]. /// 2. Returns the first element of the commitment [`TssPublicKey`] if it exists; otherwise, returns `None`. fn tss_public_key(shard_id: ShardId) -> Option { - ShardCommitment::::get(shard_id).map(|commitment| commitment[0]) + ShardCommitment::::get(shard_id).map(|commitment| commitment.0[0]) } } } diff --git a/pallets/shards/src/tests.rs b/pallets/shards/src/tests.rs index 322d7b29b..3dcf87b05 100644 --- a/pallets/shards/src/tests.rs +++ b/pallets/shards/src/tests.rs @@ -1,16 +1,16 @@ use crate::mock::*; use crate::{Event, ShardMembers, ShardNetwork, ShardState}; -use polkadot_sdk::{frame_support, frame_system, pallet_balances, sp_core}; +use polkadot_sdk::{frame_support, frame_system, pallet_balances, sp_core, sp_runtime}; use frame_support::assert_ok; use frame_support::traits::{Currency, Get}; use frame_system::RawOrigin; - use schnorr_evm::k256::elliptic_curve::PrimeField; use schnorr_evm::k256::{ProjectivePoint, Scalar}; use schnorr_evm::proof_of_knowledge::construct_proof_of_knowledge; use schnorr_evm::VerifyingKey; +use sp_runtime::BoundedVec; use time_primitives::{ AccountId, Commitment, NetworkId, PeerId, PublicKey, ShardId, ShardStatus, ShardsInterface, @@ -88,7 +88,7 @@ fn create_shard(shard_id: ShardId, shard: &[Member], threshold: u16) { assert_ok!(Shards::commit( RawOrigin::Signed(member.account_id.clone()).into(), shard_id as _, - Commitment::truncate_from(member.commitment(threshold)), + Commitment(BoundedVec::truncate_from(member.commitment(threshold))), member.proof_of_knowledge(), )); roll(1); @@ -139,7 +139,7 @@ fn test_register_shard() { assert_ok!(Shards::commit( RawOrigin::Signed(member.account_id.clone()).into(), shard_id as _, - Commitment::truncate_from(member.commitment(threshold)), + Commitment(BoundedVec::truncate_from(member.commitment(threshold))), member.proof_of_knowledge(), )); } diff --git a/pallets/tasks/src/benchmarking.rs b/pallets/tasks/src/benchmarking.rs index c5f39d9ca..e17aad0aa 100644 --- a/pallets/tasks/src/benchmarking.rs +++ b/pallets/tasks/src/benchmarking.rs @@ -5,7 +5,8 @@ use frame_support::traits::OnInitialize; use frame_system::RawOrigin; use pallet_networks::NetworkGatewayAddress; use pallet_shards::{ShardCommitment, ShardState}; -use polkadot_sdk::{frame_benchmarking, frame_support, frame_system, sp_std}; +use polkadot_sdk::{frame_benchmarking, frame_support, frame_system, sp_runtime, sp_std}; +use sp_runtime::BoundedVec; use sp_std::vec; use time_primitives::{ Commitment, GmpEvents, NetworkId, ShardStatus, ShardsInterface, Task, TaskResult, @@ -32,7 +33,7 @@ fn create_simple_task() { 1, ); ShardState::::insert(shard_id, ShardStatus::Online); - ShardCommitment::::insert(shard_id, Commitment::truncate_from(vec![PUBKEY])); + ShardCommitment::::insert(shard_id, Commitment(BoundedVec::truncate_from(vec![PUBKEY]))); Pallet::::shard_online(shard_id, ETHEREUM); Pallet::::create_task(ETHEREUM, Task::ReadGatewayEvents { blocks: 0..10 }); } @@ -44,7 +45,7 @@ benchmarks! { NetworkGatewayAddress::::insert(0, [0; 32]); create_simple_task::(); Pallet::::on_initialize(frame_system::Pallet::::block_number()); - let result = TaskResult::ReadGatewayEvents { events: GmpEvents::truncate_from(vec![]), signature: SIGNATURE }; + let result = TaskResult::ReadGatewayEvents { events: GmpEvents(BoundedVec::truncate_from(vec![])), signature: SIGNATURE }; }: _(RawOrigin::Signed([0u8; 32].into()), 0, result) verify {} schedule_tasks { diff --git a/pallets/tasks/src/lib.rs b/pallets/tasks/src/lib.rs index 43b678df8..96aa1b19b 100644 --- a/pallets/tasks/src/lib.rs +++ b/pallets/tasks/src/lib.rs @@ -317,7 +317,7 @@ pub mod pallet { TaskResult::ReadGatewayEvents { events, signature }, ) => { // verify signature - let bytes = time_primitives::encode_gmp_events(task_id, &events); + let bytes = time_primitives::encode_gmp_events(task_id, &events.0); Self::verify_signature(shard, &bytes, signature)?; // start next batch let start = blocks.end; @@ -325,7 +325,7 @@ pub mod pallet { let end = start + size; Self::create_task(network, Task::ReadGatewayEvents { blocks: start..end }); // process events - for event in events { + for event in events.0 { match event { GmpEvent::ShardRegistered(pubkey) => { ShardRegistered::::insert(pubkey, ()); diff --git a/pallets/tasks/src/tests.rs b/pallets/tasks/src/tests.rs index 6c689b05b..151c5a300 100644 --- a/pallets/tasks/src/tests.rs +++ b/pallets/tasks/src/tests.rs @@ -4,8 +4,9 @@ use crate::{BatchIdCounter, ShardRegistered}; use frame_support::assert_ok; use frame_system::RawOrigin; use pallet_shards::{ShardCommitment, ShardState}; -use polkadot_sdk::{frame_support, frame_system}; +use polkadot_sdk::{frame_support, frame_system, sp_runtime}; use scale_codec::Encode; +use sp_runtime::BoundedVec; use time_primitives::{ traits::IdentifyAccount, Commitment, ErrorMsg, GatewayMessage, GatewayOp, GmpEvent, GmpEvents, GmpMessage, MockTssSigner, NetworkId, PublicKey, ShardId, ShardStatus, ShardsInterface, Task, @@ -21,7 +22,7 @@ fn create_shard(network: NetworkId, n: u8, t: u16) -> ShardId { } let shard_id = Shards::create_shard(network, members, t).0; let pub_key = MockTssSigner::new(shard_id).public_key(); - ShardCommitment::::insert(shard_id, Commitment::truncate_from(vec![pub_key])); + ShardCommitment::::insert(shard_id, Commitment(BoundedVec::truncate_from(vec![pub_key]))); ShardState::::insert(shard_id, ShardStatus::Online); Tasks::shard_online(shard_id, network); shard_id @@ -43,7 +44,7 @@ fn register_shard(shard: ShardId) { fn submit_gateway_events(shard: ShardId, task_id: TaskId, events: &[GmpEvent]) { let signature = MockTssSigner::new(shard).sign_gmp_events(task_id, events); let result = TaskResult::ReadGatewayEvents { - events: GmpEvents::truncate_from(events.to_vec()), + events: GmpEvents(BoundedVec::truncate_from(events.to_vec())), signature, }; assert_ok!(Tasks::submit_task_result( @@ -58,7 +59,7 @@ fn submit_submission_error(account: PublicKey, task: TaskId, error: &str) { RawOrigin::Signed(account.into_account()).into(), task, TaskResult::SubmitGatewayMessage { - error: ErrorMsg::truncate_from(error.encode()) + error: ErrorMsg(BoundedVec::truncate_from(error.encode())) } )); } @@ -230,7 +231,7 @@ fn test_msg_execution_error_completes_submit_task() { submit_submission_error(account, 1, "error message"); assert_eq!( Tasks::get_task_result(1), - Some(Err(ErrorMsg::truncate_from("error message".encode()))) + Some(Err(ErrorMsg(BoundedVec::truncate_from("error message".encode())))) ); }) } diff --git a/primitives/src/dmail.rs b/primitives/src/dmail.rs index dfdd091d3..ee081ef7f 100644 --- a/primitives/src/dmail.rs +++ b/primitives/src/dmail.rs @@ -6,8 +6,10 @@ use scale_info::TypeInfo; pub const DMAIL_TO_LEN: u32 = 64; pub const DMAIL_PATH_LEN: u32 = 64; -pub type DmailTo = BoundedVec>; -pub type DmailPath = BoundedVec>; +#[derive(Encode, Decode, TypeInfo, PartialEq, Eq, Clone, Debug)] +pub struct DmailTo(pub BoundedVec>); +#[derive(Encode, Decode, TypeInfo, PartialEq, Eq, Clone, Debug)] +pub struct DmailPath(pub BoundedVec>); #[derive(Encode, Decode, TypeInfo, PartialEq, Eq, Clone, Debug)] pub struct DmailMessage { diff --git a/primitives/src/network.rs b/primitives/src/network.rs index 0f4395571..6915418a9 100644 --- a/primitives/src/network.rs +++ b/primitives/src/network.rs @@ -8,8 +8,10 @@ pub const CHAIN_NAME_LEN: u32 = 50; pub const CHAIN_NET_LEN: u32 = 50; pub type NetworkId = u16; -pub type ChainName = BoundedVec>; -pub type ChainNetwork = BoundedVec>; +#[derive(Encode, Decode, TypeInfo, PartialEq, Eq, Clone, Debug, Serialize, Deserialize)] +pub struct ChainName(pub BoundedVec>); +#[derive(Encode, Decode, TypeInfo, PartialEq, Eq, Clone, Debug, Serialize, Deserialize)] +pub struct ChainNetwork(pub BoundedVec>); #[derive(Clone, Debug, Eq, PartialEq, Encode, Decode, TypeInfo, Serialize, Deserialize)] pub struct Network { diff --git a/primitives/src/shard.rs b/primitives/src/shard.rs index cc1ff0a32..f1e5ae2b3 100644 --- a/primitives/src/shard.rs +++ b/primitives/src/shard.rs @@ -22,7 +22,8 @@ pub type TssHash = [u8; 32]; pub type PeerId = [u8; 32]; pub type ShardId = u64; pub type ProofOfKnowledge = [u8; 65]; -pub type Commitment = BoundedVec>; +#[derive(Encode, Decode, TypeInfo, PartialEq, Eq, Clone, Debug)] +pub struct Commitment(pub BoundedVec>); #[cfg(feature = "std")] pub mod serde_tss_public_key { diff --git a/primitives/src/task.rs b/primitives/src/task.rs index 55ed504c0..4c2155e9c 100644 --- a/primitives/src/task.rs +++ b/primitives/src/task.rs @@ -64,9 +64,13 @@ pub fn encode_gmp_events(task_id: TaskId, events: &[GmpEvent]) -> Vec { const MAX_GMP_EVENTS: u32 = 1_000; const MAX_ERROR_LEN: u32 = 500; /// Bounded vec alias for GMP events submitted in results -pub type GmpEvents = BoundedVec>; +#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +#[derive(Encode, Decode, TypeInfo, PartialEq, Eq, Clone, Debug)] +pub struct GmpEvents(pub BoundedVec>); /// Bounded vec alias for SubmitGatewayMessage error -pub type ErrorMsg = BoundedVec>; +#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +#[derive(Encode, Decode, TypeInfo, PartialEq, Eq, Clone, Debug)] +pub struct ErrorMsg(pub BoundedVec>); #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] #[derive(Debug, Clone, Decode, Encode, TypeInfo, PartialEq)] diff --git a/runtimes/testnet/src/tests.rs b/runtimes/testnet/src/tests.rs index af2dbe9af..0ec768a41 100644 --- a/runtimes/testnet/src/tests.rs +++ b/runtimes/testnet/src/tests.rs @@ -1,15 +1,13 @@ /// Integration tests use crate::*; -//use polkadot_sdk::*; - use frame_support::assert_ok; use frame_support::traits::{OnFinalize, OnInitialize, WhitelistedStorageKeys}; use frame_system::RawOrigin; use pallet_shards::ShardMembers; -// use pallet_tasks::TaskSigner; use sp_core::hexdisplay::HexDisplay; use sp_core::Pair; +use sp_runtime::BoundedVec; use std::collections::HashSet; use time_primitives::{ AccountId, ElectionsInterface, Network, NetworkConfig, NetworkId, PublicKey, ShardStatus, @@ -32,8 +30,8 @@ fn get_peer_id(random_num: [u8; 32]) -> [u8; 32] { fn network() -> Network { Network { id: ETHEREUM, - chain_name: ChainName::truncate_from("ethereum".encode()), - chain_network: ChainNetwork::truncate_from("dev".encode()), + chain_name: ChainName(BoundedVec::truncate_from("ethereum".encode())), + chain_network: ChainNetwork(BoundedVec::truncate_from("dev".encode())), gateway: [0u8; 32], gateway_block: 0, config: NetworkConfig { diff --git a/tc-subxt/metadata/build.rs b/tc-subxt/metadata/build.rs index fcd9fa10b..e4a3d9a20 100644 --- a/tc-subxt/metadata/build.rs +++ b/tc-subxt/metadata/build.rs @@ -6,16 +6,23 @@ fn substitute(path: &str, with: &str) -> String { fn derive(path: &Path, module: &str) -> String { let simple_types = [ + "time_primitives::dmail::DmailTo", + "time_primitives::dmail::DmailPath", "time_primitives::gmp::GmpMessage", "time_primitives::gmp::GatewayOp", "time_primitives::gmp::GatewayMessage", "time_primitives::gmp::GmpEvent", + "time_primitives::network::ChainName", + "time_primitives::network::ChainNetwork", "time_primitives::network::Network", "time_primitives::network::NetworkConfig", + "time_primitives::shard::Commitment", "time_primitives::shard::MemberStatus", "time_primitives::shard::ShardStatus", "time_primitives::task::Task", "time_primitives::task::TaskResult", + "time_primitives::task::GmpEvents", + "time_primitives::task::ErrorMsg", ]; let others = [ ("sp_core::crypto::AccountId32", "time_primitives::AccountId"), From e71d41c064110eec2c1e30f1cb0d870aa8bcdb50 Mon Sep 17 00:00:00 2001 From: 4meta5 Date: Thu, 17 Oct 2024 13:53:04 -0400 Subject: [PATCH 17/24] fix --- runtimes/testnet/src/weights/networks.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtimes/testnet/src/weights/networks.rs b/runtimes/testnet/src/weights/networks.rs index 0c7d791e9..998d9fd2c 100644 --- a/runtimes/testnet/src/weights/networks.rs +++ b/runtimes/testnet/src/weights/networks.rs @@ -63,7 +63,7 @@ impl pallet_networks::WeightInfo for WeightInfo { /// The range of component `b` is `[1, 50]`. /// The range of component `a` is `[1, 50]`. /// The range of component `b` is `[1, 50]`. - fn register_network(_a: u32, _b: u32, ) -> Weight { + fn register_network(a: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `118` // Estimated: `3583` From e0240f5faf4ccad1ef5bbc307c6d5cf3fad4f9bd Mon Sep 17 00:00:00 2001 From: 4meta5 Date: Thu, 17 Oct 2024 14:32:12 -0400 Subject: [PATCH 18/24] try fix subxt didnt learn shit just wasted time and therefore analogs money --- tc-subxt/src/api/networks.rs | 7 +++++-- tc-subxt/src/api/shards.rs | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tc-subxt/src/api/networks.rs b/tc-subxt/src/api/networks.rs index 6930d331a..c89cd1cac 100644 --- a/tc-subxt/src/api/networks.rs +++ b/tc-subxt/src/api/networks.rs @@ -2,7 +2,7 @@ use crate::worker::Tx; use crate::{metadata_scope, SubxtClient}; use anyhow::Result; use futures::channel::oneshot; -use time_primitives::{Gateway, Network, NetworkConfig, NetworkId}; +use time_primitives::{ChainName, ChainNetwork, Gateway, Network, NetworkConfig, NetworkId}; impl SubxtClient { pub async fn register_network(&self, network: Network) -> Result<()> { @@ -35,7 +35,10 @@ impl SubxtClient { Ok(networks) } - pub async fn network_name(&self, network: NetworkId) -> Result> { + pub async fn network_name( + &self, + network: NetworkId, + ) -> Result> { let data = metadata_scope!(self.metadata, { let runtime_call = metadata::apis().networks_api().get_network(network); self.client.runtime_api().at_latest().await?.call(runtime_call).await? diff --git a/tc-subxt/src/api/shards.rs b/tc-subxt/src/api/shards.rs index d1375c822..06657a400 100644 --- a/tc-subxt/src/api/shards.rs +++ b/tc-subxt/src/api/shards.rs @@ -85,7 +85,7 @@ impl SubxtClient { } pub async fn shard_public_key(&self, shard_id: ShardId) -> Result> { - Ok(self.shard_commitment(shard_id).await?.map(|v| v[0])) + Ok(self.shard_commitment(shard_id).await?.map(|v| v.0[0])) } pub async fn submit_commitment( From f90ce92ebb5e9b297b71b99286efe001f61b2460 Mon Sep 17 00:00:00 2001 From: Github Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 17 Oct 2024 19:05:18 +0000 Subject: [PATCH 19/24] runtimes: update pallet weights --- runtimes/mainnet/src/weights/dmail.rs | 14 ++++---- runtimes/mainnet/src/weights/elections.rs | 6 ++-- runtimes/mainnet/src/weights/members.rs | 14 ++++---- runtimes/mainnet/src/weights/networks.rs | 16 +++++---- runtimes/mainnet/src/weights/shards.rs | 18 +++++----- runtimes/mainnet/src/weights/tasks.rs | 22 ++++++------ runtimes/mainnet/src/weights/timegraph.rs | 42 +++++++++++------------ runtimes/testnet/src/weights/dmail.rs | 14 ++++---- runtimes/testnet/src/weights/elections.rs | 6 ++-- runtimes/testnet/src/weights/members.rs | 14 ++++---- runtimes/testnet/src/weights/networks.rs | 18 +++++----- runtimes/testnet/src/weights/shards.rs | 18 +++++----- runtimes/testnet/src/weights/tasks.rs | 22 ++++++------ runtimes/testnet/src/weights/timegraph.rs | 42 +++++++++++------------ 14 files changed, 133 insertions(+), 133 deletions(-) diff --git a/runtimes/mainnet/src/weights/dmail.rs b/runtimes/mainnet/src/weights/dmail.rs index 248fc659b..4ab29f1fe 100644 --- a/runtimes/mainnet/src/weights/dmail.rs +++ b/runtimes/mainnet/src/weights/dmail.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_dmail` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-17, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -37,16 +37,14 @@ impl pallet_dmail::WeightInfo for WeightInfo { /// The range of component `b` is `[1, 64]`. /// The range of component `a` is `[1, 64]`. /// The range of component `b` is `[1, 64]`. - fn send_email(a: u32, b: u32, ) -> Weight { + fn send_email(_a: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 6_813_000 picoseconds. - Weight::from_parts(6_457_675, 0) + // Minimum execution time: 7_164_000 picoseconds. + Weight::from_parts(8_515_330, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 1_307 - .saturating_add(Weight::from_parts(19_455, 0).saturating_mul(a.into())) - // Standard Error: 1_307 - .saturating_add(Weight::from_parts(25_413, 0).saturating_mul(b.into())) + // Standard Error: 861 + .saturating_add(Weight::from_parts(3_398, 0).saturating_mul(b.into())) } } diff --git a/runtimes/mainnet/src/weights/elections.rs b/runtimes/mainnet/src/weights/elections.rs index 94a9b9640..a2fb91cb4 100644 --- a/runtimes/mainnet/src/weights/elections.rs +++ b/runtimes/mainnet/src/weights/elections.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_elections` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-17, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -43,8 +43,8 @@ impl pallet_elections::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `123` // Estimated: `3588` - // Minimum execution time: 12_343_000 picoseconds. - Weight::from_parts(22_392_000, 0) + // Minimum execution time: 11_993_000 picoseconds. + Weight::from_parts(12_583_000, 0) .saturating_add(Weight::from_parts(0, 3588)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/runtimes/mainnet/src/weights/members.rs b/runtimes/mainnet/src/weights/members.rs index 88628d51d..54cb33ceb 100644 --- a/runtimes/mainnet/src/weights/members.rs +++ b/runtimes/mainnet/src/weights/members.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_members` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-17, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -57,8 +57,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `244` // Estimated: `3709` - // Minimum execution time: 64_810_000 picoseconds. - Weight::from_parts(70_523_000, 0) + // Minimum execution time: 64_369_000 picoseconds. + Weight::from_parts(68_278_000, 0) .saturating_add(Weight::from_parts(0, 3709)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) @@ -73,8 +73,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `293` // Estimated: `3758` - // Minimum execution time: 22_552_000 picoseconds. - Weight::from_parts(25_298_000, 0) + // Minimum execution time: 22_822_000 picoseconds. + Weight::from_parts(24_736_000, 0) .saturating_add(Weight::from_parts(0, 3758)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -101,8 +101,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `380` // Estimated: `3845` - // Minimum execution time: 56_996_000 picoseconds. - Weight::from_parts(60_903_000, 0) + // Minimum execution time: 58_530_000 picoseconds. + Weight::from_parts(61_827_000, 0) .saturating_add(Weight::from_parts(0, 3845)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) diff --git a/runtimes/mainnet/src/weights/networks.rs b/runtimes/mainnet/src/weights/networks.rs index f2890ceeb..709c561ea 100644 --- a/runtimes/mainnet/src/weights/networks.rs +++ b/runtimes/mainnet/src/weights/networks.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_networks` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-17, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -63,13 +63,17 @@ impl pallet_networks::WeightInfo for WeightInfo { /// The range of component `b` is `[1, 50]`. /// The range of component `a` is `[1, 50]`. /// The range of component `b` is `[1, 50]`. - fn register_network(_a: u32, _b: u32, ) -> Weight { + fn register_network(a: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `118` // Estimated: `3583` - // Minimum execution time: 54_371_000 picoseconds. - Weight::from_parts(68_798_719, 0) + // Minimum execution time: 53_310_000 picoseconds. + Weight::from_parts(54_471_678, 0) .saturating_add(Weight::from_parts(0, 3583)) + // Standard Error: 10_531 + .saturating_add(Weight::from_parts(60_857, 0).saturating_mul(a.into())) + // Standard Error: 10_531 + .saturating_add(Weight::from_parts(29_084, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(13)) } @@ -87,8 +91,8 @@ impl pallet_networks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `277` // Estimated: `3742` - // Minimum execution time: 21_530_000 picoseconds. - Weight::from_parts(22_533_000, 0) + // Minimum execution time: 21_210_000 picoseconds. + Weight::from_parts(21_981_000, 0) .saturating_add(Weight::from_parts(0, 3742)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(4)) diff --git a/runtimes/mainnet/src/weights/shards.rs b/runtimes/mainnet/src/weights/shards.rs index 1099c25b9..564af0897 100644 --- a/runtimes/mainnet/src/weights/shards.rs +++ b/runtimes/mainnet/src/weights/shards.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_shards` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-17, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -47,8 +47,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `757` // Estimated: `11647` - // Minimum execution time: 511_937_000 picoseconds. - Weight::from_parts(539_068_000, 0) + // Minimum execution time: 513_722_000 picoseconds. + Weight::from_parts(519_011_000, 0) .saturating_add(Weight::from_parts(0, 11647)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) @@ -69,8 +69,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `591` // Estimated: `11481` - // Minimum execution time: 59_461_000 picoseconds. - Weight::from_parts(61_224_000, 0) + // Minimum execution time: 58_890_000 picoseconds. + Weight::from_parts(61_324_000, 0) .saturating_add(Weight::from_parts(0, 11481)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) @@ -99,8 +99,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `453` // Estimated: `11343` - // Minimum execution time: 70_921_000 picoseconds. - Weight::from_parts(76_703_000, 0) + // Minimum execution time: 70_382_000 picoseconds. + Weight::from_parts(74_119_000, 0) .saturating_add(Weight::from_parts(0, 11343)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(14)) @@ -111,8 +111,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `6` // Estimated: `3471` - // Minimum execution time: 3_436_000 picoseconds. - Weight::from_parts(4_899_000, 0) + // Minimum execution time: 3_297_000 picoseconds. + Weight::from_parts(3_577_000, 0) .saturating_add(Weight::from_parts(0, 3471)) .saturating_add(T::DbWeight::get().reads(1)) } diff --git a/runtimes/mainnet/src/weights/tasks.rs b/runtimes/mainnet/src/weights/tasks.rs index 36ed8e75d..60ebb8990 100644 --- a/runtimes/mainnet/src/weights/tasks.rs +++ b/runtimes/mainnet/src/weights/tasks.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_tasks` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-17, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -69,8 +69,8 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1380` // Estimated: `12270` - // Minimum execution time: 625_850_000 picoseconds. - Weight::from_parts(651_048_000, 0) + // Minimum execution time: 624_519_000 picoseconds. + Weight::from_parts(652_491_000, 0) .saturating_add(Weight::from_parts(0, 12270)) .saturating_add(T::DbWeight::get().reads(19)) .saturating_add(T::DbWeight::get().writes(14)) @@ -99,11 +99,11 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1538 + b * (95 ±0)` // Estimated: `7370 + b * (2571 ±0)` - // Minimum execution time: 59_692_000 picoseconds. - Weight::from_parts(40_535_221, 0) + // Minimum execution time: 59_822_000 picoseconds. + Weight::from_parts(7_743_225, 0) .saturating_add(Weight::from_parts(0, 7370)) - // Standard Error: 15_013 - .saturating_add(Weight::from_parts(10_375_135, 0).saturating_mul(b.into())) + // Standard Error: 12_643 + .saturating_add(Weight::from_parts(10_623_107, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(3)) @@ -123,11 +123,11 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `958` // Estimated: `6794 + b * (1 ±0)` - // Minimum execution time: 24_615_000 picoseconds. - Weight::from_parts(40_636_421, 0) + // Minimum execution time: 24_746_000 picoseconds. + Weight::from_parts(42_091_648, 0) .saturating_add(Weight::from_parts(0, 6794)) - // Standard Error: 320 - .saturating_add(Weight::from_parts(18_435, 0).saturating_mul(b.into())) + // Standard Error: 325 + .saturating_add(Weight::from_parts(13_552, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) } diff --git a/runtimes/mainnet/src/weights/timegraph.rs b/runtimes/mainnet/src/weights/timegraph.rs index eac5631fd..f73b009cc 100644 --- a/runtimes/mainnet/src/weights/timegraph.rs +++ b/runtimes/mainnet/src/weights/timegraph.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_timegraph` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-17, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -38,12 +38,12 @@ impl pallet_timegraph::WeightInfo for WeightInfo { fn deposit() -> Weight { // Proof Size summary in bytes: // Measured: `3` - // Estimated: `3593` - // Minimum execution time: 61_375_000 picoseconds. - Weight::from_parts(65_894_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) + // Estimated: `3468` + // Minimum execution time: 31_579_000 picoseconds. + Weight::from_parts(32_752_000, 0) + .saturating_add(Weight::from_parts(0, 3468)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `Timegraph::Threshold` (r:1 w:0) /// Proof: `Timegraph::Threshold` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -52,10 +52,10 @@ impl pallet_timegraph::WeightInfo for WeightInfo { fn withdraw() -> Weight { // Proof Size summary in bytes: // Measured: `3` - // Estimated: `3593` - // Minimum execution time: 62_317_000 picoseconds. - Weight::from_parts(65_713_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) + // Estimated: `3468` + // Minimum execution time: 31_849_000 picoseconds. + Weight::from_parts(33_092_000, 0) + .saturating_add(Weight::from_parts(0, 3468)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -69,8 +69,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `272` // Estimated: `6196` - // Minimum execution time: 84_187_000 picoseconds. - Weight::from_parts(85_631_000, 0) + // Minimum execution time: 79_319_000 picoseconds. + Weight::from_parts(81_873_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) @@ -85,8 +85,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `285` // Estimated: `3593` - // Minimum execution time: 81_293_000 picoseconds. - Weight::from_parts(82_704_000, 0) + // Minimum execution time: 75_982_000 picoseconds. + Weight::from_parts(77_726_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) @@ -97,8 +97,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `1488` - // Minimum execution time: 9_378_000 picoseconds. - Weight::from_parts(9_898_000, 0) + // Minimum execution time: 8_986_000 picoseconds. + Weight::from_parts(9_718_000, 0) .saturating_add(Weight::from_parts(0, 1488)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -109,8 +109,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `1488` - // Minimum execution time: 9_477_000 picoseconds. - Weight::from_parts(10_129_000, 0) + // Minimum execution time: 8_957_000 picoseconds. + Weight::from_parts(9_768_000, 0) .saturating_add(Weight::from_parts(0, 1488)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -121,8 +121,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `1488` - // Minimum execution time: 9_126_000 picoseconds. - Weight::from_parts(16_951_000, 0) + // Minimum execution time: 8_736_000 picoseconds. + Weight::from_parts(9_858_000, 0) .saturating_add(Weight::from_parts(0, 1488)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/runtimes/testnet/src/weights/dmail.rs b/runtimes/testnet/src/weights/dmail.rs index 2474f7a5b..8b065b571 100644 --- a/runtimes/testnet/src/weights/dmail.rs +++ b/runtimes/testnet/src/weights/dmail.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_dmail` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-17, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -41,12 +41,12 @@ impl pallet_dmail::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_093_000 picoseconds. - Weight::from_parts(9_159_733, 0) + // Minimum execution time: 6_642_000 picoseconds. + Weight::from_parts(7_015_701, 0) .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 1_419 - .saturating_add(Weight::from_parts(851, 0).saturating_mul(a.into())) - // Standard Error: 1_419 - .saturating_add(Weight::from_parts(813, 0).saturating_mul(b.into())) + // Standard Error: 567 + .saturating_add(Weight::from_parts(6_583, 0).saturating_mul(a.into())) + // Standard Error: 567 + .saturating_add(Weight::from_parts(5_645, 0).saturating_mul(b.into())) } } diff --git a/runtimes/testnet/src/weights/elections.rs b/runtimes/testnet/src/weights/elections.rs index beb756f84..51fc9da98 100644 --- a/runtimes/testnet/src/weights/elections.rs +++ b/runtimes/testnet/src/weights/elections.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_elections` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-17, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -43,8 +43,8 @@ impl pallet_elections::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `123` // Estimated: `3588` - // Minimum execution time: 12_384_000 picoseconds. - Weight::from_parts(13_966_000, 0) + // Minimum execution time: 11_961_000 picoseconds. + Weight::from_parts(12_453_000, 0) .saturating_add(Weight::from_parts(0, 3588)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/runtimes/testnet/src/weights/members.rs b/runtimes/testnet/src/weights/members.rs index 41ae22dcf..4a418aecc 100644 --- a/runtimes/testnet/src/weights/members.rs +++ b/runtimes/testnet/src/weights/members.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_members` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-17, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -57,8 +57,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `244` // Estimated: `3709` - // Minimum execution time: 60_944_000 picoseconds. - Weight::from_parts(63_850_000, 0) + // Minimum execution time: 66_054_000 picoseconds. + Weight::from_parts(69_099_000, 0) .saturating_add(Weight::from_parts(0, 3709)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) @@ -73,8 +73,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `293` // Estimated: `3758` - // Minimum execution time: 22_222_000 picoseconds. - Weight::from_parts(23_855_000, 0) + // Minimum execution time: 23_124_000 picoseconds. + Weight::from_parts(23_955_000, 0) .saturating_add(Weight::from_parts(0, 3758)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -101,8 +101,8 @@ impl pallet_members::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `380` // Estimated: `3845` - // Minimum execution time: 56_436_000 picoseconds. - Weight::from_parts(59_050_000, 0) + // Minimum execution time: 60_333_000 picoseconds. + Weight::from_parts(62_366_000, 0) .saturating_add(Weight::from_parts(0, 3845)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(8)) diff --git a/runtimes/testnet/src/weights/networks.rs b/runtimes/testnet/src/weights/networks.rs index 998d9fd2c..f6eea99bf 100644 --- a/runtimes/testnet/src/weights/networks.rs +++ b/runtimes/testnet/src/weights/networks.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_networks` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-17, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -63,17 +63,15 @@ impl pallet_networks::WeightInfo for WeightInfo { /// The range of component `b` is `[1, 50]`. /// The range of component `a` is `[1, 50]`. /// The range of component `b` is `[1, 50]`. - fn register_network(a: u32, b: u32, ) -> Weight { + fn register_network(a: u32, _b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `118` // Estimated: `3583` - // Minimum execution time: 53_861_000 picoseconds. - Weight::from_parts(60_735_804, 0) + // Minimum execution time: 53_539_000 picoseconds. + Weight::from_parts(58_286_350, 0) .saturating_add(Weight::from_parts(0, 3583)) - // Standard Error: 87 - .saturating_add(Weight::from_parts(574, 0).saturating_mul(a.into())) - // Standard Error: 87 - .saturating_add(Weight::from_parts(797, 0).saturating_mul(b.into())) + // Standard Error: 4_425 + .saturating_add(Weight::from_parts(3_419, 0).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(13)) } @@ -91,8 +89,8 @@ impl pallet_networks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `277` // Estimated: `3742` - // Minimum execution time: 21_601_000 picoseconds. - Weight::from_parts(22_413_000, 0) + // Minimum execution time: 21_230_000 picoseconds. + Weight::from_parts(22_212_000, 0) .saturating_add(Weight::from_parts(0, 3742)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(4)) diff --git a/runtimes/testnet/src/weights/shards.rs b/runtimes/testnet/src/weights/shards.rs index 4f2d0e336..ce4ce35f2 100644 --- a/runtimes/testnet/src/weights/shards.rs +++ b/runtimes/testnet/src/weights/shards.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_shards` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-17, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -47,8 +47,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `757` // Estimated: `11647` - // Minimum execution time: 521_515_000 picoseconds. - Weight::from_parts(527_687_000, 0) + // Minimum execution time: 509_142_000 picoseconds. + Weight::from_parts(518_480_000, 0) .saturating_add(Weight::from_parts(0, 11647)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) @@ -69,8 +69,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `591` // Estimated: `11481` - // Minimum execution time: 59_351_000 picoseconds. - Weight::from_parts(61_616_000, 0) + // Minimum execution time: 59_151_000 picoseconds. + Weight::from_parts(61_624_000, 0) .saturating_add(Weight::from_parts(0, 11481)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) @@ -99,8 +99,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `453` // Estimated: `11343` - // Minimum execution time: 71_804_000 picoseconds. - Weight::from_parts(74_118_000, 0) + // Minimum execution time: 72_565_000 picoseconds. + Weight::from_parts(76_703_000, 0) .saturating_add(Weight::from_parts(0, 11343)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(14)) @@ -111,8 +111,8 @@ impl pallet_shards::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `6` // Estimated: `3471` - // Minimum execution time: 3_477_000 picoseconds. - Weight::from_parts(3_687_000, 0) + // Minimum execution time: 3_547_000 picoseconds. + Weight::from_parts(3_787_000, 0) .saturating_add(Weight::from_parts(0, 3471)) .saturating_add(T::DbWeight::get().reads(1)) } diff --git a/runtimes/testnet/src/weights/tasks.rs b/runtimes/testnet/src/weights/tasks.rs index f2f9f6399..4fdcc9d6d 100644 --- a/runtimes/testnet/src/weights/tasks.rs +++ b/runtimes/testnet/src/weights/tasks.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_tasks` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-17, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -69,8 +69,8 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1380` // Estimated: `12270` - // Minimum execution time: 630_578_000 picoseconds. - Weight::from_parts(647_882_000, 0) + // Minimum execution time: 632_403_000 picoseconds. + Weight::from_parts(647_720_000, 0) .saturating_add(Weight::from_parts(0, 12270)) .saturating_add(T::DbWeight::get().reads(19)) .saturating_add(T::DbWeight::get().writes(14)) @@ -99,11 +99,11 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1538 + b * (95 ±0)` // Estimated: `7370 + b * (2571 ±0)` - // Minimum execution time: 59_231_000 picoseconds. - Weight::from_parts(1_113_078, 0) + // Minimum execution time: 60_524_000 picoseconds. + Weight::from_parts(770_202, 0) .saturating_add(Weight::from_parts(0, 7370)) - // Standard Error: 11_139 - .saturating_add(Weight::from_parts(10_548_784, 0).saturating_mul(b.into())) + // Standard Error: 10_099 + .saturating_add(Weight::from_parts(10_683_689, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(3)) @@ -123,11 +123,11 @@ impl pallet_tasks::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `958` // Estimated: `6794 + b * (1 ±0)` - // Minimum execution time: 24_506_000 picoseconds. - Weight::from_parts(40_342_829, 0) + // Minimum execution time: 24_566_000 picoseconds. + Weight::from_parts(40_559_014, 0) .saturating_add(Weight::from_parts(0, 6794)) - // Standard Error: 332 - .saturating_add(Weight::from_parts(18_157, 0).saturating_mul(b.into())) + // Standard Error: 298 + .saturating_add(Weight::from_parts(16_559, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) } diff --git a/runtimes/testnet/src/weights/timegraph.rs b/runtimes/testnet/src/weights/timegraph.rs index 7b0285eb9..46e4b4b76 100644 --- a/runtimes/testnet/src/weights/timegraph.rs +++ b/runtimes/testnet/src/weights/timegraph.rs @@ -2,7 +2,7 @@ //! Autogenerated weights for `pallet_timegraph` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.0 -//! DATE: 2024-10-12, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-17, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `benchmark-agent-1`, CPU: `AMD EPYC Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 @@ -38,12 +38,12 @@ impl pallet_timegraph::WeightInfo for WeightInfo { fn deposit() -> Weight { // Proof Size summary in bytes: // Measured: `3` - // Estimated: `3593` - // Minimum execution time: 59_802_000 picoseconds. - Weight::from_parts(60_934_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) + // Estimated: `3468` + // Minimum execution time: 34_344_000 picoseconds. + Weight::from_parts(36_608_000, 0) + .saturating_add(Weight::from_parts(0, 3468)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `Timegraph::Threshold` (r:1 w:0) /// Proof: `Timegraph::Threshold` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) @@ -52,10 +52,10 @@ impl pallet_timegraph::WeightInfo for WeightInfo { fn withdraw() -> Weight { // Proof Size summary in bytes: // Measured: `3` - // Estimated: `3593` - // Minimum execution time: 59_472_000 picoseconds. - Weight::from_parts(60_914_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) + // Estimated: `3468` + // Minimum execution time: 35_105_000 picoseconds. + Weight::from_parts(37_470_000, 0) + .saturating_add(Weight::from_parts(0, 3468)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -69,8 +69,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `272` // Estimated: `6196` - // Minimum execution time: 83_497_000 picoseconds. - Weight::from_parts(85_461_000, 0) + // Minimum execution time: 88_284_000 picoseconds. + Weight::from_parts(89_968_000, 0) .saturating_add(Weight::from_parts(0, 6196)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) @@ -85,8 +85,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `285` // Estimated: `3593` - // Minimum execution time: 80_771_000 picoseconds. - Weight::from_parts(83_026_000, 0) + // Minimum execution time: 85_661_000 picoseconds. + Weight::from_parts(92_805_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(1)) @@ -97,8 +97,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `1488` - // Minimum execution time: 9_267_000 picoseconds. - Weight::from_parts(9_719_000, 0) + // Minimum execution time: 9_206_000 picoseconds. + Weight::from_parts(9_888_000, 0) .saturating_add(Weight::from_parts(0, 1488)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -109,8 +109,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `1488` - // Minimum execution time: 9_137_000 picoseconds. - Weight::from_parts(9_798_000, 0) + // Minimum execution time: 9_327_000 picoseconds. + Weight::from_parts(9_828_000, 0) .saturating_add(Weight::from_parts(0, 1488)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -121,8 +121,8 @@ impl pallet_timegraph::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `1488` - // Minimum execution time: 9_106_000 picoseconds. - Weight::from_parts(9_578_000, 0) + // Minimum execution time: 9_057_000 picoseconds. + Weight::from_parts(9_518_000, 0) .saturating_add(Weight::from_parts(0, 1488)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) From 8ce3e1330cbe24fbf972809b83d26887f28b9607 Mon Sep 17 00:00:00 2001 From: 4meta5 Date: Thu, 17 Oct 2024 16:46:51 -0400 Subject: [PATCH 20/24] deref and clone to convert static to t --- tc-subxt/src/api/networks.rs | 5 +++-- tc-subxt/src/api/shards.rs | 7 ++++++- tc-subxt/src/api/tasks.rs | 12 +++++++++--- tc-subxt/src/worker.rs | 1 + 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/tc-subxt/src/api/networks.rs b/tc-subxt/src/api/networks.rs index c89cd1cac..0b843ee5c 100644 --- a/tc-subxt/src/api/networks.rs +++ b/tc-subxt/src/api/networks.rs @@ -39,10 +39,11 @@ impl SubxtClient { &self, network: NetworkId, ) -> Result> { - let data = metadata_scope!(self.metadata, { + let data: Option<(ChainName, ChainNetwork)> = metadata_scope!(self.metadata, { let runtime_call = metadata::apis().networks_api().get_network(network); self.client.runtime_api().at_latest().await?.call(runtime_call).await? - }); + }) + .map(|(name, net)| ((*name).clone(), (*net).clone())); Ok(data) } diff --git a/tc-subxt/src/api/shards.rs b/tc-subxt/src/api/shards.rs index 06657a400..caa8be56b 100644 --- a/tc-subxt/src/api/shards.rs +++ b/tc-subxt/src/api/shards.rs @@ -80,7 +80,12 @@ impl SubxtClient { pub async fn shard_commitment(&self, shard_id: ShardId) -> Result> { metadata_scope!(self.metadata, { let runtime_call = metadata::apis().shards_api().get_shard_commitment(shard_id); - Ok(self.client.runtime_api().at_latest().await?.call(runtime_call).await?) + let output = self.client.runtime_api().at_latest().await?.call(runtime_call).await?; + let output_converted = match output { + Some(static_commitment) => Some((*static_commitment).clone()), + None => None, + }; + Ok(output_converted) }) } diff --git a/tc-subxt/src/api/tasks.rs b/tc-subxt/src/api/tasks.rs index ad0921b3b..8da289206 100644 --- a/tc-subxt/src/api/tasks.rs +++ b/tc-subxt/src/api/tasks.rs @@ -3,7 +3,8 @@ use crate::{metadata_scope, SubxtClient}; use anyhow::Result; use futures::channel::oneshot; use time_primitives::{ - BatchId, GatewayMessage, MessageId, NetworkId, PublicKey, ShardId, Task, TaskId, TaskResult, + BatchId, ErrorMsg, GatewayMessage, MessageId, NetworkId, PublicKey, ShardId, Task, TaskId, + TaskResult, }; impl SubxtClient { @@ -56,11 +57,16 @@ impl SubxtClient { }) } - pub async fn task_output(&self, task_id: TaskId) -> Result>> { + pub async fn task_output(&self, task_id: TaskId) -> Result>> { metadata_scope!(self.metadata, { let storage_query = metadata::storage().tasks().task_output(task_id); let output = self.client.storage().at_latest().await?.fetch(&storage_query).await?; - Ok(output) + let output_converted = match output { + Some(Ok(())) => Some(Ok(())), + Some(Err(static_err)) => Some(Err((*static_err).clone())), + None => None, + }; + Ok(output_converted) }) } diff --git a/tc-subxt/src/worker.rs b/tc-subxt/src/worker.rs index 76e5f887f..9e4d3fb1b 100644 --- a/tc-subxt/src/worker.rs +++ b/tc-subxt/src/worker.rs @@ -172,6 +172,7 @@ impl SubxtWorker { commitment, proof_of_knowledge, } => { + let commitment = subxt::utils::Static(commitment); let payload = metadata::tx().shards().commit(shard_id, commitment, proof_of_knowledge); self.create_signed_payload(&payload).await From d79707f3b072168ac3264364324ffd4a64316737 Mon Sep 17 00:00:00 2001 From: 4meta5 Date: Thu, 17 Oct 2024 17:13:36 -0400 Subject: [PATCH 21/24] ok clippy chill --- tc-subxt/src/api/shards.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tc-subxt/src/api/shards.rs b/tc-subxt/src/api/shards.rs index caa8be56b..d3225880c 100644 --- a/tc-subxt/src/api/shards.rs +++ b/tc-subxt/src/api/shards.rs @@ -81,10 +81,7 @@ impl SubxtClient { metadata_scope!(self.metadata, { let runtime_call = metadata::apis().shards_api().get_shard_commitment(shard_id); let output = self.client.runtime_api().at_latest().await?.call(runtime_call).await?; - let output_converted = match output { - Some(static_commitment) => Some((*static_commitment).clone()), - None => None, - }; + let output_converted = output.map(|static_commitment| (*static_commitment).clone()); Ok(output_converted) }) } From f6a6f41fd0e1945b3866da6a72e03377a7cef4eb Mon Sep 17 00:00:00 2001 From: 4meta5 Date: Thu, 17 Oct 2024 21:03:18 -0400 Subject: [PATCH 22/24] update chronicle --- Cargo.lock | 2 ++ chronicle/Cargo.toml | 5 ++++- chronicle/src/lib.rs | 7 +++++-- chronicle/src/shards/service.rs | 11 +++++++---- chronicle/src/tasks/mod.rs | 20 ++++++++++++++------ 5 files changed, 32 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f7d0de175..d95499266 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2294,7 +2294,9 @@ dependencies = [ "getrandom 0.2.15", "gmp", "hex", + "parity-scale-codec", "peernet", + "polkadot-sdk", "prometheus_exporter", "schnorr-evm", "serde", diff --git a/chronicle/Cargo.toml b/chronicle/Cargo.toml index 51887dcf8..051c35985 100644 --- a/chronicle/Cargo.toml +++ b/chronicle/Cargo.toml @@ -23,7 +23,10 @@ tc-subxt.workspace = true tokio.workspace = true tracing.workspace = true tss.workspace = true - +polkadot-sdk = { workspace = true, features = [ + "sp-runtime", +]} +scale-codec.workspace = true bincode = "1.3.3" bip39 = "2.0.0" getrandom = "0.2.15" diff --git a/chronicle/src/lib.rs b/chronicle/src/lib.rs index 9df334080..56c3206bc 100644 --- a/chronicle/src/lib.rs +++ b/chronicle/src/lib.rs @@ -5,6 +5,7 @@ use crate::tasks::TaskParams; use anyhow::Result; use futures::channel::mpsc; use gmp::Backend; +use scale_codec::Decode; use std::path::PathBuf; use std::sync::Arc; use std::time::Duration; @@ -75,10 +76,12 @@ pub async fn run_chronicle(config: ChronicleConfig, substrate: Arc) }; }; let (tss_tx, tss_rx) = mpsc::channel(10); + let blockchain = String::decode(&mut chain.0.to_vec().as_slice()).unwrap_or_default(); + let network = String::decode(&mut subchain.0.to_vec().as_slice()).unwrap_or_default(); let connector_params = ConnectorParams { network_id: config.network_id, - blockchain: chain, - network: subchain, + blockchain, + network, url: config.target_url, mnemonic: config.target_mnemonic, }; diff --git a/chronicle/src/shards/service.rs b/chronicle/src/shards/service.rs index 1690762e5..f3e8c162d 100644 --- a/chronicle/src/shards/service.rs +++ b/chronicle/src/shards/service.rs @@ -11,6 +11,7 @@ use futures::{ stream::FuturesUnordered, Future, FutureExt, Stream, StreamExt, }; +use polkadot_sdk::sp_runtime::BoundedVec; use std::sync::Arc; use std::{ collections::{BTreeMap, BTreeSet, HashMap}, @@ -19,7 +20,8 @@ use std::{ task::Poll, }; use time_primitives::{ - BlockHash, BlockNumber, ShardId, ShardStatus, TaskId, TssSignature, TssSigningRequest, + BlockHash, BlockNumber, Commitment, ShardId, ShardStatus, TaskId, TssSignature, + TssSigningRequest, }; use tokio::time::{sleep, Duration}; use tracing::{event, span, Level, Span}; @@ -131,7 +133,8 @@ where let commitment = if let Some(commitment) = self.substrate.get_shard_commitment(shard_id).await? { - let commitment = VerifiableSecretSharingCommitment::deserialize(commitment)?; + let commitment = + VerifiableSecretSharingCommitment::deserialize(commitment.0.to_vec())?; Some(commitment) } else { None @@ -159,7 +162,7 @@ where continue; } let commitment = self.substrate.get_shard_commitment(shard_id).await?.unwrap(); - let commitment = VerifiableSecretSharingCommitment::deserialize(commitment)?; + let commitment = VerifiableSecretSharingCommitment::deserialize(commitment.0.to_vec())?; tss.on_commit(commitment); self.poll_actions(&span, shard_id, block_number).await; } @@ -287,7 +290,7 @@ where self.substrate .submit_commitment( shard_id, - commitment.serialize(), + Commitment(BoundedVec::truncate_from(commitment.serialize())), proof_of_knowledge.serialize(), ) .await diff --git a/chronicle/src/tasks/mod.rs b/chronicle/src/tasks/mod.rs index 3e7c11023..af44576c0 100644 --- a/chronicle/src/tasks/mod.rs +++ b/chronicle/src/tasks/mod.rs @@ -3,11 +3,13 @@ use crate::TW_LOG; use anyhow::{Context, Result}; use futures::channel::{mpsc, oneshot}; use futures::{SinkExt, Stream}; +use polkadot_sdk::sp_runtime::BoundedVec; +use scale_codec::Encode; use std::sync::Arc; use std::{collections::BTreeMap, pin::Pin}; use time_primitives::{ - Address, BlockHash, BlockNumber, GmpParams, IConnector, NetworkId, ShardId, Task, TaskId, - TaskResult, TssSignature, TssSigningRequest, + Address, BlockHash, BlockNumber, ErrorMsg, GmpEvents, GmpParams, IConnector, NetworkId, + ShardId, Task, TaskId, TaskResult, TssSignature, TssSigningRequest, }; use tokio::task::JoinHandle; use tracing::{event, span, Level}; @@ -104,7 +106,10 @@ impl TaskParams { tracing::info!(target: TW_LOG, task_id, "read {} events", events.len(),); let payload = time_primitives::encode_gmp_events(task_id, &events); let signature = self.tss_sign(block_number, shard_id, task_id, payload).await?; - Some(TaskResult::ReadGatewayEvents { events, signature }) + Some(TaskResult::ReadGatewayEvents { + events: GmpEvents(BoundedVec::truncate_from(events)), + signature, + }) }, Task::SubmitGatewayMessage { batch_id } => { let msg = @@ -113,11 +118,14 @@ impl TaskParams { let signature = self.tss_sign(block_number, shard_id, task_id, payload.to_vec()).await?; let signer = - self.runtime.get_shard_commitment(shard_id).await?.context("invalid shard")?[0]; - if let Err(error) = + self.runtime.get_shard_commitment(shard_id).await?.context("invalid shard")?.0 + [0]; + if let Err(e) = self.connector.submit_commands(gateway, batch_id, msg, signer, signature).await { - Some(TaskResult::SubmitGatewayMessage { error }) + Some(TaskResult::SubmitGatewayMessage { + error: ErrorMsg(BoundedVec::truncate_from(e.encode())), + }) } else { None } From 252cf6cf24ba6150970a2356096fb1eb3351a773 Mon Sep 17 00:00:00 2001 From: 4meta5 Date: Thu, 17 Oct 2024 21:26:52 -0400 Subject: [PATCH 23/24] update tc cli --- Cargo.lock | 2 ++ tc-cli/Cargo.toml | 2 ++ tc-cli/src/lib.rs | 24 +++++++++++++++--------- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d95499266..dbda906e1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -18915,6 +18915,8 @@ dependencies = [ "futures", "gmp", "hex", + "parity-scale-codec", + "polkadot-sdk", "reqwest", "serde", "serde_yaml", diff --git a/tc-cli/Cargo.toml b/tc-cli/Cargo.toml index 96715b3d0..7a80edb69 100644 --- a/tc-cli/Cargo.toml +++ b/tc-cli/Cargo.toml @@ -20,6 +20,8 @@ serde_yaml = "0.9.34" surf = { version = "2.3.2", default-features = false, features = [ "h1-client-rustls" ] } tabled = "0.16.0" tc-subxt.workspace = true +scale-codec.workspace = true +polkadot-sdk = { workspace = true, features = ["sp-runtime"]} time-primitives = { workspace = true, default-features = true } tokio = { workspace = true, features = [ "macros", "rt-multi-thread", "signal" ]} tracing.workspace = true diff --git a/tc-cli/src/lib.rs b/tc-cli/src/lib.rs index e271a18b6..c354ab5ff 100644 --- a/tc-cli/src/lib.rs +++ b/tc-cli/src/lib.rs @@ -1,6 +1,8 @@ use crate::config::Config; use anyhow::{Context, Result}; use futures::stream::{BoxStream, StreamExt}; +use polkadot_sdk::sp_runtime::BoundedVec; +use scale_codec::{Decode, Encode}; use std::collections::hash_map::Entry; use std::collections::HashMap; use std::ops::Range; @@ -9,9 +11,9 @@ use std::sync::Arc; use std::time::Duration; use tc_subxt::SubxtClient; use time_primitives::{ - AccountId, Address, BatchId, BlockHash, BlockNumber, ConnectorParams, Gateway, GatewayMessage, - GmpEvent, GmpMessage, IConnectorAdmin, MemberStatus, MessageId, NetworkConfig, NetworkId, - PublicKey, Route, ShardId, ShardStatus, TaskId, TssPublicKey, + AccountId, Address, BatchId, BlockHash, BlockNumber, ChainName, ChainNetwork, ConnectorParams, + Gateway, GatewayMessage, GmpEvent, GmpMessage, IConnectorAdmin, MemberStatus, MessageId, + NetworkConfig, NetworkId, PublicKey, Route, ShardId, ShardStatus, TaskId, TssPublicKey, }; mod config; @@ -376,8 +378,10 @@ impl Tc { let sync_status = self.sync_status(network).await?; networks.push(Network { network, - chain_name, - chain_network, + chain_name: String::decode(&mut chain_name.0.to_vec().as_slice()) + .unwrap_or_default(), + chain_network: String::decode(&mut chain_network.0.to_vec().as_slice()) + .unwrap_or_default(), gateway, gateway_balance, admin, @@ -425,7 +429,7 @@ impl Tc { e.insert(self.registered_shards(network).await?); } let status = self.runtime.shard_status(shard).await?; - let key = self.runtime.shard_commitment(shard).await?.map(|c| c[0]); + let key = self.runtime.shard_commitment(shard).await?.map(|c| c.0[0]); let size = self.runtime.shard_members(shard).await?.len() as u16; let threshold = self.runtime.shard_threshold(shard).await?; let mut registered = false; @@ -480,7 +484,9 @@ impl Tc { task, network: self.runtime.task_network(task).await?.context("invalid task id")?, descriptor: self.runtime.task(task).await?.context("invalid task id")?, - output: self.runtime.task_output(task).await?, + output: self.runtime.task_output(task).await?.map(|o| { + o.map_err(|e| String::decode(&mut e.0.to_vec().as_slice()).unwrap_or_default()) + }), shard: self.runtime.assigned_shard(task).await?, submitter: self.runtime.task_submitter(task).await?, }) @@ -561,8 +567,8 @@ impl Tc { self.runtime .register_network(time_primitives::Network { id: network, - chain_name: config.blockchain.clone(), - chain_network: config.network.clone(), + chain_name: ChainName(BoundedVec::truncate_from(config.blockchain.encode())), + chain_network: ChainNetwork(BoundedVec::truncate_from(config.network.encode())), gateway, gateway_block: block, config: NetworkConfig { From 06918f66569d450bc2ace165b88efab1d09341f8 Mon Sep 17 00:00:00 2001 From: 4meta5 Date: Thu, 17 Oct 2024 21:43:42 -0400 Subject: [PATCH 24/24] update chronicle mock and tests --- chronicle/src/lib.rs | 9 +++++++-- chronicle/src/mock.rs | 13 ++++++++++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/chronicle/src/lib.rs b/chronicle/src/lib.rs index 56c3206bc..b42520577 100644 --- a/chronicle/src/lib.rs +++ b/chronicle/src/lib.rs @@ -151,9 +151,11 @@ pub async fn run_chronicle(config: ChronicleConfig, substrate: Arc) mod tests { use super::*; use crate::mock::Mock; + use polkadot_sdk::sp_runtime::BoundedVec; + use scale_codec::Encode; use std::time::Duration; use time_primitives::traits::IdentifyAccount; - use time_primitives::{AccountId, ShardStatus, Task}; + use time_primitives::{AccountId, ChainName, ChainNetwork, ShardStatus, Task}; /// Asynchronous test helper to run Chronicle. /// @@ -200,7 +202,10 @@ mod tests { std::panic::set_hook(Box::new(tracing_panic::panic_hook)); let mock = Mock::default().instance(42); - let network_id = mock.create_network("rust".into(), "rust".into()); + let network_id = mock.create_network( + ChainName(BoundedVec::truncate_from("rust".encode())), + ChainNetwork(BoundedVec::truncate_from("rust".encode())), + ); // Spawn multiple threads to run the Chronicle application. for id in 0..3 { let instance = mock.instance(id); diff --git a/chronicle/src/mock.rs b/chronicle/src/mock.rs index d9f16611b..69c9c242c 100644 --- a/chronicle/src/mock.rs +++ b/chronicle/src/mock.rs @@ -2,6 +2,7 @@ use crate::runtime::Runtime; use anyhow::Result; use futures::stream::BoxStream; use futures::{stream, StreamExt}; +use polkadot_sdk::sp_runtime::BoundedVec; use schnorr_evm::k256::ProjectivePoint; use std::collections::HashMap; use std::sync::{Arc, Mutex}; @@ -117,7 +118,11 @@ impl Mock { let mut shards = self.shards.lock().unwrap(); let shard = shards.get_mut(&shard_id).unwrap(); let public_key = VerifyingKey::new(ProjectivePoint::GENERATOR).to_bytes().unwrap(); - shard.commitments = vec![vec![public_key; threshold as _]; shard.members.len()]; + shard.commitments = + vec![ + Commitment(BoundedVec::truncate_from(vec![public_key; threshold as _])); + shard.members.len() + ]; shard.online = shard.members.len(); shard_id } @@ -260,11 +265,13 @@ impl Runtime for Mock { .commitments .iter() .map(|commitment| { - VerifiableSecretSharingCommitment::deserialize(commitment.clone()).unwrap() + VerifiableSecretSharingCommitment::deserialize(commitment.0.to_vec()).unwrap() }) .collect(); let commitments = commitments.iter().collect::>(); - Ok(Some(sum_commitments(&commitments).unwrap().serialize())) + Ok(Some(Commitment(BoundedVec::truncate_from( + sum_commitments(&commitments).unwrap().serialize(), + )))) } async fn get_shard_tasks(&self, shard_id: ShardId) -> Result> {