From e8f1f468c3eb8ae91527711dfba4b61761848959 Mon Sep 17 00:00:00 2001 From: Henrique Nogara Date: Thu, 24 Sep 2026 15:22:26 -0300 Subject: [PATCH 01/12] improve can_transfer erc7943 weight. --- pallets/nft/src/benchmarking.rs | 42 ++++++++++++++++++ pallets/nft/src/lib.rs | 2 + .../precompiles/src/interface/nft/erc7943.rs | 14 +++--- pallets/weights/src/pallet_nft.rs | 44 +++++++++++++++++++ 4 files changed, 97 insertions(+), 5 deletions(-) diff --git a/pallets/nft/src/benchmarking.rs b/pallets/nft/src/benchmarking.rs index b15a8d8913..f87bebf5a2 100644 --- a/pallets/nft/src/benchmarking.rs +++ b/pallets/nft/src/benchmarking.rs @@ -365,4 +365,46 @@ benchmarks! { } } + nft_transfer_report_best_case { + let alice = UserBuilder::::default().generate_did().build("Alice"); + let bob = UserBuilder::::default().generate_did().build("Bob"); + let mut weight_meter = WeightMeter::max_limit_no_minimum(); + + // No statistics or compliance rules are set + let (asset_id, sender, receiver, _) = + setup_nft_transfer::(&alice, &bob, 1, None, None, true, 0, false); + }: { + assert!( + Pallet::::nft_transfer_report( + &sender, + &receiver, + &NFTs::new_unverified(asset_id, vec![NFTId(1)]), + false, + &mut weight_meter + ) + .is_empty() + ); + } + + nft_transfer_report_worst_case { + let alice = UserBuilder::::default().generate_did().build("Alice"); + let bob = UserBuilder::::default().generate_did().build("Bob"); + let mut weight_meter = WeightMeter::max_limit_no_minimum(); + + // Max Statistics and Compliance rules are set + let (asset_id, sender, receiver, _) = + setup_nft_transfer::(&alice, &bob, 1, None, None, false, 0, false); + }: { + assert!( + Pallet::::nft_transfer_report( + &sender, + &receiver, + &NFTs::new_unverified(asset_id, vec![NFTId(1)]), + false, + &mut weight_meter + ) + .is_empty() + ); + } + } diff --git a/pallets/nft/src/lib.rs b/pallets/nft/src/lib.rs index 1738451a1d..57f77eb267 100644 --- a/pallets/nft/src/lib.rs +++ b/pallets/nft/src/lib.rs @@ -47,6 +47,8 @@ pub trait WeightInfo { fn approve() -> Weight; fn set_approval_for_all() -> Weight; fn spend_nft_approval(n: u32) -> Weight; + fn nft_transfer_report_best_case() -> Weight; + fn nft_transfer_report_worst_case() -> Weight; } pub use pallet::*; diff --git a/pallets/precompiles/src/interface/nft/erc7943.rs b/pallets/precompiles/src/interface/nft/erc7943.rs index 4afc579cfc..534f27499a 100644 --- a/pallets/precompiles/src/interface/nft/erc7943.rs +++ b/pallets/precompiles/src/interface/nft/erc7943.rs @@ -39,8 +39,8 @@ impl NonFungibleAssetInterface { call: &INonFungibleAsset::canTransferCall, env: &mut impl Ext, ) -> Result, Error> { - // `nft_transfer_report` performs the same checks as a single-NFT transfer. - let worst_case_weight = ::WeightInfo::base_nft_transfer(1); + let worst_case_weight = + ::WeightInfo::nft_transfer_report_worst_case(); let charged = env.charge(worst_case_weight)?; let nft_id = Self::nft_id(call.tokenId)?; @@ -57,9 +57,13 @@ impl NonFungibleAssetInterface { &mut weight_meter, ); - let consumed = weight_meter.consumed(); - if consumed.ref_time() < worst_case_weight.ref_time() { - env.adjust_gas(charged, consumed); + let transfer_report_weight = + ::WeightInfo::asset_transfer_report_best_case(); + let compliance_weight = weight_meter.consumed(); + let real_consumed_weight = transfer_report_weight.saturating_add(compliance_weight); + + if real_consumed_weight.ref_time() < worst_case_weight.ref_time() { + env.adjust_gas(charged, real_consumed_weight); } Ok(INonFungibleAsset::canTransferCall::abi_encode_returns( diff --git a/pallets/weights/src/pallet_nft.rs b/pallets/weights/src/pallet_nft.rs index 15b3c47291..fcf05f3647 100644 --- a/pallets/weights/src/pallet_nft.rs +++ b/pallets/weights/src/pallet_nft.rs @@ -303,4 +303,48 @@ impl pallet_nft::WeightInfo for SubstrateWeight { .saturating_add(DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(DbWeight::get().writes((1_u64).saturating_mul(n.into()))) } + // Storage: `Nft::CollectionAsset` (r:1 w:0) + // Proof: `Nft::CollectionAsset` (`max_values`: None, `max_size`: Some(40), added: 2515, mode: `MaxEncodedLen`) + // Storage: `Asset::Frozen` (r:1 w:0) + // Proof: `Asset::Frozen` (`max_values`: None, `max_size`: Some(33), added: 2508, mode: `MaxEncodedLen`) + // Storage: `Nft::NumberOfNFTs` (r:2 w:0) + // Proof: `Nft::NumberOfNFTs` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `MaxEncodedLen`) + // Storage: `Portfolio::FrozenPortfolios` (r:1 w:0) + // Proof: `Portfolio::FrozenPortfolios` (`max_values`: None, `max_size`: Some(82), added: 2557, mode: `MaxEncodedLen`) + // Storage: `Portfolio::PortfolioNFT` (r:1 w:0) + // Proof: `Portfolio::PortfolioNFT` (`max_values`: None, `max_size`: Some(106), added: 2581, mode: `MaxEncodedLen`) + // Storage: `Portfolio::PortfolioLockedNFT` (r:1 w:0) + // Proof: `Portfolio::PortfolioLockedNFT` (`max_values`: None, `max_size`: Some(90), added: 2565, mode: `MaxEncodedLen`) + // Storage: `Identity::DidRecords` (r:1 w:0) + // Proof: `Identity::DidRecords` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) + // Storage: `ComplianceManager::AssetCompliances` (r:1 w:0) + // Proof: `ComplianceManager::AssetCompliances` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn nft_transfer_report_best_case() -> Weight { + // Minimum execution time: 107_468 nanoseconds. + Weight::from_parts(109_845_000, 0).saturating_add(DbWeight::get().reads(9)) + } + // Storage: `Nft::CollectionAsset` (r:1 w:0) + // Proof: `Nft::CollectionAsset` (`max_values`: None, `max_size`: Some(40), added: 2515, mode: `MaxEncodedLen`) + // Storage: `Asset::Frozen` (r:1 w:0) + // Proof: `Asset::Frozen` (`max_values`: None, `max_size`: Some(33), added: 2508, mode: `MaxEncodedLen`) + // Storage: `Nft::NumberOfNFTs` (r:2 w:0) + // Proof: `Nft::NumberOfNFTs` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `MaxEncodedLen`) + // Storage: `Portfolio::FrozenPortfolios` (r:1 w:0) + // Proof: `Portfolio::FrozenPortfolios` (`max_values`: None, `max_size`: Some(82), added: 2557, mode: `MaxEncodedLen`) + // Storage: `Portfolio::PortfolioNFT` (r:1 w:0) + // Proof: `Portfolio::PortfolioNFT` (`max_values`: None, `max_size`: Some(106), added: 2581, mode: `MaxEncodedLen`) + // Storage: `Portfolio::PortfolioLockedNFT` (r:1 w:0) + // Proof: `Portfolio::PortfolioLockedNFT` (`max_values`: None, `max_size`: Some(90), added: 2565, mode: `MaxEncodedLen`) + // Storage: `Identity::DidRecords` (r:1 w:0) + // Proof: `Identity::DidRecords` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) + // Storage: `ComplianceManager::AssetCompliances` (r:1 w:0) + // Proof: `ComplianceManager::AssetCompliances` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Timestamp::Now` (r:1 w:0) + // Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + // Storage: `Identity::Claims` (r:1 w:0) + // Proof: `Identity::Claims` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn nft_transfer_report_worst_case() -> Weight { + // Minimum execution time: 117_040 nanoseconds. + Weight::from_parts(120_097_000, 0).saturating_add(DbWeight::get().reads(11)) + } } From 502813431933b91a499c7f6c8bfac06c3de1309e Mon Sep 17 00:00:00 2001 From: Henrique Nogara Date: Fri, 25 Sep 2026 09:53:23 -0300 Subject: [PATCH 02/12] Bump spec version --- Cargo.lock | 2 +- Cargo.toml | 2 +- pallets/runtime/develop/src/runtime.rs | 2 +- pallets/runtime/mainnet/src/runtime.rs | 2 +- pallets/runtime/testnet/src/runtime.rs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 75ec868171..54fb73664f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10679,7 +10679,7 @@ dependencies = [ [[package]] name = "polymesh" -version = "8.1.2" +version = "8.1.3" dependencies = [ "array-bytes 6.2.3", "clap", diff --git a/Cargo.toml b/Cargo.toml index 95e135d25f..4231dbac47 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -127,7 +127,7 @@ members = [ exclude = ["contracts", "integration", "metadata-tools"] [workspace.package] -version = "8.1.2" +version = "8.1.3" authors = ["PolymeshAssociation"] license-file = "./LICENSE" edition = "2021" diff --git a/pallets/runtime/develop/src/runtime.rs b/pallets/runtime/develop/src/runtime.rs index 4f320cee73..d69fc29f8c 100644 --- a/pallets/runtime/develop/src/runtime.rs +++ b/pallets/runtime/develop/src/runtime.rs @@ -58,7 +58,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { authoring_version: 1, // `spec_version: aaa_bbb_ccd` should match node version v`aaa.bbb.cc` // N.B. `d` is unpinned from the binary version - spec_version: 8_001_020, + spec_version: 8_001_030, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 8, diff --git a/pallets/runtime/mainnet/src/runtime.rs b/pallets/runtime/mainnet/src/runtime.rs index edbf6943f5..ff6b0dbcf7 100644 --- a/pallets/runtime/mainnet/src/runtime.rs +++ b/pallets/runtime/mainnet/src/runtime.rs @@ -57,7 +57,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { authoring_version: 1, // `spec_version: aaa_bbb_ccd` should match node version v`aaa.bbb.cc` // N.B. `d` is unpinned from the binary version - spec_version: 8_001_020, + spec_version: 8_001_030, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 8, diff --git a/pallets/runtime/testnet/src/runtime.rs b/pallets/runtime/testnet/src/runtime.rs index bb899f3148..0c0a7590b1 100644 --- a/pallets/runtime/testnet/src/runtime.rs +++ b/pallets/runtime/testnet/src/runtime.rs @@ -59,7 +59,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { authoring_version: 1, // `spec_version: aaa_bbb_ccd` should match node version v`aaa.bbb.cc` // N.B. `d` is unpinned from the binary version - spec_version: 8_001_020, + spec_version: 8_001_030, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 8, From cb53db53bae58015f7919a1be606f1948e22534c Mon Sep 17 00:00:00 2001 From: Henrique Nogara Date: Mon, 28 Sep 2026 09:00:03 -0300 Subject: [PATCH 03/12] Fix weights --- .../compliance-manager/src/benchmarking.rs | 35 +- .../precompiles/src/interface/nft/erc7943.rs | 2 +- pallets/weights/src/pallet_asset.rs | 242 ++++++------ pallets/weights/src/pallet_nft.rs | 78 ++-- pallets/weights/src/pallet_settlement.rs | 354 +++++++++--------- pallets/weights/src/pallet_sto.rs | 80 ++-- 6 files changed, 407 insertions(+), 384 deletions(-) diff --git a/pallets/compliance-manager/src/benchmarking.rs b/pallets/compliance-manager/src/benchmarking.rs index 6f3eed8738..7d5ad5d09b 100644 --- a/pallets/compliance-manager/src/benchmarking.rs +++ b/pallets/compliance-manager/src/benchmarking.rs @@ -21,8 +21,8 @@ use pallet_identity::Config as IdentityConfig; use polymesh_primitives::agent::AgentGroup; use polymesh_primitives::traits::AssetFnTrait; use polymesh_primitives::{ - asset::AssetType, AssetHolderKind, AuthorizationData, ClaimType, CountryCode, Scope, - TargetIdentity, TrustedFor, TrustedIssuer, WeightMeter, + asset::AssetType, AssetHolderKind, AuthorizationData, ClaimType, CountryCode, + CustomClaimTypeId, Scope, TargetIdentity, TrustedFor, TrustedIssuer, WeightMeter, }; use crate::*; @@ -311,22 +311,35 @@ where } /// Adds `n` requirements for `asset_id` and pauses compliance if `pause_compliance` is true. +/// +/// The requirements are built for the worst case (each has complexity 1): +/// - The first `n - 1` requirements fail (no claims are issued, so `IsAnyOf` is false), +/// forcing all requirements to be evaluated. The last one uses `IsNoneOf`, so the asset is still compliant. pub fn setup_asset_compliance( caller_did: IdentityId, asset_id: AssetId, n: u32, pause_compliance: bool, ) { + let claim_types: Vec = (1..::MaxLen::get()) + .map(|i| ClaimType::Custom(CustomClaimTypeId(i))) + .chain(core::iter::once(ClaimType::Jurisdiction)) + .collect(); + (0..n).for_each(|i| { - let trusted_issuers = vec![TrustedIssuer::from(IdentityId::from(i as u128))]; - let claims = vec![Claim::Jurisdiction( - CountryCode::BR, - Scope::Custom(vec![i as u8]), - )]; - let sender_conditions = vec![Condition::new( - ConditionType::IsNoneOf(claims), - trusted_issuers, - )]; + let trusted_issuers = vec![TrustedIssuer { + issuer: IdentityId::from(i as u128), + trusted_for: TrustedFor::Specific(claim_types.clone()), + }]; + let mut scope = vec![0u8; 32]; + scope[..4].copy_from_slice(&i.to_le_bytes()); + let claims = vec![Claim::Jurisdiction(CountryCode::BR, Scope::Custom(scope))]; + let condition_type = if i + 1 < n { + ConditionType::IsAnyOf(claims) + } else { + ConditionType::IsNoneOf(claims) + }; + let sender_conditions = vec![Condition::new(condition_type, trusted_issuers)]; Pallet::::base_add_compliance_requirement( caller_did, asset_id, diff --git a/pallets/precompiles/src/interface/nft/erc7943.rs b/pallets/precompiles/src/interface/nft/erc7943.rs index 534f27499a..fa2ac27267 100644 --- a/pallets/precompiles/src/interface/nft/erc7943.rs +++ b/pallets/precompiles/src/interface/nft/erc7943.rs @@ -58,7 +58,7 @@ impl NonFungibleAssetInterface { ); let transfer_report_weight = - ::WeightInfo::asset_transfer_report_best_case(); + ::WeightInfo::nft_transfer_report_best_case(); let compliance_weight = weight_meter.consumed(); let real_consumed_weight = transfer_report_weight.saturating_add(compliance_weight); diff --git a/pallets/weights/src/pallet_asset.rs b/pallets/weights/src/pallet_asset.rs index b65f5ab801..45d78e7120 100644 --- a/pallets/weights/src/pallet_asset.rs +++ b/pallets/weights/src/pallet_asset.rs @@ -4,7 +4,7 @@ //! Autogenerated weights for pallet_asset //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 54.0.0 -//! DATE: 2026-09-15, STEPS: `100`, REPEAT: 5, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2026-09-26, STEPS: `100`, REPEAT: 5, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 512 //! HOSTNAME: `ubuntu-8gb-hel1-bench`, CPU: `AMD EPYC-Milan Processor` @@ -16,7 +16,7 @@ // 100 // -r // 5 -// -p=pallet_asset,pallet_nft,pallet_settlement,pallet_portfolio +// -p=pallet_asset,pallet_nft,pallet_settlement,pallet_sto,pallet_compliance // -e=* // --heap-pages // 4096 @@ -58,8 +58,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::TickersOwnedByUser` (r:0 w:1) // Proof: `Asset::TickersOwnedByUser` (`max_values`: None, `max_size`: Some(61), added: 2536, mode: `MaxEncodedLen`) fn register_unique_ticker() -> Weight { - // Minimum execution time: 49_590 nanoseconds. - Weight::from_parts(54_640_000, 0) + // Minimum execution time: 47_890 nanoseconds. + Weight::from_parts(51_790_000, 0) .saturating_add(DbWeight::get().reads(8)) .saturating_add(DbWeight::get().writes(2)) } @@ -80,8 +80,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::TickersOwnedByUser` (r:0 w:2) // Proof: `Asset::TickersOwnedByUser` (`max_values`: None, `max_size`: Some(61), added: 2536, mode: `MaxEncodedLen`) fn accept_ticker_transfer() -> Weight { - // Minimum execution time: 57_560 nanoseconds. - Weight::from_parts(62_090_000, 0) + // Minimum execution time: 55_910 nanoseconds. + Weight::from_parts(59_450_000, 0) .saturating_add(DbWeight::get().reads(6)) .saturating_add(DbWeight::get().writes(6)) } @@ -116,8 +116,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `ExternalAgents::AgentOf` (r:0 w:2) // Proof: `ExternalAgents::AgentOf` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) fn accept_asset_ownership_transfer() -> Weight { - // Minimum execution time: 109_020 nanoseconds. - Weight::from_parts(115_440_000, 0) + // Minimum execution time: 105_530 nanoseconds. + Weight::from_parts(110_860_000, 0) .saturating_add(DbWeight::get().reads(12)) .saturating_add(DbWeight::get().writes(14)) } @@ -152,15 +152,11 @@ impl pallet_asset::WeightInfo for SubstrateWeight { /// The range of component `n` is `[1, 128]`. /// The range of component `i` is `[1, 512]`. /// The range of component `f` is `[1, 128]`. - fn create_asset(n: u32, i: u32, f: u32) -> Weight { - // Minimum execution time: 76_530 nanoseconds. - Weight::from_parts(83_697_121, 0) - // Standard Error: 2_794 - .saturating_add(Weight::from_parts(675, 0).saturating_mul(n.into())) - // Standard Error: 697 - .saturating_add(Weight::from_parts(62_939, 0).saturating_mul(i.into())) - // Standard Error: 2_794 - .saturating_add(Weight::from_parts(5_528, 0).saturating_mul(f.into())) + fn create_asset(_n: u32, i: u32, _f: u32) -> Weight { + // Minimum execution time: 75_130 nanoseconds. + Weight::from_parts(84_699_360, 0) + // Standard Error: 610 + .saturating_add(Weight::from_parts(59_414, 0).saturating_mul(i.into())) .saturating_add(DbWeight::get().reads(9)) .saturating_add(DbWeight::get().writes(9)) } @@ -177,8 +173,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::Frozen` (r:1 w:1) // Proof: `Asset::Frozen` (`max_values`: None, `max_size`: Some(33), added: 2508, mode: `MaxEncodedLen`) fn freeze() -> Weight { - // Minimum execution time: 37_250 nanoseconds. - Weight::from_parts(41_000_000, 0) + // Minimum execution time: 36_480 nanoseconds. + Weight::from_parts(39_310_000, 0) .saturating_add(DbWeight::get().reads(6)) .saturating_add(DbWeight::get().writes(1)) } @@ -195,8 +191,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::Frozen` (r:1 w:1) // Proof: `Asset::Frozen` (`max_values`: None, `max_size`: Some(33), added: 2508, mode: `MaxEncodedLen`) fn unfreeze() -> Weight { - // Minimum execution time: 38_239 nanoseconds. - Weight::from_parts(41_880_000, 0) + // Minimum execution time: 36_710 nanoseconds. + Weight::from_parts(40_140_000, 0) .saturating_add(DbWeight::get().reads(6)) .saturating_add(DbWeight::get().writes(1)) } @@ -214,10 +210,10 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Proof: `Asset::AssetNames` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `n` is `[1, 128]`. fn rename_asset(n: u32) -> Weight { - // Minimum execution time: 35_310 nanoseconds. - Weight::from_parts(39_002_467, 0) - // Standard Error: 578 - .saturating_add(Weight::from_parts(4_329, 0).saturating_mul(n.into())) + // Minimum execution time: 34_600 nanoseconds. + Weight::from_parts(37_427_077, 0) + // Standard Error: 466 + .saturating_add(Weight::from_parts(3_630, 0).saturating_mul(n.into())) .saturating_add(DbWeight::get().reads(5)) .saturating_add(DbWeight::get().writes(1)) } @@ -260,8 +256,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::IssuedInFundingRound` (r:1 w:1) // Proof: `Asset::IssuedInFundingRound` (`max_values`: None, `max_size`: None, mode: `Measured`) fn issue() -> Weight { - // Minimum execution time: 551_679 nanoseconds. - Weight::from_parts(585_289_000, 0) + // Minimum execution time: 528_949 nanoseconds. + Weight::from_parts(546_320_000, 0) .saturating_add(DbWeight::get().reads(137)) .saturating_add(DbWeight::get().writes(65)) } @@ -296,8 +292,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Statistics::ActiveAssetStats` (r:1 w:0) // Proof: `Statistics::ActiveAssetStats` (`max_values`: None, `max_size`: Some(2373), added: 4848, mode: `MaxEncodedLen`) fn redeem() -> Weight { - // Minimum execution time: 105_140 nanoseconds. - Weight::from_parts(110_210_000, 0) + // Minimum execution time: 100_770 nanoseconds. + Weight::from_parts(104_560_000, 0) .saturating_add(DbWeight::get().reads(15)) .saturating_add(DbWeight::get().writes(3)) } @@ -312,8 +308,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::Assets` (r:1 w:1) // Proof: `Asset::Assets` (`max_values`: None, `max_size`: None, mode: `Measured`) fn make_divisible() -> Weight { - // Minimum execution time: 33_470 nanoseconds. - Weight::from_parts(36_960_000, 0) + // Minimum execution time: 32_620 nanoseconds. + Weight::from_parts(35_500_000, 0) .saturating_add(DbWeight::get().reads(5)) .saturating_add(DbWeight::get().writes(1)) } @@ -335,10 +331,10 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Proof: `Asset::AssetDocuments` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `d` is `[1, 64]`. fn add_documents(d: u32) -> Weight { - // Minimum execution time: 47_550 nanoseconds. - Weight::from_parts(46_176_715, 0) - // Standard Error: 10_999 - .saturating_add(Weight::from_parts(8_822_890, 0).saturating_mul(d.into())) + // Minimum execution time: 46_620 nanoseconds. + Weight::from_parts(44_989_622, 0) + // Standard Error: 7_098 + .saturating_add(Weight::from_parts(8_844_607, 0).saturating_mul(d.into())) .saturating_add(DbWeight::get().reads(7)) .saturating_add(DbWeight::get().writes(1)) .saturating_add(DbWeight::get().writes((1_u64).saturating_mul(d.into()))) @@ -355,10 +351,10 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Proof: `Asset::AssetDocuments` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `d` is `[1, 64]`. fn remove_documents(d: u32) -> Weight { - // Minimum execution time: 21_720 nanoseconds. - Weight::from_parts(22_269_876, 0) - // Standard Error: 3_584 - .saturating_add(Weight::from_parts(4_420_948, 0).saturating_mul(d.into())) + // Minimum execution time: 21_040 nanoseconds. + Weight::from_parts(20_772_882, 0) + // Standard Error: 3_717 + .saturating_add(Weight::from_parts(4_429_117, 0).saturating_mul(d.into())) .saturating_add(DbWeight::get().reads(4)) .saturating_add(DbWeight::get().writes((1_u64).saturating_mul(d.into()))) } @@ -374,10 +370,10 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Proof: `Asset::FundingRound` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `f` is `[1, 128]`. fn set_funding_round(f: u32) -> Weight { - // Minimum execution time: 27_930 nanoseconds. - Weight::from_parts(31_319_324, 0) - // Standard Error: 552 - .saturating_add(Weight::from_parts(2_482, 0).saturating_mul(f.into())) + // Minimum execution time: 27_520 nanoseconds. + Weight::from_parts(29_954_916, 0) + // Standard Error: 382 + .saturating_add(Weight::from_parts(4_525, 0).saturating_mul(f.into())) .saturating_add(DbWeight::get().reads(4)) .saturating_add(DbWeight::get().writes(1)) } @@ -393,10 +389,10 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Proof: `Asset::AssetIdentifiers` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `i` is `[1, 512]`. fn update_identifiers(i: u32) -> Weight { - // Minimum execution time: 28_540 nanoseconds. - Weight::from_parts(31_691_957, 0) - // Standard Error: 239 - .saturating_add(Weight::from_parts(48_175, 0).saturating_mul(i.into())) + // Minimum execution time: 28_300 nanoseconds. + Weight::from_parts(30_579_795, 0) + // Standard Error: 228 + .saturating_add(Weight::from_parts(49_361, 0).saturating_mul(i.into())) .saturating_add(DbWeight::get().reads(4)) .saturating_add(DbWeight::get().writes(1)) } @@ -431,8 +427,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Statistics::ActiveAssetStats` (r:1 w:0) // Proof: `Statistics::ActiveAssetStats` (`max_values`: None, `max_size`: Some(2373), added: 4848, mode: `MaxEncodedLen`) fn controller_transfer() -> Weight { - // Minimum execution time: 119_800 nanoseconds. - Weight::from_parts(126_030_000, 0) + // Minimum execution time: 114_040 nanoseconds. + Weight::from_parts(120_170_000, 0) .saturating_add(DbWeight::get().reads(16)) .saturating_add(DbWeight::get().writes(5)) } @@ -473,8 +469,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Statistics::ActiveAssetStats` (r:1 w:0) // Proof: `Statistics::ActiveAssetStats` (`max_values`: None, `max_size`: Some(2373), added: 4848, mode: `MaxEncodedLen`) fn controller_transfer_to() -> Weight { - // Minimum execution time: 134_350 nanoseconds. - Weight::from_parts(140_380_000, 0) + // Minimum execution time: 128_490 nanoseconds. + Weight::from_parts(134_460_000, 0) .saturating_add(DbWeight::get().reads(20)) .saturating_add(DbWeight::get().writes(5)) } @@ -488,10 +484,10 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Proof: `Asset::CustomTypes` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `n` is `[1, 2048]`. fn register_custom_asset_type(n: u32) -> Weight { - // Minimum execution time: 26_960 nanoseconds. - Weight::from_parts(30_428_947, 0) - // Standard Error: 31 - .saturating_add(Weight::from_parts(5_621, 0).saturating_mul(n.into())) + // Minimum execution time: 26_390 nanoseconds. + Weight::from_parts(29_021_506, 0) + // Standard Error: 27 + .saturating_add(Weight::from_parts(5_901, 0).saturating_mul(n.into())) .saturating_add(DbWeight::get().reads(3)) .saturating_add(DbWeight::get().writes(3)) } @@ -510,8 +506,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::AssetMetadataValues` (r:0 w:1) // Proof: `Asset::AssetMetadataValues` (`max_values`: None, `max_size`: None, mode: `Measured`) fn set_asset_metadata() -> Weight { - // Minimum execution time: 51_250 nanoseconds. - Weight::from_parts(55_460_000, 0) + // Minimum execution time: 49_900 nanoseconds. + Weight::from_parts(53_270_000, 0) .saturating_add(DbWeight::get().reads(6)) .saturating_add(DbWeight::get().writes(2)) } @@ -530,8 +526,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Timestamp::Now` (r:1 w:0) // Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) fn set_asset_metadata_details() -> Weight { - // Minimum execution time: 47_270 nanoseconds. - Weight::from_parts(51_400_000, 0) + // Minimum execution time: 45_950 nanoseconds. + Weight::from_parts(49_120_000, 0) .saturating_add(DbWeight::get().reads(7)) .saturating_add(DbWeight::get().writes(1)) } @@ -556,8 +552,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::AssetMetadataLocalSpecs` (r:0 w:1) // Proof: `Asset::AssetMetadataLocalSpecs` (`max_values`: None, `max_size`: None, mode: `Measured`) fn register_and_set_local_asset_metadata() -> Weight { - // Minimum execution time: 75_480 nanoseconds. - Weight::from_parts(80_789_000, 0) + // Minimum execution time: 74_370 nanoseconds. + Weight::from_parts(78_450_000, 0) .saturating_add(DbWeight::get().reads(7)) .saturating_add(DbWeight::get().writes(6)) } @@ -578,8 +574,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::AssetMetadataLocalSpecs` (r:0 w:1) // Proof: `Asset::AssetMetadataLocalSpecs` (`max_values`: None, `max_size`: None, mode: `Measured`) fn register_asset_metadata_local_type() -> Weight { - // Minimum execution time: 53_410 nanoseconds. - Weight::from_parts(57_900_000, 0) + // Minimum execution time: 52_370 nanoseconds. + Weight::from_parts(55_840_000, 0) .saturating_add(DbWeight::get().reads(6)) .saturating_add(DbWeight::get().writes(4)) } @@ -592,8 +588,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::AssetMetadataGlobalSpecs` (r:0 w:1) // Proof: `Asset::AssetMetadataGlobalSpecs` (`max_values`: None, `max_size`: None, mode: `Measured`) fn register_asset_metadata_global_type() -> Weight { - // Minimum execution time: 30_360 nanoseconds. - Weight::from_parts(35_380_000, 0) + // Minimum execution time: 29_540 nanoseconds. + Weight::from_parts(33_200_000, 0) .saturating_add(DbWeight::get().reads(2)) .saturating_add(DbWeight::get().writes(4)) } @@ -608,8 +604,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Permissions::CurrentDispatchableName` (r:1 w:0) // Proof: `Permissions::CurrentDispatchableName` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn update_asset_type() -> Weight { - // Minimum execution time: 35_760 nanoseconds. - Weight::from_parts(39_660_000, 0) + // Minimum execution time: 34_660 nanoseconds. + Weight::from_parts(37_790_000, 0) .saturating_add(DbWeight::get().reads(5)) .saturating_add(DbWeight::get().writes(1)) } @@ -636,8 +632,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::AssetMetadataLocalSpecs` (r:0 w:1) // Proof: `Asset::AssetMetadataLocalSpecs` (`max_values`: None, `max_size`: None, mode: `Measured`) fn remove_local_metadata_key() -> Weight { - // Minimum execution time: 64_290 nanoseconds. - Weight::from_parts(69_369_000, 0) + // Minimum execution time: 62_280 nanoseconds. + Weight::from_parts(66_030_000, 0) .saturating_add(DbWeight::get().reads(8)) .saturating_add(DbWeight::get().writes(5)) } @@ -656,8 +652,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::AssetMetadataValues` (r:0 w:1) // Proof: `Asset::AssetMetadataValues` (`max_values`: None, `max_size`: None, mode: `Measured`) fn remove_metadata_value() -> Weight { - // Minimum execution time: 43_030 nanoseconds. - Weight::from_parts(48_210_000, 0) + // Minimum execution time: 41_640 nanoseconds. + Weight::from_parts(44_840_000, 0) .saturating_add(DbWeight::get().reads(6)) .saturating_add(DbWeight::get().writes(2)) } @@ -692,30 +688,30 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Statistics::ActiveAssetStats` (r:1 w:0) // Proof: `Statistics::ActiveAssetStats` (`max_values`: None, `max_size`: Some(2373), added: 4848, mode: `MaxEncodedLen`) fn base_transfer() -> Weight { - // Minimum execution time: 159_730 nanoseconds. - Weight::from_parts(165_830_000, 0) + // Minimum execution time: 545_590 nanoseconds. + Weight::from_parts(568_250_000, 0) .saturating_add(DbWeight::get().reads(17)) .saturating_add(DbWeight::get().writes(5)) } // Storage: `Asset::AssetsExemptFromAffirmation` (r:0 w:1) // Proof: `Asset::AssetsExemptFromAffirmation` (`max_values`: None, `max_size`: Some(33), added: 2508, mode: `MaxEncodedLen`) fn exempt_asset_affirmation() -> Weight { - // Minimum execution time: 8_650 nanoseconds. - Weight::from_parts(10_380_000, 0).saturating_add(DbWeight::get().writes(1)) + // Minimum execution time: 8_500 nanoseconds. + Weight::from_parts(9_750_000, 0).saturating_add(DbWeight::get().writes(1)) } // Storage: `Asset::AssetsExemptFromAffirmation` (r:0 w:1) // Proof: `Asset::AssetsExemptFromAffirmation` (`max_values`: None, `max_size`: Some(33), added: 2508, mode: `MaxEncodedLen`) fn remove_asset_affirmation_exemption() -> Weight { - // Minimum execution time: 8_370 nanoseconds. - Weight::from_parts(10_180_000, 0).saturating_add(DbWeight::get().writes(1)) + // Minimum execution time: 8_300 nanoseconds. + Weight::from_parts(9_590_000, 0).saturating_add(DbWeight::get().writes(1)) } // Storage: `Identity::KeyRecords` (r:1 w:0) // Proof: `Identity::KeyRecords` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) // Storage: `Asset::PreApprovedAsset` (r:0 w:1) // Proof: `Asset::PreApprovedAsset` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) fn pre_approve_asset() -> Weight { - // Minimum execution time: 17_750 nanoseconds. - Weight::from_parts(20_290_000, 0) + // Minimum execution time: 17_110 nanoseconds. + Weight::from_parts(19_070_000, 0) .saturating_add(DbWeight::get().reads(1)) .saturating_add(DbWeight::get().writes(1)) } @@ -724,8 +720,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::PreApprovedAsset` (r:0 w:1) // Proof: `Asset::PreApprovedAsset` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) fn remove_asset_pre_approval() -> Weight { - // Minimum execution time: 17_450 nanoseconds. - Weight::from_parts(19_770_000, 0) + // Minimum execution time: 17_080 nanoseconds. + Weight::from_parts(18_910_000, 0) .saturating_add(DbWeight::get().reads(1)) .saturating_add(DbWeight::get().writes(1)) } @@ -741,10 +737,10 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Proof: `Asset::MandatoryMediators` (`max_values`: None, `max_size`: Some(161), added: 2636, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 4]`. fn add_mandatory_mediators(n: u32) -> Weight { - // Minimum execution time: 33_430 nanoseconds. - Weight::from_parts(36_795_375, 0) - // Standard Error: 15_087 - .saturating_add(Weight::from_parts(267_018, 0).saturating_mul(n.into())) + // Minimum execution time: 32_700 nanoseconds. + Weight::from_parts(35_441_950, 0) + // Standard Error: 11_410 + .saturating_add(Weight::from_parts(192_313, 0).saturating_mul(n.into())) .saturating_add(DbWeight::get().reads(5)) .saturating_add(DbWeight::get().writes(1)) } @@ -760,10 +756,10 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Proof: `Asset::MandatoryMediators` (`max_values`: None, `max_size`: Some(161), added: 2636, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 4]`. fn remove_mandatory_mediators(n: u32) -> Weight { - // Minimum execution time: 34_930 nanoseconds. - Weight::from_parts(38_344_758, 0) - // Standard Error: 15_704 - .saturating_add(Weight::from_parts(219_662, 0).saturating_mul(n.into())) + // Minimum execution time: 34_020 nanoseconds. + Weight::from_parts(36_724_335, 0) + // Standard Error: 11_814 + .saturating_add(Weight::from_parts(238_999, 0).saturating_mul(n.into())) .saturating_add(DbWeight::get().reads(5)) .saturating_add(DbWeight::get().writes(1)) } @@ -784,8 +780,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::AssetIdTicker` (r:1 w:1) // Proof: `Asset::AssetIdTicker` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`) fn link_ticker_to_asset_id() -> Weight { - // Minimum execution time: 49_870 nanoseconds. - Weight::from_parts(54_060_000, 0) + // Minimum execution time: 48_090 nanoseconds. + Weight::from_parts(51_890_000, 0) .saturating_add(DbWeight::get().reads(8)) .saturating_add(DbWeight::get().writes(3)) } @@ -806,8 +802,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::AssetIdTicker` (r:0 w:1) // Proof: `Asset::AssetIdTicker` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`) fn unlink_ticker_from_asset_id() -> Weight { - // Minimum execution time: 48_430 nanoseconds. - Weight::from_parts(52_530_000, 0) + // Minimum execution time: 47_130 nanoseconds. + Weight::from_parts(50_240_000, 0) .saturating_add(DbWeight::get().reads(6)) .saturating_add(DbWeight::get().writes(4)) } @@ -816,32 +812,32 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::AssetMetadataGlobalSpecs` (r:1 w:1) // Proof: `Asset::AssetMetadataGlobalSpecs` (`max_values`: None, `max_size`: None, mode: `Measured`) fn update_global_metadata_spec() -> Weight { - // Minimum execution time: 37_960 nanoseconds. - Weight::from_parts(41_100_000, 0) + // Minimum execution time: 37_750 nanoseconds. + Weight::from_parts(40_700_000, 0) .saturating_add(DbWeight::get().reads(2)) .saturating_add(DbWeight::get().writes(1)) } // Storage: `Identity::KeyRecords` (r:1 w:0) // Proof: `Identity::KeyRecords` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) fn receiver_affirm_asset_transfer_base_weight() -> Weight { - // Minimum execution time: 12_030 nanoseconds. - Weight::from_parts(13_070_000, 0).saturating_add(DbWeight::get().reads(1)) + // Minimum execution time: 12_580 nanoseconds. + Weight::from_parts(13_480_000, 0).saturating_add(DbWeight::get().reads(1)) } // Storage: `Identity::KeyRecords` (r:1 w:0) // Proof: `Identity::KeyRecords` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) // Storage: `Asset::Allowances` (r:0 w:1) // Proof: `Asset::Allowances` (`max_values`: None, `max_size`: Some(144), added: 2619, mode: `MaxEncodedLen`) fn approve() -> Weight { - // Minimum execution time: 21_700 nanoseconds. - Weight::from_parts(24_330_000, 0) + // Minimum execution time: 21_080 nanoseconds. + Weight::from_parts(23_050_000, 0) .saturating_add(DbWeight::get().reads(1)) .saturating_add(DbWeight::get().writes(1)) } // Storage: `Asset::Allowances` (r:1 w:1) // Proof: `Asset::Allowances` (`max_values`: None, `max_size`: Some(144), added: 2619, mode: `MaxEncodedLen`) fn spend_allowance() -> Weight { - // Minimum execution time: 21_180 nanoseconds. - Weight::from_parts(23_020_000, 0) + // Minimum execution time: 20_270 nanoseconds. + Weight::from_parts(21_660_000, 0) .saturating_add(DbWeight::get().reads(1)) .saturating_add(DbWeight::get().writes(1)) } @@ -878,8 +874,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::IssuedInFundingRound` (r:1 w:1) // Proof: `Asset::IssuedInFundingRound` (`max_values`: None, `max_size`: None, mode: `Measured`) fn issue_without_statistics() -> Weight { - // Minimum execution time: 86_170 nanoseconds. - Weight::from_parts(92_339_000, 0) + // Minimum execution time: 82_590 nanoseconds. + Weight::from_parts(87_390_000, 0) .saturating_add(DbWeight::get().reads(16)) .saturating_add(DbWeight::get().writes(5)) } @@ -906,8 +902,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `ComplianceManager::AssetCompliances` (r:1 w:0) // Proof: `ComplianceManager::AssetCompliances` (`max_values`: None, `max_size`: None, mode: `Measured`) fn asset_transfer_report_best_case() -> Weight { - // Minimum execution time: 118_570 nanoseconds. - Weight::from_parts(123_260_000, 0).saturating_add(DbWeight::get().reads(13)) + // Minimum execution time: 510_320 nanoseconds. + Weight::from_parts(529_340_000, 0).saturating_add(DbWeight::get().reads(13)) } // Storage: `Asset::Assets` (r:1 w:0) // Proof: `Asset::Assets` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -931,15 +927,15 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Proof: `Statistics::AssetTransferCompliances` (`max_values`: None, `max_size`: Some(2896), added: 5371, mode: `MaxEncodedLen`) // Storage: `Timestamp::Now` (r:1 w:0) // Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) - // Storage: `Identity::Claims` (r:9 w:0) + // Storage: `Identity::Claims` (r:58 w:0) // Proof: `Identity::Claims` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `Statistics::AssetStats` (r:4 w:0) // Proof: `Statistics::AssetStats` (`max_values`: None, `max_size`: Some(107), added: 2582, mode: `MaxEncodedLen`) // Storage: `ComplianceManager::AssetCompliances` (r:1 w:0) // Proof: `ComplianceManager::AssetCompliances` (`max_values`: None, `max_size`: None, mode: `Measured`) fn asset_transfer_report_worst_case() -> Weight { - // Minimum execution time: 180_830 nanoseconds. - Weight::from_parts(186_830_000, 0).saturating_add(DbWeight::get().reads(27)) + // Minimum execution time: 748_209 nanoseconds. + Weight::from_parts(777_920_000, 0).saturating_add(DbWeight::get().reads(76)) } // Storage: `Identity::KeyRecords` (r:1 w:0) // Proof: `Identity::KeyRecords` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) @@ -956,16 +952,16 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Portfolio::PortfolioFrozenAssets` (r:0 w:1) // Proof: `Portfolio::PortfolioFrozenAssets` (`max_values`: None, `max_size`: Some(97), added: 2572, mode: `MaxEncodedLen`) fn set_frozen_tokens() -> Weight { - // Minimum execution time: 42_910 nanoseconds. - Weight::from_parts(47_170_000, 0) + // Minimum execution time: 41_450 nanoseconds. + Weight::from_parts(44_830_000, 0) .saturating_add(DbWeight::get().reads(6)) .saturating_add(DbWeight::get().writes(1)) } // Storage: `Asset::FrozenBalance` (r:1 w:0) // Proof: `Asset::FrozenBalance` (`max_values`: None, `max_size`: Some(88), added: 2563, mode: `MaxEncodedLen`) fn get_holders_frozen_balance() -> Weight { - // Minimum execution time: 9_820 nanoseconds. - Weight::from_parts(10_760_000, 0).saturating_add(DbWeight::get().reads(1)) + // Minimum execution time: 9_150 nanoseconds. + Weight::from_parts(10_220_000, 0).saturating_add(DbWeight::get().reads(1)) } // Storage: `Asset::Assets` (r:1 w:0) // Proof: `Asset::Assets` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -978,8 +974,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `ComplianceManager::AssetCompliances` (r:1 w:0) // Proof: `ComplianceManager::AssetCompliances` (`max_values`: None, `max_size`: None, mode: `Measured`) fn transfer_is_allowed_for_holder_best_case() -> Weight { - // Minimum execution time: 74_090 nanoseconds. - Weight::from_parts(76_920_000, 0).saturating_add(DbWeight::get().reads(5)) + // Minimum execution time: 451_379 nanoseconds. + Weight::from_parts(471_619_000, 0).saturating_add(DbWeight::get().reads(5)) } // Storage: `Asset::Assets` (r:1 w:0) // Proof: `Asset::Assets` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -993,11 +989,11 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Proof: `ComplianceManager::AssetCompliances` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `Timestamp::Now` (r:1 w:0) // Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) - // Storage: `Identity::Claims` (r:1 w:0) + // Storage: `Identity::Claims` (r:50 w:0) // Proof: `Identity::Claims` (`max_values`: None, `max_size`: None, mode: `Measured`) fn transfer_is_allowed_for_holder_worst_case() -> Weight { - // Minimum execution time: 83_770 nanoseconds. - Weight::from_parts(86_789_000, 0).saturating_add(DbWeight::get().reads(7)) + // Minimum execution time: 650_239 nanoseconds. + Weight::from_parts(674_920_000, 0).saturating_add(DbWeight::get().reads(56)) } // Storage: `Identity::KeyRecords` (r:1 w:0) // Proof: `Identity::KeyRecords` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) @@ -1012,8 +1008,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Portfolio::FrozenPortfolios` (r:0 w:1) // Proof: `Portfolio::FrozenPortfolios` (`max_values`: None, `max_size`: Some(82), added: 2557, mode: `MaxEncodedLen`) fn set_holder_frozen() -> Weight { - // Minimum execution time: 34_900 nanoseconds. - Weight::from_parts(38_580_000, 0) + // Minimum execution time: 34_110 nanoseconds. + Weight::from_parts(36_750_000, 0) .saturating_add(DbWeight::get().reads(5)) .saturating_add(DbWeight::get().writes(1)) } @@ -1034,8 +1030,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Portfolio::PortfolioAssetBalances` (r:1 w:0) // Proof: `Portfolio::PortfolioAssetBalances` (`max_values`: None, `max_size`: Some(97), added: 2572, mode: `MaxEncodedLen`) fn freeze_partial_tokens() -> Weight { - // Minimum execution time: 51_140 nanoseconds. - Weight::from_parts(55_870_000, 0) + // Minimum execution time: 50_100 nanoseconds. + Weight::from_parts(53_060_000, 0) .saturating_add(DbWeight::get().reads(8)) .saturating_add(DbWeight::get().writes(1)) } @@ -1054,8 +1050,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Portfolio::PortfolioFrozenAssets` (r:1 w:1) // Proof: `Portfolio::PortfolioFrozenAssets` (`max_values`: None, `max_size`: Some(97), added: 2572, mode: `MaxEncodedLen`) fn unfreeze_partial_tokens() -> Weight { - // Minimum execution time: 48_580 nanoseconds. - Weight::from_parts(52_890_000, 0) + // Minimum execution time: 47_060 nanoseconds. + Weight::from_parts(50_320_000, 0) .saturating_add(DbWeight::get().reads(7)) .saturating_add(DbWeight::get().writes(1)) } diff --git a/pallets/weights/src/pallet_nft.rs b/pallets/weights/src/pallet_nft.rs index fcf05f3647..d219f94e72 100644 --- a/pallets/weights/src/pallet_nft.rs +++ b/pallets/weights/src/pallet_nft.rs @@ -4,7 +4,7 @@ //! Autogenerated weights for pallet_nft //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 54.0.0 -//! DATE: 2026-09-15, STEPS: `100`, REPEAT: 5, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2026-09-26, STEPS: `100`, REPEAT: 5, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 512 //! HOSTNAME: `ubuntu-8gb-hel1-bench`, CPU: `AMD EPYC-Milan Processor` @@ -16,7 +16,7 @@ // 100 // -r // 5 -// -p=pallet_asset,pallet_nft,pallet_settlement,pallet_portfolio +// -p=pallet_asset,pallet_nft,pallet_settlement,pallet_sto,pallet_compliance // -e=* // --heap-pages // 4096 @@ -77,10 +77,10 @@ impl pallet_nft::WeightInfo for SubstrateWeight { // Proof: `Nft::CollectionKeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `n` is `[1, 255]`. fn create_nft_collection(n: u32) -> Weight { - // Minimum execution time: 106_580 nanoseconds. - Weight::from_parts(111_844_998, 0) - // Standard Error: 2_987 - .saturating_add(Weight::from_parts(3_080_985, 0).saturating_mul(n.into())) + // Minimum execution time: 102_210 nanoseconds. + Weight::from_parts(108_138_113, 0) + // Standard Error: 3_544 + .saturating_add(Weight::from_parts(2_961_652, 0).saturating_mul(n.into())) .saturating_add(DbWeight::get().reads(11)) .saturating_add(DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(DbWeight::get().writes(12)) @@ -113,10 +113,10 @@ impl pallet_nft::WeightInfo for SubstrateWeight { // Proof: `Nft::Owner` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 255]`. fn issue_nft(n: u32) -> Weight { - // Minimum execution time: 76_890 nanoseconds. - Weight::from_parts(79_204_504, 0) - // Standard Error: 3_474 - .saturating_add(Weight::from_parts(3_256_377, 0).saturating_mul(n.into())) + // Minimum execution time: 74_050 nanoseconds. + Weight::from_parts(76_106_393, 0) + // Standard Error: 4_181 + .saturating_add(Weight::from_parts(3_127_982, 0).saturating_mul(n.into())) .saturating_add(DbWeight::get().reads(11)) .saturating_add(DbWeight::get().writes(6)) .saturating_add(DbWeight::get().writes((1_u64).saturating_mul(n.into()))) @@ -151,10 +151,10 @@ impl pallet_nft::WeightInfo for SubstrateWeight { // Proof: `Nft::Owner` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 255]`. fn redeem_nft(n: u32) -> Weight { - // Minimum execution time: 122_260 nanoseconds. - Weight::from_parts(119_267_183, 0) - // Standard Error: 7_591 - .saturating_add(Weight::from_parts(1_730_028, 0).saturating_mul(n.into())) + // Minimum execution time: 93_980 nanoseconds. + Weight::from_parts(96_980_705, 0) + // Standard Error: 3_089 + .saturating_add(Weight::from_parts(1_363_138, 0).saturating_mul(n.into())) .saturating_add(DbWeight::get().reads(12)) .saturating_add(DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(DbWeight::get().writes(5)) @@ -182,10 +182,10 @@ impl pallet_nft::WeightInfo for SubstrateWeight { // Proof: `Nft::Owner` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 10]`. fn base_nft_transfer(n: u32) -> Weight { - // Minimum execution time: 152_870 nanoseconds. - Weight::from_parts(116_439_951, 0) - // Standard Error: 80_738 - .saturating_add(Weight::from_parts(45_120_093, 0).saturating_mul(n.into())) + // Minimum execution time: 555_080 nanoseconds. + Weight::from_parts(542_843_203, 0) + // Standard Error: 155_083 + .saturating_add(Weight::from_parts(41_777_467, 0).saturating_mul(n.into())) .saturating_add(DbWeight::get().reads(9)) .saturating_add(DbWeight::get().reads((3_u64).saturating_mul(n.into()))) .saturating_add(DbWeight::get().writes(4)) @@ -217,10 +217,10 @@ impl pallet_nft::WeightInfo for SubstrateWeight { // Proof: `Nft::Owner` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 10]`. fn controller_transfer(n: u32) -> Weight { - // Minimum execution time: 115_589 nanoseconds. - Weight::from_parts(79_271_541, 0) - // Standard Error: 66_340 - .saturating_add(Weight::from_parts(44_199_943, 0).saturating_mul(n.into())) + // Minimum execution time: 123_380 nanoseconds. + Weight::from_parts(87_700_427, 0) + // Standard Error: 136_733 + .saturating_add(Weight::from_parts(41_130_218, 0).saturating_mul(n.into())) .saturating_add(DbWeight::get().reads(11)) .saturating_add(DbWeight::get().reads((3_u64).saturating_mul(n.into()))) .saturating_add(DbWeight::get().writes(4)) @@ -258,10 +258,10 @@ impl pallet_nft::WeightInfo for SubstrateWeight { // Proof: `Nft::Owner` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 10]`. fn controller_transfer_to(n: u32) -> Weight { - // Minimum execution time: 130_560 nanoseconds. - Weight::from_parts(96_276_615, 0) - // Standard Error: 47_250 - .saturating_add(Weight::from_parts(44_293_145, 0).saturating_mul(n.into())) + // Minimum execution time: 124_529 nanoseconds. + Weight::from_parts(89_162_869, 0) + // Standard Error: 50_162 + .saturating_add(Weight::from_parts(41_568_019, 0).saturating_mul(n.into())) .saturating_add(DbWeight::get().reads(14)) .saturating_add(DbWeight::get().reads((3_u64).saturating_mul(n.into()))) .saturating_add(DbWeight::get().writes(4)) @@ -274,8 +274,8 @@ impl pallet_nft::WeightInfo for SubstrateWeight { // Storage: `Nft::TokenApproval` (r:0 w:1) // Proof: `Nft::TokenApproval` (`max_values`: None, `max_size`: Some(88), added: 2563, mode: `MaxEncodedLen`) fn approve() -> Weight { - // Minimum execution time: 29_260 nanoseconds. - Weight::from_parts(32_100_000, 0) + // Minimum execution time: 28_580 nanoseconds. + Weight::from_parts(30_969_000, 0) .saturating_add(DbWeight::get().reads(2)) .saturating_add(DbWeight::get().writes(1)) } @@ -284,8 +284,8 @@ impl pallet_nft::WeightInfo for SubstrateWeight { // Storage: `Nft::OperatorApproval` (r:0 w:1) // Proof: `Nft::OperatorApproval` (`max_values`: None, `max_size`: Some(129), added: 2604, mode: `MaxEncodedLen`) fn set_approval_for_all() -> Weight { - // Minimum execution time: 21_640 nanoseconds. - Weight::from_parts(24_080_000, 0) + // Minimum execution time: 21_240 nanoseconds. + Weight::from_parts(23_300_000, 0) .saturating_add(DbWeight::get().reads(1)) .saturating_add(DbWeight::get().writes(1)) } @@ -295,10 +295,10 @@ impl pallet_nft::WeightInfo for SubstrateWeight { // Proof: `Nft::TokenApproval` (`max_values`: None, `max_size`: Some(88), added: 2563, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 10]`. fn spend_nft_approval(n: u32) -> Weight { - // Minimum execution time: 20_750 nanoseconds. - Weight::from_parts(14_728_054, 0) - // Standard Error: 5_498 - .saturating_add(Weight::from_parts(8_894_396, 0).saturating_mul(n.into())) + // Minimum execution time: 19_920 nanoseconds. + Weight::from_parts(13_566_237, 0) + // Standard Error: 4_500 + .saturating_add(Weight::from_parts(8_509_915, 0).saturating_mul(n.into())) .saturating_add(DbWeight::get().reads(1)) .saturating_add(DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(DbWeight::get().writes((1_u64).saturating_mul(n.into()))) @@ -320,8 +320,8 @@ impl pallet_nft::WeightInfo for SubstrateWeight { // Storage: `ComplianceManager::AssetCompliances` (r:1 w:0) // Proof: `ComplianceManager::AssetCompliances` (`max_values`: None, `max_size`: None, mode: `Measured`) fn nft_transfer_report_best_case() -> Weight { - // Minimum execution time: 107_468 nanoseconds. - Weight::from_parts(109_845_000, 0).saturating_add(DbWeight::get().reads(9)) + // Minimum execution time: 474_860 nanoseconds. + Weight::from_parts(507_160_000, 0).saturating_add(DbWeight::get().reads(9)) } // Storage: `Nft::CollectionAsset` (r:1 w:0) // Proof: `Nft::CollectionAsset` (`max_values`: None, `max_size`: Some(40), added: 2515, mode: `MaxEncodedLen`) @@ -341,10 +341,10 @@ impl pallet_nft::WeightInfo for SubstrateWeight { // Proof: `ComplianceManager::AssetCompliances` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `Timestamp::Now` (r:1 w:0) // Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) - // Storage: `Identity::Claims` (r:1 w:0) + // Storage: `Identity::Claims` (r:50 w:0) // Proof: `Identity::Claims` (`max_values`: None, `max_size`: None, mode: `Measured`) fn nft_transfer_report_worst_case() -> Weight { - // Minimum execution time: 117_040 nanoseconds. - Weight::from_parts(120_097_000, 0).saturating_add(DbWeight::get().reads(11)) + // Minimum execution time: 667_679 nanoseconds. + Weight::from_parts(699_919_000, 0).saturating_add(DbWeight::get().reads(60)) } } diff --git a/pallets/weights/src/pallet_settlement.rs b/pallets/weights/src/pallet_settlement.rs index 87ca79ebde..97d1c9c89e 100644 --- a/pallets/weights/src/pallet_settlement.rs +++ b/pallets/weights/src/pallet_settlement.rs @@ -4,7 +4,7 @@ //! Autogenerated weights for pallet_settlement //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 54.0.0 -//! DATE: 2026-09-15, STEPS: `100`, REPEAT: 5, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2026-09-26, STEPS: `100`, REPEAT: 5, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 512 //! HOSTNAME: `ubuntu-8gb-hel1-bench`, CPU: `AMD EPYC-Milan Processor` @@ -16,7 +16,7 @@ // 100 // -r // 5 -// -p=pallet_asset,pallet_nft,pallet_settlement,pallet_portfolio +// -p=pallet_asset,pallet_nft,pallet_settlement,pallet_sto,pallet_compliance // -e=* // --heap-pages // 4096 @@ -56,12 +56,12 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { /// The range of component `d` is `[1, 2048]`. /// The range of component `s` is `[0, 50]`. fn create_venue(d: u32, s: u32) -> Weight { - // Minimum execution time: 30_530 nanoseconds. - Weight::from_parts(35_769_673, 0) - // Standard Error: 348 - .saturating_add(Weight::from_parts(1_577, 0).saturating_mul(d.into())) - // Standard Error: 14_703 - .saturating_add(Weight::from_parts(2_408_710, 0).saturating_mul(s.into())) + // Minimum execution time: 29_810 nanoseconds. + Weight::from_parts(37_400_699, 0) + // Standard Error: 305 + .saturating_add(Weight::from_parts(374, 0).saturating_mul(d.into())) + // Standard Error: 12_853 + .saturating_add(Weight::from_parts(2_253_716, 0).saturating_mul(s.into())) .saturating_add(DbWeight::get().reads(2)) .saturating_add(DbWeight::get().writes(5)) .saturating_add(DbWeight::get().writes((1_u64).saturating_mul(s.into()))) @@ -74,10 +74,10 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Proof: `Settlement::Details` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `d` is `[1, 2048]`. fn update_venue_details(d: u32) -> Weight { - // Minimum execution time: 24_230 nanoseconds. - Weight::from_parts(27_224_113, 0) - // Standard Error: 26 - .saturating_add(Weight::from_parts(1_198, 0).saturating_mul(d.into())) + // Minimum execution time: 23_520 nanoseconds. + Weight::from_parts(26_327_138, 0) + // Standard Error: 20 + .saturating_add(Weight::from_parts(1_045, 0).saturating_mul(d.into())) .saturating_add(DbWeight::get().reads(2)) .saturating_add(DbWeight::get().writes(1)) } @@ -86,8 +86,8 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Storage: `Settlement::VenueInfo` (r:1 w:1) // Proof: `Settlement::VenueInfo` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) fn update_venue_type() -> Weight { - // Minimum execution time: 23_010 nanoseconds. - Weight::from_parts(25_820_000, 0) + // Minimum execution time: 22_610 nanoseconds. + Weight::from_parts(24_920_000, 0) .saturating_add(DbWeight::get().reads(2)) .saturating_add(DbWeight::get().writes(1)) } @@ -101,10 +101,10 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Proof: `Settlement::VenueSigners` (`max_values`: None, `max_size`: Some(57), added: 2532, mode: `MaxEncodedLen`) /// The range of component `s` is `[0, 50]`. fn update_venue_signers(s: u32) -> Weight { - // Minimum execution time: 25_980 nanoseconds. - Weight::from_parts(34_897_104, 0) - // Standard Error: 9_793 - .saturating_add(Weight::from_parts(5_040_925, 0).saturating_mul(s.into())) + // Minimum execution time: 24_630 nanoseconds. + Weight::from_parts(33_791_513, 0) + // Standard Error: 7_427 + .saturating_add(Weight::from_parts(4_883_442, 0).saturating_mul(s.into())) .saturating_add(DbWeight::get().reads(3)) .saturating_add(DbWeight::get().reads((1_u64).saturating_mul(s.into()))) .saturating_add(DbWeight::get().writes(1)) @@ -121,8 +121,8 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Storage: `Settlement::VenueFiltering` (r:0 w:1) // Proof: `Settlement::VenueFiltering` (`max_values`: None, `max_size`: Some(33), added: 2508, mode: `MaxEncodedLen`) fn set_venue_filtering() -> Weight { - // Minimum execution time: 27_220 nanoseconds. - Weight::from_parts(30_190_000, 0) + // Minimum execution time: 26_970 nanoseconds. + Weight::from_parts(29_390_000, 0) .saturating_add(DbWeight::get().reads(4)) .saturating_add(DbWeight::get().writes(1)) } @@ -140,10 +140,10 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Proof: `Settlement::VenueAllowList` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) /// The range of component `v` is `[0, 100]`. fn allow_venues(v: u32) -> Weight { - // Minimum execution time: 32_130 nanoseconds. - Weight::from_parts(33_527_905, 0) - // Standard Error: 2_287 - .saturating_add(Weight::from_parts(2_414_834, 0).saturating_mul(v.into())) + // Minimum execution time: 31_050 nanoseconds. + Weight::from_parts(32_409_719, 0) + // Standard Error: 1_983 + .saturating_add(Weight::from_parts(2_333_511, 0).saturating_mul(v.into())) .saturating_add(DbWeight::get().reads(5)) .saturating_add(DbWeight::get().writes((1_u64).saturating_mul(v.into()))) } @@ -161,10 +161,10 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Proof: `Settlement::VenueAllowList` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) /// The range of component `v` is `[0, 100]`. fn disallow_venues(v: u32) -> Weight { - // Minimum execution time: 31_930 nanoseconds. - Weight::from_parts(33_647_940, 0) - // Standard Error: 1_807 - .saturating_add(Weight::from_parts(2_289_703, 0).saturating_mul(v.into())) + // Minimum execution time: 31_000 nanoseconds. + Weight::from_parts(33_103_663, 0) + // Standard Error: 1_752 + .saturating_add(Weight::from_parts(2_196_318, 0).saturating_mul(v.into())) .saturating_add(DbWeight::get().reads(5)) .saturating_add(DbWeight::get().writes((1_u64).saturating_mul(v.into()))) } @@ -214,14 +214,14 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { /// The range of component `n` is `[0, 100]`. /// The range of component `o` is `[0, 10]`. fn affirm_with_receipts(f: u32, n: u32, o: u32) -> Weight { - // Minimum execution time: 1_238_679 nanoseconds. - Weight::from_parts(28_928_562, 0) - // Standard Error: 592_265 - .saturating_add(Weight::from_parts(46_574_243, 0).saturating_mul(f.into())) - // Standard Error: 54_786 - .saturating_add(Weight::from_parts(40_151_560, 0).saturating_mul(n.into())) - // Standard Error: 536_501 - .saturating_add(Weight::from_parts(78_406_066, 0).saturating_mul(o.into())) + // Minimum execution time: 1_237_348 nanoseconds. + Weight::from_parts(172_033_413, 0) + // Standard Error: 565_455 + .saturating_add(Weight::from_parts(36_751_417, 0).saturating_mul(f.into())) + // Standard Error: 52_306 + .saturating_add(Weight::from_parts(38_550_050, 0).saturating_mul(n.into())) + // Standard Error: 512_215 + .saturating_add(Weight::from_parts(72_544_320, 0).saturating_mul(o.into())) .saturating_add(DbWeight::get().reads(7)) .saturating_add(DbWeight::get().reads((8_u64).saturating_mul(f.into()))) .saturating_add(DbWeight::get().reads((6_u64).saturating_mul(n.into()))) @@ -281,7 +281,7 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Proof: `Identity::DidRecords` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) // Storage: `Statistics::AssetTransferCompliances` (r:10 w:0) // Proof: `Statistics::AssetTransferCompliances` (`max_values`: None, `max_size`: Some(2896), added: 5371, mode: `MaxEncodedLen`) - // Storage: `Identity::Claims` (r:201 w:0) + // Storage: `Identity::Claims` (r:250 w:0) // Proof: `Identity::Claims` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `Statistics::AssetStats` (r:140 w:100) // Proof: `Statistics::AssetStats` (`max_values`: None, `max_size`: Some(107), added: 2582, mode: `MaxEncodedLen`) @@ -317,13 +317,13 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { /// The range of component `n` is `[0, 100]`. /// The range of component `o` is `[0, 10]`. fn execute_manual_instruction(f: u32, n: u32, o: u32) -> Weight { - // Minimum execution time: 4_456_184 nanoseconds. - Weight::from_parts(4_458_345_000, 0) - // Standard Error: 4_887_711 - .saturating_add(Weight::from_parts(257_773_974, 0).saturating_mul(f.into())) - // Standard Error: 490_720 - .saturating_add(Weight::from_parts(211_621_624, 0).saturating_mul(n.into())) - .saturating_add(DbWeight::get().reads(15)) + // Minimum execution time: 9_641_174 nanoseconds. + Weight::from_parts(376_452_040, 0) + // Standard Error: 4_261_584 + .saturating_add(Weight::from_parts(935_425_758, 0).saturating_mul(f.into())) + // Standard Error: 435_226 + .saturating_add(Weight::from_parts(748_459_672, 0).saturating_mul(n.into())) + .saturating_add(DbWeight::get().reads(64)) .saturating_add(DbWeight::get().reads((61_u64).saturating_mul(f.into()))) .saturating_add(DbWeight::get().reads((22_u64).saturating_mul(n.into()))) .saturating_add(DbWeight::get().reads((3_u64).saturating_mul(o.into()))) @@ -386,14 +386,12 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { /// The range of component `n` is `[0, 100]`. /// The range of component `o` is `[0, 10]`. fn add_instruction(f: u32, n: u32, o: u32) -> Weight { - // Minimum execution time: 687_689 nanoseconds. - Weight::from_parts(89_073_864, 0) - // Standard Error: 904_949 - .saturating_add(Weight::from_parts(57_249_377, 0).saturating_mul(f.into())) - // Standard Error: 83_710 - .saturating_add(Weight::from_parts(56_244_261, 0).saturating_mul(n.into())) - // Standard Error: 819_744 - .saturating_add(Weight::from_parts(4_717_299, 0).saturating_mul(o.into())) + // Minimum execution time: 672_638 nanoseconds. + Weight::from_parts(686_988_000, 0) + // Standard Error: 840_002 + .saturating_add(Weight::from_parts(28_405_880, 0).saturating_mul(f.into())) + // Standard Error: 81_108 + .saturating_add(Weight::from_parts(51_366_575, 0).saturating_mul(n.into())) .saturating_add(DbWeight::get().reads(9)) .saturating_add(DbWeight::get().reads((9_u64).saturating_mul(f.into()))) .saturating_add(DbWeight::get().reads((9_u64).saturating_mul(n.into()))) @@ -472,14 +470,14 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { /// The range of component `n` is `[0, 100]`. /// The range of component `o` is `[0, 10]`. fn add_and_affirm_instruction(f: u32, n: u32, o: u32) -> Weight { - // Minimum execution time: 1_168_969 nanoseconds. - Weight::from_parts(1_041_593, 0) - // Standard Error: 1_073_641 - .saturating_add(Weight::from_parts(102_478_344, 0).saturating_mul(f.into())) - // Standard Error: 99_314 - .saturating_add(Weight::from_parts(92_319_998, 0).saturating_mul(n.into())) - // Standard Error: 972_553 - .saturating_add(Weight::from_parts(16_163_745, 0).saturating_mul(o.into())) + // Minimum execution time: 1_134_478 nanoseconds. + Weight::from_parts(251_451_199, 0) + // Standard Error: 1_445_395 + .saturating_add(Weight::from_parts(80_929_234, 0).saturating_mul(f.into())) + // Standard Error: 133_702 + .saturating_add(Weight::from_parts(87_170_515, 0).saturating_mul(n.into())) + // Standard Error: 1_309_305 + .saturating_add(Weight::from_parts(11_494_951, 0).saturating_mul(o.into())) .saturating_add(DbWeight::get().reads(10)) .saturating_add(DbWeight::get().reads((15_u64).saturating_mul(f.into()))) .saturating_add(DbWeight::get().reads((14_u64).saturating_mul(n.into()))) @@ -524,12 +522,12 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { /// The range of component `f` is `[1, 10]`. /// The range of component `n` is `[1, 100]`. fn affirm_instruction(f: u32, n: u32) -> Weight { - // Minimum execution time: 608_530 nanoseconds. - Weight::from_parts(90_623_223, 0) - // Standard Error: 650_640 - .saturating_add(Weight::from_parts(51_630_667, 0).saturating_mul(f.into())) - // Standard Error: 61_139 - .saturating_add(Weight::from_parts(40_049_213, 0).saturating_mul(n.into())) + // Minimum execution time: 608_870 nanoseconds. + Weight::from_parts(167_146_611, 0) + // Standard Error: 780_689 + .saturating_add(Weight::from_parts(45_583_885, 0).saturating_mul(f.into())) + // Standard Error: 73_359 + .saturating_add(Weight::from_parts(38_591_128, 0).saturating_mul(n.into())) .saturating_add(DbWeight::get().reads(15)) .saturating_add(DbWeight::get().reads((8_u64).saturating_mul(f.into()))) .saturating_add(DbWeight::get().reads((6_u64).saturating_mul(n.into()))) @@ -615,12 +613,12 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { /// The range of component `n` is `[0, 100]`. /// The range of component `o` is `[0, 10]`. fn execute_instruction_paused(f: u32, n: u32, o: u32) -> Weight { - // Minimum execution time: 2_553_089 nanoseconds. - Weight::from_parts(2_553_760_000, 0) - // Standard Error: 3_017_203 - .saturating_add(Weight::from_parts(115_262_208, 0).saturating_mul(f.into())) - // Standard Error: 291_331 - .saturating_add(Weight::from_parts(212_946_583, 0).saturating_mul(n.into())) + // Minimum execution time: 6_167_067 nanoseconds. + Weight::from_parts(6_185_147_000, 0) + // Standard Error: 6_973_510 + .saturating_add(Weight::from_parts(376_745_972, 0).saturating_mul(f.into())) + // Standard Error: 673_340 + .saturating_add(Weight::from_parts(553_520_777, 0).saturating_mul(n.into())) .saturating_add(DbWeight::get().reads(12)) .saturating_add(DbWeight::get().reads((27_u64).saturating_mul(f.into()))) .saturating_add(DbWeight::get().reads((22_u64).saturating_mul(n.into()))) @@ -676,7 +674,7 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Proof: `Identity::DidRecords` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) // Storage: `Statistics::AssetTransferCompliances` (r:10 w:0) // Proof: `Statistics::AssetTransferCompliances` (`max_values`: None, `max_size`: Some(2896), added: 5371, mode: `MaxEncodedLen`) - // Storage: `Identity::Claims` (r:201 w:0) + // Storage: `Identity::Claims` (r:250 w:0) // Proof: `Identity::Claims` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `Statistics::AssetStats` (r:140 w:100) // Proof: `Statistics::AssetStats` (`max_values`: None, `max_size`: Some(107), added: 2582, mode: `MaxEncodedLen`) @@ -712,13 +710,13 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { /// The range of component `n` is `[0, 100]`. /// The range of component `o` is `[0, 10]`. fn execute_scheduled_instruction(f: u32, n: u32, o: u32) -> Weight { - // Minimum execution time: 4_459_718 nanoseconds. - Weight::from_parts(4_485_678_000, 0) - // Standard Error: 4_998_051 - .saturating_add(Weight::from_parts(235_039_282, 0).saturating_mul(f.into())) - // Standard Error: 482_596 - .saturating_add(Weight::from_parts(209_695_385, 0).saturating_mul(n.into())) - .saturating_add(DbWeight::get().reads(13)) + // Minimum execution time: 9_639_871 nanoseconds. + Weight::from_parts(9_751_121_000, 0) + // Standard Error: 16_211_825 + .saturating_add(Weight::from_parts(456_170_052, 0).saturating_mul(f.into())) + // Standard Error: 1_565_363 + .saturating_add(Weight::from_parts(714_375_105, 0).saturating_mul(n.into())) + .saturating_add(DbWeight::get().reads(62)) .saturating_add(DbWeight::get().reads((61_u64).saturating_mul(f.into()))) .saturating_add(DbWeight::get().reads((22_u64).saturating_mul(n.into()))) .saturating_add(DbWeight::get().reads((3_u64).saturating_mul(o.into()))) @@ -728,8 +726,8 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { .saturating_add(DbWeight::get().writes((3_u64).saturating_mul(o.into()))) } fn ensure_root_origin() -> Weight { - // Minimum execution time: 450 nanoseconds. - Weight::from_parts(580_000, 0) + // Minimum execution time: 440 nanoseconds. + Weight::from_parts(550_000, 0) } // Storage: `Identity::KeyRecords` (r:1 w:0) // Proof: `Identity::KeyRecords` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) @@ -763,14 +761,14 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { /// The range of component `n` is `[0, 100]`. /// The range of component `o` is `[0, 10]`. fn affirm_with_receipts_rcv(f: u32, n: u32, o: u32) -> Weight { - // Minimum execution time: 1_001_498 nanoseconds. - Weight::from_parts(79_908_316, 0) - // Standard Error: 353_364 - .saturating_add(Weight::from_parts(21_330_187, 0).saturating_mul(f.into())) - // Standard Error: 32_687 - .saturating_add(Weight::from_parts(20_760_331, 0).saturating_mul(n.into())) - // Standard Error: 320_093 - .saturating_add(Weight::from_parts(71_846_236, 0).saturating_mul(o.into())) + // Minimum execution time: 984_829 nanoseconds. + Weight::from_parts(66_549_297, 0) + // Standard Error: 470_348 + .saturating_add(Weight::from_parts(22_519_604, 0).saturating_mul(f.into())) + // Standard Error: 43_508 + .saturating_add(Weight::from_parts(20_289_333, 0).saturating_mul(n.into())) + // Standard Error: 426_063 + .saturating_add(Weight::from_parts(71_129_568, 0).saturating_mul(o.into())) .saturating_add(DbWeight::get().reads(7)) .saturating_add(DbWeight::get().reads((3_u64).saturating_mul(f.into()))) .saturating_add(DbWeight::get().reads((3_u64).saturating_mul(n.into()))) @@ -799,12 +797,12 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { /// The range of component `f` is `[1, 10]`. /// The range of component `n` is `[1, 100]`. fn affirm_instruction_rcv(f: u32, n: u32) -> Weight { - // Minimum execution time: 349_629 nanoseconds. - Weight::from_parts(146_057_074, 0) - // Standard Error: 284_608 - .saturating_add(Weight::from_parts(18_939_853, 0).saturating_mul(f.into())) - // Standard Error: 26_743 - .saturating_add(Weight::from_parts(20_317_831, 0).saturating_mul(n.into())) + // Minimum execution time: 345_769 nanoseconds. + Weight::from_parts(227_430_445, 0) + // Standard Error: 385_947 + .saturating_add(Weight::from_parts(12_843_695, 0).saturating_mul(f.into())) + // Standard Error: 36_266 + .saturating_add(Weight::from_parts(19_616_686, 0).saturating_mul(n.into())) .saturating_add(DbWeight::get().reads(15)) .saturating_add(DbWeight::get().reads((3_u64).saturating_mul(f.into()))) .saturating_add(DbWeight::get().reads((3_u64).saturating_mul(n.into()))) @@ -823,8 +821,8 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Storage: `Settlement::AffirmsReceived` (r:0 w:1) // Proof: `Settlement::AffirmsReceived` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `MaxEncodedLen`) fn unsafe_affirm_instruction_receiver_portfolio() -> Weight { - // Minimum execution time: 39_840 nanoseconds. - Weight::from_parts(43_150_000, 0) + // Minimum execution time: 37_500 nanoseconds. + Weight::from_parts(40_290_000, 0) .saturating_add(DbWeight::get().reads(5)) .saturating_add(DbWeight::get().writes(3)) } @@ -839,16 +837,16 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Storage: `Settlement::AffirmsReceived` (r:0 w:1) // Proof: `Settlement::AffirmsReceived` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `MaxEncodedLen`) fn unsafe_affirm_instruction_receiver_account() -> Weight { - // Minimum execution time: 41_450 nanoseconds. - Weight::from_parts(44_440_000, 0) + // Minimum execution time: 39_050 nanoseconds. + Weight::from_parts(42_060_000, 0) .saturating_add(DbWeight::get().reads(5)) .saturating_add(DbWeight::get().writes(3)) } // Storage: `Settlement::InstructionMemos` (r:0 w:1) // Proof: `Settlement::InstructionMemos` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`) fn set_instruction_memo() -> Weight { - // Minimum execution time: 1_830 nanoseconds. - Weight::from_parts(2_270_000, 0).saturating_add(DbWeight::get().writes(1)) + // Minimum execution time: 1_750 nanoseconds. + Weight::from_parts(2_180_000, 0).saturating_add(DbWeight::get().writes(1)) } // Storage: `Identity::KeyRecords` (r:1 w:0) // Proof: `Identity::KeyRecords` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) @@ -905,14 +903,16 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { /// The range of component `o` is `[0, 10]`. /// The range of component `m` is `[0, 4]`. fn add_instruction_with_mediators(f: u32, n: u32, o: u32, m: u32) -> Weight { - // Minimum execution time: 683_299 nanoseconds. - Weight::from_parts(170_994_644, 0) - // Standard Error: 644_810 - .saturating_add(Weight::from_parts(52_960_163, 0).saturating_mul(f.into())) - // Standard Error: 59_502 - .saturating_add(Weight::from_parts(55_542_258, 0).saturating_mul(n.into())) - // Standard Error: 584_288 - .saturating_add(Weight::from_parts(4_111_122, 0).saturating_mul(o.into())) + // Minimum execution time: 701_730 nanoseconds. + Weight::from_parts(103_774_708, 0) + // Standard Error: 882_699 + .saturating_add(Weight::from_parts(53_485_101, 0).saturating_mul(f.into())) + // Standard Error: 81_454 + .saturating_add(Weight::from_parts(53_349_190, 0).saturating_mul(n.into())) + // Standard Error: 799_850 + .saturating_add(Weight::from_parts(6_220_505, 0).saturating_mul(o.into())) + // Standard Error: 1_852_154 + .saturating_add(Weight::from_parts(5_371_892, 0).saturating_mul(m.into())) .saturating_add(DbWeight::get().reads(9)) .saturating_add(DbWeight::get().reads((9_u64).saturating_mul(f.into()))) .saturating_add(DbWeight::get().reads((9_u64).saturating_mul(n.into()))) @@ -993,16 +993,16 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { /// The range of component `o` is `[0, 10]`. /// The range of component `m` is `[0, 4]`. fn add_and_affirm_with_mediators(f: u32, n: u32, o: u32, m: u32) -> Weight { - // Minimum execution time: 1_156_378 nanoseconds. - Weight::from_parts(80_805_156, 0) - // Standard Error: 1_165_598 - .saturating_add(Weight::from_parts(100_036_842, 0).saturating_mul(f.into())) - // Standard Error: 107_560 - .saturating_add(Weight::from_parts(91_104_237, 0).saturating_mul(n.into())) - // Standard Error: 1_056_196 - .saturating_add(Weight::from_parts(5_578_613, 0).saturating_mul(o.into())) - // Standard Error: 2_445_756 - .saturating_add(Weight::from_parts(15_854_274, 0).saturating_mul(m.into())) + // Minimum execution time: 1_168_788 nanoseconds. + Weight::from_parts(140_563_016, 0) + // Standard Error: 1_115_504 + .saturating_add(Weight::from_parts(94_852_802, 0).saturating_mul(f.into())) + // Standard Error: 102_937 + .saturating_add(Weight::from_parts(86_487_570, 0).saturating_mul(n.into())) + // Standard Error: 1_010_803 + .saturating_add(Weight::from_parts(3_492_285, 0).saturating_mul(o.into())) + // Standard Error: 2_340_644 + .saturating_add(Weight::from_parts(22_286_457, 0).saturating_mul(m.into())) .saturating_add(DbWeight::get().reads(10)) .saturating_add(DbWeight::get().reads((15_u64).saturating_mul(f.into()))) .saturating_add(DbWeight::get().reads((14_u64).saturating_mul(n.into()))) @@ -1024,8 +1024,8 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Storage: `Settlement::InstructionAffirmsPending` (r:1 w:1) // Proof: `Settlement::InstructionAffirmsPending` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`) fn affirm_instruction_as_mediator() -> Weight { - // Minimum execution time: 77_240 nanoseconds. - Weight::from_parts(80_259_000, 0) + // Minimum execution time: 90_190 nanoseconds. + Weight::from_parts(92_210_000, 0) .saturating_add(DbWeight::get().reads(5)) .saturating_add(DbWeight::get().writes(2)) } @@ -1069,14 +1069,14 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { /// The range of component `n` is `[0, 100]`. /// The range of component `o` is `[0, 10]`. fn base_reject_instruction(f: u32, n: u32, o: u32) -> Weight { - // Minimum execution time: 570_569 nanoseconds. - Weight::from_parts(111_819_283, 0) - // Standard Error: 426_686 - .saturating_add(Weight::from_parts(34_765_727, 0).saturating_mul(f.into())) - // Standard Error: 43_576 - .saturating_add(Weight::from_parts(33_441_420, 0).saturating_mul(n.into())) - // Standard Error: 426_686 - .saturating_add(Weight::from_parts(12_711_129, 0).saturating_mul(o.into())) + // Minimum execution time: 558_259 nanoseconds. + Weight::from_parts(113_045_516, 0) + // Standard Error: 358_560 + .saturating_add(Weight::from_parts(34_914_309, 0).saturating_mul(f.into())) + // Standard Error: 36_618 + .saturating_add(Weight::from_parts(33_037_493, 0).saturating_mul(n.into())) + // Standard Error: 358_560 + .saturating_add(Weight::from_parts(12_979_163, 0).saturating_mul(o.into())) .saturating_add(DbWeight::get().reads(10)) .saturating_add(DbWeight::get().reads((7_u64).saturating_mul(f.into()))) .saturating_add(DbWeight::get().reads((7_u64).saturating_mul(n.into()))) @@ -1160,14 +1160,12 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { /// The range of component `n` is `[0, 100]`. /// The range of component `o` is `[0, 10]`. fn lock_instruction_extrinsic(f: u32, n: u32, o: u32) -> Weight { - // Minimum execution time: 2_248_805 nanoseconds. - Weight::from_parts(76_850_488, 0) - // Standard Error: 2_547_137 - .saturating_add(Weight::from_parts(207_224_824, 0).saturating_mul(f.into())) - // Standard Error: 260_133 - .saturating_add(Weight::from_parts(196_569_690, 0).saturating_mul(n.into())) - // Standard Error: 2_547_137 - .saturating_add(Weight::from_parts(3_284_995, 0).saturating_mul(o.into())) + // Minimum execution time: 5_838_332 nanoseconds. + Weight::from_parts(5_854_142_000, 0) + // Standard Error: 6_211_700 + .saturating_add(Weight::from_parts(358_315_797, 0).saturating_mul(f.into())) + // Standard Error: 623_647 + .saturating_add(Weight::from_parts(529_733_963, 0).saturating_mul(n.into())) .saturating_add(DbWeight::get().reads(14)) .saturating_add(DbWeight::get().reads((27_u64).saturating_mul(f.into()))) .saturating_add(DbWeight::get().reads((22_u64).saturating_mul(n.into()))) @@ -1248,12 +1246,12 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { /// The range of component `n` is `[0, 100]`. /// The range of component `o` is `[0, 10]`. fn execute_locked_instruction(f: u32, n: u32, o: u32) -> Weight { - // Minimum execution time: 3_250_440 nanoseconds. - Weight::from_parts(3_261_190_000, 0) - // Standard Error: 3_239_202 - .saturating_add(Weight::from_parts(188_044_776, 0).saturating_mul(f.into())) - // Standard Error: 325_212 - .saturating_add(Weight::from_parts(97_767_160, 0).saturating_mul(n.into())) + // Minimum execution time: 3_122_767 nanoseconds. + Weight::from_parts(3_126_948_000, 0) + // Standard Error: 3_326_089 + .saturating_add(Weight::from_parts(180_158_439, 0).saturating_mul(f.into())) + // Standard Error: 333_935 + .saturating_add(Weight::from_parts(95_145_148, 0).saturating_mul(n.into())) .saturating_add(DbWeight::get().reads(11)) .saturating_add(DbWeight::get().reads((54_u64).saturating_mul(f.into()))) .saturating_add(DbWeight::get().reads((15_u64).saturating_mul(n.into()))) @@ -1345,12 +1343,12 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { /// The range of component `n` is `[0, 100]`. /// The range of component `o` is `[0, 10]`. fn execute_manual_instruction_paused(f: u32, n: u32, o: u32) -> Weight { - // Minimum execution time: 2_620_600 nanoseconds. - Weight::from_parts(2_649_999_000, 0) - // Standard Error: 2_990_365 - .saturating_add(Weight::from_parts(125_068_669, 0).saturating_mul(f.into())) - // Standard Error: 300_229 - .saturating_add(Weight::from_parts(216_866_424, 0).saturating_mul(n.into())) + // Minimum execution time: 6_217_389 nanoseconds. + Weight::from_parts(485_124_389, 0) + // Standard Error: 4_471_052 + .saturating_add(Weight::from_parts(590_169_565, 0).saturating_mul(f.into())) + // Standard Error: 456_618 + .saturating_add(Weight::from_parts(587_400_720, 0).saturating_mul(n.into())) .saturating_add(DbWeight::get().reads(14)) .saturating_add(DbWeight::get().reads((27_u64).saturating_mul(f.into()))) .saturating_add(DbWeight::get().reads((22_u64).saturating_mul(n.into()))) @@ -1365,8 +1363,8 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Storage: `Settlement::MandatoryReceiverAffirmation` (r:0 w:1) // Proof: `Settlement::MandatoryReceiverAffirmation` (`max_values`: None, `max_size`: Some(33), added: 2508, mode: `MaxEncodedLen`) fn set_mandatory_receiver_affirmation() -> Weight { - // Minimum execution time: 15_870 nanoseconds. - Weight::from_parts(18_530_000, 0) + // Minimum execution time: 15_770 nanoseconds. + Weight::from_parts(17_960_000, 0) .saturating_add(DbWeight::get().reads(1)) .saturating_add(DbWeight::get().writes(1)) } @@ -1389,8 +1387,8 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Storage: `Portfolio::PortfolioAssetCount` (r:1 w:1) // Proof: `Portfolio::PortfolioAssetCount` (`max_values`: None, `max_size`: Some(57), added: 2532, mode: `MaxEncodedLen`) fn transfer_funds_portfolio_same_did() -> Weight { - // Minimum execution time: 79_640 nanoseconds. - Weight::from_parts(83_720_000, 0) + // Minimum execution time: 84_220 nanoseconds. + Weight::from_parts(88_540_000, 0) .saturating_add(DbWeight::get().reads(10)) .saturating_add(DbWeight::get().writes(3)) } @@ -1443,8 +1441,8 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Storage: `Settlement::InstructionLegStatus` (r:0 w:1) // Proof: `Settlement::InstructionLegStatus` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) fn transfer_funds_portfolio_diff_did() -> Weight { - // Minimum execution time: 156_340 nanoseconds. - Weight::from_parts(164_080_000, 0) + // Minimum execution time: 166_220 nanoseconds. + Weight::from_parts(175_150_000, 0) .saturating_add(DbWeight::get().reads(22)) .saturating_add(DbWeight::get().writes(10)) } @@ -1467,8 +1465,8 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Storage: `Portfolio::PortfolioAssetCount` (r:1 w:1) // Proof: `Portfolio::PortfolioAssetCount` (`max_values`: None, `max_size`: Some(57), added: 2532, mode: `MaxEncodedLen`) fn transfer_funds_account_same_did() -> Weight { - // Minimum execution time: 74_600 nanoseconds. - Weight::from_parts(78_680_000, 0) + // Minimum execution time: 80_530 nanoseconds. + Weight::from_parts(85_040_000, 0) .saturating_add(DbWeight::get().reads(9)) .saturating_add(DbWeight::get().writes(3)) } @@ -1515,8 +1513,8 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Storage: `Settlement::InstructionLegStatus` (r:0 w:1) // Proof: `Settlement::InstructionLegStatus` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) fn transfer_funds_account_diff_did() -> Weight { - // Minimum execution time: 151_870 nanoseconds. - Weight::from_parts(162_140_000, 0) + // Minimum execution time: 163_679 nanoseconds. + Weight::from_parts(171_669_000, 0) .saturating_add(DbWeight::get().reads(18)) .saturating_add(DbWeight::get().writes(10)) } @@ -1538,10 +1536,10 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Proof: `Nft::Owner` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 10]`. fn transfer_funds_nft_portfolio_same_did(n: u32) -> Weight { - // Minimum execution time: 89_730 nanoseconds. - Weight::from_parts(49_849_632, 0) - // Standard Error: 76_266 - .saturating_add(Weight::from_parts(45_085_637, 0).saturating_mul(n.into())) + // Minimum execution time: 99_880 nanoseconds. + Weight::from_parts(64_618_613, 0) + // Standard Error: 151_790 + .saturating_add(Weight::from_parts(41_593_460, 0).saturating_mul(n.into())) .saturating_add(DbWeight::get().reads(6)) .saturating_add(DbWeight::get().reads((3_u64).saturating_mul(n.into()))) .saturating_add(DbWeight::get().writes(2)) @@ -1595,10 +1593,10 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Proof: `Settlement::InstructionLegStatus` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 10]`. fn transfer_funds_nft_portfolio_diff_did(n: u32) -> Weight { - // Minimum execution time: 153_509 nanoseconds. - Weight::from_parts(152_801_463, 0) - // Standard Error: 84_023 - .saturating_add(Weight::from_parts(14_499_775, 0).saturating_mul(n.into())) + // Minimum execution time: 171_150 nanoseconds. + Weight::from_parts(170_207_597, 0) + // Standard Error: 192_035 + .saturating_add(Weight::from_parts(13_174_302, 0).saturating_mul(n.into())) .saturating_add(DbWeight::get().reads(19)) .saturating_add(DbWeight::get().reads((2_u64).saturating_mul(n.into()))) .saturating_add(DbWeight::get().writes(9)) @@ -1626,10 +1624,10 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Proof: `Nft::Owner` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 10]`. fn transfer_funds_nft_account_same_did(n: u32) -> Weight { - // Minimum execution time: 102_510 nanoseconds. - Weight::from_parts(55_779_899, 0) - // Standard Error: 81_748 - .saturating_add(Weight::from_parts(51_576_497, 0).saturating_mul(n.into())) + // Minimum execution time: 113_530 nanoseconds. + Weight::from_parts(72_175_790, 0) + // Standard Error: 168_061 + .saturating_add(Weight::from_parts(47_997_006, 0).saturating_mul(n.into())) .saturating_add(DbWeight::get().reads(6)) .saturating_add(DbWeight::get().reads((2_u64).saturating_mul(n.into()))) .saturating_add(DbWeight::get().writes(3)) @@ -1675,10 +1673,10 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Proof: `Settlement::InstructionLegStatus` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 10]`. fn transfer_funds_nft_account_diff_did(n: u32) -> Weight { - // Minimum execution time: 152_910 nanoseconds. - Weight::from_parts(142_256_152, 0) - // Standard Error: 82_438 - .saturating_add(Weight::from_parts(20_334_325, 0).saturating_mul(n.into())) + // Minimum execution time: 165_160 nanoseconds. + Weight::from_parts(160_025_327, 0) + // Standard Error: 198_051 + .saturating_add(Weight::from_parts(18_599_480, 0).saturating_mul(n.into())) .saturating_add(DbWeight::get().reads(15)) .saturating_add(DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(DbWeight::get().writes(9)) @@ -1697,8 +1695,8 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Storage: `Settlement::LockedTimestamp` (r:0 w:1) // Proof: `Settlement::LockedTimestamp` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`) fn unlock_instruction() -> Weight { - // Minimum execution time: 44_820 nanoseconds. - Weight::from_parts(47_010_000, 0) + // Minimum execution time: 47_130 nanoseconds. + Weight::from_parts(50_120_000, 0) .saturating_add(DbWeight::get().reads(4)) .saturating_add(DbWeight::get().writes(3)) } diff --git a/pallets/weights/src/pallet_sto.rs b/pallets/weights/src/pallet_sto.rs index ba8d8ea7a8..e55ee9f593 100644 --- a/pallets/weights/src/pallet_sto.rs +++ b/pallets/weights/src/pallet_sto.rs @@ -4,28 +4,32 @@ //! Autogenerated weights for pallet_sto //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 54.0.0 -//! DATE: 2026-05-11, STEPS: `100`, REPEAT: 5, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2026-09-26, STEPS: `100`, REPEAT: 5, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 512 //! HOSTNAME: `ubuntu-8gb-hel1-bench`, CPU: `AMD EPYC-Milan Processor` // Executed Command: -// ./target/release/polymesh +// ./polymesh // benchmark // pallet // -s // 100 // -r // 5 -// -p=pallet_sto +// -p=pallet_asset,pallet_nft,pallet_settlement,pallet_sto,pallet_compliance // -e=* // --heap-pages // 4096 // --db-cache // 512 +// --execution +// wasm +// --wasm-execution +// compiled // --output -// ./pallets/weights/src/ +// . // --template -// ./.maintain/frame-weight-template.hbs +// Polymesh/.maintain/frame-weight-template.hbs #![allow(unused_parens)] #![allow(unused_imports)] @@ -53,21 +57,25 @@ impl pallet_sto::WeightInfo for SubstrateWeight { // Proof: `Sto::FundraiserCount` (`max_values`: None, `max_size`: Some(40), added: 2515, mode: `MaxEncodedLen`) // Storage: `Asset::Assets` (r:1 w:0) // Proof: `Asset::Assets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Portfolio::FrozenPortfolios` (r:1 w:0) + // Proof: `Portfolio::FrozenPortfolios` (`max_values`: None, `max_size`: Some(82), added: 2557, mode: `MaxEncodedLen`) // Storage: `Portfolio::PortfolioAssetBalances` (r:1 w:0) // Proof: `Portfolio::PortfolioAssetBalances` (`max_values`: None, `max_size`: Some(97), added: 2572, mode: `MaxEncodedLen`) // Storage: `Portfolio::PortfolioLockedAssets` (r:1 w:1) // Proof: `Portfolio::PortfolioLockedAssets` (`max_values`: None, `max_size`: Some(97), added: 2572, mode: `MaxEncodedLen`) + // Storage: `Portfolio::PortfolioFrozenAssets` (r:1 w:0) + // Proof: `Portfolio::PortfolioFrozenAssets` (`max_values`: None, `max_size`: Some(97), added: 2572, mode: `MaxEncodedLen`) // Storage: `Sto::FundraiserNames` (r:0 w:1) // Proof: `Sto::FundraiserNames` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `Sto::Fundraisers` (r:0 w:1) // Proof: `Sto::Fundraisers` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `i` is `[1, 10]`. fn create_fundraiser(i: u32) -> Weight { - // Minimum execution time: 86_930 nanoseconds. - Weight::from_parts(91_027_889, 0) - // Standard Error: 27_200 - .saturating_add(Weight::from_parts(125_263, 0).saturating_mul(i.into())) - .saturating_add(DbWeight::get().reads(12)) + // Minimum execution time: 104_170 nanoseconds. + Weight::from_parts(109_452_256, 0) + // Standard Error: 81_108 + .saturating_add(Weight::from_parts(111_433, 0).saturating_mul(i.into())) + .saturating_add(DbWeight::get().reads(14)) .saturating_add(DbWeight::get().writes(4)) } // Storage: `Identity::KeyRecords` (r:1 w:0) @@ -106,6 +114,10 @@ impl pallet_sto::WeightInfo for SubstrateWeight { // Proof: `Settlement::InstructionLegs` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `Portfolio::PortfolioAssetBalances` (r:4 w:4) // Proof: `Portfolio::PortfolioAssetBalances` (`max_values`: None, `max_size`: Some(97), added: 2572, mode: `MaxEncodedLen`) + // Storage: `Portfolio::FrozenPortfolios` (r:2 w:0) + // Proof: `Portfolio::FrozenPortfolios` (`max_values`: None, `max_size`: Some(82), added: 2557, mode: `MaxEncodedLen`) + // Storage: `Portfolio::PortfolioFrozenAssets` (r:2 w:0) + // Proof: `Portfolio::PortfolioFrozenAssets` (`max_values`: None, `max_size`: Some(97), added: 2572, mode: `MaxEncodedLen`) // Storage: `Settlement::InstructionMediatorsAffirmations` (r:1 w:0) // Proof: `Settlement::InstructionMediatorsAffirmations` (`max_values`: None, `max_size`: Some(58), added: 2533, mode: `MaxEncodedLen`) // Storage: `Settlement::InstructionMemos` (r:1 w:0) @@ -115,8 +127,8 @@ impl pallet_sto::WeightInfo for SubstrateWeight { // Storage: `Asset::Frozen` (r:2 w:0) // Proof: `Asset::Frozen` (`max_values`: None, `max_size`: Some(33), added: 2508, mode: `MaxEncodedLen`) // Storage: `Statistics::AssetTransferCompliances` (r:2 w:0) - // Proof: `Statistics::AssetTransferCompliances` (`max_values`: None, `max_size`: Some(53247), added: 55722, mode: `MaxEncodedLen`) - // Storage: `Identity::Claims` (r:42 w:0) + // Proof: `Statistics::AssetTransferCompliances` (`max_values`: None, `max_size`: Some(2896), added: 5371, mode: `MaxEncodedLen`) + // Storage: `Identity::Claims` (r:140 w:0) // Proof: `Identity::Claims` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `Statistics::AssetStats` (r:28 w:20) // Proof: `Statistics::AssetStats` (`max_values`: None, `max_size`: Some(107), added: 2582, mode: `MaxEncodedLen`) @@ -129,7 +141,7 @@ impl pallet_sto::WeightInfo for SubstrateWeight { // Storage: `Portfolio::PortfolioAssetCount` (r:2 w:2) // Proof: `Portfolio::PortfolioAssetCount` (`max_values`: None, `max_size`: Some(57), added: 2532, mode: `MaxEncodedLen`) // Storage: `Statistics::ActiveAssetStats` (r:2 w:0) - // Proof: `Statistics::ActiveAssetStats` (`max_values`: None, `max_size`: Some(39424), added: 41899, mode: `MaxEncodedLen`) + // Proof: `Statistics::ActiveAssetStats` (`max_values`: None, `max_size`: Some(2373), added: 4848, mode: `MaxEncodedLen`) // Storage: `Settlement::UnlockedTimestamp` (r:0 w:1) // Proof: `Settlement::UnlockedTimestamp` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`) // Storage: `Settlement::UserAffirmations` (r:0 w:4) @@ -151,9 +163,9 @@ impl pallet_sto::WeightInfo for SubstrateWeight { // Storage: `Settlement::InstructionLegStatus` (r:0 w:2) // Proof: `Settlement::InstructionLegStatus` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) fn invest_onchain() -> Weight { - // Minimum execution time: 1_059_329 nanoseconds. - Weight::from_parts(1_087_269_000, 0) - .saturating_add(DbWeight::get().reads(128)) + // Minimum execution time: 2_215_048 nanoseconds. + Weight::from_parts(2_267_618_000, 0) + .saturating_add(DbWeight::get().reads(230)) .saturating_add(DbWeight::get().writes(53)) } // Storage: `Identity::KeyRecords` (r:1 w:0) @@ -200,6 +212,10 @@ impl pallet_sto::WeightInfo for SubstrateWeight { // Proof: `Settlement::InstructionLegs` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `Portfolio::PortfolioAssetBalances` (r:2 w:2) // Proof: `Portfolio::PortfolioAssetBalances` (`max_values`: None, `max_size`: Some(97), added: 2572, mode: `MaxEncodedLen`) + // Storage: `Portfolio::FrozenPortfolios` (r:1 w:0) + // Proof: `Portfolio::FrozenPortfolios` (`max_values`: None, `max_size`: Some(82), added: 2557, mode: `MaxEncodedLen`) + // Storage: `Portfolio::PortfolioFrozenAssets` (r:1 w:0) + // Proof: `Portfolio::PortfolioFrozenAssets` (`max_values`: None, `max_size`: Some(97), added: 2572, mode: `MaxEncodedLen`) // Storage: `Settlement::InstructionMediatorsAffirmations` (r:1 w:0) // Proof: `Settlement::InstructionMediatorsAffirmations` (`max_values`: None, `max_size`: Some(58), added: 2533, mode: `MaxEncodedLen`) // Storage: `Settlement::InstructionMemos` (r:1 w:0) @@ -209,8 +225,8 @@ impl pallet_sto::WeightInfo for SubstrateWeight { // Storage: `Asset::Frozen` (r:1 w:0) // Proof: `Asset::Frozen` (`max_values`: None, `max_size`: Some(33), added: 2508, mode: `MaxEncodedLen`) // Storage: `Statistics::AssetTransferCompliances` (r:1 w:0) - // Proof: `Statistics::AssetTransferCompliances` (`max_values`: None, `max_size`: Some(53247), added: 55722, mode: `MaxEncodedLen`) - // Storage: `Identity::Claims` (r:21 w:0) + // Proof: `Statistics::AssetTransferCompliances` (`max_values`: None, `max_size`: Some(2896), added: 5371, mode: `MaxEncodedLen`) + // Storage: `Identity::Claims` (r:70 w:0) // Proof: `Identity::Claims` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `Statistics::AssetStats` (r:14 w:10) // Proof: `Statistics::AssetStats` (`max_values`: None, `max_size`: Some(107), added: 2582, mode: `MaxEncodedLen`) @@ -223,7 +239,7 @@ impl pallet_sto::WeightInfo for SubstrateWeight { // Storage: `Portfolio::PortfolioAssetCount` (r:1 w:1) // Proof: `Portfolio::PortfolioAssetCount` (`max_values`: None, `max_size`: Some(57), added: 2532, mode: `MaxEncodedLen`) // Storage: `Statistics::ActiveAssetStats` (r:1 w:0) - // Proof: `Statistics::ActiveAssetStats` (`max_values`: None, `max_size`: Some(39424), added: 41899, mode: `MaxEncodedLen`) + // Proof: `Statistics::ActiveAssetStats` (`max_values`: None, `max_size`: Some(2373), added: 4848, mode: `MaxEncodedLen`) // Storage: `Settlement::UnlockedTimestamp` (r:0 w:1) // Proof: `Settlement::UnlockedTimestamp` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`) // Storage: `Settlement::UserAffirmations` (r:0 w:2) @@ -245,9 +261,9 @@ impl pallet_sto::WeightInfo for SubstrateWeight { // Storage: `Settlement::InstructionLegStatus` (r:0 w:1) // Proof: `Settlement::InstructionLegStatus` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) fn invest_offchain() -> Weight { - // Minimum execution time: 699_970 nanoseconds. - Weight::from_parts(725_519_000, 0) - .saturating_add(DbWeight::get().reads(73)) + // Minimum execution time: 1_323_799 nanoseconds. + Weight::from_parts(1_363_019_000, 0) + .saturating_add(DbWeight::get().reads(124)) .saturating_add(DbWeight::get().writes(32)) } // Storage: `Identity::KeyRecords` (r:1 w:0) @@ -261,8 +277,8 @@ impl pallet_sto::WeightInfo for SubstrateWeight { // Storage: `Sto::Fundraisers` (r:1 w:1) // Proof: `Sto::Fundraisers` (`max_values`: None, `max_size`: None, mode: `Measured`) fn freeze_fundraiser() -> Weight { - // Minimum execution time: 44_370 nanoseconds. - Weight::from_parts(46_420_000, 0) + // Minimum execution time: 49_460 nanoseconds. + Weight::from_parts(52_430_000, 0) .saturating_add(DbWeight::get().reads(5)) .saturating_add(DbWeight::get().writes(1)) } @@ -277,8 +293,8 @@ impl pallet_sto::WeightInfo for SubstrateWeight { // Storage: `Sto::Fundraisers` (r:1 w:1) // Proof: `Sto::Fundraisers` (`max_values`: None, `max_size`: None, mode: `Measured`) fn unfreeze_fundraiser() -> Weight { - // Minimum execution time: 43_450 nanoseconds. - Weight::from_parts(45_760_000, 0) + // Minimum execution time: 47_630 nanoseconds. + Weight::from_parts(50_970_000, 0) .saturating_add(DbWeight::get().reads(5)) .saturating_add(DbWeight::get().writes(1)) } @@ -295,8 +311,8 @@ impl pallet_sto::WeightInfo for SubstrateWeight { // Storage: `Timestamp::Now` (r:1 w:0) // Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) fn modify_fundraiser_window() -> Weight { - // Minimum execution time: 47_180 nanoseconds. - Weight::from_parts(49_401_000, 0) + // Minimum execution time: 52_580 nanoseconds. + Weight::from_parts(55_470_000, 0) .saturating_add(DbWeight::get().reads(6)) .saturating_add(DbWeight::get().writes(1)) } @@ -309,8 +325,8 @@ impl pallet_sto::WeightInfo for SubstrateWeight { // Storage: `Timestamp::Now` (r:1 w:0) // Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) fn stop() -> Weight { - // Minimum execution time: 44_420 nanoseconds. - Weight::from_parts(46_610_000, 0) + // Minimum execution time: 49_970 nanoseconds. + Weight::from_parts(52_250_000, 0) .saturating_add(DbWeight::get().reads(4)) .saturating_add(DbWeight::get().writes(2)) } @@ -321,8 +337,8 @@ impl pallet_sto::WeightInfo for SubstrateWeight { // Storage: `Sto::FundraiserOffchainAsset` (r:0 w:1) // Proof: `Sto::FundraiserOffchainAsset` (`max_values`: None, `max_size`: Some(60), added: 2535, mode: `MaxEncodedLen`) fn enable_offchain_funding() -> Weight { - // Minimum execution time: 31_449 nanoseconds. - Weight::from_parts(33_270_000, 0) + // Minimum execution time: 36_369 nanoseconds. + Weight::from_parts(38_760_000, 0) .saturating_add(DbWeight::get().reads(2)) .saturating_add(DbWeight::get().writes(1)) } From c5fd68dc519928491b44dddc67dc951ec2a8ac56 Mon Sep 17 00:00:00 2001 From: Henrique Nogara Date: Mon, 28 Sep 2026 09:24:45 -0300 Subject: [PATCH 04/12] Fix tests --- pallets/runtime/tests/src/settlement_test.rs | 4 ++-- pallets/settlement/src/lib.rs | 2 +- pallets/weights/src/pallet_asset.rs | 6 +++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/pallets/runtime/tests/src/settlement_test.rs b/pallets/runtime/tests/src/settlement_test.rs index 28fc0ac4f9..4ac67621f0 100644 --- a/pallets/runtime/tests/src/settlement_test.rs +++ b/pallets/runtime/tests/src/settlement_test.rs @@ -2392,7 +2392,7 @@ fn settle_manual_instruction() { ), DispatchErrorWithPostInfo { post_info: Some(Settlement::execute_manual_instruction_minimum_weight()).into(), - error: Error::NumberOfFungibleTransfersUnderestimated.into() + error: Error::InputWeightIsLessThanMinimum.into() } ); // Ensure it succeeds as the execute block was reached @@ -2499,7 +2499,7 @@ fn settle_manual_instruction_with_portfolio() { ), DispatchErrorWithPostInfo { post_info: Some(Settlement::execute_manual_instruction_minimum_weight()).into(), - error: Error::NumberOfFungibleTransfersUnderestimated.into() + error: Error::InputWeightIsLessThanMinimum.into() } ); // Ensure it succeeds as the execute block was reached diff --git a/pallets/settlement/src/lib.rs b/pallets/settlement/src/lib.rs index 6b7f6a8e0a..17be7c02f6 100644 --- a/pallets/settlement/src/lib.rs +++ b/pallets/settlement/src/lib.rs @@ -3591,7 +3591,7 @@ impl Pallet { /// Returns the minimum weight for calling the `execute_manual_instruction` extrinsic. pub fn execute_manual_instruction_minimum_weight() -> Weight { - ::WeightInfo::execute_locked_instruction(0, 0, 1) + ::WeightInfo::execute_manual_instruction(0, 0, 1) } /// Returns the weight for calling `affirm_with_receipts` while considering the `sender_asset_count` for the sender, `receiver_asset_count` diff --git a/pallets/weights/src/pallet_asset.rs b/pallets/weights/src/pallet_asset.rs index 45d78e7120..ebc7e56f01 100644 --- a/pallets/weights/src/pallet_asset.rs +++ b/pallets/weights/src/pallet_asset.rs @@ -152,11 +152,15 @@ impl pallet_asset::WeightInfo for SubstrateWeight { /// The range of component `n` is `[1, 128]`. /// The range of component `i` is `[1, 512]`. /// The range of component `f` is `[1, 128]`. - fn create_asset(_n: u32, i: u32, _f: u32) -> Weight { + fn create_asset(n: u32, i: u32, f: u32) -> Weight { // Minimum execution time: 75_130 nanoseconds. Weight::from_parts(84_699_360, 0) + // Standard Error: 2_794 + .saturating_add(Weight::from_parts(675, 0).saturating_mul(n.into())) // Standard Error: 610 .saturating_add(Weight::from_parts(59_414, 0).saturating_mul(i.into())) + // Standard Error: 2_794 + .saturating_add(Weight::from_parts(5_528, 0).saturating_mul(f.into())) .saturating_add(DbWeight::get().reads(9)) .saturating_add(DbWeight::get().writes(9)) } From c1e6de8c32824e48df867bedec09ae75522e5a7e Mon Sep 17 00:00:00 2001 From: Henrique Nogara Date: Wed, 30 Sep 2026 08:54:34 -0300 Subject: [PATCH 05/12] Improve compliance benchmark. --- pallets/compliance-manager/src/benchmarking.rs | 5 ++++- pallets/precompiles/src/interface/nft/erc7943.rs | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pallets/compliance-manager/src/benchmarking.rs b/pallets/compliance-manager/src/benchmarking.rs index 7d5ad5d09b..67f508435c 100644 --- a/pallets/compliance-manager/src/benchmarking.rs +++ b/pallets/compliance-manager/src/benchmarking.rs @@ -315,6 +315,7 @@ where /// The requirements are built for the worst case (each has complexity 1): /// - The first `n - 1` requirements fail (no claims are issued, so `IsAnyOf` is false), /// forcing all requirements to be evaluated. The last one uses `IsNoneOf`, so the asset is still compliant. +/// - Each requirement's claim scope is unique per asset, so no claim read is shared (cached) between assets. pub fn setup_asset_compliance( caller_did: IdentityId, asset_id: AssetId, @@ -331,8 +332,10 @@ pub fn setup_asset_compliance( issuer: IdentityId::from(i as u128), trusted_for: TrustedFor::Specific(claim_types.clone()), }]; + // The scope includes `asset_id` so that each asset reads unique `Identity::Claims` keys. let mut scope = vec![0u8; 32]; - scope[..4].copy_from_slice(&i.to_le_bytes()); + scope[..16].copy_from_slice(asset_id.as_ref()); + scope[16..20].copy_from_slice(&i.to_le_bytes()); let claims = vec![Claim::Jurisdiction(CountryCode::BR, Scope::Custom(scope))]; let condition_type = if i + 1 < n { ConditionType::IsAnyOf(claims) diff --git a/pallets/precompiles/src/interface/nft/erc7943.rs b/pallets/precompiles/src/interface/nft/erc7943.rs index fa2ac27267..6122cf2fe4 100644 --- a/pallets/precompiles/src/interface/nft/erc7943.rs +++ b/pallets/precompiles/src/interface/nft/erc7943.rs @@ -27,6 +27,7 @@ use polymesh_precompiles::{INonFungibleAsset, INonFungibleAssetEvents}; use polymesh_primitives::asset::AssetId; use polymesh_primitives::nft::NFTs; use polymesh_primitives::WeightMeter; +use sp_runtime::Weight; use crate::common::Common; use crate::interface::nft::NonFungibleAssetInterface; @@ -48,7 +49,7 @@ impl NonFungibleAssetInterface { let to = Common::::asset_holder(env, call.to)?; let nfts = NFTs::new_unverified(asset_id, vec![nft_id]); - let mut weight_meter = WeightMeter::max_limit_no_minimum(); + let mut weight_meter = WeightMeter::from_limit_unchecked(Weight::zero(), worst_case_weight); let errors = pallet_nft::Pallet::::nft_transfer_report( &from, &to, From 260f8b1c9f5ab10ec7d7403d859b98f7264cf5c4 Mon Sep 17 00:00:00 2001 From: Henrique Nogara Date: Wed, 30 Sep 2026 17:44:21 -0300 Subject: [PATCH 06/12] Add limit check for asset metadata value --- pallets/asset/src/lib.rs | 2 +- pallets/nft/src/benchmarking.rs | 6 +++-- pallets/nft/src/lib.rs | 4 ++- pallets/runtime/tests/src/nft.rs | 44 +++++++++++++++++++++++++++++++- 4 files changed, 51 insertions(+), 5 deletions(-) diff --git a/pallets/asset/src/lib.rs b/pallets/asset/src/lib.rs index f8829eb056..0d00d42f7d 100644 --- a/pallets/asset/src/lib.rs +++ b/pallets/asset/src/lib.rs @@ -3525,7 +3525,7 @@ impl Pallet { } /// Ensure asset metadata `value` is within the global limit. - fn ensure_asset_metadata_value_limited(value: &AssetMetadataValue) -> DispatchResult { + pub fn ensure_asset_metadata_value_limited(value: &AssetMetadataValue) -> DispatchResult { ensure!( value.len() <= T::AssetMetadataValueMaxLength::get() as usize, Error::::AssetMetadataValueMaxLengthExceeded diff --git a/pallets/nft/src/benchmarking.rs b/pallets/nft/src/benchmarking.rs index f87bebf5a2..6da494c614 100644 --- a/pallets/nft/src/benchmarking.rs +++ b/pallets/nft/src/benchmarking.rs @@ -68,10 +68,11 @@ fn create_collection_issue_nfts( ) -> AssetId { let (asset_id, _) = create_collection::(collection_owner, n_keys); + let max_value_len = ::AssetMetadataValueMaxLength::get(); let metadata_attributes: Vec = (1..n_keys + 1) .map(|key| NFTMetadataAttribute { key: AssetMetadataKey::Global(AssetMetadataGlobalKey(key.into())), - value: AssetMetadataValue(b"value".to_vec()), + value: AssetMetadataValue(vec![b'v'; max_value_len as usize]), }) .collect(); for _ in 0..n_nfts { @@ -162,11 +163,12 @@ benchmarks! { let user = user::("target", 0); let (asset_id, collection_id) = create_collection::(&user, n); + let max_value_len = ::AssetMetadataValueMaxLength::get(); let metadata_attributes: Vec = (1..n + 1) .map(|key| { NFTMetadataAttribute{ key: AssetMetadataKey::Global(AssetMetadataGlobalKey(key.into())), - value: AssetMetadataValue(b"value".to_vec()), + value: AssetMetadataValue(vec![b'v'; max_value_len as usize]), } }) .collect(); diff --git a/pallets/nft/src/lib.rs b/pallets/nft/src/lib.rs index 57f77eb267..b669e12aa9 100644 --- a/pallets/nft/src/lib.rs +++ b/pallets/nft/src/lib.rs @@ -303,6 +303,7 @@ pub mod pallet { /// - `CollectionNotFound` - if the collection associated to the given asset_id has not been created. /// - `InvalidMetadataAttribute` - if the number of attributes is not equal to the number set in the collection or attempting to set a value for a key not definied in the collection. /// - `DuplicateMetadataKey` - if a duplicate metadata keys has been passed as input. + /// - `AssetMetadataValueMaxLengthExceeded` - if any metadata value exceeds `AssetMetadataValueMaxLength`. /// /// /// # Permissions @@ -681,11 +682,12 @@ impl Pallet { Error::::DuplicateMetadataKey ); - for metadata_key in nft_attributes.keys() { + for (metadata_key, metadata_value) in nft_attributes.iter() { ensure!( mandatory_keys.contains(metadata_key), Error::::InvalidMetadataAttribute ); + AssetPallet::::ensure_asset_metadata_value_limited(metadata_value)?; } // Mints the NFT and adds it to the caller's portfolio diff --git a/pallets/runtime/tests/src/nft.rs b/pallets/runtime/tests/src/nft.rs index d3929d479e..8e29327137 100644 --- a/pallets/runtime/tests/src/nft.rs +++ b/pallets/runtime/tests/src/nft.rs @@ -1,5 +1,5 @@ use chrono::prelude::Utc; -use frame_support::traits::UncheckedOnRuntimeUpgrade; +use frame_support::traits::{Get, UncheckedOnRuntimeUpgrade}; use frame_support::{assert_noop, assert_ok}; use pallet_nft::Event; @@ -28,6 +28,7 @@ use crate::ext_builder::ExtBuilder; use crate::storage::{default_asset_holder_set, TestStorage, User}; type Asset = pallet_asset::Pallet; +type AssetError = pallet_asset::Error; type ComplianceManager = pallet_compliance_manager::Pallet; type EAError = pallet_external_agents::Error; type Identity = pallet_identity::Pallet; @@ -358,6 +359,47 @@ fn mint_nft_wrong_key() { }); } +/// An NFT can only be minted if all metadata values are within `AssetMetadataValueMaxLength`. +#[test] +fn mint_nft_metadata_value_too_long() { + ExtBuilder::default().build().execute_with(|| { + set_timestamp(Utc::now().timestamp() as _); + + let alice: User = User::new(Sr25519Keyring::Alice); + + let collection_keys: NFTCollectionKeys = + vec![AssetMetadataKey::Local(AssetMetadataLocalKey(1))].into(); + let asset_id = create_nft_collection( + alice.clone(), + AssetType::NonFungible(NonFungibleType::Derivative), + collection_keys, + ); + let max_len = + ::AssetMetadataValueMaxLength::get() as usize; + assert_noop!( + NFT::issue_nft( + alice.origin(), + asset_id, + vec![NFTMetadataAttribute { + key: AssetMetadataKey::Local(AssetMetadataLocalKey(1)), + value: AssetMetadataValue(vec![b'v'; max_len + 1]) + }], + AssetHolderKind::DefaultPortfolio + ), + AssetError::AssetMetadataValueMaxLengthExceeded + ); + assert_ok!(NFT::issue_nft( + alice.origin(), + asset_id, + vec![NFTMetadataAttribute { + key: AssetMetadataKey::Local(AssetMetadataLocalKey(1)), + value: AssetMetadataValue(vec![b'v'; max_len]) + }], + AssetHolderKind::DefaultPortfolio + )); + }); +} + /// An NFT can only be minted if the given portfolio exists. #[test] fn mint_nft_portfolio_not_found() { From d99272d4e7b6a8bf43e5b4951014adb879c32a20 Mon Sep 17 00:00:00 2001 From: Henrique Nogara Date: Thu, 1 Oct 2026 09:03:26 -0300 Subject: [PATCH 07/12] Cargo fmt --- pallets/runtime/tests/src/nft.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pallets/runtime/tests/src/nft.rs b/pallets/runtime/tests/src/nft.rs index 8e29327137..d82b1b7e22 100644 --- a/pallets/runtime/tests/src/nft.rs +++ b/pallets/runtime/tests/src/nft.rs @@ -1,5 +1,5 @@ use chrono::prelude::Utc; -use frame_support::traits::{Get, UncheckedOnRuntimeUpgrade}; +use frame_support::traits::UncheckedOnRuntimeUpgrade; use frame_support::{assert_noop, assert_ok}; use pallet_nft::Event; From 18a3a2503fc5ca75749f7501fff4d5ab58f34a85 Mon Sep 17 00:00:00 2001 From: Henrique Nogara Date: Mon, 5 Oct 2026 08:50:12 -0300 Subject: [PATCH 08/12] Rerun weights; Add unit tests; Add associated type for compliance manager --- .../compliance-manager/src/benchmarking.rs | 114 ++--- pallets/compliance-manager/src/lib.rs | 34 +- pallets/runtime/common/src/runtime.rs | 2 + pallets/runtime/develop/src/runtime.rs | 2 + pallets/runtime/mainnet/src/runtime.rs | 2 + pallets/runtime/testnet/src/runtime.rs | 2 + .../tests/src/compliance_manager_test.rs | 175 +++++++- pallets/runtime/tests/src/storage.rs | 2 + pallets/weights/src/pallet_asset.rs | 262 +++++------ pallets/weights/src/pallet_nft.rs | 92 ++-- pallets/weights/src/pallet_portfolio.rs | 70 +-- pallets/weights/src/pallet_settlement.rs | 407 +++++++++--------- pallets/weights/src/pallet_sto.rs | 42 +- 13 files changed, 715 insertions(+), 491 deletions(-) diff --git a/pallets/compliance-manager/src/benchmarking.rs b/pallets/compliance-manager/src/benchmarking.rs index 67f508435c..7f44600fda 100644 --- a/pallets/compliance-manager/src/benchmarking.rs +++ b/pallets/compliance-manager/src/benchmarking.rs @@ -27,8 +27,6 @@ use polymesh_primitives::{ use crate::*; -const MAX_DEFAULT_TRUSTED_CLAIM_ISSUERS: u32 = 3; -const MAX_TRUSTED_ISSUER_PER_CONDITION: u32 = 3; const MAX_SENDER_CONDITIONS_PER_COMPLIANCE: u32 = 3; const MAX_RECEIVER_CONDITIONS_PER_COMPLIANCE: u32 = 3; const MAX_CONDITIONS_PER_COMPLIANCE: u32 = @@ -38,21 +36,26 @@ const MAX_COMPLIANCE_REQUIREMENTS: u32 = 2; const MAX_CONDITIONS: u32 = 10; const MAX_CONDITION_TYPE_CLAIMS: u32 = 10; const MAX_CONDITION_ISSUERS: u32 = 10; -const MAX_CONDITION_ISSUER_CLAIM_TYPES: u32 = 10; - -const CLAIM_TYPES: &[ClaimType] = &[ - ClaimType::Accredited, - ClaimType::Affiliate, - ClaimType::BuyLockup, - ClaimType::SellLockup, - ClaimType::CustomerDueDiligence, - ClaimType::KnowYourCustomer, - ClaimType::Jurisdiction, - ClaimType::Exempted, - ClaimType::Blocked, -]; - -/// Create a token issuer trusted for `Any`. +const MAX_CONDITION_ISSUER_CLAIM_TYPES: u32 = 16; + +/// Returns the maximum number of trusted issuers allowed by the runtime. +fn max_trusted_issuers() -> u32 { + T::MaximumNumberOfTrustedIssuers::get() +} + +/// Returns the maximum number of claim types a trusted issuer can be trusted for. +fn max_trusted_issuer_claim_types() -> usize { + T::MaxTrustedIssuerClaimTypes::get() as usize +} + +/// Returns the maximum number of trusted issuers each condition can have, such that +/// `total_conditions` conditions (with one claim each) stay within `MaxConditionComplexity`. +fn max_issuers_per_condition(total_conditions: u32) -> u32 { + let by_complexity = T::MaxConditionComplexity::get() / total_conditions.max(1); + max_trusted_issuers::().min(by_complexity).max(1) +} + +/// Create a token issuer trusted for `Any`, or for `claim_type_len` distinct custom claim types. pub fn make_issuer(id: u32, claim_type_len: Option) -> TrustedIssuer { let u = UserBuilder::::default() .generate_did() @@ -63,9 +66,9 @@ pub fn make_issuer(id: u32, claim_type_len: Option) -> trusted_for: match claim_type_len { None => TrustedFor::Any, Some(len) => TrustedFor::Specific( + // Custom claim types have the largest encoding and are distinct, so they are not removed by dedup. (0..len) - .into_iter() - .map(|idx| CLAIM_TYPES[idx % CLAIM_TYPES.len()]) + .map(|idx| ClaimType::Custom(CustomClaimTypeId(idx as u32 + 1))) .collect(), ), }, @@ -149,15 +152,18 @@ struct ComplianceRequirementInfo { } impl ComplianceRequirementInfo { + /// Adds `i` default trusted issuers, each trusted for the maximum number of claim types. pub fn add_default_trusted_claim_issuer(self: &Self, i: u32) { - make_issuers::(i, None).into_iter().for_each(|issuer| { - Pallet::::add_default_trusted_claim_issuer( - self.owner.origin.clone().into(), - self.asset_id, - issuer, - ) - .unwrap(); - }); + make_issuers::(i, Some(max_trusted_issuer_claim_types::())) + .into_iter() + .for_each(|issuer| { + Pallet::::add_default_trusted_claim_issuer( + self.owner.origin.clone().into(), + self.asset_id, + issuer, + ) + .unwrap(); + }); } } @@ -294,15 +300,9 @@ where }); if read_trusted_issuers_storage { - // Adds all trusted issuers as the default for the asset_id - trusted_issuers.into_iter().for_each(|trusted_issuer| { - Pallet::::base_add_default_trusted_claim_issuer( - sender.did(), - asset_id, - trusted_issuer, - ) - .unwrap(); - }); + // Adds all trusted issuers as the default for the asset_id. + // NB: Storage is written directly, since `n_issuers` can exceed `MaximumNumberOfTrustedIssuers`. + TrustedClaimIssuer::::insert(asset_id, trusted_issuers); let condition = Condition::new(ConditionType::IsNoneOf(claims), Vec::new()); return condition; } @@ -322,7 +322,7 @@ pub fn setup_asset_compliance( n: u32, pause_compliance: bool, ) { - let claim_types: Vec = (1..::MaxLen::get()) + let claim_types: Vec = (1..T::MaxTrustedIssuerClaimTypes::get()) .map(|i| ClaimType::Custom(CustomClaimTypeId(i))) .chain(core::iter::once(ClaimType::Jurisdiction)) .collect(); @@ -373,7 +373,10 @@ benchmarks! { // INTERNAL: This benchmark only evaluate the adding operation. Its execution should be measured in another module. let c in 1..MAX_CONDITIONS_PER_COMPLIANCE; - let d = ComplianceRequirementBuilder::::new(MAX_TRUSTED_ISSUER_PER_CONDITION, c).build(); + let d = ComplianceRequirementBuilder::::new( + max_issuers_per_condition::(MAX_CONDITIONS_PER_COMPLIANCE), + c + ).build(); }: _(d.owner.origin, d.asset_id, d.sender_conditions.clone(), d.receiver_conditions.clone()) verify { @@ -385,7 +388,7 @@ benchmarks! { remove_compliance_requirement { // Add the compliance requirement. let d = ComplianceRequirementBuilder::::new( - MAX_TRUSTED_ISSUER_PER_CONDITION, + max_issuers_per_condition::(MAX_CONDITIONS_PER_COMPLIANCE), MAX_CONDITIONS_PER_COMPLIANCE) .add_compliance_requirement().build(); @@ -404,7 +407,7 @@ benchmarks! { pause_asset_compliance { let d = ComplianceRequirementBuilder::::new( - MAX_TRUSTED_ISSUER_PER_CONDITION, + max_issuers_per_condition::(MAX_CONDITIONS_PER_COMPLIANCE), MAX_CONDITIONS_PER_COMPLIANCE) .add_compliance_requirement().build(); }: _(d.owner.origin, d.asset_id) @@ -426,13 +429,15 @@ benchmarks! { add_default_trusted_claim_issuer { // Create and add the compliance requirement. - let d = ComplianceRequirementBuilder::::new(1, 1) + // The conditions have no issuers, so the complexity check depends on the default trusted issuers. + let d = ComplianceRequirementBuilder::::new(0, MAX_CONDITIONS_PER_COMPLIANCE) .add_compliance_requirement() .build(); - d.add_default_trusted_claim_issuer(MAX_DEFAULT_TRUSTED_CLAIM_ISSUERS -1); + let max_issuers = max_trusted_issuers::(); + d.add_default_trusted_claim_issuer(max_issuers - 1); // Add one more for benchmarking. - let new_issuer = make_issuer::(MAX_DEFAULT_TRUSTED_CLAIM_ISSUERS, None); + let new_issuer = make_issuer::(max_issuers, Some(max_trusted_issuer_claim_types::())); }: _(d.owner.origin, d.asset_id, new_issuer.clone()) verify { let trusted_issuers = TrustedClaimIssuer::::get(d.asset_id); @@ -446,8 +451,8 @@ benchmarks! { let d = ComplianceRequirementBuilder::::new(2, 1) .add_compliance_requirement().build(); - // Generate some trusted issuer. - d.add_default_trusted_claim_issuer(MAX_DEFAULT_TRUSTED_CLAIM_ISSUERS); + // Generate the maximum number of trusted issuers. + d.add_default_trusted_claim_issuer(max_trusted_issuers::()); // Delete the latest trusted issuer. let issuer = TrustedClaimIssuer::::get(d.asset_id).pop().unwrap(); @@ -465,7 +470,7 @@ benchmarks! { // Add maximum size compliance requirements. let d = ComplianceRequirementBuilder::::new( - MAX_TRUSTED_ISSUER_PER_CONDITION, + max_issuers_per_condition::(MAX_CONDITIONS_PER_COMPLIANCE), MAX_CONDITIONS_PER_COMPLIANCE) .add_compliance_requirement().build(); @@ -474,7 +479,10 @@ benchmarks! { // Build a new set of compliance requirements. let (sender_count, receiver_count) = split_conditions(c); - let issuers = make_issuers::(MAX_TRUSTED_ISSUER_PER_CONDITION, None); + let issuers = make_issuers::( + max_issuers_per_condition::(MAX_CONDITIONS_PER_COMPLIANCE), + None + ); let new_req = ComplianceRequirement { id, sender_conditions: make_conditions(sender_count, None, &issuers), @@ -494,13 +502,15 @@ benchmarks! { replace_asset_compliance { let c in 0..MAX_COMPLIANCE_REQUIREMENTS; + // The issuers are limited so that all requirements stay within `MaxConditionComplexity`. + let issuers_count = + max_issuers_per_condition::(MAX_COMPLIANCE_REQUIREMENTS * MAX_CONDITIONS_PER_COMPLIANCE); + // Always add at least one compliance requirement. - let d = ComplianceRequirementBuilder::::new( - MAX_TRUSTED_ISSUER_PER_CONDITION, - MAX_CONDITIONS_PER_COMPLIANCE) + let d = ComplianceRequirementBuilder::::new(issuers_count, MAX_CONDITIONS_PER_COMPLIANCE) .add_compliance_requirement().build(); - let issuers = make_issuers::(MAX_TRUSTED_ISSUER_PER_CONDITION, None); + let issuers = make_issuers::(issuers_count, None); let sender_conditions = make_conditions(MAX_SENDER_CONDITIONS_PER_COMPLIANCE, None, &issuers); let receiver_conditions = make_conditions(MAX_RECEIVER_CONDITIONS_PER_COMPLIANCE, None, &issuers); @@ -529,7 +539,7 @@ benchmarks! { reset_asset_compliance { // Add the compliance requirement. let d = ComplianceRequirementBuilder::::new( - MAX_TRUSTED_ISSUER_PER_CONDITION, + max_issuers_per_condition::(MAX_CONDITIONS_PER_COMPLIANCE), MAX_CONDITIONS_PER_COMPLIANCE) .add_compliance_requirement().build(); }: _(d.owner.origin, d.asset_id) diff --git a/pallets/compliance-manager/src/lib.rs b/pallets/compliance-manager/src/lib.rs index 63f821bf05..8d78587135 100644 --- a/pallets/compliance-manager/src/lib.rs +++ b/pallets/compliance-manager/src/lib.rs @@ -85,7 +85,6 @@ use frame_support::weights::Weight; use frame_system::pallet_prelude::OriginFor; use sp_std::{convert::From, prelude::*}; -use pallet_base::ensure_length_ok; use pallet_external_agents::{Config as EAConfig, GroupOfAgent}; use polymesh_primitives::asset::AssetId; use polymesh_primitives::compliance_manager::{ @@ -126,6 +125,15 @@ pub mod pallet { /// The maximum claim reads that are allowed to happen in worst case of a condition resolution #[pallet::constant] type MaxConditionComplexity: Get; + + /// The maximum number of trusted issuers allowed in the default trusted claim issuers of an asset + /// and in the `issuers` list of each condition. + #[pallet::constant] + type MaximumNumberOfTrustedIssuers: Get; + + /// The maximum number of claim types a trusted issuer can be trusted for (`TrustedFor::Specific`). + #[pallet::constant] + type MaxTrustedIssuerClaimTypes: Get; } #[pallet::event] @@ -260,6 +268,10 @@ pub mod pallet { ComplianceRequirementTooComplex, /// The maximum weight limit for executing the function was exceeded. WeightLimitExceeded, + /// The number of trusted issuers exceeds `MaximumNumberOfTrustedIssuers`. + TooManyTrustedIssuers, + /// The number of claim types of a trusted issuer exceeds `MaxTrustedIssuerClaimTypes`. + TooManyTrustedIssuerClaimTypes, } #[pallet::pallet] @@ -591,7 +603,7 @@ impl Pallet { TrustedClaimIssuer::::try_mutate(asset_id, |issuers| { // Ensure we don't have too many issuers now in total. let new_count = issuers.len().saturating_add(1); - ensure_length_ok::(new_count)?; + Self::ensure_trusted_issuers_count_limited(new_count)?; // Ensure the new issuer is new. ensure!( @@ -815,17 +827,31 @@ impl Pallet { fn ensure_issuers_in_req_limited(req: &ComplianceRequirement) -> DispatchResult { req.conditions().try_for_each(|cond| { - ensure_length_ok::(cond.issuers.len())?; + Self::ensure_trusted_issuers_count_limited(cond.issuers.len())?; cond.issuers .iter() .try_for_each(Self::ensure_issuer_limited) }) } + fn ensure_trusted_issuers_count_limited(count: usize) -> DispatchResult { + ensure!( + count <= T::MaximumNumberOfTrustedIssuers::get() as usize, + Error::::TooManyTrustedIssuers + ); + Ok(()) + } + fn ensure_issuer_limited(issuer: &TrustedIssuer) -> DispatchResult { match &issuer.trusted_for { TrustedFor::Any => Ok(()), - TrustedFor::Specific(cts) => ensure_length_ok::(cts.len()), + TrustedFor::Specific(cts) => { + ensure!( + cts.len() <= T::MaxTrustedIssuerClaimTypes::get() as usize, + Error::::TooManyTrustedIssuerClaimTypes + ); + Ok(()) + } } } diff --git a/pallets/runtime/common/src/runtime.rs b/pallets/runtime/common/src/runtime.rs index 8e43089e4c..c1f5a7aeb6 100644 --- a/pallets/runtime/common/src/runtime.rs +++ b/pallets/runtime/common/src/runtime.rs @@ -518,6 +518,8 @@ macro_rules! misc_pallet_impls { impl pallet_compliance_manager::Config for Runtime { type WeightInfo = polymesh_weights::pallet_compliance_manager::SubstrateWeight; type MaxConditionComplexity = MaxConditionComplexity; + type MaximumNumberOfTrustedIssuers = MaximumNumberOfTrustedIssuers; + type MaxTrustedIssuerClaimTypes = MaxTrustedIssuerClaimTypes; } impl pallet_capital_distribution::Config for Runtime { diff --git a/pallets/runtime/develop/src/runtime.rs b/pallets/runtime/develop/src/runtime.rs index d69fc29f8c..0815a2b148 100644 --- a/pallets/runtime/develop/src/runtime.rs +++ b/pallets/runtime/develop/src/runtime.rs @@ -131,6 +131,8 @@ parameter_types! { // Compliance manager: pub const MaxConditionComplexity: u32 = 50; + pub const MaximumNumberOfTrustedIssuers: u32 = 8; + pub const MaxTrustedIssuerClaimTypes: u32 = 16; // Corporate Actions: pub const MaxTargetIds: u32 = 1000; diff --git a/pallets/runtime/mainnet/src/runtime.rs b/pallets/runtime/mainnet/src/runtime.rs index ff6b0dbcf7..306479e6dc 100644 --- a/pallets/runtime/mainnet/src/runtime.rs +++ b/pallets/runtime/mainnet/src/runtime.rs @@ -127,6 +127,8 @@ parameter_types! { // Compliance manager: pub const MaxConditionComplexity: u32 = 50; + pub const MaximumNumberOfTrustedIssuers: u32 = 8; + pub const MaxTrustedIssuerClaimTypes: u32 = 16; // Corporate Actions: pub const MaxTargetIds: u32 = 1000; diff --git a/pallets/runtime/testnet/src/runtime.rs b/pallets/runtime/testnet/src/runtime.rs index 0c0a7590b1..8e477a97b0 100644 --- a/pallets/runtime/testnet/src/runtime.rs +++ b/pallets/runtime/testnet/src/runtime.rs @@ -137,6 +137,8 @@ parameter_types! { // Compliance manager: pub const MaxConditionComplexity: u32 = 50; + pub const MaximumNumberOfTrustedIssuers: u32 = 8; + pub const MaxTrustedIssuerClaimTypes: u32 = 16; // Corporate Actions: pub const MaxTargetIds: u32 = 1000; diff --git a/pallets/runtime/tests/src/compliance_manager_test.rs b/pallets/runtime/tests/src/compliance_manager_test.rs index f7d66ca4db..0117dd52fa 100644 --- a/pallets/runtime/tests/src/compliance_manager_test.rs +++ b/pallets/runtime/tests/src/compliance_manager_test.rs @@ -9,8 +9,8 @@ use polymesh_primitives::asset::AssetId; use polymesh_primitives::compliance_manager::{ComplianceReport, ComplianceRequirement}; use polymesh_primitives::{ traits::ComplianceFnConfig, AuthorizationData, Claim, ClaimType, Condition, ConditionType, - CountryCode, IdentityId, PortfolioId, Scope, Signatory, TargetIdentity, TrustedFor, - WeightMeter, + CountryCode, CustomClaimTypeId, IdentityId, PortfolioId, Scope, Signatory, TargetIdentity, + TrustedFor, TrustedIssuer, WeightMeter, }; use sp_keyring::Sr25519Keyring; @@ -1512,3 +1512,174 @@ fn check_new_return_type_of_rpc() { assert_valid_transfer!(asset_id, owner.did, receiver.did, 100); }); } + +#[test] +fn should_limit_number_of_trusted_issuers() { + ExtBuilder::default() + .build() + .execute_with(should_limit_number_of_trusted_issuers_we); +} + +fn should_limit_number_of_trusted_issuers_we() { + let max_issuers = + ::MaximumNumberOfTrustedIssuers::get(); + let owner = User::new(Sr25519Keyring::Alice); + let asset_id = create_and_issue_sample_asset(&owner); + + // Condition level issuers. + let ty = ConditionType::IsPresent(Claim::KnowYourCustomer(Scope::Asset(asset_id))); + let issuers = (0..=max_issuers as u128) + .map(IdentityId::from) + .collect::>(); + let max_condition = Condition::from_dids(ty.clone(), &issuers[..max_issuers as usize]); + let over_condition = Condition::from_dids(ty, &issuers); + + assert_noop!( + ComplianceManager::add_compliance_requirement( + owner.origin(), + asset_id, + vec![over_condition.clone()], + vec![], + ), + CMError::::TooManyTrustedIssuers + ); + assert_ok!(ComplianceManager::add_compliance_requirement( + owner.origin(), + asset_id, + vec![max_condition.clone()], + vec![], + )); + let id = AssetCompliances::::get(asset_id).requirements[0].id; + let over_req = ComplianceRequirement { + sender_conditions: vec![], + receiver_conditions: vec![over_condition], + id, + }; + assert_noop!( + ComplianceManager::change_compliance_requirement( + owner.origin(), + asset_id, + over_req.clone() + ), + CMError::::TooManyTrustedIssuers + ); + assert_noop!( + ComplianceManager::replace_asset_compliance(owner.origin(), asset_id, vec![over_req]), + CMError::::TooManyTrustedIssuers + ); + assert_ok!(ComplianceManager::reset_asset_compliance( + owner.origin(), + asset_id + )); + + // Default trusted issuers. + let rings = [ + Sr25519Keyring::Alice, + Sr25519Keyring::Bob, + Sr25519Keyring::Charlie, + Sr25519Keyring::Dave, + Sr25519Keyring::Eve, + Sr25519Keyring::Ferdie, + Sr25519Keyring::One, + Sr25519Keyring::Two, + ]; + assert_eq!(rings.len(), max_issuers as usize); + let users = rings + .iter() + .map(|ring| match *ring { + Sr25519Keyring::Alice => owner, + ring => User::new(ring), + }) + .collect::>(); + for user in &users { + assert_ok!(ComplianceManager::add_default_trusted_claim_issuer( + owner.origin(), + asset_id, + user.issuer(), + )); + } + assert_noop!( + ComplianceManager::add_default_trusted_claim_issuer( + owner.origin(), + asset_id, + owner.trusted_issuer_for(TrustedFor::Specific(vec![ClaimType::Accredited])), + ), + CMError::::TooManyTrustedIssuers + ); + assert_eq!( + TrustedClaimIssuer::::get(asset_id).len(), + max_issuers as usize + ); +} + +#[test] +fn should_limit_number_of_trusted_issuer_claim_types() { + ExtBuilder::default() + .build() + .execute_with(should_limit_number_of_trusted_issuer_claim_types_we); +} + +fn should_limit_number_of_trusted_issuer_claim_types_we() { + let max_claim_types = + ::MaxTrustedIssuerClaimTypes::get(); + let owner = User::new(Sr25519Keyring::Alice); + let asset_id = create_and_issue_sample_asset(&owner); + + let claim_types = |len: u32| { + TrustedFor::Specific( + (1..=len) + .map(|i| ClaimType::Custom(CustomClaimTypeId(i))) + .collect(), + ) + }; + let max_issuer = owner.trusted_issuer_for(claim_types(max_claim_types)); + let over_issuer = owner.trusted_issuer_for(claim_types(max_claim_types + 1)); + + // Condition level issuers. + let ty = ConditionType::IsPresent(Claim::KnowYourCustomer(Scope::Asset(asset_id))); + let condition = |issuer: &TrustedIssuer| Condition::new(ty.clone(), vec![issuer.clone()]); + assert_noop!( + ComplianceManager::add_compliance_requirement( + owner.origin(), + asset_id, + vec![condition(&over_issuer)], + vec![], + ), + CMError::::TooManyTrustedIssuerClaimTypes + ); + assert_ok!(ComplianceManager::add_compliance_requirement( + owner.origin(), + asset_id, + vec![condition(&max_issuer)], + vec![], + )); + let id = AssetCompliances::::get(asset_id).requirements[0].id; + let over_req = ComplianceRequirement { + sender_conditions: vec![condition(&over_issuer)], + receiver_conditions: vec![], + id, + }; + assert_noop!( + ComplianceManager::change_compliance_requirement( + owner.origin(), + asset_id, + over_req.clone() + ), + CMError::::TooManyTrustedIssuerClaimTypes + ); + assert_noop!( + ComplianceManager::replace_asset_compliance(owner.origin(), asset_id, vec![over_req]), + CMError::::TooManyTrustedIssuerClaimTypes + ); + + // Default trusted issuers. + assert_noop!( + ComplianceManager::add_default_trusted_claim_issuer(owner.origin(), asset_id, over_issuer), + CMError::::TooManyTrustedIssuerClaimTypes + ); + assert_ok!(ComplianceManager::add_default_trusted_claim_issuer( + owner.origin(), + asset_id, + max_issuer + )); +} diff --git a/pallets/runtime/tests/src/storage.rs b/pallets/runtime/tests/src/storage.rs index eca6fffef6..aea76956c6 100644 --- a/pallets/runtime/tests/src/storage.rs +++ b/pallets/runtime/tests/src/storage.rs @@ -573,6 +573,8 @@ parameter_types! { pub const MaxTransferConditionsPerAsset: u32 = 4 + BENCHMARK_MAX_INCREASE; pub const MaxConditionComplexity: u32 = 50; + pub const MaximumNumberOfTrustedIssuers: u32 = 8; + pub const MaxTrustedIssuerClaimTypes: u32 = 16; pub const MaxDefaultTrustedClaimIssuers: usize = 10; pub const MaxTrustedIssuerPerCondition: usize = 10; pub const MaxSenderConditionsPerCompliance: usize = 30; diff --git a/pallets/weights/src/pallet_asset.rs b/pallets/weights/src/pallet_asset.rs index ebc7e56f01..6c4731481f 100644 --- a/pallets/weights/src/pallet_asset.rs +++ b/pallets/weights/src/pallet_asset.rs @@ -4,7 +4,7 @@ //! Autogenerated weights for pallet_asset //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 54.0.0 -//! DATE: 2026-09-26, STEPS: `100`, REPEAT: 5, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2026-10-04, STEPS: `100`, REPEAT: 5, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 512 //! HOSTNAME: `ubuntu-8gb-hel1-bench`, CPU: `AMD EPYC-Milan Processor` @@ -16,7 +16,7 @@ // 100 // -r // 5 -// -p=pallet_asset,pallet_nft,pallet_settlement,pallet_sto,pallet_compliance +// -p=pallet_asset,pallet_nft,pallet_settlement,pallet_sto,pallet_portfolio // -e=* // --heap-pages // 4096 @@ -58,8 +58,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::TickersOwnedByUser` (r:0 w:1) // Proof: `Asset::TickersOwnedByUser` (`max_values`: None, `max_size`: Some(61), added: 2536, mode: `MaxEncodedLen`) fn register_unique_ticker() -> Weight { - // Minimum execution time: 47_890 nanoseconds. - Weight::from_parts(51_790_000, 0) + // Minimum execution time: 47_570 nanoseconds. + Weight::from_parts(51_570_000, 0) .saturating_add(DbWeight::get().reads(8)) .saturating_add(DbWeight::get().writes(2)) } @@ -80,8 +80,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::TickersOwnedByUser` (r:0 w:2) // Proof: `Asset::TickersOwnedByUser` (`max_values`: None, `max_size`: Some(61), added: 2536, mode: `MaxEncodedLen`) fn accept_ticker_transfer() -> Weight { - // Minimum execution time: 55_910 nanoseconds. - Weight::from_parts(59_450_000, 0) + // Minimum execution time: 55_100 nanoseconds. + Weight::from_parts(58_990_000, 0) .saturating_add(DbWeight::get().reads(6)) .saturating_add(DbWeight::get().writes(6)) } @@ -116,8 +116,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `ExternalAgents::AgentOf` (r:0 w:2) // Proof: `ExternalAgents::AgentOf` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) fn accept_asset_ownership_transfer() -> Weight { - // Minimum execution time: 105_530 nanoseconds. - Weight::from_parts(110_860_000, 0) + // Minimum execution time: 105_200 nanoseconds. + Weight::from_parts(111_070_000, 0) .saturating_add(DbWeight::get().reads(12)) .saturating_add(DbWeight::get().writes(14)) } @@ -152,15 +152,11 @@ impl pallet_asset::WeightInfo for SubstrateWeight { /// The range of component `n` is `[1, 128]`. /// The range of component `i` is `[1, 512]`. /// The range of component `f` is `[1, 128]`. - fn create_asset(n: u32, i: u32, f: u32) -> Weight { - // Minimum execution time: 75_130 nanoseconds. - Weight::from_parts(84_699_360, 0) - // Standard Error: 2_794 - .saturating_add(Weight::from_parts(675, 0).saturating_mul(n.into())) - // Standard Error: 610 - .saturating_add(Weight::from_parts(59_414, 0).saturating_mul(i.into())) - // Standard Error: 2_794 - .saturating_add(Weight::from_parts(5_528, 0).saturating_mul(f.into())) + fn create_asset(_n: u32, i: u32, _f: u32, ) -> Weight { + // Minimum execution time: 74_450 nanoseconds. + Weight::from_parts(82_919_011, 0) + // Standard Error: 591 + .saturating_add(Weight::from_parts(57_040, 0).saturating_mul(i.into())) .saturating_add(DbWeight::get().reads(9)) .saturating_add(DbWeight::get().writes(9)) } @@ -177,8 +173,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::Frozen` (r:1 w:1) // Proof: `Asset::Frozen` (`max_values`: None, `max_size`: Some(33), added: 2508, mode: `MaxEncodedLen`) fn freeze() -> Weight { - // Minimum execution time: 36_480 nanoseconds. - Weight::from_parts(39_310_000, 0) + // Minimum execution time: 36_080 nanoseconds. + Weight::from_parts(38_790_000, 0) .saturating_add(DbWeight::get().reads(6)) .saturating_add(DbWeight::get().writes(1)) } @@ -195,8 +191,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::Frozen` (r:1 w:1) // Proof: `Asset::Frozen` (`max_values`: None, `max_size`: Some(33), added: 2508, mode: `MaxEncodedLen`) fn unfreeze() -> Weight { - // Minimum execution time: 36_710 nanoseconds. - Weight::from_parts(40_140_000, 0) + // Minimum execution time: 36_360 nanoseconds. + Weight::from_parts(39_320_000, 0) .saturating_add(DbWeight::get().reads(6)) .saturating_add(DbWeight::get().writes(1)) } @@ -213,11 +209,11 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::AssetNames` (r:0 w:1) // Proof: `Asset::AssetNames` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `n` is `[1, 128]`. - fn rename_asset(n: u32) -> Weight { - // Minimum execution time: 34_600 nanoseconds. - Weight::from_parts(37_427_077, 0) - // Standard Error: 466 - .saturating_add(Weight::from_parts(3_630, 0).saturating_mul(n.into())) + fn rename_asset(n: u32, ) -> Weight { + // Minimum execution time: 33_920 nanoseconds. + Weight::from_parts(37_016_734, 0) + // Standard Error: 532 + .saturating_add(Weight::from_parts(5_912, 0).saturating_mul(n.into())) .saturating_add(DbWeight::get().reads(5)) .saturating_add(DbWeight::get().writes(1)) } @@ -260,8 +256,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::IssuedInFundingRound` (r:1 w:1) // Proof: `Asset::IssuedInFundingRound` (`max_values`: None, `max_size`: None, mode: `Measured`) fn issue() -> Weight { - // Minimum execution time: 528_949 nanoseconds. - Weight::from_parts(546_320_000, 0) + // Minimum execution time: 526_730 nanoseconds. + Weight::from_parts(549_669_000, 0) .saturating_add(DbWeight::get().reads(137)) .saturating_add(DbWeight::get().writes(65)) } @@ -296,8 +292,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Statistics::ActiveAssetStats` (r:1 w:0) // Proof: `Statistics::ActiveAssetStats` (`max_values`: None, `max_size`: Some(2373), added: 4848, mode: `MaxEncodedLen`) fn redeem() -> Weight { - // Minimum execution time: 100_770 nanoseconds. - Weight::from_parts(104_560_000, 0) + // Minimum execution time: 99_240 nanoseconds. + Weight::from_parts(104_060_000, 0) .saturating_add(DbWeight::get().reads(15)) .saturating_add(DbWeight::get().writes(3)) } @@ -312,8 +308,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::Assets` (r:1 w:1) // Proof: `Asset::Assets` (`max_values`: None, `max_size`: None, mode: `Measured`) fn make_divisible() -> Weight { - // Minimum execution time: 32_620 nanoseconds. - Weight::from_parts(35_500_000, 0) + // Minimum execution time: 32_110 nanoseconds. + Weight::from_parts(34_900_000, 0) .saturating_add(DbWeight::get().reads(5)) .saturating_add(DbWeight::get().writes(1)) } @@ -334,11 +330,11 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::AssetDocuments` (r:0 w:64) // Proof: `Asset::AssetDocuments` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `d` is `[1, 64]`. - fn add_documents(d: u32) -> Weight { - // Minimum execution time: 46_620 nanoseconds. - Weight::from_parts(44_989_622, 0) - // Standard Error: 7_098 - .saturating_add(Weight::from_parts(8_844_607, 0).saturating_mul(d.into())) + fn add_documents(d: u32, ) -> Weight { + // Minimum execution time: 46_350 nanoseconds. + Weight::from_parts(47_702_916, 0) + // Standard Error: 7_586 + .saturating_add(Weight::from_parts(8_812_920, 0).saturating_mul(d.into())) .saturating_add(DbWeight::get().reads(7)) .saturating_add(DbWeight::get().writes(1)) .saturating_add(DbWeight::get().writes((1_u64).saturating_mul(d.into()))) @@ -354,11 +350,11 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::AssetDocuments` (r:0 w:63) // Proof: `Asset::AssetDocuments` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `d` is `[1, 64]`. - fn remove_documents(d: u32) -> Weight { - // Minimum execution time: 21_040 nanoseconds. - Weight::from_parts(20_772_882, 0) - // Standard Error: 3_717 - .saturating_add(Weight::from_parts(4_429_117, 0).saturating_mul(d.into())) + fn remove_documents(d: u32, ) -> Weight { + // Minimum execution time: 20_970 nanoseconds. + Weight::from_parts(20_263_846, 0) + // Standard Error: 3_507 + .saturating_add(Weight::from_parts(4_450_792, 0).saturating_mul(d.into())) .saturating_add(DbWeight::get().reads(4)) .saturating_add(DbWeight::get().writes((1_u64).saturating_mul(d.into()))) } @@ -373,11 +369,11 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::FundingRound` (r:0 w:1) // Proof: `Asset::FundingRound` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `f` is `[1, 128]`. - fn set_funding_round(f: u32) -> Weight { - // Minimum execution time: 27_520 nanoseconds. - Weight::from_parts(29_954_916, 0) - // Standard Error: 382 - .saturating_add(Weight::from_parts(4_525, 0).saturating_mul(f.into())) + fn set_funding_round(f: u32, ) -> Weight { + // Minimum execution time: 26_960 nanoseconds. + Weight::from_parts(29_814_822, 0) + // Standard Error: 442 + .saturating_add(Weight::from_parts(2_699, 0).saturating_mul(f.into())) .saturating_add(DbWeight::get().reads(4)) .saturating_add(DbWeight::get().writes(1)) } @@ -392,11 +388,11 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::AssetIdentifiers` (r:0 w:1) // Proof: `Asset::AssetIdentifiers` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `i` is `[1, 512]`. - fn update_identifiers(i: u32) -> Weight { - // Minimum execution time: 28_300 nanoseconds. - Weight::from_parts(30_579_795, 0) - // Standard Error: 228 - .saturating_add(Weight::from_parts(49_361, 0).saturating_mul(i.into())) + fn update_identifiers(i: u32, ) -> Weight { + // Minimum execution time: 27_480 nanoseconds. + Weight::from_parts(30_010_161, 0) + // Standard Error: 220 + .saturating_add(Weight::from_parts(48_216, 0).saturating_mul(i.into())) .saturating_add(DbWeight::get().reads(4)) .saturating_add(DbWeight::get().writes(1)) } @@ -431,8 +427,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Statistics::ActiveAssetStats` (r:1 w:0) // Proof: `Statistics::ActiveAssetStats` (`max_values`: None, `max_size`: Some(2373), added: 4848, mode: `MaxEncodedLen`) fn controller_transfer() -> Weight { - // Minimum execution time: 114_040 nanoseconds. - Weight::from_parts(120_170_000, 0) + // Minimum execution time: 113_339 nanoseconds. + Weight::from_parts(118_820_000, 0) .saturating_add(DbWeight::get().reads(16)) .saturating_add(DbWeight::get().writes(5)) } @@ -473,8 +469,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Statistics::ActiveAssetStats` (r:1 w:0) // Proof: `Statistics::ActiveAssetStats` (`max_values`: None, `max_size`: Some(2373), added: 4848, mode: `MaxEncodedLen`) fn controller_transfer_to() -> Weight { - // Minimum execution time: 128_490 nanoseconds. - Weight::from_parts(134_460_000, 0) + // Minimum execution time: 128_570 nanoseconds. + Weight::from_parts(134_430_000, 0) .saturating_add(DbWeight::get().reads(20)) .saturating_add(DbWeight::get().writes(5)) } @@ -487,11 +483,11 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::CustomTypes` (r:0 w:1) // Proof: `Asset::CustomTypes` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `n` is `[1, 2048]`. - fn register_custom_asset_type(n: u32) -> Weight { - // Minimum execution time: 26_390 nanoseconds. - Weight::from_parts(29_021_506, 0) - // Standard Error: 27 - .saturating_add(Weight::from_parts(5_901, 0).saturating_mul(n.into())) + fn register_custom_asset_type(n: u32, ) -> Weight { + // Minimum execution time: 25_800 nanoseconds. + Weight::from_parts(28_499_485, 0) + // Standard Error: 28 + .saturating_add(Weight::from_parts(5_773, 0).saturating_mul(n.into())) .saturating_add(DbWeight::get().reads(3)) .saturating_add(DbWeight::get().writes(3)) } @@ -510,8 +506,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::AssetMetadataValues` (r:0 w:1) // Proof: `Asset::AssetMetadataValues` (`max_values`: None, `max_size`: None, mode: `Measured`) fn set_asset_metadata() -> Weight { - // Minimum execution time: 49_900 nanoseconds. - Weight::from_parts(53_270_000, 0) + // Minimum execution time: 49_570 nanoseconds. + Weight::from_parts(52_880_000, 0) .saturating_add(DbWeight::get().reads(6)) .saturating_add(DbWeight::get().writes(2)) } @@ -530,8 +526,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Timestamp::Now` (r:1 w:0) // Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) fn set_asset_metadata_details() -> Weight { - // Minimum execution time: 45_950 nanoseconds. - Weight::from_parts(49_120_000, 0) + // Minimum execution time: 45_170 nanoseconds. + Weight::from_parts(48_530_000, 0) .saturating_add(DbWeight::get().reads(7)) .saturating_add(DbWeight::get().writes(1)) } @@ -556,8 +552,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::AssetMetadataLocalSpecs` (r:0 w:1) // Proof: `Asset::AssetMetadataLocalSpecs` (`max_values`: None, `max_size`: None, mode: `Measured`) fn register_and_set_local_asset_metadata() -> Weight { - // Minimum execution time: 74_370 nanoseconds. - Weight::from_parts(78_450_000, 0) + // Minimum execution time: 73_980 nanoseconds. + Weight::from_parts(78_180_000, 0) .saturating_add(DbWeight::get().reads(7)) .saturating_add(DbWeight::get().writes(6)) } @@ -578,8 +574,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::AssetMetadataLocalSpecs` (r:0 w:1) // Proof: `Asset::AssetMetadataLocalSpecs` (`max_values`: None, `max_size`: None, mode: `Measured`) fn register_asset_metadata_local_type() -> Weight { - // Minimum execution time: 52_370 nanoseconds. - Weight::from_parts(55_840_000, 0) + // Minimum execution time: 52_480 nanoseconds. + Weight::from_parts(55_890_000, 0) .saturating_add(DbWeight::get().reads(6)) .saturating_add(DbWeight::get().writes(4)) } @@ -592,8 +588,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::AssetMetadataGlobalSpecs` (r:0 w:1) // Proof: `Asset::AssetMetadataGlobalSpecs` (`max_values`: None, `max_size`: None, mode: `Measured`) fn register_asset_metadata_global_type() -> Weight { - // Minimum execution time: 29_540 nanoseconds. - Weight::from_parts(33_200_000, 0) + // Minimum execution time: 29_359 nanoseconds. + Weight::from_parts(33_370_000, 0) .saturating_add(DbWeight::get().reads(2)) .saturating_add(DbWeight::get().writes(4)) } @@ -608,8 +604,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Permissions::CurrentDispatchableName` (r:1 w:0) // Proof: `Permissions::CurrentDispatchableName` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn update_asset_type() -> Weight { - // Minimum execution time: 34_660 nanoseconds. - Weight::from_parts(37_790_000, 0) + // Minimum execution time: 34_440 nanoseconds. + Weight::from_parts(37_320_000, 0) .saturating_add(DbWeight::get().reads(5)) .saturating_add(DbWeight::get().writes(1)) } @@ -636,8 +632,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::AssetMetadataLocalSpecs` (r:0 w:1) // Proof: `Asset::AssetMetadataLocalSpecs` (`max_values`: None, `max_size`: None, mode: `Measured`) fn remove_local_metadata_key() -> Weight { - // Minimum execution time: 62_280 nanoseconds. - Weight::from_parts(66_030_000, 0) + // Minimum execution time: 61_880 nanoseconds. + Weight::from_parts(65_400_000, 0) .saturating_add(DbWeight::get().reads(8)) .saturating_add(DbWeight::get().writes(5)) } @@ -656,8 +652,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::AssetMetadataValues` (r:0 w:1) // Proof: `Asset::AssetMetadataValues` (`max_values`: None, `max_size`: None, mode: `Measured`) fn remove_metadata_value() -> Weight { - // Minimum execution time: 41_640 nanoseconds. - Weight::from_parts(44_840_000, 0) + // Minimum execution time: 41_200 nanoseconds. + Weight::from_parts(44_100_000, 0) .saturating_add(DbWeight::get().reads(6)) .saturating_add(DbWeight::get().writes(2)) } @@ -692,30 +688,32 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Statistics::ActiveAssetStats` (r:1 w:0) // Proof: `Statistics::ActiveAssetStats` (`max_values`: None, `max_size`: Some(2373), added: 4848, mode: `MaxEncodedLen`) fn base_transfer() -> Weight { - // Minimum execution time: 545_590 nanoseconds. - Weight::from_parts(568_250_000, 0) + // Minimum execution time: 161_720 nanoseconds. + Weight::from_parts(167_579_000, 0) .saturating_add(DbWeight::get().reads(17)) .saturating_add(DbWeight::get().writes(5)) } // Storage: `Asset::AssetsExemptFromAffirmation` (r:0 w:1) // Proof: `Asset::AssetsExemptFromAffirmation` (`max_values`: None, `max_size`: Some(33), added: 2508, mode: `MaxEncodedLen`) fn exempt_asset_affirmation() -> Weight { - // Minimum execution time: 8_500 nanoseconds. - Weight::from_parts(9_750_000, 0).saturating_add(DbWeight::get().writes(1)) + // Minimum execution time: 8_410 nanoseconds. + Weight::from_parts(9_710_000, 0) + .saturating_add(DbWeight::get().writes(1)) } // Storage: `Asset::AssetsExemptFromAffirmation` (r:0 w:1) // Proof: `Asset::AssetsExemptFromAffirmation` (`max_values`: None, `max_size`: Some(33), added: 2508, mode: `MaxEncodedLen`) fn remove_asset_affirmation_exemption() -> Weight { - // Minimum execution time: 8_300 nanoseconds. - Weight::from_parts(9_590_000, 0).saturating_add(DbWeight::get().writes(1)) + // Minimum execution time: 8_200 nanoseconds. + Weight::from_parts(9_520_000, 0) + .saturating_add(DbWeight::get().writes(1)) } // Storage: `Identity::KeyRecords` (r:1 w:0) // Proof: `Identity::KeyRecords` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) // Storage: `Asset::PreApprovedAsset` (r:0 w:1) // Proof: `Asset::PreApprovedAsset` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) fn pre_approve_asset() -> Weight { - // Minimum execution time: 17_110 nanoseconds. - Weight::from_parts(19_070_000, 0) + // Minimum execution time: 16_940 nanoseconds. + Weight::from_parts(18_970_000, 0) .saturating_add(DbWeight::get().reads(1)) .saturating_add(DbWeight::get().writes(1)) } @@ -724,8 +722,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::PreApprovedAsset` (r:0 w:1) // Proof: `Asset::PreApprovedAsset` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) fn remove_asset_pre_approval() -> Weight { - // Minimum execution time: 17_080 nanoseconds. - Weight::from_parts(18_910_000, 0) + // Minimum execution time: 16_759 nanoseconds. + Weight::from_parts(18_490_000, 0) .saturating_add(DbWeight::get().reads(1)) .saturating_add(DbWeight::get().writes(1)) } @@ -740,11 +738,11 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::MandatoryMediators` (r:1 w:1) // Proof: `Asset::MandatoryMediators` (`max_values`: None, `max_size`: Some(161), added: 2636, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 4]`. - fn add_mandatory_mediators(n: u32) -> Weight { - // Minimum execution time: 32_700 nanoseconds. - Weight::from_parts(35_441_950, 0) - // Standard Error: 11_410 - .saturating_add(Weight::from_parts(192_313, 0).saturating_mul(n.into())) + fn add_mandatory_mediators(n: u32, ) -> Weight { + // Minimum execution time: 32_310 nanoseconds. + Weight::from_parts(35_141_994, 0) + // Standard Error: 14_025 + .saturating_add(Weight::from_parts(244_564, 0).saturating_mul(n.into())) .saturating_add(DbWeight::get().reads(5)) .saturating_add(DbWeight::get().writes(1)) } @@ -759,11 +757,11 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::MandatoryMediators` (r:1 w:1) // Proof: `Asset::MandatoryMediators` (`max_values`: None, `max_size`: Some(161), added: 2636, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 4]`. - fn remove_mandatory_mediators(n: u32) -> Weight { - // Minimum execution time: 34_020 nanoseconds. - Weight::from_parts(36_724_335, 0) - // Standard Error: 11_814 - .saturating_add(Weight::from_parts(238_999, 0).saturating_mul(n.into())) + fn remove_mandatory_mediators(n: u32, ) -> Weight { + // Minimum execution time: 33_540 nanoseconds. + Weight::from_parts(36_169_296, 0) + // Standard Error: 12_665 + .saturating_add(Weight::from_parts(265_988, 0).saturating_mul(n.into())) .saturating_add(DbWeight::get().reads(5)) .saturating_add(DbWeight::get().writes(1)) } @@ -784,8 +782,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::AssetIdTicker` (r:1 w:1) // Proof: `Asset::AssetIdTicker` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`) fn link_ticker_to_asset_id() -> Weight { - // Minimum execution time: 48_090 nanoseconds. - Weight::from_parts(51_890_000, 0) + // Minimum execution time: 47_910 nanoseconds. + Weight::from_parts(51_340_000, 0) .saturating_add(DbWeight::get().reads(8)) .saturating_add(DbWeight::get().writes(3)) } @@ -806,8 +804,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::AssetIdTicker` (r:0 w:1) // Proof: `Asset::AssetIdTicker` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`) fn unlink_ticker_from_asset_id() -> Weight { - // Minimum execution time: 47_130 nanoseconds. - Weight::from_parts(50_240_000, 0) + // Minimum execution time: 46_580 nanoseconds. + Weight::from_parts(49_870_000, 0) .saturating_add(DbWeight::get().reads(6)) .saturating_add(DbWeight::get().writes(4)) } @@ -816,32 +814,33 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::AssetMetadataGlobalSpecs` (r:1 w:1) // Proof: `Asset::AssetMetadataGlobalSpecs` (`max_values`: None, `max_size`: None, mode: `Measured`) fn update_global_metadata_spec() -> Weight { - // Minimum execution time: 37_750 nanoseconds. - Weight::from_parts(40_700_000, 0) + // Minimum execution time: 37_460 nanoseconds. + Weight::from_parts(41_090_000, 0) .saturating_add(DbWeight::get().reads(2)) .saturating_add(DbWeight::get().writes(1)) } // Storage: `Identity::KeyRecords` (r:1 w:0) // Proof: `Identity::KeyRecords` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) fn receiver_affirm_asset_transfer_base_weight() -> Weight { - // Minimum execution time: 12_580 nanoseconds. - Weight::from_parts(13_480_000, 0).saturating_add(DbWeight::get().reads(1)) + // Minimum execution time: 11_430 nanoseconds. + Weight::from_parts(12_420_000, 0) + .saturating_add(DbWeight::get().reads(1)) } // Storage: `Identity::KeyRecords` (r:1 w:0) // Proof: `Identity::KeyRecords` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) // Storage: `Asset::Allowances` (r:0 w:1) // Proof: `Asset::Allowances` (`max_values`: None, `max_size`: Some(144), added: 2619, mode: `MaxEncodedLen`) fn approve() -> Weight { - // Minimum execution time: 21_080 nanoseconds. - Weight::from_parts(23_050_000, 0) + // Minimum execution time: 21_090 nanoseconds. + Weight::from_parts(23_150_000, 0) .saturating_add(DbWeight::get().reads(1)) .saturating_add(DbWeight::get().writes(1)) } // Storage: `Asset::Allowances` (r:1 w:1) // Proof: `Asset::Allowances` (`max_values`: None, `max_size`: Some(144), added: 2619, mode: `MaxEncodedLen`) fn spend_allowance() -> Weight { - // Minimum execution time: 20_270 nanoseconds. - Weight::from_parts(21_660_000, 0) + // Minimum execution time: 19_950 nanoseconds. + Weight::from_parts(21_350_000, 0) .saturating_add(DbWeight::get().reads(1)) .saturating_add(DbWeight::get().writes(1)) } @@ -878,8 +877,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::IssuedInFundingRound` (r:1 w:1) // Proof: `Asset::IssuedInFundingRound` (`max_values`: None, `max_size`: None, mode: `Measured`) fn issue_without_statistics() -> Weight { - // Minimum execution time: 82_590 nanoseconds. - Weight::from_parts(87_390_000, 0) + // Minimum execution time: 81_730 nanoseconds. + Weight::from_parts(86_659_000, 0) .saturating_add(DbWeight::get().reads(16)) .saturating_add(DbWeight::get().writes(5)) } @@ -906,8 +905,9 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `ComplianceManager::AssetCompliances` (r:1 w:0) // Proof: `ComplianceManager::AssetCompliances` (`max_values`: None, `max_size`: None, mode: `Measured`) fn asset_transfer_report_best_case() -> Weight { - // Minimum execution time: 510_320 nanoseconds. - Weight::from_parts(529_340_000, 0).saturating_add(DbWeight::get().reads(13)) + // Minimum execution time: 123_949 nanoseconds. + Weight::from_parts(128_320_000, 0) + .saturating_add(DbWeight::get().reads(13)) } // Storage: `Asset::Assets` (r:1 w:0) // Proof: `Asset::Assets` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -938,8 +938,9 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `ComplianceManager::AssetCompliances` (r:1 w:0) // Proof: `ComplianceManager::AssetCompliances` (`max_values`: None, `max_size`: None, mode: `Measured`) fn asset_transfer_report_worst_case() -> Weight { - // Minimum execution time: 748_209 nanoseconds. - Weight::from_parts(777_920_000, 0).saturating_add(DbWeight::get().reads(76)) + // Minimum execution time: 356_379 nanoseconds. + Weight::from_parts(375_730_000, 0) + .saturating_add(DbWeight::get().reads(76)) } // Storage: `Identity::KeyRecords` (r:1 w:0) // Proof: `Identity::KeyRecords` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) @@ -956,16 +957,17 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Portfolio::PortfolioFrozenAssets` (r:0 w:1) // Proof: `Portfolio::PortfolioFrozenAssets` (`max_values`: None, `max_size`: Some(97), added: 2572, mode: `MaxEncodedLen`) fn set_frozen_tokens() -> Weight { - // Minimum execution time: 41_450 nanoseconds. - Weight::from_parts(44_830_000, 0) + // Minimum execution time: 41_260 nanoseconds. + Weight::from_parts(44_260_000, 0) .saturating_add(DbWeight::get().reads(6)) .saturating_add(DbWeight::get().writes(1)) } // Storage: `Asset::FrozenBalance` (r:1 w:0) // Proof: `Asset::FrozenBalance` (`max_values`: None, `max_size`: Some(88), added: 2563, mode: `MaxEncodedLen`) fn get_holders_frozen_balance() -> Weight { - // Minimum execution time: 9_150 nanoseconds. - Weight::from_parts(10_220_000, 0).saturating_add(DbWeight::get().reads(1)) + // Minimum execution time: 9_340 nanoseconds. + Weight::from_parts(10_260_000, 0) + .saturating_add(DbWeight::get().reads(1)) } // Storage: `Asset::Assets` (r:1 w:0) // Proof: `Asset::Assets` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -978,8 +980,9 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `ComplianceManager::AssetCompliances` (r:1 w:0) // Proof: `ComplianceManager::AssetCompliances` (`max_values`: None, `max_size`: None, mode: `Measured`) fn transfer_is_allowed_for_holder_best_case() -> Weight { - // Minimum execution time: 451_379 nanoseconds. - Weight::from_parts(471_619_000, 0).saturating_add(DbWeight::get().reads(5)) + // Minimum execution time: 82_000 nanoseconds. + Weight::from_parts(84_700_000, 0) + .saturating_add(DbWeight::get().reads(5)) } // Storage: `Asset::Assets` (r:1 w:0) // Proof: `Asset::Assets` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -996,8 +999,9 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Identity::Claims` (r:50 w:0) // Proof: `Identity::Claims` (`max_values`: None, `max_size`: None, mode: `Measured`) fn transfer_is_allowed_for_holder_worst_case() -> Weight { - // Minimum execution time: 650_239 nanoseconds. - Weight::from_parts(674_920_000, 0).saturating_add(DbWeight::get().reads(56)) + // Minimum execution time: 266_059 nanoseconds. + Weight::from_parts(282_360_000, 0) + .saturating_add(DbWeight::get().reads(56)) } // Storage: `Identity::KeyRecords` (r:1 w:0) // Proof: `Identity::KeyRecords` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) @@ -1012,8 +1016,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Portfolio::FrozenPortfolios` (r:0 w:1) // Proof: `Portfolio::FrozenPortfolios` (`max_values`: None, `max_size`: Some(82), added: 2557, mode: `MaxEncodedLen`) fn set_holder_frozen() -> Weight { - // Minimum execution time: 34_110 nanoseconds. - Weight::from_parts(36_750_000, 0) + // Minimum execution time: 33_530 nanoseconds. + Weight::from_parts(36_420_000, 0) .saturating_add(DbWeight::get().reads(5)) .saturating_add(DbWeight::get().writes(1)) } @@ -1034,8 +1038,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Portfolio::PortfolioAssetBalances` (r:1 w:0) // Proof: `Portfolio::PortfolioAssetBalances` (`max_values`: None, `max_size`: Some(97), added: 2572, mode: `MaxEncodedLen`) fn freeze_partial_tokens() -> Weight { - // Minimum execution time: 50_100 nanoseconds. - Weight::from_parts(53_060_000, 0) + // Minimum execution time: 49_030 nanoseconds. + Weight::from_parts(52_490_000, 0) .saturating_add(DbWeight::get().reads(8)) .saturating_add(DbWeight::get().writes(1)) } @@ -1054,8 +1058,8 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Portfolio::PortfolioFrozenAssets` (r:1 w:1) // Proof: `Portfolio::PortfolioFrozenAssets` (`max_values`: None, `max_size`: Some(97), added: 2572, mode: `MaxEncodedLen`) fn unfreeze_partial_tokens() -> Weight { - // Minimum execution time: 47_060 nanoseconds. - Weight::from_parts(50_320_000, 0) + // Minimum execution time: 46_360 nanoseconds. + Weight::from_parts(49_790_000, 0) .saturating_add(DbWeight::get().reads(7)) .saturating_add(DbWeight::get().writes(1)) } diff --git a/pallets/weights/src/pallet_nft.rs b/pallets/weights/src/pallet_nft.rs index d219f94e72..892839dbd6 100644 --- a/pallets/weights/src/pallet_nft.rs +++ b/pallets/weights/src/pallet_nft.rs @@ -4,7 +4,7 @@ //! Autogenerated weights for pallet_nft //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 54.0.0 -//! DATE: 2026-09-26, STEPS: `100`, REPEAT: 5, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2026-10-04, STEPS: `100`, REPEAT: 5, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 512 //! HOSTNAME: `ubuntu-8gb-hel1-bench`, CPU: `AMD EPYC-Milan Processor` @@ -16,7 +16,7 @@ // 100 // -r // 5 -// -p=pallet_asset,pallet_nft,pallet_settlement,pallet_sto,pallet_compliance +// -p=pallet_asset,pallet_nft,pallet_settlement,pallet_sto,pallet_portfolio // -e=* // --heap-pages // 4096 @@ -76,11 +76,11 @@ impl pallet_nft::WeightInfo for SubstrateWeight { // Storage: `Nft::CollectionKeys` (r:0 w:1) // Proof: `Nft::CollectionKeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `n` is `[1, 255]`. - fn create_nft_collection(n: u32) -> Weight { - // Minimum execution time: 102_210 nanoseconds. - Weight::from_parts(108_138_113, 0) - // Standard Error: 3_544 - .saturating_add(Weight::from_parts(2_961_652, 0).saturating_mul(n.into())) + fn create_nft_collection(n: u32, ) -> Weight { + // Minimum execution time: 101_620 nanoseconds. + Weight::from_parts(107_601_170, 0) + // Standard Error: 2_947 + .saturating_add(Weight::from_parts(2_910_092, 0).saturating_mul(n.into())) .saturating_add(DbWeight::get().reads(11)) .saturating_add(DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(DbWeight::get().writes(12)) @@ -112,11 +112,11 @@ impl pallet_nft::WeightInfo for SubstrateWeight { // Storage: `Nft::Owner` (r:0 w:1) // Proof: `Nft::Owner` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 255]`. - fn issue_nft(n: u32) -> Weight { - // Minimum execution time: 74_050 nanoseconds. - Weight::from_parts(76_106_393, 0) - // Standard Error: 4_181 - .saturating_add(Weight::from_parts(3_127_982, 0).saturating_mul(n.into())) + fn issue_nft(n: u32, ) -> Weight { + // Minimum execution time: 78_109 nanoseconds. + Weight::from_parts(83_644_098, 0) + // Standard Error: 18_039 + .saturating_add(Weight::from_parts(7_078_221, 0).saturating_mul(n.into())) .saturating_add(DbWeight::get().reads(11)) .saturating_add(DbWeight::get().writes(6)) .saturating_add(DbWeight::get().writes((1_u64).saturating_mul(n.into()))) @@ -150,11 +150,11 @@ impl pallet_nft::WeightInfo for SubstrateWeight { // Storage: `Nft::Owner` (r:0 w:1) // Proof: `Nft::Owner` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 255]`. - fn redeem_nft(n: u32) -> Weight { - // Minimum execution time: 93_980 nanoseconds. - Weight::from_parts(96_980_705, 0) - // Standard Error: 3_089 - .saturating_add(Weight::from_parts(1_363_138, 0).saturating_mul(n.into())) + fn redeem_nft(n: u32, ) -> Weight { + // Minimum execution time: 94_390 nanoseconds. + Weight::from_parts(98_787_544, 0) + // Standard Error: 4_003 + .saturating_add(Weight::from_parts(1_423_867, 0).saturating_mul(n.into())) .saturating_add(DbWeight::get().reads(12)) .saturating_add(DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(DbWeight::get().writes(5)) @@ -181,11 +181,11 @@ impl pallet_nft::WeightInfo for SubstrateWeight { // Storage: `Nft::Owner` (r:0 w:10) // Proof: `Nft::Owner` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 10]`. - fn base_nft_transfer(n: u32) -> Weight { - // Minimum execution time: 555_080 nanoseconds. - Weight::from_parts(542_843_203, 0) - // Standard Error: 155_083 - .saturating_add(Weight::from_parts(41_777_467, 0).saturating_mul(n.into())) + fn base_nft_transfer(n: u32, ) -> Weight { + // Minimum execution time: 157_180 nanoseconds. + Weight::from_parts(121_716_478, 0) + // Standard Error: 81_056 + .saturating_add(Weight::from_parts(41_772_794, 0).saturating_mul(n.into())) .saturating_add(DbWeight::get().reads(9)) .saturating_add(DbWeight::get().reads((3_u64).saturating_mul(n.into()))) .saturating_add(DbWeight::get().writes(4)) @@ -216,11 +216,11 @@ impl pallet_nft::WeightInfo for SubstrateWeight { // Storage: `Nft::Owner` (r:0 w:10) // Proof: `Nft::Owner` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 10]`. - fn controller_transfer(n: u32) -> Weight { - // Minimum execution time: 123_380 nanoseconds. - Weight::from_parts(87_700_427, 0) - // Standard Error: 136_733 - .saturating_add(Weight::from_parts(41_130_218, 0).saturating_mul(n.into())) + fn controller_transfer(n: u32, ) -> Weight { + // Minimum execution time: 109_610 nanoseconds. + Weight::from_parts(73_589_148, 0) + // Standard Error: 79_859 + .saturating_add(Weight::from_parts(41_225_975, 0).saturating_mul(n.into())) .saturating_add(DbWeight::get().reads(11)) .saturating_add(DbWeight::get().reads((3_u64).saturating_mul(n.into()))) .saturating_add(DbWeight::get().writes(4)) @@ -257,11 +257,11 @@ impl pallet_nft::WeightInfo for SubstrateWeight { // Storage: `Nft::Owner` (r:0 w:10) // Proof: `Nft::Owner` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 10]`. - fn controller_transfer_to(n: u32) -> Weight { - // Minimum execution time: 124_529 nanoseconds. - Weight::from_parts(89_162_869, 0) - // Standard Error: 50_162 - .saturating_add(Weight::from_parts(41_568_019, 0).saturating_mul(n.into())) + fn controller_transfer_to(n: u32, ) -> Weight { + // Minimum execution time: 123_990 nanoseconds. + Weight::from_parts(88_993_075, 0) + // Standard Error: 46_776 + .saturating_add(Weight::from_parts(41_330_221, 0).saturating_mul(n.into())) .saturating_add(DbWeight::get().reads(14)) .saturating_add(DbWeight::get().reads((3_u64).saturating_mul(n.into()))) .saturating_add(DbWeight::get().writes(4)) @@ -274,8 +274,8 @@ impl pallet_nft::WeightInfo for SubstrateWeight { // Storage: `Nft::TokenApproval` (r:0 w:1) // Proof: `Nft::TokenApproval` (`max_values`: None, `max_size`: Some(88), added: 2563, mode: `MaxEncodedLen`) fn approve() -> Weight { - // Minimum execution time: 28_580 nanoseconds. - Weight::from_parts(30_969_000, 0) + // Minimum execution time: 27_980 nanoseconds. + Weight::from_parts(30_360_000, 0) .saturating_add(DbWeight::get().reads(2)) .saturating_add(DbWeight::get().writes(1)) } @@ -284,8 +284,8 @@ impl pallet_nft::WeightInfo for SubstrateWeight { // Storage: `Nft::OperatorApproval` (r:0 w:1) // Proof: `Nft::OperatorApproval` (`max_values`: None, `max_size`: Some(129), added: 2604, mode: `MaxEncodedLen`) fn set_approval_for_all() -> Weight { - // Minimum execution time: 21_240 nanoseconds. - Weight::from_parts(23_300_000, 0) + // Minimum execution time: 20_800 nanoseconds. + Weight::from_parts(22_960_000, 0) .saturating_add(DbWeight::get().reads(1)) .saturating_add(DbWeight::get().writes(1)) } @@ -294,11 +294,11 @@ impl pallet_nft::WeightInfo for SubstrateWeight { // Storage: `Nft::TokenApproval` (r:10 w:10) // Proof: `Nft::TokenApproval` (`max_values`: None, `max_size`: Some(88), added: 2563, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 10]`. - fn spend_nft_approval(n: u32) -> Weight { - // Minimum execution time: 19_920 nanoseconds. - Weight::from_parts(13_566_237, 0) - // Standard Error: 4_500 - .saturating_add(Weight::from_parts(8_509_915, 0).saturating_mul(n.into())) + fn spend_nft_approval(n: u32, ) -> Weight { + // Minimum execution time: 19_540 nanoseconds. + Weight::from_parts(13_507_302, 0) + // Standard Error: 4_245 + .saturating_add(Weight::from_parts(8_429_502, 0).saturating_mul(n.into())) .saturating_add(DbWeight::get().reads(1)) .saturating_add(DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(DbWeight::get().writes((1_u64).saturating_mul(n.into()))) @@ -320,8 +320,9 @@ impl pallet_nft::WeightInfo for SubstrateWeight { // Storage: `ComplianceManager::AssetCompliances` (r:1 w:0) // Proof: `ComplianceManager::AssetCompliances` (`max_values`: None, `max_size`: None, mode: `Measured`) fn nft_transfer_report_best_case() -> Weight { - // Minimum execution time: 474_860 nanoseconds. - Weight::from_parts(507_160_000, 0).saturating_add(DbWeight::get().reads(9)) + // Minimum execution time: 104_180 nanoseconds. + Weight::from_parts(107_960_000, 0) + .saturating_add(DbWeight::get().reads(9)) } // Storage: `Nft::CollectionAsset` (r:1 w:0) // Proof: `Nft::CollectionAsset` (`max_values`: None, `max_size`: Some(40), added: 2515, mode: `MaxEncodedLen`) @@ -344,7 +345,8 @@ impl pallet_nft::WeightInfo for SubstrateWeight { // Storage: `Identity::Claims` (r:50 w:0) // Proof: `Identity::Claims` (`max_values`: None, `max_size`: None, mode: `Measured`) fn nft_transfer_report_worst_case() -> Weight { - // Minimum execution time: 667_679 nanoseconds. - Weight::from_parts(699_919_000, 0).saturating_add(DbWeight::get().reads(60)) + // Minimum execution time: 285_700 nanoseconds. + Weight::from_parts(294_620_000, 0) + .saturating_add(DbWeight::get().reads(60)) } } diff --git a/pallets/weights/src/pallet_portfolio.rs b/pallets/weights/src/pallet_portfolio.rs index 3dd28d0d40..afe7dc1a36 100644 --- a/pallets/weights/src/pallet_portfolio.rs +++ b/pallets/weights/src/pallet_portfolio.rs @@ -4,7 +4,7 @@ //! Autogenerated weights for pallet_portfolio //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 54.0.0 -//! DATE: 2026-09-15, STEPS: `100`, REPEAT: 5, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2026-10-04, STEPS: `100`, REPEAT: 5, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 512 //! HOSTNAME: `ubuntu-8gb-hel1-bench`, CPU: `AMD EPYC-Milan Processor` @@ -16,7 +16,7 @@ // 100 // -r // 5 -// -p=pallet_asset,pallet_nft,pallet_settlement,pallet_portfolio +// -p=pallet_asset,pallet_nft,pallet_settlement,pallet_sto,pallet_portfolio // -e=* // --heap-pages // 4096 @@ -48,11 +48,11 @@ impl pallet_portfolio::WeightInfo for SubstrateWeight { // Storage: `Portfolio::Portfolios` (r:0 w:1) // Proof: `Portfolio::Portfolios` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `l` is `[1, 500]`. - fn create_portfolio(l: u32) -> Weight { - // Minimum execution time: 25_130 nanoseconds. - Weight::from_parts(28_263_159, 0) - // Standard Error: 120 - .saturating_add(Weight::from_parts(8_052, 0).saturating_mul(l.into())) + fn create_portfolio(l: u32, ) -> Weight { + // Minimum execution time: 24_160 nanoseconds. + Weight::from_parts(26_679_191, 0) + // Standard Error: 100 + .saturating_add(Weight::from_parts(7_701, 0).saturating_mul(l.into())) .saturating_add(DbWeight::get().reads(3)) .saturating_add(DbWeight::get().writes(3)) } @@ -71,8 +71,8 @@ impl pallet_portfolio::WeightInfo for SubstrateWeight { // Storage: `Portfolio::NameToNumber` (r:0 w:1) // Proof: `Portfolio::NameToNumber` (`max_values`: None, `max_size`: None, mode: `Measured`) fn delete_portfolio() -> Weight { - // Minimum execution time: 49_210 nanoseconds. - Weight::from_parts(53_960_000, 0) + // Minimum execution time: 46_820 nanoseconds. + Weight::from_parts(50_470_000, 0) .saturating_add(DbWeight::get().reads(5)) .saturating_add(DbWeight::get().writes(5)) } @@ -83,11 +83,11 @@ impl pallet_portfolio::WeightInfo for SubstrateWeight { // Storage: `Portfolio::NameToNumber` (r:1 w:2) // Proof: `Portfolio::NameToNumber` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `i` is `[1, 500]`. - fn rename_portfolio(i: u32) -> Weight { - // Minimum execution time: 31_320 nanoseconds. - Weight::from_parts(34_502_317, 0) - // Standard Error: 119 - .saturating_add(Weight::from_parts(15_327, 0).saturating_mul(i.into())) + fn rename_portfolio(i: u32, ) -> Weight { + // Minimum execution time: 29_860 nanoseconds. + Weight::from_parts(32_181_728, 0) + // Standard Error: 94 + .saturating_add(Weight::from_parts(16_501, 0).saturating_mul(i.into())) .saturating_add(DbWeight::get().reads(3)) .saturating_add(DbWeight::get().writes(3)) } @@ -98,8 +98,8 @@ impl pallet_portfolio::WeightInfo for SubstrateWeight { // Storage: `Portfolio::PortfoliosInCustody` (r:0 w:1) // Proof: `Portfolio::PortfoliosInCustody` (`max_values`: None, `max_size`: Some(82), added: 2557, mode: `MaxEncodedLen`) fn quit_portfolio_custody() -> Weight { - // Minimum execution time: 25_750 nanoseconds. - Weight::from_parts(28_590_000, 0) + // Minimum execution time: 24_590 nanoseconds. + Weight::from_parts(26_700_000, 0) .saturating_add(DbWeight::get().reads(2)) .saturating_add(DbWeight::get().writes(2)) } @@ -118,8 +118,8 @@ impl pallet_portfolio::WeightInfo for SubstrateWeight { // Storage: `Identity::AuthorizationsGiven` (r:0 w:1) // Proof: `Identity::AuthorizationsGiven` (`max_values`: None, `max_size`: Some(81), added: 2556, mode: `MaxEncodedLen`) fn accept_portfolio_custody() -> Weight { - // Minimum execution time: 46_170 nanoseconds. - Weight::from_parts(50_540_000, 0) + // Minimum execution time: 44_260 nanoseconds. + Weight::from_parts(47_530_000, 0) .saturating_add(DbWeight::get().reads(5)) .saturating_add(DbWeight::get().writes(6)) } @@ -153,13 +153,13 @@ impl pallet_portfolio::WeightInfo for SubstrateWeight { // Proof: `Nft::Owner` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) /// The range of component `f` is `[1, 10]`. /// The range of component `n` is `[1, 100]`. - fn move_portfolio_funds(f: u32, n: u32) -> Weight { - // Minimum execution time: 501_330 nanoseconds. - Weight::from_parts(52_375_573, 0) - // Standard Error: 681_129 - .saturating_add(Weight::from_parts(42_772_418, 0).saturating_mul(f.into())) - // Standard Error: 64_004 - .saturating_add(Weight::from_parts(41_765_025, 0).saturating_mul(n.into())) + fn move_portfolio_funds(f: u32, n: u32, ) -> Weight { + // Minimum execution time: 478_239 nanoseconds. + Weight::from_parts(483_309_000, 0) + // Standard Error: 633_700 + .saturating_add(Weight::from_parts(11_258_839, 0).saturating_mul(f.into())) + // Standard Error: 65_671 + .saturating_add(Weight::from_parts(36_055_332, 0).saturating_mul(n.into())) .saturating_add(DbWeight::get().reads(8)) .saturating_add(DbWeight::get().reads((7_u64).saturating_mul(f.into()))) .saturating_add(DbWeight::get().reads((3_u64).saturating_mul(n.into()))) @@ -176,8 +176,8 @@ impl pallet_portfolio::WeightInfo for SubstrateWeight { // Storage: `Portfolio::PreApprovedPortfolios` (r:0 w:1) // Proof: `Portfolio::PreApprovedPortfolios` (`max_values`: None, `max_size`: Some(82), added: 2557, mode: `MaxEncodedLen`) fn pre_approve_portfolio() -> Weight { - // Minimum execution time: 23_970 nanoseconds. - Weight::from_parts(26_580_000, 0) + // Minimum execution time: 22_750 nanoseconds. + Weight::from_parts(24_900_000, 0) .saturating_add(DbWeight::get().reads(3)) .saturating_add(DbWeight::get().writes(1)) } @@ -190,8 +190,8 @@ impl pallet_portfolio::WeightInfo for SubstrateWeight { // Storage: `Portfolio::PreApprovedPortfolios` (r:0 w:1) // Proof: `Portfolio::PreApprovedPortfolios` (`max_values`: None, `max_size`: Some(82), added: 2557, mode: `MaxEncodedLen`) fn remove_portfolio_pre_approval() -> Weight { - // Minimum execution time: 24_070 nanoseconds. - Weight::from_parts(26_750_000, 0) + // Minimum execution time: 22_890 nanoseconds. + Weight::from_parts(25_010_000, 0) .saturating_add(DbWeight::get().reads(3)) .saturating_add(DbWeight::get().writes(1)) } @@ -200,8 +200,8 @@ impl pallet_portfolio::WeightInfo for SubstrateWeight { // Storage: `Portfolio::AllowedCustodians` (r:0 w:1) // Proof: `Portfolio::AllowedCustodians` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) fn allow_identity_to_create_portfolios() -> Weight { - // Minimum execution time: 16_560 nanoseconds. - Weight::from_parts(19_040_000, 0) + // Minimum execution time: 15_980 nanoseconds. + Weight::from_parts(17_840_000, 0) .saturating_add(DbWeight::get().reads(1)) .saturating_add(DbWeight::get().writes(1)) } @@ -210,8 +210,8 @@ impl pallet_portfolio::WeightInfo for SubstrateWeight { // Storage: `Portfolio::AllowedCustodians` (r:0 w:1) // Proof: `Portfolio::AllowedCustodians` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) fn revoke_create_portfolios_permission() -> Weight { - // Minimum execution time: 16_440 nanoseconds. - Weight::from_parts(18_860_000, 0) + // Minimum execution time: 15_620 nanoseconds. + Weight::from_parts(17_760_000, 0) .saturating_add(DbWeight::get().reads(1)) .saturating_add(DbWeight::get().writes(1)) } @@ -230,8 +230,8 @@ impl pallet_portfolio::WeightInfo for SubstrateWeight { // Storage: `Portfolio::Portfolios` (r:0 w:1) // Proof: `Portfolio::Portfolios` (`max_values`: None, `max_size`: None, mode: `Measured`) fn create_custody_portfolio() -> Weight { - // Minimum execution time: 38_410 nanoseconds. - Weight::from_parts(42_190_000, 0) + // Minimum execution time: 36_739 nanoseconds. + Weight::from_parts(39_440_000, 0) .saturating_add(DbWeight::get().reads(4)) .saturating_add(DbWeight::get().writes(5)) } diff --git a/pallets/weights/src/pallet_settlement.rs b/pallets/weights/src/pallet_settlement.rs index 97d1c9c89e..a410961b01 100644 --- a/pallets/weights/src/pallet_settlement.rs +++ b/pallets/weights/src/pallet_settlement.rs @@ -4,7 +4,7 @@ //! Autogenerated weights for pallet_settlement //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 54.0.0 -//! DATE: 2026-09-26, STEPS: `100`, REPEAT: 5, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2026-10-04, STEPS: `100`, REPEAT: 5, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 512 //! HOSTNAME: `ubuntu-8gb-hel1-bench`, CPU: `AMD EPYC-Milan Processor` @@ -16,7 +16,7 @@ // 100 // -r // 5 -// -p=pallet_asset,pallet_nft,pallet_settlement,pallet_sto,pallet_compliance +// -p=pallet_asset,pallet_nft,pallet_settlement,pallet_sto,pallet_portfolio // -e=* // --heap-pages // 4096 @@ -55,13 +55,13 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Proof: `Settlement::UserVenues` (`max_values`: None, `max_size`: Some(56), added: 2531, mode: `MaxEncodedLen`) /// The range of component `d` is `[1, 2048]`. /// The range of component `s` is `[0, 50]`. - fn create_venue(d: u32, s: u32) -> Weight { - // Minimum execution time: 29_810 nanoseconds. - Weight::from_parts(37_400_699, 0) - // Standard Error: 305 - .saturating_add(Weight::from_parts(374, 0).saturating_mul(d.into())) - // Standard Error: 12_853 - .saturating_add(Weight::from_parts(2_253_716, 0).saturating_mul(s.into())) + fn create_venue(d: u32, s: u32, ) -> Weight { + // Minimum execution time: 29_970 nanoseconds. + Weight::from_parts(34_354_141, 0) + // Standard Error: 310 + .saturating_add(Weight::from_parts(1_394, 0).saturating_mul(d.into())) + // Standard Error: 13_087 + .saturating_add(Weight::from_parts(2_363_906, 0).saturating_mul(s.into())) .saturating_add(DbWeight::get().reads(2)) .saturating_add(DbWeight::get().writes(5)) .saturating_add(DbWeight::get().writes((1_u64).saturating_mul(s.into()))) @@ -73,11 +73,11 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Storage: `Settlement::Details` (r:0 w:1) // Proof: `Settlement::Details` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `d` is `[1, 2048]`. - fn update_venue_details(d: u32) -> Weight { - // Minimum execution time: 23_520 nanoseconds. - Weight::from_parts(26_327_138, 0) - // Standard Error: 20 - .saturating_add(Weight::from_parts(1_045, 0).saturating_mul(d.into())) + fn update_venue_details(d: u32, ) -> Weight { + // Minimum execution time: 23_300 nanoseconds. + Weight::from_parts(26_243_027, 0) + // Standard Error: 24 + .saturating_add(Weight::from_parts(930, 0).saturating_mul(d.into())) .saturating_add(DbWeight::get().reads(2)) .saturating_add(DbWeight::get().writes(1)) } @@ -86,8 +86,8 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Storage: `Settlement::VenueInfo` (r:1 w:1) // Proof: `Settlement::VenueInfo` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) fn update_venue_type() -> Weight { - // Minimum execution time: 22_610 nanoseconds. - Weight::from_parts(24_920_000, 0) + // Minimum execution time: 22_360 nanoseconds. + Weight::from_parts(24_760_000, 0) .saturating_add(DbWeight::get().reads(2)) .saturating_add(DbWeight::get().writes(1)) } @@ -100,11 +100,11 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Storage: `Settlement::VenueSigners` (r:49 w:49) // Proof: `Settlement::VenueSigners` (`max_values`: None, `max_size`: Some(57), added: 2532, mode: `MaxEncodedLen`) /// The range of component `s` is `[0, 50]`. - fn update_venue_signers(s: u32) -> Weight { - // Minimum execution time: 24_630 nanoseconds. - Weight::from_parts(33_791_513, 0) - // Standard Error: 7_427 - .saturating_add(Weight::from_parts(4_883_442, 0).saturating_mul(s.into())) + fn update_venue_signers(s: u32, ) -> Weight { + // Minimum execution time: 24_990 nanoseconds. + Weight::from_parts(32_953_301, 0) + // Standard Error: 7_977 + .saturating_add(Weight::from_parts(4_999_213, 0).saturating_mul(s.into())) .saturating_add(DbWeight::get().reads(3)) .saturating_add(DbWeight::get().reads((1_u64).saturating_mul(s.into()))) .saturating_add(DbWeight::get().writes(1)) @@ -121,8 +121,8 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Storage: `Settlement::VenueFiltering` (r:0 w:1) // Proof: `Settlement::VenueFiltering` (`max_values`: None, `max_size`: Some(33), added: 2508, mode: `MaxEncodedLen`) fn set_venue_filtering() -> Weight { - // Minimum execution time: 26_970 nanoseconds. - Weight::from_parts(29_390_000, 0) + // Minimum execution time: 27_220 nanoseconds. + Weight::from_parts(29_670_000, 0) .saturating_add(DbWeight::get().reads(4)) .saturating_add(DbWeight::get().writes(1)) } @@ -139,11 +139,11 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Storage: `Settlement::VenueAllowList` (r:0 w:99) // Proof: `Settlement::VenueAllowList` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) /// The range of component `v` is `[0, 100]`. - fn allow_venues(v: u32) -> Weight { - // Minimum execution time: 31_050 nanoseconds. - Weight::from_parts(32_409_719, 0) - // Standard Error: 1_983 - .saturating_add(Weight::from_parts(2_333_511, 0).saturating_mul(v.into())) + fn allow_venues(v: u32, ) -> Weight { + // Minimum execution time: 31_170 nanoseconds. + Weight::from_parts(31_484_036, 0) + // Standard Error: 1_958 + .saturating_add(Weight::from_parts(2_449_800, 0).saturating_mul(v.into())) .saturating_add(DbWeight::get().reads(5)) .saturating_add(DbWeight::get().writes((1_u64).saturating_mul(v.into()))) } @@ -160,11 +160,11 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Storage: `Settlement::VenueAllowList` (r:0 w:99) // Proof: `Settlement::VenueAllowList` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) /// The range of component `v` is `[0, 100]`. - fn disallow_venues(v: u32) -> Weight { - // Minimum execution time: 31_000 nanoseconds. - Weight::from_parts(33_103_663, 0) - // Standard Error: 1_752 - .saturating_add(Weight::from_parts(2_196_318, 0).saturating_mul(v.into())) + fn disallow_venues(v: u32, ) -> Weight { + // Minimum execution time: 31_370 nanoseconds. + Weight::from_parts(32_137_814, 0) + // Standard Error: 1_621 + .saturating_add(Weight::from_parts(2_326_059, 0).saturating_mul(v.into())) .saturating_add(DbWeight::get().reads(5)) .saturating_add(DbWeight::get().writes((1_u64).saturating_mul(v.into()))) } @@ -213,15 +213,15 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { /// The range of component `f` is `[1, 10]`. /// The range of component `n` is `[0, 100]`. /// The range of component `o` is `[0, 10]`. - fn affirm_with_receipts(f: u32, n: u32, o: u32) -> Weight { - // Minimum execution time: 1_237_348 nanoseconds. - Weight::from_parts(172_033_413, 0) - // Standard Error: 565_455 - .saturating_add(Weight::from_parts(36_751_417, 0).saturating_mul(f.into())) - // Standard Error: 52_306 - .saturating_add(Weight::from_parts(38_550_050, 0).saturating_mul(n.into())) - // Standard Error: 512_215 - .saturating_add(Weight::from_parts(72_544_320, 0).saturating_mul(o.into())) + fn affirm_with_receipts(f: u32, n: u32, o: u32, ) -> Weight { + // Minimum execution time: 1_242_878 nanoseconds. + Weight::from_parts(30_424_373, 0) + // Standard Error: 535_385 + .saturating_add(Weight::from_parts(47_686_809, 0).saturating_mul(f.into())) + // Standard Error: 49_524 + .saturating_add(Weight::from_parts(38_198_180, 0).saturating_mul(n.into())) + // Standard Error: 484_976 + .saturating_add(Weight::from_parts(78_434_584, 0).saturating_mul(o.into())) .saturating_add(DbWeight::get().reads(7)) .saturating_add(DbWeight::get().reads((8_u64).saturating_mul(f.into()))) .saturating_add(DbWeight::get().reads((6_u64).saturating_mul(n.into()))) @@ -281,7 +281,7 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Proof: `Identity::DidRecords` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) // Storage: `Statistics::AssetTransferCompliances` (r:10 w:0) // Proof: `Statistics::AssetTransferCompliances` (`max_values`: None, `max_size`: Some(2896), added: 5371, mode: `MaxEncodedLen`) - // Storage: `Identity::Claims` (r:250 w:0) + // Storage: `Identity::Claims` (r:5700 w:0) // Proof: `Identity::Claims` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `Statistics::AssetStats` (r:140 w:100) // Proof: `Statistics::AssetStats` (`max_values`: None, `max_size`: Some(107), added: 2582, mode: `MaxEncodedLen`) @@ -316,16 +316,16 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { /// The range of component `f` is `[0, 10]`. /// The range of component `n` is `[0, 100]`. /// The range of component `o` is `[0, 10]`. - fn execute_manual_instruction(f: u32, n: u32, o: u32) -> Weight { - // Minimum execution time: 9_641_174 nanoseconds. - Weight::from_parts(376_452_040, 0) - // Standard Error: 4_261_584 - .saturating_add(Weight::from_parts(935_425_758, 0).saturating_mul(f.into())) - // Standard Error: 435_226 - .saturating_add(Weight::from_parts(748_459_672, 0).saturating_mul(n.into())) - .saturating_add(DbWeight::get().reads(64)) - .saturating_add(DbWeight::get().reads((61_u64).saturating_mul(f.into()))) - .saturating_add(DbWeight::get().reads((22_u64).saturating_mul(n.into()))) + fn execute_manual_instruction(f: u32, n: u32, o: u32, ) -> Weight { + // Minimum execution time: 6_248_173 nanoseconds. + Weight::from_parts(6_250_543_000, 0) + // Standard Error: 7_262_425 + .saturating_add(Weight::from_parts(369_162_262, 0).saturating_mul(f.into())) + // Standard Error: 729_139 + .saturating_add(Weight::from_parts(410_392_191, 0).saturating_mul(n.into())) + .saturating_add(DbWeight::get().reads(14)) + .saturating_add(DbWeight::get().reads((111_u64).saturating_mul(f.into()))) + .saturating_add(DbWeight::get().reads((72_u64).saturating_mul(n.into()))) .saturating_add(DbWeight::get().reads((3_u64).saturating_mul(o.into()))) .saturating_add(DbWeight::get().writes(11)) .saturating_add(DbWeight::get().writes((26_u64).saturating_mul(f.into()))) @@ -385,13 +385,15 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { /// The range of component `f` is `[1, 10]`. /// The range of component `n` is `[0, 100]`. /// The range of component `o` is `[0, 10]`. - fn add_instruction(f: u32, n: u32, o: u32) -> Weight { - // Minimum execution time: 672_638 nanoseconds. - Weight::from_parts(686_988_000, 0) - // Standard Error: 840_002 - .saturating_add(Weight::from_parts(28_405_880, 0).saturating_mul(f.into())) - // Standard Error: 81_108 - .saturating_add(Weight::from_parts(51_366_575, 0).saturating_mul(n.into())) + fn add_instruction(f: u32, n: u32, o: u32, ) -> Weight { + // Minimum execution time: 672_040 nanoseconds. + Weight::from_parts(188_032_294, 0) + // Standard Error: 734_788 + .saturating_add(Weight::from_parts(47_503_257, 0).saturating_mul(f.into())) + // Standard Error: 67_969 + .saturating_add(Weight::from_parts(54_783_698, 0).saturating_mul(n.into())) + // Standard Error: 665_604 + .saturating_add(Weight::from_parts(3_328_867, 0).saturating_mul(o.into())) .saturating_add(DbWeight::get().reads(9)) .saturating_add(DbWeight::get().reads((9_u64).saturating_mul(f.into()))) .saturating_add(DbWeight::get().reads((9_u64).saturating_mul(n.into()))) @@ -469,15 +471,15 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { /// The range of component `f` is `[1, 10]`. /// The range of component `n` is `[0, 100]`. /// The range of component `o` is `[0, 10]`. - fn add_and_affirm_instruction(f: u32, n: u32, o: u32) -> Weight { - // Minimum execution time: 1_134_478 nanoseconds. - Weight::from_parts(251_451_199, 0) - // Standard Error: 1_445_395 - .saturating_add(Weight::from_parts(80_929_234, 0).saturating_mul(f.into())) - // Standard Error: 133_702 - .saturating_add(Weight::from_parts(87_170_515, 0).saturating_mul(n.into())) - // Standard Error: 1_309_305 - .saturating_add(Weight::from_parts(11_494_951, 0).saturating_mul(o.into())) + fn add_and_affirm_instruction(f: u32, n: u32, o: u32, ) -> Weight { + // Minimum execution time: 1_123_609 nanoseconds. + Weight::from_parts(82_249_526, 0) + // Standard Error: 895_045 + .saturating_add(Weight::from_parts(96_020_666, 0).saturating_mul(f.into())) + // Standard Error: 82_794 + .saturating_add(Weight::from_parts(88_876_304, 0).saturating_mul(n.into())) + // Standard Error: 810_772 + .saturating_add(Weight::from_parts(8_906_139, 0).saturating_mul(o.into())) .saturating_add(DbWeight::get().reads(10)) .saturating_add(DbWeight::get().reads((15_u64).saturating_mul(f.into()))) .saturating_add(DbWeight::get().reads((14_u64).saturating_mul(n.into()))) @@ -521,13 +523,13 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Proof: `Settlement::InstructionLegStatus` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) /// The range of component `f` is `[1, 10]`. /// The range of component `n` is `[1, 100]`. - fn affirm_instruction(f: u32, n: u32) -> Weight { - // Minimum execution time: 608_870 nanoseconds. - Weight::from_parts(167_146_611, 0) - // Standard Error: 780_689 - .saturating_add(Weight::from_parts(45_583_885, 0).saturating_mul(f.into())) - // Standard Error: 73_359 - .saturating_add(Weight::from_parts(38_591_128, 0).saturating_mul(n.into())) + fn affirm_instruction(f: u32, n: u32, ) -> Weight { + // Minimum execution time: 619_349 nanoseconds. + Weight::from_parts(124_190_954, 0) + // Standard Error: 690_260 + .saturating_add(Weight::from_parts(47_790_966, 0).saturating_mul(f.into())) + // Standard Error: 64_862 + .saturating_add(Weight::from_parts(38_606_631, 0).saturating_mul(n.into())) .saturating_add(DbWeight::get().reads(15)) .saturating_add(DbWeight::get().reads((8_u64).saturating_mul(f.into()))) .saturating_add(DbWeight::get().reads((6_u64).saturating_mul(n.into()))) @@ -612,13 +614,13 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { /// The range of component `f` is `[1, 10]`. /// The range of component `n` is `[0, 100]`. /// The range of component `o` is `[0, 10]`. - fn execute_instruction_paused(f: u32, n: u32, o: u32) -> Weight { - // Minimum execution time: 6_167_067 nanoseconds. - Weight::from_parts(6_185_147_000, 0) - // Standard Error: 6_973_510 - .saturating_add(Weight::from_parts(376_745_972, 0).saturating_mul(f.into())) - // Standard Error: 673_340 - .saturating_add(Weight::from_parts(553_520_777, 0).saturating_mul(n.into())) + fn execute_instruction_paused(f: u32, n: u32, o: u32, ) -> Weight { + // Minimum execution time: 2_593_896 nanoseconds. + Weight::from_parts(2_623_127_000, 0) + // Standard Error: 4_441_760 + .saturating_add(Weight::from_parts(116_696_528, 0).saturating_mul(f.into())) + // Standard Error: 428_882 + .saturating_add(Weight::from_parts(219_009_206, 0).saturating_mul(n.into())) .saturating_add(DbWeight::get().reads(12)) .saturating_add(DbWeight::get().reads((27_u64).saturating_mul(f.into()))) .saturating_add(DbWeight::get().reads((22_u64).saturating_mul(n.into()))) @@ -674,7 +676,7 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Proof: `Identity::DidRecords` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) // Storage: `Statistics::AssetTransferCompliances` (r:10 w:0) // Proof: `Statistics::AssetTransferCompliances` (`max_values`: None, `max_size`: Some(2896), added: 5371, mode: `MaxEncodedLen`) - // Storage: `Identity::Claims` (r:250 w:0) + // Storage: `Identity::Claims` (r:5700 w:0) // Proof: `Identity::Claims` (`max_values`: None, `max_size`: None, mode: `Measured`) // Storage: `Statistics::AssetStats` (r:140 w:100) // Proof: `Statistics::AssetStats` (`max_values`: None, `max_size`: Some(107), added: 2582, mode: `MaxEncodedLen`) @@ -709,16 +711,16 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { /// The range of component `f` is `[1, 10]`. /// The range of component `n` is `[0, 100]`. /// The range of component `o` is `[0, 10]`. - fn execute_scheduled_instruction(f: u32, n: u32, o: u32) -> Weight { - // Minimum execution time: 9_639_871 nanoseconds. - Weight::from_parts(9_751_121_000, 0) - // Standard Error: 16_211_825 - .saturating_add(Weight::from_parts(456_170_052, 0).saturating_mul(f.into())) - // Standard Error: 1_565_363 - .saturating_add(Weight::from_parts(714_375_105, 0).saturating_mul(n.into())) - .saturating_add(DbWeight::get().reads(62)) - .saturating_add(DbWeight::get().reads((61_u64).saturating_mul(f.into()))) - .saturating_add(DbWeight::get().reads((22_u64).saturating_mul(n.into()))) + fn execute_scheduled_instruction(f: u32, n: u32, o: u32, ) -> Weight { + // Minimum execution time: 6_362_873 nanoseconds. + Weight::from_parts(6_411_993_000, 0) + // Standard Error: 7_320_943 + .saturating_add(Weight::from_parts(308_159_589, 0).saturating_mul(f.into())) + // Standard Error: 706_887 + .saturating_add(Weight::from_parts(410_550_055, 0).saturating_mul(n.into())) + .saturating_add(DbWeight::get().reads(12)) + .saturating_add(DbWeight::get().reads((111_u64).saturating_mul(f.into()))) + .saturating_add(DbWeight::get().reads((72_u64).saturating_mul(n.into()))) .saturating_add(DbWeight::get().reads((3_u64).saturating_mul(o.into()))) .saturating_add(DbWeight::get().writes(11)) .saturating_add(DbWeight::get().writes((26_u64).saturating_mul(f.into()))) @@ -727,7 +729,7 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { } fn ensure_root_origin() -> Weight { // Minimum execution time: 440 nanoseconds. - Weight::from_parts(550_000, 0) + Weight::from_parts(560_000, 0) } // Storage: `Identity::KeyRecords` (r:1 w:0) // Proof: `Identity::KeyRecords` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) @@ -760,15 +762,15 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { /// The range of component `f` is `[1, 10]`. /// The range of component `n` is `[0, 100]`. /// The range of component `o` is `[0, 10]`. - fn affirm_with_receipts_rcv(f: u32, n: u32, o: u32) -> Weight { - // Minimum execution time: 984_829 nanoseconds. - Weight::from_parts(66_549_297, 0) - // Standard Error: 470_348 - .saturating_add(Weight::from_parts(22_519_604, 0).saturating_mul(f.into())) - // Standard Error: 43_508 - .saturating_add(Weight::from_parts(20_289_333, 0).saturating_mul(n.into())) - // Standard Error: 426_063 - .saturating_add(Weight::from_parts(71_129_568, 0).saturating_mul(o.into())) + fn affirm_with_receipts_rcv(f: u32, n: u32, o: u32, ) -> Weight { + // Minimum execution time: 1_009_779 nanoseconds. + Weight::from_parts(88_370_689, 0) + // Standard Error: 355_310 + .saturating_add(Weight::from_parts(18_563_194, 0).saturating_mul(f.into())) + // Standard Error: 32_867 + .saturating_add(Weight::from_parts(19_770_304, 0).saturating_mul(n.into())) + // Standard Error: 321_856 + .saturating_add(Weight::from_parts(74_735_674, 0).saturating_mul(o.into())) .saturating_add(DbWeight::get().reads(7)) .saturating_add(DbWeight::get().reads((3_u64).saturating_mul(f.into()))) .saturating_add(DbWeight::get().reads((3_u64).saturating_mul(n.into()))) @@ -796,13 +798,13 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Proof: `Settlement::AffirmsReceived` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `MaxEncodedLen`) /// The range of component `f` is `[1, 10]`. /// The range of component `n` is `[1, 100]`. - fn affirm_instruction_rcv(f: u32, n: u32) -> Weight { - // Minimum execution time: 345_769 nanoseconds. - Weight::from_parts(227_430_445, 0) - // Standard Error: 385_947 - .saturating_add(Weight::from_parts(12_843_695, 0).saturating_mul(f.into())) - // Standard Error: 36_266 - .saturating_add(Weight::from_parts(19_616_686, 0).saturating_mul(n.into())) + fn affirm_instruction_rcv(f: u32, n: u32, ) -> Weight { + // Minimum execution time: 324_330 nanoseconds. + Weight::from_parts(152_371_434, 0) + // Standard Error: 287_537 + .saturating_add(Weight::from_parts(18_264_392, 0).saturating_mul(f.into())) + // Standard Error: 27_019 + .saturating_add(Weight::from_parts(19_279_110, 0).saturating_mul(n.into())) .saturating_add(DbWeight::get().reads(15)) .saturating_add(DbWeight::get().reads((3_u64).saturating_mul(f.into()))) .saturating_add(DbWeight::get().reads((3_u64).saturating_mul(n.into()))) @@ -821,8 +823,8 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Storage: `Settlement::AffirmsReceived` (r:0 w:1) // Proof: `Settlement::AffirmsReceived` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `MaxEncodedLen`) fn unsafe_affirm_instruction_receiver_portfolio() -> Weight { - // Minimum execution time: 37_500 nanoseconds. - Weight::from_parts(40_290_000, 0) + // Minimum execution time: 37_730 nanoseconds. + Weight::from_parts(40_370_000, 0) .saturating_add(DbWeight::get().reads(5)) .saturating_add(DbWeight::get().writes(3)) } @@ -837,16 +839,17 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Storage: `Settlement::AffirmsReceived` (r:0 w:1) // Proof: `Settlement::AffirmsReceived` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `MaxEncodedLen`) fn unsafe_affirm_instruction_receiver_account() -> Weight { - // Minimum execution time: 39_050 nanoseconds. - Weight::from_parts(42_060_000, 0) + // Minimum execution time: 38_820 nanoseconds. + Weight::from_parts(41_750_000, 0) .saturating_add(DbWeight::get().reads(5)) .saturating_add(DbWeight::get().writes(3)) } // Storage: `Settlement::InstructionMemos` (r:0 w:1) // Proof: `Settlement::InstructionMemos` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`) fn set_instruction_memo() -> Weight { - // Minimum execution time: 1_750 nanoseconds. - Weight::from_parts(2_180_000, 0).saturating_add(DbWeight::get().writes(1)) + // Minimum execution time: 1_760 nanoseconds. + Weight::from_parts(2_150_000, 0) + .saturating_add(DbWeight::get().writes(1)) } // Storage: `Identity::KeyRecords` (r:1 w:0) // Proof: `Identity::KeyRecords` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) @@ -902,17 +905,17 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { /// The range of component `n` is `[0, 100]`. /// The range of component `o` is `[0, 10]`. /// The range of component `m` is `[0, 4]`. - fn add_instruction_with_mediators(f: u32, n: u32, o: u32, m: u32) -> Weight { - // Minimum execution time: 701_730 nanoseconds. - Weight::from_parts(103_774_708, 0) - // Standard Error: 882_699 - .saturating_add(Weight::from_parts(53_485_101, 0).saturating_mul(f.into())) - // Standard Error: 81_454 - .saturating_add(Weight::from_parts(53_349_190, 0).saturating_mul(n.into())) - // Standard Error: 799_850 - .saturating_add(Weight::from_parts(6_220_505, 0).saturating_mul(o.into())) - // Standard Error: 1_852_154 - .saturating_add(Weight::from_parts(5_371_892, 0).saturating_mul(m.into())) + fn add_instruction_with_mediators(f: u32, n: u32, o: u32, m: u32, ) -> Weight { + // Minimum execution time: 675_400 nanoseconds. + Weight::from_parts(136_906_637, 0) + // Standard Error: 654_426 + .saturating_add(Weight::from_parts(50_907_295, 0).saturating_mul(f.into())) + // Standard Error: 60_390 + .saturating_add(Weight::from_parts(53_416_327, 0).saturating_mul(n.into())) + // Standard Error: 593_002 + .saturating_add(Weight::from_parts(3_799_861, 0).saturating_mul(o.into())) + // Standard Error: 1_373_173 + .saturating_add(Weight::from_parts(2_667_109, 0).saturating_mul(m.into())) .saturating_add(DbWeight::get().reads(9)) .saturating_add(DbWeight::get().reads((9_u64).saturating_mul(f.into()))) .saturating_add(DbWeight::get().reads((9_u64).saturating_mul(n.into()))) @@ -992,17 +995,15 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { /// The range of component `n` is `[0, 100]`. /// The range of component `o` is `[0, 10]`. /// The range of component `m` is `[0, 4]`. - fn add_and_affirm_with_mediators(f: u32, n: u32, o: u32, m: u32) -> Weight { - // Minimum execution time: 1_168_788 nanoseconds. - Weight::from_parts(140_563_016, 0) - // Standard Error: 1_115_504 - .saturating_add(Weight::from_parts(94_852_802, 0).saturating_mul(f.into())) - // Standard Error: 102_937 - .saturating_add(Weight::from_parts(86_487_570, 0).saturating_mul(n.into())) - // Standard Error: 1_010_803 - .saturating_add(Weight::from_parts(3_492_285, 0).saturating_mul(o.into())) - // Standard Error: 2_340_644 - .saturating_add(Weight::from_parts(22_286_457, 0).saturating_mul(m.into())) + fn add_and_affirm_with_mediators(f: u32, n: u32, o: u32, m: u32, ) -> Weight { + // Minimum execution time: 1_134_939 nanoseconds. + Weight::from_parts(52_754_445, 0) + // Standard Error: 931_837 + .saturating_add(Weight::from_parts(97_422_609, 0).saturating_mul(f.into())) + // Standard Error: 85_989 + .saturating_add(Weight::from_parts(86_921_381, 0).saturating_mul(n.into())) + // Standard Error: 844_375 + .saturating_add(Weight::from_parts(10_435_923, 0).saturating_mul(o.into())) .saturating_add(DbWeight::get().reads(10)) .saturating_add(DbWeight::get().reads((15_u64).saturating_mul(f.into()))) .saturating_add(DbWeight::get().reads((14_u64).saturating_mul(n.into()))) @@ -1024,8 +1025,8 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Storage: `Settlement::InstructionAffirmsPending` (r:1 w:1) // Proof: `Settlement::InstructionAffirmsPending` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`) fn affirm_instruction_as_mediator() -> Weight { - // Minimum execution time: 90_190 nanoseconds. - Weight::from_parts(92_210_000, 0) + // Minimum execution time: 73_260 nanoseconds. + Weight::from_parts(76_560_000, 0) .saturating_add(DbWeight::get().reads(5)) .saturating_add(DbWeight::get().writes(2)) } @@ -1068,15 +1069,15 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { /// The range of component `f` is `[0, 10]`. /// The range of component `n` is `[0, 100]`. /// The range of component `o` is `[0, 10]`. - fn base_reject_instruction(f: u32, n: u32, o: u32) -> Weight { - // Minimum execution time: 558_259 nanoseconds. - Weight::from_parts(113_045_516, 0) - // Standard Error: 358_560 - .saturating_add(Weight::from_parts(34_914_309, 0).saturating_mul(f.into())) - // Standard Error: 36_618 - .saturating_add(Weight::from_parts(33_037_493, 0).saturating_mul(n.into())) - // Standard Error: 358_560 - .saturating_add(Weight::from_parts(12_979_163, 0).saturating_mul(o.into())) + fn base_reject_instruction(f: u32, n: u32, o: u32, ) -> Weight { + // Minimum execution time: 535_009 nanoseconds. + Weight::from_parts(122_842_893, 0) + // Standard Error: 384_088 + .saturating_add(Weight::from_parts(33_273_122, 0).saturating_mul(f.into())) + // Standard Error: 39_226 + .saturating_add(Weight::from_parts(32_307_000, 0).saturating_mul(n.into())) + // Standard Error: 384_088 + .saturating_add(Weight::from_parts(10_001_795, 0).saturating_mul(o.into())) .saturating_add(DbWeight::get().reads(10)) .saturating_add(DbWeight::get().reads((7_u64).saturating_mul(f.into()))) .saturating_add(DbWeight::get().reads((7_u64).saturating_mul(n.into()))) @@ -1159,13 +1160,13 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { /// The range of component `f` is `[0, 10]`. /// The range of component `n` is `[0, 100]`. /// The range of component `o` is `[0, 10]`. - fn lock_instruction_extrinsic(f: u32, n: u32, o: u32) -> Weight { - // Minimum execution time: 5_838_332 nanoseconds. - Weight::from_parts(5_854_142_000, 0) - // Standard Error: 6_211_700 - .saturating_add(Weight::from_parts(358_315_797, 0).saturating_mul(f.into())) - // Standard Error: 623_647 - .saturating_add(Weight::from_parts(529_733_963, 0).saturating_mul(n.into())) + fn lock_instruction_extrinsic(f: u32, n: u32, o: u32, ) -> Weight { + // Minimum execution time: 2_251_757 nanoseconds. + Weight::from_parts(149_167_170, 0) + // Standard Error: 2_151_705 + .saturating_add(Weight::from_parts(207_959_193, 0).saturating_mul(f.into())) + // Standard Error: 219_748 + .saturating_add(Weight::from_parts(201_512_302, 0).saturating_mul(n.into())) .saturating_add(DbWeight::get().reads(14)) .saturating_add(DbWeight::get().reads((27_u64).saturating_mul(f.into()))) .saturating_add(DbWeight::get().reads((22_u64).saturating_mul(n.into()))) @@ -1245,13 +1246,13 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { /// The range of component `f` is `[0, 10]`. /// The range of component `n` is `[0, 100]`. /// The range of component `o` is `[0, 10]`. - fn execute_locked_instruction(f: u32, n: u32, o: u32) -> Weight { - // Minimum execution time: 3_122_767 nanoseconds. - Weight::from_parts(3_126_948_000, 0) - // Standard Error: 3_326_089 - .saturating_add(Weight::from_parts(180_158_439, 0).saturating_mul(f.into())) - // Standard Error: 333_935 - .saturating_add(Weight::from_parts(95_145_148, 0).saturating_mul(n.into())) + fn execute_locked_instruction(f: u32, n: u32, o: u32, ) -> Weight { + // Minimum execution time: 3_251_048 nanoseconds. + Weight::from_parts(3_256_748_000, 0) + // Standard Error: 3_274_743 + .saturating_add(Weight::from_parts(182_420_823, 0).saturating_mul(f.into())) + // Standard Error: 328_780 + .saturating_add(Weight::from_parts(96_017_404, 0).saturating_mul(n.into())) .saturating_add(DbWeight::get().reads(11)) .saturating_add(DbWeight::get().reads((54_u64).saturating_mul(f.into()))) .saturating_add(DbWeight::get().reads((15_u64).saturating_mul(n.into()))) @@ -1342,13 +1343,13 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { /// The range of component `f` is `[0, 10]`. /// The range of component `n` is `[0, 100]`. /// The range of component `o` is `[0, 10]`. - fn execute_manual_instruction_paused(f: u32, n: u32, o: u32) -> Weight { - // Minimum execution time: 6_217_389 nanoseconds. - Weight::from_parts(485_124_389, 0) - // Standard Error: 4_471_052 - .saturating_add(Weight::from_parts(590_169_565, 0).saturating_mul(f.into())) - // Standard Error: 456_618 - .saturating_add(Weight::from_parts(587_400_720, 0).saturating_mul(n.into())) + fn execute_manual_instruction_paused(f: u32, n: u32, o: u32, ) -> Weight { + // Minimum execution time: 2_920_188 nanoseconds. + Weight::from_parts(769_905_508, 0) + // Standard Error: 7_119_553 + .saturating_add(Weight::from_parts(218_248_095, 0).saturating_mul(f.into())) + // Standard Error: 727_104 + .saturating_add(Weight::from_parts(258_042_823, 0).saturating_mul(n.into())) .saturating_add(DbWeight::get().reads(14)) .saturating_add(DbWeight::get().reads((27_u64).saturating_mul(f.into()))) .saturating_add(DbWeight::get().reads((22_u64).saturating_mul(n.into()))) @@ -1363,8 +1364,8 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Storage: `Settlement::MandatoryReceiverAffirmation` (r:0 w:1) // Proof: `Settlement::MandatoryReceiverAffirmation` (`max_values`: None, `max_size`: Some(33), added: 2508, mode: `MaxEncodedLen`) fn set_mandatory_receiver_affirmation() -> Weight { - // Minimum execution time: 15_770 nanoseconds. - Weight::from_parts(17_960_000, 0) + // Minimum execution time: 15_849 nanoseconds. + Weight::from_parts(18_030_000, 0) .saturating_add(DbWeight::get().reads(1)) .saturating_add(DbWeight::get().writes(1)) } @@ -1387,8 +1388,8 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Storage: `Portfolio::PortfolioAssetCount` (r:1 w:1) // Proof: `Portfolio::PortfolioAssetCount` (`max_values`: None, `max_size`: Some(57), added: 2532, mode: `MaxEncodedLen`) fn transfer_funds_portfolio_same_did() -> Weight { - // Minimum execution time: 84_220 nanoseconds. - Weight::from_parts(88_540_000, 0) + // Minimum execution time: 76_450 nanoseconds. + Weight::from_parts(80_430_000, 0) .saturating_add(DbWeight::get().reads(10)) .saturating_add(DbWeight::get().writes(3)) } @@ -1441,8 +1442,8 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Storage: `Settlement::InstructionLegStatus` (r:0 w:1) // Proof: `Settlement::InstructionLegStatus` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) fn transfer_funds_portfolio_diff_did() -> Weight { - // Minimum execution time: 166_220 nanoseconds. - Weight::from_parts(175_150_000, 0) + // Minimum execution time: 148_350 nanoseconds. + Weight::from_parts(156_940_000, 0) .saturating_add(DbWeight::get().reads(22)) .saturating_add(DbWeight::get().writes(10)) } @@ -1465,8 +1466,8 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Storage: `Portfolio::PortfolioAssetCount` (r:1 w:1) // Proof: `Portfolio::PortfolioAssetCount` (`max_values`: None, `max_size`: Some(57), added: 2532, mode: `MaxEncodedLen`) fn transfer_funds_account_same_did() -> Weight { - // Minimum execution time: 80_530 nanoseconds. - Weight::from_parts(85_040_000, 0) + // Minimum execution time: 72_490 nanoseconds. + Weight::from_parts(76_240_000, 0) .saturating_add(DbWeight::get().reads(9)) .saturating_add(DbWeight::get().writes(3)) } @@ -1513,8 +1514,8 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Storage: `Settlement::InstructionLegStatus` (r:0 w:1) // Proof: `Settlement::InstructionLegStatus` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) fn transfer_funds_account_diff_did() -> Weight { - // Minimum execution time: 163_679 nanoseconds. - Weight::from_parts(171_669_000, 0) + // Minimum execution time: 146_220 nanoseconds. + Weight::from_parts(153_580_000, 0) .saturating_add(DbWeight::get().reads(18)) .saturating_add(DbWeight::get().writes(10)) } @@ -1535,11 +1536,11 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Storage: `Nft::Owner` (r:0 w:10) // Proof: `Nft::Owner` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 10]`. - fn transfer_funds_nft_portfolio_same_did(n: u32) -> Weight { - // Minimum execution time: 99_880 nanoseconds. - Weight::from_parts(64_618_613, 0) - // Standard Error: 151_790 - .saturating_add(Weight::from_parts(41_593_460, 0).saturating_mul(n.into())) + fn transfer_funds_nft_portfolio_same_did(n: u32, ) -> Weight { + // Minimum execution time: 86_130 nanoseconds. + Weight::from_parts(49_620_990, 0) + // Standard Error: 70_952 + .saturating_add(Weight::from_parts(42_020_638, 0).saturating_mul(n.into())) .saturating_add(DbWeight::get().reads(6)) .saturating_add(DbWeight::get().reads((3_u64).saturating_mul(n.into()))) .saturating_add(DbWeight::get().writes(2)) @@ -1592,11 +1593,11 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Storage: `Settlement::InstructionLegStatus` (r:0 w:1) // Proof: `Settlement::InstructionLegStatus` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 10]`. - fn transfer_funds_nft_portfolio_diff_did(n: u32) -> Weight { - // Minimum execution time: 171_150 nanoseconds. - Weight::from_parts(170_207_597, 0) - // Standard Error: 192_035 - .saturating_add(Weight::from_parts(13_174_302, 0).saturating_mul(n.into())) + fn transfer_funds_nft_portfolio_diff_did(n: u32, ) -> Weight { + // Minimum execution time: 145_780 nanoseconds. + Weight::from_parts(144_039_121, 0) + // Standard Error: 82_393 + .saturating_add(Weight::from_parts(13_673_492, 0).saturating_mul(n.into())) .saturating_add(DbWeight::get().reads(19)) .saturating_add(DbWeight::get().reads((2_u64).saturating_mul(n.into()))) .saturating_add(DbWeight::get().writes(9)) @@ -1623,11 +1624,11 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Storage: `Nft::Owner` (r:0 w:10) // Proof: `Nft::Owner` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 10]`. - fn transfer_funds_nft_account_same_did(n: u32) -> Weight { - // Minimum execution time: 113_530 nanoseconds. - Weight::from_parts(72_175_790, 0) - // Standard Error: 168_061 - .saturating_add(Weight::from_parts(47_997_006, 0).saturating_mul(n.into())) + fn transfer_funds_nft_account_same_did(n: u32, ) -> Weight { + // Minimum execution time: 98_720 nanoseconds. + Weight::from_parts(53_095_194, 0) + // Standard Error: 75_154 + .saturating_add(Weight::from_parts(48_912_605, 0).saturating_mul(n.into())) .saturating_add(DbWeight::get().reads(6)) .saturating_add(DbWeight::get().reads((2_u64).saturating_mul(n.into()))) .saturating_add(DbWeight::get().writes(3)) @@ -1672,11 +1673,11 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Storage: `Settlement::InstructionLegStatus` (r:0 w:1) // Proof: `Settlement::InstructionLegStatus` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 10]`. - fn transfer_funds_nft_account_diff_did(n: u32) -> Weight { - // Minimum execution time: 165_160 nanoseconds. - Weight::from_parts(160_025_327, 0) - // Standard Error: 198_051 - .saturating_add(Weight::from_parts(18_599_480, 0).saturating_mul(n.into())) + fn transfer_funds_nft_account_diff_did(n: u32, ) -> Weight { + // Minimum execution time: 145_350 nanoseconds. + Weight::from_parts(135_691_764, 0) + // Standard Error: 79_425 + .saturating_add(Weight::from_parts(19_015_716, 0).saturating_mul(n.into())) .saturating_add(DbWeight::get().reads(15)) .saturating_add(DbWeight::get().reads((1_u64).saturating_mul(n.into()))) .saturating_add(DbWeight::get().writes(9)) @@ -1695,8 +1696,8 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Storage: `Settlement::LockedTimestamp` (r:0 w:1) // Proof: `Settlement::LockedTimestamp` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`) fn unlock_instruction() -> Weight { - // Minimum execution time: 47_130 nanoseconds. - Weight::from_parts(50_120_000, 0) + // Minimum execution time: 43_320 nanoseconds. + Weight::from_parts(46_200_000, 0) .saturating_add(DbWeight::get().reads(4)) .saturating_add(DbWeight::get().writes(3)) } diff --git a/pallets/weights/src/pallet_sto.rs b/pallets/weights/src/pallet_sto.rs index e55ee9f593..2064ef98ff 100644 --- a/pallets/weights/src/pallet_sto.rs +++ b/pallets/weights/src/pallet_sto.rs @@ -4,7 +4,7 @@ //! Autogenerated weights for pallet_sto //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 54.0.0 -//! DATE: 2026-09-26, STEPS: `100`, REPEAT: 5, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2026-10-04, STEPS: `100`, REPEAT: 5, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 512 //! HOSTNAME: `ubuntu-8gb-hel1-bench`, CPU: `AMD EPYC-Milan Processor` @@ -16,7 +16,7 @@ // 100 // -r // 5 -// -p=pallet_asset,pallet_nft,pallet_settlement,pallet_sto,pallet_compliance +// -p=pallet_asset,pallet_nft,pallet_settlement,pallet_sto,pallet_portfolio // -e=* // --heap-pages // 4096 @@ -70,11 +70,11 @@ impl pallet_sto::WeightInfo for SubstrateWeight { // Storage: `Sto::Fundraisers` (r:0 w:1) // Proof: `Sto::Fundraisers` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `i` is `[1, 10]`. - fn create_fundraiser(i: u32) -> Weight { - // Minimum execution time: 104_170 nanoseconds. - Weight::from_parts(109_452_256, 0) - // Standard Error: 81_108 - .saturating_add(Weight::from_parts(111_433, 0).saturating_mul(i.into())) + fn create_fundraiser(i: u32, ) -> Weight { + // Minimum execution time: 90_930 nanoseconds. + Weight::from_parts(95_883_990, 0) + // Standard Error: 42_360 + .saturating_add(Weight::from_parts(179_957, 0).saturating_mul(i.into())) .saturating_add(DbWeight::get().reads(14)) .saturating_add(DbWeight::get().writes(4)) } @@ -163,8 +163,8 @@ impl pallet_sto::WeightInfo for SubstrateWeight { // Storage: `Settlement::InstructionLegStatus` (r:0 w:2) // Proof: `Settlement::InstructionLegStatus` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) fn invest_onchain() -> Weight { - // Minimum execution time: 2_215_048 nanoseconds. - Weight::from_parts(2_267_618_000, 0) + // Minimum execution time: 1_483_238 nanoseconds. + Weight::from_parts(1_524_948_000, 0) .saturating_add(DbWeight::get().reads(230)) .saturating_add(DbWeight::get().writes(53)) } @@ -261,8 +261,8 @@ impl pallet_sto::WeightInfo for SubstrateWeight { // Storage: `Settlement::InstructionLegStatus` (r:0 w:1) // Proof: `Settlement::InstructionLegStatus` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) fn invest_offchain() -> Weight { - // Minimum execution time: 1_323_799 nanoseconds. - Weight::from_parts(1_363_019_000, 0) + // Minimum execution time: 909_609 nanoseconds. + Weight::from_parts(945_909_000, 0) .saturating_add(DbWeight::get().reads(124)) .saturating_add(DbWeight::get().writes(32)) } @@ -277,8 +277,8 @@ impl pallet_sto::WeightInfo for SubstrateWeight { // Storage: `Sto::Fundraisers` (r:1 w:1) // Proof: `Sto::Fundraisers` (`max_values`: None, `max_size`: None, mode: `Measured`) fn freeze_fundraiser() -> Weight { - // Minimum execution time: 49_460 nanoseconds. - Weight::from_parts(52_430_000, 0) + // Minimum execution time: 41_940 nanoseconds. + Weight::from_parts(45_020_000, 0) .saturating_add(DbWeight::get().reads(5)) .saturating_add(DbWeight::get().writes(1)) } @@ -293,8 +293,8 @@ impl pallet_sto::WeightInfo for SubstrateWeight { // Storage: `Sto::Fundraisers` (r:1 w:1) // Proof: `Sto::Fundraisers` (`max_values`: None, `max_size`: None, mode: `Measured`) fn unfreeze_fundraiser() -> Weight { - // Minimum execution time: 47_630 nanoseconds. - Weight::from_parts(50_970_000, 0) + // Minimum execution time: 40_839 nanoseconds. + Weight::from_parts(44_190_000, 0) .saturating_add(DbWeight::get().reads(5)) .saturating_add(DbWeight::get().writes(1)) } @@ -311,8 +311,8 @@ impl pallet_sto::WeightInfo for SubstrateWeight { // Storage: `Timestamp::Now` (r:1 w:0) // Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) fn modify_fundraiser_window() -> Weight { - // Minimum execution time: 52_580 nanoseconds. - Weight::from_parts(55_470_000, 0) + // Minimum execution time: 44_950 nanoseconds. + Weight::from_parts(48_500_000, 0) .saturating_add(DbWeight::get().reads(6)) .saturating_add(DbWeight::get().writes(1)) } @@ -325,8 +325,8 @@ impl pallet_sto::WeightInfo for SubstrateWeight { // Storage: `Timestamp::Now` (r:1 w:0) // Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) fn stop() -> Weight { - // Minimum execution time: 49_970 nanoseconds. - Weight::from_parts(52_250_000, 0) + // Minimum execution time: 42_210 nanoseconds. + Weight::from_parts(45_020_000, 0) .saturating_add(DbWeight::get().reads(4)) .saturating_add(DbWeight::get().writes(2)) } @@ -337,8 +337,8 @@ impl pallet_sto::WeightInfo for SubstrateWeight { // Storage: `Sto::FundraiserOffchainAsset` (r:0 w:1) // Proof: `Sto::FundraiserOffchainAsset` (`max_values`: None, `max_size`: Some(60), added: 2535, mode: `MaxEncodedLen`) fn enable_offchain_funding() -> Weight { - // Minimum execution time: 36_369 nanoseconds. - Weight::from_parts(38_760_000, 0) + // Minimum execution time: 29_350 nanoseconds. + Weight::from_parts(32_259_000, 0) .saturating_add(DbWeight::get().reads(2)) .saturating_add(DbWeight::get().writes(1)) } From 7303b926981d05db265fcbc35207e79604640f17 Mon Sep 17 00:00:00 2001 From: Henrique Nogara Date: Mon, 5 Oct 2026 09:01:57 -0300 Subject: [PATCH 09/12] Run cargo fmt --- pallets/weights/src/pallet_asset.rs | 46 ++++++++++----------- pallets/weights/src/pallet_nft.rs | 20 +++++----- pallets/weights/src/pallet_portfolio.rs | 6 +-- pallets/weights/src/pallet_settlement.rs | 51 ++++++++++++------------ pallets/weights/src/pallet_sto.rs | 2 +- 5 files changed, 59 insertions(+), 66 deletions(-) diff --git a/pallets/weights/src/pallet_asset.rs b/pallets/weights/src/pallet_asset.rs index 6c4731481f..f9cfb9ddc8 100644 --- a/pallets/weights/src/pallet_asset.rs +++ b/pallets/weights/src/pallet_asset.rs @@ -152,11 +152,15 @@ impl pallet_asset::WeightInfo for SubstrateWeight { /// The range of component `n` is `[1, 128]`. /// The range of component `i` is `[1, 512]`. /// The range of component `f` is `[1, 128]`. - fn create_asset(_n: u32, i: u32, _f: u32, ) -> Weight { + fn create_asset(n: u32, i: u32, f: u32) -> Weight { // Minimum execution time: 74_450 nanoseconds. Weight::from_parts(82_919_011, 0) + // Standard Error: 2_794 + .saturating_add(Weight::from_parts(675, 0).saturating_mul(n.into())) // Standard Error: 591 .saturating_add(Weight::from_parts(57_040, 0).saturating_mul(i.into())) + // Standard Error: 2_794 + .saturating_add(Weight::from_parts(5_528, 0).saturating_mul(f.into())) .saturating_add(DbWeight::get().reads(9)) .saturating_add(DbWeight::get().writes(9)) } @@ -209,7 +213,7 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::AssetNames` (r:0 w:1) // Proof: `Asset::AssetNames` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `n` is `[1, 128]`. - fn rename_asset(n: u32, ) -> Weight { + fn rename_asset(n: u32) -> Weight { // Minimum execution time: 33_920 nanoseconds. Weight::from_parts(37_016_734, 0) // Standard Error: 532 @@ -330,7 +334,7 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::AssetDocuments` (r:0 w:64) // Proof: `Asset::AssetDocuments` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `d` is `[1, 64]`. - fn add_documents(d: u32, ) -> Weight { + fn add_documents(d: u32) -> Weight { // Minimum execution time: 46_350 nanoseconds. Weight::from_parts(47_702_916, 0) // Standard Error: 7_586 @@ -350,7 +354,7 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::AssetDocuments` (r:0 w:63) // Proof: `Asset::AssetDocuments` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `d` is `[1, 64]`. - fn remove_documents(d: u32, ) -> Weight { + fn remove_documents(d: u32) -> Weight { // Minimum execution time: 20_970 nanoseconds. Weight::from_parts(20_263_846, 0) // Standard Error: 3_507 @@ -369,7 +373,7 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::FundingRound` (r:0 w:1) // Proof: `Asset::FundingRound` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `f` is `[1, 128]`. - fn set_funding_round(f: u32, ) -> Weight { + fn set_funding_round(f: u32) -> Weight { // Minimum execution time: 26_960 nanoseconds. Weight::from_parts(29_814_822, 0) // Standard Error: 442 @@ -388,7 +392,7 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::AssetIdentifiers` (r:0 w:1) // Proof: `Asset::AssetIdentifiers` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `i` is `[1, 512]`. - fn update_identifiers(i: u32, ) -> Weight { + fn update_identifiers(i: u32) -> Weight { // Minimum execution time: 27_480 nanoseconds. Weight::from_parts(30_010_161, 0) // Standard Error: 220 @@ -483,7 +487,7 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::CustomTypes` (r:0 w:1) // Proof: `Asset::CustomTypes` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `n` is `[1, 2048]`. - fn register_custom_asset_type(n: u32, ) -> Weight { + fn register_custom_asset_type(n: u32) -> Weight { // Minimum execution time: 25_800 nanoseconds. Weight::from_parts(28_499_485, 0) // Standard Error: 28 @@ -697,15 +701,13 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Proof: `Asset::AssetsExemptFromAffirmation` (`max_values`: None, `max_size`: Some(33), added: 2508, mode: `MaxEncodedLen`) fn exempt_asset_affirmation() -> Weight { // Minimum execution time: 8_410 nanoseconds. - Weight::from_parts(9_710_000, 0) - .saturating_add(DbWeight::get().writes(1)) + Weight::from_parts(9_710_000, 0).saturating_add(DbWeight::get().writes(1)) } // Storage: `Asset::AssetsExemptFromAffirmation` (r:0 w:1) // Proof: `Asset::AssetsExemptFromAffirmation` (`max_values`: None, `max_size`: Some(33), added: 2508, mode: `MaxEncodedLen`) fn remove_asset_affirmation_exemption() -> Weight { // Minimum execution time: 8_200 nanoseconds. - Weight::from_parts(9_520_000, 0) - .saturating_add(DbWeight::get().writes(1)) + Weight::from_parts(9_520_000, 0).saturating_add(DbWeight::get().writes(1)) } // Storage: `Identity::KeyRecords` (r:1 w:0) // Proof: `Identity::KeyRecords` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) @@ -738,7 +740,7 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::MandatoryMediators` (r:1 w:1) // Proof: `Asset::MandatoryMediators` (`max_values`: None, `max_size`: Some(161), added: 2636, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 4]`. - fn add_mandatory_mediators(n: u32, ) -> Weight { + fn add_mandatory_mediators(n: u32) -> Weight { // Minimum execution time: 32_310 nanoseconds. Weight::from_parts(35_141_994, 0) // Standard Error: 14_025 @@ -757,7 +759,7 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Storage: `Asset::MandatoryMediators` (r:1 w:1) // Proof: `Asset::MandatoryMediators` (`max_values`: None, `max_size`: Some(161), added: 2636, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 4]`. - fn remove_mandatory_mediators(n: u32, ) -> Weight { + fn remove_mandatory_mediators(n: u32) -> Weight { // Minimum execution time: 33_540 nanoseconds. Weight::from_parts(36_169_296, 0) // Standard Error: 12_665 @@ -823,8 +825,7 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Proof: `Identity::KeyRecords` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) fn receiver_affirm_asset_transfer_base_weight() -> Weight { // Minimum execution time: 11_430 nanoseconds. - Weight::from_parts(12_420_000, 0) - .saturating_add(DbWeight::get().reads(1)) + Weight::from_parts(12_420_000, 0).saturating_add(DbWeight::get().reads(1)) } // Storage: `Identity::KeyRecords` (r:1 w:0) // Proof: `Identity::KeyRecords` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) @@ -906,8 +907,7 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Proof: `ComplianceManager::AssetCompliances` (`max_values`: None, `max_size`: None, mode: `Measured`) fn asset_transfer_report_best_case() -> Weight { // Minimum execution time: 123_949 nanoseconds. - Weight::from_parts(128_320_000, 0) - .saturating_add(DbWeight::get().reads(13)) + Weight::from_parts(128_320_000, 0).saturating_add(DbWeight::get().reads(13)) } // Storage: `Asset::Assets` (r:1 w:0) // Proof: `Asset::Assets` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -939,8 +939,7 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Proof: `ComplianceManager::AssetCompliances` (`max_values`: None, `max_size`: None, mode: `Measured`) fn asset_transfer_report_worst_case() -> Weight { // Minimum execution time: 356_379 nanoseconds. - Weight::from_parts(375_730_000, 0) - .saturating_add(DbWeight::get().reads(76)) + Weight::from_parts(375_730_000, 0).saturating_add(DbWeight::get().reads(76)) } // Storage: `Identity::KeyRecords` (r:1 w:0) // Proof: `Identity::KeyRecords` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) @@ -966,8 +965,7 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Proof: `Asset::FrozenBalance` (`max_values`: None, `max_size`: Some(88), added: 2563, mode: `MaxEncodedLen`) fn get_holders_frozen_balance() -> Weight { // Minimum execution time: 9_340 nanoseconds. - Weight::from_parts(10_260_000, 0) - .saturating_add(DbWeight::get().reads(1)) + Weight::from_parts(10_260_000, 0).saturating_add(DbWeight::get().reads(1)) } // Storage: `Asset::Assets` (r:1 w:0) // Proof: `Asset::Assets` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -981,8 +979,7 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Proof: `ComplianceManager::AssetCompliances` (`max_values`: None, `max_size`: None, mode: `Measured`) fn transfer_is_allowed_for_holder_best_case() -> Weight { // Minimum execution time: 82_000 nanoseconds. - Weight::from_parts(84_700_000, 0) - .saturating_add(DbWeight::get().reads(5)) + Weight::from_parts(84_700_000, 0).saturating_add(DbWeight::get().reads(5)) } // Storage: `Asset::Assets` (r:1 w:0) // Proof: `Asset::Assets` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -1000,8 +997,7 @@ impl pallet_asset::WeightInfo for SubstrateWeight { // Proof: `Identity::Claims` (`max_values`: None, `max_size`: None, mode: `Measured`) fn transfer_is_allowed_for_holder_worst_case() -> Weight { // Minimum execution time: 266_059 nanoseconds. - Weight::from_parts(282_360_000, 0) - .saturating_add(DbWeight::get().reads(56)) + Weight::from_parts(282_360_000, 0).saturating_add(DbWeight::get().reads(56)) } // Storage: `Identity::KeyRecords` (r:1 w:0) // Proof: `Identity::KeyRecords` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) diff --git a/pallets/weights/src/pallet_nft.rs b/pallets/weights/src/pallet_nft.rs index 892839dbd6..a3898384ad 100644 --- a/pallets/weights/src/pallet_nft.rs +++ b/pallets/weights/src/pallet_nft.rs @@ -76,7 +76,7 @@ impl pallet_nft::WeightInfo for SubstrateWeight { // Storage: `Nft::CollectionKeys` (r:0 w:1) // Proof: `Nft::CollectionKeys` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `n` is `[1, 255]`. - fn create_nft_collection(n: u32, ) -> Weight { + fn create_nft_collection(n: u32) -> Weight { // Minimum execution time: 101_620 nanoseconds. Weight::from_parts(107_601_170, 0) // Standard Error: 2_947 @@ -112,7 +112,7 @@ impl pallet_nft::WeightInfo for SubstrateWeight { // Storage: `Nft::Owner` (r:0 w:1) // Proof: `Nft::Owner` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 255]`. - fn issue_nft(n: u32, ) -> Weight { + fn issue_nft(n: u32) -> Weight { // Minimum execution time: 78_109 nanoseconds. Weight::from_parts(83_644_098, 0) // Standard Error: 18_039 @@ -150,7 +150,7 @@ impl pallet_nft::WeightInfo for SubstrateWeight { // Storage: `Nft::Owner` (r:0 w:1) // Proof: `Nft::Owner` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 255]`. - fn redeem_nft(n: u32, ) -> Weight { + fn redeem_nft(n: u32) -> Weight { // Minimum execution time: 94_390 nanoseconds. Weight::from_parts(98_787_544, 0) // Standard Error: 4_003 @@ -181,7 +181,7 @@ impl pallet_nft::WeightInfo for SubstrateWeight { // Storage: `Nft::Owner` (r:0 w:10) // Proof: `Nft::Owner` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 10]`. - fn base_nft_transfer(n: u32, ) -> Weight { + fn base_nft_transfer(n: u32) -> Weight { // Minimum execution time: 157_180 nanoseconds. Weight::from_parts(121_716_478, 0) // Standard Error: 81_056 @@ -216,7 +216,7 @@ impl pallet_nft::WeightInfo for SubstrateWeight { // Storage: `Nft::Owner` (r:0 w:10) // Proof: `Nft::Owner` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 10]`. - fn controller_transfer(n: u32, ) -> Weight { + fn controller_transfer(n: u32) -> Weight { // Minimum execution time: 109_610 nanoseconds. Weight::from_parts(73_589_148, 0) // Standard Error: 79_859 @@ -257,7 +257,7 @@ impl pallet_nft::WeightInfo for SubstrateWeight { // Storage: `Nft::Owner` (r:0 w:10) // Proof: `Nft::Owner` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 10]`. - fn controller_transfer_to(n: u32, ) -> Weight { + fn controller_transfer_to(n: u32) -> Weight { // Minimum execution time: 123_990 nanoseconds. Weight::from_parts(88_993_075, 0) // Standard Error: 46_776 @@ -294,7 +294,7 @@ impl pallet_nft::WeightInfo for SubstrateWeight { // Storage: `Nft::TokenApproval` (r:10 w:10) // Proof: `Nft::TokenApproval` (`max_values`: None, `max_size`: Some(88), added: 2563, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 10]`. - fn spend_nft_approval(n: u32, ) -> Weight { + fn spend_nft_approval(n: u32) -> Weight { // Minimum execution time: 19_540 nanoseconds. Weight::from_parts(13_507_302, 0) // Standard Error: 4_245 @@ -321,8 +321,7 @@ impl pallet_nft::WeightInfo for SubstrateWeight { // Proof: `ComplianceManager::AssetCompliances` (`max_values`: None, `max_size`: None, mode: `Measured`) fn nft_transfer_report_best_case() -> Weight { // Minimum execution time: 104_180 nanoseconds. - Weight::from_parts(107_960_000, 0) - .saturating_add(DbWeight::get().reads(9)) + Weight::from_parts(107_960_000, 0).saturating_add(DbWeight::get().reads(9)) } // Storage: `Nft::CollectionAsset` (r:1 w:0) // Proof: `Nft::CollectionAsset` (`max_values`: None, `max_size`: Some(40), added: 2515, mode: `MaxEncodedLen`) @@ -346,7 +345,6 @@ impl pallet_nft::WeightInfo for SubstrateWeight { // Proof: `Identity::Claims` (`max_values`: None, `max_size`: None, mode: `Measured`) fn nft_transfer_report_worst_case() -> Weight { // Minimum execution time: 285_700 nanoseconds. - Weight::from_parts(294_620_000, 0) - .saturating_add(DbWeight::get().reads(60)) + Weight::from_parts(294_620_000, 0).saturating_add(DbWeight::get().reads(60)) } } diff --git a/pallets/weights/src/pallet_portfolio.rs b/pallets/weights/src/pallet_portfolio.rs index afe7dc1a36..d372c37bd6 100644 --- a/pallets/weights/src/pallet_portfolio.rs +++ b/pallets/weights/src/pallet_portfolio.rs @@ -48,7 +48,7 @@ impl pallet_portfolio::WeightInfo for SubstrateWeight { // Storage: `Portfolio::Portfolios` (r:0 w:1) // Proof: `Portfolio::Portfolios` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `l` is `[1, 500]`. - fn create_portfolio(l: u32, ) -> Weight { + fn create_portfolio(l: u32) -> Weight { // Minimum execution time: 24_160 nanoseconds. Weight::from_parts(26_679_191, 0) // Standard Error: 100 @@ -83,7 +83,7 @@ impl pallet_portfolio::WeightInfo for SubstrateWeight { // Storage: `Portfolio::NameToNumber` (r:1 w:2) // Proof: `Portfolio::NameToNumber` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `i` is `[1, 500]`. - fn rename_portfolio(i: u32, ) -> Weight { + fn rename_portfolio(i: u32) -> Weight { // Minimum execution time: 29_860 nanoseconds. Weight::from_parts(32_181_728, 0) // Standard Error: 94 @@ -153,7 +153,7 @@ impl pallet_portfolio::WeightInfo for SubstrateWeight { // Proof: `Nft::Owner` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) /// The range of component `f` is `[1, 10]`. /// The range of component `n` is `[1, 100]`. - fn move_portfolio_funds(f: u32, n: u32, ) -> Weight { + fn move_portfolio_funds(f: u32, n: u32) -> Weight { // Minimum execution time: 478_239 nanoseconds. Weight::from_parts(483_309_000, 0) // Standard Error: 633_700 diff --git a/pallets/weights/src/pallet_settlement.rs b/pallets/weights/src/pallet_settlement.rs index a410961b01..363a63863c 100644 --- a/pallets/weights/src/pallet_settlement.rs +++ b/pallets/weights/src/pallet_settlement.rs @@ -55,7 +55,7 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Proof: `Settlement::UserVenues` (`max_values`: None, `max_size`: Some(56), added: 2531, mode: `MaxEncodedLen`) /// The range of component `d` is `[1, 2048]`. /// The range of component `s` is `[0, 50]`. - fn create_venue(d: u32, s: u32, ) -> Weight { + fn create_venue(d: u32, s: u32) -> Weight { // Minimum execution time: 29_970 nanoseconds. Weight::from_parts(34_354_141, 0) // Standard Error: 310 @@ -73,7 +73,7 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Storage: `Settlement::Details` (r:0 w:1) // Proof: `Settlement::Details` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `d` is `[1, 2048]`. - fn update_venue_details(d: u32, ) -> Weight { + fn update_venue_details(d: u32) -> Weight { // Minimum execution time: 23_300 nanoseconds. Weight::from_parts(26_243_027, 0) // Standard Error: 24 @@ -100,7 +100,7 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Storage: `Settlement::VenueSigners` (r:49 w:49) // Proof: `Settlement::VenueSigners` (`max_values`: None, `max_size`: Some(57), added: 2532, mode: `MaxEncodedLen`) /// The range of component `s` is `[0, 50]`. - fn update_venue_signers(s: u32, ) -> Weight { + fn update_venue_signers(s: u32) -> Weight { // Minimum execution time: 24_990 nanoseconds. Weight::from_parts(32_953_301, 0) // Standard Error: 7_977 @@ -139,7 +139,7 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Storage: `Settlement::VenueAllowList` (r:0 w:99) // Proof: `Settlement::VenueAllowList` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) /// The range of component `v` is `[0, 100]`. - fn allow_venues(v: u32, ) -> Weight { + fn allow_venues(v: u32) -> Weight { // Minimum execution time: 31_170 nanoseconds. Weight::from_parts(31_484_036, 0) // Standard Error: 1_958 @@ -160,7 +160,7 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Storage: `Settlement::VenueAllowList` (r:0 w:99) // Proof: `Settlement::VenueAllowList` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) /// The range of component `v` is `[0, 100]`. - fn disallow_venues(v: u32, ) -> Weight { + fn disallow_venues(v: u32) -> Weight { // Minimum execution time: 31_370 nanoseconds. Weight::from_parts(32_137_814, 0) // Standard Error: 1_621 @@ -213,7 +213,7 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { /// The range of component `f` is `[1, 10]`. /// The range of component `n` is `[0, 100]`. /// The range of component `o` is `[0, 10]`. - fn affirm_with_receipts(f: u32, n: u32, o: u32, ) -> Weight { + fn affirm_with_receipts(f: u32, n: u32, o: u32) -> Weight { // Minimum execution time: 1_242_878 nanoseconds. Weight::from_parts(30_424_373, 0) // Standard Error: 535_385 @@ -316,7 +316,7 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { /// The range of component `f` is `[0, 10]`. /// The range of component `n` is `[0, 100]`. /// The range of component `o` is `[0, 10]`. - fn execute_manual_instruction(f: u32, n: u32, o: u32, ) -> Weight { + fn execute_manual_instruction(f: u32, n: u32, o: u32) -> Weight { // Minimum execution time: 6_248_173 nanoseconds. Weight::from_parts(6_250_543_000, 0) // Standard Error: 7_262_425 @@ -385,7 +385,7 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { /// The range of component `f` is `[1, 10]`. /// The range of component `n` is `[0, 100]`. /// The range of component `o` is `[0, 10]`. - fn add_instruction(f: u32, n: u32, o: u32, ) -> Weight { + fn add_instruction(f: u32, n: u32, o: u32) -> Weight { // Minimum execution time: 672_040 nanoseconds. Weight::from_parts(188_032_294, 0) // Standard Error: 734_788 @@ -471,7 +471,7 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { /// The range of component `f` is `[1, 10]`. /// The range of component `n` is `[0, 100]`. /// The range of component `o` is `[0, 10]`. - fn add_and_affirm_instruction(f: u32, n: u32, o: u32, ) -> Weight { + fn add_and_affirm_instruction(f: u32, n: u32, o: u32) -> Weight { // Minimum execution time: 1_123_609 nanoseconds. Weight::from_parts(82_249_526, 0) // Standard Error: 895_045 @@ -523,7 +523,7 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Proof: `Settlement::InstructionLegStatus` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) /// The range of component `f` is `[1, 10]`. /// The range of component `n` is `[1, 100]`. - fn affirm_instruction(f: u32, n: u32, ) -> Weight { + fn affirm_instruction(f: u32, n: u32) -> Weight { // Minimum execution time: 619_349 nanoseconds. Weight::from_parts(124_190_954, 0) // Standard Error: 690_260 @@ -614,7 +614,7 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { /// The range of component `f` is `[1, 10]`. /// The range of component `n` is `[0, 100]`. /// The range of component `o` is `[0, 10]`. - fn execute_instruction_paused(f: u32, n: u32, o: u32, ) -> Weight { + fn execute_instruction_paused(f: u32, n: u32, o: u32) -> Weight { // Minimum execution time: 2_593_896 nanoseconds. Weight::from_parts(2_623_127_000, 0) // Standard Error: 4_441_760 @@ -711,7 +711,7 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { /// The range of component `f` is `[1, 10]`. /// The range of component `n` is `[0, 100]`. /// The range of component `o` is `[0, 10]`. - fn execute_scheduled_instruction(f: u32, n: u32, o: u32, ) -> Weight { + fn execute_scheduled_instruction(f: u32, n: u32, o: u32) -> Weight { // Minimum execution time: 6_362_873 nanoseconds. Weight::from_parts(6_411_993_000, 0) // Standard Error: 7_320_943 @@ -762,7 +762,7 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { /// The range of component `f` is `[1, 10]`. /// The range of component `n` is `[0, 100]`. /// The range of component `o` is `[0, 10]`. - fn affirm_with_receipts_rcv(f: u32, n: u32, o: u32, ) -> Weight { + fn affirm_with_receipts_rcv(f: u32, n: u32, o: u32) -> Weight { // Minimum execution time: 1_009_779 nanoseconds. Weight::from_parts(88_370_689, 0) // Standard Error: 355_310 @@ -798,7 +798,7 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Proof: `Settlement::AffirmsReceived` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `MaxEncodedLen`) /// The range of component `f` is `[1, 10]`. /// The range of component `n` is `[1, 100]`. - fn affirm_instruction_rcv(f: u32, n: u32, ) -> Weight { + fn affirm_instruction_rcv(f: u32, n: u32) -> Weight { // Minimum execution time: 324_330 nanoseconds. Weight::from_parts(152_371_434, 0) // Standard Error: 287_537 @@ -848,8 +848,7 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Proof: `Settlement::InstructionMemos` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`) fn set_instruction_memo() -> Weight { // Minimum execution time: 1_760 nanoseconds. - Weight::from_parts(2_150_000, 0) - .saturating_add(DbWeight::get().writes(1)) + Weight::from_parts(2_150_000, 0).saturating_add(DbWeight::get().writes(1)) } // Storage: `Identity::KeyRecords` (r:1 w:0) // Proof: `Identity::KeyRecords` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) @@ -905,7 +904,7 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { /// The range of component `n` is `[0, 100]`. /// The range of component `o` is `[0, 10]`. /// The range of component `m` is `[0, 4]`. - fn add_instruction_with_mediators(f: u32, n: u32, o: u32, m: u32, ) -> Weight { + fn add_instruction_with_mediators(f: u32, n: u32, o: u32, m: u32) -> Weight { // Minimum execution time: 675_400 nanoseconds. Weight::from_parts(136_906_637, 0) // Standard Error: 654_426 @@ -995,7 +994,7 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { /// The range of component `n` is `[0, 100]`. /// The range of component `o` is `[0, 10]`. /// The range of component `m` is `[0, 4]`. - fn add_and_affirm_with_mediators(f: u32, n: u32, o: u32, m: u32, ) -> Weight { + fn add_and_affirm_with_mediators(f: u32, n: u32, o: u32, m: u32) -> Weight { // Minimum execution time: 1_134_939 nanoseconds. Weight::from_parts(52_754_445, 0) // Standard Error: 931_837 @@ -1069,7 +1068,7 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { /// The range of component `f` is `[0, 10]`. /// The range of component `n` is `[0, 100]`. /// The range of component `o` is `[0, 10]`. - fn base_reject_instruction(f: u32, n: u32, o: u32, ) -> Weight { + fn base_reject_instruction(f: u32, n: u32, o: u32) -> Weight { // Minimum execution time: 535_009 nanoseconds. Weight::from_parts(122_842_893, 0) // Standard Error: 384_088 @@ -1160,7 +1159,7 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { /// The range of component `f` is `[0, 10]`. /// The range of component `n` is `[0, 100]`. /// The range of component `o` is `[0, 10]`. - fn lock_instruction_extrinsic(f: u32, n: u32, o: u32, ) -> Weight { + fn lock_instruction_extrinsic(f: u32, n: u32, o: u32) -> Weight { // Minimum execution time: 2_251_757 nanoseconds. Weight::from_parts(149_167_170, 0) // Standard Error: 2_151_705 @@ -1246,7 +1245,7 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { /// The range of component `f` is `[0, 10]`. /// The range of component `n` is `[0, 100]`. /// The range of component `o` is `[0, 10]`. - fn execute_locked_instruction(f: u32, n: u32, o: u32, ) -> Weight { + fn execute_locked_instruction(f: u32, n: u32, o: u32) -> Weight { // Minimum execution time: 3_251_048 nanoseconds. Weight::from_parts(3_256_748_000, 0) // Standard Error: 3_274_743 @@ -1343,7 +1342,7 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { /// The range of component `f` is `[0, 10]`. /// The range of component `n` is `[0, 100]`. /// The range of component `o` is `[0, 10]`. - fn execute_manual_instruction_paused(f: u32, n: u32, o: u32, ) -> Weight { + fn execute_manual_instruction_paused(f: u32, n: u32, o: u32) -> Weight { // Minimum execution time: 2_920_188 nanoseconds. Weight::from_parts(769_905_508, 0) // Standard Error: 7_119_553 @@ -1536,7 +1535,7 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Storage: `Nft::Owner` (r:0 w:10) // Proof: `Nft::Owner` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 10]`. - fn transfer_funds_nft_portfolio_same_did(n: u32, ) -> Weight { + fn transfer_funds_nft_portfolio_same_did(n: u32) -> Weight { // Minimum execution time: 86_130 nanoseconds. Weight::from_parts(49_620_990, 0) // Standard Error: 70_952 @@ -1593,7 +1592,7 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Storage: `Settlement::InstructionLegStatus` (r:0 w:1) // Proof: `Settlement::InstructionLegStatus` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 10]`. - fn transfer_funds_nft_portfolio_diff_did(n: u32, ) -> Weight { + fn transfer_funds_nft_portfolio_diff_did(n: u32) -> Weight { // Minimum execution time: 145_780 nanoseconds. Weight::from_parts(144_039_121, 0) // Standard Error: 82_393 @@ -1624,7 +1623,7 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Storage: `Nft::Owner` (r:0 w:10) // Proof: `Nft::Owner` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 10]`. - fn transfer_funds_nft_account_same_did(n: u32, ) -> Weight { + fn transfer_funds_nft_account_same_did(n: u32) -> Weight { // Minimum execution time: 98_720 nanoseconds. Weight::from_parts(53_095_194, 0) // Standard Error: 75_154 @@ -1673,7 +1672,7 @@ impl pallet_settlement::WeightInfo for SubstrateWeight { // Storage: `Settlement::InstructionLegStatus` (r:0 w:1) // Proof: `Settlement::InstructionLegStatus` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) /// The range of component `n` is `[1, 10]`. - fn transfer_funds_nft_account_diff_did(n: u32, ) -> Weight { + fn transfer_funds_nft_account_diff_did(n: u32) -> Weight { // Minimum execution time: 145_350 nanoseconds. Weight::from_parts(135_691_764, 0) // Standard Error: 79_425 diff --git a/pallets/weights/src/pallet_sto.rs b/pallets/weights/src/pallet_sto.rs index 2064ef98ff..23d472d4ef 100644 --- a/pallets/weights/src/pallet_sto.rs +++ b/pallets/weights/src/pallet_sto.rs @@ -70,7 +70,7 @@ impl pallet_sto::WeightInfo for SubstrateWeight { // Storage: `Sto::Fundraisers` (r:0 w:1) // Proof: `Sto::Fundraisers` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `i` is `[1, 10]`. - fn create_fundraiser(i: u32, ) -> Weight { + fn create_fundraiser(i: u32) -> Weight { // Minimum execution time: 90_930 nanoseconds. Weight::from_parts(95_883_990, 0) // Standard Error: 42_360 From b8b0ba8c1508444cbd35ad8b1d936dd19e78ebc1 Mon Sep 17 00:00:00 2001 From: Henrique Nogara Date: Mon, 5 Oct 2026 09:11:24 -0300 Subject: [PATCH 10/12] Rollback test changes --- pallets/runtime/tests/src/settlement_test.rs | 4 ++-- pallets/settlement/src/lib.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pallets/runtime/tests/src/settlement_test.rs b/pallets/runtime/tests/src/settlement_test.rs index 4ac67621f0..28fc0ac4f9 100644 --- a/pallets/runtime/tests/src/settlement_test.rs +++ b/pallets/runtime/tests/src/settlement_test.rs @@ -2392,7 +2392,7 @@ fn settle_manual_instruction() { ), DispatchErrorWithPostInfo { post_info: Some(Settlement::execute_manual_instruction_minimum_weight()).into(), - error: Error::InputWeightIsLessThanMinimum.into() + error: Error::NumberOfFungibleTransfersUnderestimated.into() } ); // Ensure it succeeds as the execute block was reached @@ -2499,7 +2499,7 @@ fn settle_manual_instruction_with_portfolio() { ), DispatchErrorWithPostInfo { post_info: Some(Settlement::execute_manual_instruction_minimum_weight()).into(), - error: Error::InputWeightIsLessThanMinimum.into() + error: Error::NumberOfFungibleTransfersUnderestimated.into() } ); // Ensure it succeeds as the execute block was reached diff --git a/pallets/settlement/src/lib.rs b/pallets/settlement/src/lib.rs index 17be7c02f6..6b7f6a8e0a 100644 --- a/pallets/settlement/src/lib.rs +++ b/pallets/settlement/src/lib.rs @@ -3591,7 +3591,7 @@ impl Pallet { /// Returns the minimum weight for calling the `execute_manual_instruction` extrinsic. pub fn execute_manual_instruction_minimum_weight() -> Weight { - ::WeightInfo::execute_manual_instruction(0, 0, 1) + ::WeightInfo::execute_locked_instruction(0, 0, 1) } /// Returns the weight for calling `affirm_with_receipts` while considering the `sender_asset_count` for the sender, `receiver_asset_count` From afc78435fdef03664b7a0f6c9a382f4bbee460b0 Mon Sep 17 00:00:00 2001 From: Henrique Nogara Date: Fri, 9 Oct 2026 16:38:21 -0300 Subject: [PATCH 11/12] Improve weight charge. --- pallets/nft/src/benchmarking.rs | 4 +- pallets/precompiles/src/common.rs | 1 + .../src/interface/fungible_asset/erc7943.rs | 83 ++++++++++--------- .../precompiles/src/interface/nft/erc7943.rs | 60 +++++++++----- pallets/runtime/tests/src/storage.rs | 5 -- primitives/src/weight_meter.rs | 17 +++- 6 files changed, 100 insertions(+), 70 deletions(-) diff --git a/pallets/nft/src/benchmarking.rs b/pallets/nft/src/benchmarking.rs index 6da494c614..484d2c90d8 100644 --- a/pallets/nft/src/benchmarking.rs +++ b/pallets/nft/src/benchmarking.rs @@ -372,7 +372,7 @@ benchmarks! { let bob = UserBuilder::::default().generate_did().build("Bob"); let mut weight_meter = WeightMeter::max_limit_no_minimum(); - // No statistics or compliance rules are set + // 50 compliance requirements are set but paused, so none are evaluated (AssetCompliances is still read) let (asset_id, sender, receiver, _) = setup_nft_transfer::(&alice, &bob, 1, None, None, true, 0, false); }: { @@ -393,7 +393,7 @@ benchmarks! { let bob = UserBuilder::::default().generate_did().build("Bob"); let mut weight_meter = WeightMeter::max_limit_no_minimum(); - // Max Statistics and Compliance rules are set + // 50 active compliance requirements are set; statistics are not read by nft_transfer_report let (asset_id, sender, receiver, _) = setup_nft_transfer::(&alice, &bob, 1, None, None, false, 0, false); }: { diff --git a/pallets/precompiles/src/common.rs b/pallets/precompiles/src/common.rs index e74205ad4d..fb37467d24 100644 --- a/pallets/precompiles/src/common.rs +++ b/pallets/precompiles/src/common.rs @@ -47,6 +47,7 @@ pub const ERR_BALANCE_CONVERSION_FAILED: &str = "Balance conversion failed"; pub const ERR_EXTRINSIC_ERROR: &str = "Extrinsic returned an error: "; pub const ERR_INVALID_ACCOUNT_ID: &str = "Invalid account id"; pub const ERR_ASSET_NOT_FOUND: &str = "Asset not found"; +pub const ERR_WEIGHT_LIMIT_EXCEEDED: &str = "Benchmarked weight limit exceeded"; pub const ERR_INST_NOT_EXECUTED: &str = "Instruction was not executed; Most likely the instruction is missing an affirmation from the receiver/mediator"; const ERR_ASSET_NOT_FUNGIBLE: &str = "Asset is not fungible"; const ERR_ASSET_NOT_NON_FUNGIBLE: &str = "Asset is not non-fungible"; diff --git a/pallets/precompiles/src/interface/fungible_asset/erc7943.rs b/pallets/precompiles/src/interface/fungible_asset/erc7943.rs index b2d10c8920..ec00df79e9 100644 --- a/pallets/precompiles/src/interface/fungible_asset/erc7943.rs +++ b/pallets/precompiles/src/interface/fungible_asset/erc7943.rs @@ -23,8 +23,9 @@ use pallet_asset::WeightInfo; use polymesh_precompiles::{IFungibleAsset, IFungibleAssetEvents}; use polymesh_primitives::asset::AssetId; use polymesh_primitives::WeightMeter; +use sp_runtime::Weight; -use crate::common::Common; +use crate::common::{revert, Common, ERR_WEIGHT_LIMIT_EXCEEDED}; use crate::interface::FungibleAssetInterface; use crate::Config; @@ -35,33 +36,37 @@ impl FungibleAssetInterface { call: &IFungibleAsset::canTransferCall, env: &mut impl Ext, ) -> Result, Error> { - let transfer_report_worst_case_weight = + let best_case_weight = + ::WeightInfo::asset_transfer_report_best_case(); + let worst_case_weight = ::WeightInfo::asset_transfer_report_worst_case(); - let charged = env.charge(transfer_report_worst_case_weight)?; + let charged = env.charge(worst_case_weight)?; let from = Common::::asset_holder(env, call.from)?; let to = Common::::asset_holder(env, call.to)?; + let value = Common::::to_balance(call.value)?; - let mut weight_meter = WeightMeter::max_limit_no_minimum(); + // The best case covers the fixed work, the meter only gets the variable rest + let mut weight_meter = WeightMeter::from_limit_unchecked( + Weight::zero(), + worst_case_weight.saturating_sub(best_case_weight), + ); let errors = pallet_asset::Pallet::::asset_transfer_report( &from, &to, &asset_id, - Common::::to_balance(call.value)?, + value, false, &mut weight_meter, ); - let transfer_report_weight = - ::WeightInfo::asset_transfer_report_best_case(); - let compliance_and_statistics_weight = weight_meter.consumed(); - let real_consumed_weight = - transfer_report_weight.saturating_add(compliance_and_statistics_weight); - - if real_consumed_weight.ref_time() < transfer_report_worst_case_weight.ref_time() { - env.adjust_gas(charged, real_consumed_weight); + if weight_meter.limit_exceeded() { + return Err(revert(ERR_WEIGHT_LIMIT_EXCEEDED)); } + let real_consumed_weight = best_case_weight.saturating_add(weight_meter.consumed()); + env.adjust_gas(charged, real_consumed_weight.min(worst_case_weight)); + Ok(IFungibleAsset::canTransferCall::abi_encode_returns( &errors.is_empty(), )) @@ -164,13 +169,19 @@ impl FungibleAssetInterface { call: &IFungibleAsset::canSendCall, env: &mut impl Ext, ) -> Result, Error> { - let transfer_is_allowed_for_holder_worst_case_weight = + let best_case_weight = + ::WeightInfo::transfer_is_allowed_for_holder_best_case(); + let worst_case_weight = ::WeightInfo::transfer_is_allowed_for_holder_worst_case(); - let charged = env.charge(transfer_is_allowed_for_holder_worst_case_weight)?; + let charged = env.charge(worst_case_weight)?; let sender = Common::::asset_holder(env, call.account)?; - let mut weight_meter = WeightMeter::max_limit_no_minimum(); + // The best case covers the fixed work, the meter only gets the variable rest + let mut weight_meter = WeightMeter::from_limit_unchecked( + Weight::zero(), + worst_case_weight.saturating_sub(best_case_weight), + ); let allowed = pallet_asset::Pallet::::transfer_is_allowed_for_holder( &sender, &asset_id, @@ -178,17 +189,13 @@ impl FungibleAssetInterface { &mut weight_meter, ); - let transfer_is_allowed_weight = - ::WeightInfo::transfer_is_allowed_for_holder_best_case(); - let compliance_weight = weight_meter.consumed(); - let real_consumed_weight = transfer_is_allowed_weight.saturating_add(compliance_weight); - - if real_consumed_weight.ref_time() - < transfer_is_allowed_for_holder_worst_case_weight.ref_time() - { - env.adjust_gas(charged, real_consumed_weight); + if weight_meter.limit_exceeded() { + return Err(revert(ERR_WEIGHT_LIMIT_EXCEEDED)); } + let real_consumed_weight = best_case_weight.saturating_add(weight_meter.consumed()); + env.adjust_gas(charged, real_consumed_weight.min(worst_case_weight)); + Ok(IFungibleAsset::canSendCall::abi_encode_returns(&allowed)) } @@ -198,13 +205,19 @@ impl FungibleAssetInterface { call: &IFungibleAsset::canReceiveCall, env: &mut impl Ext, ) -> Result, Error> { - let transfer_is_allowed_for_holder_worst_case_weight = + let best_case_weight = + ::WeightInfo::transfer_is_allowed_for_holder_best_case(); + let worst_case_weight = ::WeightInfo::transfer_is_allowed_for_holder_worst_case(); - let charged = env.charge(transfer_is_allowed_for_holder_worst_case_weight)?; + let charged = env.charge(worst_case_weight)?; let receiver = Common::::asset_holder(env, call.account)?; - let mut weight_meter = WeightMeter::max_limit_no_minimum(); + // The best case covers the fixed work, the meter only gets the variable rest + let mut weight_meter = WeightMeter::from_limit_unchecked( + Weight::zero(), + worst_case_weight.saturating_sub(best_case_weight), + ); let allowed = pallet_asset::Pallet::::transfer_is_allowed_for_holder( &receiver, &asset_id, @@ -212,17 +225,13 @@ impl FungibleAssetInterface { &mut weight_meter, ); - let transfer_is_allowed_weight = - ::WeightInfo::transfer_is_allowed_for_holder_best_case(); - let compliance_weight = weight_meter.consumed(); - let real_consumed_weight = transfer_is_allowed_weight.saturating_add(compliance_weight); - - if real_consumed_weight.ref_time() - < transfer_is_allowed_for_holder_worst_case_weight.ref_time() - { - env.adjust_gas(charged, real_consumed_weight); + if weight_meter.limit_exceeded() { + return Err(revert(ERR_WEIGHT_LIMIT_EXCEEDED)); } + let real_consumed_weight = best_case_weight.saturating_add(weight_meter.consumed()); + env.adjust_gas(charged, real_consumed_weight.min(worst_case_weight)); + Ok(IFungibleAsset::canReceiveCall::abi_encode_returns(&allowed)) } } diff --git a/pallets/precompiles/src/interface/nft/erc7943.rs b/pallets/precompiles/src/interface/nft/erc7943.rs index 6122cf2fe4..99890a664e 100644 --- a/pallets/precompiles/src/interface/nft/erc7943.rs +++ b/pallets/precompiles/src/interface/nft/erc7943.rs @@ -29,7 +29,7 @@ use polymesh_primitives::nft::NFTs; use polymesh_primitives::WeightMeter; use sp_runtime::Weight; -use crate::common::Common; +use crate::common::{revert, Common, ERR_WEIGHT_LIMIT_EXCEEDED}; use crate::interface::nft::NonFungibleAssetInterface; use crate::Config; @@ -40,6 +40,8 @@ impl NonFungibleAssetInterface { call: &INonFungibleAsset::canTransferCall, env: &mut impl Ext, ) -> Result, Error> { + let best_case_weight = + ::WeightInfo::nft_transfer_report_best_case(); let worst_case_weight = ::WeightInfo::nft_transfer_report_worst_case(); let charged = env.charge(worst_case_weight)?; @@ -49,7 +51,11 @@ impl NonFungibleAssetInterface { let to = Common::::asset_holder(env, call.to)?; let nfts = NFTs::new_unverified(asset_id, vec![nft_id]); - let mut weight_meter = WeightMeter::from_limit_unchecked(Weight::zero(), worst_case_weight); + // The best case covers the fixed work, the meter only gets the variable rest + let mut weight_meter = WeightMeter::from_limit_unchecked( + Weight::zero(), + worst_case_weight.saturating_sub(best_case_weight), + ); let errors = pallet_nft::Pallet::::nft_transfer_report( &from, &to, @@ -58,15 +64,13 @@ impl NonFungibleAssetInterface { &mut weight_meter, ); - let transfer_report_weight = - ::WeightInfo::nft_transfer_report_best_case(); - let compliance_weight = weight_meter.consumed(); - let real_consumed_weight = transfer_report_weight.saturating_add(compliance_weight); - - if real_consumed_weight.ref_time() < worst_case_weight.ref_time() { - env.adjust_gas(charged, real_consumed_weight); + if weight_meter.limit_exceeded() { + return Err(revert(ERR_WEIGHT_LIMIT_EXCEEDED)); } + let real_consumed_weight = best_case_weight.saturating_add(weight_meter.consumed()); + env.adjust_gas(charged, real_consumed_weight.min(worst_case_weight)); + Ok(INonFungibleAsset::canTransferCall::abi_encode_returns( &errors.is_empty(), )) @@ -127,13 +131,19 @@ impl NonFungibleAssetInterface { call: &INonFungibleAsset::canSendCall, env: &mut impl Ext, ) -> Result, Error> { + let best_case_weight = + ::WeightInfo::transfer_is_allowed_for_holder_best_case(); let worst_case_weight = ::WeightInfo::transfer_is_allowed_for_holder_worst_case(); let charged = env.charge(worst_case_weight)?; let sender = Common::::asset_holder(env, call.account)?; - let mut weight_meter = WeightMeter::max_limit_no_minimum(); + // The best case covers the fixed work, the meter only gets the variable rest + let mut weight_meter = WeightMeter::from_limit_unchecked( + Weight::zero(), + worst_case_weight.saturating_sub(best_case_weight), + ); let allowed = pallet_asset::Pallet::::transfer_is_allowed_for_holder( &sender, &asset_id, @@ -141,14 +151,13 @@ impl NonFungibleAssetInterface { &mut weight_meter, ); - let best_case_weight = - ::WeightInfo::transfer_is_allowed_for_holder_best_case(); - let real_consumed_weight = best_case_weight.saturating_add(weight_meter.consumed()); - - if real_consumed_weight.ref_time() < worst_case_weight.ref_time() { - env.adjust_gas(charged, real_consumed_weight); + if weight_meter.limit_exceeded() { + return Err(revert(ERR_WEIGHT_LIMIT_EXCEEDED)); } + let real_consumed_weight = best_case_weight.saturating_add(weight_meter.consumed()); + env.adjust_gas(charged, real_consumed_weight.min(worst_case_weight)); + Ok(INonFungibleAsset::canSendCall::abi_encode_returns(&allowed)) } @@ -158,13 +167,19 @@ impl NonFungibleAssetInterface { call: &INonFungibleAsset::canReceiveCall, env: &mut impl Ext, ) -> Result, Error> { + let best_case_weight = + ::WeightInfo::transfer_is_allowed_for_holder_best_case(); let worst_case_weight = ::WeightInfo::transfer_is_allowed_for_holder_worst_case(); let charged = env.charge(worst_case_weight)?; let receiver = Common::::asset_holder(env, call.account)?; - let mut weight_meter = WeightMeter::max_limit_no_minimum(); + // The best case covers the fixed work, the meter only gets the variable rest + let mut weight_meter = WeightMeter::from_limit_unchecked( + Weight::zero(), + worst_case_weight.saturating_sub(best_case_weight), + ); let allowed = pallet_asset::Pallet::::transfer_is_allowed_for_holder( &receiver, &asset_id, @@ -172,14 +187,13 @@ impl NonFungibleAssetInterface { &mut weight_meter, ); - let best_case_weight = - ::WeightInfo::transfer_is_allowed_for_holder_best_case(); - let real_consumed_weight = best_case_weight.saturating_add(weight_meter.consumed()); - - if real_consumed_weight.ref_time() < worst_case_weight.ref_time() { - env.adjust_gas(charged, real_consumed_weight); + if weight_meter.limit_exceeded() { + return Err(revert(ERR_WEIGHT_LIMIT_EXCEEDED)); } + let real_consumed_weight = best_case_weight.saturating_add(weight_meter.consumed()); + env.adjust_gas(charged, real_consumed_weight.min(worst_case_weight)); + Ok(INonFungibleAsset::canReceiveCall::abi_encode_returns( &allowed, )) diff --git a/pallets/runtime/tests/src/storage.rs b/pallets/runtime/tests/src/storage.rs index aea76956c6..412e3a49c1 100644 --- a/pallets/runtime/tests/src/storage.rs +++ b/pallets/runtime/tests/src/storage.rs @@ -575,11 +575,6 @@ parameter_types! { pub const MaxConditionComplexity: u32 = 50; pub const MaximumNumberOfTrustedIssuers: u32 = 8; pub const MaxTrustedIssuerClaimTypes: u32 = 16; - pub const MaxDefaultTrustedClaimIssuers: usize = 10; - pub const MaxTrustedIssuerPerCondition: usize = 10; - pub const MaxSenderConditionsPerCompliance: usize = 30; - pub const MaxReceiverConditionsPerCompliance: usize = 30; - pub const MaxCompliancePerRequirement: usize = 10; pub MaximumSchedulerWeight: Weight = Perbill::from_percent(80) * MaximumBlockWeight::get(); pub const MaxScheduledPerBlock: u32 = 50; diff --git a/primitives/src/weight_meter.rs b/primitives/src/weight_meter.rs index 00fff096b9..25a91718c4 100644 --- a/primitives/src/weight_meter.rs +++ b/primitives/src/weight_meter.rs @@ -21,6 +21,7 @@ use scale_info::prelude::string::String; pub struct WeightMeter { minimum_charge: Weight, meter: FrameWeightMeter, + limit_exceeded: bool, } impl WeightMeter { @@ -39,6 +40,7 @@ impl WeightMeter { Self { minimum_charge, meter: FrameWeightMeter::with_limit(limit), + limit_exceeded: false, } } @@ -51,6 +53,7 @@ impl WeightMeter { Some(Self { minimum_charge, meter: FrameWeightMeter::with_limit(limit), + limit_exceeded: false, }) } @@ -59,6 +62,7 @@ impl WeightMeter { Self { minimum_charge, meter: FrameWeightMeter::new(), + limit_exceeded: false, } } @@ -67,6 +71,7 @@ impl WeightMeter { Self { minimum_charge: Weight::zero(), meter: FrameWeightMeter::new(), + limit_exceeded: false, } } @@ -83,11 +88,17 @@ impl WeightMeter { self.meter.limit() } + /// Returns `true` if any attempt to consume weight went over the limit. + pub fn limit_exceeded(&self) -> bool { + self.limit_exceeded + } + /// Consumes the given weight after checking that it can be consumed. Returns an error otherwise. pub fn check_accrue(&mut self, weight: Weight) -> Result<(), String> { - self.meter - .try_consume(weight) - .map_err(|_| "Maximum weight limit exceeded")?; + if self.meter.try_consume(weight).is_err() { + self.limit_exceeded = true; + return Err(String::from("Maximum weight limit exceeded")); + } Ok(()) } From 1942b9b13e54ad3765ff6f7e0c3c2c465b7259d1 Mon Sep 17 00:00:00 2001 From: Henrique Nogara Date: Sat, 10 Oct 2026 13:43:43 -0300 Subject: [PATCH 12/12] Add compliance weights --- .../weights/src/pallet_compliance_manager.rs | 110 +++++++++--------- 1 file changed, 56 insertions(+), 54 deletions(-) diff --git a/pallets/weights/src/pallet_compliance_manager.rs b/pallets/weights/src/pallet_compliance_manager.rs index 75e6ddf6a7..d15dfbce27 100644 --- a/pallets/weights/src/pallet_compliance_manager.rs +++ b/pallets/weights/src/pallet_compliance_manager.rs @@ -4,12 +4,12 @@ //! Autogenerated weights for pallet_compliance_manager //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 54.0.0 -//! DATE: 2026-05-11, STEPS: `100`, REPEAT: 5, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2026-10-10, STEPS: `100`, REPEAT: 5, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 512 //! HOSTNAME: `ubuntu-8gb-hel1-bench`, CPU: `AMD EPYC-Milan Processor` // Executed Command: -// ./target/release/polymesh +// ./polymesh // benchmark // pallet // -s @@ -22,10 +22,14 @@ // 4096 // --db-cache // 512 +// --execution +// wasm +// --wasm-execution +// compiled // --output -// ./pallets/weights/src/ +// . // --template -// ./.maintain/frame-weight-template.hbs +// Polymesh/.maintain/frame-weight-template.hbs #![allow(unused_parens)] #![allow(unused_imports)] @@ -38,18 +42,16 @@ impl pallet_compliance_manager::WeightInfo for SubstrateWeight { /// The range of component `a` is `[1, 10]`. /// The range of component `b` is `[1, 10]`. /// The range of component `c` is `[1, 10]`. - /// The range of component `d` is `[1, 10]`. - fn condition_costs(a: u32, b: u32, c: u32, d: u32) -> Weight { - // Minimum execution time: 9_230 nanoseconds. - Weight::from_parts(9_530_000, 0) - // Standard Error: 33_851 - .saturating_add(Weight::from_parts(4_833_035, 0).saturating_mul(a.into())) - // Standard Error: 33_851 - .saturating_add(Weight::from_parts(618_474, 0).saturating_mul(b.into())) - // Standard Error: 33_851 - .saturating_add(Weight::from_parts(1_400_830, 0).saturating_mul(c.into())) - // Manually set for `d` - .saturating_add(Weight::from_parts(721_394, 0).saturating_mul(d.into())) + /// The range of component `d` is `[1, 16]`. + fn condition_costs(a: u32, b: u32, c: u32, _d: u32) -> Weight { + // Minimum execution time: 9_540 nanoseconds. + Weight::from_parts(10_060_000, 0) + // Standard Error: 39_969 + .saturating_add(Weight::from_parts(4_812_259, 0).saturating_mul(a.into())) + // Standard Error: 39_969 + .saturating_add(Weight::from_parts(169_674, 0).saturating_mul(b.into())) + // Standard Error: 39_969 + .saturating_add(Weight::from_parts(1_545_970, 0).saturating_mul(c.into())) } // Storage: `Identity::KeyRecords` (r:1 w:0) // Proof: `Identity::KeyRecords` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) @@ -69,10 +71,10 @@ impl pallet_compliance_manager::WeightInfo for SubstrateWeight { // Proof: `ProtocolFee::BaseFees` (`max_values`: None, `max_size`: Some(25), added: 2500, mode: `MaxEncodedLen`) /// The range of component `c` is `[1, 6]`. fn add_compliance_requirement(c: u32) -> Weight { - // Minimum execution time: 51_299 nanoseconds. - Weight::from_parts(54_176_793, 0) - // Standard Error: 24_126 - .saturating_add(Weight::from_parts(1_403_313, 0).saturating_mul(c.into())) + // Minimum execution time: 53_290 nanoseconds. + Weight::from_parts(58_136_752, 0) + // Standard Error: 36_608 + .saturating_add(Weight::from_parts(1_445_724, 0).saturating_mul(c.into())) .saturating_add(DbWeight::get().reads(8)) .saturating_add(DbWeight::get().writes(1)) } @@ -87,8 +89,8 @@ impl pallet_compliance_manager::WeightInfo for SubstrateWeight { // Storage: `ComplianceManager::AssetCompliances` (r:1 w:1) // Proof: `ComplianceManager::AssetCompliances` (`max_values`: None, `max_size`: None, mode: `Measured`) fn remove_compliance_requirement() -> Weight { - // Minimum execution time: 39_980 nanoseconds. - Weight::from_parts(42_959_000, 0) + // Minimum execution time: 40_150 nanoseconds. + Weight::from_parts(43_850_000, 0) .saturating_add(DbWeight::get().reads(5)) .saturating_add(DbWeight::get().writes(1)) } @@ -103,8 +105,8 @@ impl pallet_compliance_manager::WeightInfo for SubstrateWeight { // Storage: `ComplianceManager::AssetCompliances` (r:1 w:1) // Proof: `ComplianceManager::AssetCompliances` (`max_values`: None, `max_size`: None, mode: `Measured`) fn pause_asset_compliance() -> Weight { - // Minimum execution time: 41_680 nanoseconds. - Weight::from_parts(44_451_000, 0) + // Minimum execution time: 42_850 nanoseconds. + Weight::from_parts(46_270_000, 0) .saturating_add(DbWeight::get().reads(5)) .saturating_add(DbWeight::get().writes(1)) } @@ -119,8 +121,8 @@ impl pallet_compliance_manager::WeightInfo for SubstrateWeight { // Storage: `ComplianceManager::AssetCompliances` (r:1 w:1) // Proof: `ComplianceManager::AssetCompliances` (`max_values`: None, `max_size`: None, mode: `Measured`) fn resume_asset_compliance() -> Weight { - // Minimum execution time: 37_760 nanoseconds. - Weight::from_parts(40_549_000, 0) + // Minimum execution time: 36_400 nanoseconds. + Weight::from_parts(40_010_000, 0) .saturating_add(DbWeight::get().reads(5)) .saturating_add(DbWeight::get().writes(1)) } @@ -139,8 +141,8 @@ impl pallet_compliance_manager::WeightInfo for SubstrateWeight { // Storage: `ComplianceManager::AssetCompliances` (r:1 w:0) // Proof: `ComplianceManager::AssetCompliances` (`max_values`: None, `max_size`: None, mode: `Measured`) fn add_default_trusted_claim_issuer() -> Weight { - // Minimum execution time: 47_530 nanoseconds. - Weight::from_parts(51_120_000, 0) + // Minimum execution time: 53_510 nanoseconds. + Weight::from_parts(58_340_000, 0) .saturating_add(DbWeight::get().reads(7)) .saturating_add(DbWeight::get().writes(1)) } @@ -155,8 +157,8 @@ impl pallet_compliance_manager::WeightInfo for SubstrateWeight { // Storage: `ComplianceManager::TrustedClaimIssuer` (r:1 w:1) // Proof: `ComplianceManager::TrustedClaimIssuer` (`max_values`: None, `max_size`: None, mode: `Measured`) fn remove_default_trusted_claim_issuer() -> Weight { - // Minimum execution time: 37_250 nanoseconds. - Weight::from_parts(39_870_000, 0) + // Minimum execution time: 40_960 nanoseconds. + Weight::from_parts(44_540_000, 0) .saturating_add(DbWeight::get().reads(5)) .saturating_add(DbWeight::get().writes(1)) } @@ -174,10 +176,10 @@ impl pallet_compliance_manager::WeightInfo for SubstrateWeight { // Proof: `ComplianceManager::TrustedClaimIssuer` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `c` is `[1, 6]`. fn change_compliance_requirement(c: u32) -> Weight { - // Minimum execution time: 47_100 nanoseconds. - Weight::from_parts(49_188_742, 0) - // Standard Error: 21_690 - .saturating_add(Weight::from_parts(1_338_523, 0).saturating_mul(c.into())) + // Minimum execution time: 49_270 nanoseconds. + Weight::from_parts(51_593_379, 0) + // Standard Error: 44_721 + .saturating_add(Weight::from_parts(2_259_890, 0).saturating_mul(c.into())) .saturating_add(DbWeight::get().reads(6)) .saturating_add(DbWeight::get().writes(1)) } @@ -195,10 +197,10 @@ impl pallet_compliance_manager::WeightInfo for SubstrateWeight { // Proof: `ComplianceManager::AssetCompliances` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `c` is `[0, 2]`. fn replace_asset_compliance(c: u32) -> Weight { - // Minimum execution time: 43_440 nanoseconds. - Weight::from_parts(46_968_011, 0) - // Standard Error: 74_134 - .saturating_add(Weight::from_parts(10_112_963, 0).saturating_mul(c.into())) + // Minimum execution time: 42_930 nanoseconds. + Weight::from_parts(46_789_508, 0) + // Standard Error: 56_460 + .saturating_add(Weight::from_parts(10_307_431, 0).saturating_mul(c.into())) .saturating_add(DbWeight::get().reads(6)) .saturating_add(DbWeight::get().writes(1)) } @@ -213,8 +215,8 @@ impl pallet_compliance_manager::WeightInfo for SubstrateWeight { // Storage: `ComplianceManager::AssetCompliances` (r:0 w:1) // Proof: `ComplianceManager::AssetCompliances` (`max_values`: None, `max_size`: None, mode: `Measured`) fn reset_asset_compliance() -> Weight { - // Minimum execution time: 29_020 nanoseconds. - Weight::from_parts(31_080_000, 0) + // Minimum execution time: 29_840 nanoseconds. + Weight::from_parts(32_700_000, 0) .saturating_add(DbWeight::get().reads(4)) .saturating_add(DbWeight::get().writes(1)) } @@ -227,12 +229,12 @@ impl pallet_compliance_manager::WeightInfo for SubstrateWeight { /// The range of component `c` is `[1, 400]`. /// The range of component `t` is `[0, 1]`. fn is_condition_satisfied(c: u32, t: u32) -> Weight { - // Minimum execution time: 19_890 nanoseconds. - Weight::from_parts(9_479_480, 0) - // Standard Error: 5_788 - .saturating_add(Weight::from_parts(4_638_479, 0).saturating_mul(c.into())) - // Standard Error: 1_528_683 - .saturating_add(Weight::from_parts(4_691_403, 0).saturating_mul(t.into())) + // Minimum execution time: 18_770 nanoseconds. + Weight::from_parts(18_104_679, 0) + // Standard Error: 11_831 + .saturating_add(Weight::from_parts(4_536_799, 0).saturating_mul(c.into())) + // Standard Error: 3_124_341 + .saturating_add(Weight::from_parts(3_451_180, 0).saturating_mul(t.into())) .saturating_add(DbWeight::get().reads(1)) .saturating_add(DbWeight::get().reads((1_u64).saturating_mul(c.into()))) .saturating_add(DbWeight::get().reads((1_u64).saturating_mul(t.into()))) @@ -241,17 +243,17 @@ impl pallet_compliance_manager::WeightInfo for SubstrateWeight { // Proof: `ExternalAgents::GroupOfAgent` (`max_values`: None, `max_size`: Some(77), added: 2552, mode: `MaxEncodedLen`) /// The range of component `e` is `[0, 1]`. fn is_identity_condition(e: u32) -> Weight { - // Minimum execution time: 350 nanoseconds. - Weight::from_parts(493_197, 0) - // Standard Error: 4_217 - .saturating_add(Weight::from_parts(9_622_342, 0).saturating_mul(e.into())) + // Minimum execution time: 260 nanoseconds. + Weight::from_parts(454_114, 0) + // Standard Error: 4_604 + .saturating_add(Weight::from_parts(9_621_552, 0).saturating_mul(e.into())) .saturating_add(DbWeight::get().reads((1_u64).saturating_mul(e.into()))) } /// The range of component `i` is `[0, 10000]`. fn is_any_requirement_compliant(i: u32) -> Weight { - // Minimum execution time: 190 nanoseconds. - Weight::from_parts(220_000, 0) - // Standard Error: 11 - .saturating_add(Weight::from_parts(49_590, 0).saturating_mul(i.into())) + // Minimum execution time: 200 nanoseconds. + Weight::from_parts(250_000, 0) + // Standard Error: 21 + .saturating_add(Weight::from_parts(49_027, 0).saturating_mul(i.into())) } }