diff --git a/substrate-node/pallets/pallet-burning/src/weights.rs b/substrate-node/pallets/pallet-burning/src/weights.rs index 8954ebaa3..af9393c3e 100644 --- a/substrate-node/pallets/pallet-burning/src/weights.rs +++ b/substrate-node/pallets/pallet-burning/src/weights.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for pallet_burning //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-09-24, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-01, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `da081090f983`, CPU: `AMD Ryzen 7 5800X 8-Core Processor` +//! HOSTNAME: `585a9f003813`, CPU: `AMD Ryzen 7 5800X 8-Core Processor` //! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -45,8 +45,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `109` // Estimated: `1594` - // Minimum execution time: 26_741_000 picoseconds. - Weight::from_parts(27_212_000, 1594) + // Minimum execution time: 27_051_000 picoseconds. + Weight::from_parts(27_762_000, 1594) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -60,8 +60,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `109` // Estimated: `1594` - // Minimum execution time: 26_741_000 picoseconds. - Weight::from_parts(27_212_000, 1594) + // Minimum execution time: 27_051_000 picoseconds. + Weight::from_parts(27_762_000, 1594) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } diff --git a/substrate-node/pallets/pallet-dao/src/weights.rs b/substrate-node/pallets/pallet-dao/src/weights.rs index 3b3e90af6..8455b96c3 100644 --- a/substrate-node/pallets/pallet-dao/src/weights.rs +++ b/substrate-node/pallets/pallet-dao/src/weights.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for pallet_dao //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-09-24, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-01, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `da081090f983`, CPU: `AMD Ryzen 7 5800X 8-Core Processor` +//! HOSTNAME: `585a9f003813`, CPU: `AMD Ryzen 7 5800X 8-Core Processor` //! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -58,8 +58,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `208` // Estimated: `4687` - // Minimum execution time: 19_888_000 picoseconds. - Weight::from_parts(20_368_000, 4687) + // Minimum execution time: 19_757_000 picoseconds. + Weight::from_parts(20_439_000, 4687) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -77,8 +77,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `979` // Estimated: `4444` - // Minimum execution time: 26_991_000 picoseconds. - Weight::from_parts(27_542_000, 4444) + // Minimum execution time: 26_691_000 picoseconds. + Weight::from_parts(27_332_000, 4444) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -92,8 +92,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `487` // Estimated: `4687` - // Minimum execution time: 18_766_000 picoseconds. - Weight::from_parts(19_256_000, 4687) + // Minimum execution time: 18_845_000 picoseconds. + Weight::from_parts(19_287_000, 4687) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -111,8 +111,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `521` // Estimated: `4687` - // Minimum execution time: 25_348_000 picoseconds. - Weight::from_parts(26_310_000, 4687) + // Minimum execution time: 25_638_000 picoseconds. + Weight::from_parts(26_180_000, 4687) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -136,8 +136,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `208` // Estimated: `4687` - // Minimum execution time: 19_888_000 picoseconds. - Weight::from_parts(20_368_000, 4687) + // Minimum execution time: 19_757_000 picoseconds. + Weight::from_parts(20_439_000, 4687) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } @@ -155,8 +155,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `979` // Estimated: `4444` - // Minimum execution time: 26_991_000 picoseconds. - Weight::from_parts(27_542_000, 4444) + // Minimum execution time: 26_691_000 picoseconds. + Weight::from_parts(27_332_000, 4444) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -170,8 +170,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `487` // Estimated: `4687` - // Minimum execution time: 18_766_000 picoseconds. - Weight::from_parts(19_256_000, 4687) + // Minimum execution time: 18_845_000 picoseconds. + Weight::from_parts(19_287_000, 4687) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -189,8 +189,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `521` // Estimated: `4687` - // Minimum execution time: 25_348_000 picoseconds. - Weight::from_parts(26_310_000, 4687) + // Minimum execution time: 25_638_000 picoseconds. + Weight::from_parts(26_180_000, 4687) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } diff --git a/substrate-node/pallets/pallet-kvstore/src/weights.rs b/substrate-node/pallets/pallet-kvstore/src/weights.rs index 10510e029..db54cbf85 100644 --- a/substrate-node/pallets/pallet-kvstore/src/weights.rs +++ b/substrate-node/pallets/pallet-kvstore/src/weights.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for pallet_kvstore //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-09-24, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-01, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `da081090f983`, CPU: `AMD Ryzen 7 5800X 8-Core Processor` +//! HOSTNAME: `585a9f003813`, CPU: `AMD Ryzen 7 5800X 8-Core Processor` //! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -46,8 +46,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_054_000 picoseconds. - Weight::from_parts(7_274_000, 0) + // Minimum execution time: 6_903_000 picoseconds. + Weight::from_parts(7_153_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `TFKVStore::TFKVStore` (r:1 w:1) @@ -56,8 +56,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `146` // Estimated: `3611` - // Minimum execution time: 12_263_000 picoseconds. - Weight::from_parts(12_824_000, 3611) + // Minimum execution time: 12_274_000 picoseconds. + Weight::from_parts(12_734_000, 3611) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -71,8 +71,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_054_000 picoseconds. - Weight::from_parts(7_274_000, 0) + // Minimum execution time: 6_903_000 picoseconds. + Weight::from_parts(7_153_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `TFKVStore::TFKVStore` (r:1 w:1) @@ -81,8 +81,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `146` // Estimated: `3611` - // Minimum execution time: 12_263_000 picoseconds. - Weight::from_parts(12_824_000, 3611) + // Minimum execution time: 12_274_000 picoseconds. + Weight::from_parts(12_734_000, 3611) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } diff --git a/substrate-node/pallets/pallet-smart-contract/src/billing.rs b/substrate-node/pallets/pallet-smart-contract/src/billing.rs index 1ad253516..782bb0a4a 100644 --- a/substrate-node/pallets/pallet-smart-contract/src/billing.rs +++ b/substrate-node/pallets/pallet-smart-contract/src/billing.rs @@ -362,8 +362,14 @@ impl Pallet { has_sufficient_fund: bool, current_block: u64, ) -> DispatchResultWithPostInfo { + // Add a defensive check to prevent a node contract on a rented node from transitioning to 'created' status without considering the state of the associated rent contract + let rent_is_suspended = matches!(contract.contract_type, types::ContractData::NodeContract(_)) + && ActiveRentContractForNode::::get(contract.get_node_id()) + .and_then(|id| Contracts::::get(&id)) + .map(|c| matches!(c.state, types::ContractState::GracePeriod(_))) + .unwrap_or(false); match contract.state { - types::ContractState::GracePeriod(_) if has_sufficient_fund => { + types::ContractState::GracePeriod(_) if has_sufficient_fund && !rent_is_suspended => { // Manage transition from GracePeriod to Created log::info!("Contract {:?} is in grace period, but balance is recharged, moving to created state at block {:?}", contract.contract_id, current_block); Self::update_contract_state(contract, &types::ContractState::Created)?; @@ -386,6 +392,28 @@ impl Pallet { diff ); if diff >= T::GracePeriod::get() { + // Ensure associated node contracts have no reserved balance. + // If none, proceed to move the contract to the 'deleted' state. + // Otherwise, wait. + match contract.contract_type { + types::ContractData::RentContract(_) => { + let active_node_contracts = ActiveNodeContracts::::get(contract.get_node_id()); + let rent_has_node_contracts_with_reserve = + active_node_contracts.iter().any(|id| { + ContractPaymentState::::get(id).map_or(false, |s| s.has_reserve()) + }); + + if rent_has_node_contracts_with_reserve { + log::debug!( + "Grace period on rented node expired, but one or more associated node contracts hold user funds. \ + Rent contract deletion will be delayed until funds are distributed to beneficiaries." + ); + return Ok(().into()); + } + } + _ => (), + }; + log::info!("Contract {:?} state changed to deleted at block {:?} due to an expired grace period.", contract.contract_id, current_block); Self::deposit_event(Event::ContractGracePeriodElapsed { contract_id: contract.contract_id, @@ -734,6 +762,14 @@ impl Pallet { for ctr_id in active_node_contracts { let mut ctr = Contracts::::get(ctr_id).ok_or(Error::::ContractNotExists)?; + + // Defensive check to prevent a node contract on a rented node from transitioning to 'created' status if there's an overdraft (unsettled public IP rent). + if ContractPaymentState::::get(ctr_id).map_or_else(|| false, |ps| ps.has_overdraft()) + && matches!(state, types::ContractState::Created) + { + continue; + } + Self::update_contract_state(&mut ctr, &state)?; match state { diff --git a/substrate-node/pallets/pallet-smart-contract/src/grid_contract.rs b/substrate-node/pallets/pallet-smart-contract/src/grid_contract.rs index 7bdb7623b..a2fd7222a 100644 --- a/substrate-node/pallets/pallet-smart-contract/src/grid_contract.rs +++ b/substrate-node/pallets/pallet-smart-contract/src/grid_contract.rs @@ -272,9 +272,12 @@ impl Pallet { // override values contract.contract_type = types::ContractData::NodeContract(node_contract); - let state = contract.state.clone(); - Self::update_contract_state(&mut contract, &state)?; - + // Why we call update_contract_state if state can't be changed? + // Obviously, we just depened on the update_contract_state for writing the contract to the storage, but we can do it here + // let state = contract.state.clone(); + // Self::update_contract_state(&mut contract, &state)?; + Contracts::::insert(&contract.contract_id, contract.clone()); + Self::deposit_event(Event::ContractUpdated(contract)); Ok(().into()) @@ -393,14 +396,14 @@ impl Pallet { fn remove_active_node_contract(node_id: u32, contract_id: u64) { let mut contracts = ActiveNodeContracts::::get(&node_id); - match contracts.iter().position(|id| id == &contract_id) { - Some(index) => { - contracts.remove(index); - } - None => (), - }; + let initial_len = contracts.len(); + + contracts.retain(|&id| id != contract_id); - ActiveNodeContracts::::insert(&node_id, &contracts); + // Only update the storage if the list length has changed, meaning a contract was removed + if contracts.len() != initial_len { + ActiveNodeContracts::::insert(&node_id, contracts); + } } // Helper function that updates the contract state and manages storage accordingly @@ -408,9 +411,20 @@ impl Pallet { contract: &mut types::Contract, state: &types::ContractState, ) -> DispatchResultWithPostInfo { - // update the state and save the contract - contract.state = state.clone(); - Contracts::::insert(&contract.contract_id, contract.clone()); + // Update the state and save the contract only when necessary. + if contract.state != *state { + match (&contract.state, state) { + // Transition from GracePeriod(x) to GracePeriod(y) is not allowed + (types::ContractState::GracePeriod(_), types::ContractState::GracePeriod(_)) => { + log::info!("Contract {:?} already in grace period, not changing to {:?} state", contract.contract_id, state); + }, + // All other transitions are allowed + _ => { + contract.state = state.clone(); + Contracts::::insert(&contract.contract_id, contract.clone()); + } + } + } // if the contract is a name or rent contract, nothing to do left here match contract.contract_type { @@ -425,6 +439,7 @@ impl Pallet { let mut contracts = ActiveNodeContracts::::get(&node_contract.node_id); + let original_len = contracts.len(); match contracts.iter().position(|id| id == &contract.contract_id) { Some(index) => { // if the new contract state is delete, remove the contract id from the map @@ -439,8 +454,9 @@ impl Pallet { } } }; - - ActiveNodeContracts::::insert(&node_contract.node_id, &contracts); + if contracts.len() != original_len { + ActiveNodeContracts::::insert(&node_contract.node_id, &contracts); + }; Ok(().into()) } diff --git a/substrate-node/pallets/pallet-smart-contract/src/tests.rs b/substrate-node/pallets/pallet-smart-contract/src/tests.rs index ef24cc82d..56b5efdff 100644 --- a/substrate-node/pallets/pallet-smart-contract/src/tests.rs +++ b/substrate-node/pallets/pallet-smart-contract/src/tests.rs @@ -1,5 +1,5 @@ use crate::{ - cost, mock::RuntimeEvent as MockEvent, mock::*, test_utils::*, types, Error, + cost, mock::{RuntimeEvent as MockEvent, *}, test_utils::*, types, Error, Event as SmartContractEvent, }; use frame_support::{ @@ -3033,6 +3033,399 @@ fn test_rent_contract_and_node_contract_canceled_when_node_is_deleted_works() { }); } +#[test] +fn test_node_contract_on_dedicated_node_shouldnt_be_restored_if_rent_contract_in_grace_period() { + // Test ensuring that a node contract on a dedicated node remains in the grace period if the rent contract is in the grace period. + let (mut ext, mut pool_state) = new_test_ext_with_pool_state(0); + ext.execute_with(|| { + run_to_block(1, Some(&mut pool_state)); + prepare_dedicated_farm_and_node(); + + let node_id = 1; + + // Create a rent contract + assert_ok!(SmartContractModule::create_rent_contract( + RuntimeOrigin::signed(bob()), + node_id, + None + )); + let rent_contract_id = 1; + + run_to_block(2, Some(&mut pool_state)); + + // Create a node contract with a public IP + assert_ok!(SmartContractModule::create_node_contract( + RuntimeOrigin::signed(bob()), + node_id, + generate_deployment_hash(), + get_deployment_data(), + 1, + None + )); + let node_contract_id = 2; + push_contract_resources_used(node_contract_id); + + pool_state + .write() + .should_call_bill_contract(rent_contract_id, Ok(Pays::Yes.into()), 11); + run_to_block(11, Some(&mut pool_state)); + + pool_state + .write() + .should_call_bill_contract(node_contract_id, Ok(Pays::Yes.into()), 12); + run_to_block(12, Some(&mut pool_state)); + + // Transfer all balance from the owner of the contract to trigger the grace period to start + let bob_balance = Balances::usable_balance(bob()); + Balances::transfer_allow_death(RuntimeOrigin::signed(bob()), charlie(), bob_balance).unwrap(); + + // The grace period for the rent contract should start + // The node contract should also transition to the grace period + pool_state + .write() + .should_call_bill_contract(rent_contract_id, Ok(Pays::Yes.into()), 21); + run_to_block(21, Some(&mut pool_state)); + + // Check if the events contain ContractGracePeriodStarted events for both contracts + let events = System::events(); + log::debug!("Events: {:?}", events); + assert_eq!( + events + .iter() + .filter(|e| matches!( + e.event, + MockEvent::SmartContractModule(SmartContractEvent::ContractGracePeriodStarted { .. }) + )) + .count(), + 2 + ); + + // Transfer some balance to the owner of the contract to settle only the cost of IP rent (node contract) + // Case 1: See https://github.com/threefoldtech/tfchain/issues/1002 + // Calculate the node contract cost + let bob_twin_id = 2; + let (amount_due, discount_level) = calculate_tft_cost(node_contract_id, bob_twin_id, 10); + log::debug!("Amount due: {}, discount level: {:?}", amount_due, discount_level); + Balances::transfer_allow_death(RuntimeOrigin::signed(charlie()), bob(), amount_due).unwrap(); + + pool_state + .write() + .should_call_bill_contract(node_contract_id, Ok(Pays::Yes.into()), 22); + run_to_block(22, Some(&mut pool_state)); + + // Check if last event is Contract billed event + let events = System::events(); + log::debug!("Events: {:?}", events); + let contract_bill = types::ContractBill { + contract_id: node_contract_id, + timestamp: 1628082132, + discount_level, + amount_billed: amount_due as u128, + }; + assert_eq!( + events + .last() + .unwrap() + .event, + MockEvent::SmartContractModule(SmartContractEvent::ContractBilled(contract_bill)) + ); + + // Node contract cost settled (IP address cost), but it should remain in the grace period due to the suspended rent contract + // The cost of the node resources utilized by this node contract is billed to the rent contract + let node_contract = SmartContractModule::contracts(node_contract_id).unwrap(); + assert_eq!(node_contract.state, types::ContractState::GracePeriod(21)); + }); +} + +#[test] +fn test_node_contract_with_overdraft_on_dedicated_node_shouldnt_be_restored_when_rent_contract_overdraft_settled() { + // Test ensuring that a node contract with overdraft on a dedicated node remains in the grace period when the rent contract overdraft is settled + let (mut ext, mut pool_state) = new_test_ext_with_pool_state(0); + ext.execute_with(|| { + run_to_block(1, Some(&mut pool_state)); + prepare_dedicated_farm_and_node(); + + let node_id = 1; + + // Create a rent contract + assert_ok!(SmartContractModule::create_rent_contract( + RuntimeOrigin::signed(charlie()), + node_id, + None + )); + let rent_contract_id = 1; + + run_to_block(2, Some(&mut pool_state)); + + // Create a node contract with a public IP + assert_ok!(SmartContractModule::create_node_contract( + RuntimeOrigin::signed(charlie()), + node_id, + generate_deployment_hash(), + get_deployment_data(), + 1, + None + )); + let node_contract_id = 2; + push_contract_resources_used(node_contract_id); + + // Get spendable balance + let spendable_balance = SmartContractModule::get_usable_balance(&charlie()); + + // The grace period for the rent contract should start + // Node contract should also transition to grace period + pool_state + .write() + .should_call_bill_contract(rent_contract_id, Ok(Pays::Yes.into()), 11); + run_to_block(11, Some(&mut pool_state)); + + pool_state + .write() + .should_call_bill_contract(node_contract_id, Ok(Pays::Yes.into()), 12); + run_to_block(12, Some(&mut pool_state)); + + let rent_contract = SmartContractModule::contracts(rent_contract_id).unwrap(); + assert_eq!(rent_contract.state, types::ContractState::GracePeriod(11)); + + let node_contract = SmartContractModule::contracts(node_contract_id).unwrap(); + assert_eq!(node_contract.state, types::ContractState::GracePeriod(11)); + + // Transfer some balance to the owner of the contract to settle only the cost of node resources (rent contract) + // Case 2: see https://github.com/threefoldtech/tfchain/issues/1002 + // Calculate the rent contract cost + let charlie_twin_id = 3; + let (contract_cost, discount_level) = calculate_tft_cost(rent_contract_id, charlie_twin_id, 20); + let amount_due = contract_cost - spendable_balance; + log::debug!("Amount due: {}, discount level: {:?}", amount_due, discount_level); + Balances::transfer_allow_death(RuntimeOrigin::signed(bob()), charlie(), amount_due).unwrap(); + + // The grace period for the rent contract should end, + // but the node contract should remain in the grace period due to an outstanding overdraft + pool_state + .write() + .should_call_bill_contract(rent_contract_id, Ok(Pays::Yes.into()), 21); + run_to_block(21, Some(&mut pool_state)); + + let rent_contract = SmartContractModule::contracts(rent_contract_id).unwrap(); + assert_eq!(rent_contract.state, types::ContractState::Created); + + let node_contract = SmartContractModule::contracts(node_contract_id).unwrap(); + assert_eq!(node_contract.state, types::ContractState::GracePeriod(11)); + }); +} + +#[test] +fn test_rent_contract_should_wait_for_proper_distribution_of_rewards_when_grace_period_elapses() { + // Test ensuring that a rent contract is only canceled after associated node contracts have completed billing and rewards distribution, even if the grace period elapses + let (mut ext, mut pool_state) = new_test_ext_with_pool_state(0); + ext.execute_with(|| { + run_to_block(1, Some(&mut pool_state)); + prepare_dedicated_farm_and_node(); + + let node_id = 1; + + // Create a rent contract + assert_ok!(SmartContractModule::create_rent_contract( + RuntimeOrigin::signed(bob()), + node_id, + None + )); + let rent_contract_id = 1; + + run_to_block(2, Some(&mut pool_state)); + + // Create a node contract with a public IP + assert_ok!(SmartContractModule::create_node_contract( + RuntimeOrigin::signed(bob()), + node_id, + generate_deployment_hash(), + get_deployment_data(), + 1, + None + )); + let node_contract_id = 2; + push_contract_resources_used(node_contract_id); + + // In this cycle the contracts should reserve some amount from the owner + pool_state + .write() + .should_call_bill_contract(rent_contract_id, Ok(Pays::Yes.into()), 11); + run_to_block(11, Some(&mut pool_state)); + + pool_state + .write() + .should_call_bill_contract(node_contract_id, Ok(Pays::Yes.into()), 12); + run_to_block(12, Some(&mut pool_state)); + + // Part of the user's balance should be reserved + assert_ne!(Balances::reserved_balance(&bob()), 0); + + // Transfer all balance from the owner of the contract to trigger the grace period to start + let bob_balance = Balances::usable_balance(bob()); + Balances::transfer_allow_death(RuntimeOrigin::signed(bob()), charlie(), bob_balance).unwrap(); + + // The grace period for the rent contract should start + // Node contract should also transition to grace period + pool_state + .write() + .should_call_bill_contract(rent_contract_id, Ok(Pays::Yes.into()), 21); + run_to_block(21, Some(&mut pool_state)); + + // Check if events contain ContractGracePeriodStarted events for both contracts + let events = System::events(); + log::debug!("Events: {:?}", events); + assert_eq!( + events + .iter() + .filter(|e| matches!( + e.event, + MockEvent::SmartContractModule(SmartContractEvent::ContractGracePeriodStarted { .. }) + )) + .count(), + 2 + ); + pool_state + .write() + .should_call_bill_contract(node_contract_id, Ok(Pays::Yes.into()), 22); + run_to_block(22, Some(&mut pool_state)); + + // Advance 10 cycles + // Typically, the rent contract is canceled immediately after the grace period expires + // However, if one of the associated node contracts hasn't yet distributed rewards, + // the rent contract should remain active until the node contract completes billing and reward distribution + // Once done, the rent contract can then be canceled + // Case 3: see https://github.com/threefoldtech/tfchain/issues/1002 + for i in 1..=10 { + let block_number = 21 + i * BillingFrequency::get(); + pool_state.write().should_call_bill_contract( + rent_contract_id, + Ok(Pays::Yes.into()), + block_number, + ); + run_to_block(block_number, Some(&mut pool_state)); + pool_state.write().should_call_bill_contract( + node_contract_id, + Ok(Pays::Yes.into()), + block_number+1, + ); + run_to_block(block_number+1, Some(&mut pool_state)); + } + // Check if the events contain RewardDistributed event + let events = System::events(); + log::debug!("Events: {:?}", events); + assert_eq!( + events + .iter() + .filter(|e| matches!( + e.event, + MockEvent::SmartContractModule(SmartContractEvent::RewardDistributed { .. }) + )) + .count(), + 1 + ); + // Check if the last event is NodeContractCanceled event + assert_eq!( + events + .last() + .unwrap() + .event, + MockEvent::SmartContractModule(SmartContractEvent::NodeContractCanceled{ + contract_id: node_contract_id, + node_id: node_id, + twin_id: 2 + }) + ); + // The rent contract should be canceled in the next cycle + let block_number: u64 = 131; + pool_state.write().should_call_bill_contract( + rent_contract_id, + Ok(Pays::Yes.into()), + block_number, + ); + run_to_block(block_number, Some(&mut pool_state)); + + // Check if the last event is RentContractCanceled event + let events = System::events(); + assert_eq!( + events + .last() + .unwrap() + .event, + MockEvent::SmartContractModule(SmartContractEvent::RentContractCanceled{ + contract_id: rent_contract_id, + }) + ); + // No part of the user's balance should be reserved + assert_eq!(Balances::reserved_balance(&bob()), 0); + }); +} + +#[test] +fn test_node_contract_in_grace_period_should_maintain_start_block_number_if_rent_contract_transition_to_grace_period() { + // Test ensuring that a node contract in the grace period retains its original start block number, even if the associated rent contract transitions to the grace period + let (mut ext, mut pool_state) = new_test_ext_with_pool_state(0); + ext.execute_with(|| { + run_to_block(1, Some(&mut pool_state)); + prepare_dedicated_farm_and_node(); + + let node_id = 1; + + // Create a rent contract + assert_ok!(SmartContractModule::create_rent_contract( + RuntimeOrigin::signed(bob()), + node_id, + None + )); + let rent_contract_id = 1; + + run_to_block(2, Some(&mut pool_state)); + + // Create a node contract with a public IP + assert_ok!(SmartContractModule::create_node_contract( + RuntimeOrigin::signed(bob()), + node_id, + generate_deployment_hash(), + get_deployment_data(), + 1, + None + )); + let node_contract_id = 2; + push_contract_resources_used(node_contract_id); + + // Bill rent contract + pool_state + .write() + .should_call_bill_contract(rent_contract_id, Ok(Pays::Yes.into()), 11); + run_to_block(11, Some(&mut pool_state)); + + // Transfer all balance from the owner of the contract to trigger the grace period to start + let bob_balance = Balances::usable_balance(bob()); + Balances::transfer_allow_death(RuntimeOrigin::signed(bob()), charlie(), bob_balance).unwrap(); + + // The grace period for the node contract should start + pool_state + .write() + .should_call_bill_contract(node_contract_id, Ok(Pays::Yes.into()), 12); + run_to_block(12, Some(&mut pool_state)); + + let node_contract = SmartContractModule::contracts(node_contract_id).unwrap(); + assert_eq!(node_contract.state, types::ContractState::GracePeriod(12)); + + // The grace period for the rent contract should start + // The node contract should remain in the grace period, maintaining the original start block number (12) + pool_state + .write() + .should_call_bill_contract(rent_contract_id, Ok(Pays::Yes.into()), 21); + run_to_block(21, Some(&mut pool_state)); + + let rent_contract = SmartContractModule::contracts(rent_contract_id).unwrap(); + assert_eq!(rent_contract.state, types::ContractState::GracePeriod(21)); + + let node_contract = SmartContractModule::contracts(node_contract_id).unwrap(); + assert_eq!(node_contract.state, types::ContractState::GracePeriod(12)); + }); +} + // SOLUTION PROVIDER TESTS // // ------------------------ // diff --git a/substrate-node/pallets/pallet-smart-contract/src/weights.rs b/substrate-node/pallets/pallet-smart-contract/src/weights.rs index ab82b4cc7..aeede7066 100644 --- a/substrate-node/pallets/pallet-smart-contract/src/weights.rs +++ b/substrate-node/pallets/pallet-smart-contract/src/weights.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for pallet_smart_contract //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-09-24, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-01, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `da081090f983`, CPU: `AMD Ryzen 7 5800X 8-Core Processor` +//! HOSTNAME: `585a9f003813`, CPU: `AMD Ryzen 7 5800X 8-Core Processor` //! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -95,8 +95,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `868` // Estimated: `4333` - // Minimum execution time: 49_865_000 picoseconds. - Weight::from_parts(50_836_000, 4333) + // Minimum execution time: 48_471_000 picoseconds. + Weight::from_parts(49_253_000, 4333) .saturating_add(T::DbWeight::get().reads(12_u64)) .saturating_add(T::DbWeight::get().writes(8_u64)) } @@ -104,18 +104,16 @@ impl WeightInfo for SubstrateWeight { /// Proof: `SmartContractModule::Contracts` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `TfgridModule::Twins` (r:1 w:0) /// Proof: `TfgridModule::Twins` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SmartContractModule::ActiveNodeContracts` (r:1 w:1) - /// Proof: `SmartContractModule::ActiveNodeContracts` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SmartContractModule::ContractIDByNodeIDAndHash` (r:0 w:2) /// Proof: `SmartContractModule::ContractIDByNodeIDAndHash` (`max_values`: None, `max_size`: None, mode: `Measured`) fn update_node_contract() -> Weight { // Proof Size summary in bytes: - // Measured: `923` - // Estimated: `4388` - // Minimum execution time: 28_464_000 picoseconds. - Weight::from_parts(29_245_000, 4388) - .saturating_add(T::DbWeight::get().reads(3_u64)) - .saturating_add(T::DbWeight::get().writes(4_u64)) + // Measured: `869` + // Estimated: `4334` + // Minimum execution time: 23_585_000 picoseconds. + Weight::from_parts(24_016_000, 4334) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) } /// Storage: `SmartContractModule::Contracts` (r:1 w:1) /// Proof: `SmartContractModule::Contracts` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -135,6 +133,8 @@ impl WeightInfo for SubstrateWeight { /// Proof: `TfgridModule::TwinBoundedAccountID` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Timestamp::Now` (r:1 w:0) /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `SmartContractModule::ActiveRentContractForNode` (r:1 w:0) + /// Proof: `SmartContractModule::ActiveRentContractForNode` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SmartContractModule::BillingFrequency` (r:1 w:0) /// Proof: `SmartContractModule::BillingFrequency` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SmartContractModule::ContractsToBillAt` (r:1 w:1) @@ -149,9 +149,9 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1650` // Estimated: `7590` - // Minimum execution time: 79_240_000 picoseconds. - Weight::from_parts(80_382_000, 7590) - .saturating_add(T::DbWeight::get().reads(12_u64)) + // Minimum execution time: 77_096_000 picoseconds. + Weight::from_parts(78_488_000, 7590) + .saturating_add(T::DbWeight::get().reads(13_u64)) .saturating_add(T::DbWeight::get().writes(7_u64)) } /// Storage: `TfgridModule::TwinIdByAccountID` (r:1 w:0) @@ -174,8 +174,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `340` // Estimated: `3805` - // Minimum execution time: 26_190_000 picoseconds. - Weight::from_parts(27_382_000, 3805) + // Minimum execution time: 24_797_000 picoseconds. + Weight::from_parts(25_157_000, 3805) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -201,8 +201,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `949` // Estimated: `4414` - // Minimum execution time: 53_161_000 picoseconds. - Weight::from_parts(54_363_000, 4414) + // Minimum execution time: 51_929_000 picoseconds. + Weight::from_parts(53_511_000, 4414) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -224,8 +224,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1286` // Estimated: `4751` - // Minimum execution time: 39_635_000 picoseconds. - Weight::from_parts(40_366_000, 4751) + // Minimum execution time: 38_173_000 picoseconds. + Weight::from_parts(38_663_000, 4751) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -241,8 +241,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `765` // Estimated: `4230` - // Minimum execution time: 24_446_000 picoseconds. - Weight::from_parts(24_837_000, 4230) + // Minimum execution time: 23_385_000 picoseconds. + Weight::from_parts(23_876_000, 4230) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -272,8 +272,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `776` // Estimated: `4241` - // Minimum execution time: 36_158_000 picoseconds. - Weight::from_parts(36_689_000, 4241) + // Minimum execution time: 34_906_000 picoseconds. + Weight::from_parts(35_367_000, 4241) .saturating_add(T::DbWeight::get().reads(9_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -309,8 +309,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1607` // Estimated: `7547` - // Minimum execution time: 74_561_000 picoseconds. - Weight::from_parts(76_104_000, 7547) + // Minimum execution time: 72_007_000 picoseconds. + Weight::from_parts(73_199_000, 7547) .saturating_add(T::DbWeight::get().reads(14_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -322,8 +322,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `37` // Estimated: `1522` - // Minimum execution time: 10_089_000 picoseconds. - Weight::from_parts(10_550_000, 1522) + // Minimum execution time: 9_798_000 picoseconds. + Weight::from_parts(10_129_000, 1522) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -333,8 +333,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `215` // Estimated: `3680` - // Minimum execution time: 13_496_000 picoseconds. - Weight::from_parts(14_116_000, 3680) + // Minimum execution time: 12_794_000 picoseconds. + Weight::from_parts(12_955_000, 3680) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -374,8 +374,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `2077` // Estimated: `8017` - // Minimum execution time: 89_289_000 picoseconds. - Weight::from_parts(90_552_000, 8017) + // Minimum execution time: 87_206_000 picoseconds. + Weight::from_parts(88_408_000, 8017) .saturating_add(T::DbWeight::get().reads(17_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -389,8 +389,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `395` // Estimated: `6335` - // Minimum execution time: 19_236_000 picoseconds. - Weight::from_parts(19_777_000, 6335) + // Minimum execution time: 18_244_000 picoseconds. + Weight::from_parts(18_726_000, 6335) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -402,8 +402,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `489` // Estimated: `3954` - // Minimum execution time: 17_223_000 picoseconds. - Weight::from_parts(17_553_000, 3954) + // Minimum execution time: 16_522_000 picoseconds. + Weight::from_parts(16_892_000, 3954) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -415,8 +415,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `489` // Estimated: `3954` - // Minimum execution time: 17_283_000 picoseconds. - Weight::from_parts(17_694_000, 3954) + // Minimum execution time: 16_201_000 picoseconds. + Weight::from_parts(16_482_000, 3954) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -428,8 +428,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `502` // Estimated: `3967` - // Minimum execution time: 17_142_000 picoseconds. - Weight::from_parts(17_784_000, 3967) + // Minimum execution time: 16_461_000 picoseconds. + Weight::from_parts(16_982_000, 3967) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -441,8 +441,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `502` // Estimated: `3967` - // Minimum execution time: 18_024_000 picoseconds. - Weight::from_parts(18_384_000, 3967) + // Minimum execution time: 17_202_000 picoseconds. + Weight::from_parts(17_463_000, 3967) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -454,8 +454,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `502` // Estimated: `3967` - // Minimum execution time: 16_752_000 picoseconds. - Weight::from_parts(17_353_000, 3967) + // Minimum execution time: 15_760_000 picoseconds. + Weight::from_parts(16_351_000, 3967) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -473,8 +473,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `841` // Estimated: `6781` - // Minimum execution time: 30_267_000 picoseconds. - Weight::from_parts(31_149_000, 6781) + // Minimum execution time: 28_654_000 picoseconds. + Weight::from_parts(29_275_000, 6781) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -484,8 +484,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `37` // Estimated: `1522` - // Minimum execution time: 7_885_000 picoseconds. - Weight::from_parts(8_086_000, 1522) + // Minimum execution time: 7_474_000 picoseconds. + Weight::from_parts(7_865_000, 1522) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -499,8 +499,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `965` // Estimated: `4430` - // Minimum execution time: 22_823_000 picoseconds. - Weight::from_parts(23_374_000, 4430) + // Minimum execution time: 21_992_000 picoseconds. + Weight::from_parts(22_443_000, 4430) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -520,8 +520,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `733` // Estimated: `4198` - // Minimum execution time: 23_996_000 picoseconds. - Weight::from_parts(24_647_000, 4198) + // Minimum execution time: 23_004_000 picoseconds. + Weight::from_parts(23_434_000, 4198) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -543,6 +543,8 @@ impl WeightInfo for SubstrateWeight { /// Proof: `TfgridModule::TwinBoundedAccountID` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Timestamp::Now` (r:1 w:0) /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `SmartContractModule::ActiveRentContractForNode` (r:1 w:0) + /// Proof: `SmartContractModule::ActiveRentContractForNode` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SmartContractModule::BillingFrequency` (r:1 w:0) /// Proof: `SmartContractModule::BillingFrequency` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SmartContractModule::ContractsToBillAt` (r:1 w:1) @@ -557,9 +559,9 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `1650` // Estimated: `7590` - // Minimum execution time: 77_457_000 picoseconds. - Weight::from_parts(78_609_000, 7590) - .saturating_add(T::DbWeight::get().reads(12_u64)) + // Minimum execution time: 74_531_000 picoseconds. + Weight::from_parts(75_944_000, 7590) + .saturating_add(T::DbWeight::get().reads(13_u64)) .saturating_add(T::DbWeight::get().writes(7_u64)) } } @@ -600,8 +602,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `868` // Estimated: `4333` - // Minimum execution time: 49_865_000 picoseconds. - Weight::from_parts(50_836_000, 4333) + // Minimum execution time: 48_471_000 picoseconds. + Weight::from_parts(49_253_000, 4333) .saturating_add(RocksDbWeight::get().reads(12_u64)) .saturating_add(RocksDbWeight::get().writes(8_u64)) } @@ -609,18 +611,16 @@ impl WeightInfo for () { /// Proof: `SmartContractModule::Contracts` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `TfgridModule::Twins` (r:1 w:0) /// Proof: `TfgridModule::Twins` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `SmartContractModule::ActiveNodeContracts` (r:1 w:1) - /// Proof: `SmartContractModule::ActiveNodeContracts` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SmartContractModule::ContractIDByNodeIDAndHash` (r:0 w:2) /// Proof: `SmartContractModule::ContractIDByNodeIDAndHash` (`max_values`: None, `max_size`: None, mode: `Measured`) fn update_node_contract() -> Weight { // Proof Size summary in bytes: - // Measured: `923` - // Estimated: `4388` - // Minimum execution time: 28_464_000 picoseconds. - Weight::from_parts(29_245_000, 4388) - .saturating_add(RocksDbWeight::get().reads(3_u64)) - .saturating_add(RocksDbWeight::get().writes(4_u64)) + // Measured: `869` + // Estimated: `4334` + // Minimum execution time: 23_585_000 picoseconds. + Weight::from_parts(24_016_000, 4334) + .saturating_add(RocksDbWeight::get().reads(2_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) } /// Storage: `SmartContractModule::Contracts` (r:1 w:1) /// Proof: `SmartContractModule::Contracts` (`max_values`: None, `max_size`: None, mode: `Measured`) @@ -640,6 +640,8 @@ impl WeightInfo for () { /// Proof: `TfgridModule::TwinBoundedAccountID` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Timestamp::Now` (r:1 w:0) /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `SmartContractModule::ActiveRentContractForNode` (r:1 w:0) + /// Proof: `SmartContractModule::ActiveRentContractForNode` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SmartContractModule::BillingFrequency` (r:1 w:0) /// Proof: `SmartContractModule::BillingFrequency` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SmartContractModule::ContractsToBillAt` (r:1 w:1) @@ -654,9 +656,9 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1650` // Estimated: `7590` - // Minimum execution time: 79_240_000 picoseconds. - Weight::from_parts(80_382_000, 7590) - .saturating_add(RocksDbWeight::get().reads(12_u64)) + // Minimum execution time: 77_096_000 picoseconds. + Weight::from_parts(78_488_000, 7590) + .saturating_add(RocksDbWeight::get().reads(13_u64)) .saturating_add(RocksDbWeight::get().writes(7_u64)) } /// Storage: `TfgridModule::TwinIdByAccountID` (r:1 w:0) @@ -679,8 +681,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `340` // Estimated: `3805` - // Minimum execution time: 26_190_000 picoseconds. - Weight::from_parts(27_382_000, 3805) + // Minimum execution time: 24_797_000 picoseconds. + Weight::from_parts(25_157_000, 3805) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } @@ -706,8 +708,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `949` // Estimated: `4414` - // Minimum execution time: 53_161_000 picoseconds. - Weight::from_parts(54_363_000, 4414) + // Minimum execution time: 51_929_000 picoseconds. + Weight::from_parts(53_511_000, 4414) .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } @@ -729,8 +731,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1286` // Estimated: `4751` - // Minimum execution time: 39_635_000 picoseconds. - Weight::from_parts(40_366_000, 4751) + // Minimum execution time: 38_173_000 picoseconds. + Weight::from_parts(38_663_000, 4751) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -746,8 +748,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `765` // Estimated: `4230` - // Minimum execution time: 24_446_000 picoseconds. - Weight::from_parts(24_837_000, 4230) + // Minimum execution time: 23_385_000 picoseconds. + Weight::from_parts(23_876_000, 4230) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -777,8 +779,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `776` // Estimated: `4241` - // Minimum execution time: 36_158_000 picoseconds. - Weight::from_parts(36_689_000, 4241) + // Minimum execution time: 34_906_000 picoseconds. + Weight::from_parts(35_367_000, 4241) .saturating_add(RocksDbWeight::get().reads(9_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } @@ -814,8 +816,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1607` // Estimated: `7547` - // Minimum execution time: 74_561_000 picoseconds. - Weight::from_parts(76_104_000, 7547) + // Minimum execution time: 72_007_000 picoseconds. + Weight::from_parts(73_199_000, 7547) .saturating_add(RocksDbWeight::get().reads(14_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } @@ -827,8 +829,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `37` // Estimated: `1522` - // Minimum execution time: 10_089_000 picoseconds. - Weight::from_parts(10_550_000, 1522) + // Minimum execution time: 9_798_000 picoseconds. + Weight::from_parts(10_129_000, 1522) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -838,8 +840,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `215` // Estimated: `3680` - // Minimum execution time: 13_496_000 picoseconds. - Weight::from_parts(14_116_000, 3680) + // Minimum execution time: 12_794_000 picoseconds. + Weight::from_parts(12_955_000, 3680) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -879,8 +881,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `2077` // Estimated: `8017` - // Minimum execution time: 89_289_000 picoseconds. - Weight::from_parts(90_552_000, 8017) + // Minimum execution time: 87_206_000 picoseconds. + Weight::from_parts(88_408_000, 8017) .saturating_add(RocksDbWeight::get().reads(17_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -894,8 +896,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `395` // Estimated: `6335` - // Minimum execution time: 19_236_000 picoseconds. - Weight::from_parts(19_777_000, 6335) + // Minimum execution time: 18_244_000 picoseconds. + Weight::from_parts(18_726_000, 6335) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -907,8 +909,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `489` // Estimated: `3954` - // Minimum execution time: 17_223_000 picoseconds. - Weight::from_parts(17_553_000, 3954) + // Minimum execution time: 16_522_000 picoseconds. + Weight::from_parts(16_892_000, 3954) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -920,8 +922,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `489` // Estimated: `3954` - // Minimum execution time: 17_283_000 picoseconds. - Weight::from_parts(17_694_000, 3954) + // Minimum execution time: 16_201_000 picoseconds. + Weight::from_parts(16_482_000, 3954) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -933,8 +935,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `502` // Estimated: `3967` - // Minimum execution time: 17_142_000 picoseconds. - Weight::from_parts(17_784_000, 3967) + // Minimum execution time: 16_461_000 picoseconds. + Weight::from_parts(16_982_000, 3967) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -946,8 +948,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `502` // Estimated: `3967` - // Minimum execution time: 18_024_000 picoseconds. - Weight::from_parts(18_384_000, 3967) + // Minimum execution time: 17_202_000 picoseconds. + Weight::from_parts(17_463_000, 3967) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -959,8 +961,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `502` // Estimated: `3967` - // Minimum execution time: 16_752_000 picoseconds. - Weight::from_parts(17_353_000, 3967) + // Minimum execution time: 15_760_000 picoseconds. + Weight::from_parts(16_351_000, 3967) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -978,8 +980,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `841` // Estimated: `6781` - // Minimum execution time: 30_267_000 picoseconds. - Weight::from_parts(31_149_000, 6781) + // Minimum execution time: 28_654_000 picoseconds. + Weight::from_parts(29_275_000, 6781) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -989,8 +991,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `37` // Estimated: `1522` - // Minimum execution time: 7_885_000 picoseconds. - Weight::from_parts(8_086_000, 1522) + // Minimum execution time: 7_474_000 picoseconds. + Weight::from_parts(7_865_000, 1522) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1004,8 +1006,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `965` // Estimated: `4430` - // Minimum execution time: 22_823_000 picoseconds. - Weight::from_parts(23_374_000, 4430) + // Minimum execution time: 21_992_000 picoseconds. + Weight::from_parts(22_443_000, 4430) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1025,8 +1027,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `733` // Estimated: `4198` - // Minimum execution time: 23_996_000 picoseconds. - Weight::from_parts(24_647_000, 4198) + // Minimum execution time: 23_004_000 picoseconds. + Weight::from_parts(23_434_000, 4198) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1048,6 +1050,8 @@ impl WeightInfo for () { /// Proof: `TfgridModule::TwinBoundedAccountID` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Timestamp::Now` (r:1 w:0) /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `SmartContractModule::ActiveRentContractForNode` (r:1 w:0) + /// Proof: `SmartContractModule::ActiveRentContractForNode` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `SmartContractModule::BillingFrequency` (r:1 w:0) /// Proof: `SmartContractModule::BillingFrequency` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// Storage: `SmartContractModule::ContractsToBillAt` (r:1 w:1) @@ -1062,9 +1066,9 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `1650` // Estimated: `7590` - // Minimum execution time: 77_457_000 picoseconds. - Weight::from_parts(78_609_000, 7590) - .saturating_add(RocksDbWeight::get().reads(12_u64)) + // Minimum execution time: 74_531_000 picoseconds. + Weight::from_parts(75_944_000, 7590) + .saturating_add(RocksDbWeight::get().reads(13_u64)) .saturating_add(RocksDbWeight::get().writes(7_u64)) } } diff --git a/substrate-node/pallets/pallet-tfgrid/src/weights.rs b/substrate-node/pallets/pallet-tfgrid/src/weights.rs index bbc057d8f..446c831a5 100644 --- a/substrate-node/pallets/pallet-tfgrid/src/weights.rs +++ b/substrate-node/pallets/pallet-tfgrid/src/weights.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for pallet_tfgrid //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-09-24, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-01, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `da081090f983`, CPU: `AMD Ryzen 7 5800X 8-Core Processor` +//! HOSTNAME: `585a9f003813`, CPU: `AMD Ryzen 7 5800X 8-Core Processor` //! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -76,8 +76,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_384_000 picoseconds. - Weight::from_parts(2_485_000, 0) + // Minimum execution time: 3_788_000 picoseconds. + Weight::from_parts(4_018_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `TfgridModule::TwinIdByAccountID` (r:1 w:0) @@ -94,8 +94,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `496` // Estimated: `3961` - // Minimum execution time: 19_998_000 picoseconds. - Weight::from_parts(20_609_000, 3961) + // Minimum execution time: 19_638_000 picoseconds. + Weight::from_parts(20_018_000, 3961) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -109,8 +109,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `507` // Estimated: `3972` - // Minimum execution time: 21_631_000 picoseconds. - Weight::from_parts(22_072_000, 3972) + // Minimum execution time: 21_551_000 picoseconds. + Weight::from_parts(22_363_000, 3972) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -124,8 +124,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `453` // Estimated: `3918` - // Minimum execution time: 16_030_000 picoseconds. - Weight::from_parts(16_451_000, 3918) + // Minimum execution time: 15_699_000 picoseconds. + Weight::from_parts(16_131_000, 3918) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -135,8 +135,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `412` // Estimated: `3877` - // Minimum execution time: 13_085_000 picoseconds. - Weight::from_parts(13_656_000, 3877) + // Minimum execution time: 13_215_000 picoseconds. + Weight::from_parts(13_456_000, 3877) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -148,8 +148,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `569` // Estimated: `4034` - // Minimum execution time: 17_964_000 picoseconds. - Weight::from_parts(18_635_000, 4034) + // Minimum execution time: 17_754_000 picoseconds. + Weight::from_parts(18_194_000, 4034) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -161,8 +161,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `569` // Estimated: `4034` - // Minimum execution time: 17_133_000 picoseconds. - Weight::from_parts(17_453_000, 4034) + // Minimum execution time: 16_962_000 picoseconds. + Weight::from_parts(17_342_000, 4034) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -190,8 +190,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `905` // Estimated: `11795` - // Minimum execution time: 47_891_000 picoseconds. - Weight::from_parts(48_683_000, 11795) + // Minimum execution time: 47_349_000 picoseconds. + Weight::from_parts(48_843_000, 11795) .saturating_add(T::DbWeight::get().reads(12_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -207,8 +207,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `661` // Estimated: `4126` - // Minimum execution time: 27_271_000 picoseconds. - Weight::from_parts(27_762_000, 4126) + // Minimum execution time: 26_720_000 picoseconds. + Weight::from_parts(27_242_000, 4126) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -222,8 +222,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `956` // Estimated: `11846` - // Minimum execution time: 34_175_000 picoseconds. - Weight::from_parts(35_116_000, 11846) + // Minimum execution time: 34_234_000 picoseconds. + Weight::from_parts(35_077_000, 11846) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -239,8 +239,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `454` // Estimated: `3919` - // Minimum execution time: 18_976_000 picoseconds. - Weight::from_parts(19_607_000, 3919) + // Minimum execution time: 18_786_000 picoseconds. + Weight::from_parts(19_336_000, 3919) .saturating_add(T::DbWeight::get().reads(4_u64)) } /// Storage: `TfgridModule::Farms` (r:1 w:0) @@ -253,8 +253,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `779` // Estimated: `4244` - // Minimum execution time: 24_687_000 picoseconds. - Weight::from_parts(25_168_000, 4244) + // Minimum execution time: 24_206_000 picoseconds. + Weight::from_parts(25_237_000, 4244) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -274,8 +274,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `682` // Estimated: `4147` - // Minimum execution time: 28_123_000 picoseconds. - Weight::from_parts(28_755_000, 4147) + // Minimum execution time: 27_802_000 picoseconds. + Weight::from_parts(28_273_000, 4147) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -291,8 +291,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `235` // Estimated: `3700` - // Minimum execution time: 14_457_000 picoseconds. - Weight::from_parts(15_078_000, 3700) + // Minimum execution time: 14_217_000 picoseconds. + Weight::from_parts(14_568_000, 3700) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -304,8 +304,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `428` // Estimated: `3893` - // Minimum execution time: 15_179_000 picoseconds. - Weight::from_parts(15_730_000, 3893) + // Minimum execution time: 14_848_000 picoseconds. + Weight::from_parts(15_440_000, 3893) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -319,8 +319,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `134` // Estimated: `3599` - // Minimum execution time: 12_333_000 picoseconds. - Weight::from_parts(12_644_000, 3599) + // Minimum execution time: 11_923_000 picoseconds. + Weight::from_parts(12_324_000, 3599) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -334,8 +334,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `382` // Estimated: `3847` - // Minimum execution time: 16_532_000 picoseconds. - Weight::from_parts(16_852_000, 3847) + // Minimum execution time: 16_441_000 picoseconds. + Weight::from_parts(16_851_000, 3847) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -347,8 +347,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `134` // Estimated: `1619` - // Minimum execution time: 10_209_000 picoseconds. - Weight::from_parts(10_530_000, 1619) + // Minimum execution time: 10_229_000 picoseconds. + Weight::from_parts(10_560_000, 1619) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -360,8 +360,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `140` // Estimated: `3605` - // Minimum execution time: 7_374_000 picoseconds. - Weight::from_parts(7_504_000, 3605) + // Minimum execution time: 7_464_000 picoseconds. + Weight::from_parts(7_694_000, 3605) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -385,8 +385,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `828` // Estimated: `4293` - // Minimum execution time: 32_722_000 picoseconds. - Weight::from_parts(33_584_000, 4293) + // Minimum execution time: 32_201_000 picoseconds. + Weight::from_parts(32_992_000, 4293) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -396,8 +396,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `412` // Estimated: `3877` - // Minimum execution time: 13_466_000 picoseconds. - Weight::from_parts(13_966_000, 3877) + // Minimum execution time: 13_666_000 picoseconds. + Weight::from_parts(13_986_000, 3877) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -407,8 +407,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `412` // Estimated: `3877` - // Minimum execution time: 13_736_000 picoseconds. - Weight::from_parts(14_086_000, 3877) + // Minimum execution time: 13_445_000 picoseconds. + Weight::from_parts(13_836_000, 3877) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -418,8 +418,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_641_000 picoseconds. - Weight::from_parts(5_811_000, 0) + // Minimum execution time: 5_570_000 picoseconds. + Weight::from_parts(5_971_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `TfgridModule::AllowedNodeCertifiers` (r:1 w:1) @@ -428,8 +428,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `355` // Estimated: `1840` - // Minimum execution time: 9_698_000 picoseconds. - Weight::from_parts(10_189_000, 1840) + // Minimum execution time: 9_608_000 picoseconds. + Weight::from_parts(9_899_000, 1840) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -439,8 +439,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `413` // Estimated: `1898` - // Minimum execution time: 11_883_000 picoseconds. - Weight::from_parts(12_454_000, 1898) + // Minimum execution time: 11_913_000 picoseconds. + Weight::from_parts(12_253_000, 1898) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -450,8 +450,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `294` // Estimated: `3759` - // Minimum execution time: 13_125_000 picoseconds. - Weight::from_parts(13_416_000, 3759) + // Minimum execution time: 12_985_000 picoseconds. + Weight::from_parts(13_155_000, 3759) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -465,8 +465,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `572` // Estimated: `4037` - // Minimum execution time: 22_232_000 picoseconds. - Weight::from_parts(22_472_000, 4037) + // Minimum execution time: 21_440_000 picoseconds. + Weight::from_parts(22_112_000, 4037) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -476,8 +476,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `134` // Estimated: `1619` - // Minimum execution time: 8_065_000 picoseconds. - Weight::from_parts(8_285_000, 1619) + // Minimum execution time: 7_664_000 picoseconds. + Weight::from_parts(8_085_000, 1619) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -493,8 +493,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `621` // Estimated: `4086` - // Minimum execution time: 22_873_000 picoseconds. - Weight::from_parts(23_524_000, 4086) + // Minimum execution time: 22_663_000 picoseconds. + Weight::from_parts(23_244_000, 4086) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -514,8 +514,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `792` // Estimated: `4257` - // Minimum execution time: 26_590_000 picoseconds. - Weight::from_parts(26_881_000, 4257) + // Minimum execution time: 25_729_000 picoseconds. + Weight::from_parts(26_470_000, 4257) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -527,8 +527,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `387` // Estimated: `3852` - // Minimum execution time: 11_913_000 picoseconds. - Weight::from_parts(12_353_000, 3852) + // Minimum execution time: 11_743_000 picoseconds. + Weight::from_parts(12_053_000, 3852) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -544,8 +544,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `454` // Estimated: `3919` - // Minimum execution time: 17_984_000 picoseconds. - Weight::from_parts(18_535_000, 3919) + // Minimum execution time: 18_084_000 picoseconds. + Weight::from_parts(18_465_000, 3919) .saturating_add(T::DbWeight::get().reads(4_u64)) } } @@ -558,8 +558,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_384_000 picoseconds. - Weight::from_parts(2_485_000, 0) + // Minimum execution time: 3_788_000 picoseconds. + Weight::from_parts(4_018_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `TfgridModule::TwinIdByAccountID` (r:1 w:0) @@ -576,8 +576,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `496` // Estimated: `3961` - // Minimum execution time: 19_998_000 picoseconds. - Weight::from_parts(20_609_000, 3961) + // Minimum execution time: 19_638_000 picoseconds. + Weight::from_parts(20_018_000, 3961) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -591,8 +591,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `507` // Estimated: `3972` - // Minimum execution time: 21_631_000 picoseconds. - Weight::from_parts(22_072_000, 3972) + // Minimum execution time: 21_551_000 picoseconds. + Weight::from_parts(22_363_000, 3972) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -606,8 +606,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `453` // Estimated: `3918` - // Minimum execution time: 16_030_000 picoseconds. - Weight::from_parts(16_451_000, 3918) + // Minimum execution time: 15_699_000 picoseconds. + Weight::from_parts(16_131_000, 3918) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -617,8 +617,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `412` // Estimated: `3877` - // Minimum execution time: 13_085_000 picoseconds. - Weight::from_parts(13_656_000, 3877) + // Minimum execution time: 13_215_000 picoseconds. + Weight::from_parts(13_456_000, 3877) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -630,8 +630,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `569` // Estimated: `4034` - // Minimum execution time: 17_964_000 picoseconds. - Weight::from_parts(18_635_000, 4034) + // Minimum execution time: 17_754_000 picoseconds. + Weight::from_parts(18_194_000, 4034) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -643,8 +643,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `569` // Estimated: `4034` - // Minimum execution time: 17_133_000 picoseconds. - Weight::from_parts(17_453_000, 4034) + // Minimum execution time: 16_962_000 picoseconds. + Weight::from_parts(17_342_000, 4034) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -672,8 +672,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `905` // Estimated: `11795` - // Minimum execution time: 47_891_000 picoseconds. - Weight::from_parts(48_683_000, 11795) + // Minimum execution time: 47_349_000 picoseconds. + Weight::from_parts(48_843_000, 11795) .saturating_add(RocksDbWeight::get().reads(12_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } @@ -689,8 +689,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `661` // Estimated: `4126` - // Minimum execution time: 27_271_000 picoseconds. - Weight::from_parts(27_762_000, 4126) + // Minimum execution time: 26_720_000 picoseconds. + Weight::from_parts(27_242_000, 4126) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -704,8 +704,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `956` // Estimated: `11846` - // Minimum execution time: 34_175_000 picoseconds. - Weight::from_parts(35_116_000, 11846) + // Minimum execution time: 34_234_000 picoseconds. + Weight::from_parts(35_077_000, 11846) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -721,8 +721,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `454` // Estimated: `3919` - // Minimum execution time: 18_976_000 picoseconds. - Weight::from_parts(19_607_000, 3919) + // Minimum execution time: 18_786_000 picoseconds. + Weight::from_parts(19_336_000, 3919) .saturating_add(RocksDbWeight::get().reads(4_u64)) } /// Storage: `TfgridModule::Farms` (r:1 w:0) @@ -735,8 +735,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `779` // Estimated: `4244` - // Minimum execution time: 24_687_000 picoseconds. - Weight::from_parts(25_168_000, 4244) + // Minimum execution time: 24_206_000 picoseconds. + Weight::from_parts(25_237_000, 4244) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -756,8 +756,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `682` // Estimated: `4147` - // Minimum execution time: 28_123_000 picoseconds. - Weight::from_parts(28_755_000, 4147) + // Minimum execution time: 27_802_000 picoseconds. + Weight::from_parts(28_273_000, 4147) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -773,8 +773,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `235` // Estimated: `3700` - // Minimum execution time: 14_457_000 picoseconds. - Weight::from_parts(15_078_000, 3700) + // Minimum execution time: 14_217_000 picoseconds. + Weight::from_parts(14_568_000, 3700) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -786,8 +786,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `428` // Estimated: `3893` - // Minimum execution time: 15_179_000 picoseconds. - Weight::from_parts(15_730_000, 3893) + // Minimum execution time: 14_848_000 picoseconds. + Weight::from_parts(15_440_000, 3893) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -801,8 +801,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `134` // Estimated: `3599` - // Minimum execution time: 12_333_000 picoseconds. - Weight::from_parts(12_644_000, 3599) + // Minimum execution time: 11_923_000 picoseconds. + Weight::from_parts(12_324_000, 3599) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -816,8 +816,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `382` // Estimated: `3847` - // Minimum execution time: 16_532_000 picoseconds. - Weight::from_parts(16_852_000, 3847) + // Minimum execution time: 16_441_000 picoseconds. + Weight::from_parts(16_851_000, 3847) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -829,8 +829,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `134` // Estimated: `1619` - // Minimum execution time: 10_209_000 picoseconds. - Weight::from_parts(10_530_000, 1619) + // Minimum execution time: 10_229_000 picoseconds. + Weight::from_parts(10_560_000, 1619) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -842,8 +842,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `140` // Estimated: `3605` - // Minimum execution time: 7_374_000 picoseconds. - Weight::from_parts(7_504_000, 3605) + // Minimum execution time: 7_464_000 picoseconds. + Weight::from_parts(7_694_000, 3605) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -867,8 +867,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `828` // Estimated: `4293` - // Minimum execution time: 32_722_000 picoseconds. - Weight::from_parts(33_584_000, 4293) + // Minimum execution time: 32_201_000 picoseconds. + Weight::from_parts(32_992_000, 4293) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } @@ -878,8 +878,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `412` // Estimated: `3877` - // Minimum execution time: 13_466_000 picoseconds. - Weight::from_parts(13_966_000, 3877) + // Minimum execution time: 13_666_000 picoseconds. + Weight::from_parts(13_986_000, 3877) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -889,8 +889,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `412` // Estimated: `3877` - // Minimum execution time: 13_736_000 picoseconds. - Weight::from_parts(14_086_000, 3877) + // Minimum execution time: 13_445_000 picoseconds. + Weight::from_parts(13_836_000, 3877) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -900,8 +900,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_641_000 picoseconds. - Weight::from_parts(5_811_000, 0) + // Minimum execution time: 5_570_000 picoseconds. + Weight::from_parts(5_971_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `TfgridModule::AllowedNodeCertifiers` (r:1 w:1) @@ -910,8 +910,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `355` // Estimated: `1840` - // Minimum execution time: 9_698_000 picoseconds. - Weight::from_parts(10_189_000, 1840) + // Minimum execution time: 9_608_000 picoseconds. + Weight::from_parts(9_899_000, 1840) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -921,8 +921,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `413` // Estimated: `1898` - // Minimum execution time: 11_883_000 picoseconds. - Weight::from_parts(12_454_000, 1898) + // Minimum execution time: 11_913_000 picoseconds. + Weight::from_parts(12_253_000, 1898) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -932,8 +932,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `294` // Estimated: `3759` - // Minimum execution time: 13_125_000 picoseconds. - Weight::from_parts(13_416_000, 3759) + // Minimum execution time: 12_985_000 picoseconds. + Weight::from_parts(13_155_000, 3759) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -947,8 +947,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `572` // Estimated: `4037` - // Minimum execution time: 22_232_000 picoseconds. - Weight::from_parts(22_472_000, 4037) + // Minimum execution time: 21_440_000 picoseconds. + Weight::from_parts(22_112_000, 4037) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -958,8 +958,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `134` // Estimated: `1619` - // Minimum execution time: 8_065_000 picoseconds. - Weight::from_parts(8_285_000, 1619) + // Minimum execution time: 7_664_000 picoseconds. + Weight::from_parts(8_085_000, 1619) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -975,8 +975,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `621` // Estimated: `4086` - // Minimum execution time: 22_873_000 picoseconds. - Weight::from_parts(23_524_000, 4086) + // Minimum execution time: 22_663_000 picoseconds. + Weight::from_parts(23_244_000, 4086) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -996,8 +996,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `792` // Estimated: `4257` - // Minimum execution time: 26_590_000 picoseconds. - Weight::from_parts(26_881_000, 4257) + // Minimum execution time: 25_729_000 picoseconds. + Weight::from_parts(26_470_000, 4257) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1009,8 +1009,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `387` // Estimated: `3852` - // Minimum execution time: 11_913_000 picoseconds. - Weight::from_parts(12_353_000, 3852) + // Minimum execution time: 11_743_000 picoseconds. + Weight::from_parts(12_053_000, 3852) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -1026,8 +1026,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `454` // Estimated: `3919` - // Minimum execution time: 17_984_000 picoseconds. - Weight::from_parts(18_535_000, 3919) + // Minimum execution time: 18_084_000 picoseconds. + Weight::from_parts(18_465_000, 3919) .saturating_add(RocksDbWeight::get().reads(4_u64)) } } diff --git a/substrate-node/pallets/pallet-tft-bridge/src/weights.rs b/substrate-node/pallets/pallet-tft-bridge/src/weights.rs index 38dcd78cb..9514c4df0 100644 --- a/substrate-node/pallets/pallet-tft-bridge/src/weights.rs +++ b/substrate-node/pallets/pallet-tft-bridge/src/weights.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for pallet_tft_bridge //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-09-24, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-01, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `da081090f983`, CPU: `AMD Ryzen 7 5800X 8-Core Processor` +//! HOSTNAME: `585a9f003813`, CPU: `AMD Ryzen 7 5800X 8-Core Processor` //! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -55,8 +55,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `256` // Estimated: `1741` - // Minimum execution time: 6_933_000 picoseconds. - Weight::from_parts(7_123_000, 1741) + // Minimum execution time: 7_324_000 picoseconds. + Weight::from_parts(7_545_000, 1741) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -66,8 +66,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `289` // Estimated: `1774` - // Minimum execution time: 6_923_000 picoseconds. - Weight::from_parts(7_174_000, 1774) + // Minimum execution time: 7_154_000 picoseconds. + Weight::from_parts(7_384_000, 1774) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -77,8 +77,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_204_000 picoseconds. - Weight::from_parts(2_305_000, 0) + // Minimum execution time: 2_484_000 picoseconds. + Weight::from_parts(2_575_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `TFTBridgeModule::WithdrawFee` (r:0 w:1) @@ -87,8 +87,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_074_000 picoseconds. - Weight::from_parts(2_205_000, 0) + // Minimum execution time: 2_324_000 picoseconds. + Weight::from_parts(2_435_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `TFTBridgeModule::DepositFee` (r:0 w:1) @@ -97,8 +97,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_164_000 picoseconds. - Weight::from_parts(2_214_000, 0) + // Minimum execution time: 2_275_000 picoseconds. + Weight::from_parts(2_505_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `TFTBridgeModule::WithdrawFee` (r:1 w:0) @@ -115,8 +115,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `253` // Estimated: `3593` - // Minimum execution time: 42_040_000 picoseconds. - Weight::from_parts(42_620_000, 3593) + // Minimum execution time: 43_462_000 picoseconds. + Weight::from_parts(44_163_000, 3593) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -136,8 +136,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `499` // Estimated: `3964` - // Minimum execution time: 58_811_000 picoseconds. - Weight::from_parts(59_543_000, 3964) + // Minimum execution time: 60_224_000 picoseconds. + Weight::from_parts(61_235_000, 3964) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -151,8 +151,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `631` // Estimated: `4096` - // Minimum execution time: 25_118_000 picoseconds. - Weight::from_parts(25_598_000, 4096) + // Minimum execution time: 25_489_000 picoseconds. + Weight::from_parts(26_390_000, 4096) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -166,8 +166,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `571` // Estimated: `4036` - // Minimum execution time: 17_743_000 picoseconds. - Weight::from_parts(18_555_000, 4036) + // Minimum execution time: 18_204_000 picoseconds. + Weight::from_parts(18_515_000, 4036) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -179,8 +179,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `385` // Estimated: `3850` - // Minimum execution time: 20_639_000 picoseconds. - Weight::from_parts(21_280_000, 3850) + // Minimum execution time: 21_551_000 picoseconds. + Weight::from_parts(21_821_000, 3850) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -194,8 +194,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `560` // Estimated: `4025` - // Minimum execution time: 18_184_000 picoseconds. - Weight::from_parts(18_434_000, 4025) + // Minimum execution time: 18_625_000 picoseconds. + Weight::from_parts(18_946_000, 4025) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -209,8 +209,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `256` // Estimated: `1741` - // Minimum execution time: 6_933_000 picoseconds. - Weight::from_parts(7_123_000, 1741) + // Minimum execution time: 7_324_000 picoseconds. + Weight::from_parts(7_545_000, 1741) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -220,8 +220,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `289` // Estimated: `1774` - // Minimum execution time: 6_923_000 picoseconds. - Weight::from_parts(7_174_000, 1774) + // Minimum execution time: 7_154_000 picoseconds. + Weight::from_parts(7_384_000, 1774) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -231,8 +231,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_204_000 picoseconds. - Weight::from_parts(2_305_000, 0) + // Minimum execution time: 2_484_000 picoseconds. + Weight::from_parts(2_575_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `TFTBridgeModule::WithdrawFee` (r:0 w:1) @@ -241,8 +241,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_074_000 picoseconds. - Weight::from_parts(2_205_000, 0) + // Minimum execution time: 2_324_000 picoseconds. + Weight::from_parts(2_435_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `TFTBridgeModule::DepositFee` (r:0 w:1) @@ -251,8 +251,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_164_000 picoseconds. - Weight::from_parts(2_214_000, 0) + // Minimum execution time: 2_275_000 picoseconds. + Weight::from_parts(2_505_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `TFTBridgeModule::WithdrawFee` (r:1 w:0) @@ -269,8 +269,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `253` // Estimated: `3593` - // Minimum execution time: 42_040_000 picoseconds. - Weight::from_parts(42_620_000, 3593) + // Minimum execution time: 43_462_000 picoseconds. + Weight::from_parts(44_163_000, 3593) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -290,8 +290,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `499` // Estimated: `3964` - // Minimum execution time: 58_811_000 picoseconds. - Weight::from_parts(59_543_000, 3964) + // Minimum execution time: 60_224_000 picoseconds. + Weight::from_parts(61_235_000, 3964) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -305,8 +305,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `631` // Estimated: `4096` - // Minimum execution time: 25_118_000 picoseconds. - Weight::from_parts(25_598_000, 4096) + // Minimum execution time: 25_489_000 picoseconds. + Weight::from_parts(26_390_000, 4096) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -320,8 +320,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `571` // Estimated: `4036` - // Minimum execution time: 17_743_000 picoseconds. - Weight::from_parts(18_555_000, 4036) + // Minimum execution time: 18_204_000 picoseconds. + Weight::from_parts(18_515_000, 4036) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -333,8 +333,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `385` // Estimated: `3850` - // Minimum execution time: 20_639_000 picoseconds. - Weight::from_parts(21_280_000, 3850) + // Minimum execution time: 21_551_000 picoseconds. + Weight::from_parts(21_821_000, 3850) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -348,8 +348,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `560` // Estimated: `4025` - // Minimum execution time: 18_184_000 picoseconds. - Weight::from_parts(18_434_000, 4025) + // Minimum execution time: 18_625_000 picoseconds. + Weight::from_parts(18_946_000, 4025) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } diff --git a/substrate-node/pallets/pallet-tft-price/src/weights.rs b/substrate-node/pallets/pallet-tft-price/src/weights.rs index f5b9ac95a..4f9e921cd 100644 --- a/substrate-node/pallets/pallet-tft-price/src/weights.rs +++ b/substrate-node/pallets/pallet-tft-price/src/weights.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for pallet_tft_price //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-09-24, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-01, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `da081090f983`, CPU: `AMD Ryzen 7 5800X 8-Core Processor` +//! HOSTNAME: `585a9f003813`, CPU: `AMD Ryzen 7 5800X 8-Core Processor` //! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -61,8 +61,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `235` // Estimated: `6175` - // Minimum execution time: 29_426_000 picoseconds. - Weight::from_parts(30_408_000, 6175) + // Minimum execution time: 29_515_000 picoseconds. + Weight::from_parts(30_608_000, 6175) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -74,8 +74,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `93` // Estimated: `1578` - // Minimum execution time: 5_160_000 picoseconds. - Weight::from_parts(5_290_000, 1578) + // Minimum execution time: 5_149_000 picoseconds. + Weight::from_parts(5_340_000, 1578) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -87,8 +87,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `93` // Estimated: `1578` - // Minimum execution time: 5_109_000 picoseconds. - Weight::from_parts(5_240_000, 1578) + // Minimum execution time: 5_129_000 picoseconds. + Weight::from_parts(5_190_000, 1578) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -116,8 +116,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `235` // Estimated: `6175` - // Minimum execution time: 29_426_000 picoseconds. - Weight::from_parts(30_408_000, 6175) + // Minimum execution time: 29_515_000 picoseconds. + Weight::from_parts(30_608_000, 6175) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } @@ -129,8 +129,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `93` // Estimated: `1578` - // Minimum execution time: 5_160_000 picoseconds. - Weight::from_parts(5_290_000, 1578) + // Minimum execution time: 5_149_000 picoseconds. + Weight::from_parts(5_340_000, 1578) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -142,8 +142,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `93` // Estimated: `1578` - // Minimum execution time: 5_109_000 picoseconds. - Weight::from_parts(5_240_000, 1578) + // Minimum execution time: 5_129_000 picoseconds. + Weight::from_parts(5_190_000, 1578) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } diff --git a/substrate-node/pallets/pallet-validator/src/weights.rs b/substrate-node/pallets/pallet-validator/src/weights.rs index 0fe82ca7d..26340102e 100644 --- a/substrate-node/pallets/pallet-validator/src/weights.rs +++ b/substrate-node/pallets/pallet-validator/src/weights.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for pallet_validator //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-09-24, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-01, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `da081090f983`, CPU: `AMD Ryzen 7 5800X 8-Core Processor` +//! HOSTNAME: `585a9f003813`, CPU: `AMD Ryzen 7 5800X 8-Core Processor` //! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -50,8 +50,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `42` // Estimated: `3507` - // Minimum execution time: 9_618_000 picoseconds. - Weight::from_parts(9_909_000, 3507) + // Minimum execution time: 8_877_000 picoseconds. + Weight::from_parts(9_368_000, 3507) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -65,8 +65,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `365` // Estimated: `3830` - // Minimum execution time: 25_217_000 picoseconds. - Weight::from_parts(25_849_000, 3830) + // Minimum execution time: 24_096_000 picoseconds. + Weight::from_parts(24_637_000, 3830) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -80,8 +80,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `431` // Estimated: `3896` - // Minimum execution time: 34_345_000 picoseconds. - Weight::from_parts(35_027_000, 3896) + // Minimum execution time: 32_832_000 picoseconds. + Weight::from_parts(33_994_000, 3896) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -91,8 +91,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `42` // Estimated: `3507` - // Minimum execution time: 8_727_000 picoseconds. - Weight::from_parts(8_987_000, 3507) + // Minimum execution time: 8_286_000 picoseconds. + Weight::from_parts(8_506_000, 3507) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -110,8 +110,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `494` // Estimated: `4687` - // Minimum execution time: 25_308_000 picoseconds. - Weight::from_parts(25_879_000, 4687) + // Minimum execution time: 24_105_000 picoseconds. + Weight::from_parts(24_918_000, 4687) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -131,8 +131,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `558` // Estimated: `4687` - // Minimum execution time: 22_653_000 picoseconds. - Weight::from_parts(23_154_000, 4687) + // Minimum execution time: 21_501_000 picoseconds. + Weight::from_parts(22_092_000, 4687) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -146,8 +146,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `42` // Estimated: `3507` - // Minimum execution time: 9_618_000 picoseconds. - Weight::from_parts(9_909_000, 3507) + // Minimum execution time: 8_877_000 picoseconds. + Weight::from_parts(9_368_000, 3507) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -161,8 +161,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `365` // Estimated: `3830` - // Minimum execution time: 25_217_000 picoseconds. - Weight::from_parts(25_849_000, 3830) + // Minimum execution time: 24_096_000 picoseconds. + Weight::from_parts(24_637_000, 3830) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -176,8 +176,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `431` // Estimated: `3896` - // Minimum execution time: 34_345_000 picoseconds. - Weight::from_parts(35_027_000, 3896) + // Minimum execution time: 32_832_000 picoseconds. + Weight::from_parts(33_994_000, 3896) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } @@ -187,8 +187,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `42` // Estimated: `3507` - // Minimum execution time: 8_727_000 picoseconds. - Weight::from_parts(8_987_000, 3507) + // Minimum execution time: 8_286_000 picoseconds. + Weight::from_parts(8_506_000, 3507) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -206,8 +206,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `494` // Estimated: `4687` - // Minimum execution time: 25_308_000 picoseconds. - Weight::from_parts(25_879_000, 4687) + // Minimum execution time: 24_105_000 picoseconds. + Weight::from_parts(24_918_000, 4687) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } @@ -227,8 +227,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `558` // Estimated: `4687` - // Minimum execution time: 22_653_000 picoseconds. - Weight::from_parts(23_154_000, 4687) + // Minimum execution time: 21_501_000 picoseconds. + Weight::from_parts(22_092_000, 4687) .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } diff --git a/substrate-node/pallets/substrate-validator-set/src/weights.rs b/substrate-node/pallets/substrate-validator-set/src/weights.rs index 14ec957a9..770fde18b 100644 --- a/substrate-node/pallets/substrate-validator-set/src/weights.rs +++ b/substrate-node/pallets/substrate-validator-set/src/weights.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for substrate_validator_set //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2024-09-24, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-10-01, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `da081090f983`, CPU: `AMD Ryzen 7 5800X 8-Core Processor` +//! HOSTNAME: `585a9f003813`, CPU: `AMD Ryzen 7 5800X 8-Core Processor` //! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -49,8 +49,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `139` // Estimated: `1624` - // Minimum execution time: 13_886_000 picoseconds. - Weight::from_parts(14_267_000, 1624) + // Minimum execution time: 13_986_000 picoseconds. + Weight::from_parts(14_347_000, 1624) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -62,8 +62,8 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `205` // Estimated: `1690` - // Minimum execution time: 11_261_000 picoseconds. - Weight::from_parts(11_532_000, 1690) + // Minimum execution time: 11_381_000 picoseconds. + Weight::from_parts(11_673_000, 1690) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -75,7 +75,7 @@ impl WeightInfo for SubstrateWeight { // Proof Size summary in bytes: // Measured: `172` // Estimated: `1657` - // Minimum execution time: 12_544_000 picoseconds. + // Minimum execution time: 12_584_000 picoseconds. Weight::from_parts(12_894_000, 1657) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) @@ -92,8 +92,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `139` // Estimated: `1624` - // Minimum execution time: 13_886_000 picoseconds. - Weight::from_parts(14_267_000, 1624) + // Minimum execution time: 13_986_000 picoseconds. + Weight::from_parts(14_347_000, 1624) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -105,8 +105,8 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `205` // Estimated: `1690` - // Minimum execution time: 11_261_000 picoseconds. - Weight::from_parts(11_532_000, 1690) + // Minimum execution time: 11_381_000 picoseconds. + Weight::from_parts(11_673_000, 1690) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } @@ -118,7 +118,7 @@ impl WeightInfo for () { // Proof Size summary in bytes: // Measured: `172` // Estimated: `1657` - // Minimum execution time: 12_544_000 picoseconds. + // Minimum execution time: 12_584_000 picoseconds. Weight::from_parts(12_894_000, 1657) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64))