diff --git a/crates/btc-relay/src/benchmarking.rs b/crates/btc-relay/src/benchmarking.rs index d80ffc389b..e22b02865d 100644 --- a/crates/btc-relay/src/benchmarking.rs +++ b/crates/btc-relay/src/benchmarking.rs @@ -62,6 +62,46 @@ pub mod benchmarks { _(RawOrigin::Signed(caller), block.header, height); } + #[benchmark] + pub fn set_chainwork_for_block() { + let caller: T::AccountId = whitelisted_caller(); + + let init_block = initialize_relay::(caller.clone()); + let init_block_hash = init_block.header.hash; + + migration::v1::migrate_from_v0_to_v1::(); + + let block = add_new_block_to_relay::(caller.clone(), init_block_hash, 0); + + #[extrinsic_call] + _(RawOrigin::Signed(caller), block.header.hash); + + // make sure chain work is stored + assert_eq!(BtcRelay::::contains_chainwork(block.header.hash), true); + } + + #[benchmark] + pub fn store_block_header_when_updating_chainwork_mandatory() { + let caller: T::AccountId = whitelisted_caller(); + + let init_block = initialize_relay::(caller.clone()); + let init_block_hash = init_block.header.hash; + + migration::v1::migrate_from_v0_to_v1::(); + + let block = new_block::(init_block_hash, 0); + + #[extrinsic_call] + store_block_header(RawOrigin::Signed(caller), block.header, u32::MAX); + + // make sure block is stored + let rich_header = BtcRelay::::get_block_header_from_hash(block.header.hash).unwrap(); + assert_eq!(rich_header.chain_id, MAIN_CHAIN_ID); + + // make sure chain work is stored + assert_eq!(BtcRelay::::contains_chainwork(block.header.hash), true); + } + #[benchmark] pub fn store_block_header() { let caller: T::AccountId = whitelisted_caller(); diff --git a/crates/btc-relay/src/default_weights.rs b/crates/btc-relay/src/default_weights.rs index 648c215b05..d325c64756 100644 --- a/crates/btc-relay/src/default_weights.rs +++ b/crates/btc-relay/src/default_weights.rs @@ -42,311 +42,389 @@ pub trait WeightInfo { fn store_block_header_new_fork_sorted(f: u32, ) -> Weight; fn store_block_header_new_fork_unsorted(f: u32, ) -> Weight; fn store_block_header_reorganize_chains(f: u32, ) -> Weight; + fn set_chainwork_for_block() -> Weight; + fn store_block_header_when_updating_chainwork_mandatory () -> Weight; } /// Weights for btc_relay using the Substrate node and recommended hardware. pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { - /// Storage: BTCRelay BestBlock (r:1 w:1) - /// Proof: BTCRelay BestBlock (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: BTCRelay DisableDifficultyCheck (r:1 w:0) - /// Proof: BTCRelay DisableDifficultyCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: BTCRelay ChainCounter (r:1 w:1) - /// Proof: BTCRelay ChainCounter (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay Chains (r:1 w:1) - /// Proof: BTCRelay Chains (max_values: None, max_size: Some(24), added: 2499, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay ChainsHashes (r:0 w:1) - /// Proof: BTCRelay ChainsHashes (max_values: None, max_size: Some(72), added: 2547, mode: MaxEncodedLen) - /// Storage: BTCRelay StartBlockHeight (r:0 w:1) - /// Proof: BTCRelay StartBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlockHeight (r:0 w:1) - /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay ChainsIndex (r:0 w:1) - /// Proof: BTCRelay ChainsIndex (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) - /// Storage: BTCRelay BlockHeaders (r:0 w:1) - /// Proof: BTCRelay BlockHeaders (max_values: None, max_size: Some(200), added: 2675, mode: MaxEncodedLen) - fn initialize() -> Weight { + + /// Storage: `BTCRelay::BestBlock` (r:1 w:1) + /// Proof: `BTCRelay::BestBlock` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::DisableDifficultyCheck` (r:1 w:0) + /// Proof: `BTCRelay::DisableDifficultyCheck` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainCounter` (r:1 w:1) + /// Proof: `BTCRelay::ChainCounter` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::Chains` (r:1 w:1) + /// Proof: `BTCRelay::Chains` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`) + /// Storage: `Security::ActiveBlockCount` (r:1 w:0) + /// Proof: `Security::ActiveBlockCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainWork` (r:1 w:0) + /// Proof: `BTCRelay::ChainWork` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsHashes` (r:0 w:1) + /// Proof: `BTCRelay::ChainsHashes` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::StartBlockHeight` (r:0 w:1) + /// Proof: `BTCRelay::StartBlockHeight` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlockHeight` (r:0 w:1) + /// Proof: `BTCRelay::BestBlockHeight` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsIndex` (r:0 w:1) + /// Proof: `BTCRelay::ChainsIndex` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BlockHeaders` (r:0 w:1) + /// Proof: `BTCRelay::BlockHeaders` (`max_values`: None, `max_size`: Some(200), added: 2675, mode: `MaxEncodedLen`) + fn initialize () -> Weight { // Proof Size summary in bytes: - // Measured: `1451` - // Estimated: `4520` - // Minimum execution time: 57_676_000 picoseconds. - Weight::from_parts(58_347_000, 4520) - .saturating_add(T::DbWeight::get().reads(5_u64)) + // Measured: `403` + // Estimated: `3545` + // Minimum execution time: 80_000_000 picoseconds. + Weight::from_parts(80_000_000, 3545) + .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(8_u64)) } - /// Storage: BTCRelay ChainCounter (r:1 w:0) - /// Proof: BTCRelay ChainCounter (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BlockHeaders (r:2 w:1) - /// Proof: BTCRelay BlockHeaders (max_values: None, max_size: Some(200), added: 2675, mode: MaxEncodedLen) - /// Storage: BTCRelay ChainsIndex (r:1 w:1) - /// Proof: BTCRelay ChainsIndex (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) - /// Storage: BTCRelay DisableDifficultyCheck (r:1 w:0) - /// Proof: BTCRelay DisableDifficultyCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: BTCRelay ChainsHashes (r:1 w:1) - /// Proof: BTCRelay ChainsHashes (max_values: None, max_size: Some(72), added: 2547, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlock (r:0 w:1) - /// Proof: BTCRelay BestBlock (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlockHeight (r:0 w:1) - /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - fn store_block_header() -> Weight { + /// Storage: `BTCRelay::BlockHeaders` (r:2 w:0) + /// Proof: `BTCRelay::BlockHeaders` (`max_values`: None, `max_size`: Some(200), added: 2675, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainWork` (r:1 w:1) + /// Proof: `BTCRelay::ChainWork` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) + fn set_chainwork_for_block () -> Weight { + // Proof Size summary in bytes: + // Measured: `1049` + // Estimated: `6340` + // Minimum execution time: 39_000_000 picoseconds. + Weight::from_parts(39_000_000, 6340) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: `BTCRelay::ChainCounter` (r:1 w:0) + /// Proof: `BTCRelay::ChainCounter` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BlockHeaders` (r:2 w:1) + /// Proof: `BTCRelay::BlockHeaders` (`max_values`: None, `max_size`: Some(200), added: 2675, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsIndex` (r:1 w:1) + /// Proof: `BTCRelay::ChainsIndex` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::DisableDifficultyCheck` (r:1 w:0) + /// Proof: `BTCRelay::DisableDifficultyCheck` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsHashes` (r:1 w:1) + /// Proof: `BTCRelay::ChainsHashes` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `MaxEncodedLen`) + /// Storage: `Security::ActiveBlockCount` (r:1 w:0) + /// Proof: `Security::ActiveBlockCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainWork` (r:1 w:1) + /// Proof: `BTCRelay::ChainWork` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlock` (r:0 w:1) + /// Proof: `BTCRelay::BestBlock` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlockHeight` (r:0 w:1) + /// Proof: `BTCRelay::BestBlockHeight` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + fn store_block_header_when_updating_chainwork_mandatory () -> Weight { + // Proof Size summary in bytes: + // Measured: `979` + // Estimated: `6340` + // Minimum execution time: 83_000_000 picoseconds. + Weight::from_parts(83_000_000, 6340) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().writes(6_u64)) + } + /// Storage: `BTCRelay::ChainCounter` (r:1 w:0) + /// Proof: `BTCRelay::ChainCounter` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BlockHeaders` (r:2 w:1) + /// Proof: `BTCRelay::BlockHeaders` (`max_values`: None, `max_size`: Some(200), added: 2675, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsIndex` (r:1 w:1) + /// Proof: `BTCRelay::ChainsIndex` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::DisableDifficultyCheck` (r:1 w:0) + /// Proof: `BTCRelay::DisableDifficultyCheck` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsHashes` (r:1 w:1) + /// Proof: `BTCRelay::ChainsHashes` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `MaxEncodedLen`) + /// Storage: `Security::ActiveBlockCount` (r:1 w:0) + /// Proof: `Security::ActiveBlockCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainWork` (r:1 w:0) + /// Proof: `BTCRelay::ChainWork` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlock` (r:0 w:1) + /// Proof: `BTCRelay::BestBlock` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlockHeight` (r:0 w:1) + /// Proof: `BTCRelay::BestBlockHeight` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + fn store_block_header () -> Weight { // Proof Size summary in bytes: - // Measured: `1953` - // Estimated: `11898` - // Minimum execution time: 65_610_000 picoseconds. - Weight::from_parts(66_748_000, 11898) - .saturating_add(T::DbWeight::get().reads(7_u64)) + // Measured: `874` + // Estimated: `6340` + // Minimum execution time: 73_000_000 picoseconds. + Weight::from_parts(73_000_000, 6340) + .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } - /// Storage: BTCRelay ChainCounter (r:1 w:1) - /// Proof: BTCRelay ChainCounter (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BlockHeaders (r:2 w:1) - /// Proof: BTCRelay BlockHeaders (max_values: None, max_size: Some(200), added: 2675, mode: MaxEncodedLen) - /// Storage: BTCRelay ChainsIndex (r:6 w:1) - /// Proof: BTCRelay ChainsIndex (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) - /// Storage: BTCRelay DisableDifficultyCheck (r:1 w:0) - /// Proof: BTCRelay DisableDifficultyCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: BTCRelay Chains (r:7 w:1) - /// Proof: BTCRelay Chains (max_values: None, max_size: Some(24), added: 2499, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlock (r:1 w:0) - /// Proof: BTCRelay BestBlock (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: BTCRelay ChainsHashes (r:0 w:1) - /// Proof: BTCRelay ChainsHashes (max_values: None, max_size: Some(72), added: 2547, mode: MaxEncodedLen) + /// Storage: `BTCRelay::ChainCounter` (r:1 w:1) + /// Proof: `BTCRelay::ChainCounter` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BlockHeaders` (r:2 w:1) + /// Proof: `BTCRelay::BlockHeaders` (`max_values`: None, `max_size`: Some(200), added: 2675, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsIndex` (r:6 w:1) + /// Proof: `BTCRelay::ChainsIndex` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::DisableDifficultyCheck` (r:1 w:0) + /// Proof: `BTCRelay::DisableDifficultyCheck` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::Chains` (r:7 w:1) + /// Proof: `BTCRelay::Chains` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`) + /// Storage: `Security::ActiveBlockCount` (r:1 w:0) + /// Proof: `Security::ActiveBlockCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainWork` (r:1 w:0) + /// Proof: `BTCRelay::ChainWork` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlock` (r:1 w:0) + /// Proof: `BTCRelay::BestBlock` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsHashes` (r:0 w:1) + /// Proof: `BTCRelay::ChainsHashes` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `MaxEncodedLen`) /// The range of component `f` is `[1, 6]`. - fn store_block_header_new_fork_sorted(f: u32, ) -> Weight { + fn store_block_header_new_fork_sorted (_f: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1894 + f * (92 ±0)` - // Estimated: `9870 + f * (5006 ±0)` - // Minimum execution time: 81_320_000 picoseconds. - Weight::from_parts(83_847_120, 9870) - // Standard Error: 384_640 - .saturating_add(Weight::from_parts(11_883_224, 0).saturating_mul(f.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) - .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(f.into()))) + // Measured: `796 + f * (110 ±0)` + // Estimated: `18483` + // Minimum execution time: 85_000_000 picoseconds. + Weight::from_parts(140_000_000, 18483) + .saturating_add(T::DbWeight::get().reads(20_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) - .saturating_add(Weight::from_parts(0, 5006).saturating_mul(f.into())) } - /// Storage: BTCRelay ChainCounter (r:1 w:1) - /// Proof: BTCRelay ChainCounter (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BlockHeaders (r:2 w:1) - /// Proof: BTCRelay BlockHeaders (max_values: None, max_size: Some(200), added: 2675, mode: MaxEncodedLen) - /// Storage: BTCRelay ChainsIndex (r:2 w:1) - /// Proof: BTCRelay ChainsIndex (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) - /// Storage: BTCRelay DisableDifficultyCheck (r:1 w:0) - /// Proof: BTCRelay DisableDifficultyCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: BTCRelay Chains (r:7 w:6) - /// Proof: BTCRelay Chains (max_values: None, max_size: Some(24), added: 2499, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlock (r:1 w:0) - /// Proof: BTCRelay BestBlock (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: BTCRelay ChainsHashes (r:0 w:1) - /// Proof: BTCRelay ChainsHashes (max_values: None, max_size: Some(72), added: 2547, mode: MaxEncodedLen) + /// Storage: `BTCRelay::ChainCounter` (r:1 w:1) + /// Proof: `BTCRelay::ChainCounter` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BlockHeaders` (r:2 w:1) + /// Proof: `BTCRelay::BlockHeaders` (`max_values`: None, `max_size`: Some(200), added: 2675, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsIndex` (r:2 w:1) + /// Proof: `BTCRelay::ChainsIndex` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::DisableDifficultyCheck` (r:1 w:0) + /// Proof: `BTCRelay::DisableDifficultyCheck` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::Chains` (r:7 w:6) + /// Proof: `BTCRelay::Chains` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`) + /// Storage: `Security::ActiveBlockCount` (r:1 w:0) + /// Proof: `Security::ActiveBlockCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainWork` (r:1 w:0) + /// Proof: `BTCRelay::ChainWork` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlock` (r:1 w:0) + /// Proof: `BTCRelay::BestBlock` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsHashes` (r:0 w:1) + /// Proof: `BTCRelay::ChainsHashes` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `MaxEncodedLen`) /// The range of component `f` is `[1, 6]`. - fn store_block_header_new_fork_unsorted(f: u32, ) -> Weight { + fn store_block_header_new_fork_unsorted (_f: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1973 + f * (98 ±0)` - // Estimated: `12911 + f * (2987 ±22)` - // Minimum execution time: 84_731_000 picoseconds. - Weight::from_parts(116_733_612, 12911) - // Standard Error: 720_816 - .saturating_add(Weight::from_parts(5_329_595, 0).saturating_mul(f.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(f.into()))) - .saturating_add(T::DbWeight::get().writes(4_u64)) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(f.into()))) - .saturating_add(Weight::from_parts(0, 2987).saturating_mul(f.into())) + // Measured: `832 + f * (108 ±0)` + // Estimated: `18483` + // Minimum execution time: 85_000_000 picoseconds. + Weight::from_parts(149_000_000, 18483) + .saturating_add(T::DbWeight::get().reads(16_u64)) + .saturating_add(T::DbWeight::get().writes(10_u64)) } - /// Storage: BTCRelay ChainCounter (r:1 w:0) - /// Proof: BTCRelay ChainCounter (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BlockHeaders (r:20 w:18) - /// Proof: BTCRelay BlockHeaders (max_values: None, max_size: Some(200), added: 2675, mode: MaxEncodedLen) - /// Storage: BTCRelay ChainsIndex (r:3 w:2) - /// Proof: BTCRelay ChainsIndex (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) - /// Storage: BTCRelay DisableDifficultyCheck (r:1 w:0) - /// Proof: BTCRelay DisableDifficultyCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: BTCRelay ChainsHashes (r:13 w:24) - /// Proof: BTCRelay ChainsHashes (max_values: None, max_size: Some(72), added: 2547, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay Chains (r:6 w:0) - /// Proof: BTCRelay Chains (max_values: None, max_size: Some(24), added: 2499, mode: MaxEncodedLen) - /// Storage: BTCRelay StableBitcoinConfirmations (r:1 w:0) - /// Proof: BTCRelay StableBitcoinConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlock (r:0 w:1) - /// Proof: BTCRelay BestBlock (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlockHeight (r:0 w:1) - /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: `BTCRelay::ChainCounter` (r:1 w:0) + /// Proof: `BTCRelay::ChainCounter` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BlockHeaders` (r:20 w:18) + /// Proof: `BTCRelay::BlockHeaders` (`max_values`: None, `max_size`: Some(200), added: 2675, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsIndex` (r:3 w:2) + /// Proof: `BTCRelay::ChainsIndex` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::DisableDifficultyCheck` (r:1 w:0) + /// Proof: `BTCRelay::DisableDifficultyCheck` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsHashes` (r:13 w:24) + /// Proof: `BTCRelay::ChainsHashes` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `MaxEncodedLen`) + /// Storage: `Security::ActiveBlockCount` (r:1 w:0) + /// Proof: `Security::ActiveBlockCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainWork` (r:3 w:0) + /// Proof: `BTCRelay::ChainWork` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::Chains` (r:6 w:0) + /// Proof: `BTCRelay::Chains` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::StableBitcoinConfirmations` (r:1 w:0) + /// Proof: `BTCRelay::StableBitcoinConfirmations` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlock` (r:0 w:1) + /// Proof: `BTCRelay::BestBlock` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlockHeight` (r:0 w:1) + /// Proof: `BTCRelay::BestBlockHeight` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) /// The range of component `f` is `[3, 6]`. - fn store_block_header_reorganize_chains(f: u32, ) -> Weight { + fn store_block_header_reorganize_chains (_f: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `6534 + f * (199 ±0)` - // Estimated: `101752 + f * (1305 ±32)` - // Minimum execution time: 363_791_000 picoseconds. - Weight::from_parts(341_578_042, 101752) - // Standard Error: 162_430 - .saturating_add(Weight::from_parts(9_039_414, 0).saturating_mul(f.into())) - .saturating_add(T::DbWeight::get().reads(42_u64)) - .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(f.into()))) + // Measured: `4754 + f * (235 ±0)` + // Estimated: `54490` + // Minimum execution time: 509_000_000 picoseconds. + Weight::from_parts(533_000_000, 54490) + .saturating_add(T::DbWeight::get().reads(49_u64)) .saturating_add(T::DbWeight::get().writes(46_u64)) - .saturating_add(Weight::from_parts(0, 1305).saturating_mul(f.into())) } } // For backwards compatibility and tests impl WeightInfo for () { - /// Storage: BTCRelay BestBlock (r:1 w:1) - /// Proof: BTCRelay BestBlock (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: BTCRelay DisableDifficultyCheck (r:1 w:0) - /// Proof: BTCRelay DisableDifficultyCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: BTCRelay ChainCounter (r:1 w:1) - /// Proof: BTCRelay ChainCounter (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay Chains (r:1 w:1) - /// Proof: BTCRelay Chains (max_values: None, max_size: Some(24), added: 2499, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay ChainsHashes (r:0 w:1) - /// Proof: BTCRelay ChainsHashes (max_values: None, max_size: Some(72), added: 2547, mode: MaxEncodedLen) - /// Storage: BTCRelay StartBlockHeight (r:0 w:1) - /// Proof: BTCRelay StartBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlockHeight (r:0 w:1) - /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay ChainsIndex (r:0 w:1) - /// Proof: BTCRelay ChainsIndex (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) - /// Storage: BTCRelay BlockHeaders (r:0 w:1) - /// Proof: BTCRelay BlockHeaders (max_values: None, max_size: Some(200), added: 2675, mode: MaxEncodedLen) - fn initialize() -> Weight { + + /// Storage: `BTCRelay::BestBlock` (r:1 w:1) + /// Proof: `BTCRelay::BestBlock` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::DisableDifficultyCheck` (r:1 w:0) + /// Proof: `BTCRelay::DisableDifficultyCheck` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainCounter` (r:1 w:1) + /// Proof: `BTCRelay::ChainCounter` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::Chains` (r:1 w:1) + /// Proof: `BTCRelay::Chains` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`) + /// Storage: `Security::ActiveBlockCount` (r:1 w:0) + /// Proof: `Security::ActiveBlockCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainWork` (r:1 w:0) + /// Proof: `BTCRelay::ChainWork` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsHashes` (r:0 w:1) + /// Proof: `BTCRelay::ChainsHashes` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::StartBlockHeight` (r:0 w:1) + /// Proof: `BTCRelay::StartBlockHeight` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlockHeight` (r:0 w:1) + /// Proof: `BTCRelay::BestBlockHeight` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsIndex` (r:0 w:1) + /// Proof: `BTCRelay::ChainsIndex` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BlockHeaders` (r:0 w:1) + /// Proof: `BTCRelay::BlockHeaders` (`max_values`: None, `max_size`: Some(200), added: 2675, mode: `MaxEncodedLen`) + fn initialize () -> Weight { // Proof Size summary in bytes: - // Measured: `1451` - // Estimated: `4520` - // Minimum execution time: 57_676_000 picoseconds. - Weight::from_parts(58_347_000, 4520) - .saturating_add(RocksDbWeight::get().reads(5_u64)) + // Measured: `403` + // Estimated: `3545` + // Minimum execution time: 80_000_000 picoseconds. + Weight::from_parts(80_000_000, 3545) + .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(8_u64)) } - /// Storage: BTCRelay ChainCounter (r:1 w:0) - /// Proof: BTCRelay ChainCounter (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BlockHeaders (r:2 w:1) - /// Proof: BTCRelay BlockHeaders (max_values: None, max_size: Some(200), added: 2675, mode: MaxEncodedLen) - /// Storage: BTCRelay ChainsIndex (r:1 w:1) - /// Proof: BTCRelay ChainsIndex (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) - /// Storage: BTCRelay DisableDifficultyCheck (r:1 w:0) - /// Proof: BTCRelay DisableDifficultyCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: BTCRelay ChainsHashes (r:1 w:1) - /// Proof: BTCRelay ChainsHashes (max_values: None, max_size: Some(72), added: 2547, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlock (r:0 w:1) - /// Proof: BTCRelay BestBlock (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlockHeight (r:0 w:1) - /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - fn store_block_header() -> Weight { + /// Storage: `BTCRelay::BlockHeaders` (r:2 w:0) + /// Proof: `BTCRelay::BlockHeaders` (`max_values`: None, `max_size`: Some(200), added: 2675, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainWork` (r:1 w:1) + /// Proof: `BTCRelay::ChainWork` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) + fn set_chainwork_for_block () -> Weight { + // Proof Size summary in bytes: + // Measured: `1049` + // Estimated: `6340` + // Minimum execution time: 39_000_000 picoseconds. + Weight::from_parts(39_000_000, 6340) + .saturating_add(RocksDbWeight::get().reads(3_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } + /// Storage: `BTCRelay::ChainCounter` (r:1 w:0) + /// Proof: `BTCRelay::ChainCounter` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BlockHeaders` (r:2 w:1) + /// Proof: `BTCRelay::BlockHeaders` (`max_values`: None, `max_size`: Some(200), added: 2675, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsIndex` (r:1 w:1) + /// Proof: `BTCRelay::ChainsIndex` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::DisableDifficultyCheck` (r:1 w:0) + /// Proof: `BTCRelay::DisableDifficultyCheck` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsHashes` (r:1 w:1) + /// Proof: `BTCRelay::ChainsHashes` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `MaxEncodedLen`) + /// Storage: `Security::ActiveBlockCount` (r:1 w:0) + /// Proof: `Security::ActiveBlockCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainWork` (r:1 w:1) + /// Proof: `BTCRelay::ChainWork` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlock` (r:0 w:1) + /// Proof: `BTCRelay::BestBlock` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlockHeight` (r:0 w:1) + /// Proof: `BTCRelay::BestBlockHeight` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + fn store_block_header_when_updating_chainwork_mandatory () -> Weight { + // Proof Size summary in bytes: + // Measured: `979` + // Estimated: `6340` + // Minimum execution time: 83_000_000 picoseconds. + Weight::from_parts(83_000_000, 6340) + .saturating_add(RocksDbWeight::get().reads(8_u64)) + .saturating_add(RocksDbWeight::get().writes(6_u64)) + } + /// Storage: `BTCRelay::ChainCounter` (r:1 w:0) + /// Proof: `BTCRelay::ChainCounter` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BlockHeaders` (r:2 w:1) + /// Proof: `BTCRelay::BlockHeaders` (`max_values`: None, `max_size`: Some(200), added: 2675, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsIndex` (r:1 w:1) + /// Proof: `BTCRelay::ChainsIndex` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::DisableDifficultyCheck` (r:1 w:0) + /// Proof: `BTCRelay::DisableDifficultyCheck` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsHashes` (r:1 w:1) + /// Proof: `BTCRelay::ChainsHashes` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `MaxEncodedLen`) + /// Storage: `Security::ActiveBlockCount` (r:1 w:0) + /// Proof: `Security::ActiveBlockCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainWork` (r:1 w:0) + /// Proof: `BTCRelay::ChainWork` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlock` (r:0 w:1) + /// Proof: `BTCRelay::BestBlock` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlockHeight` (r:0 w:1) + /// Proof: `BTCRelay::BestBlockHeight` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + fn store_block_header () -> Weight { // Proof Size summary in bytes: - // Measured: `1953` - // Estimated: `11898` - // Minimum execution time: 65_610_000 picoseconds. - Weight::from_parts(66_748_000, 11898) - .saturating_add(RocksDbWeight::get().reads(7_u64)) + // Measured: `874` + // Estimated: `6340` + // Minimum execution time: 73_000_000 picoseconds. + Weight::from_parts(73_000_000, 6340) + .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } - /// Storage: BTCRelay ChainCounter (r:1 w:1) - /// Proof: BTCRelay ChainCounter (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BlockHeaders (r:2 w:1) - /// Proof: BTCRelay BlockHeaders (max_values: None, max_size: Some(200), added: 2675, mode: MaxEncodedLen) - /// Storage: BTCRelay ChainsIndex (r:6 w:1) - /// Proof: BTCRelay ChainsIndex (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) - /// Storage: BTCRelay DisableDifficultyCheck (r:1 w:0) - /// Proof: BTCRelay DisableDifficultyCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: BTCRelay Chains (r:7 w:1) - /// Proof: BTCRelay Chains (max_values: None, max_size: Some(24), added: 2499, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlock (r:1 w:0) - /// Proof: BTCRelay BestBlock (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: BTCRelay ChainsHashes (r:0 w:1) - /// Proof: BTCRelay ChainsHashes (max_values: None, max_size: Some(72), added: 2547, mode: MaxEncodedLen) + /// Storage: `BTCRelay::ChainCounter` (r:1 w:1) + /// Proof: `BTCRelay::ChainCounter` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BlockHeaders` (r:2 w:1) + /// Proof: `BTCRelay::BlockHeaders` (`max_values`: None, `max_size`: Some(200), added: 2675, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsIndex` (r:6 w:1) + /// Proof: `BTCRelay::ChainsIndex` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::DisableDifficultyCheck` (r:1 w:0) + /// Proof: `BTCRelay::DisableDifficultyCheck` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::Chains` (r:7 w:1) + /// Proof: `BTCRelay::Chains` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`) + /// Storage: `Security::ActiveBlockCount` (r:1 w:0) + /// Proof: `Security::ActiveBlockCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainWork` (r:1 w:0) + /// Proof: `BTCRelay::ChainWork` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlock` (r:1 w:0) + /// Proof: `BTCRelay::BestBlock` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsHashes` (r:0 w:1) + /// Proof: `BTCRelay::ChainsHashes` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `MaxEncodedLen`) /// The range of component `f` is `[1, 6]`. - fn store_block_header_new_fork_sorted(f: u32, ) -> Weight { + fn store_block_header_new_fork_sorted (_f: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1894 + f * (92 ±0)` - // Estimated: `9870 + f * (5006 ±0)` - // Minimum execution time: 81_320_000 picoseconds. - Weight::from_parts(83_847_120, 9870) - // Standard Error: 384_640 - .saturating_add(Weight::from_parts(11_883_224, 0).saturating_mul(f.into())) - .saturating_add(RocksDbWeight::get().reads(7_u64)) - .saturating_add(RocksDbWeight::get().reads((2_u64).saturating_mul(f.into()))) + // Measured: `796 + f * (110 ±0)` + // Estimated: `18483` + // Minimum execution time: 85_000_000 picoseconds. + Weight::from_parts(140_000_000, 18483) + .saturating_add(RocksDbWeight::get().reads(20_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) - .saturating_add(Weight::from_parts(0, 5006).saturating_mul(f.into())) } - /// Storage: BTCRelay ChainCounter (r:1 w:1) - /// Proof: BTCRelay ChainCounter (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BlockHeaders (r:2 w:1) - /// Proof: BTCRelay BlockHeaders (max_values: None, max_size: Some(200), added: 2675, mode: MaxEncodedLen) - /// Storage: BTCRelay ChainsIndex (r:2 w:1) - /// Proof: BTCRelay ChainsIndex (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) - /// Storage: BTCRelay DisableDifficultyCheck (r:1 w:0) - /// Proof: BTCRelay DisableDifficultyCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: BTCRelay Chains (r:7 w:6) - /// Proof: BTCRelay Chains (max_values: None, max_size: Some(24), added: 2499, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlock (r:1 w:0) - /// Proof: BTCRelay BestBlock (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: BTCRelay ChainsHashes (r:0 w:1) - /// Proof: BTCRelay ChainsHashes (max_values: None, max_size: Some(72), added: 2547, mode: MaxEncodedLen) + /// Storage: `BTCRelay::ChainCounter` (r:1 w:1) + /// Proof: `BTCRelay::ChainCounter` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BlockHeaders` (r:2 w:1) + /// Proof: `BTCRelay::BlockHeaders` (`max_values`: None, `max_size`: Some(200), added: 2675, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsIndex` (r:2 w:1) + /// Proof: `BTCRelay::ChainsIndex` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::DisableDifficultyCheck` (r:1 w:0) + /// Proof: `BTCRelay::DisableDifficultyCheck` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::Chains` (r:7 w:6) + /// Proof: `BTCRelay::Chains` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`) + /// Storage: `Security::ActiveBlockCount` (r:1 w:0) + /// Proof: `Security::ActiveBlockCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainWork` (r:1 w:0) + /// Proof: `BTCRelay::ChainWork` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlock` (r:1 w:0) + /// Proof: `BTCRelay::BestBlock` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsHashes` (r:0 w:1) + /// Proof: `BTCRelay::ChainsHashes` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `MaxEncodedLen`) /// The range of component `f` is `[1, 6]`. - fn store_block_header_new_fork_unsorted(f: u32, ) -> Weight { + fn store_block_header_new_fork_unsorted (_f: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1973 + f * (98 ±0)` - // Estimated: `12911 + f * (2987 ±22)` - // Minimum execution time: 84_731_000 picoseconds. - Weight::from_parts(116_733_612, 12911) - // Standard Error: 720_816 - .saturating_add(Weight::from_parts(5_329_595, 0).saturating_mul(f.into())) - .saturating_add(RocksDbWeight::get().reads(8_u64)) - .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(f.into()))) - .saturating_add(RocksDbWeight::get().writes(4_u64)) - .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(f.into()))) - .saturating_add(Weight::from_parts(0, 2987).saturating_mul(f.into())) + // Measured: `832 + f * (108 ±0)` + // Estimated: `18483` + // Minimum execution time: 85_000_000 picoseconds. + Weight::from_parts(149_000_000, 18483) + .saturating_add(RocksDbWeight::get().reads(16_u64)) + .saturating_add(RocksDbWeight::get().writes(10_u64)) } - /// Storage: BTCRelay ChainCounter (r:1 w:0) - /// Proof: BTCRelay ChainCounter (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BlockHeaders (r:20 w:18) - /// Proof: BTCRelay BlockHeaders (max_values: None, max_size: Some(200), added: 2675, mode: MaxEncodedLen) - /// Storage: BTCRelay ChainsIndex (r:3 w:2) - /// Proof: BTCRelay ChainsIndex (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) - /// Storage: BTCRelay DisableDifficultyCheck (r:1 w:0) - /// Proof: BTCRelay DisableDifficultyCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: BTCRelay ChainsHashes (r:13 w:24) - /// Proof: BTCRelay ChainsHashes (max_values: None, max_size: Some(72), added: 2547, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay Chains (r:6 w:0) - /// Proof: BTCRelay Chains (max_values: None, max_size: Some(24), added: 2499, mode: MaxEncodedLen) - /// Storage: BTCRelay StableBitcoinConfirmations (r:1 w:0) - /// Proof: BTCRelay StableBitcoinConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlock (r:0 w:1) - /// Proof: BTCRelay BestBlock (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlockHeight (r:0 w:1) - /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: `BTCRelay::ChainCounter` (r:1 w:0) + /// Proof: `BTCRelay::ChainCounter` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BlockHeaders` (r:20 w:18) + /// Proof: `BTCRelay::BlockHeaders` (`max_values`: None, `max_size`: Some(200), added: 2675, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsIndex` (r:3 w:2) + /// Proof: `BTCRelay::ChainsIndex` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::DisableDifficultyCheck` (r:1 w:0) + /// Proof: `BTCRelay::DisableDifficultyCheck` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsHashes` (r:13 w:24) + /// Proof: `BTCRelay::ChainsHashes` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `MaxEncodedLen`) + /// Storage: `Security::ActiveBlockCount` (r:1 w:0) + /// Proof: `Security::ActiveBlockCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainWork` (r:3 w:0) + /// Proof: `BTCRelay::ChainWork` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::Chains` (r:6 w:0) + /// Proof: `BTCRelay::Chains` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::StableBitcoinConfirmations` (r:1 w:0) + /// Proof: `BTCRelay::StableBitcoinConfirmations` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlock` (r:0 w:1) + /// Proof: `BTCRelay::BestBlock` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlockHeight` (r:0 w:1) + /// Proof: `BTCRelay::BestBlockHeight` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) /// The range of component `f` is `[3, 6]`. - fn store_block_header_reorganize_chains(f: u32, ) -> Weight { + fn store_block_header_reorganize_chains (_f: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `6534 + f * (199 ±0)` - // Estimated: `101752 + f * (1305 ±32)` - // Minimum execution time: 363_791_000 picoseconds. - Weight::from_parts(341_578_042, 101752) - // Standard Error: 162_430 - .saturating_add(Weight::from_parts(9_039_414, 0).saturating_mul(f.into())) - .saturating_add(RocksDbWeight::get().reads(42_u64)) - .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(f.into()))) + // Measured: `4754 + f * (235 ±0)` + // Estimated: `54490` + // Minimum execution time: 509_000_000 picoseconds. + Weight::from_parts(533_000_000, 54490) + .saturating_add(RocksDbWeight::get().reads(49_u64)) .saturating_add(RocksDbWeight::get().writes(46_u64)) - .saturating_add(Weight::from_parts(0, 1305).saturating_mul(f.into())) } } diff --git a/crates/btc-relay/src/lib.rs b/crates/btc-relay/src/lib.rs index 65ecc7c4d7..8081c3c94b 100644 --- a/crates/btc-relay/src/lib.rs +++ b/crates/btc-relay/src/lib.rs @@ -146,7 +146,6 @@ pub mod pallet { Ok(Pays::No.into()) } - // ToDo: Add benchmarking for `store_block_header_reorganize_based_on_work` /// Stores a single new block header /// /// # Arguments @@ -163,6 +162,7 @@ pub mod pallet { .max(::WeightInfo::store_block_header_new_fork_sorted(f)) .max(::WeightInfo::store_block_header_new_fork_unsorted(f)) .max(::WeightInfo::store_block_header_reorganize_chains(f)) + .max(::WeightInfo::store_block_header_when_updating_chainwork_mandatory()) }, DispatchClass::Operational ))] @@ -192,10 +192,9 @@ pub mod pallet { } /// Stores a chainwork for block header - // ToDo: Benchmarking needs to be performed #[pallet::call_index(2)] #[pallet::weight(( - ::WeightInfo::initialize(), + ::WeightInfo::set_chainwork_for_block(), DispatchClass::Operational ))] #[transactional] @@ -813,7 +812,7 @@ impl Pallet { ChainCounter::::get() } - fn contains_chainwork(block_hash: H256Le) -> bool { + pub fn contains_chainwork(block_hash: H256Le) -> bool { if let None = ChainWork::::get(block_hash) { false } else { diff --git a/crates/btc-relay/src/migration.rs b/crates/btc-relay/src/migration.rs index f77b9e5cd5..226542bb91 100644 --- a/crates/btc-relay/src/migration.rs +++ b/crates/btc-relay/src/migration.rs @@ -9,9 +9,15 @@ pub mod v1 { let current_storage_version = Pallet::::current_storage_version(); let _expected_storage_version = StorageVersion::new(0); if matches!(current_storage_version, _expected_storage_version) { - //Fixme: insert latest btc block as well as the calculated chain work. But for testnet the + // Fixme: insert latest btc block as well as the calculated chain work. But for testnet the // block header should be different. - ChainWork::::insert(H256Le::zero(), U256::zero()); + ChainWork::::insert( + H256Le::from_bytes_le(&[ + 177, 89, 206, 70, 83, 47, 12, 29, 30, 21, 192, 96, 38, 114, 155, 10, 5, 77, 59, 247, 14, 99, 150, + 79, 228, 250, 72, 71, 124, 92, 197, 19, + ]), + U256::zero(), + ); } StorageVersion::new(1).put::>(); weight diff --git a/crates/btc-relay/src/tests.rs b/crates/btc-relay/src/tests.rs index 534a25d5b0..745fb13d11 100644 --- a/crates/btc-relay/src/tests.rs +++ b/crates/btc-relay/src/tests.rs @@ -294,7 +294,10 @@ mod chainwork { let mut genesis_block = sample_block_header(); genesis_block.nonce = 11; - genesis_block.hash = H256Le::zero(); + genesis_block.hash = H256Le::from_bytes_le(&[ + 177, 89, 206, 70, 83, 47, 12, 29, 30, 21, 192, 96, 38, 114, 155, 10, 5, 77, 59, 247, 14, 99, 150, 79, + 228, 250, 72, 71, 124, 92, 197, 19, + ]); let block_height = 0; assert_ok!(BTCRelay::_initialize(3, genesis_block, block_height)); @@ -352,7 +355,7 @@ mod chainwork { // Step 6: Perform a reorg based on chainwork let mut block_14 = from_prev(31 + 12, prev_hash); - // update target so that the next block chain work is more that the best block. + // update target so that the next block chain work calculation is more that the best block. block_14.target = U256::max_value(); prev_hash = block_14.hash; assert_ok!(BTCRelay::_store_block_header(&3, block_14)); diff --git a/parachain/runtime/interlay/src/weights/btc_relay.rs b/parachain/runtime/interlay/src/weights/btc_relay.rs index 0958e8c733..497e8f764a 100644 --- a/parachain/runtime/interlay/src/weights/btc_relay.rs +++ b/parachain/runtime/interlay/src/weights/btc_relay.rs @@ -2,31 +2,30 @@ //! Autogenerated weights for btc_relay //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-09-26, STEPS: `2`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `interlay-rust-runner-2mz2v-jrrg4`, CPU: `AMD EPYC 7502P 32-Core Processor` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 +//! HOSTNAME: `Nakuls-MacBook-Pro.local`, CPU: `` +//! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 // Executed Command: -// target/release/interbtc-parachain +// ./target/release/interbtc-parachain // benchmark // pallet // --pallet -// * +// btc-relay // --extrinsic // * -// --chain -// interlay-dev -// --execution=wasm // --wasm-execution=compiled // --steps -// 50 +// 2 // --repeat -// 10 -// --output -// parachain/runtime/interlay/src/weights/ +// 1 // --template // .deploy/runtime-weight-template.hbs +// --chain +// interlay-dev +// --output +// int_bench.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -40,153 +39,190 @@ pub struct WeightInfo(PhantomData); impl btc_relay::WeightInfo for WeightInfo { - /// Storage: BTCRelay BestBlock (r:1 w:1) - /// Proof: BTCRelay BestBlock (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: BTCRelay DisableDifficultyCheck (r:1 w:0) - /// Proof: BTCRelay DisableDifficultyCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: BTCRelay ChainCounter (r:1 w:1) - /// Proof: BTCRelay ChainCounter (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay Chains (r:1 w:1) - /// Proof: BTCRelay Chains (max_values: None, max_size: Some(24), added: 2499, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay ChainsHashes (r:0 w:1) - /// Proof: BTCRelay ChainsHashes (max_values: None, max_size: Some(72), added: 2547, mode: MaxEncodedLen) - /// Storage: BTCRelay StartBlockHeight (r:0 w:1) - /// Proof: BTCRelay StartBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlockHeight (r:0 w:1) - /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay ChainsIndex (r:0 w:1) - /// Proof: BTCRelay ChainsIndex (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) - /// Storage: BTCRelay BlockHeaders (r:0 w:1) - /// Proof: BTCRelay BlockHeaders (max_values: None, max_size: Some(200), added: 2675, mode: MaxEncodedLen) + /// Storage: `BTCRelay::BestBlock` (r:1 w:1) + /// Proof: `BTCRelay::BestBlock` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::DisableDifficultyCheck` (r:1 w:0) + /// Proof: `BTCRelay::DisableDifficultyCheck` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainCounter` (r:1 w:1) + /// Proof: `BTCRelay::ChainCounter` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::Chains` (r:1 w:1) + /// Proof: `BTCRelay::Chains` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`) + /// Storage: `Security::ActiveBlockCount` (r:1 w:0) + /// Proof: `Security::ActiveBlockCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainWork` (r:1 w:0) + /// Proof: `BTCRelay::ChainWork` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsHashes` (r:0 w:1) + /// Proof: `BTCRelay::ChainsHashes` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::StartBlockHeight` (r:0 w:1) + /// Proof: `BTCRelay::StartBlockHeight` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlockHeight` (r:0 w:1) + /// Proof: `BTCRelay::BestBlockHeight` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsIndex` (r:0 w:1) + /// Proof: `BTCRelay::ChainsIndex` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BlockHeaders` (r:0 w:1) + /// Proof: `BTCRelay::BlockHeaders` (`max_values`: None, `max_size`: Some(200), added: 2675, mode: `MaxEncodedLen`) fn initialize () -> Weight { // Proof Size summary in bytes: // Measured: `403` - // Estimated: `3489` - // Minimum execution time: 71_783_000 picoseconds. - Weight::from_parts(74_009_000, 3489) - .saturating_add(T::DbWeight::get().reads(5_u64)) + // Estimated: `3545` + // Minimum execution time: 80_000_000 picoseconds. + Weight::from_parts(80_000_000, 3545) + .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(8_u64)) } - /// Storage: BTCRelay ChainCounter (r:1 w:0) - /// Proof: BTCRelay ChainCounter (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BlockHeaders (r:2 w:1) - /// Proof: BTCRelay BlockHeaders (max_values: None, max_size: Some(200), added: 2675, mode: MaxEncodedLen) - /// Storage: BTCRelay ChainsIndex (r:1 w:1) - /// Proof: BTCRelay ChainsIndex (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) - /// Storage: BTCRelay DisableDifficultyCheck (r:1 w:0) - /// Proof: BTCRelay DisableDifficultyCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: BTCRelay ChainsHashes (r:1 w:1) - /// Proof: BTCRelay ChainsHashes (max_values: None, max_size: Some(72), added: 2547, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlock (r:0 w:1) - /// Proof: BTCRelay BestBlock (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlockHeight (r:0 w:1) - /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: `BTCRelay::BlockHeaders` (r:2 w:0) + /// Proof: `BTCRelay::BlockHeaders` (`max_values`: None, `max_size`: Some(200), added: 2675, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainWork` (r:1 w:1) + /// Proof: `BTCRelay::ChainWork` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) + fn set_chainwork_for_block () -> Weight { + // Proof Size summary in bytes: + // Measured: `1049` + // Estimated: `6340` + // Minimum execution time: 39_000_000 picoseconds. + Weight::from_parts(39_000_000, 6340) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: `BTCRelay::ChainCounter` (r:1 w:0) + /// Proof: `BTCRelay::ChainCounter` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BlockHeaders` (r:2 w:1) + /// Proof: `BTCRelay::BlockHeaders` (`max_values`: None, `max_size`: Some(200), added: 2675, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsIndex` (r:1 w:1) + /// Proof: `BTCRelay::ChainsIndex` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::DisableDifficultyCheck` (r:1 w:0) + /// Proof: `BTCRelay::DisableDifficultyCheck` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsHashes` (r:1 w:1) + /// Proof: `BTCRelay::ChainsHashes` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `MaxEncodedLen`) + /// Storage: `Security::ActiveBlockCount` (r:1 w:0) + /// Proof: `Security::ActiveBlockCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainWork` (r:1 w:1) + /// Proof: `BTCRelay::ChainWork` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlock` (r:0 w:1) + /// Proof: `BTCRelay::BestBlock` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlockHeight` (r:0 w:1) + /// Proof: `BTCRelay::BestBlockHeight` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + fn store_block_header_when_updating_chainwork_mandatory () -> Weight { + // Proof Size summary in bytes: + // Measured: `979` + // Estimated: `6340` + // Minimum execution time: 83_000_000 picoseconds. + Weight::from_parts(83_000_000, 6340) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().writes(6_u64)) + } + /// Storage: `BTCRelay::ChainCounter` (r:1 w:0) + /// Proof: `BTCRelay::ChainCounter` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BlockHeaders` (r:2 w:1) + /// Proof: `BTCRelay::BlockHeaders` (`max_values`: None, `max_size`: Some(200), added: 2675, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsIndex` (r:1 w:1) + /// Proof: `BTCRelay::ChainsIndex` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::DisableDifficultyCheck` (r:1 w:0) + /// Proof: `BTCRelay::DisableDifficultyCheck` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsHashes` (r:1 w:1) + /// Proof: `BTCRelay::ChainsHashes` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `MaxEncodedLen`) + /// Storage: `Security::ActiveBlockCount` (r:1 w:0) + /// Proof: `Security::ActiveBlockCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainWork` (r:1 w:0) + /// Proof: `BTCRelay::ChainWork` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlock` (r:0 w:1) + /// Proof: `BTCRelay::BestBlock` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlockHeight` (r:0 w:1) + /// Proof: `BTCRelay::BestBlockHeight` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) fn store_block_header () -> Weight { // Proof Size summary in bytes: // Measured: `874` // Estimated: `6340` - // Minimum execution time: 88_808_000 picoseconds. - Weight::from_parts(90_482_000, 6340) - .saturating_add(T::DbWeight::get().reads(7_u64)) + // Minimum execution time: 73_000_000 picoseconds. + Weight::from_parts(73_000_000, 6340) + .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } - /// Storage: BTCRelay ChainCounter (r:1 w:1) - /// Proof: BTCRelay ChainCounter (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BlockHeaders (r:2 w:1) - /// Proof: BTCRelay BlockHeaders (max_values: None, max_size: Some(200), added: 2675, mode: MaxEncodedLen) - /// Storage: BTCRelay ChainsIndex (r:6 w:1) - /// Proof: BTCRelay ChainsIndex (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) - /// Storage: BTCRelay DisableDifficultyCheck (r:1 w:0) - /// Proof: BTCRelay DisableDifficultyCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: BTCRelay Chains (r:7 w:1) - /// Proof: BTCRelay Chains (max_values: None, max_size: Some(24), added: 2499, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlock (r:1 w:0) - /// Proof: BTCRelay BestBlock (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: BTCRelay ChainsHashes (r:0 w:1) - /// Proof: BTCRelay ChainsHashes (max_values: None, max_size: Some(72), added: 2547, mode: MaxEncodedLen) + /// Storage: `BTCRelay::ChainCounter` (r:1 w:1) + /// Proof: `BTCRelay::ChainCounter` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BlockHeaders` (r:2 w:1) + /// Proof: `BTCRelay::BlockHeaders` (`max_values`: None, `max_size`: Some(200), added: 2675, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsIndex` (r:6 w:1) + /// Proof: `BTCRelay::ChainsIndex` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::DisableDifficultyCheck` (r:1 w:0) + /// Proof: `BTCRelay::DisableDifficultyCheck` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::Chains` (r:7 w:1) + /// Proof: `BTCRelay::Chains` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`) + /// Storage: `Security::ActiveBlockCount` (r:1 w:0) + /// Proof: `Security::ActiveBlockCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainWork` (r:1 w:0) + /// Proof: `BTCRelay::ChainWork` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlock` (r:1 w:0) + /// Proof: `BTCRelay::BestBlock` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsHashes` (r:0 w:1) + /// Proof: `BTCRelay::ChainsHashes` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `MaxEncodedLen`) /// The range of component `f` is `[1, 6]`. - fn store_block_header_new_fork_sorted (f: u32, ) -> Weight { + fn store_block_header_new_fork_sorted (_f: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `806 + f * (101 ±0)` - // Estimated: `6340 + f * (2507 ±0)` - // Minimum execution time: 101_073_000 picoseconds. - Weight::from_parts(95_176_412, 6340) - // Standard Error: 452_083 - .saturating_add(Weight::from_parts(11_888_980, 0).saturating_mul(f.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) - .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(f.into()))) + // Measured: `796 + f * (110 ±0)` + // Estimated: `18483` + // Minimum execution time: 85_000_000 picoseconds. + Weight::from_parts(140_000_000, 18483) + .saturating_add(T::DbWeight::get().reads(20_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) - .saturating_add(Weight::from_parts(0, 2507).saturating_mul(f.into())) } - /// Storage: BTCRelay ChainCounter (r:1 w:1) - /// Proof: BTCRelay ChainCounter (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BlockHeaders (r:2 w:1) - /// Proof: BTCRelay BlockHeaders (max_values: None, max_size: Some(200), added: 2675, mode: MaxEncodedLen) - /// Storage: BTCRelay ChainsIndex (r:2 w:1) - /// Proof: BTCRelay ChainsIndex (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) - /// Storage: BTCRelay DisableDifficultyCheck (r:1 w:0) - /// Proof: BTCRelay DisableDifficultyCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: BTCRelay Chains (r:7 w:6) - /// Proof: BTCRelay Chains (max_values: None, max_size: Some(24), added: 2499, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlock (r:1 w:0) - /// Proof: BTCRelay BestBlock (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: BTCRelay ChainsHashes (r:0 w:1) - /// Proof: BTCRelay ChainsHashes (max_values: None, max_size: Some(72), added: 2547, mode: MaxEncodedLen) + /// Storage: `BTCRelay::ChainCounter` (r:1 w:1) + /// Proof: `BTCRelay::ChainCounter` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BlockHeaders` (r:2 w:1) + /// Proof: `BTCRelay::BlockHeaders` (`max_values`: None, `max_size`: Some(200), added: 2675, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsIndex` (r:2 w:1) + /// Proof: `BTCRelay::ChainsIndex` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::DisableDifficultyCheck` (r:1 w:0) + /// Proof: `BTCRelay::DisableDifficultyCheck` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::Chains` (r:7 w:6) + /// Proof: `BTCRelay::Chains` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`) + /// Storage: `Security::ActiveBlockCount` (r:1 w:0) + /// Proof: `Security::ActiveBlockCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainWork` (r:1 w:0) + /// Proof: `BTCRelay::ChainWork` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlock` (r:1 w:0) + /// Proof: `BTCRelay::BestBlock` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsHashes` (r:0 w:1) + /// Proof: `BTCRelay::ChainsHashes` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `MaxEncodedLen`) /// The range of component `f` is `[1, 6]`. - fn store_block_header_new_fork_unsorted (f: u32, ) -> Weight { + fn store_block_header_new_fork_unsorted (_f: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `842 + f * (99 ±0)` - // Estimated: `6340 + f * (2499 ±0)` - // Minimum execution time: 97_675_000 picoseconds. - Weight::from_parts(89_104_041, 6340) - // Standard Error: 196_333 - .saturating_add(Weight::from_parts(14_328_939, 0).saturating_mul(f.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(f.into()))) - .saturating_add(T::DbWeight::get().writes(4_u64)) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(f.into()))) - .saturating_add(Weight::from_parts(0, 2499).saturating_mul(f.into())) + // Measured: `832 + f * (108 ±0)` + // Estimated: `18483` + // Minimum execution time: 85_000_000 picoseconds. + Weight::from_parts(149_000_000, 18483) + .saturating_add(T::DbWeight::get().reads(16_u64)) + .saturating_add(T::DbWeight::get().writes(10_u64)) } - /// Storage: BTCRelay ChainCounter (r:1 w:0) - /// Proof: BTCRelay ChainCounter (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BlockHeaders (r:20 w:18) - /// Proof: BTCRelay BlockHeaders (max_values: None, max_size: Some(200), added: 2675, mode: MaxEncodedLen) - /// Storage: BTCRelay ChainsIndex (r:3 w:2) - /// Proof: BTCRelay ChainsIndex (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) - /// Storage: BTCRelay DisableDifficultyCheck (r:1 w:0) - /// Proof: BTCRelay DisableDifficultyCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: BTCRelay ChainsHashes (r:13 w:24) - /// Proof: BTCRelay ChainsHashes (max_values: None, max_size: Some(72), added: 2547, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay Chains (r:6 w:0) - /// Proof: BTCRelay Chains (max_values: None, max_size: Some(24), added: 2499, mode: MaxEncodedLen) - /// Storage: BTCRelay StableBitcoinConfirmations (r:1 w:0) - /// Proof: BTCRelay StableBitcoinConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlock (r:0 w:1) - /// Proof: BTCRelay BestBlock (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlockHeight (r:0 w:1) - /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: `BTCRelay::ChainCounter` (r:1 w:0) + /// Proof: `BTCRelay::ChainCounter` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BlockHeaders` (r:20 w:18) + /// Proof: `BTCRelay::BlockHeaders` (`max_values`: None, `max_size`: Some(200), added: 2675, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsIndex` (r:3 w:2) + /// Proof: `BTCRelay::ChainsIndex` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::DisableDifficultyCheck` (r:1 w:0) + /// Proof: `BTCRelay::DisableDifficultyCheck` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsHashes` (r:13 w:24) + /// Proof: `BTCRelay::ChainsHashes` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `MaxEncodedLen`) + /// Storage: `Security::ActiveBlockCount` (r:1 w:0) + /// Proof: `Security::ActiveBlockCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainWork` (r:3 w:0) + /// Proof: `BTCRelay::ChainWork` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::Chains` (r:6 w:0) + /// Proof: `BTCRelay::Chains` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::StableBitcoinConfirmations` (r:1 w:0) + /// Proof: `BTCRelay::StableBitcoinConfirmations` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlock` (r:0 w:1) + /// Proof: `BTCRelay::BestBlock` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlockHeight` (r:0 w:1) + /// Proof: `BTCRelay::BestBlockHeight` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) /// The range of component `f` is `[3, 6]`. - fn store_block_header_reorganize_chains (f: u32, ) -> Weight { + fn store_block_header_reorganize_chains (_f: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `4741 + f * (240 ±0)` - // Estimated: `54490 + f * (1340 ±45)` - // Minimum execution time: 506_604_000 picoseconds. - Weight::from_parts(465_095_071, 54490) - // Standard Error: 430_820 - .saturating_add(Weight::from_parts(18_597_675, 0).saturating_mul(f.into())) - .saturating_add(T::DbWeight::get().reads(42_u64)) - .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(f.into()))) + // Measured: `4754 + f * (235 ±0)` + // Estimated: `54490` + // Minimum execution time: 509_000_000 picoseconds. + Weight::from_parts(533_000_000, 54490) + .saturating_add(T::DbWeight::get().reads(49_u64)) .saturating_add(T::DbWeight::get().writes(46_u64)) - .saturating_add(Weight::from_parts(0, 1340).saturating_mul(f.into())) } } \ No newline at end of file diff --git a/parachain/runtime/kintsugi/src/weights/btc_relay.rs b/parachain/runtime/kintsugi/src/weights/btc_relay.rs index 4a89ccbe56..1667eee791 100644 --- a/parachain/runtime/kintsugi/src/weights/btc_relay.rs +++ b/parachain/runtime/kintsugi/src/weights/btc_relay.rs @@ -2,31 +2,30 @@ //! Autogenerated weights for btc_relay //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-09-26, STEPS: `2`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `interlay-rust-runner-2mz2v-kcxvd`, CPU: `AMD EPYC 7502P 32-Core Processor` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 +//! HOSTNAME: `Nakuls-MacBook-Pro.local`, CPU: `` +//! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 // Executed Command: -// target/release/interbtc-parachain +// ./target/release/interbtc-parachain // benchmark // pallet // --pallet -// * +// btc-relay // --extrinsic // * -// --chain -// kintsugi-dev -// --execution=wasm // --wasm-execution=compiled // --steps -// 50 +// 2 // --repeat -// 10 -// --output -// parachain/runtime/kintsugi/src/weights/ +// 1 // --template // .deploy/runtime-weight-template.hbs +// --chain +// kintsugi-dev +// --output +// kint_bench.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -40,153 +39,190 @@ pub struct WeightInfo(PhantomData); impl btc_relay::WeightInfo for WeightInfo { - /// Storage: BTCRelay BestBlock (r:1 w:1) - /// Proof: BTCRelay BestBlock (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: BTCRelay DisableDifficultyCheck (r:1 w:0) - /// Proof: BTCRelay DisableDifficultyCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: BTCRelay ChainCounter (r:1 w:1) - /// Proof: BTCRelay ChainCounter (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay Chains (r:1 w:1) - /// Proof: BTCRelay Chains (max_values: None, max_size: Some(24), added: 2499, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay ChainsHashes (r:0 w:1) - /// Proof: BTCRelay ChainsHashes (max_values: None, max_size: Some(72), added: 2547, mode: MaxEncodedLen) - /// Storage: BTCRelay StartBlockHeight (r:0 w:1) - /// Proof: BTCRelay StartBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlockHeight (r:0 w:1) - /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay ChainsIndex (r:0 w:1) - /// Proof: BTCRelay ChainsIndex (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) - /// Storage: BTCRelay BlockHeaders (r:0 w:1) - /// Proof: BTCRelay BlockHeaders (max_values: None, max_size: Some(200), added: 2675, mode: MaxEncodedLen) + /// Storage: `BTCRelay::BestBlock` (r:1 w:1) + /// Proof: `BTCRelay::BestBlock` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::DisableDifficultyCheck` (r:1 w:0) + /// Proof: `BTCRelay::DisableDifficultyCheck` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainCounter` (r:1 w:1) + /// Proof: `BTCRelay::ChainCounter` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::Chains` (r:1 w:1) + /// Proof: `BTCRelay::Chains` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`) + /// Storage: `Security::ActiveBlockCount` (r:1 w:0) + /// Proof: `Security::ActiveBlockCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainWork` (r:1 w:0) + /// Proof: `BTCRelay::ChainWork` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsHashes` (r:0 w:1) + /// Proof: `BTCRelay::ChainsHashes` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::StartBlockHeight` (r:0 w:1) + /// Proof: `BTCRelay::StartBlockHeight` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlockHeight` (r:0 w:1) + /// Proof: `BTCRelay::BestBlockHeight` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsIndex` (r:0 w:1) + /// Proof: `BTCRelay::ChainsIndex` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BlockHeaders` (r:0 w:1) + /// Proof: `BTCRelay::BlockHeaders` (`max_values`: None, `max_size`: Some(200), added: 2675, mode: `MaxEncodedLen`) fn initialize () -> Weight { // Proof Size summary in bytes: - // Measured: `403` - // Estimated: `3489` - // Minimum execution time: 66_834_000 picoseconds. - Weight::from_parts(67_535_000, 3489) - .saturating_add(T::DbWeight::get().reads(5_u64)) + // Measured: `423` + // Estimated: `3545` + // Minimum execution time: 113_000_000 picoseconds. + Weight::from_parts(113_000_000, 3545) + .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(8_u64)) } - /// Storage: BTCRelay ChainCounter (r:1 w:0) - /// Proof: BTCRelay ChainCounter (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BlockHeaders (r:2 w:1) - /// Proof: BTCRelay BlockHeaders (max_values: None, max_size: Some(200), added: 2675, mode: MaxEncodedLen) - /// Storage: BTCRelay ChainsIndex (r:1 w:1) - /// Proof: BTCRelay ChainsIndex (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) - /// Storage: BTCRelay DisableDifficultyCheck (r:1 w:0) - /// Proof: BTCRelay DisableDifficultyCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: BTCRelay ChainsHashes (r:1 w:1) - /// Proof: BTCRelay ChainsHashes (max_values: None, max_size: Some(72), added: 2547, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlock (r:0 w:1) - /// Proof: BTCRelay BestBlock (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlockHeight (r:0 w:1) - /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: `BTCRelay::BlockHeaders` (r:2 w:0) + /// Proof: `BTCRelay::BlockHeaders` (`max_values`: None, `max_size`: Some(200), added: 2675, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainWork` (r:1 w:1) + /// Proof: `BTCRelay::ChainWork` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) + fn set_chainwork_for_block () -> Weight { + // Proof Size summary in bytes: + // Measured: `1049` + // Estimated: `6340` + // Minimum execution time: 45_000_000 picoseconds. + Weight::from_parts(45_000_000, 6340) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: `BTCRelay::ChainCounter` (r:1 w:0) + /// Proof: `BTCRelay::ChainCounter` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BlockHeaders` (r:2 w:1) + /// Proof: `BTCRelay::BlockHeaders` (`max_values`: None, `max_size`: Some(200), added: 2675, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsIndex` (r:1 w:1) + /// Proof: `BTCRelay::ChainsIndex` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::DisableDifficultyCheck` (r:1 w:0) + /// Proof: `BTCRelay::DisableDifficultyCheck` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsHashes` (r:1 w:1) + /// Proof: `BTCRelay::ChainsHashes` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `MaxEncodedLen`) + /// Storage: `Security::ActiveBlockCount` (r:1 w:0) + /// Proof: `Security::ActiveBlockCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainWork` (r:1 w:1) + /// Proof: `BTCRelay::ChainWork` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlock` (r:0 w:1) + /// Proof: `BTCRelay::BestBlock` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlockHeight` (r:0 w:1) + /// Proof: `BTCRelay::BestBlockHeight` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + fn store_block_header_when_updating_chainwork_mandatory () -> Weight { + // Proof Size summary in bytes: + // Measured: `999` + // Estimated: `6340` + // Minimum execution time: 100_000_000 picoseconds. + Weight::from_parts(100_000_000, 6340) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().writes(6_u64)) + } + /// Storage: `BTCRelay::ChainCounter` (r:1 w:0) + /// Proof: `BTCRelay::ChainCounter` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BlockHeaders` (r:2 w:1) + /// Proof: `BTCRelay::BlockHeaders` (`max_values`: None, `max_size`: Some(200), added: 2675, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsIndex` (r:1 w:1) + /// Proof: `BTCRelay::ChainsIndex` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::DisableDifficultyCheck` (r:1 w:0) + /// Proof: `BTCRelay::DisableDifficultyCheck` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsHashes` (r:1 w:1) + /// Proof: `BTCRelay::ChainsHashes` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `MaxEncodedLen`) + /// Storage: `Security::ActiveBlockCount` (r:1 w:0) + /// Proof: `Security::ActiveBlockCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainWork` (r:1 w:0) + /// Proof: `BTCRelay::ChainWork` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlock` (r:0 w:1) + /// Proof: `BTCRelay::BestBlock` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlockHeight` (r:0 w:1) + /// Proof: `BTCRelay::BestBlockHeight` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) fn store_block_header () -> Weight { // Proof Size summary in bytes: - // Measured: `874` + // Measured: `894` // Estimated: `6340` - // Minimum execution time: 82_235_000 picoseconds. - Weight::from_parts(83_036_000, 6340) - .saturating_add(T::DbWeight::get().reads(7_u64)) + // Minimum execution time: 87_000_000 picoseconds. + Weight::from_parts(87_000_000, 6340) + .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } - /// Storage: BTCRelay ChainCounter (r:1 w:1) - /// Proof: BTCRelay ChainCounter (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BlockHeaders (r:2 w:1) - /// Proof: BTCRelay BlockHeaders (max_values: None, max_size: Some(200), added: 2675, mode: MaxEncodedLen) - /// Storage: BTCRelay ChainsIndex (r:6 w:1) - /// Proof: BTCRelay ChainsIndex (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) - /// Storage: BTCRelay DisableDifficultyCheck (r:1 w:0) - /// Proof: BTCRelay DisableDifficultyCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: BTCRelay Chains (r:7 w:1) - /// Proof: BTCRelay Chains (max_values: None, max_size: Some(24), added: 2499, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlock (r:1 w:0) - /// Proof: BTCRelay BestBlock (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: BTCRelay ChainsHashes (r:0 w:1) - /// Proof: BTCRelay ChainsHashes (max_values: None, max_size: Some(72), added: 2547, mode: MaxEncodedLen) + /// Storage: `BTCRelay::ChainCounter` (r:1 w:1) + /// Proof: `BTCRelay::ChainCounter` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BlockHeaders` (r:2 w:1) + /// Proof: `BTCRelay::BlockHeaders` (`max_values`: None, `max_size`: Some(200), added: 2675, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsIndex` (r:6 w:1) + /// Proof: `BTCRelay::ChainsIndex` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::DisableDifficultyCheck` (r:1 w:0) + /// Proof: `BTCRelay::DisableDifficultyCheck` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::Chains` (r:7 w:1) + /// Proof: `BTCRelay::Chains` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`) + /// Storage: `Security::ActiveBlockCount` (r:1 w:0) + /// Proof: `Security::ActiveBlockCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainWork` (r:1 w:0) + /// Proof: `BTCRelay::ChainWork` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlock` (r:1 w:0) + /// Proof: `BTCRelay::BestBlock` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsHashes` (r:0 w:1) + /// Proof: `BTCRelay::ChainsHashes` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `MaxEncodedLen`) /// The range of component `f` is `[1, 6]`. - fn store_block_header_new_fork_sorted (f: u32, ) -> Weight { + fn store_block_header_new_fork_sorted (_f: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `806 + f * (101 ±0)` - // Estimated: `6340 + f * (2507 ±0)` - // Minimum execution time: 93_938_000 picoseconds. - Weight::from_parts(85_636_123, 6340) - // Standard Error: 86_395 - .saturating_add(Weight::from_parts(10_763_758, 0).saturating_mul(f.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) - .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(f.into()))) + // Measured: `816 + f * (110 ±0)` + // Estimated: `18483` + // Minimum execution time: 89_000_000 picoseconds. + Weight::from_parts(139_000_000, 18483) + .saturating_add(T::DbWeight::get().reads(20_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) - .saturating_add(Weight::from_parts(0, 2507).saturating_mul(f.into())) } - /// Storage: BTCRelay ChainCounter (r:1 w:1) - /// Proof: BTCRelay ChainCounter (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BlockHeaders (r:2 w:1) - /// Proof: BTCRelay BlockHeaders (max_values: None, max_size: Some(200), added: 2675, mode: MaxEncodedLen) - /// Storage: BTCRelay ChainsIndex (r:2 w:1) - /// Proof: BTCRelay ChainsIndex (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) - /// Storage: BTCRelay DisableDifficultyCheck (r:1 w:0) - /// Proof: BTCRelay DisableDifficultyCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: BTCRelay Chains (r:7 w:6) - /// Proof: BTCRelay Chains (max_values: None, max_size: Some(24), added: 2499, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlock (r:1 w:0) - /// Proof: BTCRelay BestBlock (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: BTCRelay ChainsHashes (r:0 w:1) - /// Proof: BTCRelay ChainsHashes (max_values: None, max_size: Some(72), added: 2547, mode: MaxEncodedLen) + /// Storage: `BTCRelay::ChainCounter` (r:1 w:1) + /// Proof: `BTCRelay::ChainCounter` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BlockHeaders` (r:2 w:1) + /// Proof: `BTCRelay::BlockHeaders` (`max_values`: None, `max_size`: Some(200), added: 2675, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsIndex` (r:2 w:1) + /// Proof: `BTCRelay::ChainsIndex` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::DisableDifficultyCheck` (r:1 w:0) + /// Proof: `BTCRelay::DisableDifficultyCheck` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::Chains` (r:7 w:6) + /// Proof: `BTCRelay::Chains` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`) + /// Storage: `Security::ActiveBlockCount` (r:1 w:0) + /// Proof: `Security::ActiveBlockCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainWork` (r:1 w:0) + /// Proof: `BTCRelay::ChainWork` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlock` (r:1 w:0) + /// Proof: `BTCRelay::BestBlock` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsHashes` (r:0 w:1) + /// Proof: `BTCRelay::ChainsHashes` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `MaxEncodedLen`) /// The range of component `f` is `[1, 6]`. - fn store_block_header_new_fork_unsorted (f: u32, ) -> Weight { + fn store_block_header_new_fork_unsorted (_f: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `842 + f * (99 ±0)` - // Estimated: `6340 + f * (2499 ±31)` - // Minimum execution time: 95_491_000 picoseconds. - Weight::from_parts(87_545_230, 6340) - // Standard Error: 88_777 - .saturating_add(Weight::from_parts(13_033_203, 0).saturating_mul(f.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(f.into()))) - .saturating_add(T::DbWeight::get().writes(4_u64)) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(f.into()))) - .saturating_add(Weight::from_parts(0, 2499).saturating_mul(f.into())) + // Measured: `852 + f * (108 ±0)` + // Estimated: `18483` + // Minimum execution time: 113_000_000 picoseconds. + Weight::from_parts(151_000_000, 18483) + .saturating_add(T::DbWeight::get().reads(16_u64)) + .saturating_add(T::DbWeight::get().writes(10_u64)) } - /// Storage: BTCRelay ChainCounter (r:1 w:0) - /// Proof: BTCRelay ChainCounter (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BlockHeaders (r:20 w:18) - /// Proof: BTCRelay BlockHeaders (max_values: None, max_size: Some(200), added: 2675, mode: MaxEncodedLen) - /// Storage: BTCRelay ChainsIndex (r:3 w:2) - /// Proof: BTCRelay ChainsIndex (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) - /// Storage: BTCRelay DisableDifficultyCheck (r:1 w:0) - /// Proof: BTCRelay DisableDifficultyCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: BTCRelay ChainsHashes (r:13 w:24) - /// Proof: BTCRelay ChainsHashes (max_values: None, max_size: Some(72), added: 2547, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay Chains (r:6 w:0) - /// Proof: BTCRelay Chains (max_values: None, max_size: Some(24), added: 2499, mode: MaxEncodedLen) - /// Storage: BTCRelay StableBitcoinConfirmations (r:1 w:0) - /// Proof: BTCRelay StableBitcoinConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlock (r:0 w:1) - /// Proof: BTCRelay BestBlock (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlockHeight (r:0 w:1) - /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: `BTCRelay::ChainCounter` (r:1 w:0) + /// Proof: `BTCRelay::ChainCounter` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BlockHeaders` (r:20 w:18) + /// Proof: `BTCRelay::BlockHeaders` (`max_values`: None, `max_size`: Some(200), added: 2675, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsIndex` (r:3 w:2) + /// Proof: `BTCRelay::ChainsIndex` (`max_values`: None, `max_size`: Some(32), added: 2507, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::DisableDifficultyCheck` (r:1 w:0) + /// Proof: `BTCRelay::DisableDifficultyCheck` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainsHashes` (r:13 w:24) + /// Proof: `BTCRelay::ChainsHashes` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `MaxEncodedLen`) + /// Storage: `Security::ActiveBlockCount` (r:1 w:0) + /// Proof: `Security::ActiveBlockCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::ChainWork` (r:3 w:0) + /// Proof: `BTCRelay::ChainWork` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::Chains` (r:6 w:0) + /// Proof: `BTCRelay::Chains` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::StableBitcoinConfirmations` (r:1 w:0) + /// Proof: `BTCRelay::StableBitcoinConfirmations` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlock` (r:0 w:1) + /// Proof: `BTCRelay::BestBlock` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `BTCRelay::BestBlockHeight` (r:0 w:1) + /// Proof: `BTCRelay::BestBlockHeight` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) /// The range of component `f` is `[3, 6]`. - fn store_block_header_reorganize_chains (f: u32, ) -> Weight { + fn store_block_header_reorganize_chains (_f: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `4741 + f * (240 ±0)` - // Estimated: `54490 + f * (1340 ±45)` - // Minimum execution time: 513_248_000 picoseconds. - Weight::from_parts(504_054_659, 54490) - // Standard Error: 322_620 - .saturating_add(Weight::from_parts(7_203_738, 0).saturating_mul(f.into())) - .saturating_add(T::DbWeight::get().reads(42_u64)) - .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(f.into()))) + // Measured: `4774 + f * (235 ±0)` + // Estimated: `54490` + // Minimum execution time: 494_000_000 picoseconds. + Weight::from_parts(523_000_000, 54490) + .saturating_add(T::DbWeight::get().reads(49_u64)) .saturating_add(T::DbWeight::get().writes(46_u64)) - .saturating_add(Weight::from_parts(0, 1340).saturating_mul(f.into())) } } \ No newline at end of file