diff --git a/cumulus/parachains/integration-tests/emulated/common/src/impls.rs b/cumulus/parachains/integration-tests/emulated/common/src/impls.rs index 09b0faf0fecce..273580096e21a 100644 --- a/cumulus/parachains/integration-tests/emulated/common/src/impls.rs +++ b/cumulus/parachains/integration-tests/emulated/common/src/impls.rs @@ -860,7 +860,7 @@ macro_rules! impl_foreign_assets_helpers_for_parachain { ]>::ForeignAssets::set_reserves( owner_origin, id.clone(), - reserves, + reserves.try_into().unwrap(), ) ); }); diff --git a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/foreign_assets.rs b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/foreign_assets.rs index 992fec92f323c..f5ccdd25dda0c 100644 --- a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/foreign_assets.rs +++ b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend/src/tests/foreign_assets.rs @@ -114,7 +114,7 @@ pub fn penpal_set_foreign_asset_reserves_on_asset_hub( pallet_assets::Instance2, >::set_reserves { id: asset_id_on_ah.into(), - reserves, + reserves: reserves.try_into().unwrap(), }) .encode() .into(); @@ -483,7 +483,7 @@ fn verify_foreign_asset_origin_checks() { ::ForeignAssets::set_reserves( origin, foreign_asset_location_on_ah.clone(), - vec![reserves_data.clone()], + vec![reserves_data.clone()].try_into().unwrap(), ) .unwrap(); assert_expected_events!( @@ -501,7 +501,7 @@ fn verify_foreign_asset_origin_checks() { assert!(::ForeignAssets::set_reserves( origin, foreign_asset_location_on_ah.clone(), - vec![reserves_data], + vec![reserves_data].try_into().unwrap(), ) .is_err()); }); diff --git a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_assets_foreign.rs b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_assets_foreign.rs index 0c4e92392322f..8240ca7b0b918 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_assets_foreign.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_assets_foreign.rs @@ -49,6 +49,7 @@ use core::marker::PhantomData; /// Weight functions for `pallet_assets`. pub struct WeightInfo(PhantomData); + impl pallet_assets::WeightInfo for WeightInfo { /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) @@ -109,7 +110,7 @@ impl pallet_assets::WeightInfo for WeightInfo { /// The range of component `c` is `[0, 1000]`. /// The range of component `c` is `[0, 1000]`. /// The range of component `c` is `[0, 1000]`. - fn destroy_accounts(c: u32, ) -> Weight { + fn destroy_accounts(c: u32) -> Weight { // Proof Size summary in bytes: // Measured: `0 + c * (208 ±0)` // Estimated: `4273 + c * (3207 ±0)` @@ -131,7 +132,7 @@ impl pallet_assets::WeightInfo for WeightInfo { /// The range of component `a` is `[0, 1000]`. /// The range of component `a` is `[0, 1000]`. /// The range of component `a` is `[0, 1000]`. - fn destroy_approvals(a: u32, ) -> Weight { + fn destroy_approvals(a: u32) -> Weight { // Proof Size summary in bytes: // Measured: `413 + a * (86 ±0)` // Estimated: `4273 + a * (3221 ±0)` @@ -338,7 +339,7 @@ impl pallet_assets::WeightInfo for WeightInfo { /// The range of component `s` is `[0, 50]`. /// The range of component `n` is `[0, 50]`. /// The range of component `s` is `[0, 50]`. - fn set_metadata(_n: u32, s: u32, ) -> Weight { + fn set_metadata(_n: u32, s: u32) -> Weight { // Proof Size summary in bytes: // Measured: `242` // Estimated: `4273` @@ -374,7 +375,7 @@ impl pallet_assets::WeightInfo for WeightInfo { /// The range of component `s` is `[0, 50]`. /// The range of component `n` is `[0, 50]`. /// The range of component `s` is `[0, 50]`. - fn force_set_metadata(n: u32, s: u32, ) -> Weight { + fn force_set_metadata(n: u32, s: u32) -> Weight { // Proof Size summary in bytes: // Measured: `81` // Estimated: `4273` @@ -625,8 +626,13 @@ impl pallet_assets::WeightInfo for WeightInfo { .saturating_add(Weight::from_parts(0, 4211)) .saturating_add(T::DbWeight::get().reads(1)) } - fn set_reserves() -> Weight { + /// The range of component `n` is `[0, 5]`. + /// The range of component `n` is `[0, 5]`. + /// The range of component `n` is `[0, 5]`. + fn set_reserves(n: u32) -> Weight { Weight::from_parts(31_972_000, 3675) + // Standard Error: 13_748 + .saturating_add(Weight::from_parts(198_975, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } diff --git a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_assets_local.rs b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_assets_local.rs index 912516b0d8bf4..4e4cfd96c62e6 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_assets_local.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_assets_local.rs @@ -49,6 +49,7 @@ use core::marker::PhantomData; /// Weight functions for `pallet_assets`. pub struct WeightInfo(PhantomData); + impl pallet_assets::WeightInfo for WeightInfo { /// Storage: `Assets::Asset` (r:1 w:1) /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) @@ -107,7 +108,7 @@ impl pallet_assets::WeightInfo for WeightInfo { /// The range of component `c` is `[0, 1000]`. /// The range of component `c` is `[0, 1000]`. /// The range of component `c` is `[0, 1000]`. - fn destroy_accounts(c: u32, ) -> Weight { + fn destroy_accounts(c: u32) -> Weight { // Proof Size summary in bytes: // Measured: `0 + c * (208 ±0)` // Estimated: `3675 + c * (2609 ±0)` @@ -129,7 +130,7 @@ impl pallet_assets::WeightInfo for WeightInfo { /// The range of component `a` is `[0, 1000]`. /// The range of component `a` is `[0, 1000]`. /// The range of component `a` is `[0, 1000]`. - fn destroy_approvals(a: u32, ) -> Weight { + fn destroy_approvals(a: u32) -> Weight { // Proof Size summary in bytes: // Measured: `451 + a * (86 ±0)` // Estimated: `3675 + a * (2623 ±0)` @@ -336,7 +337,7 @@ impl pallet_assets::WeightInfo for WeightInfo { /// The range of component `s` is `[0, 50]`. /// The range of component `n` is `[0, 50]`. /// The range of component `s` is `[0, 50]`. - fn set_metadata(_n: u32, _s: u32, ) -> Weight { + fn set_metadata(_n: u32, _s: u32) -> Weight { // Proof Size summary in bytes: // Measured: `280` // Estimated: `3675` @@ -370,7 +371,7 @@ impl pallet_assets::WeightInfo for WeightInfo { /// The range of component `s` is `[0, 50]`. /// The range of component `n` is `[0, 50]`. /// The range of component `s` is `[0, 50]`. - fn force_set_metadata(n: u32, s: u32, ) -> Weight { + fn force_set_metadata(n: u32, s: u32) -> Weight { // Proof Size summary in bytes: // Measured: `119` // Estimated: `3675` @@ -621,8 +622,13 @@ impl pallet_assets::WeightInfo for WeightInfo { .saturating_add(Weight::from_parts(0, 3613)) .saturating_add(T::DbWeight::get().reads(1)) } - fn set_reserves() -> Weight { + /// The range of component `n` is `[0, 5]`. + /// The range of component `n` is `[0, 5]`. + /// The range of component `n` is `[0, 5]`. + fn set_reserves(n: u32) -> Weight { Weight::from_parts(31_972_000, 3675) + // Standard Error: 13_748 + .saturating_add(Weight::from_parts(198_975, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } diff --git a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_assets_pool.rs b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_assets_pool.rs index 54c84d06d35f5..0b0e9bde4ba82 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_assets_pool.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_assets_pool.rs @@ -49,6 +49,7 @@ use core::marker::PhantomData; /// Weight functions for `pallet_assets`. pub struct WeightInfo(PhantomData); + impl pallet_assets::WeightInfo for WeightInfo { /// Storage: `PoolAssets::Asset` (r:1 w:1) /// Proof: `PoolAssets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) @@ -105,7 +106,7 @@ impl pallet_assets::WeightInfo for WeightInfo { /// The range of component `c` is `[0, 1000]`. /// The range of component `c` is `[0, 1000]`. /// The range of component `c` is `[0, 1000]`. - fn destroy_accounts(c: u32, ) -> Weight { + fn destroy_accounts(c: u32) -> Weight { // Proof Size summary in bytes: // Measured: `0 + c * (208 ±0)` // Estimated: `3675 + c * (2609 ±0)` @@ -127,7 +128,7 @@ impl pallet_assets::WeightInfo for WeightInfo { /// The range of component `a` is `[0, 1000]`. /// The range of component `a` is `[0, 1000]`. /// The range of component `a` is `[0, 1000]`. - fn destroy_approvals(a: u32, ) -> Weight { + fn destroy_approvals(a: u32) -> Weight { // Proof Size summary in bytes: // Measured: `451 + a * (86 ±0)` // Estimated: `3675 + a * (2623 ±0)` @@ -334,7 +335,7 @@ impl pallet_assets::WeightInfo for WeightInfo { /// The range of component `s` is `[0, 50]`. /// The range of component `n` is `[0, 50]`. /// The range of component `s` is `[0, 50]`. - fn set_metadata(n: u32, _s: u32, ) -> Weight { + fn set_metadata(n: u32, _s: u32) -> Weight { // Proof Size summary in bytes: // Measured: `280` // Estimated: `3675` @@ -370,7 +371,7 @@ impl pallet_assets::WeightInfo for WeightInfo { /// The range of component `s` is `[0, 50]`. /// The range of component `n` is `[0, 50]`. /// The range of component `s` is `[0, 50]`. - fn force_set_metadata(_n: u32, s: u32, ) -> Weight { + fn force_set_metadata(_n: u32, s: u32) -> Weight { // Proof Size summary in bytes: // Measured: `119` // Estimated: `3675` @@ -615,8 +616,13 @@ impl pallet_assets::WeightInfo for WeightInfo { .saturating_add(Weight::from_parts(0, 3613)) .saturating_add(T::DbWeight::get().reads(1)) } - fn set_reserves() -> Weight { + /// The range of component `n` is `[0, 5]`. + /// The range of component `n` is `[0, 5]`. + /// The range of component `n` is `[0, 5]`. + fn set_reserves(n: u32) -> Weight { Weight::from_parts(31_972_000, 3675) + // Standard Error: 13_748 + .saturating_add(Weight::from_parts(198_975, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs index caf04479288b3..ae3de3d558df8 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs @@ -2473,7 +2473,7 @@ pallet_revive::impl_runtime_apis_plus_revive_traits!( assert_ok!(ForeignAssets::set_reserves( RuntimeOrigin::signed(account), roc_id.clone().into(), - vec![reserves.clone()], + vec![reserves.clone()].try_into().unwrap(), )); (reserves.reserve, roc) }); diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_assets_foreign.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_assets_foreign.rs index 8e5cd6b9fee21..0c46c2ccb0fee 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_assets_foreign.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_assets_foreign.rs @@ -16,9 +16,9 @@ //! Autogenerated weights for `pallet_assets` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-10-22, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-12-24, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `2ee62bdee63c`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `1ad128e84c6f`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: @@ -62,8 +62,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1348` // Estimated: `4273` - // Minimum execution time: 39_569_000 picoseconds. - Weight::from_parts(41_071_000, 0) + // Minimum execution time: 62_012_000 picoseconds. + Weight::from_parts(67_369_000, 0) .saturating_add(Weight::from_parts(0, 4273)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) @@ -76,8 +76,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `4` // Estimated: `4273` - // Minimum execution time: 12_476_000 picoseconds. - Weight::from_parts(13_054_000, 0) + // Minimum execution time: 17_025_000 picoseconds. + Weight::from_parts(18_562_000, 0) .saturating_add(Weight::from_parts(0, 4273)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -90,8 +90,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `360` // Estimated: `4273` - // Minimum execution time: 19_797_000 picoseconds. - Weight::from_parts(20_726_000, 0) + // Minimum execution time: 28_762_000 picoseconds. + Weight::from_parts(29_866_000, 0) .saturating_add(Weight::from_parts(0, 4273)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -111,13 +111,13 @@ impl pallet_assets::WeightInfo for WeightInfo { /// The range of component `c` is `[0, 1000]`. fn destroy_accounts(c: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `67849 + c * (419 ±0)` + // Measured: `68635 + c * (424 ±0)` // Estimated: `4273 + c * (3207 ±0)` - // Minimum execution time: 17_360_000 picoseconds. - Weight::from_parts(17_713_000, 0) + // Minimum execution time: 23_400_000 picoseconds. + Weight::from_parts(23_918_000, 0) .saturating_add(Weight::from_parts(0, 4273)) - // Standard Error: 27_481 - .saturating_add(Weight::from_parts(38_560_758, 0).saturating_mul(c.into())) + // Standard Error: 40_830 + .saturating_add(Weight::from_parts(46_080_612, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((4_u64).saturating_mul(c.into()))) .saturating_add(T::DbWeight::get().writes(1)) @@ -135,11 +135,11 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `413 + a * (86 ±0)` // Estimated: `4273 + a * (3221 ±0)` - // Minimum execution time: 18_228_000 picoseconds. - Weight::from_parts(18_810_000, 0) + // Minimum execution time: 25_836_000 picoseconds. + Weight::from_parts(26_811_000, 0) .saturating_add(Weight::from_parts(0, 4273)) - // Standard Error: 7_645 - .saturating_add(Weight::from_parts(18_846_821, 0).saturating_mul(a.into())) + // Standard Error: 31_359 + .saturating_add(Weight::from_parts(25_818_865, 0).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(1)) @@ -150,15 +150,17 @@ impl pallet_assets::WeightInfo for WeightInfo { /// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(808), added: 3283, mode: `MaxEncodedLen`) /// Storage: `ForeignAssets::Metadata` (r:1 w:0) /// Proof: `ForeignAssets::Metadata` (`max_values`: None, `max_size`: Some(738), added: 3213, mode: `MaxEncodedLen`) + /// Storage: `ForeignAssets::Reserves` (r:0 w:1) + /// Proof: `ForeignAssets::Reserves` (`max_values`: None, `max_size`: Some(3634), added: 6109, mode: `MaxEncodedLen`) fn finish_destroy() -> Weight { // Proof Size summary in bytes: // Measured: `242` // Estimated: `4273` - // Minimum execution time: 14_576_000 picoseconds. - Weight::from_parts(15_595_000, 0) + // Minimum execution time: 23_915_000 picoseconds. + Weight::from_parts(24_792_000, 0) .saturating_add(Weight::from_parts(0, 4273)) .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(T::DbWeight::get().writes(2)) } /// Storage: `ForeignAssets::Asset` (r:1 w:1) /// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(808), added: 3283, mode: `MaxEncodedLen`) @@ -168,8 +170,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `242` // Estimated: `4273` - // Minimum execution time: 25_596_000 picoseconds. - Weight::from_parts(26_675_000, 0) + // Minimum execution time: 37_316_000 picoseconds. + Weight::from_parts(38_771_000, 0) .saturating_add(Weight::from_parts(0, 4273)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -186,8 +188,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `430` // Estimated: `4273` - // Minimum execution time: 57_339_000 picoseconds. - Weight::from_parts(58_934_000, 0) + // Minimum execution time: 77_083_000 picoseconds. + Weight::from_parts(81_771_000, 0) .saturating_add(Weight::from_parts(0, 4273)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) @@ -204,10 +206,10 @@ impl pallet_assets::WeightInfo for WeightInfo { /// Proof: `ForeignAssetsFreezer::Freezes` (`max_values`: None, `max_size`: Some(703), added: 3178, mode: `MaxEncodedLen`) fn transfer() -> Weight { // Proof Size summary in bytes: - // Measured: `1719` + // Measured: `1752` // Estimated: `7404` - // Minimum execution time: 77_390_000 picoseconds. - Weight::from_parts(78_733_000, 0) + // Minimum execution time: 107_946_000 picoseconds. + Weight::from_parts(112_113_000, 0) .saturating_add(Weight::from_parts(0, 7404)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(6)) @@ -222,10 +224,10 @@ impl pallet_assets::WeightInfo for WeightInfo { /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) fn transfer_keep_alive() -> Weight { // Proof Size summary in bytes: - // Measured: `1719` + // Measured: `1752` // Estimated: `7404` - // Minimum execution time: 60_920_000 picoseconds. - Weight::from_parts(62_889_000, 0) + // Minimum execution time: 85_466_000 picoseconds. + Weight::from_parts(88_733_000, 0) .saturating_add(Weight::from_parts(0, 7404)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) @@ -242,10 +244,10 @@ impl pallet_assets::WeightInfo for WeightInfo { /// Proof: `ForeignAssetsFreezer::Freezes` (`max_values`: None, `max_size`: Some(703), added: 3178, mode: `MaxEncodedLen`) fn force_transfer() -> Weight { // Proof Size summary in bytes: - // Measured: `1719` + // Measured: `1752` // Estimated: `7404` - // Minimum execution time: 77_568_000 picoseconds. - Weight::from_parts(79_253_000, 0) + // Minimum execution time: 107_196_000 picoseconds. + Weight::from_parts(110_898_000, 0) .saturating_add(Weight::from_parts(0, 7404)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(6)) @@ -258,8 +260,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `350` // Estimated: `4273` - // Minimum execution time: 19_975_000 picoseconds. - Weight::from_parts(21_006_000, 0) + // Minimum execution time: 30_625_000 picoseconds. + Weight::from_parts(32_482_000, 0) .saturating_add(Weight::from_parts(0, 4273)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -272,8 +274,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `350` // Estimated: `4273` - // Minimum execution time: 19_799_000 picoseconds. - Weight::from_parts(20_563_000, 0) + // Minimum execution time: 30_649_000 picoseconds. + Weight::from_parts(32_249_000, 0) .saturating_add(Weight::from_parts(0, 4273)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -284,8 +286,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `276` // Estimated: `4273` - // Minimum execution time: 13_180_000 picoseconds. - Weight::from_parts(13_836_000, 0) + // Minimum execution time: 20_339_000 picoseconds. + Weight::from_parts(21_946_000, 0) .saturating_add(Weight::from_parts(0, 4273)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -296,8 +298,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `276` // Estimated: `4273` - // Minimum execution time: 12_913_000 picoseconds. - Weight::from_parts(13_453_000, 0) + // Minimum execution time: 19_813_000 picoseconds. + Weight::from_parts(21_255_000, 0) .saturating_add(Weight::from_parts(0, 4273)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -310,8 +312,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `242` // Estimated: `4273` - // Minimum execution time: 14_898_000 picoseconds. - Weight::from_parts(15_609_000, 0) + // Minimum execution time: 22_825_000 picoseconds. + Weight::from_parts(23_896_000, 0) .saturating_add(Weight::from_parts(0, 4273)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -322,8 +324,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `242` // Estimated: `4273` - // Minimum execution time: 12_851_000 picoseconds. - Weight::from_parts(13_466_000, 0) + // Minimum execution time: 19_693_000 picoseconds. + Weight::from_parts(21_208_000, 0) .saturating_add(Weight::from_parts(0, 4273)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -331,14 +333,19 @@ impl pallet_assets::WeightInfo for WeightInfo { /// Storage: `ForeignAssets::Asset` (r:1 w:0) /// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(808), added: 3283, mode: `MaxEncodedLen`) /// Storage: `ForeignAssets::Reserves` (r:0 w:1) - /// Proof: `ForeignAssets::Reserves` (`max_values`: None, `max_size`: Some(3629), added: 6104, mode: `MaxEncodedLen`) - fn set_reserves() -> Weight { + /// Proof: `ForeignAssets::Reserves` (`max_values`: None, `max_size`: Some(3634), added: 6109, mode: `MaxEncodedLen`) + /// The range of component `n` is `[0, 5]`. + /// The range of component `n` is `[0, 5]`. + /// The range of component `n` is `[0, 5]`. + fn set_reserves(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `242` // Estimated: `4273` - // Minimum execution time: 16_752_000 picoseconds. - Weight::from_parts(17_401_000, 0) + // Minimum execution time: 20_530_000 picoseconds. + Weight::from_parts(22_865_922, 0) .saturating_add(Weight::from_parts(0, 4273)) + // Standard Error: 14_472 + .saturating_add(Weight::from_parts(682_835, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -352,15 +359,13 @@ impl pallet_assets::WeightInfo for WeightInfo { /// The range of component `s` is `[0, 50]`. /// The range of component `n` is `[0, 50]`. /// The range of component `s` is `[0, 50]`. - fn set_metadata(_n: u32, s: u32, ) -> Weight { + fn set_metadata(_n: u32, _s: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `242` // Estimated: `4273` - // Minimum execution time: 30_005_000 picoseconds. - Weight::from_parts(32_577_235, 0) + // Minimum execution time: 45_661_000 picoseconds. + Weight::from_parts(55_804_037, 0) .saturating_add(Weight::from_parts(0, 4273)) - // Standard Error: 3_006 - .saturating_add(Weight::from_parts(9_047, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -372,8 +377,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `406` // Estimated: `4273` - // Minimum execution time: 32_623_000 picoseconds. - Weight::from_parts(33_415_000, 0) + // Minimum execution time: 46_847_000 picoseconds. + Weight::from_parts(49_276_000, 0) .saturating_add(Weight::from_parts(0, 4273)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -388,17 +393,15 @@ impl pallet_assets::WeightInfo for WeightInfo { /// The range of component `s` is `[0, 50]`. /// The range of component `n` is `[0, 50]`. /// The range of component `s` is `[0, 50]`. - fn force_set_metadata(n: u32, s: u32, ) -> Weight { + fn force_set_metadata(n: u32, _s: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `81` // Estimated: `4273` - // Minimum execution time: 13_053_000 picoseconds. - Weight::from_parts(14_088_046, 0) + // Minimum execution time: 19_328_000 picoseconds. + Weight::from_parts(21_195_675, 0) .saturating_add(Weight::from_parts(0, 4273)) - // Standard Error: 517 - .saturating_add(Weight::from_parts(322, 0).saturating_mul(n.into())) - // Standard Error: 517 - .saturating_add(Weight::from_parts(20, 0).saturating_mul(s.into())) + // Standard Error: 1_392 + .saturating_add(Weight::from_parts(6_716, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -410,8 +413,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `406` // Estimated: `4273` - // Minimum execution time: 31_563_000 picoseconds. - Weight::from_parts(32_811_000, 0) + // Minimum execution time: 45_087_000 picoseconds. + Weight::from_parts(47_268_000, 0) .saturating_add(Weight::from_parts(0, 4273)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -422,8 +425,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `242` // Estimated: `4273` - // Minimum execution time: 11_979_000 picoseconds. - Weight::from_parts(12_490_000, 0) + // Minimum execution time: 18_867_000 picoseconds. + Weight::from_parts(20_198_000, 0) .saturating_add(Weight::from_parts(0, 4273)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -436,8 +439,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `276` // Estimated: `4273` - // Minimum execution time: 35_262_000 picoseconds. - Weight::from_parts(36_597_000, 0) + // Minimum execution time: 48_541_000 picoseconds. + Weight::from_parts(51_815_000, 0) .saturating_add(Weight::from_parts(0, 4273)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -458,8 +461,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1790` // Estimated: `7404` - // Minimum execution time: 101_301_000 picoseconds. - Weight::from_parts(104_810_000, 0) + // Minimum execution time: 138_168_000 picoseconds. + Weight::from_parts(141_909_000, 0) .saturating_add(Weight::from_parts(0, 7404)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(7)) @@ -472,8 +475,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `446` // Estimated: `4273` - // Minimum execution time: 38_707_000 picoseconds. - Weight::from_parts(40_245_000, 0) + // Minimum execution time: 55_517_000 picoseconds. + Weight::from_parts(57_986_000, 0) .saturating_add(Weight::from_parts(0, 4273)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -486,8 +489,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `446` // Estimated: `4273` - // Minimum execution time: 38_675_000 picoseconds. - Weight::from_parts(40_277_000, 0) + // Minimum execution time: 56_263_000 picoseconds. + Weight::from_parts(58_380_000, 0) .saturating_add(Weight::from_parts(0, 4273)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -498,8 +501,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `242` // Estimated: `4273` - // Minimum execution time: 13_617_000 picoseconds. - Weight::from_parts(14_358_000, 0) + // Minimum execution time: 19_701_000 picoseconds. + Weight::from_parts(21_024_000, 0) .saturating_add(Weight::from_parts(0, 4273)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -514,8 +517,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1549` // Estimated: `4273` - // Minimum execution time: 43_330_000 picoseconds. - Weight::from_parts(44_710_000, 0) + // Minimum execution time: 61_407_000 picoseconds. + Weight::from_parts(63_081_000, 0) .saturating_add(Weight::from_parts(0, 4273)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -528,8 +531,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `242` // Estimated: `4273` - // Minimum execution time: 34_454_000 picoseconds. - Weight::from_parts(35_648_000, 0) + // Minimum execution time: 48_496_000 picoseconds. + Weight::from_parts(50_343_000, 0) .saturating_add(Weight::from_parts(0, 4273)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -548,8 +551,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1755` // Estimated: `4273` - // Minimum execution time: 56_572_000 picoseconds. - Weight::from_parts(57_480_000, 0) + // Minimum execution time: 80_393_000 picoseconds. + Weight::from_parts(83_061_000, 0) .saturating_add(Weight::from_parts(0, 4273)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(5)) @@ -566,8 +569,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `481` // Estimated: `4273` - // Minimum execution time: 50_510_000 picoseconds. - Weight::from_parts(52_435_000, 0) + // Minimum execution time: 69_254_000 picoseconds. + Weight::from_parts(71_611_000, 0) .saturating_add(Weight::from_parts(0, 4273)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) @@ -580,8 +583,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `350` // Estimated: `4273` - // Minimum execution time: 20_003_000 picoseconds. - Weight::from_parts(21_016_000, 0) + // Minimum execution time: 29_869_000 picoseconds. + Weight::from_parts(31_565_000, 0) .saturating_add(Weight::from_parts(0, 4273)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -598,10 +601,10 @@ impl pallet_assets::WeightInfo for WeightInfo { /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) fn transfer_all() -> Weight { // Proof Size summary in bytes: - // Measured: `1719` + // Measured: `1752` // Estimated: `7404` - // Minimum execution time: 92_770_000 picoseconds. - Weight::from_parts(95_828_000, 0) + // Minimum execution time: 127_031_000 picoseconds. + Weight::from_parts(131_516_000, 0) .saturating_add(Weight::from_parts(0, 7404)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(6)) @@ -612,8 +615,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `276` // Estimated: `4273` - // Minimum execution time: 5_967_000 picoseconds. - Weight::from_parts(6_583_000, 0) + // Minimum execution time: 7_644_000 picoseconds. + Weight::from_parts(8_239_000, 0) .saturating_add(Weight::from_parts(0, 4273)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -623,8 +626,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `150` // Estimated: `4197` - // Minimum execution time: 6_885_000 picoseconds. - Weight::from_parts(7_456_000, 0) + // Minimum execution time: 9_608_000 picoseconds. + Weight::from_parts(10_545_000, 0) .saturating_add(Weight::from_parts(0, 4197)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -634,21 +637,21 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `245` // Estimated: `4211` - // Minimum execution time: 9_815_000 picoseconds. - Weight::from_parts(10_386_000, 0) + // Minimum execution time: 13_507_000 picoseconds. + Weight::from_parts(15_042_000, 0) .saturating_add(Weight::from_parts(0, 4211)) .saturating_add(T::DbWeight::get().reads(1)) } /// Storage: `ForeignAssets::Asset` (r:1 w:0) /// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(808), added: 3283, mode: `MaxEncodedLen`) /// Storage: `ForeignAssets::Reserves` (r:0 w:1) - /// Proof: `ForeignAssets::Reserves` (`max_values`: None, `max_size`: Some(3629), added: 6104, mode: `MaxEncodedLen`) + /// Proof: `ForeignAssets::Reserves` (`max_values`: None, `max_size`: Some(3634), added: 6109, mode: `MaxEncodedLen`) fn migration_v2_foreign_asset_set_reserve_weight() -> Weight { // Proof Size summary in bytes: // Measured: `81` // Estimated: `4273` - // Minimum execution time: 9_980_000 picoseconds. - Weight::from_parts(10_607_000, 0) + // Minimum execution time: 15_092_000 picoseconds. + Weight::from_parts(16_045_000, 0) .saturating_add(Weight::from_parts(0, 4273)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_assets_local.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_assets_local.rs index 15197c356b88c..f96d61683d5a5 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_assets_local.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_assets_local.rs @@ -16,9 +16,9 @@ //! Autogenerated weights for `pallet_assets` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-10-22, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-12-24, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `2ee62bdee63c`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `1ad128e84c6f`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: @@ -60,8 +60,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1317` // Estimated: `3675` - // Minimum execution time: 36_240_000 picoseconds. - Weight::from_parts(37_271_000, 0) + // Minimum execution time: 51_156_000 picoseconds. + Weight::from_parts(53_203_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) @@ -74,8 +74,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `76` // Estimated: `3675` - // Minimum execution time: 12_758_000 picoseconds. - Weight::from_parts(13_591_000, 0) + // Minimum execution time: 18_152_000 picoseconds. + Weight::from_parts(19_084_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -88,8 +88,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `394` // Estimated: `3675` - // Minimum execution time: 20_380_000 picoseconds. - Weight::from_parts(21_689_000, 0) + // Minimum execution time: 29_974_000 picoseconds. + Weight::from_parts(31_532_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -109,13 +109,13 @@ impl pallet_assets::WeightInfo for WeightInfo { /// The range of component `c` is `[0, 1000]`. fn destroy_accounts(c: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `67845 + c * (419 ±0)` + // Measured: `68631 + c * (424 ±0)` // Estimated: `3675 + c * (2609 ±0)` - // Minimum execution time: 17_412_000 picoseconds. - Weight::from_parts(18_196_000, 0) + // Minimum execution time: 23_900_000 picoseconds. + Weight::from_parts(24_220_000, 0) .saturating_add(Weight::from_parts(0, 3675)) - // Standard Error: 28_027 - .saturating_add(Weight::from_parts(37_399_962, 0).saturating_mul(c.into())) + // Standard Error: 57_773 + .saturating_add(Weight::from_parts(43_709_731, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((4_u64).saturating_mul(c.into()))) .saturating_add(T::DbWeight::get().writes(1)) @@ -133,11 +133,11 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `485 + a * (86 ±0)` // Estimated: `3675 + a * (2623 ±0)` - // Minimum execution time: 20_673_000 picoseconds. - Weight::from_parts(21_507_000, 0) + // Minimum execution time: 29_583_000 picoseconds. + Weight::from_parts(30_387_000, 0) .saturating_add(Weight::from_parts(0, 3675)) // Standard Error: 13_887 - .saturating_add(Weight::from_parts(19_209_419, 0).saturating_mul(a.into())) + .saturating_add(Weight::from_parts(22_627_454, 0).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(1)) @@ -148,15 +148,17 @@ impl pallet_assets::WeightInfo for WeightInfo { /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) /// Storage: `Assets::Metadata` (r:1 w:0) /// Proof: `Assets::Metadata` (`max_values`: None, `max_size`: Some(140), added: 2615, mode: `MaxEncodedLen`) + /// Storage: `Assets::Reserves` (r:0 w:1) + /// Proof: `Assets::Reserves` (`max_values`: None, `max_size`: Some(21), added: 2496, mode: `MaxEncodedLen`) fn finish_destroy() -> Weight { // Proof Size summary in bytes: // Measured: `314` // Estimated: `3675` - // Minimum execution time: 14_643_000 picoseconds. - Weight::from_parts(15_354_000, 0) + // Minimum execution time: 22_410_000 picoseconds. + Weight::from_parts(23_666_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(T::DbWeight::get().writes(2)) } /// Storage: `Assets::Asset` (r:1 w:1) /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) @@ -166,8 +168,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `314` // Estimated: `3675` - // Minimum execution time: 24_707_000 picoseconds. - Weight::from_parts(25_927_000, 0) + // Minimum execution time: 35_426_000 picoseconds. + Weight::from_parts(37_139_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -184,8 +186,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `426` // Estimated: `3675` - // Minimum execution time: 52_167_000 picoseconds. - Weight::from_parts(53_906_000, 0) + // Minimum execution time: 69_545_000 picoseconds. + Weight::from_parts(71_574_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) @@ -202,10 +204,10 @@ impl pallet_assets::WeightInfo for WeightInfo { /// Proof: `AssetsFreezer::Freezes` (`max_values`: None, `max_size`: Some(105), added: 2580, mode: `MaxEncodedLen`) fn transfer() -> Weight { // Proof Size summary in bytes: - // Measured: `1715` + // Measured: `1748` // Estimated: `6208` - // Minimum execution time: 70_449_000 picoseconds. - Weight::from_parts(72_769_000, 0) + // Minimum execution time: 95_914_000 picoseconds. + Weight::from_parts(98_304_000, 0) .saturating_add(Weight::from_parts(0, 6208)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(6)) @@ -220,10 +222,10 @@ impl pallet_assets::WeightInfo for WeightInfo { /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) fn transfer_keep_alive() -> Weight { // Proof Size summary in bytes: - // Measured: `1715` + // Measured: `1748` // Estimated: `6208` - // Minimum execution time: 55_389_000 picoseconds. - Weight::from_parts(57_855_000, 0) + // Minimum execution time: 76_715_000 picoseconds. + Weight::from_parts(81_974_000, 0) .saturating_add(Weight::from_parts(0, 6208)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) @@ -240,10 +242,10 @@ impl pallet_assets::WeightInfo for WeightInfo { /// Proof: `AssetsFreezer::Freezes` (`max_values`: None, `max_size`: Some(105), added: 2580, mode: `MaxEncodedLen`) fn force_transfer() -> Weight { // Proof Size summary in bytes: - // Measured: `1715` + // Measured: `1748` // Estimated: `6208` - // Minimum execution time: 70_681_000 picoseconds. - Weight::from_parts(73_029_000, 0) + // Minimum execution time: 95_473_000 picoseconds. + Weight::from_parts(98_663_000, 0) .saturating_add(Weight::from_parts(0, 6208)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(6)) @@ -256,8 +258,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `422` // Estimated: `3675` - // Minimum execution time: 19_965_000 picoseconds. - Weight::from_parts(20_799_000, 0) + // Minimum execution time: 30_011_000 picoseconds. + Weight::from_parts(31_178_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -270,8 +272,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `422` // Estimated: `3675` - // Minimum execution time: 20_102_000 picoseconds. - Weight::from_parts(20_896_000, 0) + // Minimum execution time: 30_044_000 picoseconds. + Weight::from_parts(31_253_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -282,8 +284,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `348` // Estimated: `3675` - // Minimum execution time: 14_936_000 picoseconds. - Weight::from_parts(15_698_000, 0) + // Minimum execution time: 23_625_000 picoseconds. + Weight::from_parts(24_590_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -294,8 +296,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `348` // Estimated: `3675` - // Minimum execution time: 15_009_000 picoseconds. - Weight::from_parts(15_790_000, 0) + // Minimum execution time: 22_889_000 picoseconds. + Weight::from_parts(24_438_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -308,8 +310,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `314` // Estimated: `3675` - // Minimum execution time: 14_900_000 picoseconds. - Weight::from_parts(15_512_000, 0) + // Minimum execution time: 21_633_000 picoseconds. + Weight::from_parts(22_761_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -320,8 +322,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `314` // Estimated: `3675` - // Minimum execution time: 13_023_000 picoseconds. - Weight::from_parts(13_560_000, 0) + // Minimum execution time: 19_460_000 picoseconds. + Weight::from_parts(20_530_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -330,13 +332,18 @@ impl pallet_assets::WeightInfo for WeightInfo { /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) /// Storage: `Assets::Reserves` (r:0 w:1) /// Proof: `Assets::Reserves` (`max_values`: None, `max_size`: Some(21), added: 2496, mode: `MaxEncodedLen`) - fn set_reserves() -> Weight { + /// The range of component `n` is `[0, 5]`. + /// The range of component `n` is `[0, 5]`. + /// The range of component `n` is `[0, 5]`. + fn set_reserves(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `314` // Estimated: `3675` - // Minimum execution time: 16_061_000 picoseconds. - Weight::from_parts(17_221_000, 0) + // Minimum execution time: 22_807_000 picoseconds. + Weight::from_parts(25_136_204, 0) .saturating_add(Weight::from_parts(0, 3675)) + // Standard Error: 21_027 + .saturating_add(Weight::from_parts(71_155, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -354,13 +361,13 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `314` // Estimated: `3675` - // Minimum execution time: 32_184_000 picoseconds. - Weight::from_parts(33_855_081, 0) + // Minimum execution time: 43_683_000 picoseconds. + Weight::from_parts(46_622_482, 0) .saturating_add(Weight::from_parts(0, 3675)) - // Standard Error: 1_335 - .saturating_add(Weight::from_parts(653, 0).saturating_mul(n.into())) - // Standard Error: 1_335 - .saturating_add(Weight::from_parts(6_241, 0).saturating_mul(s.into())) + // Standard Error: 4_967 + .saturating_add(Weight::from_parts(174_999, 0).saturating_mul(n.into())) + // Standard Error: 4_967 + .saturating_add(Weight::from_parts(15_530, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -372,8 +379,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `478` // Estimated: `3675` - // Minimum execution time: 32_613_000 picoseconds. - Weight::from_parts(33_301_000, 0) + // Minimum execution time: 50_357_000 picoseconds. + Weight::from_parts(53_182_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -388,17 +395,13 @@ impl pallet_assets::WeightInfo for WeightInfo { /// The range of component `s` is `[0, 50]`. /// The range of component `n` is `[0, 50]`. /// The range of component `s` is `[0, 50]`. - fn force_set_metadata(n: u32, s: u32, ) -> Weight { + fn force_set_metadata(_n: u32, _s: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `153` // Estimated: `3675` - // Minimum execution time: 13_394_000 picoseconds. - Weight::from_parts(14_359_578, 0) + // Minimum execution time: 19_136_000 picoseconds. + Weight::from_parts(21_454_280, 0) .saturating_add(Weight::from_parts(0, 3675)) - // Standard Error: 1_260 - .saturating_add(Weight::from_parts(1_307, 0).saturating_mul(n.into())) - // Standard Error: 1_260 - .saturating_add(Weight::from_parts(4_527, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -410,8 +413,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `478` // Estimated: `3675` - // Minimum execution time: 31_774_000 picoseconds. - Weight::from_parts(32_836_000, 0) + // Minimum execution time: 50_490_000 picoseconds. + Weight::from_parts(52_302_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -422,8 +425,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `314` // Estimated: `3675` - // Minimum execution time: 12_411_000 picoseconds. - Weight::from_parts(12_974_000, 0) + // Minimum execution time: 18_539_000 picoseconds. + Weight::from_parts(19_837_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -436,8 +439,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `348` // Estimated: `3675` - // Minimum execution time: 37_182_000 picoseconds. - Weight::from_parts(38_197_000, 0) + // Minimum execution time: 57_581_000 picoseconds. + Weight::from_parts(60_845_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -458,8 +461,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1786` // Estimated: `6208` - // Minimum execution time: 94_667_000 picoseconds. - Weight::from_parts(96_802_000, 0) + // Minimum execution time: 131_345_000 picoseconds. + Weight::from_parts(135_920_000, 0) .saturating_add(Weight::from_parts(0, 6208)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(7)) @@ -472,8 +475,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `518` // Estimated: `3675` - // Minimum execution time: 38_834_000 picoseconds. - Weight::from_parts(40_378_000, 0) + // Minimum execution time: 59_008_000 picoseconds. + Weight::from_parts(62_566_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -486,8 +489,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `518` // Estimated: `3675` - // Minimum execution time: 39_037_000 picoseconds. - Weight::from_parts(40_345_000, 0) + // Minimum execution time: 60_765_000 picoseconds. + Weight::from_parts(63_196_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -498,8 +501,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `314` // Estimated: `3675` - // Minimum execution time: 13_563_000 picoseconds. - Weight::from_parts(14_017_000, 0) + // Minimum execution time: 20_121_000 picoseconds. + Weight::from_parts(20_817_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -514,8 +517,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1621` // Estimated: `3675` - // Minimum execution time: 42_581_000 picoseconds. - Weight::from_parts(43_943_000, 0) + // Minimum execution time: 68_161_000 picoseconds. + Weight::from_parts(70_497_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) @@ -528,8 +531,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `314` // Estimated: `3675` - // Minimum execution time: 35_571_000 picoseconds. - Weight::from_parts(36_953_000, 0) + // Minimum execution time: 56_063_000 picoseconds. + Weight::from_parts(59_147_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -548,8 +551,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1751` // Estimated: `3675` - // Minimum execution time: 53_055_000 picoseconds. - Weight::from_parts(54_859_000, 0) + // Minimum execution time: 79_643_000 picoseconds. + Weight::from_parts(81_502_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(5)) @@ -566,8 +569,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `477` // Estimated: `3675` - // Minimum execution time: 46_865_000 picoseconds. - Weight::from_parts(48_188_000, 0) + // Minimum execution time: 68_575_000 picoseconds. + Weight::from_parts(72_237_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) @@ -580,8 +583,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `422` // Estimated: `3675` - // Minimum execution time: 19_593_000 picoseconds. - Weight::from_parts(20_772_000, 0) + // Minimum execution time: 30_316_000 picoseconds. + Weight::from_parts(31_369_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -598,10 +601,10 @@ impl pallet_assets::WeightInfo for WeightInfo { /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) fn transfer_all() -> Weight { // Proof Size summary in bytes: - // Measured: `1715` + // Measured: `1748` // Estimated: `6208` - // Minimum execution time: 85_303_000 picoseconds. - Weight::from_parts(88_170_000, 0) + // Minimum execution time: 114_181_000 picoseconds. + Weight::from_parts(116_905_000, 0) .saturating_add(Weight::from_parts(0, 6208)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(6)) @@ -612,8 +615,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `348` // Estimated: `3675` - // Minimum execution time: 8_403_000 picoseconds. - Weight::from_parts(8_900_000, 0) + // Minimum execution time: 12_302_000 picoseconds. + Weight::from_parts(13_097_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -623,8 +626,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `222` // Estimated: `3599` - // Minimum execution time: 7_462_000 picoseconds. - Weight::from_parts(7_991_000, 0) + // Minimum execution time: 10_346_000 picoseconds. + Weight::from_parts(11_276_000, 0) .saturating_add(Weight::from_parts(0, 3599)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -634,8 +637,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `317` // Estimated: `3613` - // Minimum execution time: 10_763_000 picoseconds. - Weight::from_parts(11_249_000, 0) + // Minimum execution time: 13_889_000 picoseconds. + Weight::from_parts(14_959_000, 0) .saturating_add(Weight::from_parts(0, 3613)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -647,8 +650,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `153` // Estimated: `3675` - // Minimum execution time: 8_838_000 picoseconds. - Weight::from_parts(9_234_000, 0) + // Minimum execution time: 11_948_000 picoseconds. + Weight::from_parts(12_815_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_assets_pool.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_assets_pool.rs index d4826ebb81c88..47f2f8e8e5bbd 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_assets_pool.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_assets_pool.rs @@ -16,9 +16,9 @@ //! Autogenerated weights for `pallet_assets` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-10-22, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2025-12-24, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `2ee62bdee63c`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `1ad128e84c6f`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: @@ -58,8 +58,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `109` // Estimated: `3675` - // Minimum execution time: 12_698_000 picoseconds. - Weight::from_parts(13_492_000, 0) + // Minimum execution time: 19_699_000 picoseconds. + Weight::from_parts(21_939_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -72,8 +72,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `109` // Estimated: `3675` - // Minimum execution time: 12_436_000 picoseconds. - Weight::from_parts(13_018_000, 0) + // Minimum execution time: 18_840_000 picoseconds. + Weight::from_parts(19_875_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -84,10 +84,10 @@ impl pallet_assets::WeightInfo for WeightInfo { /// Proof: `PoolAssetsFreezer::Freezes` (`max_values`: None, `max_size`: Some(105), added: 2580, mode: `MaxEncodedLen`) fn start_destroy() -> Weight { // Proof Size summary in bytes: - // Measured: `632` + // Measured: `723` // Estimated: `3675` - // Minimum execution time: 21_355_000 picoseconds. - Weight::from_parts(21_959_000, 0) + // Minimum execution time: 31_405_000 picoseconds. + Weight::from_parts(33_397_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -107,13 +107,13 @@ impl pallet_assets::WeightInfo for WeightInfo { /// The range of component `c` is `[0, 1000]`. fn destroy_accounts(c: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `67950 + c * (419 ±0)` + // Measured: `68736 + c * (424 ±0)` // Estimated: `3675 + c * (2609 ±0)` - // Minimum execution time: 17_132_000 picoseconds. - Weight::from_parts(17_790_000, 0) + // Minimum execution time: 25_461_000 picoseconds. + Weight::from_parts(26_497_000, 0) .saturating_add(Weight::from_parts(0, 3675)) - // Standard Error: 33_147 - .saturating_add(Weight::from_parts(37_123_218, 0).saturating_mul(c.into())) + // Standard Error: 42_329 + .saturating_add(Weight::from_parts(44_790_090, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((4_u64).saturating_mul(c.into()))) .saturating_add(T::DbWeight::get().writes(1)) @@ -131,11 +131,11 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `518 + a * (86 ±0)` // Estimated: `3675 + a * (2623 ±0)` - // Minimum execution time: 20_687_000 picoseconds. - Weight::from_parts(21_205_000, 0) + // Minimum execution time: 30_257_000 picoseconds. + Weight::from_parts(31_316_000, 0) .saturating_add(Weight::from_parts(0, 3675)) - // Standard Error: 8_148 - .saturating_add(Weight::from_parts(7_444_915, 0).saturating_mul(a.into())) + // Standard Error: 12_956 + .saturating_add(Weight::from_parts(9_550_623, 0).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(1)) @@ -146,15 +146,17 @@ impl pallet_assets::WeightInfo for WeightInfo { /// Proof: `PoolAssets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) /// Storage: `PoolAssets::Metadata` (r:1 w:0) /// Proof: `PoolAssets::Metadata` (`max_values`: None, `max_size`: Some(140), added: 2615, mode: `MaxEncodedLen`) + /// Storage: `PoolAssets::Reserves` (r:0 w:1) + /// Proof: `PoolAssets::Reserves` (`max_values`: None, `max_size`: Some(21), added: 2496, mode: `MaxEncodedLen`) fn finish_destroy() -> Weight { // Proof Size summary in bytes: // Measured: `347` // Estimated: `3675` - // Minimum execution time: 14_141_000 picoseconds. - Weight::from_parts(15_000_000, 0) + // Minimum execution time: 22_576_000 picoseconds. + Weight::from_parts(23_853_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(T::DbWeight::get().writes(2)) } /// Storage: `PoolAssets::Asset` (r:1 w:1) /// Proof: `PoolAssets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) @@ -164,8 +166,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `347` // Estimated: `3675` - // Minimum execution time: 25_109_000 picoseconds. - Weight::from_parts(26_252_000, 0) + // Minimum execution time: 35_092_000 picoseconds. + Weight::from_parts(36_742_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -182,8 +184,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `531` // Estimated: `3675` - // Minimum execution time: 53_456_000 picoseconds. - Weight::from_parts(55_549_000, 0) + // Minimum execution time: 70_703_000 picoseconds. + Weight::from_parts(75_978_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) @@ -200,10 +202,10 @@ impl pallet_assets::WeightInfo for WeightInfo { /// Proof: `PoolAssetsFreezer::Freezes` (`max_values`: None, `max_size`: Some(105), added: 2580, mode: `MaxEncodedLen`) fn transfer() -> Weight { // Proof Size summary in bytes: - // Measured: `1820` + // Measured: `1853` // Estimated: `6208` - // Minimum execution time: 73_553_000 picoseconds. - Weight::from_parts(75_864_000, 0) + // Minimum execution time: 100_956_000 picoseconds. + Weight::from_parts(103_860_000, 0) .saturating_add(Weight::from_parts(0, 6208)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(6)) @@ -218,10 +220,10 @@ impl pallet_assets::WeightInfo for WeightInfo { /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) fn transfer_keep_alive() -> Weight { // Proof Size summary in bytes: - // Measured: `1820` + // Measured: `1853` // Estimated: `6208` - // Minimum execution time: 57_156_000 picoseconds. - Weight::from_parts(59_347_000, 0) + // Minimum execution time: 81_644_000 picoseconds. + Weight::from_parts(85_141_000, 0) .saturating_add(Weight::from_parts(0, 6208)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) @@ -238,10 +240,10 @@ impl pallet_assets::WeightInfo for WeightInfo { /// Proof: `PoolAssetsFreezer::Freezes` (`max_values`: None, `max_size`: Some(105), added: 2580, mode: `MaxEncodedLen`) fn force_transfer() -> Weight { // Proof Size summary in bytes: - // Measured: `1820` + // Measured: `1853` // Estimated: `6208` - // Minimum execution time: 73_238_000 picoseconds. - Weight::from_parts(75_801_000, 0) + // Minimum execution time: 101_175_000 picoseconds. + Weight::from_parts(105_271_000, 0) .saturating_add(Weight::from_parts(0, 6208)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(6)) @@ -254,8 +256,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `455` // Estimated: `3675` - // Minimum execution time: 19_358_000 picoseconds. - Weight::from_parts(20_608_000, 0) + // Minimum execution time: 29_395_000 picoseconds. + Weight::from_parts(31_485_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -268,8 +270,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `455` // Estimated: `3675` - // Minimum execution time: 20_035_000 picoseconds. - Weight::from_parts(20_581_000, 0) + // Minimum execution time: 30_401_000 picoseconds. + Weight::from_parts(32_166_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -280,8 +282,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `381` // Estimated: `3675` - // Minimum execution time: 14_945_000 picoseconds. - Weight::from_parts(15_844_000, 0) + // Minimum execution time: 23_330_000 picoseconds. + Weight::from_parts(24_227_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -292,8 +294,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `381` // Estimated: `3675` - // Minimum execution time: 14_853_000 picoseconds. - Weight::from_parts(15_745_000, 0) + // Minimum execution time: 22_866_000 picoseconds. + Weight::from_parts(24_718_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -306,8 +308,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `347` // Estimated: `3675` - // Minimum execution time: 14_848_000 picoseconds. - Weight::from_parts(15_387_000, 0) + // Minimum execution time: 21_161_000 picoseconds. + Weight::from_parts(22_760_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -318,8 +320,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `347` // Estimated: `3675` - // Minimum execution time: 12_866_000 picoseconds. - Weight::from_parts(13_511_000, 0) + // Minimum execution time: 19_674_000 picoseconds. + Weight::from_parts(20_500_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -328,13 +330,18 @@ impl pallet_assets::WeightInfo for WeightInfo { /// Proof: `PoolAssets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) /// Storage: `PoolAssets::Reserves` (r:0 w:1) /// Proof: `PoolAssets::Reserves` (`max_values`: None, `max_size`: Some(21), added: 2496, mode: `MaxEncodedLen`) - fn set_reserves() -> Weight { + /// The range of component `n` is `[0, 5]`. + /// The range of component `n` is `[0, 5]`. + /// The range of component `n` is `[0, 5]`. + fn set_reserves(n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `347` // Estimated: `3675` - // Minimum execution time: 16_429_000 picoseconds. - Weight::from_parts(16_951_000, 0) + // Minimum execution time: 23_280_000 picoseconds. + Weight::from_parts(25_795_182, 0) .saturating_add(Weight::from_parts(0, 3675)) + // Standard Error: 13_748 + .saturating_add(Weight::from_parts(198_975, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -348,15 +355,13 @@ impl pallet_assets::WeightInfo for WeightInfo { /// The range of component `s` is `[0, 50]`. /// The range of component `n` is `[0, 50]`. /// The range of component `s` is `[0, 50]`. - fn set_metadata(_n: u32, s: u32, ) -> Weight { + fn set_metadata(_n: u32, _s: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `347` // Estimated: `3675` - // Minimum execution time: 17_646_000 picoseconds. - Weight::from_parts(19_328_612, 0) + // Minimum execution time: 26_160_000 picoseconds. + Weight::from_parts(30_367_654, 0) .saturating_add(Weight::from_parts(0, 3675)) - // Standard Error: 1_559 - .saturating_add(Weight::from_parts(1_016, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -368,8 +373,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `511` // Estimated: `3675` - // Minimum execution time: 19_197_000 picoseconds. - Weight::from_parts(19_621_000, 0) + // Minimum execution time: 27_684_000 picoseconds. + Weight::from_parts(29_279_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -384,17 +389,15 @@ impl pallet_assets::WeightInfo for WeightInfo { /// The range of component `s` is `[0, 50]`. /// The range of component `n` is `[0, 50]`. /// The range of component `s` is `[0, 50]`. - fn force_set_metadata(n: u32, s: u32, ) -> Weight { + fn force_set_metadata(_n: u32, s: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `186` // Estimated: `3675` - // Minimum execution time: 13_460_000 picoseconds. - Weight::from_parts(14_549_675, 0) + // Minimum execution time: 20_106_000 picoseconds. + Weight::from_parts(22_544_982, 0) .saturating_add(Weight::from_parts(0, 3675)) - // Standard Error: 942 - .saturating_add(Weight::from_parts(87, 0).saturating_mul(n.into())) - // Standard Error: 942 - .saturating_add(Weight::from_parts(1_251, 0).saturating_mul(s.into())) + // Standard Error: 1_608 + .saturating_add(Weight::from_parts(2_283, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -406,8 +409,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `511` // Estimated: `3675` - // Minimum execution time: 18_338_000 picoseconds. - Weight::from_parts(19_032_000, 0) + // Minimum execution time: 27_120_000 picoseconds. + Weight::from_parts(29_650_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -418,8 +421,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `347` // Estimated: `3675` - // Minimum execution time: 12_247_000 picoseconds. - Weight::from_parts(13_034_000, 0) + // Minimum execution time: 18_984_000 picoseconds. + Weight::from_parts(20_430_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -432,8 +435,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `381` // Estimated: `3675` - // Minimum execution time: 22_547_000 picoseconds. - Weight::from_parts(23_547_000, 0) + // Minimum execution time: 32_757_000 picoseconds. + Weight::from_parts(35_053_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -454,8 +457,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `1891` // Estimated: `6208` - // Minimum execution time: 82_800_000 picoseconds. - Weight::from_parts(86_166_000, 0) + // Minimum execution time: 119_424_000 picoseconds. + Weight::from_parts(123_694_000, 0) .saturating_add(Weight::from_parts(0, 6208)) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(7)) @@ -468,8 +471,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `551` // Estimated: `3675` - // Minimum execution time: 24_569_000 picoseconds. - Weight::from_parts(25_721_000, 0) + // Minimum execution time: 37_592_000 picoseconds. + Weight::from_parts(40_120_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -482,8 +485,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `551` // Estimated: `3675` - // Minimum execution time: 24_680_000 picoseconds. - Weight::from_parts(25_400_000, 0) + // Minimum execution time: 37_693_000 picoseconds. + Weight::from_parts(39_844_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -494,8 +497,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `347` // Estimated: `3675` - // Minimum execution time: 13_247_000 picoseconds. - Weight::from_parts(14_016_000, 0) + // Minimum execution time: 20_555_000 picoseconds. + Weight::from_parts(21_793_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) @@ -508,8 +511,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `347` // Estimated: `3675` - // Minimum execution time: 19_107_000 picoseconds. - Weight::from_parts(19_878_000, 0) + // Minimum execution time: 28_320_000 picoseconds. + Weight::from_parts(29_814_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -522,8 +525,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `347` // Estimated: `3675` - // Minimum execution time: 21_049_000 picoseconds. - Weight::from_parts(22_003_000, 0) + // Minimum execution time: 32_047_000 picoseconds. + Weight::from_parts(33_548_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -540,8 +543,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `549` // Estimated: `3675` - // Minimum execution time: 33_110_000 picoseconds. - Weight::from_parts(34_194_000, 0) + // Minimum execution time: 47_443_000 picoseconds. + Weight::from_parts(49_335_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) @@ -558,8 +561,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `582` // Estimated: `3675` - // Minimum execution time: 32_650_000 picoseconds. - Weight::from_parts(33_752_000, 0) + // Minimum execution time: 48_332_000 picoseconds. + Weight::from_parts(49_995_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) @@ -572,8 +575,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `455` // Estimated: `3675` - // Minimum execution time: 20_003_000 picoseconds. - Weight::from_parts(20_790_000, 0) + // Minimum execution time: 30_107_000 picoseconds. + Weight::from_parts(32_175_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -590,10 +593,10 @@ impl pallet_assets::WeightInfo for WeightInfo { /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) fn transfer_all() -> Weight { // Proof Size summary in bytes: - // Measured: `1820` + // Measured: `1853` // Estimated: `6208` - // Minimum execution time: 87_563_000 picoseconds. - Weight::from_parts(90_470_000, 0) + // Minimum execution time: 122_359_000 picoseconds. + Weight::from_parts(128_443_000, 0) .saturating_add(Weight::from_parts(0, 6208)) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(6)) @@ -604,8 +607,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `381` // Estimated: `3675` - // Minimum execution time: 8_229_000 picoseconds. - Weight::from_parts(8_668_000, 0) + // Minimum execution time: 11_610_000 picoseconds. + Weight::from_parts(12_414_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -615,8 +618,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `255` // Estimated: `3599` - // Minimum execution time: 7_507_000 picoseconds. - Weight::from_parts(8_014_000, 0) + // Minimum execution time: 10_667_000 picoseconds. + Weight::from_parts(12_012_000, 0) .saturating_add(Weight::from_parts(0, 3599)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -626,8 +629,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `350` // Estimated: `3613` - // Minimum execution time: 10_292_000 picoseconds. - Weight::from_parts(11_057_000, 0) + // Minimum execution time: 14_770_000 picoseconds. + Weight::from_parts(15_786_000, 0) .saturating_add(Weight::from_parts(0, 3613)) .saturating_add(T::DbWeight::get().reads(1)) } @@ -639,8 +642,8 @@ impl pallet_assets::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `186` // Estimated: `3675` - // Minimum execution time: 9_103_000 picoseconds. - Weight::from_parts(9_503_000, 0) + // Minimum execution time: 13_262_000 picoseconds. + Weight::from_parts(14_340_000, 0) .saturating_add(Weight::from_parts(0, 3675)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/cumulus/parachains/runtimes/assets/common/src/migrations.rs b/cumulus/parachains/runtimes/assets/common/src/migrations.rs index 181839817ae08..baf9d6d9ef214 100644 --- a/cumulus/parachains/runtimes/assets/common/src/migrations.rs +++ b/cumulus/parachains/runtimes/assets/common/src/migrations.rs @@ -175,14 +175,24 @@ pub mod foreign_assets_reserves { target: "runtime::ForeignAssetsReservesMigration::asset_step", ?asset_id, ?reserves, "updating reserves for" ); - if let Err(e) = pallet_assets::Pallet::::unchecked_update_reserves( - asset_id.clone(), - reserves, - ) { - tracing::error!( - target: "runtime::ForeignAssetsReservesMigration::asset_step", - ?e, ?asset_id, "failed migrating reserves for asset" - ); + match reserves.try_into() { + Ok(bounded_reserves) => { + if let Err(e) = pallet_assets::Pallet::::unchecked_update_reserves( + asset_id.clone(), + bounded_reserves, + ) { + tracing::error!( + target: "runtime::ForeignAssetsReservesMigration::asset_step", + ?e, ?asset_id, "failed migrating reserves for asset" + ); + } + }, + Err(_) => { + tracing::error!( + target: "runtime::ForeignAssetsReservesMigration::asset_step", + ?asset_id, "too many reserves for asset" + ); + }, } MigrationState::Asset(asset_id) } else { diff --git a/cumulus/parachains/runtimes/assets/test-utils/src/test_cases.rs b/cumulus/parachains/runtimes/assets/test-utils/src/test_cases.rs index fb531afef27a2..d88aea8a3441f 100644 --- a/cumulus/parachains/runtimes/assets/test-utils/src/test_cases.rs +++ b/cumulus/parachains/runtimes/assets/test-utils/src/test_cases.rs @@ -516,7 +516,7 @@ pub fn teleports_for_foreign_assets_works< >::set_reserves( RuntimeHelper::::origin_of(asset_owner.into()), foreign_asset_id_location.clone().into(), - vec![foreign_asset_reserve_data], + vec![foreign_asset_reserve_data].try_into().unwrap(), ) ); diff --git a/cumulus/parachains/runtimes/assets/test-utils/src/test_cases_over_bridge.rs b/cumulus/parachains/runtimes/assets/test-utils/src/test_cases_over_bridge.rs index f922beacd68d6..e0485156e8ce6 100644 --- a/cumulus/parachains/runtimes/assets/test-utils/src/test_cases_over_bridge.rs +++ b/cumulus/parachains/runtimes/assets/test-utils/src/test_cases_over_bridge.rs @@ -414,7 +414,7 @@ pub fn receive_reserve_asset_deposited_from_different_consensus_works< foreign_asset_owner ), foreign_asset_id_location.clone().into(), - vec![foreign_asset_reserve_data], + vec![foreign_asset_reserve_data].try_into().unwrap(), ) ); diff --git a/prdoc/pr_10711.prdoc b/prdoc/pr_10711.prdoc new file mode 100644 index 0000000000000..0dc11929905ae --- /dev/null +++ b/prdoc/pr_10711.prdoc @@ -0,0 +1,19 @@ +title: Fix benchmarking for pallet-assets::set_reserves() +doc: +- audience: Runtime Dev + description: Parametrize pallet-assets::set_reserves() weight based on number of + reserves provided instead of always assuming worst-case. +crates: +- name: asset-hub-rococo-runtime + bump: patch +- name: asset-hub-westend-runtime + bump: patch +- name: pallet-assets + bump: minor + validate: false +- name: emulated-integration-tests-common + bump: patch +- name: assets-common + bump: patch +- name: asset-test-utils + bump: patch diff --git a/substrate/frame/assets/src/benchmarking.rs b/substrate/frame/assets/src/benchmarking.rs index a5cbbf86c66cf..39959039775e7 100644 --- a/substrate/frame/assets/src/benchmarking.rs +++ b/substrate/frame/assets/src/benchmarking.rs @@ -59,12 +59,13 @@ fn create_default_asset, I: 'static>( } fn create_default_reserves, I: 'static>( + count: u32, ) -> (T::AssetIdParameter, T::AccountId, Vec) { // create asset let (asset_id, caller, _) = create_default_asset::(true); // build max number of reserves let mut reserves = Vec::::new(); - for i in 0..MAX_RESERVES { + for i in 0..count { reserves.push(T::BenchmarkHelper::create_reserve_id_parameter(i)); } (asset_id, caller, reserves) @@ -109,7 +110,7 @@ fn add_sufficients, I: 'static>(minter: T::AccountId, n: u32) { origin.clone().into(), asset_id.clone(), target_lookup, - 100u32.into() + 100u32.into(), ) .is_ok()); } @@ -350,11 +351,18 @@ benchmarks_instance_pallet! { } set_reserves { - let (asset_id, caller, reserves) = create_default_reserves::(); + let n in 0 .. MAX_RESERVES; + let (asset_id, caller, reserves) = create_default_reserves::(n); T::Currency::make_free_balance_be(&caller, DepositBalanceOf::::max_value()); - }: _(SystemOrigin::Signed(caller), asset_id.clone(), reserves.clone()) + let bounded_reserves = reserves.clone().try_into().unwrap(); + }: _(SystemOrigin::Signed(caller), asset_id.clone(), bounded_reserves) verify { - assert_last_event::(Event::ReservesUpdated { asset_id: asset_id.into(), reserves: reserves }.into()); + let expected_event = if reserves.is_empty() { + Event::ReservesRemoved { asset_id: asset_id.into() } + } else { + Event::ReservesUpdated { asset_id: asset_id.into(), reserves: reserves } + }; + assert_last_event::(expected_event.into()); } set_metadata { @@ -626,7 +634,8 @@ benchmarks_instance_pallet! { let asset_id = Asset::::iter_keys().next() .ok_or_else(|| BenchmarkError::Override(BenchmarkResult::from_weight(Weight::MAX)))?; assert_eq!(id, asset_id); - Pallet::::unchecked_update_reserves(asset_id, vec![reserve.clone()]).unwrap(); + let bounded_reserves = vec![reserve.clone()].try_into().unwrap(); + Pallet::::unchecked_update_reserves(asset_id, bounded_reserves).unwrap(); } verify { assert_eq!(Reserves::::get(id)[0], reserve); diff --git a/substrate/frame/assets/src/functions.rs b/substrate/frame/assets/src/functions.rs index d5ca62c3afc96..9930b19ba2a74 100644 --- a/substrate/frame/assets/src/functions.rs +++ b/substrate/frame/assets/src/functions.rs @@ -20,6 +20,7 @@ use super::*; use alloc::vec; use frame_support::{defensive, traits::Get, BoundedVec}; +use sp_runtime::traits::ConstU32; #[must_use] pub(super) enum DeadConsequence { @@ -1099,16 +1100,15 @@ impl, I: 'static> Pallet { /// Does not check validity of asset id, caller should check it. pub fn unchecked_update_reserves( id: T::AssetId, - reserves: Vec, + reserves: BoundedVec>, ) -> Result<(), Error> { if reserves.is_empty() { Reserves::::remove(&id); Self::deposit_event(Event::ReservesRemoved { asset_id: id }); } else { - let bounded_reserves = - reserves.clone().try_into().map_err(|_| Error::::TooManyReserves)?; - Reserves::::set(&id, bounded_reserves); - Self::deposit_event(Event::ReservesUpdated { asset_id: id, reserves }); + let reserves_vec = reserves.clone().into_inner(); + Reserves::::set(&id, reserves); + Self::deposit_event(Event::ReservesUpdated { asset_id: id, reserves: reserves_vec }); } Ok(()) } diff --git a/substrate/frame/assets/src/lib.rs b/substrate/frame/assets/src/lib.rs index 69bc380a9e450..b91a54d70d79a 100644 --- a/substrate/frame/assets/src/lib.rs +++ b/substrate/frame/assets/src/lib.rs @@ -1868,11 +1868,11 @@ pub mod pallet { /// /// Emits `AssetMinBalanceChanged` event when successful. #[pallet::call_index(33)] - #[pallet::weight(T::WeightInfo::set_reserves())] + #[pallet::weight(T::WeightInfo::set_reserves(reserves.len() as u32))] pub fn set_reserves( origin: OriginFor, id: T::AssetIdParameter, - reserves: Vec, + reserves: BoundedVec>, ) -> DispatchResult { let id: T::AssetId = id.into(); let origin = ensure_signed(origin.clone()) diff --git a/substrate/frame/assets/src/tests.rs b/substrate/frame/assets/src/tests.rs index 837a19d81dcfb..aba8d19db33ca 100644 --- a/substrate/frame/assets/src/tests.rs +++ b/substrate/frame/assets/src/tests.rs @@ -27,10 +27,14 @@ use frame_support::{ tokens::{Preservation::Protect, Provenance}, Currency, }, + BoundedVec, }; use pallet_balances::Error as BalancesError; use sp_io::storage; -use sp_runtime::{traits::ConvertInto, TokenError}; +use sp_runtime::{ + traits::{ConstU32, ConvertInto}, + TokenError, +}; mod sets; @@ -484,7 +488,12 @@ fn lifecycle_should_work() { assert_ok!(Assets::set_metadata(RuntimeOrigin::signed(1), 0, vec![0], vec![0], 12)); assert_eq!(Balances::reserved_balance(&1), 4); assert!(Metadata::::contains_key(0)); - + assert_ok!(Assets::set_reserves( + RuntimeOrigin::signed(1), + 0, + vec![1234].try_into().unwrap() + )); + assert_eq!(Reserves::::get(0), vec![1234]); Balances::make_free_balance_be(&10, 100); assert_ok!(Assets::mint(RuntimeOrigin::signed(1), 0, 10, 100)); Balances::make_free_balance_be(&20, 100); @@ -2205,3 +2214,23 @@ fn asset_id_cannot_be_reused() { assert!(Asset::::contains_key(7)); }); } + +#[test] +fn setting_too_many_reserves_fails() { + new_test_ext().execute_with(|| { + Balances::make_free_balance_be(&1, 100); + assert_ok!(Assets::create(RuntimeOrigin::signed(1), 0, 1, 1)); + assert_eq!(Balances::reserved_balance(&1), 1); + assert!(Asset::::contains_key(0)); + + let mut reserves = vec![]; + for i in 0..MAX_RESERVES + 1 { + reserves.push(1234u128 + i as u128); + } + // Attempting to create a BoundedVec with too many reserves should fail + let result: Result>, _> = + reserves.clone().try_into(); + assert!(result.is_err()); + assert_eq!(Reserves::::get(0), vec![]); + }); +} diff --git a/substrate/frame/assets/src/weights.rs b/substrate/frame/assets/src/weights.rs index 6bc8892b49a24..13c37ca5115f9 100644 --- a/substrate/frame/assets/src/weights.rs +++ b/substrate/frame/assets/src/weights.rs @@ -74,8 +74,8 @@ pub trait WeightInfo { fn create() -> Weight; fn force_create() -> Weight; fn start_destroy() -> Weight; - fn destroy_accounts(c: u32, ) -> Weight; - fn destroy_approvals(a: u32, ) -> Weight; + fn destroy_accounts(c: u32) -> Weight; + fn destroy_approvals(a: u32) -> Weight; fn finish_destroy() -> Weight; fn mint() -> Weight; fn burn() -> Weight; @@ -88,9 +88,9 @@ pub trait WeightInfo { fn thaw_asset() -> Weight; fn transfer_ownership() -> Weight; fn set_team() -> Weight; - fn set_metadata(n: u32, s: u32, ) -> Weight; + fn set_metadata(n: u32, s: u32) -> Weight; fn clear_metadata() -> Weight; - fn force_set_metadata(n: u32, s: u32, ) -> Weight; + fn force_set_metadata(n: u32, s: u32) -> Weight; fn force_clear_metadata() -> Weight; fn force_asset_status() -> Weight; fn approve_transfer() -> Weight; @@ -107,7 +107,7 @@ pub trait WeightInfo { fn total_issuance() -> Weight; fn balance() -> Weight; fn allowance() -> Weight; - fn set_reserves() -> Weight; + fn set_reserves(n: u32) -> Weight; fn migration_v2_foreign_asset_set_reserve_weight() -> Weight { // disabled by default, force explicit benchmarking Weight::MAX @@ -116,6 +116,7 @@ pub trait WeightInfo { /// Weights for `pallet_assets` using the Substrate node and recommended hardware. pub struct SubstrateWeight(PhantomData); + impl WeightInfo for SubstrateWeight { /// Storage: `Assets::Asset` (r:1 w:1) /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) @@ -163,7 +164,7 @@ impl WeightInfo for SubstrateWeight { /// Storage: `System::Account` (r:1000 w:1000) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) /// The range of component `c` is `[0, 1000]`. - fn destroy_accounts(c: u32, ) -> Weight { + fn destroy_accounts(c: u32) -> Weight { // Proof Size summary in bytes: // Measured: `104 + c * (208 ±0)` // Estimated: `3675 + c * (2609 ±0)` @@ -182,7 +183,7 @@ impl WeightInfo for SubstrateWeight { /// Storage: `Assets::Approvals` (r:1001 w:1000) /// Proof: `Assets::Approvals` (`max_values`: None, `max_size`: Some(148), added: 2623, mode: `MaxEncodedLen`) /// The range of component `a` is `[0, 1000]`. - fn destroy_approvals(a: u32, ) -> Weight { + fn destroy_approvals(a: u32) -> Weight { // Proof Size summary in bytes: // Measured: `555 + a * (86 ±0)` // Estimated: `3675 + a * (2623 ±0)` @@ -358,7 +359,7 @@ impl WeightInfo for SubstrateWeight { /// Proof: `Assets::Metadata` (`max_values`: None, `max_size`: Some(140), added: 2615, mode: `MaxEncodedLen`) /// The range of component `n` is `[0, 50]`. /// The range of component `s` is `[0, 50]`. - fn set_metadata(_n: u32, s: u32, ) -> Weight { + fn set_metadata(_n: u32, s: u32) -> Weight { // Proof Size summary in bytes: // Measured: `384` // Estimated: `3675` @@ -388,7 +389,7 @@ impl WeightInfo for SubstrateWeight { /// Proof: `Assets::Metadata` (`max_values`: None, `max_size`: Some(140), added: 2615, mode: `MaxEncodedLen`) /// The range of component `n` is `[0, 50]`. /// The range of component `s` is `[0, 50]`. - fn force_set_metadata(n: u32, s: u32, ) -> Weight { + fn force_set_metadata(n: u32, s: u32) -> Weight { // Proof Size summary in bytes: // Measured: `223` // Estimated: `3675` @@ -606,8 +607,13 @@ impl WeightInfo for SubstrateWeight { Weight::from_parts(11_882_000, 3613) .saturating_add(T::DbWeight::get().reads(1_u64)) } - fn set_reserves() -> Weight { + /// The range of component `n` is `[0, 5]`. + /// The range of component `n` is `[0, 5]`. + /// The range of component `n` is `[0, 5]`. + fn set_reserves(n: u32) -> Weight { Weight::from_parts(31_972_000, 3675) + // Standard Error: 13_748 + .saturating_add(Weight::from_parts(198_975, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -661,7 +667,7 @@ impl WeightInfo for () { /// Storage: `System::Account` (r:1000 w:1000) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) /// The range of component `c` is `[0, 1000]`. - fn destroy_accounts(c: u32, ) -> Weight { + fn destroy_accounts(c: u32) -> Weight { // Proof Size summary in bytes: // Measured: `104 + c * (208 ±0)` // Estimated: `3675 + c * (2609 ±0)` @@ -680,7 +686,7 @@ impl WeightInfo for () { /// Storage: `Assets::Approvals` (r:1001 w:1000) /// Proof: `Assets::Approvals` (`max_values`: None, `max_size`: Some(148), added: 2623, mode: `MaxEncodedLen`) /// The range of component `a` is `[0, 1000]`. - fn destroy_approvals(a: u32, ) -> Weight { + fn destroy_approvals(a: u32) -> Weight { // Proof Size summary in bytes: // Measured: `555 + a * (86 ±0)` // Estimated: `3675 + a * (2623 ±0)` @@ -856,7 +862,7 @@ impl WeightInfo for () { /// Proof: `Assets::Metadata` (`max_values`: None, `max_size`: Some(140), added: 2615, mode: `MaxEncodedLen`) /// The range of component `n` is `[0, 50]`. /// The range of component `s` is `[0, 50]`. - fn set_metadata(_n: u32, s: u32, ) -> Weight { + fn set_metadata(_n: u32, s: u32) -> Weight { // Proof Size summary in bytes: // Measured: `384` // Estimated: `3675` @@ -886,7 +892,7 @@ impl WeightInfo for () { /// Proof: `Assets::Metadata` (`max_values`: None, `max_size`: Some(140), added: 2615, mode: `MaxEncodedLen`) /// The range of component `n` is `[0, 50]`. /// The range of component `s` is `[0, 50]`. - fn force_set_metadata(n: u32, s: u32, ) -> Weight { + fn force_set_metadata(n: u32, s: u32) -> Weight { // Proof Size summary in bytes: // Measured: `223` // Estimated: `3675` @@ -1104,8 +1110,13 @@ impl WeightInfo for () { Weight::from_parts(11_882_000, 3613) .saturating_add(RocksDbWeight::get().reads(1_u64)) } - fn set_reserves() -> Weight { + /// The range of component `n` is `[0, 5]`. + /// The range of component `n` is `[0, 5]`. + /// The range of component `n` is `[0, 5]`. + fn set_reserves(n: u32) -> Weight { Weight::from_parts(31_972_000, 3675) + // Standard Error: 13_748 + .saturating_add(Weight::from_parts(198_975, 0).saturating_mul(n.into())) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } diff --git a/substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_assets_foreign.rs b/substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_assets_foreign.rs index 0c4e92392322f..8240ca7b0b918 100644 --- a/substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_assets_foreign.rs +++ b/substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_assets_foreign.rs @@ -49,6 +49,7 @@ use core::marker::PhantomData; /// Weight functions for `pallet_assets`. pub struct WeightInfo(PhantomData); + impl pallet_assets::WeightInfo for WeightInfo { /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) @@ -109,7 +110,7 @@ impl pallet_assets::WeightInfo for WeightInfo { /// The range of component `c` is `[0, 1000]`. /// The range of component `c` is `[0, 1000]`. /// The range of component `c` is `[0, 1000]`. - fn destroy_accounts(c: u32, ) -> Weight { + fn destroy_accounts(c: u32) -> Weight { // Proof Size summary in bytes: // Measured: `0 + c * (208 ±0)` // Estimated: `4273 + c * (3207 ±0)` @@ -131,7 +132,7 @@ impl pallet_assets::WeightInfo for WeightInfo { /// The range of component `a` is `[0, 1000]`. /// The range of component `a` is `[0, 1000]`. /// The range of component `a` is `[0, 1000]`. - fn destroy_approvals(a: u32, ) -> Weight { + fn destroy_approvals(a: u32) -> Weight { // Proof Size summary in bytes: // Measured: `413 + a * (86 ±0)` // Estimated: `4273 + a * (3221 ±0)` @@ -338,7 +339,7 @@ impl pallet_assets::WeightInfo for WeightInfo { /// The range of component `s` is `[0, 50]`. /// The range of component `n` is `[0, 50]`. /// The range of component `s` is `[0, 50]`. - fn set_metadata(_n: u32, s: u32, ) -> Weight { + fn set_metadata(_n: u32, s: u32) -> Weight { // Proof Size summary in bytes: // Measured: `242` // Estimated: `4273` @@ -374,7 +375,7 @@ impl pallet_assets::WeightInfo for WeightInfo { /// The range of component `s` is `[0, 50]`. /// The range of component `n` is `[0, 50]`. /// The range of component `s` is `[0, 50]`. - fn force_set_metadata(n: u32, s: u32, ) -> Weight { + fn force_set_metadata(n: u32, s: u32) -> Weight { // Proof Size summary in bytes: // Measured: `81` // Estimated: `4273` @@ -625,8 +626,13 @@ impl pallet_assets::WeightInfo for WeightInfo { .saturating_add(Weight::from_parts(0, 4211)) .saturating_add(T::DbWeight::get().reads(1)) } - fn set_reserves() -> Weight { + /// The range of component `n` is `[0, 5]`. + /// The range of component `n` is `[0, 5]`. + /// The range of component `n` is `[0, 5]`. + fn set_reserves(n: u32) -> Weight { Weight::from_parts(31_972_000, 3675) + // Standard Error: 13_748 + .saturating_add(Weight::from_parts(198_975, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } diff --git a/substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_assets_local.rs b/substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_assets_local.rs index 912516b0d8bf4..4e4cfd96c62e6 100644 --- a/substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_assets_local.rs +++ b/substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_assets_local.rs @@ -49,6 +49,7 @@ use core::marker::PhantomData; /// Weight functions for `pallet_assets`. pub struct WeightInfo(PhantomData); + impl pallet_assets::WeightInfo for WeightInfo { /// Storage: `Assets::Asset` (r:1 w:1) /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) @@ -107,7 +108,7 @@ impl pallet_assets::WeightInfo for WeightInfo { /// The range of component `c` is `[0, 1000]`. /// The range of component `c` is `[0, 1000]`. /// The range of component `c` is `[0, 1000]`. - fn destroy_accounts(c: u32, ) -> Weight { + fn destroy_accounts(c: u32) -> Weight { // Proof Size summary in bytes: // Measured: `0 + c * (208 ±0)` // Estimated: `3675 + c * (2609 ±0)` @@ -129,7 +130,7 @@ impl pallet_assets::WeightInfo for WeightInfo { /// The range of component `a` is `[0, 1000]`. /// The range of component `a` is `[0, 1000]`. /// The range of component `a` is `[0, 1000]`. - fn destroy_approvals(a: u32, ) -> Weight { + fn destroy_approvals(a: u32) -> Weight { // Proof Size summary in bytes: // Measured: `451 + a * (86 ±0)` // Estimated: `3675 + a * (2623 ±0)` @@ -336,7 +337,7 @@ impl pallet_assets::WeightInfo for WeightInfo { /// The range of component `s` is `[0, 50]`. /// The range of component `n` is `[0, 50]`. /// The range of component `s` is `[0, 50]`. - fn set_metadata(_n: u32, _s: u32, ) -> Weight { + fn set_metadata(_n: u32, _s: u32) -> Weight { // Proof Size summary in bytes: // Measured: `280` // Estimated: `3675` @@ -370,7 +371,7 @@ impl pallet_assets::WeightInfo for WeightInfo { /// The range of component `s` is `[0, 50]`. /// The range of component `n` is `[0, 50]`. /// The range of component `s` is `[0, 50]`. - fn force_set_metadata(n: u32, s: u32, ) -> Weight { + fn force_set_metadata(n: u32, s: u32) -> Weight { // Proof Size summary in bytes: // Measured: `119` // Estimated: `3675` @@ -621,8 +622,13 @@ impl pallet_assets::WeightInfo for WeightInfo { .saturating_add(Weight::from_parts(0, 3613)) .saturating_add(T::DbWeight::get().reads(1)) } - fn set_reserves() -> Weight { + /// The range of component `n` is `[0, 5]`. + /// The range of component `n` is `[0, 5]`. + /// The range of component `n` is `[0, 5]`. + fn set_reserves(n: u32) -> Weight { Weight::from_parts(31_972_000, 3675) + // Standard Error: 13_748 + .saturating_add(Weight::from_parts(198_975, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } diff --git a/substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_assets_pool.rs b/substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_assets_pool.rs index 54c84d06d35f5..0b0e9bde4ba82 100644 --- a/substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_assets_pool.rs +++ b/substrate/frame/staking-async/runtimes/parachain/src/weights/pallet_assets_pool.rs @@ -49,6 +49,7 @@ use core::marker::PhantomData; /// Weight functions for `pallet_assets`. pub struct WeightInfo(PhantomData); + impl pallet_assets::WeightInfo for WeightInfo { /// Storage: `PoolAssets::Asset` (r:1 w:1) /// Proof: `PoolAssets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) @@ -105,7 +106,7 @@ impl pallet_assets::WeightInfo for WeightInfo { /// The range of component `c` is `[0, 1000]`. /// The range of component `c` is `[0, 1000]`. /// The range of component `c` is `[0, 1000]`. - fn destroy_accounts(c: u32, ) -> Weight { + fn destroy_accounts(c: u32) -> Weight { // Proof Size summary in bytes: // Measured: `0 + c * (208 ±0)` // Estimated: `3675 + c * (2609 ±0)` @@ -127,7 +128,7 @@ impl pallet_assets::WeightInfo for WeightInfo { /// The range of component `a` is `[0, 1000]`. /// The range of component `a` is `[0, 1000]`. /// The range of component `a` is `[0, 1000]`. - fn destroy_approvals(a: u32, ) -> Weight { + fn destroy_approvals(a: u32) -> Weight { // Proof Size summary in bytes: // Measured: `451 + a * (86 ±0)` // Estimated: `3675 + a * (2623 ±0)` @@ -334,7 +335,7 @@ impl pallet_assets::WeightInfo for WeightInfo { /// The range of component `s` is `[0, 50]`. /// The range of component `n` is `[0, 50]`. /// The range of component `s` is `[0, 50]`. - fn set_metadata(n: u32, _s: u32, ) -> Weight { + fn set_metadata(n: u32, _s: u32) -> Weight { // Proof Size summary in bytes: // Measured: `280` // Estimated: `3675` @@ -370,7 +371,7 @@ impl pallet_assets::WeightInfo for WeightInfo { /// The range of component `s` is `[0, 50]`. /// The range of component `n` is `[0, 50]`. /// The range of component `s` is `[0, 50]`. - fn force_set_metadata(_n: u32, s: u32, ) -> Weight { + fn force_set_metadata(_n: u32, s: u32) -> Weight { // Proof Size summary in bytes: // Measured: `119` // Estimated: `3675` @@ -615,8 +616,13 @@ impl pallet_assets::WeightInfo for WeightInfo { .saturating_add(Weight::from_parts(0, 3613)) .saturating_add(T::DbWeight::get().reads(1)) } - fn set_reserves() -> Weight { + /// The range of component `n` is `[0, 5]`. + /// The range of component `n` is `[0, 5]`. + /// The range of component `n` is `[0, 5]`. + fn set_reserves(n: u32) -> Weight { Weight::from_parts(31_972_000, 3675) + // Standard Error: 13_748 + .saturating_add(Weight::from_parts(198_975, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) }