From 93d5b1734bb2dab535d623e9a0395b1496975a92 Mon Sep 17 00:00:00 2001 From: nakul1010 Date: Mon, 14 Aug 2023 10:18:46 +0530 Subject: [PATCH 1/6] feat: add mandatory replace --- .github/workflows/benchmark.yml | 17 +- .github/workflows/notify-breaking.yml | 10 +- Cargo.lock | 64 +- README.md | 10 + crates/issue/src/benchmarking.rs | 2 +- crates/issue/src/lib.rs | 115 +- crates/issue/src/migration.rs | 4 +- crates/issue/src/mock.rs | 9 + crates/issue/src/tests.rs | 96 +- crates/redeem/Cargo.toml | 2 + crates/redeem/src/benchmarking.rs | 226 ++++ crates/redeem/src/default_weights.rs | 119 ++ crates/redeem/src/ext.rs | 55 +- crates/redeem/src/lib.rs | 273 +++- crates/redeem/src/mock.rs | 41 +- crates/redeem/src/tests.rs | 179 ++- crates/replace/Cargo.toml | 94 -- crates/replace/rpc/Cargo.toml | 13 - crates/replace/rpc/runtime-api/Cargo.toml | 20 - crates/replace/rpc/runtime-api/src/lib.rs | 20 - crates/replace/rpc/src/lib.rs | 83 -- crates/replace/src/benchmarking.rs | 332 ----- crates/replace/src/default_weights.rs | 596 --------- crates/replace/src/ext.rs | 180 --- crates/replace/src/lib.rs | 689 ---------- crates/replace/src/mock.rs | 354 ----- crates/replace/src/tests.rs | 291 ---- crates/replace/src/types.rs | 59 - crates/vault-registry/src/lib.rs | 122 +- crates/vault-registry/src/mock.rs | 2 +- crates/vault-registry/src/tests.rs | 110 -- crates/vault-registry/src/types.rs | 81 -- parachain/Cargo.toml | 1 - parachain/runtime/common/Cargo.toml | 3 - parachain/runtime/interlay/Cargo.toml | 6 - parachain/runtime/interlay/src/lib.rs | 36 +- .../src/weights/annuity_escrow_annuity.rs | 28 +- .../src/weights/annuity_vault_annuity.rs | 20 +- .../runtime/interlay/src/weights/btc_relay.rs | 62 +- .../interlay/src/weights/clients_info.rs | 28 +- .../src/weights/collator_selection.rs | 92 +- .../src/weights/cumulus_pallet_xcmp_queue.rs | 14 +- .../runtime/interlay/src/weights/democracy.rs | 126 +- .../interlay/src/weights/dex_general.rs | 148 +- .../interlay/src/weights/dex_stable.rs | 162 ++- .../interlay/src/weights/dex_swap_router.rs | 14 +- .../runtime/interlay/src/weights/escrow.rs | 142 +- .../runtime/interlay/src/weights/farming.rs | 72 +- parachain/runtime/interlay/src/weights/fee.rs | 51 +- .../interlay/src/weights/frame_system.rs | 54 +- .../runtime/interlay/src/weights/issue.rs | 168 ++- .../runtime/interlay/src/weights/loans.rs | 168 ++- parachain/runtime/interlay/src/weights/mod.rs | 1 - .../interlay/src/weights/nomination.rs | 117 +- .../runtime/interlay/src/weights/oracle.rs | 51 +- .../src/weights/orml_asset_registry.rs | 22 +- .../interlay/src/weights/orml_tokens.rs | 46 +- .../interlay/src/weights/orml_vesting.rs | 30 +- .../interlay/src/weights/pallet_collective.rs | 180 ++- .../interlay/src/weights/pallet_identity.rs | 222 +-- .../interlay/src/weights/pallet_membership.rs | 84 +- .../interlay/src/weights/pallet_multisig.rs | 90 +- .../interlay/src/weights/pallet_preimage.rs | 74 +- .../interlay/src/weights/pallet_proxy.rs | 140 +- .../interlay/src/weights/pallet_scheduler.rs | 84 +- .../interlay/src/weights/pallet_timestamp.rs | 22 +- .../interlay/src/weights/pallet_utility.rs | 38 +- .../interlay/src/weights/pallet_xcm.rs | 95 +- .../weights/pallet_xcm_benchmarks_fungible.rs | 54 +- .../weights/pallet_xcm_benchmarks_generic.rs | 146 +- .../runtime/interlay/src/weights/redeem.rs | 154 ++- .../runtime/interlay/src/weights/replace.rs | 321 ----- .../runtime/interlay/src/weights/security.rs | 27 +- .../runtime/interlay/src/weights/supply.rs | 18 +- .../runtime/interlay/src/weights/tx_pause.rs | 14 +- .../interlay/src/weights/vault_registry.rs | 92 +- parachain/runtime/interlay/src/xcm_config.rs | 2 +- parachain/runtime/kintsugi/Cargo.toml | 6 - parachain/runtime/kintsugi/src/contracts.rs | 12 +- parachain/runtime/kintsugi/src/lib.rs | 163 ++- .../src/weights/annuity_escrow_annuity.rs | 28 +- .../src/weights/annuity_vault_annuity.rs | 20 +- .../runtime/kintsugi/src/weights/btc_relay.rs | 62 +- .../kintsugi/src/weights/clients_info.rs | 30 +- .../src/weights/collator_selection.rs | 92 +- .../src/weights/cumulus_pallet_xcmp_queue.rs | 14 +- .../runtime/kintsugi/src/weights/democracy.rs | 126 +- .../kintsugi/src/weights/dex_general.rs | 148 +- .../kintsugi/src/weights/dex_stable.rs | 158 +-- .../kintsugi/src/weights/dex_swap_router.rs | 14 +- .../runtime/kintsugi/src/weights/escrow.rs | 136 +- .../runtime/kintsugi/src/weights/farming.rs | 72 +- parachain/runtime/kintsugi/src/weights/fee.rs | 51 +- .../kintsugi/src/weights/frame_system.rs | 54 +- .../runtime/kintsugi/src/weights/issue.rs | 180 ++- .../runtime/kintsugi/src/weights/loans.rs | 160 ++- parachain/runtime/kintsugi/src/weights/mod.rs | 1 - .../kintsugi/src/weights/nomination.rs | 117 +- .../runtime/kintsugi/src/weights/oracle.rs | 51 +- .../src/weights/orml_asset_registry.rs | 22 +- .../kintsugi/src/weights/orml_tokens.rs | 46 +- .../kintsugi/src/weights/orml_vesting.rs | 30 +- .../kintsugi/src/weights/pallet_collective.rs | 182 +-- .../kintsugi/src/weights/pallet_identity.rs | 222 ++- .../kintsugi/src/weights/pallet_membership.rs | 84 +- .../kintsugi/src/weights/pallet_multisig.rs | 90 +- .../kintsugi/src/weights/pallet_preimage.rs | 74 +- .../kintsugi/src/weights/pallet_proxy.rs | 136 +- .../kintsugi/src/weights/pallet_scheduler.rs | 84 +- .../kintsugi/src/weights/pallet_timestamp.rs | 22 +- .../kintsugi/src/weights/pallet_utility.rs | 38 +- .../kintsugi/src/weights/pallet_xcm.rs | 95 +- .../weights/pallet_xcm_benchmarks_fungible.rs | 54 +- .../weights/pallet_xcm_benchmarks_generic.rs | 146 +- .../runtime/kintsugi/src/weights/redeem.rs | 153 ++- .../runtime/kintsugi/src/weights/replace.rs | 323 ----- .../runtime/kintsugi/src/weights/security.rs | 26 +- .../runtime/kintsugi/src/weights/supply.rs | 18 +- .../runtime/kintsugi/src/weights/tx_pause.rs | 14 +- .../kintsugi/src/weights/vault_registry.rs | 92 +- parachain/runtime/kintsugi/src/xcm_config.rs | 2 +- parachain/runtime/runtime-tests/Cargo.toml | 3 - .../runtime/runtime-tests/src/parachain.rs | 1 - .../runtime-tests/src/parachain/contracts.rs | 3 + .../runtime-tests/src/parachain/fee_pool.rs | 14 - .../runtime-tests/src/parachain/issue.rs | 11 +- .../runtime-tests/src/parachain/nomination.rs | 23 - .../runtime-tests/src/parachain/redeem.rs | 37 - .../runtime-tests/src/parachain/replace.rs | 1185 ----------------- .../src/parachain/vault_registry.rs | 10 - parachain/runtime/runtime-tests/src/setup.rs | 7 - parachain/runtime/runtime-tests/src/utils.rs | 86 +- .../runtime-tests/src/utils/replace_utils.rs | 90 -- parachain/src/chain_spec/interlay.rs | 4 - parachain/src/chain_spec/kintsugi.rs | 8 +- parachain/src/chain_spec/testnet_kintsugi.rs | 1 + parachain/src/eth.rs | 48 +- parachain/src/service.rs | 76 +- primitives/src/lib.rs | 31 +- rpc/Cargo.toml | 1 - rpc/src/lib.rs | 13 +- scripts/benchmark.sh | 6 +- 142 files changed, 4430 insertions(+), 8663 deletions(-) delete mode 100644 crates/replace/Cargo.toml delete mode 100644 crates/replace/rpc/Cargo.toml delete mode 100644 crates/replace/rpc/runtime-api/Cargo.toml delete mode 100644 crates/replace/rpc/runtime-api/src/lib.rs delete mode 100644 crates/replace/rpc/src/lib.rs delete mode 100644 crates/replace/src/benchmarking.rs delete mode 100644 crates/replace/src/default_weights.rs delete mode 100644 crates/replace/src/ext.rs delete mode 100644 crates/replace/src/lib.rs delete mode 100644 crates/replace/src/mock.rs delete mode 100644 crates/replace/src/tests.rs delete mode 100644 crates/replace/src/types.rs delete mode 100644 parachain/runtime/interlay/src/weights/replace.rs delete mode 100644 parachain/runtime/kintsugi/src/weights/replace.rs delete mode 100644 parachain/runtime/runtime-tests/src/parachain/replace.rs delete mode 100644 parachain/runtime/runtime-tests/src/utils/replace_utils.rs diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index eac8af5e78..02ef88c48e 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -10,7 +10,7 @@ permissions: jobs: benchmark: name: Benchmark - if: ${{ github.event.issue.pull_request && startsWith(github.event.comment.body, '/run_benchmarks') }} + if: ${{ github.event.issue.pull_request && startsWith(github.event.comment.body, '/benchmark') }} runs-on: [self-hosted, linux] steps: - uses: actions/github-script@v6 @@ -37,10 +37,11 @@ jobs: id: command with: result-encoding: string + # /benchmark CHAIN_NAME [PALLET_NAME] script: | - const [, , cmd, ...args] = context.payload.comment.body.split(/\W+/) + const [cmd, ...args] = context.payload.comment.body.split(" ") const [runtime, pallet] = args - return `bash ./scripts/benchmark.sh -r ${runtime ?? "*"} -p ${pallet ?? "*"}` + return `bash ./scripts/benchmark.sh -r ${runtime ?? ""} -p ${pallet ?? ""}` - uses: actions/github-script@v6 name: Post comment id: comment @@ -70,10 +71,12 @@ jobs: - name: Run benchmarks run: ${{steps.command.outputs.result}} > ${{runner.temp}}/out.txt - name: Commit new weights - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: Automated weights - + run: | + git config user.email "contact@interlay.io" + git config user.name "Interlay Bot" + git add . + git commit -m '${{github.event.comment.body}}' --allow-empty + git push origin HEAD:${{ fromJson(steps.issue.outputs.result).ref }} - uses: actions/github-script@v6 name: Update comment with: diff --git a/.github/workflows/notify-breaking.yml b/.github/workflows/notify-breaking.yml index 5c124b7487..aedff146f4 100644 --- a/.github/workflows/notify-breaking.yml +++ b/.github/workflows/notify-breaking.yml @@ -10,7 +10,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 @@ -23,8 +23,8 @@ jobs: fi - name: Send Discord Notification - uses: Ilshidur/action-discord@master - with: - args: "Breaking change detected in PR: ${{ github.event.pull_request.html_url }}" - webhook: ${{ secrets.DISCORD_RELEASE_WEBHOOK_URL }} + run: | + curl -X POST -H "Content-Type: application/json" \ + --data '{"content": "Breaking change detected in PR: ${{ github.event.pull_request.html_url }}"}' \ + "${{ secrets.DISCORD_RELEASE_WEBHOOK_URL }}" if: env.BREAKING_CHANGE_DETECTED == 'true' diff --git a/Cargo.lock b/Cargo.lock index 44f1949205..60c064526d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4805,7 +4805,6 @@ dependencies = [ "polkadot-service", "redeem-rpc-runtime-api", "regex", - "replace-rpc-runtime-api", "reward-rpc-runtime-api", "runtime-common", "sc-basic-authorship", @@ -4885,7 +4884,6 @@ dependencies = [ "oracle-rpc", "pallet-transaction-payment-rpc", "redeem-rpc", - "replace-rpc", "reward-rpc", "sc-client-api", "sc-consensus-manual-seal", @@ -5011,8 +5009,6 @@ dependencies = [ "polkadot-parachain", "redeem", "redeem-rpc-runtime-api", - "replace", - "replace-rpc-runtime-api", "reward", "reward-rpc-runtime-api", "runtime-common", @@ -5437,8 +5433,6 @@ dependencies = [ "polkadot-parachain", "redeem", "redeem-rpc-runtime-api", - "replace", - "replace-rpc-runtime-api", "reward", "reward-rpc-runtime-api", "runtime-common", @@ -8734,8 +8728,6 @@ dependencies = [ "rand 0.8.5", "redeem", "redeem-rpc-runtime-api", - "replace", - "replace-rpc-runtime-api", "reward", "reward-rpc-runtime-api", "runtime-common", @@ -10904,6 +10896,7 @@ dependencies = [ "frame-support", "frame-system", "interbtc-primitives", + "issue", "loans", "mocktopus", "nomination", @@ -11065,60 +11058,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "replace" -version = "1.2.0" -dependencies = [ - "bitcoin", - "btc-relay", - "currency", - "fee", - "frame-benchmarking", - "frame-support", - "frame-system", - "interbtc-primitives", - "mocktopus", - "nomination", - "oracle", - "orml-tokens", - "orml-traits", - "pallet-timestamp", - "parity-scale-codec", - "reward", - "scale-info", - "security", - "serde", - "sp-arithmetic", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", - "staking", - "vault-registry", -] - -[[package]] -name = "replace-rpc" -version = "1.2.0" -dependencies = [ - "jsonrpsee", - "parity-scale-codec", - "replace-rpc-runtime-api", - "sp-api", - "sp-blockchain", - "sp-runtime", -] - -[[package]] -name = "replace-rpc-runtime-api" -version = "1.2.0" -dependencies = [ - "frame-support", - "parity-scale-codec", - "sp-api", - "sp-std", -] - [[package]] name = "resolv-conf" version = "0.7.0" @@ -11449,7 +11388,6 @@ dependencies = [ "pallet-evm-precompile-simple", "parachain-info", "redeem", - "replace", "reward", "security", "sp-core", diff --git a/README.md b/README.md index b242970f30..b02d5cddd0 100644 --- a/README.md +++ b/README.md @@ -152,6 +152,16 @@ cargo run --release --bin interbtc-parachain -- --dev To connect with a local relay-chain follow [these instructions](docs/rococo.md). +### Development node + +Running a development can be achieved without compiling the node with docker and `instant-seal`. Replace the release version with one of the available tags: + +```shell +docker run --network=host interlayhq/interbtc:RELEASE_TAG --dev --instant-seal +# Example +docker run --network=host interlayhq/interbtc:1.25.0-rc5 --dev --instant-seal +``` + #### Test Coverage Test coverage reports available under [docs/testcoverage.html](https://github.com/interlay/interbtc/blob/master/docs/testcoverage.html) diff --git a/crates/issue/src/benchmarking.rs b/crates/issue/src/benchmarking.rs index d9cf85c747..db7c0cdd4f 100644 --- a/crates/issue/src/benchmarking.rs +++ b/crates/issue/src/benchmarking.rs @@ -128,7 +128,7 @@ fn setup_issue( let issue_id = H256::zero(); let issue_request = IssueRequest { - requester: origin.clone(), + requester: AccountOrVault::Account(origin.clone()), vault: vault_id.clone(), btc_address: vault_btc_address, amount: value.amount(), diff --git a/crates/issue/src/lib.rs b/crates/issue/src/lib.rs index 509422f5ca..6f597baf59 100644 --- a/crates/issue/src/lib.rs +++ b/crates/issue/src/lib.rs @@ -32,12 +32,13 @@ pub mod types; pub use crate::types::{DefaultIssueRequest, IssueRequest, IssueRequestStatus}; use crate::types::{BalanceOf, DefaultVaultId, Version}; -use bitcoin::{merkle::PartialTransactionProof, types::FullTransactionProof}; +use bitcoin::{merkle::PartialTransactionProof, types::FullTransactionProof, Address}; use btc_relay::{BtcAddress, BtcPublicKey}; use currency::Amount; use frame_support::{dispatch::DispatchError, ensure, pallet_prelude::Weight, traits::Get, transactional, PalletId}; use frame_system::{ensure_root, ensure_signed}; pub use pallet::*; +use primitives::AccountOrVault; use sp_core::H256; use sp_runtime::traits::{AccountIdConversion, Convert, Saturating}; use sp_std::vec::Vec; @@ -75,6 +76,7 @@ pub mod pallet { use super::*; use frame_support::pallet_prelude::*; use frame_system::pallet_prelude::*; + use primitives::AccountOrVault; /// ## Configuration /// The pallet's configuration trait. @@ -153,6 +155,8 @@ pub mod pallet { InvalidExecutor, /// Issue amount is too small. AmountBelowDustAmount, + /// Replace request can't be executed as issue request. + ReplaceRequestCannotBeExecutedAsIssue, } /// Users create issue requests to issue tokens. This mapping provides access @@ -232,7 +236,7 @@ pub mod pallet { vault_id: DefaultVaultId, griefing_currency: CurrencyId, ) -> DispatchResultWithPostInfo { - let requester = ensure_signed(origin)?; + let requester = AccountOrVault::Account(ensure_signed(origin)?); Self::_request_issue(requester, amount, vault_id, griefing_currency)?; Ok(().into()) } @@ -301,13 +305,75 @@ impl Pallet { T::TreasuryPalletId::get().into_account_truncating() } + // Function to cancel an issue request and slash collateral + pub fn cancel_issue_request_and_slash_collateral(issue_id: &H256) -> Result, DispatchError> { + // Get the issue request using the provided issue_id + let issue = Self::get_issue_request_from_id(issue_id)?; + + // Retrieve the amount of griefing collateral from the issue + let griefing_collateral = issue.griefing_collateral(); + + // Transfer griefing collateral from the requester's account to the vault's account + ext::vault_registry::transfer_funds::( + CurrencySource::UserGriefing(issue.requester.get_account().clone()), + CurrencySource::FreeBalance(issue.vault.account_id), + &griefing_collateral, + )?; + + // Set the status of the issue request to 'Cancelled' + Self::set_issue_status(issue_id.clone(), IssueRequestStatus::Cancelled); + + // Emit an event to indicate the cancellation of the issue request + Self::deposit_event(Event::CancelIssue { + issue_id: issue_id.clone(), + requester: issue.requester.get_account().clone(), + griefing_collateral: griefing_collateral.amount(), + }); + + // Return the amount of griefing collateral that was slashed + Ok(griefing_collateral.amount()) + } + + // Function to retrieve the vault ID associated with a given issue ID + pub fn get_vault_from_id_from_issue_id(issue_id: &H256) -> Result, DispatchError> { + // Retrieve the issue request using the provided issue_id + let issue_request = Self::get_issue_request_from_id(issue_id)?; + + // Extract and return the associated vault ID from the issue request + Ok(issue_request.vault) + } + + // Function to complete a vault issue process + pub fn _complete_vault_issue(issue_id: H256) -> Result<(), DispatchError> { + // Retrieve the issue request using the provided issue_id + let issue = Self::get_issue_request_from_id(&issue_id)?; + + // Calculate the total amount including both issue amount and fee + let total = issue.amount().checked_add(&issue.fee())?; + + // Decrease the to-be-issued tokens and increase the issued tokens for the new vault + ext::vault_registry::issue_tokens::(&issue.vault, &total)?; + + // Distribute rewards based on the issue fee + ext::fee::distribute_rewards::(&issue.fee())?; + + // Release the locked griefing collateral to the requester's account + let griefing_collateral: Amount = issue.griefing_collateral(); + griefing_collateral.unlock_on(&issue.requester.get_account())?; + + // Set the issue status to 'Completed' + Self::set_issue_status(issue_id, IssueRequestStatus::Completed); + + Ok(()) + } + /// Requests CBA issuance, returns unique tracking ID. - fn _request_issue( - requester: T::AccountId, + pub fn _request_issue( + requester: AccountOrVault, amount_requested: BalanceOf, vault_id: DefaultVaultId, griefing_currency: CurrencyId, - ) -> Result { + ) -> Result<(H256, Address), DispatchError> { let amount_requested = Amount::new(amount_requested, vault_id.wrapped_currency()); ensure!( @@ -329,7 +395,7 @@ impl Pallet { // calculate griefing collateral based on the total amount of tokens to be issued let amount_collateral = amount_requested.convert_to(griefing_currency)?; let griefing_collateral = ext::fee::get_issue_griefing_collateral::(&amount_collateral)?; - griefing_collateral.lock_on(&requester)?; + griefing_collateral.lock_on(requester.get_account())?; // only continue if the payment is above the dust value ensure!( @@ -343,14 +409,14 @@ impl Pallet { // calculate the amount of tokens that will be transferred to the user upon execution let amount_user = amount_requested.checked_sub(&fee)?; - let issue_id = ext::security::get_secure_id::(&requester); + let issue_id = ext::security::get_secure_id::(&requester.get_account()); let btc_address = ext::vault_registry::register_deposit_address::(&vault_id, issue_id)?; let btc_public_key = ext::vault_registry::get_bitcoin_public_key::(&vault_id.account_id)?; let request = IssueRequest { vault: vault_id, opentime: ext::security::active_block_number::(), - requester, + requester: requester.clone(), btc_address, btc_public_key, amount: amount_user.amount(), @@ -365,7 +431,7 @@ impl Pallet { Self::deposit_event(Event::RequestIssue { issue_id, - requester: request.requester, + requester: request.requester.get_account().clone(), amount: request.amount, fee: request.fee, griefing_collateral: request.griefing_collateral, @@ -374,7 +440,7 @@ impl Pallet { vault_address: request.btc_address, vault_public_key: request.btc_public_key, }); - Ok(issue_id) + Ok((issue_id, btc_address)) } /// Completes CBA issuance, removing request from storage and minting token. @@ -384,6 +450,13 @@ impl Pallet { unchecked_transaction: FullTransactionProof, ) -> Result<(), DispatchError> { let mut issue = Self::get_issue_request_from_id(&issue_id)?; + + // ensure that issue is not part of replace request + ensure!( + !issue.requester.is_vault_account(), + Error::::ReplaceRequestCannotBeExecutedAsIssue + ); + // allow anyone to complete issue request let requester = issue.requester.clone(); @@ -405,7 +478,7 @@ impl Pallet { ext::vault_registry::try_increase_to_be_issued_tokens::(&issue.vault, &amount_transferred)?; if amount_transferred.lt(&expected_total_amount)? { - ensure!(requester == executor, Error::::InvalidExecutor); + ensure!(requester.get_account() == &executor, Error::::InvalidExecutor); } if amount_transferred.ne(&expected_total_amount)? { // griefing collateral and to_be_issued already decreased in cancel @@ -416,7 +489,7 @@ impl Pallet { IssueRequestStatus::Pending => { let to_release_griefing_collateral = if amount_transferred.lt(&expected_total_amount)? { // only the requester of the issue can execute payments with insufficient amounts - ensure!(requester == executor, Error::::InvalidExecutor); + ensure!(requester.get_account() == &executor, Error::::InvalidExecutor); Self::decrease_issue_amount(&issue_id, &mut issue, amount_transferred, expected_total_amount)? } else { if amount_transferred.gt(&expected_total_amount)? @@ -432,7 +505,7 @@ impl Pallet { issue.griefing_collateral() }; - to_release_griefing_collateral.unlock_on(&requester)?; + to_release_griefing_collateral.unlock_on(requester.get_account())?; } } @@ -443,7 +516,7 @@ impl Pallet { ext::vault_registry::issue_tokens::(&issue.vault, &total)?; // mint issued tokens - issue_amount.mint_to(&requester)?; + issue_amount.mint_to(requester.get_account())?; // mint wrapped fees issue_fee.mint_to(&ext::fee::fee_pool_account_id::())?; @@ -455,7 +528,7 @@ impl Pallet { Self::deposit_event(Event::ExecuteIssue { issue_id, - requester, + requester: requester.get_account().clone(), vault_id: issue.vault, amount: total.amount(), fee: issue.fee, @@ -472,7 +545,7 @@ impl Pallet { if ext::btc_relay::has_request_expired::(issue.opentime, issue.btc_height, issue_period)? { // anyone can cancel the issue request once expired issue.griefing_collateral() - } else if issue.requester == requester { + } else if issue.requester.get_account() == &requester { // slash/release griefing collateral proportionally to the time elapsed // NOTE: if global issue period increases requester will get more griefing collateral let blocks_elapsed = ext::security::active_block_number::().saturating_sub(issue.opentime); @@ -505,12 +578,12 @@ impl Pallet { if ext::vault_registry::is_vault_liquidated::(&issue.vault)? { // return slashed griefing collateral if the vault is liquidated - to_be_slashed_collateral.unlock_on(&issue.requester)?; + to_be_slashed_collateral.unlock_on(issue.requester.get_account())?; } else { // otherwise give slashed griefing collateral to the treasury // since the vault may have purposely blocked minting ext::vault_registry::transfer_funds::( - CurrencySource::UserGriefing(issue.requester.clone()), + CurrencySource::UserGriefing(issue.requester.get_account().clone()), CurrencySource::FreeBalance(Self::treasury_account_id()), &to_be_slashed_collateral, )?; @@ -548,7 +621,7 @@ impl Pallet { )?; let slashed_collateral = issue.griefing_collateral().checked_sub(&to_release_collateral)?; ext::vault_registry::transfer_funds::( - CurrencySource::UserGriefing(issue.requester.clone()), + CurrencySource::UserGriefing(issue.requester.get_account().clone()), CurrencySource::FreeBalance(Self::treasury_account_id()), &slashed_collateral, )?; @@ -588,7 +661,7 @@ impl Pallet { /// * `account_id` - user account id pub fn get_issue_requests_for_account(account_id: T::AccountId) -> Vec { >::iter() - .filter(|(_, request)| request.requester == account_id) + .filter(|(_, request)| request.requester.get_account() == &account_id) .map(|(key, _)| key) .collect() } @@ -657,7 +730,7 @@ impl Pallet { Ok(()) } - fn insert_issue_request(key: &H256, value: &DefaultIssueRequest) { + pub fn insert_issue_request(key: &H256, value: &DefaultIssueRequest) { >::insert(key, value) } diff --git a/crates/issue/src/migration.rs b/crates/issue/src/migration.rs index 216916123c..e95f8ffc7b 100644 --- a/crates/issue/src/migration.rs +++ b/crates/issue/src/migration.rs @@ -87,7 +87,7 @@ pub mod v1 { griefing_collateral: old.griefing_collateral, amount: old.amount, fee: old.fee, - requester: old.requester, + requester: AccountOrVault::Account(old.requester), btc_address: old.btc_address, btc_public_key: old.btc_public_key, btc_height: old.btc_height, @@ -148,7 +148,7 @@ mod test { v1::Migration::::on_runtime_upgrade(); let new = crate::IssueRequests::::get(key).unwrap(); - assert!(old.requester == new.requester); + assert!(old.requester == new.requester.get_account().clone()); assert!(old.vault == new.vault); assert!(old.btc_address == new.btc_address); assert!(old.amount == new.amount); diff --git a/crates/issue/src/mock.rs b/crates/issue/src/mock.rs index b045e5bb67..45c808d207 100644 --- a/crates/issue/src/mock.rs +++ b/crates/issue/src/mock.rs @@ -286,7 +286,15 @@ pub const VAULT: VaultId = VaultId { wrapped: DEFAULT_WRAPPED_CURRENCY, }, }; +pub const OLD_VAULT: VaultId = VaultId { + account_id: 4, + currencies: VaultCurrencyPair { + collateral: DEFAULT_COLLATERAL_CURRENCY, + wrapped: DEFAULT_WRAPPED_CURRENCY, + }, +}; +pub const OLD_VAULT_BALANCE: u128 = 1_000_000; pub const ALICE_BALANCE: u128 = 1_000_000; pub const BOB_BALANCE: u128 = 1_000_000; @@ -345,6 +353,7 @@ impl ExtBuilder { vec![ (USER, currency_id, ALICE_BALANCE), (VAULT.account_id, currency_id, BOB_BALANCE), + (OLD_VAULT.account_id, currency_id, OLD_VAULT_BALANCE), ] }) .collect(), diff --git a/crates/issue/src/tests.rs b/crates/issue/src/tests.rs index 4f8cccd3b3..276a7e9a6a 100644 --- a/crates/issue/src/tests.rs +++ b/crates/issue/src/tests.rs @@ -1,12 +1,12 @@ use crate::{ext, mock::*, Event, IssueRequest}; -use bitcoin::{merkle::PartialTransactionProof, types::FullTransactionProof}; +use bitcoin::{merkle::PartialTransactionProof, types::FullTransactionProof, Address}; use btc_relay::{BtcAddress, BtcPublicKey}; use currency::Amount; use frame_support::{assert_noop, assert_ok, dispatch::DispatchError}; use mocktopus::mocking::*; use orml_traits::MultiCurrency; -use primitives::issue::IssueRequestStatus; +use primitives::{issue::IssueRequestStatus, AccountOrVault}; use sp_arithmetic::FixedU128; use sp_core::H256; use sp_runtime::traits::One; @@ -20,22 +20,30 @@ fn wrapped(amount: u128) -> Amount { Amount::new(amount, DEFAULT_WRAPPED_CURRENCY) } -fn request_issue(origin: AccountId, amount: Balance, vault: DefaultVaultId) -> Result { +fn request_issue( + origin: AccountId, + amount: Balance, + vault: DefaultVaultId, +) -> Result<(H256, Address), DispatchError> { ext::security::get_secure_id::.mock_safe(|_| MockResult::Return(get_dummy_request_id())); ext::vault_registry::try_increase_to_be_issued_tokens::.mock_safe(|_, _| MockResult::Return(Ok(()))); ext::vault_registry::register_deposit_address:: .mock_safe(|_, _| MockResult::Return(Ok(BtcAddress::random()))); - Issue::_request_issue(origin, amount, vault, DEFAULT_NATIVE_CURRENCY) + Issue::_request_issue(AccountOrVault::Account(origin), amount, vault, DEFAULT_NATIVE_CURRENCY) } -fn request_issue_ok(origin: AccountId, amount: Balance, vault: DefaultVaultId) -> H256 { +fn request_issue_ok( + origin: AccountOrVault, + amount: Balance, + vault: DefaultVaultId, +) -> H256 { request_issue_ok_with_address(origin, amount, vault, BtcAddress::random()) } fn request_issue_ok_with_address( - origin: AccountId, + origin: AccountOrVault, amount: Balance, vault: DefaultVaultId, address: BtcAddress, @@ -51,7 +59,9 @@ fn request_issue_ok_with_address( ext::vault_registry::register_deposit_address::.mock_raw(|_, _| MockResult::Return(Ok(address))); } - Issue::_request_issue(origin, amount, vault, DEFAULT_NATIVE_CURRENCY).unwrap() + Issue::_request_issue(origin, amount, vault, DEFAULT_NATIVE_CURRENCY) + .unwrap() + .0 } fn execute_issue(origin: AccountId, issue_id: &H256) -> Result<(), DispatchError> { @@ -94,12 +104,9 @@ fn test_request_issue_banned_fails() { &VAULT, vault_registry::Vault { id: VAULT, - to_be_replaced_tokens: 0, to_be_issued_tokens: 0, issued_tokens: 0, to_be_redeemed_tokens: 0, - replace_collateral: 0, - active_replace_collateral: 0, banned_until: Some(1), secure_collateral_threshold: None, status: VaultStatus::Active(true), @@ -128,7 +135,8 @@ fn test_request_issue_succeeds() { ext::fee::get_issue_griefing_collateral:: .mock_safe(move |_| MockResult::Return(Ok(griefing(issue_griefing_collateral)))); - let issue_id = request_issue_ok_with_address(origin, amount, vault.clone(), address.clone()); + let issue_id = + request_issue_ok_with_address(AccountOrVault::Account(origin), amount, vault.clone(), address.clone()); let request_issue_event = TestEvent::Issue(Event::RequestIssue { issue_id, @@ -159,6 +167,7 @@ fn setup_execute( issue_fee: Balance, griefing_collateral: Balance, btc_transferred: Balance, + account: AccountOrVault, ) -> H256 { ext::vault_registry::get_active_vault_from_id::.mock_safe(|_| MockResult::Return(Ok(init_zero_vault(VAULT)))); ext::vault_registry::issue_tokens::.mock_safe(|_, _| MockResult::Return(Ok(()))); @@ -168,7 +177,7 @@ fn setup_execute( ext::fee::get_issue_griefing_collateral:: .mock_safe(move |_| MockResult::Return(Ok(griefing(griefing_collateral)))); - let issue_id = request_issue_ok(USER, issue_amount, VAULT); + let issue_id = request_issue_ok(account, issue_amount, VAULT); >::set_active_block_number(5); ext::btc_relay::get_and_verify_issue_payment:: @@ -180,7 +189,7 @@ fn setup_execute( #[test] fn test_execute_issue_succeeds() { run_test(|| { - let issue_id = setup_execute(3, 1, 1, 3); + let issue_id = setup_execute(3, 1, 1, 3, AccountOrVault::Account(USER)); assert_ok!(execute_issue(USER, &issue_id)); let execute_issue_event = TestEvent::Issue(Event::ExecuteIssue { @@ -208,7 +217,7 @@ fn test_execute_issue_succeeds() { #[test] fn test_execute_issue_overpayment_succeeds() { run_test(|| { - let issue_id = setup_execute(3, 0, 0, 5); + let issue_id = setup_execute(3, 0, 0, 5, AccountOrVault::Account(USER)); unsafe { let mut increase_tokens_called = false; @@ -238,7 +247,7 @@ fn test_execute_issue_overpayment_succeeds() { #[test] fn test_execute_issue_overpayment_up_to_max_succeeds() { run_test(|| { - let issue_id = setup_execute(3, 0, 0, 10); + let issue_id = setup_execute(3, 0, 0, 10, AccountOrVault::Account(USER)); unsafe { let mut increase_tokens_called = false; @@ -268,7 +277,7 @@ fn test_execute_issue_overpayment_up_to_max_succeeds() { #[test] fn test_execute_issue_underpayment_succeeds() { run_test(|| { - let issue_id = setup_execute(10, 0, 20, 1); + let issue_id = setup_execute(10, 0, 20, 1, AccountOrVault::Account(USER)); unsafe { let mut transfer_funds_called = false; ext::vault_registry::transfer_funds::.mock_raw(|from, to, amount| { @@ -319,7 +328,7 @@ fn test_cancel_issue_not_expired_and_not_requester_fails() { ext::vault_registry::get_active_vault_from_id:: .mock_safe(|_| MockResult::Return(Ok(init_zero_vault(VAULT)))); - let issue_id = request_issue_ok(USER, 3, VAULT); + let issue_id = request_issue_ok(AccountOrVault::Account(USER), 3, VAULT); // issue period is 10, we issued at block 1, so at block 5 the cancel should fail >::set_active_block_number(5); assert_noop!(cancel_issue(3, &issue_id), TestError::TimeNotExpired); @@ -335,7 +344,7 @@ fn test_cancel_issue_not_expired_and_requester_succeeds() { ext::vault_registry::is_vault_liquidated::.mock_safe(move |_| MockResult::Return(Ok(false))); ext::fee::get_issue_griefing_collateral::.mock_safe(move |_| MockResult::Return(Ok(griefing(100)))); - let issue_id = request_issue_ok(USER, 300, VAULT); + let issue_id = request_issue_ok(AccountOrVault::Account(USER), 300, VAULT); unsafe { let mut transfer_called = false; @@ -372,7 +381,7 @@ fn test_cancel_issue_expired_succeeds() { ext::fee::get_issue_griefing_collateral::.mock_safe(move |_| MockResult::Return(Ok(griefing(100)))); ext::btc_relay::has_request_expired::.mock_safe(move |_, _, _| MockResult::Return(Ok(true))); - let issue_id = request_issue_ok(USER, 300, VAULT); + let issue_id = request_issue_ok(AccountOrVault::Account(USER), 300, VAULT); unsafe { // issue period is 10, we issued at block 1, so at block 12 the request has expired @@ -403,3 +412,52 @@ fn test_set_issue_period_only_root() { assert_ok!(Issue::set_issue_period(RuntimeOrigin::root(), 1)); }) } + +#[test] +fn execute_issue_fails_for_replace_request() { + run_test(|| { + let issue_id = setup_execute(3, 1, 1, 3, AccountOrVault::Vault(OLD_VAULT)); + assert_noop!( + execute_issue(USER, &issue_id), + TestError::ReplaceRequestCannotBeExecutedAsIssue + ); + }); +} + +#[test] +fn complete_issue_request_for_replace() { + run_test(|| { + let issue_id = setup_execute(3, 1, 1, 3, AccountOrVault::Vault(OLD_VAULT)); + assert_ok!(Issue::_complete_vault_issue(issue_id)); + assert_eq!( + Issue::issue_requests(&issue_id).unwrap().status, + IssueRequestStatus::Completed + ); + assert_noop!(cancel_issue(USER, &issue_id), TestError::IssueCompleted); + }); +} + +#[test] +fn cancel_issue_for_replace() { + run_test(|| { + let griefing_collateral = 10; + let issue_id = setup_execute(3, 1, griefing_collateral, 3, AccountOrVault::Vault(OLD_VAULT)); + + assert_eq!( + Issue::cancel_issue_request_and_slash_collateral(&issue_id), + Ok(griefing_collateral) + ); + + assert_eq!( + Issue::issue_requests(&issue_id).unwrap().status, + IssueRequestStatus::Cancelled + ); + + let request_issue_event = TestEvent::Issue(Event::CancelIssue { + issue_id, + requester: OLD_VAULT.account_id, + griefing_collateral, + }); + assert!(System::events().iter().any(|a| a.event == request_issue_event)); + }); +} diff --git a/crates/redeem/Cargo.toml b/crates/redeem/Cargo.toml index 4853f80647..60e98ad66e 100644 --- a/crates/redeem/Cargo.toml +++ b/crates/redeem/Cargo.toml @@ -32,6 +32,7 @@ security = { path = "../security", default-features = false } vault-registry = { path = "../vault-registry", default-features = false } loans = { path = "../loans", default-features = false } primitives = { package = "interbtc-primitives", path = "../../primitives", default-features = false } +issue = { path ="../issue", default-features = false } # Orml dependencies orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "dc39cfddefb10ef0de23655e2c3dcdab66a19404", default-features = false, optional = true } @@ -78,6 +79,7 @@ std = [ "nomination/std", "primitives/std", "loans/std", + "issue/std", "orml-tokens/std", "orml-traits/std", diff --git a/crates/redeem/src/benchmarking.rs b/crates/redeem/src/benchmarking.rs index afcc7ae50a..19fa82eb81 100644 --- a/crates/redeem/src/benchmarking.rs +++ b/crates/redeem/src/benchmarking.rs @@ -18,7 +18,9 @@ use vault_registry::{ // Pallets use crate::Pallet as Redeem; use btc_relay::Pallet as BtcRelay; +use issue::Pallet as Issue; use oracle::Pallet as Oracle; +use primitives::issue::IssueRequest; use security::Pallet as Security; use vault_registry::Pallet as VaultRegistry; @@ -111,6 +113,7 @@ fn test_request(vault_id: &DefaultVaultId) -> DefaultRedeem btc_address: Default::default(), btc_height: Default::default(), status: Default::default(), + issue_id: None, } } @@ -122,6 +125,154 @@ fn mint_vault_collateral(vault_id: &DefaultVau } } +fn get_vault_id(name: &'static str) -> DefaultVaultId { + VaultId::new( + account(name, 0, 0), + get_collateral_currency_id::(), + get_wrapped_currency_id::(), + ) +} + +fn register_vault(vault_id: &DefaultVaultId, issued_tokens: Amount) { + let origin = RawOrigin::Signed(vault_id.account_id.clone()); + + assert_ok!(>::deposit( + get_collateral_currency_id::(), + &vault_id.account_id, + (1u32 << 31).into() + )); + assert_ok!(>::deposit( + get_native_currency_id::(), + &vault_id.account_id, + (1u32 << 31).into() + )); + + assert_ok!(VaultRegistry::::register_public_key( + origin.into(), + BtcPublicKey::dummy() + )); + assert_ok!(VaultRegistry::::_register_vault( + vault_id.clone(), + 100000000u32.into() + )); + + VaultRegistry::::try_increase_to_be_issued_tokens(vault_id, &issued_tokens).unwrap(); + VaultRegistry::::issue_tokens(vault_id, &issued_tokens).unwrap(); +} + +struct ChainState { + old_vault_id: DefaultVaultId, + new_vault_id: DefaultVaultId, + issued_tokens: Amount, + to_be_replaced: Amount, +} + +fn setup_chain() -> ChainState { + let new_vault_id = get_vault_id::("NewVault"); + let old_vault_id = get_vault_id::("OldVault"); + + Oracle::::_set_exchange_rate( + get_native_currency_id::(), // for griefing collateral + ::UnsignedFixedPoint::one(), + ) + .unwrap(); + Oracle::::_set_exchange_rate( + old_vault_id.collateral_currency(), + ::UnsignedFixedPoint::one(), + ) + .unwrap(); + + VaultRegistry::::set_minimum_collateral( + RawOrigin::Root.into(), + old_vault_id.collateral_currency(), + 100_000u32.into(), + ) + .unwrap(); + VaultRegistry::::_set_system_collateral_ceiling(old_vault_id.currencies.clone(), 1_000_000_000u32.into()); + + VaultRegistry::::_set_secure_collateral_threshold( + old_vault_id.currencies.clone(), + ::UnsignedFixedPoint::checked_from_rational(1, 100000).unwrap(), + ); + VaultRegistry::::_set_premium_redeem_threshold( + old_vault_id.currencies.clone(), + ::UnsignedFixedPoint::checked_from_rational(1, 200000).unwrap(), + ); + VaultRegistry::::_set_liquidation_collateral_threshold( + old_vault_id.currencies.clone(), + ::UnsignedFixedPoint::checked_from_rational(1, 300000).unwrap(), + ); + + let issued_tokens = Amount::new(200000u32.into(), old_vault_id.wrapped_currency()); + let to_be_replaced = issued_tokens.clone().map(|x| x / 4u32.into()); + + register_vault(&old_vault_id, issued_tokens.clone()); + register_vault(&new_vault_id, issued_tokens.clone()); + + ChainState { + old_vault_id, + new_vault_id, + issued_tokens, + to_be_replaced, + } +} + +fn setup_replace( + old_vault_id: &DefaultVaultId, + new_vault_id: &DefaultVaultId, + to_be_replaced: Amount, +) -> (H256, BalanceOf) +where + <::Balance as TryInto>::Error: Debug, +{ + let value: Amount = Amount::new(2u32.into(), get_wrapped_currency_id::()); + + //set up redeem + let redeem_id = H256::zero(); + let mut redeem_request = test_request::(&old_vault_id); + redeem_request.redeemer = new_vault_id.account_id.clone(); + redeem_request.opentime = Security::::active_block_number(); + redeem_request.issue_id = Some(H256::zero()); + redeem_request.amount_btc = value.amount(); + Redeem::::insert_redeem_request(&redeem_id, &redeem_request); + + VaultRegistry::::try_increase_to_be_redeemed_tokens(&old_vault_id, &to_be_replaced).unwrap(); + VaultRegistry::::try_increase_to_be_issued_tokens(&new_vault_id, &to_be_replaced).unwrap(); + + mint_and_reserve_wrapped::(&redeem_request.redeemer, redeem_request.amount_btc); + + // expire redeem request + initialize_and_mine_blocks_until_expiry::(&redeem_request); + Security::::set_active_block_number( + Security::::active_block_number() + Redeem::::redeem_period() + 100u32.into(), + ); + + // set up issue + let issue_id = H256::zero(); + let issue_request = IssueRequest { + requester: AccountOrVault::Account(old_vault_id.account_id.clone()), + vault: new_vault_id.clone(), + btc_address: Default::default(), + amount: value.amount(), + btc_height: Default::default(), + btc_public_key: Default::default(), + fee: Default::default(), + griefing_collateral: Default::default(), + griefing_currency: get_native_currency_id::(), + opentime: Default::default(), + period: Default::default(), + status: Default::default(), + }; + Issue::::insert_issue_request(&issue_id, &issue_request); + let value: Amount = Amount::new(3u32.into(), get_wrapped_currency_id::()); + + VaultRegistry::::try_increase_to_be_issued_tokens(&new_vault_id, &value).unwrap(); + + Redeem::::insert_request(&redeem_id, &issue_id); + + (redeem_id, redeem_request.amount_btc) +} + #[benchmarks( where T: loans::Config, @@ -332,6 +483,44 @@ pub mod benchmarks { cancel_redeem(RawOrigin::Signed(caller), redeem_id, false); } + #[benchmark] + pub fn cancel_replace() { + let ChainState { + old_vault_id, + to_be_replaced, + new_vault_id, + .. + } = setup_chain::(); + + let (redeem_id, amount_btc) = setup_replace::(&old_vault_id, &new_vault_id, to_be_replaced); + + let vault_id = activate_lending_and_get_vault_id::(); + + initialize_oracle::(); + + register_public_key::(vault_id.clone()); + VaultRegistry::::insert_vault( + &vault_id, + Vault { + id: vault_id.clone(), + issued_tokens: amount_btc, + to_be_redeemed_tokens: amount_btc, + ..Vault::new(vault_id.clone()) + }, + ); + + mint_collateral::(&vault_id.account_id, 1000u32.into()); + assert_ok!(VaultRegistry::::try_deposit_collateral(&vault_id, &collateral(1000))); + + assert_ok!(Oracle::::_set_exchange_rate( + get_collateral_currency_id::(), + UnsignedFixedPoint::::one() + )); + + #[extrinsic_call] + cancel_redeem(RawOrigin::Signed(old_vault_id.account_id.clone()), redeem_id, true); + } + #[benchmark] pub fn set_redeem_period() { #[extrinsic_call] @@ -375,6 +564,43 @@ pub mod benchmarks { _(RawOrigin::Signed(caller), vault_id.currencies, amount.into()); } + #[benchmark] + pub fn request_replace() { + let ChainState { + old_vault_id, + issued_tokens, + to_be_replaced, + new_vault_id, + } = setup_chain::(); + let amount = (issued_tokens.checked_sub(&to_be_replaced).unwrap()).amount(); + let relayer_id: T::AccountId = account("Relayer", 0, 0); + initialize_oracle::(); + mint_collateral::(&relayer_id, (1u32 << 31).into()); + + // initialize relay + let init_block = BlockBuilder::new() + .with_version(4) + .with_coinbase(&BtcAddress::dummy(), 50, 3) + .with_timestamp(u32::MAX) + .mine(U256::from(2).pow(254.into())) + .unwrap(); + + BtcRelay::::_initialize(relayer_id.clone(), init_block.header, 0).unwrap(); + BtcRelay::::mine_blocks(&relayer_id, 1); + Security::::set_active_block_number( + Security::::active_block_number() + BtcRelay::::parachain_confirmations(), + ); + + #[extrinsic_call] + _( + RawOrigin::Signed(old_vault_id.account_id.clone()), + old_vault_id.currencies.clone(), + amount, + new_vault_id.clone(), + get_native_currency_id::(), + ); + } + impl_benchmark_test_suite!( Redeem, crate::mock::ExtBuilder::build_with(Default::default()), diff --git a/crates/redeem/src/default_weights.rs b/crates/redeem/src/default_weights.rs index 71ac5e8290..8079f3e54b 100644 --- a/crates/redeem/src/default_weights.rs +++ b/crates/redeem/src/default_weights.rs @@ -44,6 +44,7 @@ pub trait WeightInfo { fn cancel_redeem_retry() -> Weight; fn set_redeem_period() -> Weight; fn self_redeem() -> Weight; + fn request_replace() -> Weight; } /// Weights for redeem using the Substrate node and recommended hardware. @@ -411,6 +412,65 @@ impl WeightInfo for SubstrateWeight { .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } + /// Storage: VaultRegistry Vaults (r:2 w:2) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) + /// Storage: BTCRelay StartBlockHeight (r:1 w:0) + /// Proof: BTCRelay StartBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: BTCRelay StableBitcoinConfirmations (r:1 w:0) + /// Proof: BTCRelay StableBitcoinConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: BTCRelay BestBlockHeight (r:1 w:0) + /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: Oracle Aggregate (r:3 w:0) + /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) + /// Storage: Fee IssueGriefingCollateral (r:1 w:0) + /// Proof: Fee IssueGriefingCollateral (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:1 w:1) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: Issue IssueBtcDustValue (r:1 w:0) + /// Proof: Issue IssueBtcDustValue (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) + /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) + /// Storage: VaultStaking Nonce (r:2 w:0) + /// Proof: VaultStaking Nonce (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) + /// Storage: VaultStaking TotalCurrentStake (r:2 w:0) + /// Proof: VaultStaking TotalCurrentStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) + /// Storage: Fee IssueFee (r:1 w:0) + /// Proof: Fee IssueFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// Storage: Security Nonce (r:1 w:1) + /// Proof: Security Nonce (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) + /// Storage: System ParentHash (r:1 w:0) + /// Proof: System ParentHash (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) + /// Storage: VaultRegistry VaultBitcoinPublicKey (r:1 w:0) + /// Proof: VaultRegistry VaultBitcoinPublicKey (max_values: None, max_size: Some(81), added: 2556, mode: MaxEncodedLen) + /// Storage: Security ActiveBlockCount (r:1 w:0) + /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: Issue IssuePeriod (r:1 w:0) + /// Proof: Issue IssuePeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: Fee RedeemFee (r:1 w:0) + /// Proof: Fee RedeemFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// Storage: Redeem RedeemTransactionSize (r:1 w:0) + /// Proof: Redeem RedeemTransactionSize (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: Redeem RedeemBtcDustValue (r:1 w:0) + /// Proof: Redeem RedeemBtcDustValue (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// Storage: VaultRegistry PremiumRedeemThreshold (r:1 w:0) + /// Proof: VaultRegistry PremiumRedeemThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) + /// Storage: Redeem RedeemPeriod (r:1 w:0) + /// Proof: Redeem RedeemPeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: Issue IssueRequests (r:0 w:1) + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) + /// Storage: Redeem RedeemRequests (r:0 w:1) + /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(278), added: 2753, mode: MaxEncodedLen) + /// Storage: Redeem Requests (r:0 w:1) + /// Proof: Redeem Requests (max_values: None, max_size: Some(80), added: 2555, mode: MaxEncodedLen) + fn request_replace() -> Weight { + // Proof Size summary in bytes: + // Measured: `3277` + // Estimated: `8547` + // Minimum execution time: 39_015_000_000 picoseconds. + Weight::from_parts(39_015_000_000, 8547) + .saturating_add(T::DbWeight::get().reads(27_u64)) + .saturating_add(T::DbWeight::get().writes(7_u64)) + } } // For backwards compatibility and tests @@ -777,4 +837,63 @@ impl WeightInfo for () { .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } + /// Storage: VaultRegistry Vaults (r:2 w:2) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) + /// Storage: BTCRelay StartBlockHeight (r:1 w:0) + /// Proof: BTCRelay StartBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: BTCRelay StableBitcoinConfirmations (r:1 w:0) + /// Proof: BTCRelay StableBitcoinConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: BTCRelay BestBlockHeight (r:1 w:0) + /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: Oracle Aggregate (r:3 w:0) + /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) + /// Storage: Fee IssueGriefingCollateral (r:1 w:0) + /// Proof: Fee IssueGriefingCollateral (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:1 w:1) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: Issue IssueBtcDustValue (r:1 w:0) + /// Proof: Issue IssueBtcDustValue (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) + /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) + /// Storage: VaultStaking Nonce (r:2 w:0) + /// Proof: VaultStaking Nonce (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) + /// Storage: VaultStaking TotalCurrentStake (r:2 w:0) + /// Proof: VaultStaking TotalCurrentStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) + /// Storage: Fee IssueFee (r:1 w:0) + /// Proof: Fee IssueFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// Storage: Security Nonce (r:1 w:1) + /// Proof: Security Nonce (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) + /// Storage: System ParentHash (r:1 w:0) + /// Proof: System ParentHash (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) + /// Storage: VaultRegistry VaultBitcoinPublicKey (r:1 w:0) + /// Proof: VaultRegistry VaultBitcoinPublicKey (max_values: None, max_size: Some(81), added: 2556, mode: MaxEncodedLen) + /// Storage: Security ActiveBlockCount (r:1 w:0) + /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: Issue IssuePeriod (r:1 w:0) + /// Proof: Issue IssuePeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: Fee RedeemFee (r:1 w:0) + /// Proof: Fee RedeemFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// Storage: Redeem RedeemTransactionSize (r:1 w:0) + /// Proof: Redeem RedeemTransactionSize (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: Redeem RedeemBtcDustValue (r:1 w:0) + /// Proof: Redeem RedeemBtcDustValue (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// Storage: VaultRegistry PremiumRedeemThreshold (r:1 w:0) + /// Proof: VaultRegistry PremiumRedeemThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) + /// Storage: Redeem RedeemPeriod (r:1 w:0) + /// Proof: Redeem RedeemPeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: Issue IssueRequests (r:0 w:1) + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) + /// Storage: Redeem RedeemRequests (r:0 w:1) + /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(278), added: 2753, mode: MaxEncodedLen) + /// Storage: Redeem Requests (r:0 w:1) + /// Proof: Redeem Requests (max_values: None, max_size: Some(80), added: 2555, mode: MaxEncodedLen) + fn request_replace() -> Weight { + // Proof Size summary in bytes: + // Measured: `3277` + // Estimated: `8547` + // Minimum execution time: 39_015_000_000 picoseconds. + Weight::from_parts(39_015_000_000, 8547) + .saturating_add(RocksDbWeight::get().reads(27_u64)) + .saturating_add(RocksDbWeight::get().writes(7_u64)) + } } diff --git a/crates/redeem/src/ext.rs b/crates/redeem/src/ext.rs index a1156eb7e9..e7ad363ca0 100644 --- a/crates/redeem/src/ext.rs +++ b/crates/redeem/src/ext.rs @@ -43,6 +43,20 @@ pub(crate) mod vault_registry { use frame_support::dispatch::{DispatchError, DispatchResult}; use vault_registry::types::{CurrencyId, CurrencySource, DefaultVault}; + pub fn cancel_replace_tokens( + old_vault_id: &DefaultVaultId, + new_vault_id: &DefaultVaultId, + tokens: &Amount, + ) -> DispatchResult { + >::cancel_replace_tokens(old_vault_id, new_vault_id, tokens) + } + + pub fn requestable_to_be_replaced_tokens( + vault_id: &DefaultVaultId, + ) -> Result, DispatchError> { + >::requestable_to_be_replaced_tokens(vault_id) + } + pub fn get_liquidated_collateral( vault_id: &DefaultVaultId, ) -> Result, DispatchError> { @@ -159,13 +173,6 @@ pub(crate) mod vault_registry { pub fn issue_tokens(vault_id: &DefaultVaultId, amount: &Amount) -> DispatchResult { >::issue_tokens(vault_id, amount) } - - pub fn decrease_to_be_replaced_tokens( - vault_id: &DefaultVaultId, - tokens: &Amount, - ) -> Result<(Amount, Amount), DispatchError> { - >::decrease_to_be_replaced_tokens(vault_id, tokens) - } } #[cfg_attr(test, mockable)] @@ -227,3 +234,37 @@ pub(crate) mod fee { >::get_premium_redeem_fee(amount) } } + +#[cfg_attr(test, mockable)] +pub(crate) mod issue { + use crate::{types::BalanceOf, DefaultVaultId, DispatchError}; + use bitcoin::Address; + use primitives::AccountOrVault; + use sp_core::H256; + use vault_registry::types::CurrencyId; + + pub fn request_vault_issue( + requester: AccountOrVault, + amount_requested: BalanceOf, + vault_id: DefaultVaultId, + griefing_currency: CurrencyId, + ) -> Result<(H256, Address), DispatchError> { + >::_request_issue(requester, amount_requested, vault_id, griefing_currency) + } + + pub fn complete_vault_issue(issue_id: H256) -> Result<(), DispatchError> { + >::_complete_vault_issue(issue_id) + } + + pub fn get_vault_from_id_from_issue_id( + issue_id: &H256, + ) -> Result, DispatchError> { + >::get_vault_from_id_from_issue_id(issue_id) + } + + pub fn cancel_issue_request_and_slash_collateral( + issue_id: &H256, + ) -> Result, DispatchError> { + >::cancel_issue_request_and_slash_collateral(issue_id) + } +} diff --git a/crates/redeem/src/lib.rs b/crates/redeem/src/lib.rs index ffd3acc3f3..93c24f9573 100644 --- a/crates/redeem/src/lib.rs +++ b/crates/redeem/src/lib.rs @@ -51,6 +51,7 @@ use vault_registry::{ }; pub use pallet::*; +use primitives::{AccountOrVault, VaultId}; /// Complexity: /// - `O(H + I + O + B)` where: @@ -78,13 +79,15 @@ pub mod pallet { use super::*; use frame_support::pallet_prelude::*; use frame_system::pallet_prelude::*; - use primitives::VaultId; + use primitives::{AccountOrVault, VaultId}; use vault_registry::types::DefaultVaultCurrencyPair; /// ## Configuration /// The pallet's configuration trait. #[pallet::config] - pub trait Config: frame_system::Config + vault_registry::Config + btc_relay::Config + fee::Config { + pub trait Config: + frame_system::Config + vault_registry::Config + btc_relay::Config + fee::Config + issue::Config + { /// The overarching event type. type RuntimeEvent: From> + IsType<::RuntimeEvent>; @@ -124,6 +127,14 @@ pub mod pallet { slashed_amount: BalanceOf, status: RedeemRequestStatus, }, + CancelReplace { + redeem_id: H256, + issue_id: H256, + old_vault: DefaultVaultId, + new_vault: DefaultVaultId, + slashed_amount: BalanceOf, + status: RedeemRequestStatus, + }, MintTokensForReimbursedRedeem { redeem_id: H256, vault_id: DefaultVaultId, @@ -159,6 +170,8 @@ pub mod pallet { TryIntoIntError, /// Redeem amount is too small. AmountBelowDustAmount, + /// Invalid Cancel request. + InvalidCancelRequest, } /// The time difference in number of blocks between a redeem request is created and required completion time by a @@ -181,6 +194,11 @@ pub mod pallet { #[pallet::getter(fn redeem_btc_dust_value)] pub(super) type RedeemBtcDustValue = StorageValue<_, BalanceOf, ValueQuery>; + /// This mapping provides an access from a unique hash redeemId to a issueId hash + #[pallet::storage] + #[pallet::getter(fn redeem_issue_requests)] + pub(super) type Requests = StorageMap<_, Blake2_128Concat, H256, H256, OptionQuery>; + /// the expected size in bytes of the redeem bitcoin transfer #[pallet::storage] #[pallet::getter(fn redeem_transaction_size)] @@ -250,8 +268,8 @@ pub mod pallet { btc_address: BtcAddress, vault_id: DefaultVaultId, ) -> DispatchResultWithPostInfo { - let redeemer = ensure_signed(origin)?; - Self::_request_redeem(redeemer, amount_wrapped, btc_address, vault_id)?; + let redeemer = AccountOrVault::Account(ensure_signed(origin)?); + Self::_request_redeem(redeemer, amount_wrapped, btc_address, vault_id, None)?; Ok(().into()) } @@ -385,6 +403,43 @@ pub mod pallet { Ok(().into()) } + + /// Request a replace operation for a vault + /// + /// ## Parameters + /// + /// - `origin`: The origin from which the request is made, typically the vault owner. + /// - `currency_pair`: The trading pair associated with the collateral and backing assets. + /// - `amount`: The amount of backed asset to be replaced. + /// - `new_vault_id`: The identifier of the new vault that will replace the existing vault. + /// - `griefing_currency`: The currency in which a griefing deposit is required for the replace. + /// + /// ## Returns + /// + /// If the replace operation is successful, this function returns `Ok`. If the operation fails, + /// an appropriate error indicating the reason for failure is returned. + #[pallet::call_index(7)] + #[pallet::weight(::WeightInfo::request_replace())] + #[transactional] + pub fn request_replace( + origin: OriginFor, + currency_pair: DefaultVaultCurrencyPair, + amount: BalanceOf, + new_vault_id: DefaultVaultId, + griefing_currency: CurrencyId, + ) -> DispatchResultWithPostInfo { + let old_vault_account = ensure_signed(origin)?; + + Self::_request_replace( + old_vault_account, + currency_pair, + amount, + new_vault_id, + griefing_currency, + )?; + + Ok(().into()) + } } } @@ -462,33 +517,79 @@ mod self_redeem { &vault_id.account_id, )?; - Pallet::::release_replace_collateral(vault_id, consumed_issued_tokens)?; Ok(()) } } // "Internal" functions, callable by code. #[cfg_attr(test, mockable)] impl Pallet { + fn _request_replace( + old_vault_account: T::AccountId, + currency_pair: DefaultVaultCurrencyPair, + amount: BalanceOf, + new_vault_id: DefaultVaultId, + griefing_currency: CurrencyId, + ) -> Result<(), DispatchError> { + // Create VaultId for the old vault + let old_vault_id = VaultId::new( + old_vault_account.clone(), + currency_pair.collateral, + currency_pair.wrapped, + ); + + // Define old and new vault references + let old_vault = AccountOrVault::Vault(old_vault_id.clone()); + let new_vault = AccountOrVault::Vault(new_vault_id.clone()); + + // Calculate requestable tokens for old vault + let max_requestable_tokens: Amount = + ext::vault_registry::requestable_to_be_replaced_tokens::(&old_vault_id)?; + let requestable_tokens = amount.min(max_requestable_tokens.amount()); + + // Initiate issue call + let (issue_id, btc_address) = ext::issue::request_vault_issue::( + old_vault.clone(), + requestable_tokens, + new_vault_id.clone(), + griefing_currency, + )?; + + // Initiate redeem call + let redeem_id = + Self::_request_redeem(new_vault, requestable_tokens, btc_address, old_vault_id, Some(issue_id))?; + + // Store the request IDs + Self::insert_request(&redeem_id, &issue_id); + + Ok(()) + } + fn _request_redeem( - redeemer: T::AccountId, + redeemer: AccountOrVault, amount_wrapped: BalanceOf, btc_address: BtcAddress, vault_id: DefaultVaultId, + issue_id: Option, ) -> Result { let amount_wrapped = Amount::new(amount_wrapped, vault_id.wrapped_currency()); - let redeemer_balance = ext::treasury::get_balance::(&redeemer, vault_id.wrapped_currency()); - ensure!( - amount_wrapped.le(&redeemer_balance)?, - Error::::AmountExceedsUserBalance - ); + // if redeemer is vault then it's a replace request, skip wrapped tokens balance check for + // it + if !redeemer.is_vault_account() { + let redeemer_balance = + ext::treasury::get_balance::(&redeemer.get_account(), vault_id.wrapped_currency()); + ensure!( + amount_wrapped.le(&redeemer_balance)?, + Error::::AmountExceedsUserBalance + ); + } // We saw a user lose bitcoin when they forgot to enter the address in the polkadot-js ui. // Make sure this can't happen again. ensure!(!btc_address.is_zero(), btc_relay::Error::::InvalidBtcHash); // todo: currently allowed to redeem from one currency to the other for free - decide if this is desirable - let fee_wrapped = if redeemer == vault_id.account_id { + let fee_wrapped = if redeemer.get_account().clone() == vault_id.account_id { Amount::zero(vault_id.wrapped_currency()) } else { ext::fee::get_redeem_fee::(&amount_wrapped)? @@ -511,12 +612,16 @@ impl Pallet { Error::::AmountBelowDustAmount ); - // vault will get rid of the btc + btc_inclusion_fee - ext::vault_registry::try_increase_to_be_redeemed_tokens::(&vault_id, &vault_to_be_burned_tokens)?; + if redeemer.is_vault_account() { + // increased the to_be_redeem tokens by amount_wrapped since a request replace + ext::vault_registry::try_increase_to_be_redeemed_tokens::(&vault_id, &amount_wrapped)?; + } else { + // vault will get rid of the btc + btc_inclusion_fee + ext::vault_registry::try_increase_to_be_redeemed_tokens::(&vault_id, &vault_to_be_burned_tokens)?; + amount_wrapped.lock_on(redeemer.get_account())?; + } - // lock full amount (inc. fee) - amount_wrapped.lock_on(&redeemer)?; - let redeem_id = ext::security::get_secure_id::(&redeemer); + let redeem_id = ext::security::get_secure_id::(redeemer.get_account()); let below_premium_redeem = ext::vault_registry::is_vault_below_premium_threshold::(&vault_id)?; let currency_id = vault_id.collateral_currency(); @@ -528,7 +633,11 @@ impl Pallet { Amount::zero(currency_id) }; - Self::release_replace_collateral(&vault_id, &vault_to_be_burned_tokens)?; + let to_be_received_btc = if redeemer.is_vault_account() { + amount_wrapped.amount() + } else { + user_to_be_received_btc.amount() + }; Self::insert_redeem_request( &redeem_id, @@ -537,20 +646,21 @@ impl Pallet { opentime: ext::security::active_block_number::(), fee: fee_wrapped.amount(), transfer_fee_btc: inclusion_fee.amount(), - amount_btc: user_to_be_received_btc.amount(), + amount_btc: to_be_received_btc, premium: premium_collateral.amount(), period: Self::redeem_period(), - redeemer: redeemer.clone(), + redeemer: redeemer.get_account().clone(), btc_address, btc_height: ext::btc_relay::get_best_block_height::(), status: RedeemRequestStatus::Pending, + issue_id, }, ); Self::deposit_event(Event::::RequestRedeem { redeem_id, - redeemer, - amount: user_to_be_received_btc.amount(), + redeemer: redeemer.get_account().clone(), + amount: to_be_received_btc, fee: fee_wrapped.amount(), premium: premium_collateral.amount(), vault_id, @@ -598,17 +708,34 @@ impl Pallet { redeem_id, )?; - // burn amount (without parachain fee, but including transfer fee) - let burn_amount = redeem.amount_btc().checked_add(&redeem.transfer_fee_btc())?; - burn_amount.burn_from(&redeem.redeemer)?; + if redeem.is_redeem_a_replace_request() { + //redeem tokens for old vault + ext::vault_registry::redeem_tokens::( + &redeem.vault, + &redeem.amount_btc(), + &redeem.premium()?, + &redeem.redeemer, + )?; + + // get issue_id from redeem_id + let issue_id = >::get(redeem_id).ok_or(Error::::RedeemIdNotFound)?; - // send fees to pool - let fee = redeem.fee(); - fee.unlock_on(&redeem.redeemer)?; - fee.transfer(&redeem.redeemer, &ext::fee::fee_pool_account_id::())?; - ext::fee::distribute_rewards::(&fee)?; + // complete_vault_issue increases issued_tokens & decreases to_be_issued for new vault + ext::issue::complete_vault_issue::(issue_id)?; + } else { + // burn amount (without parachain fee, but including transfer fee) + let burn_amount = redeem.amount_btc().checked_add(&redeem.transfer_fee_btc())?; + burn_amount.burn_from(&redeem.redeemer)?; - ext::vault_registry::redeem_tokens::(&redeem.vault, &burn_amount, &redeem.premium()?, &redeem.redeemer)?; + // send fees to pool + let fee = redeem.fee(); + fee.unlock_on(&redeem.redeemer)?; + fee.transfer(&redeem.redeemer, &ext::fee::fee_pool_account_id::())?; + ext::fee::distribute_rewards::(&fee)?; + + //redeem tokens for vault + ext::vault_registry::redeem_tokens::(&redeem.vault, &burn_amount, &redeem.premium()?, &redeem.redeemer)?; + } Self::set_redeem_status(redeem_id, RedeemRequestStatus::Completed); Self::deposit_event(Event::::ExecuteRedeem { @@ -622,7 +749,7 @@ impl Pallet { Ok(()) } - fn _cancel_redeem(redeemer: T::AccountId, redeem_id: H256, reimburse: bool) -> DispatchResult { + fn _cancel_redeem_request(redeemer: T::AccountId, redeem_id: H256, reimburse: bool) -> DispatchResult { let redeem = Self::get_open_redeem_request_from_id(&redeem_id)?; ensure!(redeemer == redeem.redeemer, Error::::UnauthorizedRedeemer); @@ -732,6 +859,62 @@ impl Pallet { Ok(()) } + // Cancels a redeem request, replaces it with a new issue request, adjusts vault balances, and + // updates the system state. + fn _cancel_replace_request(redeem_id: H256, issue_id: H256) -> DispatchResult { + let redeem = Self::get_open_redeem_request_from_id(&redeem_id)?; + + // only cancellable after the request has expired + ensure!( + ext::btc_relay::has_request_expired::( + redeem.opentime, + redeem.btc_height, + Self::redeem_period().max(redeem.period) + )?, + Error::::TimeNotExpired + ); + + let old_vault_id = &redeem.vault; + let new_vault_id = ext::issue::get_vault_from_id_from_issue_id::(&issue_id)?; + + // decrease old-vault's to-be-redeemed tokens, and + // decrease new-vault's to-be-issued tokens + ext::vault_registry::cancel_replace_tokens::(&old_vault_id, &new_vault_id, &redeem.amount_btc())?; + + // cancel issue request and slash collateral + let slashed_amount = ext::issue::cancel_issue_request_and_slash_collateral::(&issue_id)?; + + // Set the status of the redeem request to "Cancelled" + Self::set_redeem_status(redeem_id, RedeemRequestStatus::Cancelled); + + // release event + Self::deposit_event(Event::::CancelReplace { + redeem_id, + issue_id, + old_vault: old_vault_id.clone(), + new_vault: new_vault_id.clone(), + slashed_amount, + status: RedeemRequestStatus::Cancelled, + }); + + Ok(()) + } + + fn _cancel_redeem(redeemer: T::AccountId, redeem_id: H256, reimburse: bool) -> DispatchResult { + // Retrieve the request associated with the redeem_id + let request = >::get(redeem_id); + + if request.is_none() { + // If there's no associated request, cancel the redeem request + Self::_cancel_redeem_request(redeemer, redeem_id, reimburse) + } else { + // If there's an associated request, retrieve its issue_id + let issue_id = request.ok_or(Error::::InvalidCancelRequest)?; + // Cancel the replace request using the redeem_id and issue_id + Self::_cancel_replace_request(redeem_id, issue_id) + } + } + fn _mint_tokens_for_reimbursed_redeem(vault_id: DefaultVaultId, redeem_id: H256) -> DispatchResult { let redeem = RedeemRequests::::try_get(&redeem_id).or(Err(Error::::RedeemIdNotFound))?; ensure!( @@ -758,22 +941,14 @@ impl Pallet { Ok(()) } - fn release_replace_collateral(vault_id: &DefaultVaultId, burned_tokens: &Amount) -> DispatchResult { - // decrease to-be-replaced tokens - when the vault requests tokens to be replaced, it - // want to get rid of tokens, and it does not matter whether this is through a redeem, - // or a replace. As such, we decrease the to-be-replaced tokens here. This call will - // never fail due to insufficient to-be-replaced tokens - let (_, griefing_collateral) = - ext::vault_registry::decrease_to_be_replaced_tokens::(&vault_id, &burned_tokens)?; - // release the griefing collateral that is locked for the replace request - if !griefing_collateral.is_zero() { - ext::vault_registry::transfer_funds( - CurrencySource::AvailableReplaceCollateral(vault_id.clone()), - CurrencySource::FreeBalance(vault_id.account_id.clone()), - &griefing_collateral, - )?; - } - Ok(()) + /// Insert a new request replace. + /// + /// # Arguments + /// + /// * `key` - 256-bit identifier of the redeem request + /// * `value` - 256-bit identifier of the issue request + fn insert_request(key: &H256, value: &H256) { + >::insert(key, value); } /// Insert a new redeem request into state. @@ -850,7 +1025,7 @@ impl Pallet { match request.status { RedeemRequestStatus::Pending => Ok(request), RedeemRequestStatus::Completed => Err(Error::::RedeemCompleted.into()), - RedeemRequestStatus::Reimbursed(_) | RedeemRequestStatus::Retried => { + RedeemRequestStatus::Reimbursed(_) | RedeemRequestStatus::Retried | RedeemRequestStatus::Cancelled => { Err(Error::::RedeemCancelled.into()) } } diff --git a/crates/redeem/src/mock.rs b/crates/redeem/src/mock.rs index 1f1294819d..9c4b7ea658 100644 --- a/crates/redeem/src/mock.rs +++ b/crates/redeem/src/mock.rs @@ -15,7 +15,7 @@ pub use sp_arithmetic::{FixedI128, FixedPointNumber, FixedU128}; use sp_core::H256; use sp_runtime::{ testing::{Header, TestXt}, - traits::{BlakeTwo256, IdentityLookup, Zero}, + traits::{BlakeTwo256, Convert, IdentityLookup, Zero}, }; type TestExtrinsic = TestXt; @@ -49,6 +49,7 @@ frame_support::construct_runtime!( Currency: currency::{Pallet}, Nomination: nomination::{Pallet, Call, Config, Storage, Event}, Loans: loans::{Pallet, Storage, Call, Event, Config}, + Issue: issue::{Pallet, Call, Config, Storage, Event}, } ); @@ -269,6 +270,25 @@ impl loans::Config for Test { type OnExchangeRateChange = (); } +parameter_types! { + pub const TreasuryPalletId: PalletId = PalletId(*b"mod/trsy"); +} + +pub struct BlockNumberToBalance; + +impl Convert for BlockNumberToBalance { + fn convert(a: BlockNumber) -> Balance { + a.into() + } +} + +impl issue::Config for Test { + type TreasuryPalletId = TreasuryPalletId; + type RuntimeEvent = RuntimeEvent; + type BlockNumberToBalance = BlockNumberToBalance; + type WeightInfo = (); +} + impl Config for Test { type RuntimeEvent = RuntimeEvent; type WeightInfo = (); @@ -288,6 +308,23 @@ pub const VAULT: VaultId = VaultId { }; pub const CAROL: AccountId = 3; +pub const OLD_VAULT: VaultId = VaultId { + account_id: 4, + currencies: VaultCurrencyPair { + collateral: DEFAULT_COLLATERAL_CURRENCY, + wrapped: DEFAULT_WRAPPED_CURRENCY, + }, +}; +pub const NEW_VAULT: VaultId = VaultId { + account_id: 5, + currencies: VaultCurrencyPair { + collateral: DEFAULT_COLLATERAL_CURRENCY, + wrapped: DEFAULT_WRAPPED_CURRENCY, + }, +}; + +pub const OLD_VAULT_BALANCE: u128 = 1_000_000; +pub const NEW_VAULT_BALANCE: u128 = 1_000_000; pub const ALICE_BALANCE: u128 = 1_005_000; pub const VAULT_BALANCE: u128 = 1_005_000; pub const CAROL_BALANCE: u128 = 1_005_000; @@ -367,6 +404,8 @@ impl ExtBuilder { (USER, Token(IBTC), ALICE_BALANCE), (VAULT.account_id, Token(IBTC), VAULT_BALANCE), (CAROL, Token(IBTC), CAROL_BALANCE), + (OLD_VAULT.account_id, Token(DOT), OLD_VAULT_BALANCE), + (NEW_VAULT.account_id, Token(DOT), NEW_VAULT_BALANCE), ], }) } diff --git a/crates/redeem/src/tests.rs b/crates/redeem/src/tests.rs index c31a0afd15..45596376b8 100644 --- a/crates/redeem/src/tests.rs +++ b/crates/redeem/src/tests.rs @@ -15,9 +15,6 @@ type Event = crate::Event; fn collateral(amount: u128) -> Amount { Amount::new(amount, DEFAULT_COLLATERAL_CURRENCY) } -fn griefing(amount: u128) -> Amount { - Amount::new(amount, DEFAULT_NATIVE_CURRENCY) -} fn wrapped(amount: u128) -> Amount { Amount::new(amount, DEFAULT_WRAPPED_CURRENCY) } @@ -43,12 +40,9 @@ fn inject_redeem_request(key: H256, value: RedeemRequest DefaultVault { vault_registry::Vault { id: VAULT, - to_be_replaced_tokens: 0, to_be_issued_tokens: 0, issued_tokens: 10, - replace_collateral: 0, to_be_redeemed_tokens: 0, - active_replace_collateral: 0, banned_until: None, secure_collateral_threshold: None, status: VaultStatus::Active(true), @@ -77,12 +71,9 @@ fn test_request_redeem_fails_with_amount_below_minimum() { &VAULT, vault_registry::Vault { id: VAULT, - to_be_replaced_tokens: 0, to_be_issued_tokens: 0, issued_tokens: 10, - replace_collateral: 0, to_be_redeemed_tokens: 0, - active_replace_collateral: 0, banned_until: None, secure_collateral_threshold: None, status: VaultStatus::Active(true), @@ -149,12 +140,9 @@ fn test_request_redeem_succeeds_with_normal_redeem() { &VAULT, vault_registry::Vault { id: VAULT, - to_be_replaced_tokens: 0, to_be_issued_tokens: 0, issued_tokens: 10, to_be_redeemed_tokens: 0, - replace_collateral: 0, - active_replace_collateral: 0, banned_until: None, secure_collateral_threshold: None, status: VaultStatus::Active(true), @@ -221,6 +209,7 @@ fn test_request_redeem_succeeds_with_normal_redeem() { transfer_fee_btc: Redeem::get_current_inclusion_fee(DEFAULT_WRAPPED_CURRENCY) .unwrap() .amount(), + issue_id: None, } ); }) @@ -254,12 +243,9 @@ fn test_request_redeem_succeeds_with_self_redeem() { &VAULT, vault_registry::Vault { id: VAULT, - to_be_replaced_tokens: 0, to_be_issued_tokens: 0, issued_tokens: 10, to_be_redeemed_tokens: 0, - active_replace_collateral: 0, - replace_collateral: 0, banned_until: None, secure_collateral_threshold: None, status: VaultStatus::Active(true), @@ -324,6 +310,7 @@ fn test_request_redeem_succeeds_with_self_redeem() { transfer_fee_btc: Redeem::get_current_inclusion_fee(DEFAULT_WRAPPED_CURRENCY) .unwrap() .amount(), + issue_id: None, } ); }) @@ -395,12 +382,9 @@ fn test_execute_redeem_succeeds_with_another_account() { &VAULT, vault_registry::Vault { id: VAULT, - to_be_replaced_tokens: 0, to_be_issued_tokens: 0, issued_tokens: 200, to_be_redeemed_tokens: 200, - replace_collateral: 0, - active_replace_collateral: 0, banned_until: None, secure_collateral_threshold: None, status: VaultStatus::Active(true), @@ -426,6 +410,7 @@ fn test_execute_redeem_succeeds_with_another_account() { btc_height: 0, status: RedeemRequestStatus::Pending, transfer_fee_btc: btc_fee.amount(), + issue_id: None, }, ); @@ -472,12 +457,9 @@ fn test_execute_redeem_succeeds() { &VAULT, vault_registry::Vault { id: VAULT, - to_be_replaced_tokens: 0, to_be_issued_tokens: 0, issued_tokens: 200, to_be_redeemed_tokens: 200, - replace_collateral: 0, - active_replace_collateral: 0, banned_until: None, secure_collateral_threshold: None, status: VaultStatus::Active(true), @@ -503,6 +485,7 @@ fn test_execute_redeem_succeeds() { btc_height: 0, status: RedeemRequestStatus::Pending, transfer_fee_btc: btc_fee.amount(), + issue_id: None, }, ); @@ -570,6 +553,7 @@ fn test_cancel_redeem_fails_with_time_not_expired() { transfer_fee_btc: Redeem::get_current_inclusion_fee(DEFAULT_WRAPPED_CURRENCY) .unwrap() .amount(), + issue_id: None, })) }); @@ -600,6 +584,7 @@ fn test_cancel_redeem_fails_with_unauthorized_caller() { transfer_fee_btc: Redeem::get_current_inclusion_fee(DEFAULT_WRAPPED_CURRENCY) .unwrap() .amount(), + issue_id: None, })) }); @@ -629,6 +614,7 @@ fn test_cancel_redeem_succeeds() { transfer_fee_btc: Redeem::get_current_inclusion_fee(DEFAULT_WRAPPED_CURRENCY) .unwrap() .amount(), + issue_id: None, }, ); @@ -685,6 +671,7 @@ fn test_mint_tokens_for_reimbursed_redeem() { btc_height: 0, status: RedeemRequestStatus::Reimbursed(false), transfer_fee_btc: 1, + issue_id: None, }; let redeem_request_clone = redeem_request.clone(); inject_redeem_request(H256([0u8; 32]), redeem_request.clone()); @@ -742,6 +729,143 @@ fn test_set_redeem_period_only_root() { }) } +mod redeem_replace_tests { + use super::*; + + fn setup_mocks() { + ext::vault_registry::ensure_not_banned::.mock_safe(|_| MockResult::Return(Ok(()))); + ext::vault_registry::requestable_to_be_replaced_tokens:: + .mock_safe(move |_| MockResult::Return(Ok(wrapped(1000000)))); + ext::vault_registry::transfer_funds::.mock_safe(|_, _, _| MockResult::Return(Ok(()))); + ext::vault_registry::try_increase_to_be_redeemed_tokens:: + .mock_safe(move |_vault_id, _amount| MockResult::Return(Ok(()))); + ext::security::get_secure_id::.mock_safe(move |_| MockResult::Return(H256([0; 32]))); + ext::vault_registry::is_vault_below_premium_threshold:: + .mock_safe(move |_vault_id| MockResult::Return(Ok(false))); + } + + fn setup_execute_redeem() { + let btc_address = BtcAddress::random(); + let request_btc_address = btc_address.clone(); + + ext::issue::request_vault_issue:: + .mock_safe(move |_, _, _, _| MockResult::Return(Ok((H256([1; 32]), request_btc_address)))); + ext::issue::complete_vault_issue::.mock_safe(move |_| MockResult::Return(Ok(()))); + ext::btc_relay::verify_and_validate_op_return_transaction:: + .mock_safe(|_, _, _, _| MockResult::Return(Ok(()))); + ext::btc_relay::has_request_expired::.mock_safe(|_, _, _| MockResult::Return(Ok(true))); + ext::issue::get_vault_from_id_from_issue_id::.mock_safe(|_| MockResult::Return(Ok(NEW_VAULT))); + ext::vault_registry::cancel_replace_tokens::.mock_safe(|_, _, _| MockResult::Return(Ok(()))); + ext::issue::cancel_issue_request_and_slash_collateral::.mock_safe(|_| MockResult::Return(Ok(1))); + + let amount = 10; + assert_ok!(Redeem::request_replace( + RuntimeOrigin::signed(OLD_VAULT.account_id), + OLD_VAULT.currencies, + amount, + NEW_VAULT, + DEFAULT_NATIVE_CURRENCY + )); + + ext::vault_registry::redeem_tokens::.mock_safe(move |vault, amount_wrapped, premium, redeemer| { + assert_eq!(vault, &OLD_VAULT); + assert_eq!(amount_wrapped, &wrapped(amount)); + assert_eq!(premium, &collateral(0)); + assert_eq!(redeemer, &NEW_VAULT.account_id); + MockResult::Return(Ok(())) + }); + } + + #[test] + fn test_request_replace() { + run_test(|| { + setup_mocks(); + let btc_address = BtcAddress::random(); + let request_btc_address = btc_address.clone(); + + ext::issue::request_vault_issue:: + .mock_safe(move |_, _, _, _| MockResult::Return(Ok((H256([1; 32]), request_btc_address)))); + + let amount = 10; + assert_ok!(Redeem::request_replace( + RuntimeOrigin::signed(OLD_VAULT.account_id), + OLD_VAULT.currencies, + amount, + NEW_VAULT, + DEFAULT_NATIVE_CURRENCY + )); + + assert_emitted!(Event::RequestRedeem { + redeem_id: H256([0; 32]), + redeemer: NEW_VAULT.account_id, + amount: amount, + fee: 0, + premium: 0, + vault_id: OLD_VAULT, + btc_address, + transfer_fee: Redeem::get_current_inclusion_fee(DEFAULT_WRAPPED_CURRENCY) + .unwrap() + .amount() + }); + }) + } + + #[test] + fn test_execute_redeem_for_replace() { + run_test(|| { + setup_mocks(); + setup_execute_redeem(); + + // call execute redeem + assert_ok!(Redeem::_execute_redeem( + H256([0u8; 32]), + get_some_unchecked_transaction() + )); + + assert_emitted!(Event::ExecuteRedeem { + redeem_id: H256([0; 32]), + redeemer: NEW_VAULT.account_id, + vault_id: OLD_VAULT, + amount: 10, + fee: 0, + transfer_fee: Redeem::get_current_inclusion_fee(DEFAULT_WRAPPED_CURRENCY) + .unwrap() + .amount(), + }); + + assert_err!( + Redeem::get_open_redeem_request_from_id(&H256([0u8; 32])), + TestError::RedeemCompleted, + ); + }); + } + + #[test] + fn test_cancel_replace_redeem_request() { + run_test(|| { + setup_mocks(); + setup_execute_redeem(); + + // call cancel redeem + assert_ok!(Redeem::_cancel_redeem(USER, H256([0; 32]), true,)); + + assert_emitted!(Event::CancelReplace { + redeem_id: H256([0; 32]), + issue_id: H256([1; 32]), + old_vault: OLD_VAULT, + new_vault: NEW_VAULT, + slashed_amount: 1, + status: RedeemRequestStatus::Cancelled, + }); + + assert_err!( + Redeem::get_open_redeem_request_from_id(&H256([0u8; 32])), + TestError::RedeemCancelled, + ); + }) + } +} + mod spec_based_tests { use super::*; @@ -762,14 +886,6 @@ mod spec_based_tests { .mock_safe(move |_vault_id, _amount| MockResult::Return(Ok(()))); ext::vault_registry::is_vault_below_premium_threshold:: .mock_safe(move |_vault_id| MockResult::Return(Ok(false))); - let redeem_fee = Fee::get_redeem_fee(&wrapped(amount_to_redeem)).unwrap(); - let burned_tokens = wrapped(amount_to_redeem) - redeem_fee; - - ext::vault_registry::decrease_to_be_replaced_tokens::.mock_safe(move |vault_id, tokens| { - assert_eq!(vault_id, &VAULT); - assert_eq!(tokens, &burned_tokens); - MockResult::Return(Ok((wrapped(0), griefing(0)))) - }); // The returned `replaceCollateral` MUST be released currency::Amount::unlock_on.mock_safe(move |collateral_amount, vault_id| { @@ -831,11 +947,9 @@ mod spec_based_tests { &VAULT, vault_registry::Vault { id: VAULT, - to_be_replaced_tokens: 0, to_be_issued_tokens: 0, issued_tokens: 200, to_be_redeemed_tokens: 200, - replace_collateral: 0, banned_until: None, status: VaultStatus::Active(true), ..default_vault() @@ -857,6 +971,7 @@ mod spec_based_tests { btc_height: 0, status: RedeemRequestStatus::Pending, transfer_fee_btc: btc_fee.amount(), + issue_id: None, }; inject_redeem_request(H256([0u8; 32]), redeem_request.clone()); @@ -915,6 +1030,7 @@ mod spec_based_tests { transfer_fee_btc: Redeem::get_current_inclusion_fee(DEFAULT_WRAPPED_CURRENCY) .unwrap() .amount(), + issue_id: None, }; inject_redeem_request(H256([0u8; 32]), redeem_request.clone()); @@ -983,6 +1099,7 @@ mod spec_based_tests { transfer_fee_btc: Redeem::get_current_inclusion_fee(DEFAULT_WRAPPED_CURRENCY) .unwrap() .amount(), + issue_id: None, }; inject_redeem_request(H256([0u8; 32]), redeem_request.clone()); diff --git a/crates/replace/Cargo.toml b/crates/replace/Cargo.toml deleted file mode 100644 index 0ec5e8595f..0000000000 --- a/crates/replace/Cargo.toml +++ /dev/null @@ -1,94 +0,0 @@ -[package] -authors = ["Interlay Ltd"] -description = "Replace module" -edition = "2021" -name = "replace" -version = "1.2.0" - -[dependencies] -serde = { version = "1.0.130", default-features = false, features = ['derive'], optional = true } -codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false, features = ["derive", "max-encoded-len"] } -scale-info = { version = "2.2.0", default-features = false, features = ["derive"] } - -# Substrate dependencies -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false } -sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false } - -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false, optional = true } -pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false } - -# Parachain dependencies -bitcoin = { path = "../bitcoin", default-features = false } -btc-relay = { path = "../btc-relay", default-features = false } -oracle = { path = "../oracle", default-features = false } -fee = { path = "../fee", default-features = false } -security = { path = "../security", default-features = false } -currency = { path = "../currency", default-features = false } -vault-registry = { path = "../vault-registry", default-features = false } -nomination = { path = "../nomination", default-features = false } -primitives = { package = "interbtc-primitives", path = "../../primitives", default-features = false } - -# Orml dependencies -orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "dc39cfddefb10ef0de23655e2c3dcdab66a19404", default-features = false, optional = true } -orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "dc39cfddefb10ef0de23655e2c3dcdab66a19404", default-features = false, optional = true } - -[dev-dependencies] -mocktopus = "0.8.0" -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31" } - -# Parachain dependencies -reward = { path = "../reward" } -staking = { path = "../staking" } -currency = { path = "../currency", features = ["testing-utils"] } - -# Orml dependencies -orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "dc39cfddefb10ef0de23655e2c3dcdab66a19404" } -orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "dc39cfddefb10ef0de23655e2c3dcdab66a19404" } - -[features] -default = ["std"] -std = [ - "serde", - "codec/std", - - "sp-io/std", - "sp-core/std", - "sp-std/std", - "sp-arithmetic/std", - "sp-runtime/std", - - "frame-support/std", - "frame-system/std", - "frame-benchmarking/std", - "pallet-timestamp/std", - - "bitcoin/std", - "btc-relay/std", - "oracle/std", - "fee/std", - "security/std", - "currency/std", - "vault-registry/std", - "nomination/std", - "primitives/std", - - "orml-tokens/std", - "orml-traits/std", -] -runtime-benchmarks = [ - "frame-benchmarking", - "frame-support/runtime-benchmarks", - "frame-system/runtime-benchmarks", - - "bitcoin/runtime-benchmarks", - "btc-relay/runtime-benchmarks", - - "orml-tokens", - "orml-traits", -] -try-runtime = [ "frame-support/try-runtime" ] \ No newline at end of file diff --git a/crates/replace/rpc/Cargo.toml b/crates/replace/rpc/Cargo.toml deleted file mode 100644 index de81104efd..0000000000 --- a/crates/replace/rpc/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "replace-rpc" -version = "1.2.0" -authors = ["Interlay Ltd"] -edition = "2021" - -[dependencies] -codec = { package = "parity-scale-codec", version = "3.1.5" } -jsonrpsee = { version = "0.16.2", features = ["server", "macros"] } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31" } -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31" } -sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31" } -replace-rpc-runtime-api = { path = "runtime-api" } diff --git a/crates/replace/rpc/runtime-api/Cargo.toml b/crates/replace/rpc/runtime-api/Cargo.toml deleted file mode 100644 index 0fd66ee779..0000000000 --- a/crates/replace/rpc/runtime-api/Cargo.toml +++ /dev/null @@ -1,20 +0,0 @@ -[package] -name = "replace-rpc-runtime-api" -version = "1.2.0" -authors = ["Interlay Ltd"] -edition = "2021" - -[dependencies] -codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false, features = ["derive", "max-encoded-len"] } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false } -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.31", default-features = false } - -[features] -default = ["std"] -std = [ - "codec/std", - "frame-support/std", - "sp-api/std", - "sp-std/std", -] diff --git a/crates/replace/rpc/runtime-api/src/lib.rs b/crates/replace/rpc/runtime-api/src/lib.rs deleted file mode 100644 index e46d0d9782..0000000000 --- a/crates/replace/rpc/runtime-api/src/lib.rs +++ /dev/null @@ -1,20 +0,0 @@ -//! Runtime API definition for the Replace Module. - -#![cfg_attr(not(feature = "std"), no_std)] - -use codec::Codec; -use sp_std::vec::Vec; - -sp_api::decl_runtime_apis! { - pub trait ReplaceApi where - AccountId: Codec, - H256: Codec, - ReplaceRequest: Codec, - { - /// Get all replace requests from a particular vault - fn get_old_vault_replace_requests(vault_id: AccountId) -> Vec; - - /// Get all replace requests to a particular vault - fn get_new_vault_replace_requests(vault_id: AccountId) -> Vec; - } -} diff --git a/crates/replace/rpc/src/lib.rs b/crates/replace/rpc/src/lib.rs deleted file mode 100644 index fc9670781e..0000000000 --- a/crates/replace/rpc/src/lib.rs +++ /dev/null @@ -1,83 +0,0 @@ -//! RPC interface for the Replace Module. - -use codec::Codec; -use jsonrpsee::{ - core::{async_trait, Error as JsonRpseeError, RpcResult}, - proc_macros::rpc, - types::error::{CallError, ErrorCode, ErrorObject}, -}; -use sp_api::ProvideRuntimeApi; -use sp_blockchain::HeaderBackend; -use sp_runtime::traits::Block as BlockT; -use std::sync::Arc; - -pub use replace_rpc_runtime_api::ReplaceApi as ReplaceRuntimeApi; - -#[rpc(client, server)] -pub trait ReplaceApi { - #[method(name = "replace_getOldVaultReplaceRequests")] - fn get_old_vault_replace_requests(&self, vault_id: AccountId, at: Option) -> RpcResult>; - - #[method(name = "replace_getNewVaultReplaceRequests")] - fn get_new_vault_replace_requests(&self, vault_id: AccountId, at: Option) -> RpcResult>; -} - -fn internal_err(message: T) -> JsonRpseeError { - JsonRpseeError::Call(CallError::Custom(ErrorObject::owned( - ErrorCode::InternalError.code(), - message.to_string(), - None::<()>, - ))) -} - -/// A struct that implements the [`ReplaceApi`]. -pub struct Replace { - client: Arc, - _marker: std::marker::PhantomData, -} - -impl Replace { - /// Create new `Replace` with the given reference to the client. - pub fn new(client: Arc) -> Self { - Replace { - client, - _marker: Default::default(), - } - } -} - -#[async_trait] -impl - ReplaceApiServer<::Hash, AccountId, H256, ReplaceRequest> for Replace -where - Block: BlockT, - C: Send + Sync + 'static + ProvideRuntimeApi + HeaderBackend, - C::Api: ReplaceRuntimeApi, - AccountId: Codec, - H256: Codec, - ReplaceRequest: Codec, -{ - fn get_old_vault_replace_requests( - &self, - vault_id: AccountId, - at: Option<::Hash>, - ) -> RpcResult> { - let api = self.client.runtime_api(); - let at = at.unwrap_or_else(|| self.client.info().best_hash); - - api.get_old_vault_replace_requests(at, vault_id) - .map_err(|e| internal_err(format!("Unable to fetch replace requests: {:?}", e))) - } - - fn get_new_vault_replace_requests( - &self, - vault_id: AccountId, - at: Option<::Hash>, - ) -> RpcResult> { - let api = self.client.runtime_api(); - let at = at.unwrap_or_else(|| self.client.info().best_hash); - - api.get_new_vault_replace_requests(at, vault_id) - .map_err(|e| internal_err(format!("Unable to fetch replace requests: {:?}", e))) - } -} diff --git a/crates/replace/src/benchmarking.rs b/crates/replace/src/benchmarking.rs deleted file mode 100644 index 9d523d72a6..0000000000 --- a/crates/replace/src/benchmarking.rs +++ /dev/null @@ -1,332 +0,0 @@ -use super::*; -use bitcoin::types::TransactionOutput; -use btc_relay::{BtcAddress, BtcPublicKey}; -use currency::getters::{get_relay_chain_currency_id as get_collateral_currency_id, *}; -use frame_benchmarking::v2::*; -use frame_support::assert_ok; -use frame_system::RawOrigin; -use orml_traits::MultiCurrency; -use primitives::VaultId; -use sp_core::H256; -use sp_runtime::{traits::One, FixedPointNumber}; -use sp_std::{fmt::Debug, prelude::*}; - -// Pallets -use crate::Pallet as Replace; -use btc_relay::Pallet as BtcRelay; -use oracle::Pallet as Oracle; -use security::Pallet as Security; -use vault_registry::Pallet as VaultRegistry; - -fn test_request( - new_vault_id: &DefaultVaultId, - old_vault_id: &DefaultVaultId, -) -> DefaultReplaceRequest { - ReplaceRequest { - new_vault: new_vault_id.clone(), - old_vault: old_vault_id.clone(), - period: Default::default(), - accept_time: Default::default(), - amount: Default::default(), - griefing_collateral: 12345u32.into(), // non-zero to hit additional code paths - btc_address: BtcAddress::dummy(), - collateral: Default::default(), - btc_height: Default::default(), - status: Default::default(), - } -} - -fn get_vault_id(name: &'static str) -> DefaultVaultId { - VaultId::new( - account(name, 0, 0), - get_collateral_currency_id::(), - get_wrapped_currency_id::(), - ) -} - -fn register_vault(vault_id: &DefaultVaultId, issued_tokens: Amount, to_be_replaced: Amount) { - let origin = RawOrigin::Signed(vault_id.account_id.clone()); - - assert_ok!(>::deposit( - get_collateral_currency_id::(), - &vault_id.account_id, - (1u32 << 31).into() - )); - assert_ok!(>::deposit( - get_native_currency_id::(), - &vault_id.account_id, - (1u32 << 31).into() - )); - - assert_ok!(VaultRegistry::::register_public_key( - origin.into(), - BtcPublicKey::dummy() - )); - assert_ok!(VaultRegistry::::_register_vault( - vault_id.clone(), - 100000000u32.into() - )); - - VaultRegistry::::try_increase_to_be_issued_tokens(vault_id, &issued_tokens).unwrap(); - VaultRegistry::::issue_tokens(vault_id, &issued_tokens).unwrap(); - VaultRegistry::::try_increase_to_be_replaced_tokens(vault_id, &to_be_replaced).unwrap(); -} - -struct ChainState { - old_vault_id: DefaultVaultId, - new_vault_id: DefaultVaultId, - issued_tokens: Amount, - to_be_replaced: Amount, -} - -fn setup_chain() -> ChainState { - let new_vault_id = get_vault_id::("NewVault"); - let old_vault_id = get_vault_id::("OldVault"); - - Oracle::::_set_exchange_rate( - get_native_currency_id::(), // for griefing collateral - ::UnsignedFixedPoint::one(), - ) - .unwrap(); - Oracle::::_set_exchange_rate( - old_vault_id.collateral_currency(), - ::UnsignedFixedPoint::one(), - ) - .unwrap(); - - VaultRegistry::::set_minimum_collateral( - RawOrigin::Root.into(), - old_vault_id.collateral_currency(), - 100_000u32.into(), - ) - .unwrap(); - VaultRegistry::::_set_system_collateral_ceiling(old_vault_id.currencies.clone(), 1_000_000_000u32.into()); - - VaultRegistry::::_set_secure_collateral_threshold( - old_vault_id.currencies.clone(), - ::UnsignedFixedPoint::checked_from_rational(1, 100000).unwrap(), - ); - VaultRegistry::::_set_premium_redeem_threshold( - old_vault_id.currencies.clone(), - ::UnsignedFixedPoint::checked_from_rational(1, 200000).unwrap(), - ); - VaultRegistry::::_set_liquidation_collateral_threshold( - old_vault_id.currencies.clone(), - ::UnsignedFixedPoint::checked_from_rational(1, 300000).unwrap(), - ); - - let issued_tokens = Amount::new(200000u32.into(), old_vault_id.wrapped_currency()); - let to_be_replaced = issued_tokens.clone().map(|x| x / 4u32.into()); - - register_vault(&old_vault_id, issued_tokens.clone(), to_be_replaced.clone()); - register_vault(&new_vault_id, issued_tokens.clone(), to_be_replaced.clone()); - - ChainState { - old_vault_id, - new_vault_id, - issued_tokens, - to_be_replaced, - } -} - -fn setup_replace( - old_vault_id: &DefaultVaultId, - new_vault_id: &DefaultVaultId, - to_be_replaced: Amount, - hashes: u32, - vin: u32, - vout: u32, - tx_size: u32, -) -> (H256, FullTransactionProof) -where - <::Balance as TryInto>::Error: Debug, -{ - let replace_id = H256::zero(); - let mut replace_request = test_request::(&new_vault_id, &old_vault_id); - replace_request.amount = to_be_replaced.amount(); - Replace::::insert_replace_request(&replace_id, &replace_request); - - // simulate that the request has been accepted - VaultRegistry::::try_increase_to_be_redeemed_tokens(&old_vault_id, &to_be_replaced).unwrap(); - VaultRegistry::::try_increase_to_be_issued_tokens(&new_vault_id, &to_be_replaced).unwrap(); - - VaultRegistry::::transfer_funds( - CurrencySource::FreeBalance(old_vault_id.account_id.clone()), - CurrencySource::ActiveReplaceCollateral(old_vault_id.clone()), - &Amount::new(replace_request.griefing_collateral, get_native_currency_id::()), - ) - .unwrap(); - - let relayer_id: T::AccountId = account("Relayer", 0, 0); - assert_ok!(>::deposit( - get_collateral_currency_id::(), - &relayer_id, - (1u32 << 31).into() - )); - assert_ok!(>::deposit( - get_native_currency_id::(), - &relayer_id, - (1u32 << 31).into() - )); - - // we always need these outputs for replace - let mut outputs = vec![ - TransactionOutput::payment( - to_be_replaced.amount().try_into().unwrap(), - &replace_request.btc_address, - ), - TransactionOutput::op_return(0, replace_id.as_bytes()), - ]; - - // add return-to-self output - if vout == 3 { - outputs.push(TransactionOutput::payment( - 0u32.into(), - &BtcAddress::P2PKH(sp_core::H160::zero()), - )); - } - - let transaction = - BtcRelay::::initialize_and_store_max(relayer_id.clone(), hashes, vin, outputs, tx_size as usize); - - let period = Replace::::replace_period().max(replace_request.period); - let expiry_height = BtcRelay::::bitcoin_expiry_height(replace_request.btc_height, period).unwrap(); - - BtcRelay::::mine_blocks(&relayer_id, expiry_height + 100); - Security::::set_active_block_number( - Security::::active_block_number() + Replace::::replace_period() + 100u32.into(), - ); - - (replace_id, transaction) -} - -#[benchmarks( - where - <::Balance as TryInto>::Error: Debug, -)] -pub mod benchmarks { - use super::*; - - #[benchmark] - fn request_replace() { - let ChainState { - old_vault_id, - issued_tokens, - to_be_replaced, - .. - } = setup_chain::(); - - let amount = (issued_tokens.checked_sub(&to_be_replaced).unwrap()).amount(); - - #[extrinsic_call] - request_replace( - RawOrigin::Signed(old_vault_id.account_id.clone()), - old_vault_id.currencies.clone(), - amount, - ); - } - - #[benchmark] - fn withdraw_replace() { - let ChainState { - old_vault_id, - to_be_replaced, - .. - } = setup_chain::(); - - #[extrinsic_call] - withdraw_replace( - RawOrigin::Signed(old_vault_id.account_id.clone()), - old_vault_id.currencies.clone(), - to_be_replaced.amount(), - ); - } - - #[benchmark] - fn accept_replace() { - let ChainState { - old_vault_id, - new_vault_id, - to_be_replaced, - .. - } = setup_chain::(); - - let replace_id = H256::zero(); - let mut replace_request = test_request::(&new_vault_id, &old_vault_id); - replace_request.amount = to_be_replaced.amount(); - Replace::::insert_replace_request(&replace_id, &replace_request); - - let new_vault_btc_address = BtcAddress::dummy(); - let griefing = 100000000u32.into(); - - #[extrinsic_call] - accept_replace( - RawOrigin::Signed(new_vault_id.account_id.clone()), - new_vault_id.currencies.clone(), - old_vault_id, - to_be_replaced.amount(), - griefing, - new_vault_btc_address, - ); - } - - #[benchmark] - fn execute_pending_replace(h: Linear<2, 10>, i: Linear<1, 10>, o: Linear<2, 3>, b: Linear<541, 2_048>) { - let ChainState { - old_vault_id, - new_vault_id, - to_be_replaced, - .. - } = setup_chain::(); - let (replace_id, transaction) = setup_replace::(&old_vault_id, &new_vault_id, to_be_replaced, h, i, o, b); - - #[extrinsic_call] - execute_replace(RawOrigin::Signed(old_vault_id.account_id), replace_id, transaction); - } - - #[benchmark] - fn execute_cancelled_replace(h: Linear<2, 10>, i: Linear<1, 10>, o: Linear<2, 3>, b: Linear<541, 2_048>) { - let ChainState { - old_vault_id, - new_vault_id, - to_be_replaced, - .. - } = setup_chain::(); - let (replace_id, transaction) = setup_replace::(&old_vault_id, &new_vault_id, to_be_replaced, h, i, o, b); - - assert_ok!(Pallet::::cancel_replace( - RawOrigin::Signed(new_vault_id.account_id).into(), - replace_id - )); - - #[extrinsic_call] - execute_replace(RawOrigin::Signed(old_vault_id.account_id), replace_id, transaction); - } - - #[benchmark] - fn cancel_replace() { - let ChainState { - old_vault_id, - new_vault_id, - to_be_replaced, - .. - } = setup_chain::(); - - let (replace_id, _) = setup_replace::(&old_vault_id, &new_vault_id, to_be_replaced, 2, 2, 2, 541); - - #[extrinsic_call] - cancel_replace(RawOrigin::Signed(new_vault_id.account_id), replace_id); - } - - #[benchmark] - fn set_replace_period() { - #[extrinsic_call] - set_replace_period(RawOrigin::Root, 1u32.into()); - } - - impl_benchmark_test_suite! { - Replace, - crate::mock::ExtBuilder::build_with(Default::default()), - crate::mock::Test - } -} diff --git a/crates/replace/src/default_weights.rs b/crates/replace/src/default_weights.rs deleted file mode 100644 index 98f95ae651..0000000000 --- a/crates/replace/src/default_weights.rs +++ /dev/null @@ -1,596 +0,0 @@ - -//! Autogenerated weights for replace -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-03, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `enterprise`, CPU: `Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 - -// Executed Command: -// ./target/release/interbtc-parachain -// benchmark -// pallet -// --pallet -// replace -// --extrinsic -// * -// --chain -// kintsugi-dev -// --execution=wasm -// --wasm-execution=compiled -// --steps -// 50 -// --repeat -// 20 -// --output -// crates/replace/src/default_weights.rs -// --template -// .deploy/default-weight-template.hbs - -#![cfg_attr(rustfmt, rustfmt_skip)] -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use sp_std::marker::PhantomData; - -/// Weight functions needed for replace. -pub trait WeightInfo { - fn request_replace() -> Weight; - fn withdraw_replace() -> Weight; - fn accept_replace() -> Weight; - fn execute_pending_replace(h: u32, i: u32, o: u32, b: u32, ) -> Weight; - fn execute_cancelled_replace(h: u32, i: u32, o: u32, b: u32, ) -> Weight; - fn cancel_replace() -> Weight; - fn set_replace_period() -> Weight; -} - -/// Weights for replace using the Substrate node and recommended hardware. -pub struct SubstrateWeight(PhantomData); -impl WeightInfo for SubstrateWeight { - /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) - /// Storage: Nomination Vaults (r:1 w:0) - /// Proof: Nomination Vaults (max_values: None, max_size: Some(71), added: 2546, mode: MaxEncodedLen) - /// Storage: Replace ReplaceBtcDustValue (r:1 w:0) - /// Proof: Replace ReplaceBtcDustValue (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: Oracle Aggregate (r:1 w:0) - /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) - /// Storage: Fee ReplaceGriefingCollateral (r:1 w:0) - /// Proof: Fee ReplaceGriefingCollateral (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:1 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - fn request_replace() -> Weight { - // Proof Size summary in bytes: - // Measured: `2972` - // Estimated: `11908` - // Minimum execution time: 103_625_000 picoseconds. - Weight::from_parts(104_579_000, 11908) - .saturating_add(T::DbWeight::get().reads(7_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - } - /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) - fn withdraw_replace() -> Weight { - // Proof Size summary in bytes: - // Measured: `1760` - // Estimated: `2735` - // Minimum execution time: 55_362_000 picoseconds. - Weight::from_parts(56_367_000, 2735) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: VaultRegistry Vaults (r:2 w:2) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) - /// Storage: Replace ReplaceBtcDustValue (r:1 w:0) - /// Proof: Replace ReplaceBtcDustValue (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: VaultCapacity Stake (r:1 w:1) - /// Proof: VaultCapacity Stake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultCapacity RewardPerToken (r:2 w:0) - /// Proof: VaultCapacity RewardPerToken (max_values: None, max_size: Some(59), added: 2534, mode: MaxEncodedLen) - /// Storage: VaultCapacity RewardTally (r:2 w:2) - /// Proof: VaultCapacity RewardTally (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) - /// Storage: VaultCapacity TotalRewards (r:2 w:2) - /// Proof: VaultCapacity TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultRewards Stake (r:1 w:1) - /// Proof: VaultRewards Stake (max_values: None, max_size: Some(97), added: 2572, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardPerToken (r:2 w:0) - /// Proof: VaultRewards RewardPerToken (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardTally (r:2 w:2) - /// Proof: VaultRewards RewardTally (max_values: None, max_size: Some(124), added: 2599, mode: MaxEncodedLen) - /// Storage: VaultRewards TotalRewards (r:2 w:2) - /// Proof: VaultRewards TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Fee Commission (r:1 w:0) - /// Proof: Fee Commission (max_values: None, max_size: Some(86), added: 2561, mode: MaxEncodedLen) - /// Storage: VaultStaking Nonce (r:1 w:0) - /// Proof: VaultStaking Nonce (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) - /// Storage: VaultStaking TotalCurrentStake (r:1 w:1) - /// Proof: VaultStaking TotalCurrentStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultStaking RewardPerToken (r:2 w:2) - /// Proof: VaultStaking RewardPerToken (max_values: None, max_size: Some(117), added: 2592, mode: MaxEncodedLen) - /// Storage: VaultStaking Stake (r:1 w:1) - /// Proof: VaultStaking Stake (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) - /// Storage: VaultStaking SlashPerToken (r:1 w:0) - /// Proof: VaultStaking SlashPerToken (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultStaking SlashTally (r:1 w:1) - /// Proof: VaultStaking SlashTally (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) - /// Storage: VaultStaking TotalStake (r:1 w:1) - /// Proof: VaultStaking TotalStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultStaking RewardTally (r:2 w:2) - /// Proof: VaultStaking RewardTally (max_values: None, max_size: Some(149), added: 2624, mode: MaxEncodedLen) - /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) - /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: VaultRewards TotalStake (r:1 w:1) - /// Proof: VaultRewards TotalStake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardCurrencies (r:1 w:0) - /// Proof: VaultRewards RewardCurrencies (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: Oracle Aggregate (r:1 w:0) - /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) - /// Storage: VaultCapacity TotalStake (r:1 w:1) - /// Proof: VaultCapacity TotalStake (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) - /// Storage: VaultCapacity RewardCurrencies (r:1 w:0) - /// Proof: VaultCapacity RewardCurrencies (max_values: None, max_size: Some(127), added: 2602, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:1 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: VaultRegistry TotalUserVaultCollateral (r:1 w:1) - /// Proof: VaultRegistry TotalUserVaultCollateral (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: VaultRegistry SystemCollateralCeiling (r:1 w:0) - /// Proof: VaultRegistry SystemCollateralCeiling (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: Security Nonce (r:1 w:1) - /// Proof: Security Nonce (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: System ParentHash (r:1 w:0) - /// Proof: System ParentHash (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Replace ReplacePeriod (r:1 w:0) - /// Proof: Replace ReplacePeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlockHeight (r:1 w:0) - /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Replace ReplaceRequests (r:0 w:1) - /// Proof: Replace ReplaceRequests (max_values: None, max_size: Some(250), added: 2725, mode: MaxEncodedLen) - fn accept_replace() -> Weight { - // Proof Size summary in bytes: - // Measured: `5415` - // Estimated: `96083` - // Minimum execution time: 417_052_000 picoseconds. - Weight::from_parts(420_396_000, 96083) - .saturating_add(T::DbWeight::get().reads(43_u64)) - .saturating_add(T::DbWeight::get().writes(26_u64)) - } - /// Storage: Replace ReplaceRequests (r:1 w:1) - /// Proof: Replace ReplaceRequests (max_values: None, max_size: Some(250), added: 2725, mode: MaxEncodedLen) - /// Storage: BTCRelay DisableInclusionCheck (r:1 w:0) - /// Proof: BTCRelay DisableInclusionCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlockHeight (r:1 w:0) - /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay Chains (r:1 w:0) - /// Proof: BTCRelay Chains (max_values: None, max_size: Some(24), added: 2499, mode: MaxEncodedLen) - /// Storage: BTCRelay BlockHeaders (r:1 w:0) - /// Proof: BTCRelay BlockHeaders (max_values: None, max_size: Some(200), added: 2675, mode: MaxEncodedLen) - /// Storage: BTCRelay StableBitcoinConfirmations (r:1 w:0) - /// Proof: BTCRelay StableBitcoinConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay StableParachainConfirmations (r:1 w:0) - /// Proof: BTCRelay StableParachainConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: VaultRegistry Vaults (r:2 w:2) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:1 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// The range of component `h` is `[2, 10]`. - /// The range of component `i` is `[1, 10]`. - /// The range of component `o` is `[2, 3]`. - /// The range of component `b` is `[541, 2048]`. - fn execute_pending_replace(h: u32, _i: u32, _o: u32, _b: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `4990` - // Estimated: `18451` - // Minimum execution time: 143_961_000 picoseconds. - Weight::from_parts(191_182_902, 18451) - // Standard Error: 132_362 - .saturating_add(Weight::from_parts(961_843, 0).saturating_mul(h.into())) - .saturating_add(T::DbWeight::get().reads(11_u64)) - .saturating_add(T::DbWeight::get().writes(4_u64)) - } - /// Storage: Replace ReplaceRequests (r:1 w:1) - /// Proof: Replace ReplaceRequests (max_values: None, max_size: Some(250), added: 2725, mode: MaxEncodedLen) - /// Storage: BTCRelay DisableInclusionCheck (r:1 w:0) - /// Proof: BTCRelay DisableInclusionCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlockHeight (r:1 w:0) - /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay Chains (r:1 w:0) - /// Proof: BTCRelay Chains (max_values: None, max_size: Some(24), added: 2499, mode: MaxEncodedLen) - /// Storage: BTCRelay BlockHeaders (r:1 w:0) - /// Proof: BTCRelay BlockHeaders (max_values: None, max_size: Some(200), added: 2675, mode: MaxEncodedLen) - /// Storage: BTCRelay StableBitcoinConfirmations (r:1 w:0) - /// Proof: BTCRelay StableBitcoinConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay StableParachainConfirmations (r:1 w:0) - /// Proof: BTCRelay StableParachainConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: VaultRegistry Vaults (r:2 w:2) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) - /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) - /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: Oracle Aggregate (r:1 w:0) - /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) - /// Storage: VaultStaking Nonce (r:1 w:0) - /// Proof: VaultStaking Nonce (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) - /// Storage: VaultStaking TotalCurrentStake (r:1 w:0) - /// Proof: VaultStaking TotalCurrentStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// The range of component `h` is `[2, 10]`. - /// The range of component `i` is `[1, 10]`. - /// The range of component `o` is `[2, 3]`. - /// The range of component `b` is `[541, 2048]`. - fn execute_cancelled_replace(_h: u32, i: u32, _o: u32, b: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `5335` - // Estimated: `26535` - // Minimum execution time: 177_761_000 picoseconds. - Weight::from_parts(197_448_409, 26535) - // Standard Error: 42_163 - .saturating_add(Weight::from_parts(84_783, 0).saturating_mul(i.into())) - // Standard Error: 268 - .saturating_add(Weight::from_parts(3_017, 0).saturating_mul(b.into())) - .saturating_add(T::DbWeight::get().reads(15_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) - } - /// Storage: Replace ReplaceRequests (r:1 w:1) - /// Proof: Replace ReplaceRequests (max_values: None, max_size: Some(250), added: 2725, mode: MaxEncodedLen) - /// Storage: Replace ReplacePeriod (r:1 w:0) - /// Proof: Replace ReplacePeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlockHeight (r:1 w:0) - /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: VaultRegistry Vaults (r:2 w:2) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:2 w:2) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: VaultStaking Nonce (r:1 w:0) - /// Proof: VaultStaking Nonce (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) - /// Storage: VaultStaking TotalCurrentStake (r:1 w:0) - /// Proof: VaultStaking TotalCurrentStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultRegistry MinimumCollateralVault (r:1 w:0) - /// Proof: VaultRegistry MinimumCollateralVault (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) - /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: Oracle Aggregate (r:1 w:0) - /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) - /// Storage: VaultRegistry TotalUserVaultCollateral (r:1 w:1) - /// Proof: VaultRegistry TotalUserVaultCollateral (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: VaultCapacity Stake (r:1 w:0) - /// Proof: VaultCapacity Stake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultCapacity RewardPerToken (r:2 w:0) - /// Proof: VaultCapacity RewardPerToken (max_values: None, max_size: Some(59), added: 2534, mode: MaxEncodedLen) - /// Storage: VaultCapacity RewardTally (r:2 w:2) - /// Proof: VaultCapacity RewardTally (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) - /// Storage: VaultCapacity TotalRewards (r:2 w:2) - /// Proof: VaultCapacity TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultRewards Stake (r:1 w:0) - /// Proof: VaultRewards Stake (max_values: None, max_size: Some(97), added: 2572, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardPerToken (r:2 w:0) - /// Proof: VaultRewards RewardPerToken (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardTally (r:2 w:2) - /// Proof: VaultRewards RewardTally (max_values: None, max_size: Some(124), added: 2599, mode: MaxEncodedLen) - /// Storage: VaultRewards TotalRewards (r:2 w:2) - /// Proof: VaultRewards TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Fee Commission (r:1 w:0) - /// Proof: Fee Commission (max_values: None, max_size: Some(86), added: 2561, mode: MaxEncodedLen) - /// Storage: VaultStaking RewardPerToken (r:2 w:2) - /// Proof: VaultStaking RewardPerToken (max_values: None, max_size: Some(117), added: 2592, mode: MaxEncodedLen) - /// Storage: VaultStaking Stake (r:1 w:1) - /// Proof: VaultStaking Stake (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) - /// Storage: VaultStaking SlashPerToken (r:1 w:0) - /// Proof: VaultStaking SlashPerToken (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultStaking SlashTally (r:1 w:1) - /// Proof: VaultStaking SlashTally (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) - /// Storage: VaultStaking TotalStake (r:1 w:1) - /// Proof: VaultStaking TotalStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultRewards TotalStake (r:1 w:0) - /// Proof: VaultRewards TotalStake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - fn cancel_replace() -> Weight { - // Proof Size summary in bytes: - // Measured: `5955` - // Estimated: `89455` - // Minimum execution time: 332_975_000 picoseconds. - Weight::from_parts(340_302_000, 89455) - .saturating_add(T::DbWeight::get().reads(38_u64)) - .saturating_add(T::DbWeight::get().writes(19_u64)) - } - /// Storage: Replace ReplacePeriod (r:0 w:1) - /// Proof: Replace ReplacePeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - fn set_replace_period() -> Weight { - // Proof Size summary in bytes: - // Measured: `1027` - // Estimated: `0` - // Minimum execution time: 21_886_000 picoseconds. - Weight::from_parts(22_419_000, 0) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } -} - -// For backwards compatibility and tests -impl WeightInfo for () { - /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) - /// Storage: Nomination Vaults (r:1 w:0) - /// Proof: Nomination Vaults (max_values: None, max_size: Some(71), added: 2546, mode: MaxEncodedLen) - /// Storage: Replace ReplaceBtcDustValue (r:1 w:0) - /// Proof: Replace ReplaceBtcDustValue (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: Oracle Aggregate (r:1 w:0) - /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) - /// Storage: Fee ReplaceGriefingCollateral (r:1 w:0) - /// Proof: Fee ReplaceGriefingCollateral (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:1 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - fn request_replace() -> Weight { - // Proof Size summary in bytes: - // Measured: `2972` - // Estimated: `11908` - // Minimum execution time: 103_625_000 picoseconds. - Weight::from_parts(104_579_000, 11908) - .saturating_add(RocksDbWeight::get().reads(7_u64)) - .saturating_add(RocksDbWeight::get().writes(2_u64)) - } - /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) - fn withdraw_replace() -> Weight { - // Proof Size summary in bytes: - // Measured: `1760` - // Estimated: `2735` - // Minimum execution time: 55_362_000 picoseconds. - Weight::from_parts(56_367_000, 2735) - .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } - /// Storage: VaultRegistry Vaults (r:2 w:2) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) - /// Storage: Replace ReplaceBtcDustValue (r:1 w:0) - /// Proof: Replace ReplaceBtcDustValue (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: VaultCapacity Stake (r:1 w:1) - /// Proof: VaultCapacity Stake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultCapacity RewardPerToken (r:2 w:0) - /// Proof: VaultCapacity RewardPerToken (max_values: None, max_size: Some(59), added: 2534, mode: MaxEncodedLen) - /// Storage: VaultCapacity RewardTally (r:2 w:2) - /// Proof: VaultCapacity RewardTally (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) - /// Storage: VaultCapacity TotalRewards (r:2 w:2) - /// Proof: VaultCapacity TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultRewards Stake (r:1 w:1) - /// Proof: VaultRewards Stake (max_values: None, max_size: Some(97), added: 2572, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardPerToken (r:2 w:0) - /// Proof: VaultRewards RewardPerToken (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardTally (r:2 w:2) - /// Proof: VaultRewards RewardTally (max_values: None, max_size: Some(124), added: 2599, mode: MaxEncodedLen) - /// Storage: VaultRewards TotalRewards (r:2 w:2) - /// Proof: VaultRewards TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Fee Commission (r:1 w:0) - /// Proof: Fee Commission (max_values: None, max_size: Some(86), added: 2561, mode: MaxEncodedLen) - /// Storage: VaultStaking Nonce (r:1 w:0) - /// Proof: VaultStaking Nonce (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) - /// Storage: VaultStaking TotalCurrentStake (r:1 w:1) - /// Proof: VaultStaking TotalCurrentStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultStaking RewardPerToken (r:2 w:2) - /// Proof: VaultStaking RewardPerToken (max_values: None, max_size: Some(117), added: 2592, mode: MaxEncodedLen) - /// Storage: VaultStaking Stake (r:1 w:1) - /// Proof: VaultStaking Stake (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) - /// Storage: VaultStaking SlashPerToken (r:1 w:0) - /// Proof: VaultStaking SlashPerToken (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultStaking SlashTally (r:1 w:1) - /// Proof: VaultStaking SlashTally (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) - /// Storage: VaultStaking TotalStake (r:1 w:1) - /// Proof: VaultStaking TotalStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultStaking RewardTally (r:2 w:2) - /// Proof: VaultStaking RewardTally (max_values: None, max_size: Some(149), added: 2624, mode: MaxEncodedLen) - /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) - /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: VaultRewards TotalStake (r:1 w:1) - /// Proof: VaultRewards TotalStake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardCurrencies (r:1 w:0) - /// Proof: VaultRewards RewardCurrencies (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: Oracle Aggregate (r:1 w:0) - /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) - /// Storage: VaultCapacity TotalStake (r:1 w:1) - /// Proof: VaultCapacity TotalStake (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) - /// Storage: VaultCapacity RewardCurrencies (r:1 w:0) - /// Proof: VaultCapacity RewardCurrencies (max_values: None, max_size: Some(127), added: 2602, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:1 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: VaultRegistry TotalUserVaultCollateral (r:1 w:1) - /// Proof: VaultRegistry TotalUserVaultCollateral (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: VaultRegistry SystemCollateralCeiling (r:1 w:0) - /// Proof: VaultRegistry SystemCollateralCeiling (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: Security Nonce (r:1 w:1) - /// Proof: Security Nonce (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: System ParentHash (r:1 w:0) - /// Proof: System ParentHash (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Replace ReplacePeriod (r:1 w:0) - /// Proof: Replace ReplacePeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlockHeight (r:1 w:0) - /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Replace ReplaceRequests (r:0 w:1) - /// Proof: Replace ReplaceRequests (max_values: None, max_size: Some(250), added: 2725, mode: MaxEncodedLen) - fn accept_replace() -> Weight { - // Proof Size summary in bytes: - // Measured: `5415` - // Estimated: `96083` - // Minimum execution time: 417_052_000 picoseconds. - Weight::from_parts(420_396_000, 96083) - .saturating_add(RocksDbWeight::get().reads(43_u64)) - .saturating_add(RocksDbWeight::get().writes(26_u64)) - } - /// Storage: Replace ReplaceRequests (r:1 w:1) - /// Proof: Replace ReplaceRequests (max_values: None, max_size: Some(250), added: 2725, mode: MaxEncodedLen) - /// Storage: BTCRelay DisableInclusionCheck (r:1 w:0) - /// Proof: BTCRelay DisableInclusionCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlockHeight (r:1 w:0) - /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay Chains (r:1 w:0) - /// Proof: BTCRelay Chains (max_values: None, max_size: Some(24), added: 2499, mode: MaxEncodedLen) - /// Storage: BTCRelay BlockHeaders (r:1 w:0) - /// Proof: BTCRelay BlockHeaders (max_values: None, max_size: Some(200), added: 2675, mode: MaxEncodedLen) - /// Storage: BTCRelay StableBitcoinConfirmations (r:1 w:0) - /// Proof: BTCRelay StableBitcoinConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay StableParachainConfirmations (r:1 w:0) - /// Proof: BTCRelay StableParachainConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: VaultRegistry Vaults (r:2 w:2) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:1 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// The range of component `h` is `[2, 10]`. - /// The range of component `i` is `[1, 10]`. - /// The range of component `o` is `[2, 3]`. - /// The range of component `b` is `[541, 2048]`. - fn execute_pending_replace(h: u32, _i: u32, _o: u32, _b: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `4990` - // Estimated: `18451` - // Minimum execution time: 143_961_000 picoseconds. - Weight::from_parts(191_182_902, 18451) - // Standard Error: 132_362 - .saturating_add(Weight::from_parts(961_843, 0).saturating_mul(h.into())) - .saturating_add(RocksDbWeight::get().reads(11_u64)) - .saturating_add(RocksDbWeight::get().writes(4_u64)) - } - /// Storage: Replace ReplaceRequests (r:1 w:1) - /// Proof: Replace ReplaceRequests (max_values: None, max_size: Some(250), added: 2725, mode: MaxEncodedLen) - /// Storage: BTCRelay DisableInclusionCheck (r:1 w:0) - /// Proof: BTCRelay DisableInclusionCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlockHeight (r:1 w:0) - /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay Chains (r:1 w:0) - /// Proof: BTCRelay Chains (max_values: None, max_size: Some(24), added: 2499, mode: MaxEncodedLen) - /// Storage: BTCRelay BlockHeaders (r:1 w:0) - /// Proof: BTCRelay BlockHeaders (max_values: None, max_size: Some(200), added: 2675, mode: MaxEncodedLen) - /// Storage: BTCRelay StableBitcoinConfirmations (r:1 w:0) - /// Proof: BTCRelay StableBitcoinConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay StableParachainConfirmations (r:1 w:0) - /// Proof: BTCRelay StableParachainConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: VaultRegistry Vaults (r:2 w:2) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) - /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) - /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: Oracle Aggregate (r:1 w:0) - /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) - /// Storage: VaultStaking Nonce (r:1 w:0) - /// Proof: VaultStaking Nonce (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) - /// Storage: VaultStaking TotalCurrentStake (r:1 w:0) - /// Proof: VaultStaking TotalCurrentStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// The range of component `h` is `[2, 10]`. - /// The range of component `i` is `[1, 10]`. - /// The range of component `o` is `[2, 3]`. - /// The range of component `b` is `[541, 2048]`. - fn execute_cancelled_replace(_h: u32, i: u32, _o: u32, b: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `5335` - // Estimated: `26535` - // Minimum execution time: 177_761_000 picoseconds. - Weight::from_parts(197_448_409, 26535) - // Standard Error: 42_163 - .saturating_add(Weight::from_parts(84_783, 0).saturating_mul(i.into())) - // Standard Error: 268 - .saturating_add(Weight::from_parts(3_017, 0).saturating_mul(b.into())) - .saturating_add(RocksDbWeight::get().reads(15_u64)) - .saturating_add(RocksDbWeight::get().writes(3_u64)) - } - /// Storage: Replace ReplaceRequests (r:1 w:1) - /// Proof: Replace ReplaceRequests (max_values: None, max_size: Some(250), added: 2725, mode: MaxEncodedLen) - /// Storage: Replace ReplacePeriod (r:1 w:0) - /// Proof: Replace ReplacePeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlockHeight (r:1 w:0) - /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: VaultRegistry Vaults (r:2 w:2) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:2 w:2) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: VaultStaking Nonce (r:1 w:0) - /// Proof: VaultStaking Nonce (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) - /// Storage: VaultStaking TotalCurrentStake (r:1 w:0) - /// Proof: VaultStaking TotalCurrentStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultRegistry MinimumCollateralVault (r:1 w:0) - /// Proof: VaultRegistry MinimumCollateralVault (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) - /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: Oracle Aggregate (r:1 w:0) - /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) - /// Storage: VaultRegistry TotalUserVaultCollateral (r:1 w:1) - /// Proof: VaultRegistry TotalUserVaultCollateral (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: VaultCapacity Stake (r:1 w:0) - /// Proof: VaultCapacity Stake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultCapacity RewardPerToken (r:2 w:0) - /// Proof: VaultCapacity RewardPerToken (max_values: None, max_size: Some(59), added: 2534, mode: MaxEncodedLen) - /// Storage: VaultCapacity RewardTally (r:2 w:2) - /// Proof: VaultCapacity RewardTally (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) - /// Storage: VaultCapacity TotalRewards (r:2 w:2) - /// Proof: VaultCapacity TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultRewards Stake (r:1 w:0) - /// Proof: VaultRewards Stake (max_values: None, max_size: Some(97), added: 2572, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardPerToken (r:2 w:0) - /// Proof: VaultRewards RewardPerToken (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardTally (r:2 w:2) - /// Proof: VaultRewards RewardTally (max_values: None, max_size: Some(124), added: 2599, mode: MaxEncodedLen) - /// Storage: VaultRewards TotalRewards (r:2 w:2) - /// Proof: VaultRewards TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Fee Commission (r:1 w:0) - /// Proof: Fee Commission (max_values: None, max_size: Some(86), added: 2561, mode: MaxEncodedLen) - /// Storage: VaultStaking RewardPerToken (r:2 w:2) - /// Proof: VaultStaking RewardPerToken (max_values: None, max_size: Some(117), added: 2592, mode: MaxEncodedLen) - /// Storage: VaultStaking Stake (r:1 w:1) - /// Proof: VaultStaking Stake (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) - /// Storage: VaultStaking SlashPerToken (r:1 w:0) - /// Proof: VaultStaking SlashPerToken (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultStaking SlashTally (r:1 w:1) - /// Proof: VaultStaking SlashTally (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) - /// Storage: VaultStaking TotalStake (r:1 w:1) - /// Proof: VaultStaking TotalStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultRewards TotalStake (r:1 w:0) - /// Proof: VaultRewards TotalStake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - fn cancel_replace() -> Weight { - // Proof Size summary in bytes: - // Measured: `5955` - // Estimated: `89455` - // Minimum execution time: 332_975_000 picoseconds. - Weight::from_parts(340_302_000, 89455) - .saturating_add(RocksDbWeight::get().reads(38_u64)) - .saturating_add(RocksDbWeight::get().writes(19_u64)) - } - /// Storage: Replace ReplacePeriod (r:0 w:1) - /// Proof: Replace ReplacePeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - fn set_replace_period() -> Weight { - // Proof Size summary in bytes: - // Measured: `1027` - // Estimated: `0` - // Minimum execution time: 21_886_000 picoseconds. - Weight::from_parts(22_419_000, 0) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } -} diff --git a/crates/replace/src/ext.rs b/crates/replace/src/ext.rs deleted file mode 100644 index dc8d2a77d2..0000000000 --- a/crates/replace/src/ext.rs +++ /dev/null @@ -1,180 +0,0 @@ -#[cfg(test)] -use mocktopus::macros::mockable; - -#[cfg_attr(test, mockable)] -pub(crate) mod btc_relay { - use bitcoin::types::{FullTransactionProof, Value}; - use btc_relay::BtcAddress; - use frame_support::dispatch::DispatchError; - use sp_core::H256; - use sp_std::convert::TryInto; - - pub fn verify_and_validate_op_return_transaction>( - unchecked_transaction: FullTransactionProof, - recipient_btc_address: BtcAddress, - expected_btc: V, - op_return_id: H256, - ) -> Result<(), DispatchError> { - >::verify_and_validate_op_return_transaction( - unchecked_transaction, - recipient_btc_address, - expected_btc, - op_return_id, - ) - } - - pub fn get_best_block_height() -> u32 { - >::get_best_block_height() - } - - pub fn has_request_expired( - opentime: T::BlockNumber, - btc_open_height: u32, - period: T::BlockNumber, - ) -> Result { - >::has_request_expired(opentime, btc_open_height, period) - } -} - -#[cfg_attr(test, mockable)] -pub(crate) mod vault_registry { - use crate::DefaultVaultId; - use currency::Amount; - use frame_support::dispatch::{DispatchError, DispatchResult}; - use vault_registry::types::CurrencySource; - - pub fn transfer_funds( - from: CurrencySource, - to: CurrencySource, - amount: &Amount, - ) -> DispatchResult { - >::transfer_funds(from, to, amount) - } - - pub fn replace_tokens( - old_vault_id: &DefaultVaultId, - new_vault_id: &DefaultVaultId, - tokens: &Amount, - collateral: &Amount, - ) -> DispatchResult { - >::replace_tokens(old_vault_id, new_vault_id, tokens, collateral) - } - - pub fn cancel_replace_tokens( - old_vault_id: &DefaultVaultId, - new_vault_id: &DefaultVaultId, - tokens: &Amount, - ) -> DispatchResult { - >::cancel_replace_tokens(old_vault_id, new_vault_id, tokens) - } - - pub fn is_vault_liquidated(vault_id: &DefaultVaultId) -> Result { - >::is_vault_liquidated(vault_id) - } - - pub fn try_increase_to_be_redeemed_tokens( - vault_id: &DefaultVaultId, - tokens: &Amount, - ) -> DispatchResult { - >::try_increase_to_be_redeemed_tokens(vault_id, tokens) - } - - pub fn ensure_not_banned(vault_id: &DefaultVaultId) -> DispatchResult { - >::_ensure_not_banned(vault_id) - } - - pub fn try_increase_to_be_issued_tokens( - vault_id: &DefaultVaultId, - amount: &Amount, - ) -> Result<(), DispatchError> { - >::try_increase_to_be_issued_tokens(vault_id, amount) - } - - pub fn requestable_to_be_replaced_tokens( - vault_id: &DefaultVaultId, - ) -> Result, DispatchError> { - >::requestable_to_be_replaced_tokens(vault_id) - } - - pub fn try_increase_to_be_replaced_tokens( - vault_id: &DefaultVaultId, - amount: &Amount, - ) -> Result, DispatchError> { - >::try_increase_to_be_replaced_tokens(vault_id, amount) - } - - pub fn decrease_to_be_replaced_tokens( - vault_id: &DefaultVaultId, - tokens: &Amount, - ) -> Result<(Amount, Amount), DispatchError> { - >::decrease_to_be_replaced_tokens(vault_id, tokens) - } - - pub fn withdraw_replace_request( - vault_id: &DefaultVaultId, - amount: &Amount, - ) -> Result<(Amount, Amount), DispatchError> { - >::withdraw_replace_request(vault_id, amount) - } - - pub fn try_deposit_collateral( - vault_id: &DefaultVaultId, - amount: &Amount, - ) -> Result<(), DispatchError> { - >::try_deposit_collateral(vault_id, amount) - } - - pub fn force_withdraw_collateral( - vault_id: &DefaultVaultId, - amount: &Amount, - ) -> Result<(), DispatchError> { - >::force_withdraw_collateral(vault_id, amount) - } - - pub fn is_allowed_to_withdraw_collateral( - vault_id: &DefaultVaultId, - amount: Option>, - ) -> Result { - >::is_allowed_to_withdraw_collateral(vault_id, amount) - } - - pub fn calculate_collateral( - collateral: &Amount, - numerator: &Amount, - denominator: &Amount, - ) -> Result, DispatchError> { - >::calculate_collateral(collateral, numerator, denominator) - } -} - -#[cfg_attr(test, mockable)] -pub(crate) mod security { - use sp_core::H256; - - pub fn get_secure_id(id: &T::AccountId) -> H256 { - >::get_secure_id(id) - } - - pub fn active_block_number() -> T::BlockNumber { - >::active_block_number() - } -} - -#[cfg_attr(test, mockable)] -pub(crate) mod fee { - use currency::Amount; - use frame_support::dispatch::DispatchError; - - pub fn get_replace_griefing_collateral(amount: &Amount) -> Result, DispatchError> { - >::get_replace_griefing_collateral(amount) - } -} - -#[cfg_attr(test, mockable)] -pub(crate) mod nomination { - use crate::DefaultVaultId; - - pub fn is_nominatable(vault_id: &DefaultVaultId) -> bool { - >::is_opted_in(vault_id) - } -} diff --git a/crates/replace/src/lib.rs b/crates/replace/src/lib.rs deleted file mode 100644 index 3187c8d4a3..0000000000 --- a/crates/replace/src/lib.rs +++ /dev/null @@ -1,689 +0,0 @@ -//! # Replace Pallet -//! Based on the [specification](https://spec.interlay.io/spec/replace.html). - -#![deny(warnings)] -#![cfg_attr(test, feature(proc_macro_hygiene))] -#![cfg_attr(not(feature = "std"), no_std)] - -#[cfg(feature = "runtime-benchmarks")] -mod benchmarking; - -mod default_weights; -mod ext; - -pub mod types; - -#[cfg(test)] -mod mock; - -#[cfg(test)] -mod tests; - -#[cfg(test)] -extern crate mocktopus; - -#[cfg(test)] -use mocktopus::macros::mockable; - -use crate::types::{BalanceOf, ReplaceRequestExt, Version}; -pub use crate::types::{DefaultReplaceRequest, ReplaceRequest, ReplaceRequestStatus}; -use bitcoin::types::FullTransactionProof; -use btc_relay::BtcAddress; -use currency::Amount; -pub use default_weights::WeightInfo; -use frame_support::{ - dispatch::{DispatchError, DispatchResult}, - ensure, - pallet_prelude::Weight, - traits::Get, - transactional, -}; -use frame_system::{ensure_root, ensure_signed}; -use sp_core::H256; -use sp_std::vec::Vec; -use types::DefaultVaultId; -use vault_registry::{types::CurrencyId, CurrencySource}; - -pub use pallet::*; - -/// Complexity: -/// - `O(H + I + O + B)` where: -/// - `H` is the number of hashes in the merkle tree -/// - `I` is the number of transaction inputs -/// - `O` is the number of transaction outputs -/// - `B` is `transaction` size in bytes (length-fee-bounded) -fn weight_for_execute_replace(proof: &FullTransactionProof) -> Weight { - { - let h = proof.user_tx_proof.merkle_proof.hashes.len() as u32; - let i = proof.user_tx_proof.transaction.inputs.len() as u32; - let o = proof.user_tx_proof.transaction.outputs.len() as u32; - let b = proof.user_tx_proof.tx_encoded_len; - ::WeightInfo::execute_pending_replace(h, i, o, b) - .max(::WeightInfo::execute_cancelled_replace(h, i, o, b)) - } - .saturating_add({ - let h = proof.coinbase_proof.merkle_proof.hashes.len() as u32; - let i = proof.coinbase_proof.transaction.inputs.len() as u32; - let o = proof.coinbase_proof.transaction.outputs.len() as u32; - let b = proof.coinbase_proof.tx_encoded_len; - ::WeightInfo::execute_pending_replace(h, i, o, b) - .max(::WeightInfo::execute_cancelled_replace(h, i, o, b)) - }) -} - -#[frame_support::pallet] -pub mod pallet { - use super::*; - use frame_support::pallet_prelude::*; - use frame_system::pallet_prelude::*; - use primitives::VaultId; - use vault_registry::types::DefaultVaultCurrencyPair; - - /// ## Configuration - /// The pallet's configuration trait. - #[pallet::config] - pub trait Config: - frame_system::Config - + vault_registry::Config - + btc_relay::Config - + oracle::Config - + fee::Config - + nomination::Config - { - /// The overarching event type. - type RuntimeEvent: From> + IsType<::RuntimeEvent>; - - /// Weight information for the extrinsics in this module. - type WeightInfo: WeightInfo; - } - - #[pallet::event] - #[pallet::generate_deposit(pub(super) fn deposit_event)] - pub enum Event { - RequestReplace { - old_vault_id: DefaultVaultId, - amount: BalanceOf, - griefing_collateral: BalanceOf, - }, - WithdrawReplace { - old_vault_id: DefaultVaultId, - withdrawn_tokens: BalanceOf, - withdrawn_griefing_collateral: BalanceOf, - }, - AcceptReplace { - replace_id: H256, - old_vault_id: DefaultVaultId, - new_vault_id: DefaultVaultId, - amount: BalanceOf, - collateral: BalanceOf, - btc_address: BtcAddress, - }, - ExecuteReplace { - replace_id: H256, - old_vault_id: DefaultVaultId, - new_vault_id: DefaultVaultId, - }, - CancelReplace { - replace_id: H256, - new_vault_id: DefaultVaultId, - old_vault_id: DefaultVaultId, - griefing_collateral: BalanceOf, - }, - ReplacePeriodChange { - period: T::BlockNumber, - }, - } - - #[pallet::error] - pub enum Error { - /// Replace requires non-zero increase. - ReplaceAmountZero, - /// Replace amount is too small. - AmountBelowDustAmount, - /// No replace request found. - NoPendingRequest, - /// Unexpected vault account. - UnauthorizedVault, - /// Cannot replace self. - ReplaceSelfNotAllowed, - /// Cannot replace with nominated collateral. - VaultHasEnabledNomination, - /// Replace request has not expired. - ReplacePeriodNotExpired, - /// Replace request already completed. - ReplaceCompleted, - /// Replace request already cancelled. - ReplaceCancelled, - /// Replace request not found. - ReplaceIdNotFound, - /// Vault cannot replace different currency. - InvalidWrappedCurrency, - } - - /// Vaults create replace requests to transfer locked collateral. - /// This mapping provides access from a unique hash to a `ReplaceRequest`. - #[pallet::storage] - pub(super) type ReplaceRequests = - StorageMap<_, Blake2_128Concat, H256, DefaultReplaceRequest, OptionQuery>; - - /// The time difference in number of blocks between when a replace request is created - /// and required completion time by a vault. The replace period has an upper limit - /// to prevent griefing of vault collateral. - #[pallet::storage] - #[pallet::getter(fn replace_period)] - pub(super) type ReplacePeriod = StorageValue<_, T::BlockNumber, ValueQuery>; - - /// The minimum amount of btc that is accepted for replace requests; any lower values would - /// risk the bitcoin client to reject the payment - #[pallet::storage] - #[pallet::getter(fn replace_btc_dust_value)] - pub(super) type ReplaceBtcDustValue = StorageValue<_, BalanceOf, ValueQuery>; - - #[pallet::type_value] - pub(super) fn DefaultForStorageVersion() -> Version { - Version::V0 - } - - /// Build storage at V1 (requires default 0). - #[pallet::storage] - #[pallet::getter(fn storage_version)] - pub(super) type StorageVersion = StorageValue<_, Version, ValueQuery, DefaultForStorageVersion>; - - #[pallet::genesis_config] - pub struct GenesisConfig { - pub replace_period: T::BlockNumber, - pub replace_btc_dust_value: BalanceOf, - } - - #[cfg(feature = "std")] - impl Default for GenesisConfig { - fn default() -> Self { - Self { - replace_period: Default::default(), - replace_btc_dust_value: Default::default(), - } - } - } - - #[pallet::genesis_build] - impl GenesisBuild for GenesisConfig { - fn build(&self) { - ReplacePeriod::::put(self.replace_period); - ReplaceBtcDustValue::::put(self.replace_btc_dust_value); - } - } - - #[pallet::hooks] - impl Hooks for Pallet {} - - #[pallet::pallet] - pub struct Pallet(_); - - // The pallet's dispatchable functions. - #[pallet::call] - impl Pallet { - /// Request the replacement of a new vault ownership - /// - /// # Arguments - /// - /// * `origin` - sender of the transaction - /// * `amount` - amount of issued tokens - /// * `griefing_collateral` - amount of collateral - #[pallet::call_index(0)] - #[pallet::weight(::WeightInfo::request_replace())] - #[transactional] - pub fn request_replace( - origin: OriginFor, - currency_pair: DefaultVaultCurrencyPair, - #[pallet::compact] amount: BalanceOf, - ) -> DispatchResultWithPostInfo { - let old_vault = VaultId::new(ensure_signed(origin)?, currency_pair.collateral, currency_pair.wrapped); - Self::_request_replace(old_vault, amount)?; - Ok(().into()) - } - - /// Withdraw a request of vault replacement - /// - /// # Arguments - /// - /// * `origin` - sender of the transaction: the old vault - #[pallet::call_index(1)] - #[pallet::weight(::WeightInfo::withdraw_replace())] - #[transactional] - pub fn withdraw_replace( - origin: OriginFor, - currency_pair: DefaultVaultCurrencyPair, - #[pallet::compact] amount: BalanceOf, - ) -> DispatchResultWithPostInfo { - let old_vault = VaultId::new(ensure_signed(origin)?, currency_pair.collateral, currency_pair.wrapped); - Self::_withdraw_replace_request(old_vault, amount)?; - Ok(().into()) - } - - /// Accept request of vault replacement - /// - /// # Arguments - /// - /// * `origin` - the initiator of the transaction: the new vault - /// * `old_vault` - id of the old vault that we are (possibly partially) replacing - /// * `collateral` - the collateral for replacement - /// * `btc_address` - the address that old-vault should transfer the btc to - #[pallet::call_index(2)] - #[pallet::weight(::WeightInfo::accept_replace())] - #[transactional] - pub fn accept_replace( - origin: OriginFor, - currency_pair: DefaultVaultCurrencyPair, - old_vault: DefaultVaultId, - #[pallet::compact] amount_btc: BalanceOf, - #[pallet::compact] collateral: BalanceOf, - btc_address: BtcAddress, - ) -> DispatchResultWithPostInfo { - let new_vault = VaultId::new(ensure_signed(origin)?, currency_pair.collateral, currency_pair.wrapped); - Self::_accept_replace(old_vault, new_vault, amount_btc, collateral, btc_address)?; - Ok(().into()) - } - - /// Execute vault replacement - /// - /// # Arguments - /// - /// * `origin` - sender of the transaction: the new vault - /// * `replace_id` - the ID of the replacement request - /// * 'merkle_proof' - the merkle root of the block - /// * `raw_tx` - the transaction id in bytes - #[pallet::call_index(3)] - #[pallet::weight(weight_for_execute_replace::(unchecked_transaction))] - #[transactional] - pub fn execute_replace( - origin: OriginFor, - replace_id: H256, - unchecked_transaction: FullTransactionProof, - ) -> DispatchResultWithPostInfo { - let _ = ensure_signed(origin)?; - - Self::_execute_replace(replace_id, unchecked_transaction)?; - Ok(().into()) - } - - /// Cancel vault replacement - /// - /// # Arguments - /// - /// * `origin` - sender of the transaction: anyone - /// * `replace_id` - the ID of the replacement request - #[pallet::call_index(4)] - #[pallet::weight(::WeightInfo::cancel_replace())] - #[transactional] - pub fn cancel_replace(origin: OriginFor, replace_id: H256) -> DispatchResultWithPostInfo { - let _ = ensure_signed(origin)?; - Self::_cancel_replace(replace_id)?; - Ok(().into()) - } - - /// Set the default replace period for tx verification. - /// - /// # Arguments - /// - /// * `origin` - the dispatch origin of this call (must be _Root_) - /// * `period` - default period for new requests - /// - /// # Weight: `O(1)` - #[pallet::call_index(5)] - #[pallet::weight(::WeightInfo::set_replace_period())] - #[transactional] - pub fn set_replace_period(origin: OriginFor, period: T::BlockNumber) -> DispatchResultWithPostInfo { - ensure_root(origin)?; - >::set(period); - Self::deposit_event(Event::ReplacePeriodChange { period }); - Ok(().into()) - } - } -} - -// "Internal" functions, callable by code. -#[cfg_attr(test, mockable)] -impl Pallet { - fn _request_replace(vault_id: DefaultVaultId, amount_btc: BalanceOf) -> DispatchResult { - // check vault is not banned - ext::vault_registry::ensure_not_banned::(&vault_id)?; - - let amount_btc = Amount::new(amount_btc, vault_id.wrapped_currency()); - - ensure!( - !ext::nomination::is_nominatable::(&vault_id), - Error::::VaultHasEnabledNomination - ); - - let requestable_tokens = ext::vault_registry::requestable_to_be_replaced_tokens::(&vault_id)?; - let to_be_replaced_increase = amount_btc.min(&requestable_tokens)?; - - ensure!(!to_be_replaced_increase.is_zero(), Error::::ReplaceAmountZero); - - // increase to-be-replaced tokens. This will fail if the vault does not have enough tokens available - let total_to_be_replaced = - ext::vault_registry::try_increase_to_be_replaced_tokens::(&vault_id, &to_be_replaced_increase)?; - - // check that total-to-be-replaced is above the minimum - ensure!( - total_to_be_replaced.ge(&Self::dust_value(vault_id.wrapped_currency()))?, - Error::::AmountBelowDustAmount - ); - - // get the griefing collateral increase - let griefing_collateral = ext::fee::get_replace_griefing_collateral::( - &to_be_replaced_increase.convert_to(T::GetGriefingCollateralCurrencyId::get())?, - )?; - - // Lock the oldVault’s griefing collateral - ext::vault_registry::transfer_funds( - CurrencySource::FreeBalance(vault_id.account_id.clone()), - CurrencySource::AvailableReplaceCollateral(vault_id.clone()), - &griefing_collateral, - )?; - - // Emit RequestReplace event - Self::deposit_event(Event::::RequestReplace { - old_vault_id: vault_id, - amount: to_be_replaced_increase.amount(), - griefing_collateral: griefing_collateral.amount(), - }); - Ok(()) - } - - fn _withdraw_replace_request(vault_id: DefaultVaultId, amount: BalanceOf) -> Result<(), DispatchError> { - let amount = Amount::new(amount, vault_id.wrapped_currency()); - // decrease to-be-replaced tokens, so that the vault is free to use its issued tokens again. - let (withdrawn_tokens, to_withdraw_collateral) = - ext::vault_registry::withdraw_replace_request::(&vault_id, &amount)?; - - if withdrawn_tokens.is_zero() { - return Err(Error::::NoPendingRequest.into()); - } - - // Emit WithdrawReplaceRequest event. - Self::deposit_event(Event::::WithdrawReplace { - old_vault_id: vault_id, - withdrawn_tokens: withdrawn_tokens.amount(), - withdrawn_griefing_collateral: to_withdraw_collateral.amount(), - }); - Ok(()) - } - - fn accept_replace_tokens( - old_vault_id: &DefaultVaultId, - new_vault_id: &DefaultVaultId, - redeemable_tokens: &Amount, - ) -> DispatchResult { - // increase old-vault's to-be-redeemed tokens - this should never fail - ext::vault_registry::try_increase_to_be_redeemed_tokens::(old_vault_id, redeemable_tokens)?; - - // increase new-vault's to-be-issued tokens - this will fail if there is insufficient collateral - ext::vault_registry::try_increase_to_be_issued_tokens::(new_vault_id, redeemable_tokens)?; - - Ok(()) - } - - fn _accept_replace( - old_vault_id: DefaultVaultId, - new_vault_id: DefaultVaultId, - amount_btc: BalanceOf, - collateral: BalanceOf, - btc_address: BtcAddress, - ) -> Result<(), DispatchError> { - let new_vault_currency_id = new_vault_id.collateral_currency(); - let amount_btc = Amount::new(amount_btc, old_vault_id.wrapped_currency()); - let collateral = Amount::new(collateral, new_vault_currency_id); - - // don't allow vaults to replace themselves - ensure!(old_vault_id != new_vault_id, Error::::ReplaceSelfNotAllowed); - - // probably this check is not strictly required, but it's better to give an - // explicit error rather than insufficient balance - ensure!( - old_vault_id.wrapped_currency() == new_vault_id.wrapped_currency(), - Error::::InvalidWrappedCurrency - ); - - // Check that new vault is not currently banned - ext::vault_registry::ensure_not_banned::(&new_vault_id)?; - - // decrease old-vault's to-be-replaced tokens - let (redeemable_tokens, griefing_collateral) = - ext::vault_registry::decrease_to_be_replaced_tokens::(&old_vault_id, &amount_btc)?; - - // check amount_btc is above the minimum - ensure!( - redeemable_tokens.ge(&Self::dust_value(old_vault_id.wrapped_currency()))?, - Error::::AmountBelowDustAmount - ); - - // Calculate and lock the new-vault's additional collateral - let actual_new_vault_collateral = - ext::vault_registry::calculate_collateral::(&collateral, &redeemable_tokens, &amount_btc)?; - - ext::vault_registry::try_deposit_collateral::(&new_vault_id, &actual_new_vault_collateral)?; - - Self::accept_replace_tokens(&old_vault_id, &new_vault_id, &redeemable_tokens)?; - - ext::vault_registry::transfer_funds( - CurrencySource::AvailableReplaceCollateral(old_vault_id.clone()), - CurrencySource::ActiveReplaceCollateral(old_vault_id.clone()), - &griefing_collateral, - )?; - - let replace_id = ext::security::get_secure_id::(&old_vault_id.account_id); - - let replace = ReplaceRequest { - old_vault: old_vault_id, - new_vault: new_vault_id, - accept_time: ext::security::active_block_number::(), - collateral: actual_new_vault_collateral.amount(), - btc_address, - griefing_collateral: griefing_collateral.amount(), - amount: redeemable_tokens.amount(), - period: Self::replace_period(), - btc_height: ext::btc_relay::get_best_block_height::(), - status: ReplaceRequestStatus::Pending, - }; - - Self::insert_replace_request(&replace_id, &replace); - - // Emit AcceptReplace event - Self::deposit_event(Event::::AcceptReplace { - replace_id: replace_id, - old_vault_id: replace.old_vault, - new_vault_id: replace.new_vault, - amount: replace.amount, - collateral: replace.collateral, - btc_address: replace.btc_address, - }); - - Ok(()) - } - - fn _execute_replace(replace_id: H256, unchecked_transaction: FullTransactionProof) -> DispatchResult { - // retrieve the replace request using the id parameter - // we can still execute cancelled requests - let replace = Self::get_open_or_cancelled_replace_request(&replace_id)?; - - let griefing_collateral: Amount = replace.griefing_collateral(); - let amount = replace.amount(); - let collateral = replace.collateral()?; - - // NOTE: anyone can call this method provided the proof is correct - let new_vault_id = replace.new_vault; - let old_vault_id = replace.old_vault; - - // check the transaction inclusion and validity - ext::btc_relay::verify_and_validate_op_return_transaction::( - unchecked_transaction, - replace.btc_address, - replace.amount, - replace_id, - )?; - - // only return griefing collateral if not already slashed - let collateral = match replace.status { - ReplaceRequestStatus::Pending => { - // give old-vault the griefing collateral - ext::vault_registry::transfer_funds( - CurrencySource::ActiveReplaceCollateral(old_vault_id.clone()), - CurrencySource::FreeBalance(old_vault_id.account_id.clone()), - &griefing_collateral, - )?; - // NOTE: this is just the additional collateral already locked on accept - // it is only used in the ReplaceTokens event - collateral - } - ReplaceRequestStatus::Cancelled => { - // we need to re-accept first, this will check that the vault is over the secure threshold - Self::accept_replace_tokens(&old_vault_id, &new_vault_id, &amount)?; - // no additional collateral locked for this - Amount::zero(collateral.currency()) - } - ReplaceRequestStatus::Completed => { - // we never enter this branch as completed requests are filtered - return Err(Error::::ReplaceCompleted.into()); - } - }; - - // decrease old-vault's issued & to-be-redeemed tokens, and - // change new-vault's to-be-issued tokens to issued tokens - ext::vault_registry::replace_tokens::(&old_vault_id, &new_vault_id, &amount, &collateral)?; - - // Emit ExecuteReplace event. - Self::deposit_event(Event::::ExecuteReplace { - replace_id: replace_id, - old_vault_id: old_vault_id, - new_vault_id: new_vault_id, - }); - - // Remove replace request - Self::set_replace_status(&replace_id, ReplaceRequestStatus::Completed); - Ok(()) - } - - fn _cancel_replace(replace_id: H256) -> Result<(), DispatchError> { - // Retrieve the ReplaceRequest as per the replaceId parameter from Vaults in the VaultRegistry - let replace = Self::get_open_replace_request(&replace_id)?; - - let griefing_collateral: Amount = replace.griefing_collateral(); - let amount = replace.amount(); - let collateral = replace.collateral()?; - - // only cancellable after the request has expired - ensure!( - ext::btc_relay::has_request_expired::( - replace.accept_time, - replace.btc_height, - Self::replace_period().max(replace.period) - )?, - Error::::ReplacePeriodNotExpired - ); - - let new_vault_id = replace.new_vault; - - // decrease old-vault's to-be-redeemed tokens, and - // decrease new-vault's to-be-issued tokens - ext::vault_registry::cancel_replace_tokens::(&replace.old_vault, &new_vault_id, &amount)?; - - // slash old-vault's griefing collateral - ext::vault_registry::transfer_funds::( - CurrencySource::ActiveReplaceCollateral(replace.old_vault.clone()), - CurrencySource::FreeBalance(new_vault_id.account_id.clone()), - &griefing_collateral, - )?; - - // if the new_vault locked additional collateral especially for this replace, - // release it if it does not cause them to be undercollateralized - if !ext::vault_registry::is_vault_liquidated::(&new_vault_id)? - && ext::vault_registry::is_allowed_to_withdraw_collateral::(&new_vault_id, Some(collateral.clone()))? - { - ext::vault_registry::force_withdraw_collateral::(&new_vault_id, &collateral)?; - } - - // Remove the ReplaceRequest from ReplaceRequests - Self::set_replace_status(&replace_id, ReplaceRequestStatus::Cancelled); - - // Emit CancelReplace event. - Self::deposit_event(Event::::CancelReplace { - replace_id: replace_id, - new_vault_id: new_vault_id, - old_vault_id: replace.old_vault, - griefing_collateral: replace.griefing_collateral, - }); - Ok(()) - } - - /// Fetch all replace requests from the specified vault. - /// - /// # Arguments - /// - /// * `account_id` - user account id - pub fn get_replace_requests_for_old_vault(vault_id: T::AccountId) -> Vec { - >::iter() - .filter(|(_, request)| request.old_vault.account_id == vault_id) - .map(|(key, _)| key) - .collect::>() - } - - /// Fetch all replace requests to the specified vault. - /// - /// # Arguments - /// - /// * `account_id` - user account id - pub fn get_replace_requests_for_new_vault(vault_id: T::AccountId) -> Vec { - >::iter() - .filter(|(_, request)| request.new_vault.account_id == vault_id) - .map(|(key, _)| key) - .collect::>() - } - - /// Get a replace request by id. Completed or cancelled requests are not returned. - pub fn get_open_replace_request(replace_id: &H256) -> Result, DispatchError> { - let request = ReplaceRequests::::try_get(replace_id).or(Err(Error::::ReplaceIdNotFound))?; - - // NOTE: temporary workaround until we delete - match request.status { - ReplaceRequestStatus::Pending => Ok(request), - ReplaceRequestStatus::Completed => Err(Error::::ReplaceCompleted.into()), - ReplaceRequestStatus::Cancelled => Err(Error::::ReplaceCancelled.into()), - } - } - - /// Get a open or completed replace request by id. Cancelled requests are not returned. - pub fn get_open_or_completed_replace_request(id: &H256) -> Result, DispatchError> { - let request = >::get(id).ok_or(Error::::ReplaceIdNotFound)?; - match request.status { - ReplaceRequestStatus::Pending | ReplaceRequestStatus::Completed => Ok(request), - ReplaceRequestStatus::Cancelled => Err(Error::::ReplaceCancelled.into()), - } - } - - /// Get a open or cancelled replace request by id. Completed requests are not returned. - pub fn get_open_or_cancelled_replace_request(id: &H256) -> Result, DispatchError> { - let request = >::get(id).ok_or(Error::::ReplaceIdNotFound)?; - match request.status { - ReplaceRequestStatus::Pending | ReplaceRequestStatus::Cancelled => Ok(request), - ReplaceRequestStatus::Completed => Err(Error::::ReplaceCompleted.into()), - } - } - - fn insert_replace_request(key: &H256, value: &DefaultReplaceRequest) { - >::insert(key, value) - } - - fn set_replace_status(key: &H256, status: ReplaceRequestStatus) { - >::mutate_exists(key, |request| { - *request = request.clone().map(|request| DefaultReplaceRequest:: { - status: status.clone(), - ..request - }); - }); - } - - pub fn dust_value(currency_id: CurrencyId) -> Amount { - Amount::new(ReplaceBtcDustValue::::get(), currency_id) - } -} diff --git a/crates/replace/src/mock.rs b/crates/replace/src/mock.rs deleted file mode 100644 index ad728c297d..0000000000 --- a/crates/replace/src/mock.rs +++ /dev/null @@ -1,354 +0,0 @@ -use crate as replace; -use crate::{Config, Error}; -use currency::Amount; -use frame_support::{ - assert_ok, parameter_types, - traits::{ConstU32, Everything, GenesisBuild}, - PalletId, -}; -use mocktopus::{macros::mockable, mocking::clear_mocks}; -use orml_traits::parameter_type_with_key; -pub use primitives::{CurrencyId, CurrencyId::Token, TokenSymbol::*}; -use primitives::{VaultCurrencyPair, VaultId}; -use sp_arithmetic::{FixedI128, FixedPointNumber, FixedU128}; -use sp_core::H256; -use sp_runtime::{ - testing::{Header, TestXt}, - traits::{BlakeTwo256, IdentityLookup, One, Zero}, -}; - -type TestExtrinsic = TestXt; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; -type Block = frame_system::mocking::MockBlock; - -// Configure a mock runtime to test the pallet. -frame_support::construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent}, - - // Tokens & Balances - Tokens: orml_tokens::{Pallet, Storage, Config, Event}, - - CapacityRewards: reward::::{Pallet, Call, Storage, Event}, - VaultRewards: reward::::{Pallet, Call, Storage, Event}, - VaultStaking: staking::{Pallet, Storage, Event}, - - // Operational - BTCRelay: btc_relay::{Pallet, Call, Config, Storage, Event}, - Security: security::{Pallet, Call, Storage, Event}, - VaultRegistry: vault_registry::{Pallet, Call, Config, Storage, Event}, - Oracle: oracle::{Pallet, Call, Config, Storage, Event}, - Replace: replace::{Pallet, Call, Config, Storage, Event}, - Fee: fee::{Pallet, Call, Config, Storage}, - Nomination: nomination::{Pallet, Call, Config, Storage, Event}, - Currency: currency::{Pallet}, - } -); - -pub type AccountId = u64; -pub type Balance = u128; -pub type RawAmount = i128; -pub type BlockNumber = u64; -pub type Moment = u64; -pub type Index = u64; -pub type SignedFixedPoint = FixedI128; -pub type SignedInner = i128; -pub type UnsignedFixedPoint = FixedU128; - -parameter_types! { - pub const BlockHashCount: u64 = 250; - pub const SS58Prefix: u8 = 42; -} - -impl frame_system::Config for Test { - type BaseCallFilter = Everything; - type BlockWeights = (); - type BlockLength = (); - type DbWeight = (); - type RuntimeOrigin = RuntimeOrigin; - type RuntimeCall = RuntimeCall; - type Index = Index; - type BlockNumber = BlockNumber; - type Hash = H256; - type Hashing = BlakeTwo256; - type AccountId = AccountId; - type Lookup = IdentityLookup; - type Header = Header; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = BlockHashCount; - type Version = (); - type PalletInfo = PalletInfo; - type AccountData = (); - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = SS58Prefix; - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<16>; -} - -pub const DEFAULT_COLLATERAL_CURRENCY: CurrencyId = Token(DOT); -pub const DEFAULT_NATIVE_CURRENCY: CurrencyId = Token(INTR); -pub const DEFAULT_WRAPPED_CURRENCY: CurrencyId = Token(IBTC); - -parameter_types! { - pub const GetCollateralCurrencyId: CurrencyId = DEFAULT_COLLATERAL_CURRENCY; - pub const GetNativeCurrencyId: CurrencyId = DEFAULT_NATIVE_CURRENCY; - pub const GetWrappedCurrencyId: CurrencyId = DEFAULT_WRAPPED_CURRENCY; - pub const MaxLocks: u32 = 50; -} - -parameter_type_with_key! { - pub ExistentialDeposits: |_currency_id: CurrencyId| -> Balance { - Zero::zero() - }; -} - -impl orml_tokens::Config for Test { - type RuntimeEvent = RuntimeEvent; - type Balance = Balance; - type Amount = RawAmount; - type CurrencyId = CurrencyId; - type WeightInfo = (); - type ExistentialDeposits = ExistentialDeposits; - type CurrencyHooks = (); - type MaxLocks = MaxLocks; - type DustRemovalWhitelist = Everything; - type MaxReserves = ConstU32<0>; // we don't use named reserves - type ReserveIdentifier = (); // we don't use named reserves -} - -type CapacityRewardsInstance = reward::Instance1; - -impl reward::Config for Test { - type RuntimeEvent = RuntimeEvent; - type SignedFixedPoint = SignedFixedPoint; - type PoolId = (); - type StakeId = CurrencyId; - type CurrencyId = CurrencyId; - type MaxRewardCurrencies = ConstU32<10>; -} - -type VaultRewardsInstance = reward::Instance2; - -impl reward::Config for Test { - type RuntimeEvent = RuntimeEvent; - type SignedFixedPoint = SignedFixedPoint; - type PoolId = CurrencyId; - type StakeId = VaultId; - type CurrencyId = CurrencyId; - type MaxRewardCurrencies = ConstU32<10>; -} - -impl staking::Config for Test { - type RuntimeEvent = RuntimeEvent; - type SignedFixedPoint = SignedFixedPoint; - type SignedInner = SignedInner; - type CurrencyId = CurrencyId; - type GetNativeCurrencyId = GetNativeCurrencyId; -} - -parameter_types! { - pub const VaultPalletId: PalletId = PalletId(*b"mod/vreg"); -} - -impl frame_system::offchain::SendTransactionTypes for Test -where - RuntimeCall: From, -{ - type OverarchingCall = RuntimeCall; - type Extrinsic = TestExtrinsic; -} -pub struct CurrencyConvert; -impl currency::CurrencyConversion, CurrencyId> for CurrencyConvert { - fn convert( - amount: ¤cy::Amount, - to: CurrencyId, - ) -> Result, sp_runtime::DispatchError> { - let amount = convert_to(to, amount.amount())?; - Ok(Amount::new(amount, to)) - } -} - -#[cfg_attr(test, mockable)] -pub fn convert_to(to: CurrencyId, amount: Balance) -> Result { - Ok(amount) // default conversion 1:1 - overwritable with mocktopus -} - -impl currency::Config for Test { - type SignedInner = SignedInner; - type SignedFixedPoint = SignedFixedPoint; - type UnsignedFixedPoint = UnsignedFixedPoint; - type Balance = Balance; - type GetNativeCurrencyId = GetNativeCurrencyId; - type GetRelayChainCurrencyId = GetCollateralCurrencyId; - type GetWrappedCurrencyId = GetWrappedCurrencyId; - type CurrencyConversion = CurrencyConvert; -} - -impl vault_registry::Config for Test { - type PalletId = VaultPalletId; - type RuntimeEvent = RuntimeEvent; - type WeightInfo = (); - type GetGriefingCollateralCurrencyId = GetNativeCurrencyId; -} - -impl nomination::Config for Test { - type RuntimeEvent = RuntimeEvent; - type WeightInfo = (); -} - -parameter_types! { - pub const ParachainBlocksPerBitcoinBlock: BlockNumber = 100; -} - -impl btc_relay::Config for Test { - type RuntimeEvent = RuntimeEvent; - type ParachainBlocksPerBitcoinBlock = ParachainBlocksPerBitcoinBlock; - type WeightInfo = (); -} - -impl security::Config for Test { - type RuntimeEvent = RuntimeEvent; - type WeightInfo = (); -} - -parameter_types! { - pub const MinimumPeriod: Moment = 5; -} - -impl pallet_timestamp::Config for Test { - type Moment = Moment; - type OnTimestampSet = (); - type MinimumPeriod = MinimumPeriod; - type WeightInfo = (); -} - -impl oracle::Config for Test { - type RuntimeEvent = RuntimeEvent; - type OnExchangeRateChange = (); - type WeightInfo = (); - type MaxNameLength = ConstU32<255>; -} - -parameter_types! { - pub const FeePalletId: PalletId = PalletId(*b"mod/fees"); - pub const MaxExpectedValue: UnsignedFixedPoint = UnsignedFixedPoint::from_inner(::DIV); -} - -impl fee::Config for Test { - type FeePalletId = FeePalletId; - type WeightInfo = (); - type SignedFixedPoint = SignedFixedPoint; - type SignedInner = SignedInner; - type CapacityRewards = CapacityRewards; - type VaultRewards = VaultRewards; - type VaultStaking = VaultStaking; - type OnSweep = (); - type MaxExpectedValue = MaxExpectedValue; - type NominationApi = Nomination; -} - -impl Config for Test { - type RuntimeEvent = RuntimeEvent; - type WeightInfo = (); -} - -pub type TestEvent = RuntimeEvent; -pub type TestError = Error; - -pub const OLD_VAULT: VaultId = VaultId { - account_id: 1, - currencies: VaultCurrencyPair { - collateral: DEFAULT_COLLATERAL_CURRENCY, - wrapped: DEFAULT_WRAPPED_CURRENCY, - }, -}; -pub const NEW_VAULT: VaultId = VaultId { - account_id: 2, - currencies: VaultCurrencyPair { - collateral: DEFAULT_COLLATERAL_CURRENCY, - wrapped: DEFAULT_WRAPPED_CURRENCY, - }, -}; - -pub const OLD_VAULT_BALANCE: u128 = 1_000_000; -pub const NEW_VAULT_BALANCE: u128 = 1_000_000; - -pub struct ExtBuilder; - -impl ExtBuilder { - pub fn build_with(balances: orml_tokens::GenesisConfig) -> sp_io::TestExternalities { - let mut storage = frame_system::GenesisConfig::default().build_storage::().unwrap(); - - balances.assimilate_storage(&mut storage).unwrap(); - - fee::GenesisConfig:: { - issue_fee: UnsignedFixedPoint::checked_from_rational(5, 1000).unwrap(), // 0.5% - issue_griefing_collateral: UnsignedFixedPoint::checked_from_rational(5, 100000).unwrap(), // 0.005% - redeem_fee: UnsignedFixedPoint::checked_from_rational(5, 1000).unwrap(), // 0.5% - premium_redeem_fee: UnsignedFixedPoint::checked_from_rational(5, 100).unwrap(), // 5% - punishment_fee: UnsignedFixedPoint::checked_from_rational(1, 10).unwrap(), // 10% - replace_griefing_collateral: UnsignedFixedPoint::checked_from_rational(1, 10).unwrap(), // 10% - } - .assimilate_storage(&mut storage) - .unwrap(); - - const PAIR: VaultCurrencyPair = VaultCurrencyPair { - collateral: DEFAULT_COLLATERAL_CURRENCY, - wrapped: DEFAULT_WRAPPED_CURRENCY, - }; - vault_registry::GenesisConfig:: { - minimum_collateral_vault: vec![(DEFAULT_COLLATERAL_CURRENCY, 0)], - punishment_delay: 8, - system_collateral_ceiling: vec![(PAIR, 1_000_000_000_000)], - secure_collateral_threshold: vec![(PAIR, UnsignedFixedPoint::checked_from_rational(200, 100).unwrap())], - premium_redeem_threshold: vec![(PAIR, UnsignedFixedPoint::checked_from_rational(120, 100).unwrap())], - liquidation_collateral_threshold: vec![( - PAIR, - UnsignedFixedPoint::checked_from_rational(110, 100).unwrap(), - )], - } - .assimilate_storage(&mut storage) - .unwrap(); - - replace::GenesisConfig:: { - replace_period: 10, - replace_btc_dust_value: 2, - } - .assimilate_storage(&mut storage) - .unwrap(); - - storage.into() - } - - pub fn build() -> sp_io::TestExternalities { - ExtBuilder::build_with(orml_tokens::GenesisConfig:: { - balances: vec![ - (OLD_VAULT.account_id, Token(DOT), OLD_VAULT_BALANCE), - (NEW_VAULT.account_id, Token(DOT), NEW_VAULT_BALANCE), - ], - }) - } -} - -pub fn run_test(test: T) -where - T: FnOnce(), -{ - clear_mocks(); - ExtBuilder::build().execute_with(|| { - assert_ok!(>::_set_exchange_rate( - DEFAULT_COLLATERAL_CURRENCY, - UnsignedFixedPoint::one() - )); - System::set_block_number(1); - Security::set_active_block_number(1); - test(); - }); -} diff --git a/crates/replace/src/tests.rs b/crates/replace/src/tests.rs deleted file mode 100644 index 51cf8fa241..0000000000 --- a/crates/replace/src/tests.rs +++ /dev/null @@ -1,291 +0,0 @@ -use crate::{ - mock::{CurrencyId, *}, - *, -}; - -use bitcoin::merkle::PartialTransactionProof; -use btc_relay::BtcAddress; -use currency::Amount; -use frame_support::{assert_err, assert_ok}; -use mocktopus::mocking::*; -use sp_core::H256; - -type Event = crate::Event; - -macro_rules! assert_event_matches { - ($( $pattern:pat_param )|+ $( if $guard: expr )? $(,)?) => { - - assert!(System::events().iter().any(|a| { - match a.event { - TestEvent::Replace( $( $pattern )|+ ) $( if $guard )? => true, - _ => false - } - })); - } -} -fn test_request() -> ReplaceRequest { - ReplaceRequest { - period: 0, - new_vault: NEW_VAULT, - old_vault: OLD_VAULT, - accept_time: 1, - amount: 10, - griefing_collateral: 0, - btc_address: BtcAddress::random(), - collateral: 20, - btc_height: 0, - status: ReplaceRequestStatus::Pending, - } -} - -fn griefing(amount: u128) -> Amount { - Amount::new(amount, DEFAULT_NATIVE_CURRENCY) -} -fn wrapped(amount: u128) -> Amount { - Amount::new(amount, DEFAULT_WRAPPED_CURRENCY) -} - -fn get_some_unchecked_transaction() -> FullTransactionProof { - FullTransactionProof { - user_tx_proof: PartialTransactionProof { - transaction: Default::default(), - tx_encoded_len: u32::MAX, - merkle_proof: Default::default(), - }, - coinbase_proof: PartialTransactionProof { - transaction: Default::default(), - tx_encoded_len: u32::MAX, - merkle_proof: Default::default(), - }, - } -} - -mod request_replace_tests { - use super::*; - - fn setup_mocks() { - ext::vault_registry::ensure_not_banned::.mock_safe(|_| MockResult::Return(Ok(()))); - ext::vault_registry::requestable_to_be_replaced_tokens:: - .mock_safe(move |_| MockResult::Return(Ok(wrapped(1000000)))); - ext::vault_registry::try_increase_to_be_replaced_tokens:: - .mock_safe(|_, _| MockResult::Return(Ok(wrapped(2)))); - ext::fee::get_replace_griefing_collateral::.mock_safe(move |_| MockResult::Return(Ok(griefing(20)))); - ext::vault_registry::transfer_funds::.mock_safe(|_, _, _| MockResult::Return(Ok(()))); - } - - #[test] - fn test_request_replace_total_to_be_replace_above_dust_succeeds() { - run_test(|| { - setup_mocks(); - assert_ok!(Replace::_request_replace(OLD_VAULT, 1)); - assert_event_matches!(Event::RequestReplace { - old_vault_id: OLD_VAULT, - amount: 1, - .. - }); - }) - } - - #[test] - fn test_request_replace_above_requestable_succeeds() { - run_test(|| { - setup_mocks(); - ext::vault_registry::requestable_to_be_replaced_tokens:: - .mock_safe(move |_| MockResult::Return(Ok(wrapped(5)))); - assert_ok!(Replace::_request_replace(OLD_VAULT, 10)); - assert_event_matches!(Event::RequestReplace { - old_vault_id: OLD_VAULT, - amount: 5, - .. - }); - }) - } - - #[test] - fn test_request_replace_total_to_be_replace_below_dust_fails() { - run_test(|| { - setup_mocks(); - ext::vault_registry::try_increase_to_be_replaced_tokens:: - .mock_safe(|_, _| MockResult::Return(Ok(wrapped(1)))); - assert_err!( - Replace::_request_replace(OLD_VAULT, 1), - TestError::AmountBelowDustAmount - ); - }) - } - - #[test] - fn request_replace_should_fail_with_replace_amount_zero() { - run_test(|| { - setup_mocks(); - ext::vault_registry::try_increase_to_be_replaced_tokens:: - .mock_safe(|_, _| MockResult::Return(Ok(wrapped(1)))); - assert_err!(Replace::_request_replace(OLD_VAULT, 0), TestError::ReplaceAmountZero); - }) - } -} - -mod accept_replace_tests { - use super::*; - - fn setup_mocks() { - ext::vault_registry::ensure_not_banned::.mock_safe(|_| MockResult::Return(Ok(()))); - ext::vault_registry::decrease_to_be_replaced_tokens:: - .mock_safe(|_, _| MockResult::Return(Ok((wrapped(5), griefing(10))))); - ext::vault_registry::try_deposit_collateral::.mock_safe(|_, _| MockResult::Return(Ok(()))); - ext::vault_registry::try_increase_to_be_redeemed_tokens::.mock_safe(|_, _| MockResult::Return(Ok(()))); - ext::vault_registry::try_increase_to_be_issued_tokens::.mock_safe(|_, _| MockResult::Return(Ok(()))); - ext::vault_registry::transfer_funds::.mock_safe(|_, _, _| MockResult::Return(Ok(()))); - } - - #[test] - fn test_accept_replace_succeeds() { - run_test(|| { - setup_mocks(); - let btc_address = BtcAddress::random(); - assert_ok!(Replace::_accept_replace(OLD_VAULT, NEW_VAULT, 5, 10, btc_address)); - assert_event_matches!(Event::AcceptReplace{ - replace_id: _, - old_vault_id: OLD_VAULT, - new_vault_id: NEW_VAULT, - amount: 5, - collateral: 10, - btc_address: addr} if addr == btc_address); - }) - } - - #[test] - fn test_accept_replace_partial_accept_succeeds() { - run_test(|| { - // call to replace (5, 10), when there is only (4, 8) actually used - setup_mocks(); - ext::vault_registry::decrease_to_be_replaced_tokens:: - .mock_safe(|_, _| MockResult::Return(Ok((wrapped(4), griefing(8))))); - - let btc_address = BtcAddress::random(); - - assert_ok!(Replace::_accept_replace(OLD_VAULT, NEW_VAULT, 5, 10, btc_address)); - assert_event_matches!(Event::AcceptReplace{ - replace_id: _, - old_vault_id: OLD_VAULT, - new_vault_id: NEW_VAULT, - amount: 4, - collateral: 8, - btc_address: addr} if addr == btc_address); - }) - } - - #[test] - fn test_accept_replace_below_dust_fails() { - run_test(|| { - setup_mocks(); - ext::vault_registry::decrease_to_be_replaced_tokens:: - .mock_safe(|_, _| MockResult::Return(Ok((wrapped(1), griefing(10))))); - assert_err!( - Replace::_accept_replace(OLD_VAULT, NEW_VAULT, 5, 10, BtcAddress::random()), - TestError::AmountBelowDustAmount - ); - }) - } -} - -mod execute_replace_test { - use currency::Amount; - - use super::*; - - fn setup_mocks() { - ReplaceRequests::::insert(H256::zero(), { - let mut replace = test_request(); - replace.old_vault = OLD_VAULT; - replace.new_vault = NEW_VAULT; - replace - }); - - Replace::replace_period.mock_safe(|| MockResult::Return(20)); - ext::btc_relay::has_request_expired::.mock_safe(|_, _, _| MockResult::Return(Ok(false))); - ext::btc_relay::verify_and_validate_op_return_transaction:: - .mock_safe(|_, _, _, _| MockResult::Return(Ok(()))); - ext::vault_registry::replace_tokens::.mock_safe(|_, _, _, _| MockResult::Return(Ok(()))); - Amount::::unlock_on.mock_safe(|_, _| MockResult::Return(Ok(()))); - ext::vault_registry::transfer_funds::.mock_safe(|_, _, _| MockResult::Return(Ok(()))); - - ext::vault_registry::try_increase_to_be_redeemed_tokens::.mock_safe(|_, _| MockResult::Return(Ok(()))); - ext::vault_registry::try_increase_to_be_issued_tokens::.mock_safe(|_, _| MockResult::Return(Ok(()))); - } - - #[test] - fn test_execute_replace_succeeds() { - run_test(|| { - setup_mocks(); - assert_ok!(Replace::_execute_replace( - H256::zero(), - get_some_unchecked_transaction() - )); - assert_event_matches!(Event::ExecuteReplace { - replace_id: _, - old_vault_id: OLD_VAULT, - new_vault_id: NEW_VAULT - }); - }) - } - - #[test] - fn should_execute_cancelled_request() { - run_test(|| { - setup_mocks(); - - ReplaceRequests::::insert(H256::zero(), { - let mut replace = test_request(); - replace.old_vault = OLD_VAULT; - replace.new_vault = NEW_VAULT; - replace.status = ReplaceRequestStatus::Cancelled; - replace - }); - - assert_ok!(Replace::_execute_replace( - H256::zero(), - get_some_unchecked_transaction() - )); - assert_event_matches!(Event::ExecuteReplace { - replace_id: _, - old_vault_id: OLD_VAULT, - new_vault_id: NEW_VAULT - }); - }) - } -} - -mod cancel_replace_tests { - use super::*; - - fn setup_mocks() { - Replace::get_open_replace_request.mock_safe(move |_| { - let mut replace = test_request(); - replace.old_vault = OLD_VAULT; - replace.new_vault = NEW_VAULT; - MockResult::Return(Ok(replace)) - }); - - Replace::replace_period.mock_safe(|| MockResult::Return(20)); - ext::btc_relay::has_request_expired::.mock_safe(|_, _, _| MockResult::Return(Ok(true))); - ext::vault_registry::is_vault_liquidated::.mock_safe(|_| MockResult::Return(Ok(false))); - ext::vault_registry::cancel_replace_tokens::.mock_safe(|_, _, _| MockResult::Return(Ok(()))); - ext::vault_registry::transfer_funds::.mock_safe(|_, _, _| MockResult::Return(Ok(()))); - ext::vault_registry::is_allowed_to_withdraw_collateral::.mock_safe(|_, _| MockResult::Return(Ok(false))); - } - - #[test] - fn test_cancel_replace_succeeds() { - run_test(|| { - setup_mocks(); - assert_ok!(Replace::_cancel_replace(H256::zero(),)); - assert_event_matches!(Event::CancelReplace { - replace_id: _, - new_vault_id: NEW_VAULT, - old_vault_id: OLD_VAULT, - griefing_collateral: _ - }); - }) - } -} diff --git a/crates/replace/src/types.rs b/crates/replace/src/types.rs deleted file mode 100644 index 849151a643..0000000000 --- a/crates/replace/src/types.rs +++ /dev/null @@ -1,59 +0,0 @@ -use crate::Config; -use codec::{Decode, Encode, MaxEncodedLen}; -use currency::Amount; -use frame_support::traits::Get; -pub use primitives::replace::{ReplaceRequest, ReplaceRequestStatus}; -use primitives::VaultId; -use scale_info::TypeInfo; -use sp_core::H160; -use sp_runtime::DispatchError; -use vault_registry::types::CurrencyId; - -/// Storage version. -#[derive(Encode, Decode, Eq, PartialEq, TypeInfo, MaxEncodedLen)] -pub enum Version { - /// Initial version. - V0, -} - -pub(crate) type BalanceOf = ::Balance; - -pub(crate) type DefaultVaultId = VaultId<::AccountId, CurrencyId>; - -#[derive(Encode, Decode, Default, Clone, PartialEq)] -pub(crate) struct ReplaceRequestV0 { - pub old_vault: AccountId, - pub open_time: BlockNumber, - pub amount: Balance, - pub griefing_collateral: Balance, - pub new_vault: Option, - pub collateral: Balance, - pub accept_time: Option, - pub btc_address: H160, - pub completed: bool, -} - -pub type DefaultReplaceRequest = ReplaceRequest< - ::AccountId, - ::BlockNumber, - BalanceOf, - CurrencyId, ->; - -pub trait ReplaceRequestExt { - fn amount(&self) -> Amount; - fn griefing_collateral(&self) -> Amount; - fn collateral(&self) -> Result, DispatchError>; -} - -impl ReplaceRequestExt for DefaultReplaceRequest { - fn amount(&self) -> Amount { - Amount::new(self.amount, self.old_vault.wrapped_currency()) - } - fn griefing_collateral(&self) -> Amount { - Amount::new(self.griefing_collateral, T::GetGriefingCollateralCurrencyId::get()) - } - fn collateral(&self) -> Result, DispatchError> { - Ok(Amount::new(self.collateral, self.new_vault.collateral_currency())) - } -} diff --git a/crates/vault-registry/src/lib.rs b/crates/vault-registry/src/lib.rs index c6321504d0..b8ee2e79b0 100644 --- a/crates/vault-registry/src/lib.rs +++ b/crates/vault-registry/src/lib.rs @@ -479,10 +479,8 @@ pub mod pallet { issued_tokens: BalanceOf, to_be_issued_tokens: BalanceOf, to_be_redeemed_tokens: BalanceOf, - to_be_replaced_tokens: BalanceOf, backing_collateral: BalanceOf, status: VaultStatus, - replace_collateral: BalanceOf, }, BanVault { vault_id: DefaultVaultId, @@ -889,16 +887,6 @@ impl Pallet { ); Self::slash_backing_collateral(vault_id, amount)?; } - CurrencySource::AvailableReplaceCollateral(ref vault_id) => { - let mut vault = Self::get_active_rich_vault_from_id(&vault_id)?; - vault.decrease_available_replace_collateral(amount)?; - amount.unlock_on(&from.account_id())?; - } - CurrencySource::ActiveReplaceCollateral(ref vault_id) => { - let mut vault = Self::get_rich_vault_from_id(&vault_id)?; - vault.decrease_active_replace_collateral(amount)?; - amount.unlock_on(&from.account_id())?; - } CurrencySource::UserGriefing(_) => { amount.unlock_on(&from.account_id())?; } @@ -930,16 +918,6 @@ impl Pallet { ); Self::try_deposit_collateral(vault_id, amount)?; } - CurrencySource::AvailableReplaceCollateral(ref vault_id) => { - let mut vault = Self::get_active_rich_vault_from_id(&vault_id)?; - vault.increase_available_replace_collateral(amount)?; - amount.lock_on(&to.account_id())?; - } - CurrencySource::ActiveReplaceCollateral(ref vault_id) => { - let mut vault = Self::get_rich_vault_from_id(&vault_id)?; - vault.increase_active_replace_collateral(amount)?; - amount.lock_on(&to.account_id())?; - } CurrencySource::UserGriefing(_) => { amount.lock_on(&to.account_id())?; } @@ -1003,65 +981,7 @@ impl Pallet { pub fn requestable_to_be_replaced_tokens(vault_id: &DefaultVaultId) -> Result, DispatchError> { let vault = Self::get_active_rich_vault_from_id(&vault_id)?; - vault - .issued_tokens() - .checked_sub(&vault.to_be_replaced_tokens())? - .checked_sub(&vault.to_be_redeemed_tokens()) - } - - /// returns the new total to-be-replaced and replace-collateral - pub fn try_increase_to_be_replaced_tokens( - vault_id: &DefaultVaultId, - tokens: &Amount, - ) -> Result, DispatchError> { - let mut vault = Self::get_active_rich_vault_from_id(&vault_id)?; - - let new_to_be_replaced = vault.to_be_replaced_tokens().checked_add(&tokens)?; - let total_decreasing_tokens = new_to_be_replaced.checked_add(&vault.to_be_redeemed_tokens())?; - - ensure!( - total_decreasing_tokens.le(&vault.issued_tokens())?, - Error::::InsufficientTokensCommitted - ); - - vault.set_to_be_replaced_amount(&new_to_be_replaced)?; - - Self::deposit_event(Event::::IncreaseToBeReplacedTokens { - vault_id: vault.id(), - increase: tokens.amount(), - }); - - Ok(new_to_be_replaced) - } - - pub fn decrease_to_be_replaced_tokens( - vault_id: &DefaultVaultId, - tokens: &Amount, - ) -> Result<(Amount, Amount), DispatchError> { - let mut vault = Self::get_rich_vault_from_id(&vault_id)?; - - let initial_to_be_replaced = Amount::new(vault.data.to_be_replaced_tokens, vault_id.wrapped_currency()); - let initial_griefing_collateral = - Amount::new(vault.data.replace_collateral, T::GetGriefingCollateralCurrencyId::get()); - - let used_tokens = tokens.min(&initial_to_be_replaced)?; - - let used_collateral = - Self::calculate_collateral(&initial_griefing_collateral, &used_tokens, &initial_to_be_replaced)?; - - // make sure we don't use too much if a rounding error occurs - let used_collateral = used_collateral.min(&initial_griefing_collateral)?; - - let new_to_be_replaced = initial_to_be_replaced.checked_sub(&used_tokens)?; - - vault.set_to_be_replaced_amount(&new_to_be_replaced)?; - - Self::deposit_event(Event::::DecreaseToBeReplacedTokens { - vault_id: vault.id(), - decrease: tokens.amount(), - }); - - Ok((used_tokens, used_collateral)) + vault.issued_tokens().checked_sub(&vault.to_be_redeemed_tokens()) } /// Decreases the amount of tokens to be issued in the next issue request from the @@ -1386,27 +1306,6 @@ impl Pallet { Ok(()) } - /// Withdraws an `amount` of tokens that were requested for replacement by `vault_id` - /// - /// # Arguments - /// * `vault_id` - the id of the vault - /// * `amount` - the amount of tokens to be withdrawn from replace requests - pub fn withdraw_replace_request( - vault_id: &DefaultVaultId, - amount: &Amount, - ) -> Result<(Amount, Amount), DispatchError> { - let (withdrawn_tokens, to_withdraw_collateral) = Self::decrease_to_be_replaced_tokens(&vault_id, &amount)?; - - // release the used collateral - Self::transfer_funds( - CurrencySource::AvailableReplaceCollateral(vault_id.clone()), - CurrencySource::FreeBalance(vault_id.account_id.clone()), - &to_withdraw_collateral, - )?; - - Ok((withdrawn_tokens, to_withdraw_collateral)) - } - fn undercollateralized_vaults() -> impl Iterator> { >::iter().filter_map(|(vault_id, vault)| { if let Some(liquidation_threshold) = Self::liquidation_collateral_threshold(&vault.id.currencies) { @@ -1436,10 +1335,8 @@ impl Pallet { issued_tokens: vault_orig.issued_tokens, to_be_issued_tokens: vault_orig.to_be_issued_tokens, to_be_redeemed_tokens: vault_orig.to_be_redeemed_tokens, - to_be_replaced_tokens: vault_orig.to_be_replaced_tokens, backing_collateral: backing_collateral.amount(), status: VaultStatus::Liquidated, - replace_collateral: vault_orig.replace_collateral, }); Ok(to_slash) } @@ -1910,25 +1807,8 @@ impl Pallet { #[cfg(feature = "integration-tests")] pub fn collateral_integrity_check() { - let griefing_currency = T::GetGriefingCollateralCurrencyId::get(); for (vault_id, vault) in Vaults::::iter().filter(|(_, vault)| matches!(vault.status, VaultStatus::Active(_))) { - // check that there is enough griefing collateral - let active_griefing = CurrencySource::::ActiveReplaceCollateral(vault_id.clone()) - .current_balance(griefing_currency) - .unwrap(); - let available_replace_collateral = CurrencySource::::AvailableReplaceCollateral(vault_id.clone()) - .current_balance(griefing_currency) - .unwrap(); - let total_replace_collateral = active_griefing + available_replace_collateral.clone(); - let reserved_balance = ext::currency::get_reserved_balance(griefing_currency, &vault_id.account_id); - assert!(reserved_balance.ge(&total_replace_collateral).unwrap()); - - if available_replace_collateral.is_zero() { - // we can't have reserved collateral for to_be_replaced tokens if there are no to-be-replaced tokens - assert!(vault.to_be_replaced_tokens.is_zero()); - } - let liquidated_collateral = CurrencySource::::LiquidatedCollateral(vault_id.clone()) .current_balance(vault_id.collateral_currency()) .unwrap(); diff --git a/crates/vault-registry/src/mock.rs b/crates/vault-registry/src/mock.rs index dbe11826e1..15029d441b 100644 --- a/crates/vault-registry/src/mock.rs +++ b/crates/vault-registry/src/mock.rs @@ -269,7 +269,7 @@ impl traits::NominationApi, currency::Amount) -> Result<(), DispatchError> { + fn ensure_opted_in_to_nomination(_vault_id: &VaultId) -> Result<(), DispatchError> { Ok(()) } #[cfg(any(feature = "runtime-benchmarks", test))] diff --git a/crates/vault-registry/src/tests.rs b/crates/vault-registry/src/tests.rs index cd1dd05cc2..7e1ed457f1 100644 --- a/crates/vault-registry/src/tests.rs +++ b/crates/vault-registry/src/tests.rs @@ -66,10 +66,6 @@ fn amount(amount: u128) -> Amount { Amount::new(amount, DEFAULT_COLLATERAL_CURRENCY) } -fn griefing(amount: u128) -> Amount { - Amount::new(amount, DEFAULT_NATIVE_CURRENCY) -} - fn wrapped(amount: u128) -> Amount { Amount::new(amount, DEFAULT_WRAPPED_CURRENCY) } @@ -302,37 +298,6 @@ fn issue_tokens_fails_with_insufficient_tokens() { }); } -#[test] -fn try_increase_to_be_replaced_tokens_succeeds() { - run_test(|| { - let id = create_sample_vault(); - - assert_ok!(VaultRegistry::try_increase_to_be_issued_tokens(&id, &wrapped(50)),); - assert_ok!(VaultRegistry::issue_tokens(&id, &wrapped(50))); - assert_ok!(VaultRegistry::try_increase_to_be_replaced_tokens(&id, &wrapped(50))); - let vault = VaultRegistry::get_active_rich_vault_from_id(&id).unwrap(); - assert_eq!(vault.data.issued_tokens, 50); - assert_eq!(vault.data.to_be_replaced_tokens, 50); - assert_emitted!(Event::IncreaseToBeReplacedTokens { - vault_id: id, - increase: 50 - }); - }); -} - -#[test] -fn try_increase_to_be_replaced_tokens_fails_with_insufficient_tokens() { - run_test(|| { - let id = create_sample_vault(); - - // important: should not change the storage state - assert_noop!( - VaultRegistry::try_increase_to_be_replaced_tokens(&id, &wrapped(50)), - TestError::InsufficientTokensCommitted - ); - }); -} - #[test] fn try_increase_to_be_redeemed_tokens_succeeds() { run_test(|| { @@ -1324,81 +1289,6 @@ mod get_vaults_with_redeemable_tokens_test { } } -#[test] -fn test_try_increase_to_be_replaced_tokens() { - run_test(|| { - let issue_tokens: u128 = 4; - let vault_id = create_sample_vault_and_issue_tokens(issue_tokens); - assert_ok!(VaultRegistry::try_increase_to_be_redeemed_tokens( - &vault_id, - &wrapped(1) - )); - - let total_wrapped = VaultRegistry::try_increase_to_be_replaced_tokens(&vault_id, &wrapped(2)).unwrap(); - assert!(total_wrapped == wrapped(2)); - - // check that we can't request more than we have issued tokens - assert_noop!( - VaultRegistry::try_increase_to_be_replaced_tokens(&vault_id, &wrapped(3)), - TestError::InsufficientTokensCommitted - ); - - // check that we can't request replacement for tokens that are marked as to-be-redeemed - assert_noop!( - VaultRegistry::try_increase_to_be_replaced_tokens(&vault_id, &wrapped(2)), - TestError::InsufficientTokensCommitted - ); - - let mut vault = VaultRegistry::get_active_rich_vault_from_id(&vault_id).unwrap(); - vault.increase_available_replace_collateral(&griefing(10)).unwrap(); - - let total_wrapped = VaultRegistry::try_increase_to_be_replaced_tokens(&vault_id, &wrapped(1)).unwrap(); - assert_eq!(total_wrapped, wrapped(3)); - - // check that to_be_replaced_tokens is was written to storage - let vault = VaultRegistry::get_active_vault_from_id(&vault_id).unwrap(); - assert_eq!(vault.to_be_replaced_tokens, 3); - }) -} - -#[test] -fn test_decrease_to_be_replaced_tokens_over_capacity() { - run_test(|| { - let issue_tokens: u128 = 4; - let vault_id = create_sample_vault_and_issue_tokens(issue_tokens); - - assert_ok!(VaultRegistry::try_increase_to_be_replaced_tokens( - &vault_id, - &wrapped(4), - )); - let mut vault = VaultRegistry::get_active_rich_vault_from_id(&vault_id).unwrap(); - vault.increase_available_replace_collateral(&griefing(10)).unwrap(); - - let (tokens, collateral) = VaultRegistry::decrease_to_be_replaced_tokens(&vault_id, &wrapped(5)).unwrap(); - assert_eq!(tokens, wrapped(4)); - assert_eq!(collateral, griefing(10)); - }) -} - -#[test] -fn test_decrease_to_be_replaced_tokens_below_capacity() { - run_test(|| { - let issue_tokens: u128 = 4; - let vault_id = create_sample_vault_and_issue_tokens(issue_tokens); - - assert_ok!(VaultRegistry::try_increase_to_be_replaced_tokens( - &vault_id, - &wrapped(4), - )); - let mut vault = VaultRegistry::get_active_rich_vault_from_id(&vault_id).unwrap(); - vault.increase_available_replace_collateral(&griefing(10)).unwrap(); - - let (tokens, collateral) = VaultRegistry::decrease_to_be_replaced_tokens(&vault_id, &wrapped(3)).unwrap(); - assert_eq!(tokens, wrapped(3)); - assert_eq!(collateral, griefing(7)); - }) -} - #[test] fn test_offchain_worker_unsigned_transaction_submission() { let mut externalities = crate::mock::ExtBuilder::build(); diff --git a/crates/vault-registry/src/types.rs b/crates/vault-registry/src/types.rs index 7570ac6c6f..9a32a828be 100644 --- a/crates/vault-registry/src/types.rs +++ b/crates/vault-registry/src/types.rs @@ -42,10 +42,6 @@ pub enum Version { pub enum CurrencySource { /// Used by vault to back issued tokens Collateral(DefaultVaultId), - /// Collateral put down by request_replace, but that has not been accepted yet - AvailableReplaceCollateral(DefaultVaultId), - /// Collateral that is locked, but not used to back issued tokens (e.g. griefing collateral) - ActiveReplaceCollateral(DefaultVaultId), /// User's issue griefing collateral UserGriefing(::AccountId), /// Unlocked balance @@ -61,8 +57,6 @@ impl CurrencySource { pub fn account_id(&self) -> ::AccountId { match self { CurrencySource::Collateral(DefaultVaultId:: { account_id: x, .. }) - | CurrencySource::AvailableReplaceCollateral(DefaultVaultId:: { account_id: x, .. }) - | CurrencySource::ActiveReplaceCollateral(DefaultVaultId:: { account_id: x, .. }) | CurrencySource::UserGriefing(x) | CurrencySource::FreeBalance(x) | CurrencySource::LiquidatedCollateral(DefaultVaultId:: { account_id: x, .. }) => x.clone(), @@ -73,17 +67,6 @@ impl CurrencySource { pub fn current_balance(&self, currency_id: CurrencyId) -> Result, DispatchError> { let amount = match self { CurrencySource::Collateral(vault_id) => Pallet::::get_backing_collateral(vault_id)?, - CurrencySource::AvailableReplaceCollateral(vault_id) => { - let vault = Pallet::::get_vault_from_id(vault_id)?; - Amount::new(vault.replace_collateral, T::GetGriefingCollateralCurrencyId::get()) - } - CurrencySource::ActiveReplaceCollateral(vault_id) => { - let vault = Pallet::::get_vault_from_id(vault_id)?; - Amount::new( - vault.active_replace_collateral, - T::GetGriefingCollateralCurrencyId::get(), - ) - } CurrencySource::UserGriefing(x) => ext::currency::get_reserved_balance::(currency_id, x), CurrencySource::FreeBalance(x) => ext::currency::get_free_balance::(currency_id, x), CurrencySource::LiquidatedCollateral(vault_id) => { @@ -157,14 +140,6 @@ pub struct Vault RichVault { Ok(Amount::new(amount, self.wrapped_currency())) } - pub(crate) fn to_be_replaced_tokens(&self) -> Amount { - Amount::new(self.data.to_be_replaced_tokens, self.wrapped_currency()) - } - pub(crate) fn to_be_redeemed_tokens(&self) -> Amount { Amount::new(self.data.to_be_redeemed_tokens, self.wrapped_currency()) } @@ -454,53 +422,6 @@ impl RichVault { self.issued_tokens().checked_sub(&self.to_be_redeemed_tokens()) } - pub(crate) fn set_to_be_replaced_amount(&mut self, tokens: &Amount) -> DispatchResult { - self.update(|v| { - v.to_be_replaced_tokens = tokens.amount(); - Ok(()) - }) - } - - pub(crate) fn increase_available_replace_collateral(&mut self, amount: &Amount) -> DispatchResult { - self.update(|v| { - v.replace_collateral = v - .replace_collateral - .checked_add(&amount.amount()) - .ok_or(ArithmeticError::Overflow)?; - Ok(()) - }) - } - - pub(crate) fn decrease_available_replace_collateral(&mut self, amount: &Amount) -> DispatchResult { - self.update(|v| { - v.replace_collateral = v - .replace_collateral - .checked_sub(&amount.amount()) - .ok_or(ArithmeticError::Underflow)?; - Ok(()) - }) - } - - pub(crate) fn increase_active_replace_collateral(&mut self, amount: &Amount) -> DispatchResult { - self.update(|v| { - v.active_replace_collateral = v - .active_replace_collateral - .checked_add(&amount.amount()) - .ok_or(ArithmeticError::Overflow)?; - Ok(()) - }) - } - - pub(crate) fn decrease_active_replace_collateral(&mut self, amount: &Amount) -> DispatchResult { - self.update(|v| { - v.active_replace_collateral = v - .active_replace_collateral - .checked_sub(&amount.amount()) - .ok_or(ArithmeticError::Underflow)?; - Ok(()) - }) - } - pub(crate) fn set_custom_secure_threshold(&mut self, threshold: Option>) -> DispatchResult { self.update(|v| { v.secure_collateral_threshold = threshold; @@ -578,8 +499,6 @@ impl RichVault { .ok_or(Error::::ThresholdNotSet)?, )?; - // Clear `to_be_replaced` tokens, since the vault will have no more `issued` or `to_be_issued` tokens. - let _ = Pallet::::withdraw_replace_request(&self.data.id, &self.to_be_replaced_tokens())?; // the vault struct was modified in the call above - we need to re-fetch, // otherwise changes get overwritten below *self = Pallet::::get_rich_vault_from_id(&vault_id)?; diff --git a/parachain/Cargo.toml b/parachain/Cargo.toml index 29e46babfc..6c1f0d2248 100644 --- a/parachain/Cargo.toml +++ b/parachain/Cargo.toml @@ -42,7 +42,6 @@ escrow-rpc-runtime-api = { path = "../crates/escrow/rpc/runtime-api" } reward-rpc-runtime-api = { path = "../crates/reward/rpc/runtime-api" } issue-rpc-runtime-api = { path = "../crates/issue/rpc/runtime-api" } redeem-rpc-runtime-api = { path = "../crates/redeem/rpc/runtime-api" } -replace-rpc-runtime-api = { path = "../crates/replace/rpc/runtime-api" } loans-rpc-runtime-api = { path = "../crates/loans/rpc/runtime-api" } dex-general-rpc-runtime-api = { path = "../crates/dex-general/rpc/runtime-api" } dex-stable-rpc-runtime-api = { path = "../crates/dex-stable/rpc/runtime-api" } diff --git a/parachain/runtime/common/Cargo.toml b/parachain/runtime/common/Cargo.toml index b66f349dcf..1ea78addcd 100644 --- a/parachain/runtime/common/Cargo.toml +++ b/parachain/runtime/common/Cargo.toml @@ -37,7 +37,6 @@ loans = { path = "../../../crates/loans", default-features = false } nomination = { path = "../../../crates/nomination", default-features = false } oracle = { path = "../../../crates/oracle", default-features = false } redeem = { path = "../../../crates/redeem", default-features = false } -replace = { path = "../../../crates/replace", default-features = false } reward = { path = "../../../crates/reward", default-features = false } security = { path = "../../../crates/security", default-features = false } staking = { path = "../../../crates/staking", default-features = false } @@ -98,7 +97,6 @@ std = [ "nomination/std", "oracle/std", "redeem/std", - "replace/std", "reward/std", "security/std", "staking/std", @@ -141,7 +139,6 @@ try-runtime = [ "nomination/try-runtime", "oracle/try-runtime", "redeem/try-runtime", - "replace/try-runtime", "reward/try-runtime", "security/try-runtime", "staking/try-runtime", diff --git a/parachain/runtime/interlay/Cargo.toml b/parachain/runtime/interlay/Cargo.toml index 43d729e0d2..89ca450d17 100644 --- a/parachain/runtime/interlay/Cargo.toml +++ b/parachain/runtime/interlay/Cargo.toml @@ -97,7 +97,6 @@ multi-transaction-payment = { path = "../../../crates/multi-transaction-payment" nomination = { path = "../../../crates/nomination", default-features = false } oracle = { path = "../../../crates/oracle", default-features = false } redeem = { path = "../../../crates/redeem", default-features = false } -replace = { path = "../../../crates/replace", default-features = false } reward = { path = "../../../crates/reward", default-features = false } security = { path = "../../../crates/security", default-features = false } staking = { path = "../../../crates/staking", default-features = false } @@ -117,7 +116,6 @@ issue-rpc-runtime-api = { path = "../../../crates/issue/rpc/runtime-api", defaul loans-rpc-runtime-api = { path = "../../../crates/loans/rpc/runtime-api", default-features = false } oracle-rpc-runtime-api = { path = "../../../crates/oracle/rpc/runtime-api", default-features = false } redeem-rpc-runtime-api = { path = "../../../crates/redeem/rpc/runtime-api", default-features = false } -replace-rpc-runtime-api = { path = "../../../crates/replace/rpc/runtime-api", default-features = false } reward-rpc-runtime-api = { path = "../../../crates/reward/rpc/runtime-api", default-features = false } vault-registry-rpc-runtime-api = { path = "../../../crates/vault-registry/rpc/runtime-api", default-features = false } @@ -235,7 +233,6 @@ std = [ "nomination/std", "oracle/std", "redeem/std", - "replace/std", "reward/std", "security/std", "staking/std", @@ -255,7 +252,6 @@ std = [ "loans-rpc-runtime-api/std", "oracle-rpc-runtime-api/std", "redeem-rpc-runtime-api/std", - "replace-rpc-runtime-api/std", "reward-rpc-runtime-api/std", "vault-registry-rpc-runtime-api/std", @@ -315,7 +311,6 @@ runtime-benchmarks = [ "nomination/runtime-benchmarks", "oracle/runtime-benchmarks", "redeem/runtime-benchmarks", - "replace/runtime-benchmarks", "security/runtime-benchmarks", "supply/runtime-benchmarks", "traits/runtime-benchmarks", @@ -376,7 +371,6 @@ try-runtime = [ "nomination/try-runtime", "oracle/try-runtime", "redeem/try-runtime", - "replace/try-runtime", "reward/try-runtime", "security/try-runtime", "staking/try-runtime", diff --git a/parachain/runtime/interlay/src/lib.rs b/parachain/runtime/interlay/src/lib.rs index 4267d35739..a4fb9ba639 100644 --- a/parachain/runtime/interlay/src/lib.rs +++ b/parachain/runtime/interlay/src/lib.rs @@ -112,7 +112,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("interlay-parachain"), impl_name: create_runtime_str!("interlay-parachain"), authoring_version: 1, - spec_version: 1025000, + spec_version: 1025001, impl_version: 1, transaction_version: 4, apis: RUNTIME_API_VERSIONS, @@ -1155,13 +1155,6 @@ impl redeem::Config for Runtime { type WeightInfo = weights::redeem::WeightInfo; } -pub use replace::ReplaceRequest; - -impl replace::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type WeightInfo = weights::replace::WeightInfo; -} - pub use nomination::Event as NominationEvent; impl nomination::Config for Runtime { @@ -1252,8 +1245,7 @@ construct_runtime! { Oracle: oracle::{Pallet, Call, Config, Storage, Event} = 62, Issue: issue::{Pallet, Call, Config, Storage, Event} = 63, Redeem: redeem::{Pallet, Call, Config, Storage, Event} = 64, - Replace: replace::{Pallet, Call, Config, Storage, Event} = 65, - Fee: fee::{Pallet, Call, Config, Storage} = 66, + Fee: fee::{Pallet, Call, Config, Storage} = 65, // Refund: 67 Nomination: nomination::{Pallet, Call, Config, Storage, Event} = 68, ClientsInfo: clients_info::{Pallet, Call, Storage, Event} = 69, @@ -1324,13 +1316,7 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, - ( - orml_asset_registry::Migration, - orml_unknown_tokens::Migration, - dex::SetLoansExchangeRates, - issue::migration::v1::Migration, - evm::SetEvmChainId, - ), + (evm::SetEvmChainId,), >; impl fp_self_contained::SelfContainedCall for RuntimeCall { @@ -1438,7 +1424,6 @@ mod benches { [nomination, Nomination] [oracle, Oracle] [redeem, Redeem] - [replace, Replace] [security, Security] [supply, Supply] [tx_pause, TxPause] @@ -1958,21 +1943,6 @@ impl_runtime_apis! { } } - impl replace_rpc_runtime_api::ReplaceApi< - Block, - AccountId, - H256, - ReplaceRequest - > for Runtime { - fn get_old_vault_replace_requests(vault_id: AccountId) -> Vec { - Replace::get_replace_requests_for_old_vault(vault_id) - } - - fn get_new_vault_replace_requests(vault_id: AccountId) -> Vec { - Replace::get_replace_requests_for_new_vault(vault_id) - } - } - #[cfg(feature = "try-runtime")] impl frame_try_runtime::TryRuntime for Runtime { fn on_runtime_upgrade(checks: frame_try_runtime::UpgradeCheckSelect) -> (Weight, Weight) { diff --git a/parachain/runtime/interlay/src/weights/annuity_escrow_annuity.rs b/parachain/runtime/interlay/src/weights/annuity_escrow_annuity.rs index 0c462ec7e4..984ac5a0a5 100644 --- a/parachain/runtime/interlay/src/weights/annuity_escrow_annuity.rs +++ b/parachain/runtime/interlay/src/weights/annuity_escrow_annuity.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for annuity //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-jrrg4`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/interlay/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -44,8 +44,8 @@ impl annuity::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 15_962_000 picoseconds. - Weight::from_parts(16_652_000, 0) + // Minimum execution time: 13_878_000 picoseconds. + Weight::from_parts(14_369_000, 0) } /// Storage: EscrowRewards Stake (r:1 w:0) /// Proof: EscrowRewards Stake (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) @@ -61,10 +61,10 @@ impl annuity::WeightInfo for WeightInfo { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn withdraw_rewards () -> Weight { // Proof Size summary in bytes: - // Measured: `747` - // Estimated: `23880` - // Minimum execution time: 144_859_000 picoseconds. - Weight::from_parts(150_600_000, 23880) + // Measured: `1014` + // Estimated: `6170` + // Minimum execution time: 125_391_000 picoseconds. + Weight::from_parts(130_662_000, 6170) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -72,17 +72,17 @@ impl annuity::WeightInfo for WeightInfo { /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) fn update_rewards () -> Weight { // Proof Size summary in bytes: - // Measured: `319` + // Measured: `536` // Estimated: `3580` - // Minimum execution time: 26_200_000 picoseconds. - Weight::from_parts(27_770_000, 3580) + // Minimum execution time: 23_708_000 picoseconds. + Weight::from_parts(25_200_000, 3580) .saturating_add(T::DbWeight::get().reads(1_u64)) } fn set_reward_per_wrapped () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 10_013_000 picoseconds. - Weight::from_parts(10_547_000, 0) + // Minimum execution time: 9_058_000 picoseconds. + Weight::from_parts(9_459_000, 0) } } \ No newline at end of file diff --git a/parachain/runtime/interlay/src/weights/annuity_vault_annuity.rs b/parachain/runtime/interlay/src/weights/annuity_vault_annuity.rs index cd70a7a700..42ba284b23 100644 --- a/parachain/runtime/interlay/src/weights/annuity_vault_annuity.rs +++ b/parachain/runtime/interlay/src/weights/annuity_vault_annuity.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for annuity //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-jrrg4`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/interlay/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -44,8 +44,8 @@ impl annuity::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 16_456_000 picoseconds. - Weight::from_parts(16_919_000, 0) + // Minimum execution time: 14_750_000 picoseconds. + Weight::from_parts(15_390_000, 0) } fn withdraw_rewards () -> Weight { // Proof Size summary in bytes: @@ -58,17 +58,17 @@ impl annuity::WeightInfo for WeightInfo { /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) fn update_rewards () -> Weight { // Proof Size summary in bytes: - // Measured: `319` + // Measured: `536` // Estimated: `3580` - // Minimum execution time: 25_859_000 picoseconds. - Weight::from_parts(27_884_000, 3580) + // Minimum execution time: 23_998_000 picoseconds. + Weight::from_parts(25_060_000, 3580) .saturating_add(T::DbWeight::get().reads(1_u64)) } fn set_reward_per_wrapped () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 10_298_000 picoseconds. - Weight::from_parts(10_736_000, 0) + // Minimum execution time: 9_028_000 picoseconds. + Weight::from_parts(9_399_000, 0) } } \ No newline at end of file diff --git a/parachain/runtime/interlay/src/weights/btc_relay.rs b/parachain/runtime/interlay/src/weights/btc_relay.rs index 49ed445af2..0958e8c733 100644 --- a/parachain/runtime/interlay/src/weights/btc_relay.rs +++ b/parachain/runtime/interlay/src/weights/btc_relay.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for btc_relay //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-jrrg4`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/interlay/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -62,10 +62,10 @@ impl btc_relay::WeightInfo for WeightInfo { /// Proof: BTCRelay BlockHeaders (max_values: None, max_size: Some(200), added: 2675, mode: MaxEncodedLen) fn initialize () -> Weight { // Proof Size summary in bytes: - // Measured: `430` - // Estimated: `9470` - // Minimum execution time: 84_891_000 picoseconds. - Weight::from_parts(89_997_000, 9470) + // Measured: `403` + // Estimated: `3489` + // Minimum execution time: 71_783_000 picoseconds. + Weight::from_parts(74_009_000, 3489) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(8_u64)) } @@ -87,10 +87,10 @@ impl btc_relay::WeightInfo for WeightInfo { /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) fn store_block_header () -> Weight { // Proof Size summary in bytes: - // Measured: `901` - // Estimated: `17838` - // Minimum execution time: 96_734_000 picoseconds. - Weight::from_parts(104_906_000, 17838) + // Measured: `874` + // Estimated: `6340` + // Minimum execution time: 88_808_000 picoseconds. + Weight::from_parts(90_482_000, 6340) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -113,16 +113,16 @@ impl btc_relay::WeightInfo for WeightInfo { /// The range of component `f` is `[1, 6]`. fn store_block_header_new_fork_sorted (f: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `841 + f * (92 ±0)` - // Estimated: `16800 + f * (5006 ±0)` - // Minimum execution time: 122_921_000 picoseconds. - Weight::from_parts(115_873_657, 16800) - // Standard Error: 233_264 - .saturating_add(Weight::from_parts(13_772_544, 0).saturating_mul(f.into())) + // Measured: `806 + f * (101 ±0)` + // Estimated: `6340 + f * (2507 ±0)` + // Minimum execution time: 101_073_000 picoseconds. + Weight::from_parts(95_176_412, 6340) + // Standard Error: 452_083 + .saturating_add(Weight::from_parts(11_888_980, 0).saturating_mul(f.into())) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(f.into()))) .saturating_add(T::DbWeight::get().writes(5_u64)) - .saturating_add(Weight::from_parts(0, 5006).saturating_mul(f.into())) + .saturating_add(Weight::from_parts(0, 2507).saturating_mul(f.into())) } /// Storage: BTCRelay ChainCounter (r:1 w:1) /// Proof: BTCRelay ChainCounter (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -143,17 +143,17 @@ impl btc_relay::WeightInfo for WeightInfo { /// The range of component `f` is `[1, 6]`. fn store_block_header_new_fork_unsorted (f: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `920 + f * (98 ±0)` - // Estimated: `19871 + f * (2975 ±31)` - // Minimum execution time: 124_552_000 picoseconds. - Weight::from_parts(119_807_286, 19871) - // Standard Error: 219_739 - .saturating_add(Weight::from_parts(16_025_685, 0).saturating_mul(f.into())) + // Measured: `842 + f * (99 ±0)` + // Estimated: `6340 + f * (2499 ±0)` + // Minimum execution time: 97_675_000 picoseconds. + Weight::from_parts(89_104_041, 6340) + // Standard Error: 196_333 + .saturating_add(Weight::from_parts(14_328_939, 0).saturating_mul(f.into())) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(f.into()))) .saturating_add(T::DbWeight::get().writes(4_u64)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(f.into()))) - .saturating_add(Weight::from_parts(0, 2975).saturating_mul(f.into())) + .saturating_add(Weight::from_parts(0, 2499).saturating_mul(f.into())) } /// Storage: BTCRelay ChainCounter (r:1 w:0) /// Proof: BTCRelay ChainCounter (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -178,12 +178,12 @@ impl btc_relay::WeightInfo for WeightInfo { /// The range of component `f` is `[3, 6]`. fn store_block_header_reorganize_chains (f: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `4937 + f * (199 ±0)` - // Estimated: `109561 + f * (1340 ±45)` - // Minimum execution time: 650_977_000 picoseconds. - Weight::from_parts(615_353_151, 109561) - // Standard Error: 994_819 - .saturating_add(Weight::from_parts(22_332_173, 0).saturating_mul(f.into())) + // Measured: `4741 + f * (240 ±0)` + // Estimated: `54490 + f * (1340 ±45)` + // Minimum execution time: 506_604_000 picoseconds. + Weight::from_parts(465_095_071, 54490) + // Standard Error: 430_820 + .saturating_add(Weight::from_parts(18_597_675, 0).saturating_mul(f.into())) .saturating_add(T::DbWeight::get().reads(42_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(f.into()))) .saturating_add(T::DbWeight::get().writes(46_u64)) diff --git a/parachain/runtime/interlay/src/weights/clients_info.rs b/parachain/runtime/interlay/src/weights/clients_info.rs index a9522240b7..c40bdf0157 100644 --- a/parachain/runtime/interlay/src/weights/clients_info.rs +++ b/parachain/runtime/interlay/src/weights/clients_info.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for clients_info //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-jrrg4`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/interlay/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -44,16 +44,12 @@ impl clients_info::WeightInfo for WeightInfo { /// Proof: ClientsInfo CurrentClientReleases (max_values: None, max_size: Some(562), added: 3037, mode: MaxEncodedLen) /// The range of component `n` is `[0, 255]`. /// The range of component `u` is `[0, 255]`. - fn set_current_client_release (n: u32, u: u32, ) -> Weight { + fn set_current_client_release (_n: u32, _u: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 28_286_000 picoseconds. - Weight::from_parts(29_757_758, 0) - // Standard Error: 1_555 - .saturating_add(Weight::from_parts(7_981, 0).saturating_mul(n.into())) - // Standard Error: 1_555 - .saturating_add(Weight::from_parts(5_543, 0).saturating_mul(u.into())) + // Minimum execution time: 23_357_000 picoseconds. + Weight::from_parts(26_197_179, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: ClientsInfo PendingClientReleases (r:0 w:1) @@ -64,12 +60,12 @@ impl clients_info::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 28_745_000 picoseconds. - Weight::from_parts(28_862_679, 0) - // Standard Error: 1_669 - .saturating_add(Weight::from_parts(9_826, 0).saturating_mul(n.into())) - // Standard Error: 1_669 - .saturating_add(Weight::from_parts(9_079, 0).saturating_mul(u.into())) + // Minimum execution time: 22_976_000 picoseconds. + Weight::from_parts(24_221_268, 0) + // Standard Error: 615 + .saturating_add(Weight::from_parts(3_577, 0).saturating_mul(n.into())) + // Standard Error: 615 + .saturating_add(Weight::from_parts(1_267, 0).saturating_mul(u.into())) .saturating_add(T::DbWeight::get().writes(1_u64)) } } \ No newline at end of file diff --git a/parachain/runtime/interlay/src/weights/collator_selection.rs b/parachain/runtime/interlay/src/weights/collator_selection.rs index f06d0b06c1..d9532fcc8f 100644 --- a/parachain/runtime/interlay/src/weights/collator_selection.rs +++ b/parachain/runtime/interlay/src/weights/collator_selection.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for collator_selection //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-jrrg4`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/interlay/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -47,12 +47,12 @@ impl collator_selection::WeightInfo for WeightInfo { /// The range of component `b` is `[1, 100]`. fn set_invulnerables (b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `217 + b * (78 ±0)` - // Estimated: `1207 + b * (2554 ±0)` - // Minimum execution time: 33_665_000 picoseconds. - Weight::from_parts(36_494_050, 1207) - // Standard Error: 24_862 - .saturating_add(Weight::from_parts(6_432_343, 0).saturating_mul(b.into())) + // Measured: `252 + b * (78 ±0)` + // Estimated: `1241 + b * (2554 ±0)` + // Minimum execution time: 28_387_000 picoseconds. + Weight::from_parts(19_586_047, 1241) + // Standard Error: 104_765 + .saturating_add(Weight::from_parts(5_569_637, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(1_u64)) .saturating_add(Weight::from_parts(0, 2554).saturating_mul(b.into())) @@ -63,8 +63,8 @@ impl collator_selection::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 17_101_000 picoseconds. - Weight::from_parts(18_058_000, 0) + // Minimum execution time: 17_825_000 picoseconds. + Weight::from_parts(24_970_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: CollatorSelection CandidacyBond (r:0 w:1) @@ -73,8 +73,8 @@ impl collator_selection::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 18_328_000 picoseconds. - Weight::from_parts(18_909_000, 0) + // Minimum execution time: 26_052_000 picoseconds. + Weight::from_parts(27_986_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: CollatorSelection Candidates (r:1 w:1) @@ -95,18 +95,18 @@ impl collator_selection::WeightInfo for WeightInfo { /// Proof: Escrow Reserved (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) /// Storage: CollatorSelection LastAuthoredBlock (r:0 w:1) /// Proof: CollatorSelection LastAuthoredBlock (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) - /// The range of component `c` is `[1, 999]`. + /// The range of component `c` is `[1, 19]`. fn register_as_candidate (c: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `2801 + c * (49 ±0)` - // Estimated: `73766 + c * (50 ±0)` - // Minimum execution time: 96_633_000 picoseconds. - Weight::from_parts(128_853_656, 73766) - // Standard Error: 3_768 - .saturating_add(Weight::from_parts(280_459, 0).saturating_mul(c.into())) + // Measured: `902 + c * (96 ±0)` + // Estimated: `49487 + c * (97 ±0)` + // Minimum execution time: 78_588_000 picoseconds. + Weight::from_parts(82_310_845, 49487) + // Standard Error: 88_497 + .saturating_add(Weight::from_parts(487_436, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) - .saturating_add(Weight::from_parts(0, 50).saturating_mul(c.into())) + .saturating_add(Weight::from_parts(0, 97).saturating_mul(c.into())) } /// Storage: CollatorSelection Candidates (r:1 w:1) /// Proof: CollatorSelection Candidates (max_values: Some(1), max_size: Some(48002), added: 48497, mode: MaxEncodedLen) @@ -114,15 +114,15 @@ impl collator_selection::WeightInfo for WeightInfo { /// Proof: Escrow Reserved (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) /// Storage: CollatorSelection LastAuthoredBlock (r:0 w:1) /// Proof: CollatorSelection LastAuthoredBlock (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) - /// The range of component `c` is `[6, 1000]`. + /// The range of component `c` is `[6, 20]`. fn leave_intent (c: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `983 + c * (48 ±0)` - // Estimated: `53016` - // Minimum execution time: 54_720_000 picoseconds. - Weight::from_parts(71_237_061, 53016) - // Standard Error: 3_387 - .saturating_add(Weight::from_parts(270_577, 0).saturating_mul(c.into())) + // Measured: `402 + c * (64 ±0)` + // Estimated: `49487` + // Minimum execution time: 41_573_000 picoseconds. + Weight::from_parts(42_921_116, 49487) + // Standard Error: 17_308 + .saturating_add(Weight::from_parts(209_885, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -134,10 +134,10 @@ impl collator_selection::WeightInfo for WeightInfo { /// Proof: CollatorSelection LastAuthoredBlock (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) fn note_author () -> Weight { // Proof Size summary in bytes: - // Measured: `319` - // Estimated: `9763` - // Minimum execution time: 80_950_000 picoseconds. - Weight::from_parts(84_539_000, 9763) + // Measured: `650` + // Estimated: `6170` + // Minimum execution time: 72_686_000 picoseconds. + Weight::from_parts(73_928_000, 6170) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -145,30 +145,30 @@ impl collator_selection::WeightInfo for WeightInfo { /// Proof: CollatorSelection Candidates (max_values: Some(1), max_size: Some(48002), added: 48497, mode: MaxEncodedLen) /// Storage: CollatorSelection CandidacyBond (r:1 w:0) /// Proof: CollatorSelection CandidacyBond (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: CollatorSelection LastAuthoredBlock (r:999 w:0) + /// Storage: CollatorSelection LastAuthoredBlock (r:20 w:0) /// Proof: CollatorSelection LastAuthoredBlock (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) - /// Storage: Escrow UserPointEpoch (r:999 w:0) + /// Storage: Escrow UserPointEpoch (r:20 w:0) /// Proof: Escrow UserPointEpoch (max_values: None, max_size: Some(52), added: 2527, mode: MaxEncodedLen) - /// Storage: Escrow UserPointHistory (r:999 w:0) + /// Storage: Escrow UserPointHistory (r:20 w:0) /// Proof: Escrow UserPointHistory (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen) /// Storage: CollatorSelection Invulnerables (r:1 w:0) /// Proof: CollatorSelection Invulnerables (max_values: Some(1), max_size: Some(3202), added: 3697, mode: MaxEncodedLen) - /// Storage: Escrow Reserved (r:995 w:995) + /// Storage: Escrow Reserved (r:15 w:15) /// Proof: Escrow Reserved (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) - /// The range of component `r` is `[1, 1000]`. - /// The range of component `c` is `[1, 1000]`. + /// The range of component `r` is `[1, 20]`. + /// The range of component `c` is `[1, 20]`. fn new_session (r: u32, c: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `23641 + r * (50 ±0) + c * (193 ±0)` - // Estimated: `58645 + c * (7610 ±0) + r * (2538 ±0)` - // Minimum execution time: 66_169_000 picoseconds. - Weight::from_parts(66_765_000, 58645) - // Standard Error: 1_569_335 - .saturating_add(Weight::from_parts(87_957_359, 0).saturating_mul(c.into())) + // Measured: `793 + c * (194 ±0) + r * (47 ±0)` + // Estimated: `49487 + c * (2563 ±0) + r * (2207 ±23)` + // Minimum execution time: 51_603_000 picoseconds. + Weight::from_parts(53_327_000, 49487) + // Standard Error: 385_035 + .saturating_add(Weight::from_parts(25_609_068, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(c.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(c.into()))) - .saturating_add(Weight::from_parts(0, 7610).saturating_mul(c.into())) - .saturating_add(Weight::from_parts(0, 2538).saturating_mul(r.into())) + .saturating_add(Weight::from_parts(0, 2563).saturating_mul(c.into())) + .saturating_add(Weight::from_parts(0, 2207).saturating_mul(r.into())) } } \ No newline at end of file diff --git a/parachain/runtime/interlay/src/weights/cumulus_pallet_xcmp_queue.rs b/parachain/runtime/interlay/src/weights/cumulus_pallet_xcmp_queue.rs index 996be1bfca..834dd5a395 100644 --- a/parachain/runtime/interlay/src/weights/cumulus_pallet_xcmp_queue.rs +++ b/parachain/runtime/interlay/src/weights/cumulus_pallet_xcmp_queue.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for cumulus_pallet_xcmp_queue //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-jrrg4`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/interlay/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -46,8 +46,8 @@ impl cumulus_pallet_xcmp_queue::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `4` // Estimated: `1489` - // Minimum execution time: 13_471_000 picoseconds. - Weight::from_parts(13_943_000, 1489) + // Minimum execution time: 10_290_000 picoseconds. + Weight::from_parts(10_882_000, 1489) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -57,8 +57,8 @@ impl cumulus_pallet_xcmp_queue::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `4` // Estimated: `1489` - // Minimum execution time: 13_530_000 picoseconds. - Weight::from_parts(14_547_000, 1489) + // Minimum execution time: 10_611_000 picoseconds. + Weight::from_parts(11_673_000, 1489) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } diff --git a/parachain/runtime/interlay/src/weights/democracy.rs b/parachain/runtime/interlay/src/weights/democracy.rs index 33f0b5cf48..08bad28c7f 100644 --- a/parachain/runtime/interlay/src/weights/democracy.rs +++ b/parachain/runtime/interlay/src/weights/democracy.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for democracy //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-jrrg4`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/interlay/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -54,10 +54,10 @@ impl democracy::WeightInfo for WeightInfo { /// Proof: Democracy DepositOf (max_values: None, max_size: Some(3230), added: 5705, mode: MaxEncodedLen) fn propose () -> Weight { // Proof Size summary in bytes: - // Measured: `6110` - // Estimated: `30275` - // Minimum execution time: 114_600_000 picoseconds. - Weight::from_parts(120_562_000, 30275) + // Measured: `6137` + // Estimated: `18187` + // Minimum execution time: 93_467_000 picoseconds. + Weight::from_parts(129_309_000, 18187) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -71,10 +71,10 @@ impl democracy::WeightInfo for WeightInfo { /// Proof: Escrow Reserved (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) fn second () -> Weight { // Proof Size summary in bytes: - // Measured: `4802` - // Estimated: `17294` - // Minimum execution time: 88_005_000 picoseconds. - Weight::from_parts(100_713_000, 17294) + // Measured: `4829` + // Estimated: `6695` + // Minimum execution time: 62_655_000 picoseconds. + Weight::from_parts(64_308_000, 6695) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -90,10 +90,10 @@ impl democracy::WeightInfo for WeightInfo { /// Proof: Democracy VotingOf (max_values: None, max_size: Some(2142), added: 4617, mode: MaxEncodedLen) fn vote_new () -> Weight { // Proof Size summary in bytes: - // Measured: `3160` - // Estimated: `19872` - // Minimum execution time: 98_079_000 picoseconds. - Weight::from_parts(115_463_000, 19872) + // Measured: `3187` + // Estimated: `5607` + // Minimum execution time: 66_814_000 picoseconds. + Weight::from_parts(70_581_000, 5607) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -109,10 +109,10 @@ impl democracy::WeightInfo for WeightInfo { /// Proof: Democracy VotingOf (max_values: None, max_size: Some(2142), added: 4617, mode: MaxEncodedLen) fn vote_existing () -> Weight { // Proof Size summary in bytes: - // Measured: `3181` - // Estimated: `19872` - // Minimum execution time: 89_689_000 picoseconds. - Weight::from_parts(99_828_000, 19872) + // Measured: `3208` + // Estimated: `5607` + // Minimum execution time: 75_491_000 picoseconds. + Weight::from_parts(89_820_000, 5607) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -128,10 +128,10 @@ impl democracy::WeightInfo for WeightInfo { /// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen) fn fast_track () -> Weight { // Proof Size summary in bytes: - // Measured: `398` - // Estimated: `29900` - // Minimum execution time: 70_470_000 picoseconds. - Weight::from_parts(71_922_000, 29900) + // Measured: `425` + // Estimated: `18187` + // Minimum execution time: 61_484_000 picoseconds. + Weight::from_parts(63_477_000, 18187) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -139,10 +139,10 @@ impl democracy::WeightInfo for WeightInfo { /// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen) fn fast_track_referendum () -> Weight { // Proof Size summary in bytes: - // Measured: `221` + // Measured: `248` // Estimated: `3666` - // Minimum execution time: 38_562_000 picoseconds. - Weight::from_parts(39_311_000, 3666) + // Minimum execution time: 34_058_000 picoseconds. + Weight::from_parts(35_220_000, 3666) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -154,10 +154,10 @@ impl democracy::WeightInfo for WeightInfo { /// Proof: Escrow Reserved (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) fn cancel_proposal () -> Weight { // Proof Size summary in bytes: - // Measured: `6169` - // Estimated: `28411` - // Minimum execution time: 161_254_000 picoseconds. - Weight::from_parts(171_109_000, 28411) + // Measured: `6196` + // Estimated: `18187` + // Minimum execution time: 105_050_000 picoseconds. + Weight::from_parts(123_808_000, 18187) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -165,10 +165,10 @@ impl democracy::WeightInfo for WeightInfo { /// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen) fn cancel_referendum () -> Weight { // Proof Size summary in bytes: - // Measured: `221` + // Measured: `248` // Estimated: `3666` - // Minimum execution time: 33_858_000 picoseconds. - Weight::from_parts(37_949_000, 3666) + // Minimum execution time: 29_239_000 picoseconds. + Weight::from_parts(29_700_000, 3666) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -195,12 +195,12 @@ impl democracy::WeightInfo for WeightInfo { /// The range of component `r` is `[0, 99]`. fn on_initialize_public (r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `426 + r * (86 ±0)` - // Estimated: `40282 + r * (2677 ±0)` - // Minimum execution time: 80_172_000 picoseconds. - Weight::from_parts(95_107_339, 40282) - // Standard Error: 60_742 - .saturating_add(Weight::from_parts(22_858_429, 0).saturating_mul(r.into())) + // Measured: `453 + r * (86 ±0)` + // Estimated: `18187 + r * (2677 ±0)` + // Minimum execution time: 74_709_000 picoseconds. + Weight::from_parts(144_257_239, 18187) + // Standard Error: 307_991 + .saturating_add(Weight::from_parts(18_937_404, 0).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(9_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(6_u64)) @@ -222,12 +222,12 @@ impl democracy::WeightInfo for WeightInfo { /// The range of component `r` is `[0, 99]`. fn on_initialize_base (r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `144 + r * (86 ±0)` - // Estimated: `25141 + r * (2676 ±0)` - // Minimum execution time: 20_896_000 picoseconds. - Weight::from_parts(16_533_498, 25141) - // Standard Error: 32_240 - .saturating_add(Weight::from_parts(6_780_742, 0).saturating_mul(r.into())) + // Measured: `171 + r * (86 ±0)` + // Estimated: `18187 + r * (2676 ±0)` + // Minimum execution time: 19_750_000 picoseconds. + Weight::from_parts(23_636_151, 18187) + // Standard Error: 11_079 + .saturating_add(Weight::from_parts(4_983_882, 0).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(1_u64)) @@ -248,12 +248,12 @@ impl democracy::WeightInfo for WeightInfo { /// The range of component `r` is `[0, 99]`. fn on_initialize_base_with_launch_period (r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `144 + r * (86 ±0)` - // Estimated: `25141 + r * (2676 ±0)` - // Minimum execution time: 20_738_000 picoseconds. - Weight::from_parts(15_781_900, 25141) - // Standard Error: 35_897 - .saturating_add(Weight::from_parts(6_785_581, 0).saturating_mul(r.into())) + // Measured: `171 + r * (86 ±0)` + // Estimated: `18187 + r * (2676 ±0)` + // Minimum execution time: 19_560_000 picoseconds. + Weight::from_parts(19_961_000, 18187) + // Standard Error: 10_127 + .saturating_add(Weight::from_parts(5_053_754, 0).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(1_u64)) @@ -265,8 +265,8 @@ impl democracy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 9_406_000 picoseconds. - Weight::from_parts(10_445_000, 0) + // Minimum execution time: 6_784_000 picoseconds. + Weight::from_parts(6_964_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: Democracy ReferendumInfoOf (r:1 w:1) @@ -276,12 +276,12 @@ impl democracy::WeightInfo for WeightInfo { /// The range of component `r` is `[1, 100]`. fn remove_vote (r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `598 + r * (25 ±0)` - // Estimated: `9273` - // Minimum execution time: 34_563_000 picoseconds. - Weight::from_parts(43_648_351, 9273) - // Standard Error: 11_539 - .saturating_add(Weight::from_parts(322_493, 0).saturating_mul(r.into())) + // Measured: `625 + r * (25 ±0)` + // Estimated: `5607` + // Minimum execution time: 28_156_000 picoseconds. + Weight::from_parts(32_747_776, 5607) + // Standard Error: 5_899 + .saturating_add(Weight::from_parts(121_274, 0).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -291,10 +291,10 @@ impl democracy::WeightInfo for WeightInfo { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn spend_from_treasury () -> Weight { // Proof Size summary in bytes: - // Measured: `319` - // Estimated: `9763` - // Minimum execution time: 81_377_000 picoseconds. - Weight::from_parts(83_931_000, 9763) + // Measured: `536` + // Estimated: `6170` + // Minimum execution time: 66_633_000 picoseconds. + Weight::from_parts(67_405_000, 6170) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } diff --git a/parachain/runtime/interlay/src/weights/dex_general.rs b/parachain/runtime/interlay/src/weights/dex_general.rs index b58e14869c..031edce72c 100644 --- a/parachain/runtime/interlay/src/weights/dex_general.rs +++ b/parachain/runtime/interlay/src/weights/dex_general.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for dex_general //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-jrrg4`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/interlay/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -44,10 +44,10 @@ impl dex_general::WeightInfo for WeightInfo { /// Proof: DexGeneral FeeMeta (max_values: Some(1), max_size: Some(34), added: 529, mode: MaxEncodedLen) fn set_fee_receiver () -> Weight { // Proof Size summary in bytes: - // Measured: `3` + // Measured: `4` // Estimated: `1519` - // Minimum execution time: 15_919_000 picoseconds. - Weight::from_parts(16_728_000, 1519) + // Minimum execution time: 13_066_000 picoseconds. + Weight::from_parts(13_848_000, 1519) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -55,10 +55,10 @@ impl dex_general::WeightInfo for WeightInfo { /// Proof: DexGeneral FeeMeta (max_values: Some(1), max_size: Some(34), added: 529, mode: MaxEncodedLen) fn set_fee_point () -> Weight { // Proof Size summary in bytes: - // Measured: `3` + // Measured: `4` // Estimated: `1519` - // Minimum execution time: 26_414_000 picoseconds. - Weight::from_parts(26_871_000, 1519) + // Minimum execution time: 21_603_000 picoseconds. + Weight::from_parts(22_054_000, 1519) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -68,10 +68,10 @@ impl dex_general::WeightInfo for WeightInfo { /// Proof: DexGeneral LiquidityPairs (max_values: None, max_size: Some(50), added: 2525, mode: MaxEncodedLen) fn create_pair () -> Weight { // Proof Size summary in bytes: - // Measured: `3` + // Measured: `4` // Estimated: `3628` - // Minimum execution time: 39_508_000 picoseconds. - Weight::from_parts(41_610_000, 3628) + // Minimum execution time: 31_944_000 picoseconds. + Weight::from_parts(32_956_000, 3628) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -85,14 +85,14 @@ impl dex_general::WeightInfo for WeightInfo { /// The range of component `l` is `[1, 10]`. fn bootstrap_create (r: u32, l: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `3` + // Measured: `4` // Estimated: `3628` - // Minimum execution time: 46_807_000 picoseconds. - Weight::from_parts(49_800_031, 3628) - // Standard Error: 55_147 - .saturating_add(Weight::from_parts(120_739, 0).saturating_mul(r.into())) - // Standard Error: 55_147 - .saturating_add(Weight::from_parts(229_186, 0).saturating_mul(l.into())) + // Minimum execution time: 37_816_000 picoseconds. + Weight::from_parts(29_977_579, 3628) + // Standard Error: 119_682 + .saturating_add(Weight::from_parts(499_256, 0).saturating_mul(r.into())) + // Standard Error: 119_682 + .saturating_add(Weight::from_parts(1_107_001, 0).saturating_mul(l.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -108,10 +108,10 @@ impl dex_general::WeightInfo for WeightInfo { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn bootstrap_contribute () -> Weight { // Proof Size summary in bytes: - // Measured: `671` - // Estimated: `52635` - // Minimum execution time: 185_711_000 picoseconds. - Weight::from_parts(199_156_000, 52635) + // Measured: `941` + // Estimated: `30497` + // Minimum execution time: 153_948_000 picoseconds. + Weight::from_parts(156_744_000, 30497) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(7_u64)) } @@ -131,10 +131,10 @@ impl dex_general::WeightInfo for WeightInfo { /// Proof: DexGeneral BootstrapRewards (max_values: None, max_size: Some(27032), added: 29507, mode: MaxEncodedLen) fn bootstrap_claim () -> Weight { // Proof Size summary in bytes: - // Measured: `1231` - // Estimated: `54598` - // Minimum execution time: 169_864_000 picoseconds. - Weight::from_parts(181_561_000, 54598) + // Measured: `1486` + // Estimated: `30497` + // Minimum execution time: 131_704_000 picoseconds. + Weight::from_parts(132_755_000, 30497) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -152,10 +152,10 @@ impl dex_general::WeightInfo for WeightInfo { /// Proof: DexGeneral BootstrapEndStatus (max_values: None, max_size: Some(163), added: 2638, mode: MaxEncodedLen) fn bootstrap_end () -> Weight { // Proof Size summary in bytes: - // Measured: `893` - // Estimated: `27264` - // Minimum execution time: 240_023_000 picoseconds. - Weight::from_parts(253_923_000, 27264) + // Measured: `1200` + // Estimated: `13940` + // Minimum execution time: 192_676_000 picoseconds. + Weight::from_parts(193_828_000, 13940) .saturating_add(T::DbWeight::get().reads(9_u64)) .saturating_add(T::DbWeight::get().writes(10_u64)) } @@ -169,14 +169,14 @@ impl dex_general::WeightInfo for WeightInfo { /// The range of component `l` is `[1, 10]`. fn bootstrap_update (r: u32, l: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `259 + r * (21 ±0)` - // Estimated: `34125` - // Minimum execution time: 57_936_000 picoseconds. - Weight::from_parts(57_288_965, 34125) - // Standard Error: 53_814 - .saturating_add(Weight::from_parts(572_652, 0).saturating_mul(r.into())) - // Standard Error: 53_814 - .saturating_add(Weight::from_parts(371_921, 0).saturating_mul(l.into())) + // Measured: `260 + r * (21 ±0)` + // Estimated: `30497` + // Minimum execution time: 46_433_000 picoseconds. + Weight::from_parts(45_194_974, 30497) + // Standard Error: 144_589 + .saturating_add(Weight::from_parts(153_960, 0).saturating_mul(r.into())) + // Standard Error: 144_589 + .saturating_add(Weight::from_parts(754_676, 0).saturating_mul(l.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -190,10 +190,10 @@ impl dex_general::WeightInfo for WeightInfo { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn bootstrap_refund () -> Weight { // Proof Size summary in bytes: - // Measured: `1046` - // Estimated: `22138` - // Minimum execution time: 152_230_000 picoseconds. - Weight::from_parts(168_048_000, 22138) + // Measured: `1301` + // Estimated: `11350` + // Minimum execution time: 122_856_000 picoseconds. + Weight::from_parts(127_425_000, 11350) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(6_u64)) } @@ -213,10 +213,10 @@ impl dex_general::WeightInfo for WeightInfo { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn add_liquidity () -> Weight { // Proof Size summary in bytes: - // Measured: `704` - // Estimated: `33222` - // Minimum execution time: 265_466_000 picoseconds. - Weight::from_parts(294_876_000, 33222) + // Measured: `974` + // Estimated: `13940` + // Minimum execution time: 213_548_000 picoseconds. + Weight::from_parts(214_830_000, 13940) .saturating_add(T::DbWeight::get().reads(11_u64)) .saturating_add(T::DbWeight::get().writes(9_u64)) } @@ -236,10 +236,10 @@ impl dex_general::WeightInfo for WeightInfo { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn remove_liquidity () -> Weight { // Proof Size summary in bytes: - // Measured: `1188` - // Estimated: `33222` - // Minimum execution time: 224_704_000 picoseconds. - Weight::from_parts(228_516_000, 33222) + // Measured: `1443` + // Estimated: `13940` + // Minimum execution time: 182_185_000 picoseconds. + Weight::from_parts(183_037_000, 13940) .saturating_add(T::DbWeight::get().reads(11_u64)) .saturating_add(T::DbWeight::get().writes(8_u64)) } @@ -252,16 +252,16 @@ impl dex_general::WeightInfo for WeightInfo { /// The range of component `a` is `[2, 10]`. fn swap_exact_assets_for_assets (a: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `0 + a * (435 ±0)` - // Estimated: `8211 + a * (8825 ±21)` - // Minimum execution time: 161_917_000 picoseconds. - Weight::from_parts(12_273_386, 8211) - // Standard Error: 283_655 - .saturating_add(Weight::from_parts(78_807_907, 0).saturating_mul(a.into())) + // Measured: `224 + a * (459 ±0)` + // Estimated: `3628 + a * (5180 ±21)` + // Minimum execution time: 134_600_000 picoseconds. + Weight::from_parts(11_419_585, 3628) + // Standard Error: 109_224 + .saturating_add(Weight::from_parts(63_887_910, 0).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(a.into()))) - .saturating_add(Weight::from_parts(0, 8825).saturating_mul(a.into())) + .saturating_add(Weight::from_parts(0, 5180).saturating_mul(a.into())) } /// Storage: Tokens Accounts (r:20 w:20) /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) @@ -272,16 +272,16 @@ impl dex_general::WeightInfo for WeightInfo { /// The range of component `a` is `[2, 10]`. fn swap_assets_for_exact_assets (a: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `0 + a * (435 ±0)` - // Estimated: `8211 + a * (8825 ±0)` - // Minimum execution time: 163_640_000 picoseconds. - Weight::from_parts(14_064_501, 8211) - // Standard Error: 299_174 - .saturating_add(Weight::from_parts(79_120_950, 0).saturating_mul(a.into())) + // Measured: `224 + a * (459 ±0)` + // Estimated: `3628 + a * (5180 ±22)` + // Minimum execution time: 134_940_000 picoseconds. + Weight::from_parts(10_824_127, 3628) + // Standard Error: 93_262 + .saturating_add(Weight::from_parts(63_943_649, 0).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(a.into()))) - .saturating_add(Weight::from_parts(0, 8825).saturating_mul(a.into())) + .saturating_add(Weight::from_parts(0, 5180).saturating_mul(a.into())) } /// Storage: DexGeneral BootstrapRewards (r:1 w:1) /// Proof: DexGeneral BootstrapRewards (max_values: None, max_size: Some(27032), added: 29507, mode: MaxEncodedLen) @@ -292,12 +292,12 @@ impl dex_general::WeightInfo for WeightInfo { /// The range of component `r` is `[1, 10]`. fn bootstrap_charge_reward (r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `376 + r * (88 ±0)` - // Estimated: `35080 + r * (5180 ±0)` - // Minimum execution time: 108_140_000 picoseconds. - Weight::from_parts(68_067_108, 35080) - // Standard Error: 227_743 - .saturating_add(Weight::from_parts(53_817_168, 0).saturating_mul(r.into())) + // Measured: `646 + r * (88 ±0)` + // Estimated: `30497 + r * (5180 ±0)` + // Minimum execution time: 92_285_000 picoseconds. + Weight::from_parts(51_599_752, 30497) + // Standard Error: 35_906 + .saturating_add(Weight::from_parts(43_455_215, 0).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(2_u64)) @@ -308,10 +308,10 @@ impl dex_general::WeightInfo for WeightInfo { /// Proof: DexGeneral BootstrapRewards (max_values: None, max_size: Some(27032), added: 29507, mode: MaxEncodedLen) fn bootstrap_withdraw_reward () -> Weight { // Proof Size summary in bytes: - // Measured: `135` + // Measured: `136` // Estimated: `30497` - // Minimum execution time: 37_512_000 picoseconds. - Weight::from_parts(44_039_000, 30497) + // Minimum execution time: 29_279_000 picoseconds. + Weight::from_parts(29_900_000, 30497) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } diff --git a/parachain/runtime/interlay/src/weights/dex_stable.rs b/parachain/runtime/interlay/src/weights/dex_stable.rs index fd2d52d05e..633ebcfff8 100644 --- a/parachain/runtime/interlay/src/weights/dex_stable.rs +++ b/parachain/runtime/interlay/src/weights/dex_stable.rs @@ -2,17 +2,17 @@ //! Autogenerated weights for dex_stable //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-07-10, STEPS: `10`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: ``, CPU: `Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-jrrg4`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 // Executed Command: -// ./target/debug/interbtc-parachain +// target/release/interbtc-parachain // benchmark // pallet // --pallet -// dex-stable +// * // --extrinsic // * // --chain @@ -20,11 +20,11 @@ // --execution=wasm // --wasm-execution=compiled // --steps -// 10 +// 50 // --repeat -// 1 +// 10 // --output -// parachain/runtime/interlay/src/weights +// parachain/runtime/interlay/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -52,14 +52,14 @@ impl dex_stable::WeightInfo for WeightInfo { /// The range of component `s` is `[0, 50]`. fn create_base_pool (b: u32, s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `175` + // Measured: `227` // Estimated: `4281` - // Minimum execution time: 926_937_000 picoseconds. - Weight::from_parts(892_440_860, 4281) - // Standard Error: 2_385_481 - .saturating_add(Weight::from_parts(4_499_300, 0).saturating_mul(b.into())) - // Standard Error: 411_324 - .saturating_add(Weight::from_parts(458_537, 0).saturating_mul(s.into())) + // Minimum execution time: 54_269_000 picoseconds. + Weight::from_parts(54_997_240, 4281) + // Standard Error: 17_665 + .saturating_add(Weight::from_parts(183_582, 0).saturating_mul(b.into())) + // Standard Error: 2_939 + .saturating_add(Weight::from_parts(825, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -77,16 +77,14 @@ impl dex_stable::WeightInfo for WeightInfo { /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) /// The range of component `m` is `[2, 10]`. /// The range of component `s` is `[0, 50]`. - fn create_meta_pool (m: u32, s: u32, ) -> Weight { + fn create_meta_pool (m: u32, _s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1327` + // Measured: `1398` // Estimated: `7572` - // Minimum execution time: 1_499_976_000 picoseconds. - Weight::from_parts(1_481_261_840, 7572) - // Standard Error: 1_427_994 - .saturating_add(Weight::from_parts(2_331_903, 0).saturating_mul(m.into())) - // Standard Error: 246_226 - .saturating_add(Weight::from_parts(413_815, 0).saturating_mul(s.into())) + // Minimum execution time: 103_989_000 picoseconds. + Weight::from_parts(106_056_384, 7572) + // Standard Error: 27_983 + .saturating_add(Weight::from_parts(148_173, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -103,12 +101,12 @@ impl dex_stable::WeightInfo for WeightInfo { /// The range of component `b` is `[2, 10]`. fn add_liquidity (b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `955 + b * (121 ±0)` + // Measured: `1272 + b * (121 ±0)` // Estimated: `4281 + b * (5180 ±0)` - // Minimum execution time: 3_243_974_000 picoseconds. - Weight::from_parts(1_456_375_387, 4281) - // Standard Error: 1_551_618 - .saturating_add(Weight::from_parts(895_259_645, 0).saturating_mul(b.into())) + // Minimum execution time: 196_183_000 picoseconds. + Weight::from_parts(93_408_237, 4281) + // Standard Error: 1_465_469 + .saturating_add(Weight::from_parts(53_655_462, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(4_u64)) @@ -125,10 +123,10 @@ impl dex_stable::WeightInfo for WeightInfo { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn swap () -> Weight { // Proof Size summary in bytes: - // Measured: `2108` + // Measured: `2366` // Estimated: `11350` - // Minimum execution time: 2_268_129_000 picoseconds. - Weight::from_parts(2_268_129_000, 11350) + // Minimum execution time: 155_952_000 picoseconds. + Weight::from_parts(157_205_000, 11350) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -143,12 +141,12 @@ impl dex_stable::WeightInfo for WeightInfo { /// The range of component `b` is `[2, 10]`. fn remove_liquidity (b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1064 + b * (189 ±0)` + // Measured: `1326 + b * (189 ±0)` // Estimated: `4281 + b * (5180 ±0)` - // Minimum execution time: 2_524_661_000 picoseconds. - Weight::from_parts(1_324_272_155, 4281) - // Standard Error: 2_684_950 - .saturating_add(Weight::from_parts(601_291_454, 0).saturating_mul(b.into())) + // Minimum execution time: 152_916_000 picoseconds. + Weight::from_parts(78_803_054, 4281) + // Standard Error: 652_838 + .saturating_add(Weight::from_parts(35_960_644, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(3_u64)) @@ -167,10 +165,10 @@ impl dex_stable::WeightInfo for WeightInfo { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn remove_liquidity_one_currency () -> Weight { // Proof Size summary in bytes: - // Measured: `2179` + // Measured: `2437` // Estimated: `8760` - // Minimum execution time: 2_160_817_000 picoseconds. - Weight::from_parts(2_160_817_000, 8760) + // Minimum execution time: 178_146_000 picoseconds. + Weight::from_parts(179_620_000, 8760) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -187,12 +185,12 @@ impl dex_stable::WeightInfo for WeightInfo { /// The range of component `b` is `[2, 10]`. fn remove_liquidity_imbalance (b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1106 + b * (189 ±0)` + // Measured: `1368 + b * (189 ±0)` // Estimated: `4281 + b * (5180 ±0)` - // Minimum execution time: 2_605_230_000 picoseconds. - Weight::from_parts(1_378_223_306, 4281) - // Standard Error: 3_145_876 - .saturating_add(Weight::from_parts(610_722_427, 0).saturating_mul(b.into())) + // Minimum execution time: 177_185_000 picoseconds. + Weight::from_parts(108_143_142, 4281) + // Standard Error: 537_782 + .saturating_add(Weight::from_parts(39_454_173, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(3_u64)) @@ -213,14 +211,14 @@ impl dex_stable::WeightInfo for WeightInfo { /// The range of component `m` is `[2, 10]`. fn add_pool_and_base_pool_liquidity (b: u32, m: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1410 + b * (187 ±0) + m * (121 ±0)` + // Measured: `1708 + b * (187 ±0) + m * (117 ±0)` // Estimated: `7572 + b * (5180 ±0) + m * (5180 ±0)` - // Minimum execution time: 11_645_469_000 picoseconds. - Weight::from_parts(2_289_802_814, 7572) - // Standard Error: 4_386_612 - .saturating_add(Weight::from_parts(750_338_420, 0).saturating_mul(b.into())) - // Standard Error: 4_386_612 - .saturating_add(Weight::from_parts(918_351_372, 0).saturating_mul(m.into())) + // Minimum execution time: 699_882_000 picoseconds. + Weight::from_parts(148_335_738, 7572) + // Standard Error: 161_576 + .saturating_add(Weight::from_parts(45_050_514, 0).saturating_mul(b.into())) + // Standard Error: 161_576 + .saturating_add(Weight::from_parts(55_322_501, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(m.into()))) @@ -242,14 +240,14 @@ impl dex_stable::WeightInfo for WeightInfo { /// The range of component `m` is `[2, 10]`. fn remove_pool_and_base_pool_liquidity (b: u32, m: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1630 + b * (187 ±0) + m * (187 ±0)` + // Measured: `1951 + b * (187 ±0) + m * (184 ±0)` // Estimated: `7572 + b * (5180 ±0) + m * (5180 ±0)` - // Minimum execution time: 9_647_145_000 picoseconds. - Weight::from_parts(2_035_313_491, 7572) - // Standard Error: 17_444_707 - .saturating_add(Weight::from_parts(636_796_544, 0).saturating_mul(b.into())) - // Standard Error: 17_444_707 - .saturating_add(Weight::from_parts(628_853_533, 0).saturating_mul(m.into())) + // Minimum execution time: 556_133_000 picoseconds. + Weight::from_parts(182_776_140, 7572) + // Standard Error: 257_496 + .saturating_add(Weight::from_parts(32_276_393, 0).saturating_mul(b.into())) + // Standard Error: 257_496 + .saturating_add(Weight::from_parts(31_958_805, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(m.into()))) @@ -271,10 +269,10 @@ impl dex_stable::WeightInfo for WeightInfo { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn remove_pool_and_base_pool_liquidity_one_currency () -> Weight { // Proof Size summary in bytes: - // Measured: `3983` + // Measured: `4278` // Estimated: `13940` - // Minimum execution time: 4_155_522_000 picoseconds. - Weight::from_parts(4_155_522_000, 13940) + // Minimum execution time: 350_151_000 picoseconds. + Weight::from_parts(353_107_000, 13940) .saturating_add(T::DbWeight::get().reads(12_u64)) .saturating_add(T::DbWeight::get().writes(9_u64)) } @@ -290,10 +288,10 @@ impl dex_stable::WeightInfo for WeightInfo { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn swap_pool_from_base () -> Weight { // Proof Size summary in bytes: - // Measured: `4250` + // Measured: `4508` // Estimated: `39840` - // Minimum execution time: 5_762_939_000 picoseconds. - Weight::from_parts(5_762_939_000, 39840) + // Minimum execution time: 422_676_000 picoseconds. + Weight::from_parts(427_075_000, 39840) .saturating_add(T::DbWeight::get().reads(20_u64)) .saturating_add(T::DbWeight::get().writes(9_u64)) } @@ -309,10 +307,10 @@ impl dex_stable::WeightInfo for WeightInfo { /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) fn swap_pool_to_base () -> Weight { // Proof Size summary in bytes: - // Measured: `4013` + // Measured: `4308` // Estimated: `16530` - // Minimum execution time: 4_159_755_000 picoseconds. - Weight::from_parts(4_159_755_000, 16530) + // Minimum execution time: 331_324_000 picoseconds. + Weight::from_parts(337_195_000, 16530) .saturating_add(T::DbWeight::get().reads(12_u64)) .saturating_add(T::DbWeight::get().writes(9_u64)) } @@ -326,10 +324,10 @@ impl dex_stable::WeightInfo for WeightInfo { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn swap_meta_pool_underlying () -> Weight { // Proof Size summary in bytes: - // Measured: `2459` + // Measured: `2680` // Estimated: `11350` - // Minimum execution time: 2_205_825_000 picoseconds. - Weight::from_parts(2_205_825_000, 11350) + // Minimum execution time: 163_748_000 picoseconds. + Weight::from_parts(164_570_000, 11350) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -339,8 +337,8 @@ impl dex_stable::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `874` // Estimated: `4281` - // Minimum execution time: 509_216_000 picoseconds. - Weight::from_parts(509_216_000, 4281) + // Minimum execution time: 32_756_000 picoseconds. + Weight::from_parts(33_778_000, 4281) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -350,8 +348,8 @@ impl dex_stable::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `874` // Estimated: `4281` - // Minimum execution time: 519_106_000 picoseconds. - Weight::from_parts(519_106_000, 4281) + // Minimum execution time: 32_465_000 picoseconds. + Weight::from_parts(33_146_000, 4281) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -361,8 +359,8 @@ impl dex_stable::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `874` // Estimated: `4281` - // Minimum execution time: 511_217_000 picoseconds. - Weight::from_parts(511_217_000, 4281) + // Minimum execution time: 32_365_000 picoseconds. + Weight::from_parts(33_006_000, 4281) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -374,8 +372,8 @@ impl dex_stable::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `968` // Estimated: `4281` - // Minimum execution time: 644_410_000 picoseconds. - Weight::from_parts(644_410_000, 4281) + // Minimum execution time: 40_401_000 picoseconds. + Weight::from_parts(41_092_000, 4281) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -387,8 +385,8 @@ impl dex_stable::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `968` // Estimated: `4281` - // Minimum execution time: 643_830_000 picoseconds. - Weight::from_parts(643_830_000, 4281) + // Minimum execution time: 40_571_000 picoseconds. + Weight::from_parts(40_812_000, 4281) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -398,10 +396,10 @@ impl dex_stable::WeightInfo for WeightInfo { /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) fn withdraw_admin_fee () -> Weight { // Proof Size summary in bytes: - // Measured: `1843` + // Measured: `2064` // Estimated: `26890` - // Minimum execution time: 2_884_467_000 picoseconds. - Weight::from_parts(2_884_467_000, 26890) + // Minimum execution time: 167_655_000 picoseconds. + Weight::from_parts(168_567_000, 26890) .saturating_add(T::DbWeight::get().reads(11_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } diff --git a/parachain/runtime/interlay/src/weights/dex_swap_router.rs b/parachain/runtime/interlay/src/weights/dex_swap_router.rs index 4e9780d3ce..bd292ea62d 100644 --- a/parachain/runtime/interlay/src/weights/dex_swap_router.rs +++ b/parachain/runtime/interlay/src/weights/dex_swap_router.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for dex_swap_router //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-jrrg4`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/interlay/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -45,9 +45,9 @@ impl dex_swap_router::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 750_000 picoseconds. - Weight::from_parts(642_654, 0) - // Standard Error: 1_383 - .saturating_add(Weight::from_parts(123_062, 0).saturating_mul(a.into())) + // Minimum execution time: 631_000 picoseconds. + Weight::from_parts(545_230, 0) + // Standard Error: 725 + .saturating_add(Weight::from_parts(102_563, 0).saturating_mul(a.into())) } } \ No newline at end of file diff --git a/parachain/runtime/interlay/src/weights/escrow.rs b/parachain/runtime/interlay/src/weights/escrow.rs index 04598944d3..80ba563917 100644 --- a/parachain/runtime/interlay/src/weights/escrow.rs +++ b/parachain/runtime/interlay/src/weights/escrow.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for escrow //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-jrrg4`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/interlay/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -65,17 +65,21 @@ impl escrow::WeightInfo for WeightInfo { /// Storage: EscrowRewards TotalStake (r:1 w:1) /// Proof: EscrowRewards TotalStake (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) /// Storage: EscrowRewards RewardCurrencies (r:1 w:0) - /// Proof: EscrowRewards RewardCurrencies (max_values: None, max_size: Some(127), added: 2602, mode: MaxEncodedLen) + /// Proof: EscrowRewards RewardCurrencies (max_values: None, max_size: Some(28), added: 2503, mode: MaxEncodedLen) + /// Storage: EscrowRewards RewardTally (r:1 w:1) + /// Proof: EscrowRewards RewardTally (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: EscrowRewards RewardPerToken (r:1 w:0) + /// Proof: EscrowRewards RewardPerToken (max_values: None, max_size: Some(59), added: 2534, mode: MaxEncodedLen) /// Storage: Escrow UserPointHistory (r:0 w:1) /// Proof: Escrow UserPointHistory (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen) fn create_lock () -> Weight { // Proof Size summary in bytes: - // Measured: `540` - // Estimated: `178187` - // Minimum execution time: 517_938_000 picoseconds. - Weight::from_parts(542_454_000, 178187) - .saturating_add(T::DbWeight::get().reads(66_u64)) - .saturating_add(T::DbWeight::get().writes(62_u64)) + // Measured: `1094` + // Estimated: `136584` + // Minimum execution time: 460_452_000 picoseconds. + Weight::from_parts(464_921_000, 136584) + .saturating_add(T::DbWeight::get().reads(68_u64)) + .saturating_add(T::DbWeight::get().writes(63_u64)) } /// Storage: Escrow Locked (r:1 w:1) /// Proof: Escrow Locked (max_values: None, max_size: Some(68), added: 2543, mode: MaxEncodedLen) @@ -100,17 +104,21 @@ impl escrow::WeightInfo for WeightInfo { /// Storage: EscrowRewards TotalStake (r:1 w:1) /// Proof: EscrowRewards TotalStake (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) /// Storage: EscrowRewards RewardCurrencies (r:1 w:0) - /// Proof: EscrowRewards RewardCurrencies (max_values: None, max_size: Some(127), added: 2602, mode: MaxEncodedLen) + /// Proof: EscrowRewards RewardCurrencies (max_values: None, max_size: Some(28), added: 2503, mode: MaxEncodedLen) + /// Storage: EscrowRewards RewardTally (r:1 w:1) + /// Proof: EscrowRewards RewardTally (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: EscrowRewards RewardPerToken (r:1 w:0) + /// Proof: EscrowRewards RewardPerToken (max_values: None, max_size: Some(59), added: 2534, mode: MaxEncodedLen) /// Storage: Escrow UserPointHistory (r:0 w:1) /// Proof: Escrow UserPointHistory (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen) fn increase_amount () -> Weight { // Proof Size summary in bytes: - // Measured: `1273` - // Estimated: `41511` - // Minimum execution time: 227_462_000 picoseconds. - Weight::from_parts(242_306_000, 41511) - .saturating_add(T::DbWeight::get().reads(12_u64)) - .saturating_add(T::DbWeight::get().writes(10_u64)) + // Measured: `1683` + // Estimated: `4733` + // Minimum execution time: 205_251_000 picoseconds. + Weight::from_parts(206_143_000, 4733) + .saturating_add(T::DbWeight::get().reads(14_u64)) + .saturating_add(T::DbWeight::get().writes(11_u64)) } /// Storage: Escrow Locked (r:1 w:1) /// Proof: Escrow Locked (max_values: None, max_size: Some(68), added: 2543, mode: MaxEncodedLen) @@ -135,17 +143,21 @@ impl escrow::WeightInfo for WeightInfo { /// Storage: EscrowRewards TotalStake (r:1 w:1) /// Proof: EscrowRewards TotalStake (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) /// Storage: EscrowRewards RewardCurrencies (r:1 w:0) - /// Proof: EscrowRewards RewardCurrencies (max_values: None, max_size: Some(127), added: 2602, mode: MaxEncodedLen) + /// Proof: EscrowRewards RewardCurrencies (max_values: None, max_size: Some(28), added: 2503, mode: MaxEncodedLen) + /// Storage: EscrowRewards RewardTally (r:1 w:1) + /// Proof: EscrowRewards RewardTally (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: EscrowRewards RewardPerToken (r:1 w:0) + /// Proof: EscrowRewards RewardPerToken (max_values: None, max_size: Some(59), added: 2534, mode: MaxEncodedLen) /// Storage: Escrow UserPointHistory (r:0 w:1) /// Proof: Escrow UserPointHistory (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen) fn increase_unlock_height () -> Weight { // Proof Size summary in bytes: - // Measured: `1273` - // Estimated: `523623` - // Minimum execution time: 1_447_368_000 picoseconds. - Weight::from_parts(1_499_422_000, 523623) - .saturating_add(T::DbWeight::get().reads(204_u64)) - .saturating_add(T::DbWeight::get().writes(201_u64)) + // Measured: `1683` + // Estimated: `485613` + // Minimum execution time: 1_203_991_000 picoseconds. + Weight::from_parts(1_215_614_000, 485613) + .saturating_add(T::DbWeight::get().reads(206_u64)) + .saturating_add(T::DbWeight::get().writes(202_u64)) } /// Storage: Escrow Locked (r:1 w:1) /// Proof: Escrow Locked (max_values: None, max_size: Some(68), added: 2543, mode: MaxEncodedLen) @@ -154,7 +166,11 @@ impl escrow::WeightInfo for WeightInfo { /// Storage: EscrowRewards TotalStake (r:1 w:1) /// Proof: EscrowRewards TotalStake (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) /// Storage: EscrowRewards RewardCurrencies (r:1 w:0) - /// Proof: EscrowRewards RewardCurrencies (max_values: None, max_size: Some(127), added: 2602, mode: MaxEncodedLen) + /// Proof: EscrowRewards RewardCurrencies (max_values: None, max_size: Some(28), added: 2503, mode: MaxEncodedLen) + /// Storage: EscrowRewards RewardTally (r:1 w:1) + /// Proof: EscrowRewards RewardTally (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: EscrowRewards RewardPerToken (r:1 w:0) + /// Proof: EscrowRewards RewardPerToken (max_values: None, max_size: Some(59), added: 2534, mode: MaxEncodedLen) /// Storage: Escrow SlopeChanges (r:193 w:0) /// Proof: Escrow SlopeChanges (max_values: None, max_size: Some(36), added: 2511, mode: MaxEncodedLen) /// Storage: Escrow Epoch (r:1 w:1) @@ -173,15 +189,33 @@ impl escrow::WeightInfo for WeightInfo { /// Proof: Escrow UserPointHistory (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen) fn withdraw () -> Weight { // Proof Size summary in bytes: - // Measured: `1455` - // Estimated: `523734` - // Minimum execution time: 1_474_654_000 picoseconds. - Weight::from_parts(1_503_680_000, 523734) - .saturating_add(T::DbWeight::get().reads(204_u64)) - .saturating_add(T::DbWeight::get().writes(203_u64)) + // Measured: `1902` + // Estimated: `485613` + // Minimum execution time: 1_187_508_000 picoseconds. + Weight::from_parts(1_208_961_000, 485613) + .saturating_add(T::DbWeight::get().reads(206_u64)) + .saturating_add(T::DbWeight::get().writes(204_u64)) + } + /// Storage: Escrow Limits (r:0 w:1) + /// Proof: Escrow Limits (max_values: None, max_size: Some(56), added: 2531, mode: MaxEncodedLen) + fn set_account_limit () -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 10_060_000 picoseconds. + Weight::from_parts(10_421_000, 0) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: Escrow Blocks (r:0 w:1) + /// Proof: Escrow Blocks (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) + fn set_account_block () -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 10_020_000 picoseconds. + Weight::from_parts(10_881_000, 0) + .saturating_add(T::DbWeight::get().writes(1_u64)) } - /// Storage: EscrowRewards Stake (r:1 w:1) - /// Proof: EscrowRewards Stake (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) /// Storage: Escrow Locked (r:1 w:1) /// Proof: Escrow Locked (max_values: None, max_size: Some(68), added: 2543, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:1 w:1) @@ -192,49 +226,29 @@ impl escrow::WeightInfo for WeightInfo { /// Proof: Escrow Limits (max_values: None, max_size: Some(56), added: 2531, mode: MaxEncodedLen) /// Storage: Tokens Locks (r:1 w:1) /// Proof: Tokens Locks (max_values: None, max_size: Some(1268), added: 3743, mode: MaxEncodedLen) - /// Storage: Escrow SlopeChanges (r:96 w:1) + /// Storage: Escrow SlopeChanges (r:192 w:1) /// Proof: Escrow SlopeChanges (max_values: None, max_size: Some(36), added: 2511, mode: MaxEncodedLen) /// Storage: Escrow Epoch (r:1 w:1) /// Proof: Escrow Epoch (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Escrow PointHistory (r:1 w:95) + /// Storage: Escrow PointHistory (r:1 w:191) /// Proof: Escrow PointHistory (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen) /// Storage: Escrow UserPointEpoch (r:1 w:1) /// Proof: Escrow UserPointEpoch (max_values: None, max_size: Some(52), added: 2527, mode: MaxEncodedLen) + /// Storage: EscrowRewards Stake (r:1 w:1) + /// Proof: EscrowRewards Stake (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) /// Storage: EscrowRewards TotalStake (r:1 w:1) /// Proof: EscrowRewards TotalStake (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) /// Storage: EscrowRewards RewardCurrencies (r:1 w:0) - /// Proof: EscrowRewards RewardCurrencies (max_values: None, max_size: Some(127), added: 2602, mode: MaxEncodedLen) - /// Storage: Escrow ThresholdPercentage (r:1 w:0) - /// Proof: Escrow ThresholdPercentage (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) + /// Proof: EscrowRewards RewardCurrencies (max_values: None, max_size: Some(28), added: 2503, mode: MaxEncodedLen) /// Storage: Escrow UserPointHistory (r:0 w:1) /// Proof: Escrow UserPointHistory (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen) fn update_user_stake () -> Weight { // Proof Size summary in bytes: - // Measured: `1273` - // Estimated: `281542` - // Minimum execution time: 359_000_000 picoseconds. - Weight::from_parts(363_000_000, 281542) - .saturating_add(T::DbWeight::get().reads(108_u64)) - .saturating_add(T::DbWeight::get().writes(104_u64)) - } - - fn set_account_limit () -> Weight { - // Proof Size summary in bytes: - // Measured: `1273` - // Estimated: `281542` - // Minimum execution time: 359_000_000 picoseconds. - Weight::from_parts(363_000_000, 281542) - .saturating_add(T::DbWeight::get().reads(108_u64)) - .saturating_add(T::DbWeight::get().writes(104_u64)) - } - - fn set_account_block () -> Weight { - // Proof Size summary in bytes: - // Measured: `1273` - // Estimated: `281542` - // Minimum execution time: 359_000_000 picoseconds. - Weight::from_parts(363_000_000, 281542) - .saturating_add(T::DbWeight::get().reads(108_u64)) - .saturating_add(T::DbWeight::get().writes(104_u64)) + // Measured: `1490` + // Estimated: `483102` + // Minimum execution time: 1_173_299_000 picoseconds. + Weight::from_parts(1_186_816_000, 483102) + .saturating_add(T::DbWeight::get().reads(203_u64)) + .saturating_add(T::DbWeight::get().writes(200_u64)) } } \ No newline at end of file diff --git a/parachain/runtime/interlay/src/weights/farming.rs b/parachain/runtime/interlay/src/weights/farming.rs index a9cc2be95b..9a4cebd139 100644 --- a/parachain/runtime/interlay/src/weights/farming.rs +++ b/parachain/runtime/interlay/src/weights/farming.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for farming //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-jrrg4`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/interlay/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -47,15 +47,15 @@ impl farming::WeightInfo for WeightInfo { /// The range of component `c` is `[1, 4]`. fn on_initialize (c: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `189 + c * (41 ±0)` - // Estimated: `6342 + c * (3717 ±0)` - // Minimum execution time: 36_335_000 picoseconds. - Weight::from_parts(26_116_063, 6342) - // Standard Error: 179_842 - .saturating_add(Weight::from_parts(13_707_478, 0).saturating_mul(c.into())) + // Measured: `208 + c * (41 ±0)` + // Estimated: `3539 + c * (2549 ±45)` + // Minimum execution time: 29_038_000 picoseconds. + Weight::from_parts(25_341_704, 3539) + // Standard Error: 136_097 + .saturating_add(Weight::from_parts(9_901_018, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(c.into()))) - .saturating_add(Weight::from_parts(0, 3717).saturating_mul(c.into())) + .saturating_add(Weight::from_parts(0, 2549).saturating_mul(c.into())) } /// Storage: Tokens Accounts (r:2 w:2) /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) @@ -65,10 +65,10 @@ impl farming::WeightInfo for WeightInfo { /// Proof: Farming RewardSchedules (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) fn update_reward_schedule () -> Weight { // Proof Size summary in bytes: - // Measured: `435` - // Estimated: `13302` - // Minimum execution time: 110_632_000 picoseconds. - Weight::from_parts(119_448_000, 13302) + // Measured: `847` + // Estimated: `6170` + // Minimum execution time: 96_002_000 picoseconds. + Weight::from_parts(98_848_000, 6170) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -80,10 +80,10 @@ impl farming::WeightInfo for WeightInfo { /// Proof: Farming RewardSchedules (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) fn remove_reward_schedule () -> Weight { // Proof Size summary in bytes: - // Measured: `582` - // Estimated: `9763` - // Minimum execution time: 93_051_000 picoseconds. - Weight::from_parts(98_659_000, 9763) + // Measured: `945` + // Estimated: `6170` + // Minimum execution time: 76_924_000 picoseconds. + Weight::from_parts(78_778_000, 6170) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -102,17 +102,17 @@ impl farming::WeightInfo for WeightInfo { /// The range of component `c` is `[1, 4]`. fn deposit (c: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `683 + c * (70 ±0)` - // Estimated: `16211 + c * (5122 ±0)` - // Minimum execution time: 115_386_000 picoseconds. - Weight::from_parts(106_834_770, 16211) - // Standard Error: 328_359 - .saturating_add(Weight::from_parts(16_898_888, 0).saturating_mul(c.into())) + // Measured: `900 + c * (70 ±0)` + // Estimated: `3603 + c * (2577 ±0)` + // Minimum execution time: 92_525_000 picoseconds. + Weight::from_parts(83_566_332, 3603) + // Standard Error: 141_739 + .saturating_add(Weight::from_parts(12_357_123, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(c.into()))) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(c.into()))) - .saturating_add(Weight::from_parts(0, 5122).saturating_mul(c.into())) + .saturating_add(Weight::from_parts(0, 2577).saturating_mul(c.into())) } /// Storage: FarmingRewards RewardCurrencies (r:1 w:0) /// Proof: FarmingRewards RewardCurrencies (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) @@ -129,17 +129,17 @@ impl farming::WeightInfo for WeightInfo { /// The range of component `c` is `[1, 4]`. fn withdraw (c: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `683 + c * (70 ±0)` - // Estimated: `16211 + c * (5122 ±0)` - // Minimum execution time: 105_950_000 picoseconds. - Weight::from_parts(94_600_423, 16211) - // Standard Error: 308_218 - .saturating_add(Weight::from_parts(18_457_333, 0).saturating_mul(c.into())) + // Measured: `900 + c * (70 ±0)` + // Estimated: `3603 + c * (2577 ±0)` + // Minimum execution time: 85_000_000 picoseconds. + Weight::from_parts(74_727_024, 3603) + // Standard Error: 76_360 + .saturating_add(Weight::from_parts(12_445_425, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(c.into()))) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(c.into()))) - .saturating_add(Weight::from_parts(0, 5122).saturating_mul(c.into())) + .saturating_add(Weight::from_parts(0, 2577).saturating_mul(c.into())) } /// Storage: FarmingRewards Stake (r:1 w:0) /// Proof: FarmingRewards Stake (max_values: None, max_size: Some(75), added: 2550, mode: MaxEncodedLen) @@ -155,10 +155,10 @@ impl farming::WeightInfo for WeightInfo { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn claim () -> Weight { // Proof Size summary in bytes: - // Measured: `956` - // Estimated: `23913` - // Minimum execution time: 153_216_000 picoseconds. - Weight::from_parts(177_650_000, 23913) + // Measured: `1318` + // Estimated: `6170` + // Minimum execution time: 126_974_000 picoseconds. + Weight::from_parts(128_337_000, 6170) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } diff --git a/parachain/runtime/interlay/src/weights/fee.rs b/parachain/runtime/interlay/src/weights/fee.rs index 61c21fbb75..2ecdd22440 100644 --- a/parachain/runtime/interlay/src/weights/fee.rs +++ b/parachain/runtime/interlay/src/weights/fee.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for fee //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-jrrg4`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/interlay/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -51,7 +51,7 @@ impl fee::WeightInfo for WeightInfo { /// Storage: VaultRewards TotalStake (r:1 w:0) /// Proof: VaultRewards TotalStake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) /// Storage: VaultRewards RewardCurrencies (r:1 w:1) - /// Proof: VaultRewards RewardCurrencies (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) + /// Proof: VaultRewards RewardCurrencies (max_values: None, max_size: Some(50), added: 2525, mode: MaxEncodedLen) /// Storage: VaultRewards RewardPerToken (r:2 w:2) /// Proof: VaultRewards RewardPerToken (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) /// Storage: VaultRewards TotalRewards (r:2 w:2) @@ -86,10 +86,10 @@ impl fee::WeightInfo for WeightInfo { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn withdraw_rewards () -> Weight { // Proof Size summary in bytes: - // Measured: `2602` - // Estimated: `111780` - // Minimum execution time: 725_934_000 picoseconds. - Weight::from_parts(754_520_000, 111780) + // Measured: `2962` + // Estimated: `11350` + // Minimum execution time: 584_140_000 picoseconds. + Weight::from_parts(593_319_000, 11350) .saturating_add(T::DbWeight::get().reads(35_u64)) .saturating_add(T::DbWeight::get().writes(25_u64)) } @@ -99,8 +99,8 @@ impl fee::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 10_847_000 picoseconds. - Weight::from_parts(11_946_000, 0) + // Minimum execution time: 8_197_000 picoseconds. + Weight::from_parts(8_557_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: Fee IssueGriefingCollateral (r:0 w:1) @@ -109,8 +109,8 @@ impl fee::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 10_919_000 picoseconds. - Weight::from_parts(12_024_000, 0) + // Minimum execution time: 8_416_000 picoseconds. + Weight::from_parts(8_627_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: Fee RedeemFee (r:0 w:1) @@ -119,8 +119,8 @@ impl fee::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 10_758_000 picoseconds. - Weight::from_parts(11_619_000, 0) + // Minimum execution time: 8_397_000 picoseconds. + Weight::from_parts(8_597_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: Fee PremiumRedeemFee (r:0 w:1) @@ -129,8 +129,8 @@ impl fee::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 11_103_000 picoseconds. - Weight::from_parts(11_590_000, 0) + // Minimum execution time: 8_166_000 picoseconds. + Weight::from_parts(8_507_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: Fee PunishmentFee (r:0 w:1) @@ -139,8 +139,8 @@ impl fee::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 10_727_000 picoseconds. - Weight::from_parts(11_291_000, 0) + // Minimum execution time: 8_317_000 picoseconds. + Weight::from_parts(8_537_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: Fee ReplaceGriefingCollateral (r:0 w:1) @@ -149,18 +149,21 @@ impl fee::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 11_007_000 picoseconds. - Weight::from_parts(11_284_000, 0) + // Minimum execution time: 8_227_000 picoseconds. + Weight::from_parts(8_527_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } + /// Storage: Nomination Vaults (r:1 w:0) + /// Proof: Nomination Vaults (max_values: None, max_size: Some(71), added: 2546, mode: MaxEncodedLen) /// Storage: Fee Commission (r:0 w:1) /// Proof: Fee Commission (max_values: None, max_size: Some(86), added: 2561, mode: MaxEncodedLen) fn set_commission () -> Weight { // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 13_816_000 picoseconds. - Weight::from_parts(14_511_000, 0) + // Measured: `167` + // Estimated: `3536` + // Minimum execution time: 18_618_000 picoseconds. + Weight::from_parts(18_778_000, 3536) + .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } } \ No newline at end of file diff --git a/parachain/runtime/interlay/src/weights/frame_system.rs b/parachain/runtime/interlay/src/weights/frame_system.rs index 60100f3150..adcc70b9c8 100644 --- a/parachain/runtime/interlay/src/weights/frame_system.rs +++ b/parachain/runtime/interlay/src/weights/frame_system.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for frame_system //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-jrrg4`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/interlay/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -45,20 +45,20 @@ impl frame_system::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 6_319_000 picoseconds. - Weight::from_parts(6_568_000, 0) - // Standard Error: 1 - .saturating_add(Weight::from_parts(664, 0).saturating_mul(b.into())) + // Minimum execution time: 4_790_000 picoseconds. + Weight::from_parts(4_890_000, 0) + // Standard Error: 3 + .saturating_add(Weight::from_parts(373, 0).saturating_mul(b.into())) } /// The range of component `b` is `[0, 3932160]`. fn remark_with_event (b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 19_331_000 picoseconds. - Weight::from_parts(19_762_000, 0) - // Standard Error: 4 - .saturating_add(Weight::from_parts(2_733, 0).saturating_mul(b.into())) + // Minimum execution time: 14_970_000 picoseconds. + Weight::from_parts(15_040_000, 0) + // Standard Error: 3 + .saturating_add(Weight::from_parts(1_626, 0).saturating_mul(b.into())) } /// Storage: System Digest (r:1 w:1) /// Proof Skipped: System Digest (max_values: Some(1), max_size: None, mode: Measured) @@ -68,8 +68,8 @@ impl frame_system::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `1485` - // Minimum execution time: 11_267_000 picoseconds. - Weight::from_parts(12_100_000, 1485) + // Minimum execution time: 8_798_000 picoseconds. + Weight::from_parts(8_948_000, 1485) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -80,10 +80,10 @@ impl frame_system::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_884_000 picoseconds. - Weight::from_parts(6_165_000, 0) - // Standard Error: 4_263 - .saturating_add(Weight::from_parts(1_634_009, 0).saturating_mul(i.into())) + // Minimum execution time: 4_579_000 picoseconds. + Weight::from_parts(4_600_000, 0) + // Standard Error: 10_040 + .saturating_add(Weight::from_parts(1_289_257, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into()))) } /// Storage: Skipped Metadata (r:0 w:0) @@ -93,10 +93,10 @@ impl frame_system::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 6_302_000 picoseconds. - Weight::from_parts(6_515_000, 0) - // Standard Error: 2_428 - .saturating_add(Weight::from_parts(1_156_128, 0).saturating_mul(i.into())) + // Minimum execution time: 4_680_000 picoseconds. + Weight::from_parts(4_790_000, 0) + // Standard Error: 1_261 + .saturating_add(Weight::from_parts(863_163, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into()))) } /// Storage: Skipped Metadata (r:0 w:0) @@ -104,12 +104,12 @@ impl frame_system::WeightInfo for WeightInfo { /// The range of component `p` is `[0, 1000]`. fn kill_prefix (p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `98 + p * (69 ±0)` - // Estimated: `94 + p * (70 ±0)` - // Minimum execution time: 11_057_000 picoseconds. - Weight::from_parts(11_323_000, 94) - // Standard Error: 6_736 - .saturating_add(Weight::from_parts(2_206_268, 0).saturating_mul(p.into())) + // Measured: `124 + p * (69 ±0)` + // Estimated: `111 + p * (70 ±0)` + // Minimum execution time: 8_637_000 picoseconds. + Weight::from_parts(8_697_000, 111) + // Standard Error: 14_450 + .saturating_add(Weight::from_parts(1_539_477, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into()))) .saturating_add(Weight::from_parts(0, 70).saturating_mul(p.into())) diff --git a/parachain/runtime/interlay/src/weights/issue.rs b/parachain/runtime/interlay/src/weights/issue.rs index 87c20c94e2..fa72cf8d1c 100644 --- a/parachain/runtime/interlay/src/weights/issue.rs +++ b/parachain/runtime/interlay/src/weights/issue.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for issue //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-jrrg4`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/interlay/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -48,8 +48,6 @@ impl issue::WeightInfo for WeightInfo { /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:1) /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: Oracle Aggregate (r:2 w:0) /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) /// Storage: Fee IssueGriefingCollateral (r:1 w:0) @@ -80,11 +78,11 @@ impl issue::WeightInfo for WeightInfo { /// Proof: Issue IssueRequests (max_values: None, max_size: Some(272), added: 2747, mode: MaxEncodedLen) fn request_issue () -> Weight { // Proof Size summary in bytes: - // Measured: `2448` - // Estimated: `43976` - // Minimum execution time: 793_321_000 picoseconds. - Weight::from_parts(830_560_000, 43976) - .saturating_add(T::DbWeight::get().reads(19_u64)) + // Measured: `2681` + // Estimated: `6028` + // Minimum execution time: 556_004_000 picoseconds. + Weight::from_parts(558_989_000, 6028) + .saturating_add(T::DbWeight::get().reads(18_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } /// Storage: Issue IssueRequests (r:1 w:1) @@ -117,16 +115,16 @@ impl issue::WeightInfo for WeightInfo { /// The range of component `b` is `[770, 2048]`. fn execute_issue_exact (h: u32, i: u32, _o: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `2196` - // Estimated: `32731` - // Minimum execution time: 253_839_000 picoseconds. - Weight::from_parts(238_170_932, 32731) - // Standard Error: 162_987 - .saturating_add(Weight::from_parts(6_743_495, 0).saturating_mul(h.into())) - // Standard Error: 146_867 - .saturating_add(Weight::from_parts(713_195, 0).saturating_mul(i.into())) - // Standard Error: 1_053 - .saturating_add(Weight::from_parts(4_907, 0).saturating_mul(b.into())) + // Measured: `2434` + // Estimated: `3737` + // Minimum execution time: 195_191_000 picoseconds. + Weight::from_parts(33_956_966, 3737) + // Standard Error: 810_295 + .saturating_add(Weight::from_parts(10_187_551, 0).saturating_mul(h.into())) + // Standard Error: 730_159 + .saturating_add(Weight::from_parts(7_188_076, 0).saturating_mul(i.into())) + // Standard Error: 5_239 + .saturating_add(Weight::from_parts(34_842, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(12_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -150,8 +148,6 @@ impl issue::WeightInfo for WeightInfo { /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: Oracle Aggregate (r:1 w:0) /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) /// Storage: VaultStaking Nonce (r:1 w:0) @@ -170,19 +166,15 @@ impl issue::WeightInfo for WeightInfo { /// The range of component `i` is `[1, 10]`. /// The range of component `o` is `[1, 10]`. /// The range of component `b` is `[770, 2048]`. - fn execute_issue_overpayment (h: u32, i: u32, _o: u32, b: u32, ) -> Weight { + fn execute_issue_overpayment (h: u32, _i: u32, _o: u32, _b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `2981` - // Estimated: `49856` - // Minimum execution time: 394_807_000 picoseconds. - Weight::from_parts(386_179_800, 49856) - // Standard Error: 202_009 - .saturating_add(Weight::from_parts(7_026_149, 0).saturating_mul(h.into())) - // Standard Error: 182_030 - .saturating_add(Weight::from_parts(953_910, 0).saturating_mul(i.into())) - // Standard Error: 1_306 - .saturating_add(Weight::from_parts(6_647, 0).saturating_mul(b.into())) - .saturating_add(T::DbWeight::get().reads(18_u64)) + // Measured: `3248` + // Estimated: `3737` + // Minimum execution time: 313_197_000 picoseconds. + Weight::from_parts(676_783_389, 3737) + // Standard Error: 967_719 + .saturating_add(Weight::from_parts(1_294_288, 0).saturating_mul(h.into())) + .saturating_add(T::DbWeight::get().reads(17_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } /// Storage: Issue IssueRequests (r:1 w:1) @@ -215,16 +207,18 @@ impl issue::WeightInfo for WeightInfo { /// The range of component `i` is `[1, 10]`. /// The range of component `o` is `[1, 10]`. /// The range of component `b` is `[770, 2048]`. - fn execute_issue_underpayment (h: u32, _i: u32, _o: u32, b: u32, ) -> Weight { + fn execute_issue_underpayment (h: u32, _i: u32, o: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `2449` - // Estimated: `34232` - // Minimum execution time: 304_453_000 picoseconds. - Weight::from_parts(303_918_897, 34232) - // Standard Error: 203_963 - .saturating_add(Weight::from_parts(6_645_260, 0).saturating_mul(h.into())) - // Standard Error: 1_318 - .saturating_add(Weight::from_parts(11_871, 0).saturating_mul(b.into())) + // Measured: `2739` + // Estimated: `3737` + // Minimum execution time: 231_854_000 picoseconds. + Weight::from_parts(253_010_791, 3737) + // Standard Error: 189_488 + .saturating_add(Weight::from_parts(3_800_800, 0).saturating_mul(h.into())) + // Standard Error: 170_748 + .saturating_add(Weight::from_parts(167_716, 0).saturating_mul(o.into())) + // Standard Error: 1_225 + .saturating_add(Weight::from_parts(6_220, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(13_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -258,18 +252,18 @@ impl issue::WeightInfo for WeightInfo { /// The range of component `b` is `[770, 2048]`. fn execute_expired_issue_exact (h: u32, i: u32, o: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `3049 + h * (5 ±0)` - // Estimated: `32731` - // Minimum execution time: 313_054_000 picoseconds. - Weight::from_parts(295_805_854, 32731) - // Standard Error: 129_240 - .saturating_add(Weight::from_parts(2_881_946, 0).saturating_mul(h.into())) - // Standard Error: 116_458 - .saturating_add(Weight::from_parts(1_843_101, 0).saturating_mul(i.into())) - // Standard Error: 116_458 - .saturating_add(Weight::from_parts(387_074, 0).saturating_mul(o.into())) - // Standard Error: 835 - .saturating_add(Weight::from_parts(6_697, 0).saturating_mul(b.into())) + // Measured: `3363` + // Estimated: `3737` + // Minimum execution time: 201_924_000 picoseconds. + Weight::from_parts(139_929_561, 3737) + // Standard Error: 194_156 + .saturating_add(Weight::from_parts(3_652_125, 0).saturating_mul(h.into())) + // Standard Error: 174_955 + .saturating_add(Weight::from_parts(1_547_829, 0).saturating_mul(i.into())) + // Standard Error: 174_955 + .saturating_add(Weight::from_parts(1_815_584, 0).saturating_mul(o.into())) + // Standard Error: 1_255 + .saturating_add(Weight::from_parts(16_572, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(12_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -293,8 +287,6 @@ impl issue::WeightInfo for WeightInfo { /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: Oracle Aggregate (r:1 w:0) /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) /// Storage: VaultStaking Nonce (r:1 w:0) @@ -315,19 +307,19 @@ impl issue::WeightInfo for WeightInfo { /// The range of component `b` is `[770, 2048]`. fn execute_expired_issue_overpayment (h: u32, i: u32, o: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `3880 + i * (9 ±0)` - // Estimated: `49856` - // Minimum execution time: 481_400_000 picoseconds. - Weight::from_parts(476_689_233, 49856) - // Standard Error: 146_120 - .saturating_add(Weight::from_parts(2_172_716, 0).saturating_mul(h.into())) - // Standard Error: 131_669 - .saturating_add(Weight::from_parts(1_635_167, 0).saturating_mul(i.into())) - // Standard Error: 131_669 - .saturating_add(Weight::from_parts(127_055, 0).saturating_mul(o.into())) - // Standard Error: 944 - .saturating_add(Weight::from_parts(8_816, 0).saturating_mul(b.into())) - .saturating_add(T::DbWeight::get().reads(18_u64)) + // Measured: `3947 + h * (1 ±0) + i * (1 ±0)` + // Estimated: `3737` + // Minimum execution time: 319_510_000 picoseconds. + Weight::from_parts(297_484_836, 3737) + // Standard Error: 93_915 + .saturating_add(Weight::from_parts(3_775_028, 0).saturating_mul(h.into())) + // Standard Error: 84_627 + .saturating_add(Weight::from_parts(1_330_041, 0).saturating_mul(i.into())) + // Standard Error: 84_627 + .saturating_add(Weight::from_parts(179_165, 0).saturating_mul(o.into())) + // Standard Error: 607 + .saturating_add(Weight::from_parts(2_628, 0).saturating_mul(b.into())) + .saturating_add(T::DbWeight::get().reads(17_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } /// Storage: Issue IssueRequests (r:1 w:1) @@ -360,20 +352,18 @@ impl issue::WeightInfo for WeightInfo { /// The range of component `i` is `[1, 10]`. /// The range of component `o` is `[1, 10]`. /// The range of component `b` is `[770, 2048]`. - fn execute_expired_issue_underpayment (h: u32, i: u32, o: u32, b: u32, ) -> Weight { + fn execute_expired_issue_underpayment (h: u32, i: u32, _o: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `3081 + h * (9 ±0) + i * (9 ±0)` - // Estimated: `34232` - // Minimum execution time: 368_871_000 picoseconds. - Weight::from_parts(356_306_647, 34232) - // Standard Error: 129_172 - .saturating_add(Weight::from_parts(3_241_308, 0).saturating_mul(h.into())) - // Standard Error: 116_397 - .saturating_add(Weight::from_parts(1_683_073, 0).saturating_mul(i.into())) - // Standard Error: 116_397 - .saturating_add(Weight::from_parts(494_875, 0).saturating_mul(o.into())) - // Standard Error: 835 - .saturating_add(Weight::from_parts(1_689, 0).saturating_mul(b.into())) + // Measured: `3653` + // Estimated: `3737` + // Minimum execution time: 241_423_000 picoseconds. + Weight::from_parts(228_353_888, 3737) + // Standard Error: 69_658 + .saturating_add(Weight::from_parts(3_202_457, 0).saturating_mul(h.into())) + // Standard Error: 62_769 + .saturating_add(Weight::from_parts(689_283, 0).saturating_mul(i.into())) + // Standard Error: 450 + .saturating_add(Weight::from_parts(3_239, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(13_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -389,10 +379,10 @@ impl issue::WeightInfo for WeightInfo { /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) fn cancel_issue () -> Weight { // Proof Size summary in bytes: - // Measured: `1496` - // Estimated: `11929` - // Minimum execution time: 163_665_000 picoseconds. - Weight::from_parts(168_254_000, 11929) + // Measured: `1495` + // Estimated: `3737` + // Minimum execution time: 89_729_000 picoseconds. + Weight::from_parts(90_551_000, 3737) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -402,8 +392,8 @@ impl issue::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 22_381_000 picoseconds. - Weight::from_parts(23_208_000, 0) + // Minimum execution time: 17_425_000 picoseconds. + Weight::from_parts(17_906_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } } \ No newline at end of file diff --git a/parachain/runtime/interlay/src/weights/loans.rs b/parachain/runtime/interlay/src/weights/loans.rs index c771e197ee..3ba00f5f52 100644 --- a/parachain/runtime/interlay/src/weights/loans.rs +++ b/parachain/runtime/interlay/src/weights/loans.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for loans //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-jrrg4`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/interlay/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -53,9 +53,9 @@ impl loans::WeightInfo for WeightInfo { fn add_market () -> Weight { // Proof Size summary in bytes: // Measured: `78` - // Estimated: `11264` - // Minimum execution time: 66_757_000 picoseconds. - Weight::from_parts(68_266_000, 11264) + // Estimated: `6260` + // Minimum execution time: 54_068_000 picoseconds. + Weight::from_parts(54_850_000, 6260) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -65,8 +65,8 @@ impl loans::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `343` // Estimated: `3625` - // Minimum execution time: 34_647_000 picoseconds. - Weight::from_parts(35_575_000, 3625) + // Minimum execution time: 26_934_000 picoseconds. + Weight::from_parts(27_294_000, 3625) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -76,8 +76,8 @@ impl loans::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `343` // Estimated: `3625` - // Minimum execution time: 36_279_000 picoseconds. - Weight::from_parts(37_274_000, 3625) + // Minimum execution time: 28_397_000 picoseconds. + Weight::from_parts(28_928_000, 3625) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -87,8 +87,8 @@ impl loans::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `343` // Estimated: `3625` - // Minimum execution time: 41_125_000 picoseconds. - Weight::from_parts(42_050_000, 3625) + // Minimum execution time: 32_044_000 picoseconds. + Weight::from_parts(32_375_000, 3625) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -99,9 +99,9 @@ impl loans::WeightInfo for WeightInfo { fn force_update_market () -> Weight { // Proof Size summary in bytes: // Measured: `354` - // Estimated: `7128` - // Minimum execution time: 49_595_000 picoseconds. - Weight::from_parts(50_686_000, 7128) + // Estimated: `3625` + // Minimum execution time: 39_699_000 picoseconds. + Weight::from_parts(40_140_000, 3625) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -111,10 +111,10 @@ impl loans::WeightInfo for WeightInfo { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn add_reward () -> Weight { // Proof Size summary in bytes: - // Measured: `490` - // Estimated: `9763` - // Minimum execution time: 96_884_000 picoseconds. - Weight::from_parts(100_894_000, 9763) + // Measured: `821` + // Estimated: `6170` + // Minimum execution time: 84_590_000 picoseconds. + Weight::from_parts(85_742_000, 6170) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -131,9 +131,9 @@ impl loans::WeightInfo for WeightInfo { fn update_market_reward_speed () -> Weight { // Proof Size summary in bytes: // Measured: `357` - // Estimated: `20300` - // Minimum execution time: 80_096_000 picoseconds. - Weight::from_parts(81_809_000, 20300) + // Estimated: `6260` + // Minimum execution time: 63_608_000 picoseconds. + Weight::from_parts(64_559_000, 6260) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -167,10 +167,10 @@ impl loans::WeightInfo for WeightInfo { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn claim_reward () -> Weight { // Proof Size summary in bytes: - // Measured: `1808` - // Estimated: `57382` - // Minimum execution time: 258_950_000 picoseconds. - Weight::from_parts(273_492_000, 57382) + // Measured: `2066` + // Estimated: `8760` + // Minimum execution time: 205_252_000 picoseconds. + Weight::from_parts(210_712_000, 8760) .saturating_add(T::DbWeight::get().reads(17_u64)) .saturating_add(T::DbWeight::get().writes(7_u64)) } @@ -204,10 +204,10 @@ impl loans::WeightInfo for WeightInfo { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn claim_reward_for_market () -> Weight { // Proof Size summary in bytes: - // Measured: `1808` - // Estimated: `54747` - // Minimum execution time: 247_768_000 picoseconds. - Weight::from_parts(258_615_000, 54747) + // Measured: `2066` + // Estimated: `8760` + // Minimum execution time: 195_301_000 picoseconds. + Weight::from_parts(198_498_000, 8760) .saturating_add(T::DbWeight::get().reads(16_u64)) .saturating_add(T::DbWeight::get().writes(7_u64)) } @@ -243,10 +243,10 @@ impl loans::WeightInfo for WeightInfo { /// Proof: Loans AccountDeposits (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) fn mint () -> Weight { // Proof Size summary in bytes: - // Measured: `1188` - // Estimated: `56787` - // Minimum execution time: 347_068_000 picoseconds. - Weight::from_parts(381_814_000, 56787) + // Measured: `1481` + // Estimated: `8760` + // Minimum execution time: 281_373_000 picoseconds. + Weight::from_parts(283_498_000, 8760) .saturating_add(T::DbWeight::get().reads(18_u64)) .saturating_add(T::DbWeight::get().writes(9_u64)) } @@ -264,8 +264,6 @@ impl loans::WeightInfo for WeightInfo { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) /// Storage: Loans TotalReserves (r:1 w:0) /// Proof: Loans TotalReserves (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: Oracle Aggregate (r:1 w:0) /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) /// Storage: Loans AccountDeposits (r:1 w:0) @@ -292,11 +290,11 @@ impl loans::WeightInfo for WeightInfo { /// Proof: Loans BorrowIndex (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) fn borrow () -> Weight { // Proof Size summary in bytes: - // Measured: `1950` - // Estimated: `67773` - // Minimum execution time: 354_021_000 picoseconds. - Weight::from_parts(367_373_000, 67773) - .saturating_add(T::DbWeight::get().reads(22_u64)) + // Measured: `2171` + // Estimated: `6260` + // Minimum execution time: 276_714_000 picoseconds. + Weight::from_parts(278_708_000, 6260) + .saturating_add(T::DbWeight::get().reads(21_u64)) .saturating_add(T::DbWeight::get().writes(8_u64)) } /// Storage: Loans Markets (r:2 w:0) @@ -333,10 +331,10 @@ impl loans::WeightInfo for WeightInfo { /// Proof: Loans RewardAccrued (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) fn redeem () -> Weight { // Proof Size summary in bytes: - // Measured: `1723` - // Estimated: `58288` - // Minimum execution time: 420_726_000 picoseconds. - Weight::from_parts(434_795_000, 58288) + // Measured: `2016` + // Estimated: `8760` + // Minimum execution time: 343_288_000 picoseconds. + Weight::from_parts(346_344_000, 8760) .saturating_add(T::DbWeight::get().reads(19_u64)) .saturating_add(T::DbWeight::get().writes(8_u64)) } @@ -374,10 +372,10 @@ impl loans::WeightInfo for WeightInfo { /// Proof: Loans RewardAccrued (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) fn redeem_all () -> Weight { // Proof Size summary in bytes: - // Measured: `1723` - // Estimated: `58288` - // Minimum execution time: 431_168_000 picoseconds. - Weight::from_parts(466_340_000, 58288) + // Measured: `2016` + // Estimated: `8760` + // Minimum execution time: 344_951_000 picoseconds. + Weight::from_parts(348_397_000, 8760) .saturating_add(T::DbWeight::get().reads(19_u64)) .saturating_add(T::DbWeight::get().writes(8_u64)) } @@ -405,10 +403,10 @@ impl loans::WeightInfo for WeightInfo { /// Proof: Loans TotalBorrows (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) fn repay_borrow () -> Weight { // Proof Size summary in bytes: - // Measured: `1620` - // Estimated: `42116` - // Minimum execution time: 221_063_000 picoseconds. - Weight::from_parts(229_097_000, 42116) + // Measured: `1875` + // Estimated: `6260` + // Minimum execution time: 172_034_000 picoseconds. + Weight::from_parts(173_187_000, 6260) .saturating_add(T::DbWeight::get().reads(13_u64)) .saturating_add(T::DbWeight::get().writes(8_u64)) } @@ -436,10 +434,10 @@ impl loans::WeightInfo for WeightInfo { /// Proof: Loans TotalBorrows (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) fn repay_borrow_all () -> Weight { // Proof Size summary in bytes: - // Measured: `1620` - // Estimated: `42116` - // Minimum execution time: 244_411_000 picoseconds. - Weight::from_parts(257_837_000, 42116) + // Measured: `1875` + // Estimated: `6260` + // Minimum execution time: 192_575_000 picoseconds. + Weight::from_parts(194_841_000, 6260) .saturating_add(T::DbWeight::get().reads(13_u64)) .saturating_add(T::DbWeight::get().writes(8_u64)) } @@ -453,10 +451,10 @@ impl loans::WeightInfo for WeightInfo { /// Proof: Loans AccountDeposits (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) fn deposit_all_collateral () -> Weight { // Proof Size summary in bytes: - // Measured: `967` - // Estimated: `16899` - // Minimum execution time: 123_309_000 picoseconds. - Weight::from_parts(131_712_000, 16899) + // Measured: `1184` + // Estimated: `6260` + // Minimum execution time: 96_493_000 picoseconds. + Weight::from_parts(96_834_000, 6260) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -484,19 +482,17 @@ impl loans::WeightInfo for WeightInfo { /// Proof: Loans MinExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: Loans MaxExchangeRate (r:1 w:0) /// Proof: Loans MaxExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: Oracle Aggregate (r:1 w:0) /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) /// Storage: Loans AccountBorrows (r:1 w:0) /// Proof: Loans AccountBorrows (max_values: None, max_size: Some(107), added: 2582, mode: MaxEncodedLen) fn withdraw_all_collateral () -> Weight { // Proof Size summary in bytes: - // Measured: `1880` - // Estimated: `50160` - // Minimum execution time: 311_263_000 picoseconds. - Weight::from_parts(318_834_000, 50160) - .saturating_add(T::DbWeight::get().reads(17_u64)) + // Measured: `2101` + // Estimated: `6260` + // Minimum execution time: 238_287_000 picoseconds. + Weight::from_parts(239_900_000, 6260) + .saturating_add(T::DbWeight::get().reads(16_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } /// Storage: Timestamp Now (r:1 w:0) @@ -523,8 +519,6 @@ impl loans::WeightInfo for WeightInfo { /// Proof: Loans MinExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: Loans MaxExchangeRate (r:1 w:0) /// Proof: Loans MaxExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: Oracle Aggregate (r:2 w:0) /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) /// Storage: Loans AccountBorrows (r:3 w:1) @@ -547,11 +541,11 @@ impl loans::WeightInfo for WeightInfo { /// Proof: Loans RewardSupplierIndex (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) fn liquidate_borrow () -> Weight { // Proof Size summary in bytes: - // Measured: `3353` - // Estimated: `129772` - // Minimum execution time: 1_267_658_000 picoseconds. - Weight::from_parts(1_330_004_000, 129772) - .saturating_add(T::DbWeight::get().reads(45_u64)) + // Measured: `3615` + // Estimated: `16530` + // Minimum execution time: 821_475_000 picoseconds. + Weight::from_parts(827_197_000, 16530) + .saturating_add(T::DbWeight::get().reads(44_u64)) .saturating_add(T::DbWeight::get().writes(21_u64)) } /// Storage: Loans Markets (r:2 w:0) @@ -588,10 +582,10 @@ impl loans::WeightInfo for WeightInfo { /// Proof: Loans RewardAccrued (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) fn reduce_incentive_reserves () -> Weight { // Proof Size summary in bytes: - // Measured: `2653` - // Estimated: `63481` - // Minimum execution time: 582_859_000 picoseconds. - Weight::from_parts(615_249_000, 63481) + // Measured: `2949` + // Estimated: `11350` + // Minimum execution time: 439_370_000 picoseconds. + Weight::from_parts(443_348_000, 11350) .saturating_add(T::DbWeight::get().reads(21_u64)) .saturating_add(T::DbWeight::get().writes(10_u64)) } @@ -609,10 +603,10 @@ impl loans::WeightInfo for WeightInfo { /// Proof: Loans TotalReserves (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) fn add_reserves () -> Weight { // Proof Size summary in bytes: - // Measured: `1012` - // Estimated: `24524` - // Minimum execution time: 161_331_000 picoseconds. - Weight::from_parts(167_585_000, 24524) + // Measured: `1305` + // Estimated: `6260` + // Minimum execution time: 123_618_000 picoseconds. + Weight::from_parts(124_138_000, 6260) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -630,10 +624,10 @@ impl loans::WeightInfo for WeightInfo { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn reduce_reserves () -> Weight { // Proof Size summary in bytes: - // Measured: `1243` - // Estimated: `24524` - // Minimum execution time: 140_149_000 picoseconds. - Weight::from_parts(153_718_000, 24524) + // Measured: `1536` + // Estimated: `6260` + // Minimum execution time: 107_896_000 picoseconds. + Weight::from_parts(109_179_000, 6260) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } diff --git a/parachain/runtime/interlay/src/weights/mod.rs b/parachain/runtime/interlay/src/weights/mod.rs index 9c557d49d7..792af080bb 100644 --- a/parachain/runtime/interlay/src/weights/mod.rs +++ b/parachain/runtime/interlay/src/weights/mod.rs @@ -34,7 +34,6 @@ pub mod pallet_xcm; pub mod pallet_xcm_benchmarks_fungible; pub mod pallet_xcm_benchmarks_generic; pub mod redeem; -pub mod replace; pub mod security; pub mod supply; pub mod tx_pause; diff --git a/parachain/runtime/interlay/src/weights/nomination.rs b/parachain/runtime/interlay/src/weights/nomination.rs index 3064a03294..243cd4d2d4 100644 --- a/parachain/runtime/interlay/src/weights/nomination.rs +++ b/parachain/runtime/interlay/src/weights/nomination.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for nomination //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-jrrg4`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/interlay/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -46,25 +46,20 @@ impl nomination::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 10_384_000 picoseconds. - Weight::from_parts(11_473_000, 0) + // Minimum execution time: 8_456_000 picoseconds. + Weight::from_parts(8_577_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: Nomination NominationLimit (r:0 w:1) /// Proof: Nomination NominationLimit (max_values: None, max_size: Some(86), added: 2561, mode: MaxEncodedLen) fn set_nomination_limit () -> Weight { // Proof Size summary in bytes: - // Measured: `126` - // Estimated: `1486` - // Minimum execution time: 28_221_000 picoseconds. - Weight::from_parts(30_402_000, 1486) - .saturating_add(T::DbWeight::get().reads(1_u64)) + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 12_274_000 picoseconds. + Weight::from_parts(12_395_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: Nomination NominationEnabled (r:1 w:0) /// Proof: Nomination NominationEnabled (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:0) @@ -73,15 +68,13 @@ impl nomination::WeightInfo for WeightInfo { /// Proof: Nomination Vaults (max_values: None, max_size: Some(71), added: 2546, mode: MaxEncodedLen) fn opt_in_to_nomination () -> Weight { // Proof Size summary in bytes: - // Measured: `767` - // Estimated: `10233` - // Minimum execution time: 74_126_000 picoseconds. - Weight::from_parts(81_868_000, 10233) - .saturating_add(T::DbWeight::get().reads(4_u64)) + // Measured: `642` + // Estimated: `3725` + // Minimum execution time: 43_357_000 picoseconds. + Weight::from_parts(44_048_000, 3725) + .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: Nomination Vaults (r:1 w:1) /// Proof: Nomination Vaults (max_values: None, max_size: Some(71), added: 2546, mode: MaxEncodedLen) /// Storage: VaultStaking Nonce (r:1 w:1) @@ -154,15 +147,13 @@ impl nomination::WeightInfo for WeightInfo { /// Proof: VaultRegistry TotalUserVaultCollateral (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) fn opt_out_of_nomination () -> Weight { // Proof Size summary in bytes: - // Measured: `4277` - // Estimated: `166107` - // Minimum execution time: 898_769_000 picoseconds. - Weight::from_parts(950_797_000, 166107) - .saturating_add(T::DbWeight::get().reads(54_u64)) + // Measured: `4500` + // Estimated: `11486` + // Minimum execution time: 707_246_000 picoseconds. + Weight::from_parts(712_346_000, 11486) + .saturating_add(T::DbWeight::get().reads(53_u64)) .saturating_add(T::DbWeight::get().writes(26_u64)) } - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: VaultStaking Nonce (r:1 w:0) /// Proof: VaultStaking Nonce (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) /// Storage: VaultStaking TotalCurrentStake (r:1 w:1) @@ -205,18 +196,24 @@ impl nomination::WeightInfo for WeightInfo { /// Proof: VaultCapacity RewardTally (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) /// Storage: VaultCapacity TotalRewards (r:2 w:2) /// Proof: VaultCapacity TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: VaultRewards TotalStake (r:1 w:1) + /// Proof: VaultRewards TotalStake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: VaultRewards RewardCurrencies (r:1 w:1) + /// Proof: VaultRewards RewardCurrencies (max_values: None, max_size: Some(50), added: 2525, mode: MaxEncodedLen) + /// Storage: VaultRewards RewardPerToken (r:2 w:2) + /// Proof: VaultRewards RewardPerToken (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) + /// Storage: VaultRewards TotalRewards (r:2 w:2) + /// Proof: VaultRewards TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) /// Storage: VaultRewards Stake (r:1 w:1) /// Proof: VaultRewards Stake (max_values: None, max_size: Some(97), added: 2572, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardPerToken (r:2 w:0) - /// Proof: VaultRewards RewardPerToken (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) /// Storage: VaultRewards RewardTally (r:2 w:2) /// Proof: VaultRewards RewardTally (max_values: None, max_size: Some(124), added: 2599, mode: MaxEncodedLen) - /// Storage: VaultRewards TotalRewards (r:2 w:2) - /// Proof: VaultRewards TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) /// Storage: Fee Commission (r:1 w:0) /// Proof: Fee Commission (max_values: None, max_size: Some(86), added: 2561, mode: MaxEncodedLen) /// Storage: VaultStaking RewardPerToken (r:2 w:2) /// Proof: VaultStaking RewardPerToken (max_values: None, max_size: Some(117), added: 2592, mode: MaxEncodedLen) + /// Storage: VaultStaking TotalRewards (r:2 w:2) + /// Proof: VaultStaking TotalRewards (max_values: None, max_size: Some(117), added: 2592, mode: MaxEncodedLen) /// Storage: VaultStaking TotalStake (r:1 w:1) /// Proof: VaultStaking TotalStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) /// Storage: VaultStaking RewardTally (r:2 w:2) @@ -225,10 +222,6 @@ impl nomination::WeightInfo for WeightInfo { /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: VaultRewards TotalStake (r:1 w:1) - /// Proof: VaultRewards TotalStake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardCurrencies (r:1 w:0) - /// Proof: VaultRewards RewardCurrencies (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) /// Storage: Loans LastAccruedInterestTime (r:1 w:1) @@ -248,22 +241,20 @@ impl nomination::WeightInfo for WeightInfo { /// Storage: VaultCapacity TotalStake (r:1 w:1) /// Proof: VaultCapacity TotalStake (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) /// Storage: VaultCapacity RewardCurrencies (r:1 w:0) - /// Proof: VaultCapacity RewardCurrencies (max_values: None, max_size: Some(127), added: 2602, mode: MaxEncodedLen) + /// Proof: VaultCapacity RewardCurrencies (max_values: None, max_size: Some(39), added: 2514, mode: MaxEncodedLen) /// Storage: VaultRegistry TotalUserVaultCollateral (r:1 w:1) /// Proof: VaultRegistry TotalUserVaultCollateral (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) /// Storage: VaultRegistry SystemCollateralCeiling (r:1 w:0) /// Proof: VaultRegistry SystemCollateralCeiling (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) fn deposit_collateral () -> Weight { // Proof Size summary in bytes: - // Measured: `5135` - // Estimated: `194221` - // Minimum execution time: 909_947_000 picoseconds. - Weight::from_parts(951_635_000, 194221) - .saturating_add(T::DbWeight::get().reads(62_u64)) - .saturating_add(T::DbWeight::get().writes(29_u64)) + // Measured: `5681` + // Estimated: `8760` + // Minimum execution time: 846_906_000 picoseconds. + Weight::from_parts(868_049_000, 8760) + .saturating_add(T::DbWeight::get().reads(63_u64)) + .saturating_add(T::DbWeight::get().writes(34_u64)) } - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: VaultStaking Nonce (r:1 w:0) /// Proof: VaultStaking Nonce (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:0) @@ -302,8 +293,6 @@ impl nomination::WeightInfo for WeightInfo { /// Proof: Nomination NominationEnabled (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: Nomination Vaults (r:1 w:0) /// Proof: Nomination Vaults (max_values: None, max_size: Some(71), added: 2546, mode: MaxEncodedLen) - /// Storage: VaultRegistry TotalUserVaultCollateral (r:1 w:1) - /// Proof: VaultRegistry TotalUserVaultCollateral (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) /// Storage: VaultCapacity Stake (r:1 w:1) /// Proof: VaultCapacity Stake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) /// Storage: VaultCapacity RewardPerToken (r:2 w:0) @@ -312,18 +301,24 @@ impl nomination::WeightInfo for WeightInfo { /// Proof: VaultCapacity RewardTally (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) /// Storage: VaultCapacity TotalRewards (r:2 w:2) /// Proof: VaultCapacity TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: VaultRewards TotalStake (r:1 w:1) + /// Proof: VaultRewards TotalStake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: VaultRewards RewardCurrencies (r:1 w:1) + /// Proof: VaultRewards RewardCurrencies (max_values: None, max_size: Some(50), added: 2525, mode: MaxEncodedLen) + /// Storage: VaultRewards RewardPerToken (r:2 w:2) + /// Proof: VaultRewards RewardPerToken (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) + /// Storage: VaultRewards TotalRewards (r:2 w:2) + /// Proof: VaultRewards TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) /// Storage: VaultRewards Stake (r:1 w:1) /// Proof: VaultRewards Stake (max_values: None, max_size: Some(97), added: 2572, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardPerToken (r:2 w:0) - /// Proof: VaultRewards RewardPerToken (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) /// Storage: VaultRewards RewardTally (r:2 w:2) /// Proof: VaultRewards RewardTally (max_values: None, max_size: Some(124), added: 2599, mode: MaxEncodedLen) - /// Storage: VaultRewards TotalRewards (r:2 w:2) - /// Proof: VaultRewards TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) /// Storage: Fee Commission (r:1 w:0) /// Proof: Fee Commission (max_values: None, max_size: Some(86), added: 2561, mode: MaxEncodedLen) /// Storage: VaultStaking RewardPerToken (r:2 w:2) /// Proof: VaultStaking RewardPerToken (max_values: None, max_size: Some(117), added: 2592, mode: MaxEncodedLen) + /// Storage: VaultStaking TotalRewards (r:2 w:2) + /// Proof: VaultStaking TotalRewards (max_values: None, max_size: Some(117), added: 2592, mode: MaxEncodedLen) /// Storage: VaultStaking Stake (r:1 w:1) /// Proof: VaultStaking Stake (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) /// Storage: VaultStaking SlashPerToken (r:1 w:0) @@ -334,14 +329,10 @@ impl nomination::WeightInfo for WeightInfo { /// Proof: VaultStaking TotalStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) /// Storage: VaultStaking RewardTally (r:2 w:2) /// Proof: VaultStaking RewardTally (max_values: None, max_size: Some(149), added: 2624, mode: MaxEncodedLen) - /// Storage: VaultRewards TotalStake (r:1 w:1) - /// Proof: VaultRewards TotalStake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardCurrencies (r:1 w:0) - /// Proof: VaultRewards RewardCurrencies (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) /// Storage: VaultCapacity TotalStake (r:1 w:1) /// Proof: VaultCapacity TotalStake (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) /// Storage: VaultCapacity RewardCurrencies (r:1 w:0) - /// Proof: VaultCapacity RewardCurrencies (max_values: None, max_size: Some(127), added: 2602, mode: MaxEncodedLen) + /// Proof: VaultCapacity RewardCurrencies (max_values: None, max_size: Some(39), added: 2514, mode: MaxEncodedLen) /// Storage: Loans RewardSupplyState (r:1 w:1) /// Proof: Loans RewardSupplyState (max_values: None, max_size: Some(47), added: 2522, mode: MaxEncodedLen) /// Storage: Loans RewardSupplySpeed (r:1 w:0) @@ -352,13 +343,15 @@ impl nomination::WeightInfo for WeightInfo { /// Proof: Loans RewardAccrued (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) /// Storage: Loans AccountDeposits (r:1 w:0) /// Proof: Loans AccountDeposits (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: VaultRegistry TotalUserVaultCollateral (r:1 w:1) + /// Proof: VaultRegistry TotalUserVaultCollateral (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) fn withdraw_collateral () -> Weight { // Proof Size summary in bytes: - // Measured: `5472` - // Estimated: `185433` - // Minimum execution time: 990_914_000 picoseconds. - Weight::from_parts(1_034_102_000, 185433) - .saturating_add(T::DbWeight::get().reads(59_u64)) - .saturating_add(T::DbWeight::get().writes(29_u64)) + // Measured: `6006` + // Estimated: `8760` + // Minimum execution time: 892_548_000 picoseconds. + Weight::from_parts(901_395_000, 8760) + .saturating_add(T::DbWeight::get().reads(60_u64)) + .saturating_add(T::DbWeight::get().writes(34_u64)) } } \ No newline at end of file diff --git a/parachain/runtime/interlay/src/weights/oracle.rs b/parachain/runtime/interlay/src/weights/oracle.rs index 8c0cdafa65..ad7c77eaaf 100644 --- a/parachain/runtime/interlay/src/weights/oracle.rs +++ b/parachain/runtime/interlay/src/weights/oracle.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for oracle //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-jrrg4`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/interlay/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -50,10 +50,10 @@ impl oracle::WeightInfo for WeightInfo { /// Proof: Oracle MaxDelay (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) /// Storage: VaultRewards TotalStake (r:999 w:0) /// Proof: VaultRewards TotalStake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Security ParachainStatus (r:1 w:1) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: Security Errors (r:1 w:1) - /// Proof: Security Errors (max_values: Some(1), max_size: Some(2), added: 497, mode: MaxEncodedLen) + /// Storage: VaultCapacity Stake (r:999 w:0) + /// Proof: VaultCapacity Stake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Loans Markets (r:999 w:0) + /// Proof: Loans Markets (max_values: None, max_size: Some(160), added: 2635, mode: MaxEncodedLen) /// Storage: Oracle Aggregate (r:0 w:999) /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) /// Storage: Oracle ValidUntil (r:0 w:999) @@ -61,17 +61,16 @@ impl oracle::WeightInfo for WeightInfo { /// The range of component `u` is `[1, 1000]`. fn on_initialize (u: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `687 + u * (127 ±0)` - // Estimated: `11433 + u * (10172 ±0)` - // Minimum execution time: 124_620_000 picoseconds. - Weight::from_parts(126_432_000, 11433) - // Standard Error: 52_310 - .saturating_add(Weight::from_parts(50_637_249, 0).saturating_mul(u.into())) - .saturating_add(T::DbWeight::get().reads(5_u64)) - .saturating_add(T::DbWeight::get().reads((4_u64).saturating_mul(u.into()))) - .saturating_add(T::DbWeight::get().writes(2_u64)) + // Measured: `678 + u * (127 ±0)` + // Estimated: `3494 + u * (5150 ±0)` + // Minimum execution time: 82_555_000 picoseconds. + Weight::from_parts(82_936_000, 3494) + // Standard Error: 44_981 + .saturating_add(Weight::from_parts(45_674_981, 0).saturating_mul(u.into())) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().reads((6_u64).saturating_mul(u.into()))) .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(u.into()))) - .saturating_add(Weight::from_parts(0, 10172).saturating_mul(u.into())) + .saturating_add(Weight::from_parts(0, 5150).saturating_mul(u.into())) } /// Storage: Oracle AuthorizedOracles (r:1 w:0) /// Proof: Oracle AuthorizedOracles (max_values: None, max_size: Some(305), added: 2780, mode: MaxEncodedLen) @@ -85,11 +84,11 @@ impl oracle::WeightInfo for WeightInfo { fn feed_values (u: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `295` - // Estimated: `5263` - // Minimum execution time: 49_622_000 picoseconds. - Weight::from_parts(50_155_000, 5263) - // Standard Error: 18_635 - .saturating_add(Weight::from_parts(9_962_469, 0).saturating_mul(u.into())) + // Estimated: `3770` + // Minimum execution time: 37_184_000 picoseconds. + Weight::from_parts(37_425_000, 3770) + // Standard Error: 35_377 + .saturating_add(Weight::from_parts(8_220_553, 0).saturating_mul(u.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(u.into()))) } @@ -99,8 +98,8 @@ impl oracle::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 29_623_000 picoseconds. - Weight::from_parts(30_869_000, 0) + // Minimum execution time: 22_265_000 picoseconds. + Weight::from_parts(22_555_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: Oracle AuthorizedOracles (r:0 w:1) @@ -109,8 +108,8 @@ impl oracle::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 26_992_000 picoseconds. - Weight::from_parts(28_076_000, 0) + // Minimum execution time: 20_180_000 picoseconds. + Weight::from_parts(20_461_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } } \ No newline at end of file diff --git a/parachain/runtime/interlay/src/weights/orml_asset_registry.rs b/parachain/runtime/interlay/src/weights/orml_asset_registry.rs index 705e433064..a6e1b47a4a 100644 --- a/parachain/runtime/interlay/src/weights/orml_asset_registry.rs +++ b/parachain/runtime/interlay/src/weights/orml_asset_registry.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for orml_asset_registry //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-jrrg4`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/interlay/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -49,9 +49,9 @@ impl orml_asset_registry::WeightInfo for WeightInfo fn register_asset () -> Weight { // Proof Size summary in bytes: // Measured: `107` - // Estimated: `8736` - // Minimum execution time: 55_685_000 picoseconds. - Weight::from_parts(63_994_000, 8736) + // Estimated: `3572` + // Minimum execution time: 41_974_000 picoseconds. + Weight::from_parts(43_196_000, 3572) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -62,9 +62,9 @@ impl orml_asset_registry::WeightInfo for WeightInfo fn update_asset () -> Weight { // Proof Size summary in bytes: // Measured: `774` - // Estimated: `8478` - // Minimum execution time: 67_201_000 picoseconds. - Weight::from_parts(75_234_000, 8478) + // Estimated: `4239` + // Minimum execution time: 51_463_000 picoseconds. + Weight::from_parts(52_084_000, 4239) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -72,7 +72,7 @@ impl orml_asset_registry::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 524_000 picoseconds. - Weight::from_parts(579_000, 0) + // Minimum execution time: 421_000 picoseconds. + Weight::from_parts(471_000, 0) } } \ No newline at end of file diff --git a/parachain/runtime/interlay/src/weights/orml_tokens.rs b/parachain/runtime/interlay/src/weights/orml_tokens.rs index 3149b215ad..ec757ac9ac 100644 --- a/parachain/runtime/interlay/src/weights/orml_tokens.rs +++ b/parachain/runtime/interlay/src/weights/orml_tokens.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for orml_tokens //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-jrrg4`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/interlay/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -60,10 +60,10 @@ impl orml_tokens::WeightInfo for WeightInfo { /// Proof: Loans AccountDeposits (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) fn transfer () -> Weight { // Proof Size summary in bytes: - // Measured: `1517` - // Estimated: `42199` - // Minimum execution time: 260_329_000 picoseconds. - Weight::from_parts(271_947_000, 42199) + // Measured: `1743` + // Estimated: `6260` + // Minimum execution time: 209_179_000 picoseconds. + Weight::from_parts(211_704_000, 6260) .saturating_add(T::DbWeight::get().reads(13_u64)) .saturating_add(T::DbWeight::get().writes(8_u64)) } @@ -87,10 +87,10 @@ impl orml_tokens::WeightInfo for WeightInfo { /// Proof: Loans AccountDeposits (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) fn transfer_all () -> Weight { // Proof Size summary in bytes: - // Measured: `1517` - // Estimated: `42199` - // Minimum execution time: 269_158_000 picoseconds. - Weight::from_parts(281_645_000, 42199) + // Measured: `1743` + // Estimated: `6260` + // Minimum execution time: 215_902_000 picoseconds. + Weight::from_parts(219_470_000, 6260) .saturating_add(T::DbWeight::get().reads(13_u64)) .saturating_add(T::DbWeight::get().writes(8_u64)) } @@ -114,10 +114,10 @@ impl orml_tokens::WeightInfo for WeightInfo { /// Proof: Loans AccountDeposits (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) fn transfer_keep_alive () -> Weight { // Proof Size summary in bytes: - // Measured: `1517` - // Estimated: `42199` - // Minimum execution time: 260_565_000 picoseconds. - Weight::from_parts(266_397_000, 42199) + // Measured: `1743` + // Estimated: `6260` + // Minimum execution time: 205_602_000 picoseconds. + Weight::from_parts(207_255_000, 6260) .saturating_add(T::DbWeight::get().reads(13_u64)) .saturating_add(T::DbWeight::get().writes(8_u64)) } @@ -141,10 +141,10 @@ impl orml_tokens::WeightInfo for WeightInfo { /// Proof: Loans AccountDeposits (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) fn force_transfer () -> Weight { // Proof Size summary in bytes: - // Measured: `1517` - // Estimated: `42199` - // Minimum execution time: 259_001_000 picoseconds. - Weight::from_parts(271_563_000, 42199) + // Measured: `1743` + // Estimated: `6260` + // Minimum execution time: 209_379_000 picoseconds. + Weight::from_parts(211_293_000, 6260) .saturating_add(T::DbWeight::get().reads(13_u64)) .saturating_add(T::DbWeight::get().writes(8_u64)) } @@ -154,10 +154,10 @@ impl orml_tokens::WeightInfo for WeightInfo { /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) fn set_balance () -> Weight { // Proof Size summary in bytes: - // Measured: `218` - // Estimated: `7080` - // Minimum execution time: 64_408_000 picoseconds. - Weight::from_parts(66_426_000, 7080) + // Measured: `435` + // Estimated: `3580` + // Minimum execution time: 52_415_000 picoseconds. + Weight::from_parts(53_918_000, 3580) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } diff --git a/parachain/runtime/interlay/src/weights/orml_vesting.rs b/parachain/runtime/interlay/src/weights/orml_vesting.rs index dfcac10454..1b87121998 100644 --- a/parachain/runtime/interlay/src/weights/orml_vesting.rs +++ b/parachain/runtime/interlay/src/weights/orml_vesting.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for orml_vesting //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-jrrg4`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/interlay/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -51,10 +51,10 @@ impl orml_vesting::WeightInfo for WeightInfo { /// The range of component `n` is `[0, 1]`. fn claim (_n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `315 + n * (306 ±0)` - // Estimated: `15448` - // Minimum execution time: 84_833_000 picoseconds. - Weight::from_parts(97_565_028, 15448) + // Measured: `771 + n * (109 ±0)` + // Estimated: `4733` + // Minimum execution time: 68_828_000 picoseconds. + Weight::from_parts(86_162_085, 4733) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -68,10 +68,10 @@ impl orml_vesting::WeightInfo for WeightInfo { /// Proof: Tokens Locks (max_values: None, max_size: Some(1268), added: 3743, mode: MaxEncodedLen) fn vested_transfer () -> Weight { // Proof Size summary in bytes: - // Measured: `395` - // Estimated: `18038` - // Minimum execution time: 153_089_000 picoseconds. - Weight::from_parts(156_347_000, 18038) + // Measured: `851` + // Estimated: `6170` + // Minimum execution time: 132_135_000 picoseconds. + Weight::from_parts(134_780_000, 6170) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -86,10 +86,10 @@ impl orml_vesting::WeightInfo for WeightInfo { /// The range of component `n` is `[0, 1]`. fn update_vesting_schedules (_n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `560` - // Estimated: `11906` - // Minimum execution time: 85_329_000 picoseconds. - Weight::from_parts(91_242_552, 11906) + // Measured: `894` + // Estimated: `4733` + // Minimum execution time: 71_683_000 picoseconds. + Weight::from_parts(76_991_012, 4733) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } diff --git a/parachain/runtime/interlay/src/weights/pallet_collective.rs b/parachain/runtime/interlay/src/weights/pallet_collective.rs index 84624bfe20..160694ec8b 100644 --- a/parachain/runtime/interlay/src/weights/pallet_collective.rs +++ b/parachain/runtime/interlay/src/weights/pallet_collective.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for pallet_collective //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-jrrg4`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/interlay/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -54,34 +54,32 @@ impl pallet_collective::WeightInfo for WeightInfo { fn set_members (m: u32, _n: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0 + m * (3232 ±0) + p * (3190 ±0)` - // Estimated: `19032 + m * (7796 ±30) + p * (10110 ±30)` - // Minimum execution time: 36_859_000 picoseconds. - Weight::from_parts(36_989_000, 19032) - // Standard Error: 168_481 - .saturating_add(Weight::from_parts(9_907_408, 0).saturating_mul(m.into())) - // Standard Error: 168_481 - .saturating_add(Weight::from_parts(17_366_102, 0).saturating_mul(p.into())) + // Estimated: `15762 + m * (1966 ±32) + p * (4332 ±32)` + // Minimum execution time: 27_395_000 picoseconds. + Weight::from_parts(27_776_000, 15762) + // Standard Error: 105_500 + .saturating_add(Weight::from_parts(6_123_319, 0).saturating_mul(m.into())) + // Standard Error: 105_500 + .saturating_add(Weight::from_parts(11_424_791, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) .saturating_add(T::DbWeight::get().writes(2_u64)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into()))) - .saturating_add(Weight::from_parts(0, 7796).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 10110).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 1966).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 4332).saturating_mul(p.into())) } /// Storage: TechnicalCommittee Members (r:1 w:0) /// Proof Skipped: TechnicalCommittee Members (max_values: Some(1), max_size: None, mode: Measured) /// The range of component `b` is `[2, 1024]`. /// The range of component `m` is `[1, 100]`. - fn execute (b: u32, m: u32, ) -> Weight { + fn execute (_b: u32, m: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `103 + m * (32 ±0)` // Estimated: `1589 + m * (32 ±0)` - // Minimum execution time: 38_525_000 picoseconds. - Weight::from_parts(41_645_958, 1589) - // Standard Error: 537 - .saturating_add(Weight::from_parts(438, 0).saturating_mul(b.into())) - // Standard Error: 5_540 - .saturating_add(Weight::from_parts(22_385, 0).saturating_mul(m.into())) + // Minimum execution time: 29_499_000 picoseconds. + Weight::from_parts(31_124_039, 1589) + // Standard Error: 7_234 + .saturating_add(Weight::from_parts(32_755, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } @@ -94,15 +92,15 @@ impl pallet_collective::WeightInfo for WeightInfo { fn propose_execute (b: u32, m: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `103 + m * (32 ±0)` - // Estimated: `5158 + m * (64 ±0)` - // Minimum execution time: 44_202_000 picoseconds. - Weight::from_parts(47_233_769, 5158) - // Standard Error: 620 - .saturating_add(Weight::from_parts(1_996, 0).saturating_mul(b.into())) - // Standard Error: 6_397 - .saturating_add(Weight::from_parts(30_056, 0).saturating_mul(m.into())) + // Estimated: `3569 + m * (32 ±0)` + // Minimum execution time: 34_780_000 picoseconds. + Weight::from_parts(35_374_452, 3569) + // Standard Error: 371 + .saturating_add(Weight::from_parts(1_346, 0).saturating_mul(b.into())) + // Standard Error: 3_829 + .saturating_add(Weight::from_parts(16_196, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } /// Storage: TechnicalCommittee Members (r:1 w:0) /// Proof Skipped: TechnicalCommittee Members (max_values: Some(1), max_size: None, mode: Measured) @@ -120,19 +118,19 @@ impl pallet_collective::WeightInfo for WeightInfo { fn propose_proposed (b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `393 + m * (32 ±0) + p * (36 ±0)` - // Estimated: `9510 + m * (165 ±0) + p * (180 ±0)` - // Minimum execution time: 59_352_000 picoseconds. - Weight::from_parts(49_658_095, 9510) - // Standard Error: 1_215 - .saturating_add(Weight::from_parts(15_112, 0).saturating_mul(b.into())) - // Standard Error: 12_680 - .saturating_add(Weight::from_parts(74_712, 0).saturating_mul(m.into())) - // Standard Error: 12_520 - .saturating_add(Weight::from_parts(670_544, 0).saturating_mul(p.into())) + // Estimated: `3783 + m * (33 ±0) + p * (36 ±0)` + // Minimum execution time: 46_323_000 picoseconds. + Weight::from_parts(46_756_551, 3783) + // Standard Error: 751 + .saturating_add(Weight::from_parts(4_944, 0).saturating_mul(b.into())) + // Standard Error: 7_841 + .saturating_add(Weight::from_parts(33_290, 0).saturating_mul(m.into())) + // Standard Error: 7_741 + .saturating_add(Weight::from_parts(272_416, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) - .saturating_add(Weight::from_parts(0, 165).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 180).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 33).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) } /// Storage: TechnicalCommittee Members (r:1 w:0) /// Proof Skipped: TechnicalCommittee Members (max_values: Some(1), max_size: None, mode: Measured) @@ -142,14 +140,14 @@ impl pallet_collective::WeightInfo for WeightInfo { fn vote (m: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `842 + m * (64 ±0)` - // Estimated: `6632 + m * (128 ±0)` - // Minimum execution time: 68_104_000 picoseconds. - Weight::from_parts(79_068_930, 6632) - // Standard Error: 13_671 - .saturating_add(Weight::from_parts(130_890, 0).saturating_mul(m.into())) + // Estimated: `4306 + m * (64 ±0)` + // Minimum execution time: 38_868_000 picoseconds. + Weight::from_parts(40_129_312, 4306) + // Standard Error: 6_629 + .saturating_add(Weight::from_parts(57_672, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) - .saturating_add(Weight::from_parts(0, 128).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) } /// Storage: TechnicalCommittee Voting (r:1 w:1) /// Proof Skipped: TechnicalCommittee Voting (max_values: None, max_size: None, mode: Measured) @@ -164,17 +162,17 @@ impl pallet_collective::WeightInfo for WeightInfo { fn close_early_disapproved (m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `431 + m * (64 ±0) + p * (36 ±0)` - // Estimated: `8075 + m * (260 ±0) + p * (144 ±0)` - // Minimum execution time: 67_651_000 picoseconds. - Weight::from_parts(71_894_266, 8075) - // Standard Error: 13_167 - .saturating_add(Weight::from_parts(114_193, 0).saturating_mul(m.into())) - // Standard Error: 12_840 - .saturating_add(Weight::from_parts(535_191, 0).saturating_mul(p.into())) + // Estimated: `3875 + m * (65 ±0) + p * (36 ±0)` + // Minimum execution time: 48_788_000 picoseconds. + Weight::from_parts(54_221_664, 3875) + // Standard Error: 10_679 + .saturating_add(Weight::from_parts(1_275, 0).saturating_mul(m.into())) + // Standard Error: 10_413 + .saturating_add(Weight::from_parts(293_929, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) - .saturating_add(Weight::from_parts(0, 260).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 144).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) } /// Storage: TechnicalCommittee Voting (r:1 w:1) /// Proof Skipped: TechnicalCommittee Voting (max_values: None, max_size: None, mode: Measured) @@ -190,20 +188,20 @@ impl pallet_collective::WeightInfo for WeightInfo { fn close_early_approved (b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `733 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` - // Estimated: `12228 + b * (4 ±0) + m * (264 ±0) + p * (160 ±0)` - // Minimum execution time: 96_526_000 picoseconds. - Weight::from_parts(113_889_832, 12228) - // Standard Error: 1_535 - .saturating_add(Weight::from_parts(2_870, 0).saturating_mul(b.into())) - // Standard Error: 16_227 - .saturating_add(Weight::from_parts(67_319, 0).saturating_mul(m.into())) - // Standard Error: 15_817 - .saturating_add(Weight::from_parts(702_142, 0).saturating_mul(p.into())) + // Estimated: `4047 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` + // Minimum execution time: 75_401_000 picoseconds. + Weight::from_parts(81_011_199, 4047) + // Standard Error: 923 + .saturating_add(Weight::from_parts(1_644, 0).saturating_mul(b.into())) + // Standard Error: 9_759 + .saturating_add(Weight::from_parts(14_124, 0).saturating_mul(m.into())) + // Standard Error: 9_513 + .saturating_add(Weight::from_parts(254_678, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) - .saturating_add(Weight::from_parts(0, 4).saturating_mul(b.into())) - .saturating_add(Weight::from_parts(0, 264).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 160).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) + .saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into())) } /// Storage: TechnicalCommittee Voting (r:1 w:1) /// Proof Skipped: TechnicalCommittee Voting (max_values: None, max_size: None, mode: Measured) @@ -220,17 +218,17 @@ impl pallet_collective::WeightInfo for WeightInfo { fn close_disapproved (m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `451 + m * (64 ±0) + p * (36 ±0)` - // Estimated: `10070 + m * (325 ±0) + p * (180 ±0)` - // Minimum execution time: 72_430_000 picoseconds. - Weight::from_parts(79_406_354, 10070) - // Standard Error: 14_749 - .saturating_add(Weight::from_parts(91_178, 0).saturating_mul(m.into())) - // Standard Error: 14_381 - .saturating_add(Weight::from_parts(616_228, 0).saturating_mul(p.into())) + // Estimated: `3895 + m * (65 ±0) + p * (36 ±0)` + // Minimum execution time: 53_828_000 picoseconds. + Weight::from_parts(56_074_022, 3895) + // Standard Error: 9_851 + .saturating_add(Weight::from_parts(55_652, 0).saturating_mul(m.into())) + // Standard Error: 9_606 + .saturating_add(Weight::from_parts(276_244, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) - .saturating_add(Weight::from_parts(0, 325).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 180).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) } /// Storage: TechnicalCommittee Voting (r:1 w:1) /// Proof Skipped: TechnicalCommittee Voting (max_values: None, max_size: None, mode: Measured) @@ -248,20 +246,18 @@ impl pallet_collective::WeightInfo for WeightInfo { fn close_approved (b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `753 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` - // Estimated: `14395 + b * (5 ±0) + m * (330 ±0) + p * (200 ±0)` - // Minimum execution time: 107_317_000 picoseconds. - Weight::from_parts(136_262_210, 14395) - // Standard Error: 1_997 - .saturating_add(Weight::from_parts(6_154, 0).saturating_mul(b.into())) - // Standard Error: 21_113 - .saturating_add(Weight::from_parts(36_533, 0).saturating_mul(m.into())) - // Standard Error: 20_580 - .saturating_add(Weight::from_parts(533_990, 0).saturating_mul(p.into())) + // Estimated: `4067 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` + // Minimum execution time: 78_407_000 picoseconds. + Weight::from_parts(83_047_577, 4067) + // Standard Error: 976 + .saturating_add(Weight::from_parts(3_047, 0).saturating_mul(b.into())) + // Standard Error: 10_058 + .saturating_add(Weight::from_parts(299_268, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) - .saturating_add(Weight::from_parts(0, 5).saturating_mul(b.into())) - .saturating_add(Weight::from_parts(0, 330).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 200).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) + .saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into())) } /// Storage: TechnicalCommittee Proposals (r:1 w:1) /// Proof Skipped: TechnicalCommittee Proposals (max_values: Some(1), max_size: None, mode: Measured) @@ -273,13 +269,13 @@ impl pallet_collective::WeightInfo for WeightInfo { fn disapprove_proposal (p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `260 + p * (32 ±0)` - // Estimated: `2265 + p * (96 ±0)` - // Minimum execution time: 37_249_000 picoseconds. - Weight::from_parts(45_749_178, 2265) - // Standard Error: 11_887 - .saturating_add(Weight::from_parts(562_550, 0).saturating_mul(p.into())) + // Estimated: `1745 + p * (32 ±0)` + // Minimum execution time: 28_797_000 picoseconds. + Weight::from_parts(34_789_821, 1745) + // Standard Error: 8_315 + .saturating_add(Weight::from_parts(211_487, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) - .saturating_add(Weight::from_parts(0, 96).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 32).saturating_mul(p.into())) } } \ No newline at end of file diff --git a/parachain/runtime/interlay/src/weights/pallet_identity.rs b/parachain/runtime/interlay/src/weights/pallet_identity.rs index f179921e03..c7c5c51713 100644 --- a/parachain/runtime/interlay/src/weights/pallet_identity.rs +++ b/parachain/runtime/interlay/src/weights/pallet_identity.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for pallet_identity //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-jrrg4`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/interlay/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -45,12 +45,12 @@ impl pallet_identity::WeightInfo for WeightInfo { /// The range of component `r` is `[1, 19]`. fn add_registrar (r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `31 + r * (57 ±0)` + // Measured: `32 + r * (57 ±0)` // Estimated: `2626` - // Minimum execution time: 28_285_000 picoseconds. - Weight::from_parts(31_134_871, 2626) - // Standard Error: 41_361 - .saturating_add(Weight::from_parts(640_975, 0).saturating_mul(r.into())) + // Minimum execution time: 22_445_000 picoseconds. + Weight::from_parts(23_756_709, 2626) + // Standard Error: 5_721 + .saturating_add(Weight::from_parts(167_489, 0).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -62,14 +62,14 @@ impl pallet_identity::WeightInfo for WeightInfo { /// The range of component `x` is `[0, 100]`. fn set_identity (r: u32, x: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `797 + r * (17 ±0)` - // Estimated: `14583` - // Minimum execution time: 92_086_000 picoseconds. - Weight::from_parts(91_339_533, 14583) - // Standard Error: 68_507 - .saturating_add(Weight::from_parts(1_011_797, 0).saturating_mul(r.into())) - // Standard Error: 13_030 - .saturating_add(Weight::from_parts(1_255_225, 0).saturating_mul(x.into())) + // Measured: `1017 + r * (12 ±0)` + // Estimated: `11003` + // Minimum execution time: 63_999_000 picoseconds. + Weight::from_parts(65_678_164, 11003) + // Standard Error: 61_681 + .saturating_add(Weight::from_parts(349_590, 0).saturating_mul(r.into())) + // Standard Error: 11_731 + .saturating_add(Weight::from_parts(1_083_072, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -84,12 +84,12 @@ impl pallet_identity::WeightInfo for WeightInfo { /// The range of component `s` is `[0, 100]`. fn set_subs_new (s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `419` - // Estimated: `22296 + s * (2589 ±0)` - // Minimum execution time: 22_836_000 picoseconds. - Weight::from_parts(64_900_054, 22296) - // Standard Error: 38_498 - .saturating_add(Weight::from_parts(7_425_143, 0).saturating_mul(s.into())) + // Measured: `637` + // Estimated: `11003 + s * (2589 ±0)` + // Minimum execution time: 17_796_000 picoseconds. + Weight::from_parts(47_903_223, 11003) + // Standard Error: 120_498 + .saturating_add(Weight::from_parts(6_559_882, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(s.into()))) .saturating_add(T::DbWeight::get().writes(2_u64)) @@ -107,12 +107,12 @@ impl pallet_identity::WeightInfo for WeightInfo { /// The range of component `p` is `[0, 100]`. fn set_subs_old (p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `512 + p * (32 ±0)` - // Estimated: `21306` - // Minimum execution time: 23_183_000 picoseconds. - Weight::from_parts(62_590_870, 21306) - // Standard Error: 21_122 - .saturating_add(Weight::from_parts(2_998_615, 0).saturating_mul(p.into())) + // Measured: `730 + p * (32 ±0)` + // Estimated: `11003` + // Minimum execution time: 17_565_000 picoseconds. + Weight::from_parts(50_889_102, 11003) + // Standard Error: 41_676 + .saturating_add(Weight::from_parts(2_418_743, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into()))) @@ -130,16 +130,16 @@ impl pallet_identity::WeightInfo for WeightInfo { /// The range of component `x` is `[0, 100]`. fn clear_identity (r: u32, s: u32, x: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `825 + r * (17 ±0) + s * (32 ±0) + x * (66 ±0)` - // Estimated: `21306` - // Minimum execution time: 156_806_000 picoseconds. - Weight::from_parts(59_701_362, 21306) - // Standard Error: 107_650 - .saturating_add(Weight::from_parts(1_832_632, 0).saturating_mul(r.into())) - // Standard Error: 20_341 - .saturating_add(Weight::from_parts(2_968_437, 0).saturating_mul(s.into())) - // Standard Error: 20_341 - .saturating_add(Weight::from_parts(800_329, 0).saturating_mul(x.into())) + // Measured: `1049 + r * (12 ±0) + s * (32 ±0) + x * (66 ±0)` + // Estimated: `11003` + // Minimum execution time: 109_400_000 picoseconds. + Weight::from_parts(86_902_105, 11003) + // Standard Error: 176_683 + .saturating_add(Weight::from_parts(42_180, 0).saturating_mul(r.into())) + // Standard Error: 33_386 + .saturating_add(Weight::from_parts(2_389_801, 0).saturating_mul(s.into())) + // Standard Error: 33_386 + .saturating_add(Weight::from_parts(281_531, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(s.into()))) @@ -154,14 +154,14 @@ impl pallet_identity::WeightInfo for WeightInfo { /// The range of component `x` is `[0, 100]`. fn request_judgement (r: u32, x: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `721 + r * (69 ±0) + x * (66 ±0)` - // Estimated: `17209` - // Minimum execution time: 97_943_000 picoseconds. - Weight::from_parts(97_563_444, 17209) - // Standard Error: 68_848 - .saturating_add(Weight::from_parts(692_460, 0).saturating_mul(r.into())) - // Standard Error: 13_095 - .saturating_add(Weight::from_parts(1_241_864, 0).saturating_mul(x.into())) + // Measured: `942 + r * (64 ±0) + x * (66 ±0)` + // Estimated: `11003` + // Minimum execution time: 72_045_000 picoseconds. + Weight::from_parts(61_074_609, 11003) + // Standard Error: 116_663 + .saturating_add(Weight::from_parts(571_285, 0).saturating_mul(r.into())) + // Standard Error: 22_189 + .saturating_add(Weight::from_parts(1_140_967, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -173,14 +173,14 @@ impl pallet_identity::WeightInfo for WeightInfo { /// The range of component `x` is `[0, 100]`. fn cancel_request (r: u32, x: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `753 + r * (12 ±0) + x * (66 ±0)` - // Estimated: `14583` - // Minimum execution time: 83_591_000 picoseconds. - Weight::from_parts(75_600_315, 14583) - // Standard Error: 61_196 - .saturating_add(Weight::from_parts(762_700, 0).saturating_mul(r.into())) - // Standard Error: 11_639 - .saturating_add(Weight::from_parts(1_301_192, 0).saturating_mul(x.into())) + // Measured: `973 + r * (7 ±0) + x * (66 ±0)` + // Estimated: `11003` + // Minimum execution time: 62_395_000 picoseconds. + Weight::from_parts(61_639_151, 11003) + // Standard Error: 88_015 + .saturating_add(Weight::from_parts(245_592, 0).saturating_mul(r.into())) + // Standard Error: 16_740 + .saturating_add(Weight::from_parts(1_037_672, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -189,12 +189,12 @@ impl pallet_identity::WeightInfo for WeightInfo { /// The range of component `r` is `[1, 19]`. fn set_fee (r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `88 + r * (57 ±0)` + // Measured: `89 + r * (57 ±0)` // Estimated: `2626` - // Minimum execution time: 18_308_000 picoseconds. - Weight::from_parts(20_184_358, 2626) - // Standard Error: 23_250 - .saturating_add(Weight::from_parts(431_841, 0).saturating_mul(r.into())) + // Minimum execution time: 14_269_000 picoseconds. + Weight::from_parts(14_871_637, 2626) + // Standard Error: 2_602 + .saturating_add(Weight::from_parts(150_392, 0).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -203,12 +203,12 @@ impl pallet_identity::WeightInfo for WeightInfo { /// The range of component `r` is `[1, 19]`. fn set_account_id (r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `88 + r * (57 ±0)` + // Measured: `89 + r * (57 ±0)` // Estimated: `2626` - // Minimum execution time: 19_040_000 picoseconds. - Weight::from_parts(20_345_843, 2626) - // Standard Error: 17_467 - .saturating_add(Weight::from_parts(415_678, 0).saturating_mul(r.into())) + // Minimum execution time: 14_018_000 picoseconds. + Weight::from_parts(14_900_258, 2626) + // Standard Error: 4_272 + .saturating_add(Weight::from_parts(148_637, 0).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -217,12 +217,12 @@ impl pallet_identity::WeightInfo for WeightInfo { /// The range of component `r` is `[1, 19]`. fn set_fields (r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `88 + r * (57 ±0)` + // Measured: `89 + r * (57 ±0)` // Estimated: `2626` - // Minimum execution time: 18_404_000 picoseconds. - Weight::from_parts(19_550_443, 2626) - // Standard Error: 18_770 - .saturating_add(Weight::from_parts(400_503, 0).saturating_mul(r.into())) + // Minimum execution time: 14_008_000 picoseconds. + Weight::from_parts(15_066_270, 2626) + // Standard Error: 5_721 + .saturating_add(Weight::from_parts(137_567, 0).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -234,14 +234,14 @@ impl pallet_identity::WeightInfo for WeightInfo { /// The range of component `x` is `[0, 100]`. fn provide_judgement (r: u32, x: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `444 + r * (57 ±0) + x * (66 ±0)` - // Estimated: `13629` - // Minimum execution time: 62_083_000 picoseconds. - Weight::from_parts(55_493_478, 13629) - // Standard Error: 67_748 - .saturating_add(Weight::from_parts(785_801, 0).saturating_mul(r.into())) - // Standard Error: 12_235 - .saturating_add(Weight::from_parts(1_957_097, 0).saturating_mul(x.into())) + // Measured: `445 + r * (57 ±0) + x * (66 ±0)` + // Estimated: `11003` + // Minimum execution time: 42_455_000 picoseconds. + Weight::from_parts(43_058_178, 11003) + // Standard Error: 17_677 + .saturating_add(Weight::from_parts(86_899, 0).saturating_mul(r.into())) + // Standard Error: 3_192 + .saturating_add(Weight::from_parts(1_696_419, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -260,16 +260,16 @@ impl pallet_identity::WeightInfo for WeightInfo { /// The range of component `x` is `[0, 100]`. fn kill_identity (r: u32, s: u32, x: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `879 + r * (13 ±0) + s * (32 ±0) + x * (66 ±0)` - // Estimated: `24806` - // Minimum execution time: 274_589_000 picoseconds. - Weight::from_parts(311_292_941, 24806) - // Standard Error: 408_105 - .saturating_add(Weight::from_parts(171_681, 0).saturating_mul(r.into())) - // Standard Error: 77_115 - .saturating_add(Weight::from_parts(2_838_867, 0).saturating_mul(s.into())) - // Standard Error: 77_115 - .saturating_add(Weight::from_parts(644_382, 0).saturating_mul(x.into())) + // Measured: `1133 + r * (8 ±0) + s * (32 ±0) + x * (66 ±0)` + // Estimated: `11003` + // Minimum execution time: 137_084_000 picoseconds. + Weight::from_parts(81_494_923, 11003) + // Standard Error: 130_256 + .saturating_add(Weight::from_parts(202_721, 0).saturating_mul(r.into())) + // Standard Error: 24_613 + .saturating_add(Weight::from_parts(2_433_856, 0).saturating_mul(s.into())) + // Standard Error: 24_613 + .saturating_add(Weight::from_parts(573_483, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(s.into()))) @@ -285,12 +285,12 @@ impl pallet_identity::WeightInfo for WeightInfo { /// The range of component `s` is `[0, 99]`. fn add_sub (s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `793 + s * (36 ±0)` - // Estimated: `24885` - // Minimum execution time: 77_951_000 picoseconds. - Weight::from_parts(93_359_690, 24885) - // Standard Error: 12_406 - .saturating_add(Weight::from_parts(308_142, 0).saturating_mul(s.into())) + // Measured: `1011 + s * (36 ±0)` + // Estimated: `11003` + // Minimum execution time: 65_772_000 picoseconds. + Weight::from_parts(73_485_025, 11003) + // Standard Error: 3_768 + .saturating_add(Weight::from_parts(84_025, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -301,12 +301,12 @@ impl pallet_identity::WeightInfo for WeightInfo { /// The range of component `s` is `[1, 100]`. fn rename_sub (s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `590 + s * (3 ±0)` - // Estimated: `14582` - // Minimum execution time: 30_781_000 picoseconds. - Weight::from_parts(36_339_461, 14582) - // Standard Error: 5_712 - .saturating_add(Weight::from_parts(106_410, 0).saturating_mul(s.into())) + // Measured: `591 + s * (3 ±0)` + // Estimated: `11003` + // Minimum execution time: 23_597_000 picoseconds. + Weight::from_parts(26_704_574, 11003) + // Standard Error: 1_776 + .saturating_add(Weight::from_parts(19_797, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -321,12 +321,12 @@ impl pallet_identity::WeightInfo for WeightInfo { /// The range of component `s` is `[1, 100]`. fn remove_sub (s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `956 + s * (35 ±0)` - // Estimated: `24885` - // Minimum execution time: 79_122_000 picoseconds. - Weight::from_parts(86_539_531, 24885) - // Standard Error: 12_333 - .saturating_add(Weight::from_parts(330_446, 0).saturating_mul(s.into())) + // Measured: `1174 + s * (35 ±0)` + // Estimated: `11003` + // Minimum execution time: 63_447_000 picoseconds. + Weight::from_parts(69_904_554, 11003) + // Standard Error: 4_285 + .saturating_add(Weight::from_parts(54_384, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -339,12 +339,12 @@ impl pallet_identity::WeightInfo for WeightInfo { /// The range of component `s` is `[0, 99]`. fn quit_sub (s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `882 + s * (37 ±0)` - // Estimated: `16472` - // Minimum execution time: 128_616_000 picoseconds. - Weight::from_parts(143_077_089, 16472) - // Standard Error: 21_048 - .saturating_add(Weight::from_parts(217_420, 0).saturating_mul(s.into())) + // Measured: `1100 + s * (37 ±0)` + // Estimated: `6723` + // Minimum execution time: 103_998_000 picoseconds. + Weight::from_parts(108_496_768, 6723) + // Standard Error: 4_429 + .saturating_add(Weight::from_parts(86_220, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } diff --git a/parachain/runtime/interlay/src/weights/pallet_membership.rs b/parachain/runtime/interlay/src/weights/pallet_membership.rs index 8852e70d89..fcdb95b9d9 100644 --- a/parachain/runtime/interlay/src/weights/pallet_membership.rs +++ b/parachain/runtime/interlay/src/weights/pallet_membership.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for pallet_membership //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-jrrg4`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/interlay/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -52,14 +52,14 @@ impl pallet_membership::WeightInfo for WeightInfo { fn add_member (m: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `135 + m * (64 ±0)` - // Estimated: `6574 + m * (192 ±0)` - // Minimum execution time: 36_135_000 picoseconds. - Weight::from_parts(40_099_506, 6574) - // Standard Error: 5_392 - .saturating_add(Weight::from_parts(69_878, 0).saturating_mul(m.into())) + // Estimated: `4687 + m * (64 ±0)` + // Minimum execution time: 29_359_000 picoseconds. + Weight::from_parts(30_811_808, 4687) + // Standard Error: 1_728 + .saturating_add(Weight::from_parts(49_864, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) - .saturating_add(Weight::from_parts(0, 192).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) } /// Storage: TechnicalMembership Members (r:1 w:1) /// Proof: TechnicalMembership Members (max_values: Some(1), max_size: Some(3202), added: 3697, mode: MaxEncodedLen) @@ -75,14 +75,14 @@ impl pallet_membership::WeightInfo for WeightInfo { fn remove_member (m: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `239 + m * (64 ±0)` - // Estimated: `8403 + m * (192 ±0)` - // Minimum execution time: 42_745_000 picoseconds. - Weight::from_parts(46_076_131, 8403) - // Standard Error: 7_343 - .saturating_add(Weight::from_parts(65_455, 0).saturating_mul(m.into())) + // Estimated: `4687 + m * (64 ±0)` + // Minimum execution time: 33_688_000 picoseconds. + Weight::from_parts(35_819_967, 4687) + // Standard Error: 1_925 + .saturating_add(Weight::from_parts(40_006, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) - .saturating_add(Weight::from_parts(0, 192).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) } /// Storage: TechnicalMembership Members (r:1 w:1) /// Proof: TechnicalMembership Members (max_values: Some(1), max_size: Some(3202), added: 3697, mode: MaxEncodedLen) @@ -98,14 +98,14 @@ impl pallet_membership::WeightInfo for WeightInfo { fn swap_member (m: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `239 + m * (64 ±0)` - // Estimated: `8403 + m * (192 ±0)` - // Minimum execution time: 42_750_000 picoseconds. - Weight::from_parts(46_324_805, 8403) - // Standard Error: 4_636 - .saturating_add(Weight::from_parts(81_716, 0).saturating_mul(m.into())) + // Estimated: `4687 + m * (64 ±0)` + // Minimum execution time: 33_707_000 picoseconds. + Weight::from_parts(35_899_102, 4687) + // Standard Error: 2_114 + .saturating_add(Weight::from_parts(58_918, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) - .saturating_add(Weight::from_parts(0, 192).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) } /// Storage: TechnicalMembership Members (r:1 w:1) /// Proof: TechnicalMembership Members (max_values: Some(1), max_size: Some(3202), added: 3697, mode: MaxEncodedLen) @@ -121,14 +121,14 @@ impl pallet_membership::WeightInfo for WeightInfo { fn reset_member (m: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `239 + m * (64 ±0)` - // Estimated: `8403 + m * (192 ±0)` - // Minimum execution time: 40_881_000 picoseconds. - Weight::from_parts(46_277_495, 8403) - // Standard Error: 7_454 - .saturating_add(Weight::from_parts(306_640, 0).saturating_mul(m.into())) + // Estimated: `4687 + m * (64 ±0)` + // Minimum execution time: 33_427_000 picoseconds. + Weight::from_parts(36_483_001, 4687) + // Standard Error: 3_091 + .saturating_add(Weight::from_parts(209_236, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) - .saturating_add(Weight::from_parts(0, 192).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) } /// Storage: TechnicalMembership Members (r:1 w:1) /// Proof: TechnicalMembership Members (max_values: Some(1), max_size: Some(3202), added: 3697, mode: MaxEncodedLen) @@ -144,14 +144,14 @@ impl pallet_membership::WeightInfo for WeightInfo { fn change_key (m: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `239 + m * (64 ±0)` - // Estimated: `8403 + m * (192 ±0)` - // Minimum execution time: 43_327_000 picoseconds. - Weight::from_parts(48_319_947, 8403) - // Standard Error: 7_030 - .saturating_add(Weight::from_parts(81_382, 0).saturating_mul(m.into())) + // Estimated: `4687 + m * (64 ±0)` + // Minimum execution time: 34_429_000 picoseconds. + Weight::from_parts(36_744_041, 4687) + // Standard Error: 2_154 + .saturating_add(Weight::from_parts(60_320, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) - .saturating_add(Weight::from_parts(0, 192).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) } /// Storage: TechnicalMembership Members (r:1 w:0) /// Proof: TechnicalMembership Members (max_values: Some(1), max_size: Some(3202), added: 3697, mode: MaxEncodedLen) @@ -163,11 +163,11 @@ impl pallet_membership::WeightInfo for WeightInfo { fn set_prime (m: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `31 + m * (32 ±0)` - // Estimated: `4718 + m * (32 ±0)` - // Minimum execution time: 16_867_000 picoseconds. - Weight::from_parts(17_803_828, 4718) - // Standard Error: 2_856 - .saturating_add(Weight::from_parts(25_226, 0).saturating_mul(m.into())) + // Estimated: `4687 + m * (32 ±0)` + // Minimum execution time: 13_366_000 picoseconds. + Weight::from_parts(14_277_554, 4687) + // Standard Error: 635 + .saturating_add(Weight::from_parts(9_514, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) @@ -177,14 +177,12 @@ impl pallet_membership::WeightInfo for WeightInfo { /// Storage: TechnicalCommittee Prime (r:0 w:1) /// Proof Skipped: TechnicalCommittee Prime (max_values: Some(1), max_size: None, mode: Measured) /// The range of component `m` is `[1, 100]`. - fn clear_prime (m: u32, ) -> Weight { + fn clear_prime (_m: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_977_000 picoseconds. - Weight::from_parts(8_590_771, 0) - // Standard Error: 2_369 - .saturating_add(Weight::from_parts(6_119, 0).saturating_mul(m.into())) + // Minimum execution time: 6_574_000 picoseconds. + Weight::from_parts(7_091_990, 0) .saturating_add(T::DbWeight::get().writes(2_u64)) } } \ No newline at end of file diff --git a/parachain/runtime/interlay/src/weights/pallet_multisig.rs b/parachain/runtime/interlay/src/weights/pallet_multisig.rs index 7e5fc6c256..7fa7ac2cb6 100644 --- a/parachain/runtime/interlay/src/weights/pallet_multisig.rs +++ b/parachain/runtime/interlay/src/weights/pallet_multisig.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for pallet_multisig //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-jrrg4`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/interlay/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -45,10 +45,10 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 40_254_000 picoseconds. - Weight::from_parts(45_954_521, 0) - // Standard Error: 78 - .saturating_add(Weight::from_parts(1_088, 0).saturating_mul(z.into())) + // Minimum execution time: 20_220_000 picoseconds. + Weight::from_parts(21_500_794, 0) + // Standard Error: 51 + .saturating_add(Weight::from_parts(527, 0).saturating_mul(z.into())) } /// Storage: Multisig Multisigs (r:1 w:1) /// Proof: Multisig Multisigs (max_values: None, max_size: Some(3346), added: 5821, mode: MaxEncodedLen) @@ -58,14 +58,14 @@ impl pallet_multisig::WeightInfo for WeightInfo { /// The range of component `z` is `[0, 10000]`. fn as_multi_create (s: u32, z: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `679 + s * (3 ±0)` - // Estimated: `10391` - // Minimum execution time: 100_166_000 picoseconds. - Weight::from_parts(78_077_241, 10391) - // Standard Error: 12_891 - .saturating_add(Weight::from_parts(500_683, 0).saturating_mul(s.into())) - // Standard Error: 126 - .saturating_add(Weight::from_parts(2_720, 0).saturating_mul(z.into())) + // Measured: `785 + s * (2 ±0)` + // Estimated: `6811` + // Minimum execution time: 76_122_000 picoseconds. + Weight::from_parts(68_806_273, 6811) + // Standard Error: 4_377 + .saturating_add(Weight::from_parts(109_000, 0).saturating_mul(s.into())) + // Standard Error: 42 + .saturating_add(Weight::from_parts(1_352, 0).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -77,12 +77,12 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `210` // Estimated: `6811` - // Minimum execution time: 67_053_000 picoseconds. - Weight::from_parts(49_470_953, 6811) - // Standard Error: 10_765 - .saturating_add(Weight::from_parts(372_231, 0).saturating_mul(s.into())) - // Standard Error: 105 - .saturating_add(Weight::from_parts(2_250, 0).saturating_mul(z.into())) + // Minimum execution time: 43_367_000 picoseconds. + Weight::from_parts(38_850_566, 6811) + // Standard Error: 5_924 + .saturating_add(Weight::from_parts(84_915, 0).saturating_mul(s.into())) + // Standard Error: 58 + .saturating_add(Weight::from_parts(1_226, 0).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -94,14 +94,14 @@ impl pallet_multisig::WeightInfo for WeightInfo { /// The range of component `z` is `[0, 10000]`. fn as_multi_complete (s: u32, z: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `820 + s * (35 ±0)` - // Estimated: `10391` - // Minimum execution time: 98_109_000 picoseconds. - Weight::from_parts(88_799_005, 10391) - // Standard Error: 15_677 - .saturating_add(Weight::from_parts(531_558, 0).saturating_mul(s.into())) - // Standard Error: 153 - .saturating_add(Weight::from_parts(2_801, 0).saturating_mul(z.into())) + // Measured: `927 + s * (34 ±0)` + // Estimated: `6811` + // Minimum execution time: 74_970_000 picoseconds. + Weight::from_parts(64_293_492, 6811) + // Standard Error: 8_085 + .saturating_add(Weight::from_parts(138_889, 0).saturating_mul(s.into())) + // Standard Error: 79 + .saturating_add(Weight::from_parts(1_554, 0).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -112,12 +112,12 @@ impl pallet_multisig::WeightInfo for WeightInfo { /// The range of component `s` is `[2, 100]`. fn approve_as_multi_create (s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `681 + s * (3 ±0)` - // Estimated: `10391` - // Minimum execution time: 74_815_000 picoseconds. - Weight::from_parts(82_028_501, 10391) - // Standard Error: 14_163 - .saturating_add(Weight::from_parts(476_567, 0).saturating_mul(s.into())) + // Measured: `785 + s * (2 ±0)` + // Estimated: `6811` + // Minimum execution time: 61_033_000 picoseconds. + Weight::from_parts(63_605_389, 6811) + // Standard Error: 3_464 + .saturating_add(Weight::from_parts(117_310, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -128,10 +128,10 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `210` // Estimated: `6811` - // Minimum execution time: 44_360_000 picoseconds. - Weight::from_parts(48_304_264, 6811) - // Standard Error: 11_358 - .saturating_add(Weight::from_parts(370_201, 0).saturating_mul(s.into())) + // Minimum execution time: 32_866_000 picoseconds. + Weight::from_parts(34_746_154, 6811) + // Standard Error: 2_804 + .saturating_add(Weight::from_parts(78_497, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -142,12 +142,12 @@ impl pallet_multisig::WeightInfo for WeightInfo { /// The range of component `s` is `[2, 100]`. fn cancel_as_multi (s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `887 + s * (3 ±0)` - // Estimated: `10391` - // Minimum execution time: 70_033_000 picoseconds. - Weight::from_parts(78_599_449, 10391) - // Standard Error: 16_395 - .saturating_add(Weight::from_parts(444_403, 0).saturating_mul(s.into())) + // Measured: `991 + s * (2 ±0)` + // Estimated: `6811` + // Minimum execution time: 56_042_000 picoseconds. + Weight::from_parts(57_944_956, 6811) + // Standard Error: 3_359 + .saturating_add(Weight::from_parts(93_599, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } diff --git a/parachain/runtime/interlay/src/weights/pallet_preimage.rs b/parachain/runtime/interlay/src/weights/pallet_preimage.rs index aca53cfd92..21a67dbd0b 100644 --- a/parachain/runtime/interlay/src/weights/pallet_preimage.rs +++ b/parachain/runtime/interlay/src/weights/pallet_preimage.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for pallet_preimage //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-jrrg4`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/interlay/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -49,12 +49,12 @@ impl pallet_preimage::WeightInfo for WeightInfo { /// The range of component `s` is `[0, 4194304]`. fn note_preimage (s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `361` - // Estimated: `7136` - // Minimum execution time: 70_471_000 picoseconds. - Weight::from_parts(70_690_000, 7136) - // Standard Error: 18 - .saturating_add(Weight::from_parts(4_530, 0).saturating_mul(s.into())) + // Measured: `578` + // Estimated: `3580` + // Minimum execution time: 56_674_000 picoseconds. + Weight::from_parts(56_744_000, 3580) + // Standard Error: 9 + .saturating_add(Weight::from_parts(2_253, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -67,10 +67,10 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `106` // Estimated: `3556` - // Minimum execution time: 38_328_000 picoseconds. - Weight::from_parts(38_931_000, 3556) - // Standard Error: 19 - .saturating_add(Weight::from_parts(4_408, 0).saturating_mul(s.into())) + // Minimum execution time: 30_431_000 picoseconds. + Weight::from_parts(30_621_000, 3556) + // Standard Error: 7 + .saturating_add(Weight::from_parts(2_235, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -83,10 +83,10 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `106` // Estimated: `3556` - // Minimum execution time: 36_339_000 picoseconds. - Weight::from_parts(36_680_000, 3556) - // Standard Error: 18 - .saturating_add(Weight::from_parts(4_436, 0).saturating_mul(s.into())) + // Minimum execution time: 28_828_000 picoseconds. + Weight::from_parts(28_978_000, 3556) + // Standard Error: 6 + .saturating_add(Weight::from_parts(2_180, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -98,10 +98,10 @@ impl pallet_preimage::WeightInfo for WeightInfo { /// Proof: Preimage PreimageFor (max_values: None, max_size: Some(4194344), added: 4196819, mode: MaxEncodedLen) fn unnote_preimage () -> Weight { // Proof Size summary in bytes: - // Measured: `507` - // Estimated: `7136` - // Minimum execution time: 113_035_000 picoseconds. - Weight::from_parts(119_506_000, 7136) + // Measured: `724` + // Estimated: `3580` + // Minimum execution time: 77_946_000 picoseconds. + Weight::from_parts(82_034_000, 3580) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -113,8 +113,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `144` // Estimated: `3556` - // Minimum execution time: 80_343_000 picoseconds. - Weight::from_parts(84_433_000, 3556) + // Minimum execution time: 48_898_000 picoseconds. + Weight::from_parts(51_533_000, 3556) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -124,8 +124,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `188` // Estimated: `3556` - // Minimum execution time: 73_268_000 picoseconds. - Weight::from_parts(75_724_000, 3556) + // Minimum execution time: 44_018_000 picoseconds. + Weight::from_parts(46_012_000, 3556) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -135,8 +135,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `144` // Estimated: `3556` - // Minimum execution time: 48_665_000 picoseconds. - Weight::from_parts(50_252_000, 3556) + // Minimum execution time: 27_455_000 picoseconds. + Weight::from_parts(28_757_000, 3556) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -146,8 +146,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `42` // Estimated: `3556` - // Minimum execution time: 55_790_000 picoseconds. - Weight::from_parts(59_109_000, 3556) + // Minimum execution time: 24_489_000 picoseconds. + Weight::from_parts(25_091_000, 3556) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -157,8 +157,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `106` // Estimated: `3556` - // Minimum execution time: 25_495_000 picoseconds. - Weight::from_parts(25_914_000, 3556) + // Minimum execution time: 15_050_000 picoseconds. + Weight::from_parts(15_451_000, 3556) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -170,8 +170,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `144` // Estimated: `3556` - // Minimum execution time: 75_413_000 picoseconds. - Weight::from_parts(82_295_000, 3556) + // Minimum execution time: 46_563_000 picoseconds. + Weight::from_parts(48_607_000, 3556) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -181,8 +181,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `106` // Estimated: `3556` - // Minimum execution time: 25_370_000 picoseconds. - Weight::from_parts(27_662_000, 3556) + // Minimum execution time: 14_940_000 picoseconds. + Weight::from_parts(15_401_000, 3556) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -192,8 +192,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `106` // Estimated: `3556` - // Minimum execution time: 24_775_000 picoseconds. - Weight::from_parts(26_112_000, 3556) + // Minimum execution time: 14_850_000 picoseconds. + Weight::from_parts(15_461_000, 3556) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } diff --git a/parachain/runtime/interlay/src/weights/pallet_proxy.rs b/parachain/runtime/interlay/src/weights/pallet_proxy.rs index 7807d81405..3750697150 100644 --- a/parachain/runtime/interlay/src/weights/pallet_proxy.rs +++ b/parachain/runtime/interlay/src/weights/pallet_proxy.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for pallet_proxy //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-jrrg4`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/interlay/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -45,12 +45,12 @@ impl pallet_proxy::WeightInfo for WeightInfo { /// The range of component `p` is `[1, 31]`. fn proxy (p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `199 + p * (37 ±0)` + // Measured: `251 + p * (37 ±0)` // Estimated: `4706` - // Minimum execution time: 39_254_000 picoseconds. - Weight::from_parts(41_395_129, 4706) - // Standard Error: 16_886 - .saturating_add(Weight::from_parts(174_688, 0).saturating_mul(p.into())) + // Minimum execution time: 30_912_000 picoseconds. + Weight::from_parts(30_623_419, 4706) + // Standard Error: 28_458 + .saturating_add(Weight::from_parts(166_114, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: Proxy Proxies (r:1 w:0) @@ -63,14 +63,14 @@ impl pallet_proxy::WeightInfo for WeightInfo { /// The range of component `p` is `[1, 31]`. fn proxy_announced (a: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `771 + a * (68 ±0) + p * (37 ±0)` - // Estimated: `13984` - // Minimum execution time: 86_714_000 picoseconds. - Weight::from_parts(86_967_835, 13984) - // Standard Error: 35_642 - .saturating_add(Weight::from_parts(634_473, 0).saturating_mul(a.into())) - // Standard Error: 36_875 - .saturating_add(Weight::from_parts(287_102, 0).saturating_mul(p.into())) + // Measured: `1011 + a * (68 ±0) + p * (37 ±0)` + // Estimated: `5698` + // Minimum execution time: 67_565_000 picoseconds. + Weight::from_parts(69_851_107, 5698) + // Standard Error: 9_707 + .saturating_add(Weight::from_parts(307_439, 0).saturating_mul(a.into())) + // Standard Error: 10_043 + .saturating_add(Weight::from_parts(66_763, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -80,14 +80,16 @@ impl pallet_proxy::WeightInfo for WeightInfo { /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) /// The range of component `a` is `[0, 31]`. /// The range of component `p` is `[1, 31]`. - fn remove_announcement (a: u32, _p: u32, ) -> Weight { + fn remove_announcement (a: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `686 + a * (68 ±0)` - // Estimated: `9278` - // Minimum execution time: 57_027_000 picoseconds. - Weight::from_parts(63_497_142, 9278) - // Standard Error: 21_946 - .saturating_add(Weight::from_parts(472_425, 0).saturating_mul(a.into())) + // Measured: `926 + a * (68 ±0)` + // Estimated: `5698` + // Minimum execution time: 44_419_000 picoseconds. + Weight::from_parts(46_056_280, 5698) + // Standard Error: 7_299 + .saturating_add(Weight::from_parts(336_362, 0).saturating_mul(a.into())) + // Standard Error: 7_552 + .saturating_add(Weight::from_parts(36_898, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -97,16 +99,14 @@ impl pallet_proxy::WeightInfo for WeightInfo { /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) /// The range of component `a` is `[0, 31]`. /// The range of component `p` is `[1, 31]`. - fn reject_announcement (a: u32, p: u32, ) -> Weight { + fn reject_announcement (a: u32, _p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `686 + a * (68 ±0)` - // Estimated: `9278` - // Minimum execution time: 57_322_000 picoseconds. - Weight::from_parts(62_529_167, 9278) - // Standard Error: 22_606 - .saturating_add(Weight::from_parts(487_003, 0).saturating_mul(a.into())) - // Standard Error: 23_389 - .saturating_add(Weight::from_parts(34_848, 0).saturating_mul(p.into())) + // Measured: `926 + a * (68 ±0)` + // Estimated: `5698` + // Minimum execution time: 44_600_000 picoseconds. + Weight::from_parts(49_852_297, 5698) + // Standard Error: 29_970 + .saturating_add(Weight::from_parts(329_933, 0).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -120,14 +120,14 @@ impl pallet_proxy::WeightInfo for WeightInfo { /// The range of component `p` is `[1, 31]`. fn announce (a: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `703 + a * (68 ±0) + p * (37 ±0)` - // Estimated: `13984` - // Minimum execution time: 82_431_000 picoseconds. - Weight::from_parts(91_399_563, 13984) - // Standard Error: 26_814 - .saturating_add(Weight::from_parts(465_023, 0).saturating_mul(a.into())) - // Standard Error: 27_742 - .saturating_add(Weight::from_parts(58_518, 0).saturating_mul(p.into())) + // Measured: `943 + a * (68 ±0) + p * (37 ±0)` + // Estimated: `5698` + // Minimum execution time: 67_575_000 picoseconds. + Weight::from_parts(75_659_905, 5698) + // Standard Error: 26_467 + .saturating_add(Weight::from_parts(129_800, 0).saturating_mul(a.into())) + // Standard Error: 27_383 + .saturating_add(Weight::from_parts(1_946, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -138,12 +138,12 @@ impl pallet_proxy::WeightInfo for WeightInfo { /// The range of component `p` is `[1, 31]`. fn add_proxy (p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `518 + p * (37 ±0)` - // Estimated: `8286` - // Minimum execution time: 72_509_000 picoseconds. - Weight::from_parts(76_255_771, 8286) - // Standard Error: 24_340 - .saturating_add(Weight::from_parts(200_189, 0).saturating_mul(p.into())) + // Measured: `787 + p * (37 ±0)` + // Estimated: `4706` + // Minimum execution time: 59_289_000 picoseconds. + Weight::from_parts(62_123_571, 4706) + // Standard Error: 9_974 + .saturating_add(Weight::from_parts(99_746, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -154,12 +154,12 @@ impl pallet_proxy::WeightInfo for WeightInfo { /// The range of component `p` is `[1, 31]`. fn remove_proxy (p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `518 + p * (37 ±0)` - // Estimated: `8286` - // Minimum execution time: 63_212_000 picoseconds. - Weight::from_parts(68_993_645, 8286) - // Standard Error: 23_840 - .saturating_add(Weight::from_parts(154_987, 0).saturating_mul(p.into())) + // Measured: `787 + p * (37 ±0)` + // Estimated: `4706` + // Minimum execution time: 51_914_000 picoseconds. + Weight::from_parts(54_858_482, 4706) + // Standard Error: 9_144 + .saturating_add(Weight::from_parts(71_177, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -170,12 +170,12 @@ impl pallet_proxy::WeightInfo for WeightInfo { /// The range of component `p` is `[1, 31]`. fn remove_proxies (p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `518 + p * (37 ±0)` - // Estimated: `8286` - // Minimum execution time: 51_896_000 picoseconds. - Weight::from_parts(56_498_469, 8286) - // Standard Error: 23_386 - .saturating_add(Weight::from_parts(71_334, 0).saturating_mul(p.into())) + // Measured: `787 + p * (37 ±0)` + // Estimated: `4706` + // Minimum execution time: 42_415_000 picoseconds. + Weight::from_parts(44_192_608, 4706) + // Standard Error: 9_610 + .saturating_add(Weight::from_parts(20_010, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -184,14 +184,12 @@ impl pallet_proxy::WeightInfo for WeightInfo { /// Storage: Tokens Accounts (r:1 w:1) /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) /// The range of component `p` is `[1, 31]`. - fn create_pure (p: u32, ) -> Weight { + fn create_pure (_p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `530` - // Estimated: `8286` - // Minimum execution time: 77_205_000 picoseconds. - Weight::from_parts(83_179_242, 8286) - // Standard Error: 24_024 - .saturating_add(Weight::from_parts(52_026, 0).saturating_mul(p.into())) + // Measured: `799` + // Estimated: `4706` + // Minimum execution time: 63_518_000 picoseconds. + Weight::from_parts(66_660_686, 4706) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -202,12 +200,12 @@ impl pallet_proxy::WeightInfo for WeightInfo { /// The range of component `p` is `[0, 30]`. fn kill_pure (p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `588 + p * (37 ±0)` - // Estimated: `8286` - // Minimum execution time: 55_068_000 picoseconds. - Weight::from_parts(58_455_185, 8286) - // Standard Error: 21_996 - .saturating_add(Weight::from_parts(163_126, 0).saturating_mul(p.into())) + // Measured: `857 + p * (37 ±0)` + // Estimated: `4706` + // Minimum execution time: 44_059_000 picoseconds. + Weight::from_parts(45_682_855, 4706) + // Standard Error: 5_345 + .saturating_add(Weight::from_parts(2_697, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } diff --git a/parachain/runtime/interlay/src/weights/pallet_scheduler.rs b/parachain/runtime/interlay/src/weights/pallet_scheduler.rs index a1881f4ac1..71344e6c22 100644 --- a/parachain/runtime/interlay/src/weights/pallet_scheduler.rs +++ b/parachain/runtime/interlay/src/weights/pallet_scheduler.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for pallet_scheduler //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-jrrg4`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/interlay/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -46,8 +46,8 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `31` // Estimated: `1489` - // Minimum execution time: 8_044_000 picoseconds. - Weight::from_parts(8_634_000, 1489) + // Minimum execution time: 6_743_000 picoseconds. + Weight::from_parts(6_873_000, 1489) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -58,10 +58,10 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `78 + s * (177 ±0)` // Estimated: `26848` - // Minimum execution time: 8_111_000 picoseconds. - Weight::from_parts(13_422_815, 26848) - // Standard Error: 16_202 - .saturating_add(Weight::from_parts(1_883_059, 0).saturating_mul(s.into())) + // Minimum execution time: 6_623_000 picoseconds. + Weight::from_parts(11_341_429, 26848) + // Standard Error: 7_932 + .saturating_add(Weight::from_parts(1_230_127, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -69,8 +69,8 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 14_012_000 picoseconds. - Weight::from_parts(14_888_000, 0) + // Minimum execution time: 10_902_000 picoseconds. + Weight::from_parts(11_182_000, 0) } /// Storage: Preimage PreimageFor (r:1 w:1) /// Proof: Preimage PreimageFor (max_values: None, max_size: Some(4194344), added: 4196819, mode: Measured) @@ -80,11 +80,11 @@ impl pallet_scheduler::WeightInfo for WeightInfo { fn service_task_fetched (s: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `179 + s * (1 ±0)` - // Estimated: `7200 + s * (1 ±0)` - // Minimum execution time: 45_981_000 picoseconds. - Weight::from_parts(46_173_000, 7200) - // Standard Error: 45 - .saturating_add(Weight::from_parts(2_876, 0).saturating_mul(s.into())) + // Estimated: `3644 + s * (1 ±0)` + // Minimum execution time: 36_583_000 picoseconds. + Weight::from_parts(36_934_000, 3644) + // Standard Error: 22 + .saturating_add(Weight::from_parts(1_791, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(s.into())) @@ -95,30 +95,30 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 18_120_000 picoseconds. - Weight::from_parts(18_965_000, 0) + // Minimum execution time: 14_349_000 picoseconds. + Weight::from_parts(14_479_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } fn service_task_periodic () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 14_192_000 picoseconds. - Weight::from_parts(15_645_000, 0) + // Minimum execution time: 10_942_000 picoseconds. + Weight::from_parts(11_083_000, 0) } fn execute_dispatch_signed () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 8_022_000 picoseconds. - Weight::from_parts(8_360_000, 0) + // Minimum execution time: 5_872_000 picoseconds. + Weight::from_parts(5_992_000, 0) } fn execute_dispatch_unsigned () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_773_000 picoseconds. - Weight::from_parts(9_017_000, 0) + // Minimum execution time: 5_761_000 picoseconds. + Weight::from_parts(5_992_000, 0) } /// Storage: Scheduler Agenda (r:1 w:1) /// Proof: Scheduler Agenda (max_values: None, max_size: Some(23383), added: 25858, mode: MaxEncodedLen) @@ -127,10 +127,10 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `78 + s * (177 ±0)` // Estimated: `26848` - // Minimum execution time: 32_145_000 picoseconds. - Weight::from_parts(38_211_053, 26848) - // Standard Error: 28_580 - .saturating_add(Weight::from_parts(2_069_526, 0).saturating_mul(s.into())) + // Minimum execution time: 25_642_000 picoseconds. + Weight::from_parts(29_967_259, 26848) + // Standard Error: 7_822 + .saturating_add(Weight::from_parts(1_177_376, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -143,10 +143,10 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `78 + s * (177 ±0)` // Estimated: `26848` - // Minimum execution time: 40_871_000 picoseconds. - Weight::from_parts(40_267_666, 26848) - // Standard Error: 24_016 - .saturating_add(Weight::from_parts(3_346_053, 0).saturating_mul(s.into())) + // Minimum execution time: 31_663_000 picoseconds. + Weight::from_parts(31_062_029, 26848) + // Standard Error: 12_580 + .saturating_add(Weight::from_parts(2_090_123, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -158,11 +158,11 @@ impl pallet_scheduler::WeightInfo for WeightInfo { fn schedule_named (s: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `186 + s * (189 ±0)` - // Estimated: `30361` - // Minimum execution time: 40_580_000 picoseconds. - Weight::from_parts(47_509_309, 30361) - // Standard Error: 20_892 - .saturating_add(Weight::from_parts(2_120_518, 0).saturating_mul(s.into())) + // Estimated: `26848` + // Minimum execution time: 31_794_000 picoseconds. + Weight::from_parts(37_514_363, 26848) + // Standard Error: 10_143 + .saturating_add(Weight::from_parts(1_211_221, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -174,11 +174,11 @@ impl pallet_scheduler::WeightInfo for WeightInfo { fn cancel_named (s: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `217 + s * (188 ±0)` - // Estimated: `30361` - // Minimum execution time: 43_914_000 picoseconds. - Weight::from_parts(43_551_431, 30361) - // Standard Error: 24_498 - .saturating_add(Weight::from_parts(3_425_193, 0).saturating_mul(s.into())) + // Estimated: `26848` + // Minimum execution time: 33_988_000 picoseconds. + Weight::from_parts(34_054_260, 26848) + // Standard Error: 10_277 + .saturating_add(Weight::from_parts(2_146_097, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } diff --git a/parachain/runtime/interlay/src/weights/pallet_timestamp.rs b/parachain/runtime/interlay/src/weights/pallet_timestamp.rs index 84aa72ba11..fd784224a3 100644 --- a/parachain/runtime/interlay/src/weights/pallet_timestamp.rs +++ b/parachain/runtime/interlay/src/weights/pallet_timestamp.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for pallet_timestamp //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-jrrg4`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/interlay/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -42,14 +42,14 @@ impl pallet_timestamp::WeightInfo for WeightInfo { /// Storage: Timestamp Now (r:1 w:1) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: Aura CurrentSlot (r:1 w:0) - /// Proof: Aura CurrentSlot (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + /// Storage: unknown `0x13fe8e6572d0617ab8b9721f4e28cb46` (r:1 w:0) + /// Proof Skipped: unknown `0x13fe8e6572d0617ab8b9721f4e28cb46` (r:1 w:0) fn set () -> Weight { // Proof Size summary in bytes: - // Measured: `194` - // Estimated: `2986` - // Minimum execution time: 23_450_000 picoseconds. - Weight::from_parts(26_310_000, 2986) + // Measured: `166` + // Estimated: `3631` + // Minimum execution time: 15_692_000 picoseconds. + Weight::from_parts(16_192_000, 3631) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -57,7 +57,7 @@ impl pallet_timestamp::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `94` // Estimated: `0` - // Minimum execution time: 8_913_000 picoseconds. - Weight::from_parts(9_230_000, 0) + // Minimum execution time: 7_054_000 picoseconds. + Weight::from_parts(7_305_000, 0) } } \ No newline at end of file diff --git a/parachain/runtime/interlay/src/weights/pallet_utility.rs b/parachain/runtime/interlay/src/weights/pallet_utility.rs index bd5f59636b..0b65fb1f06 100644 --- a/parachain/runtime/interlay/src/weights/pallet_utility.rs +++ b/parachain/runtime/interlay/src/weights/pallet_utility.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for pallet_utility //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-jrrg4`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/interlay/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -45,43 +45,43 @@ impl pallet_utility::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 17_738_000 picoseconds. - Weight::from_parts(18_819_000, 0) - // Standard Error: 16_599 - .saturating_add(Weight::from_parts(13_437_537, 0).saturating_mul(c.into())) + // Minimum execution time: 13_637_000 picoseconds. + Weight::from_parts(14_143_347, 0) + // Standard Error: 7_460 + .saturating_add(Weight::from_parts(10_531_820, 0).saturating_mul(c.into())) } fn as_derivative () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 13_894_000 picoseconds. - Weight::from_parts(14_416_000, 0) + // Minimum execution time: 10_812_000 picoseconds. + Weight::from_parts(11_162_000, 0) } /// The range of component `c` is `[0, 1000]`. fn batch_all (c: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 17_668_000 picoseconds. - Weight::from_parts(17_755_000, 0) - // Standard Error: 18_220 - .saturating_add(Weight::from_parts(14_313_855, 0).saturating_mul(c.into())) + // Minimum execution time: 13_567_000 picoseconds. + Weight::from_parts(92_452_234, 0) + // Standard Error: 81_966 + .saturating_add(Weight::from_parts(11_112_221, 0).saturating_mul(c.into())) } fn dispatch_as () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 23_694_000 picoseconds. - Weight::from_parts(25_584_000, 0) + // Minimum execution time: 18_156_000 picoseconds. + Weight::from_parts(18_417_000, 0) } /// The range of component `c` is `[0, 1000]`. fn force_batch (c: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 17_832_000 picoseconds. - Weight::from_parts(5_470_709, 0) - // Standard Error: 28_314 - .saturating_add(Weight::from_parts(13_509_828, 0).saturating_mul(c.into())) + // Minimum execution time: 13_497_000 picoseconds. + Weight::from_parts(13_667_000, 0) + // Standard Error: 70_076 + .saturating_add(Weight::from_parts(10_839_741, 0).saturating_mul(c.into())) } } \ No newline at end of file diff --git a/parachain/runtime/interlay/src/weights/pallet_xcm.rs b/parachain/runtime/interlay/src/weights/pallet_xcm.rs index 5ba539ee4f..8a22d00eb7 100644 --- a/parachain/runtime/interlay/src/weights/pallet_xcm.rs +++ b/parachain/runtime/interlay/src/weights/pallet_xcm.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for pallet_xcm //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-jrrg4`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/interlay/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -53,9 +53,9 @@ impl pallet_xcm::WeightInfo for WeightInfo { fn send () -> Weight { // Proof Size summary in bytes: // Measured: `107` - // Estimated: `9940` - // Minimum execution time: 65_179_000 picoseconds. - Weight::from_parts(71_351_000, 9940) + // Estimated: `3572` + // Minimum execution time: 48_888_000 picoseconds. + Weight::from_parts(49_649_000, 3572) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -65,20 +65,20 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof Skipped: UnknownTokens ConcreteFungibleBalances (max_values: None, max_size: None, mode: Measured) fn teleport_assets () -> Weight { // Proof Size summary in bytes: - // Measured: `245` - // Estimated: `5199` - // Minimum execution time: 70_619_000 picoseconds. - Weight::from_parts(77_725_000, 5199) + // Measured: `282` + // Estimated: `3747` + // Minimum execution time: 53_066_000 picoseconds. + Weight::from_parts(54_038_000, 3747) .saturating_add(T::DbWeight::get().reads(2_u64)) } /// Storage: ParachainInfo ParachainId (r:1 w:0) /// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) fn reserve_transfer_assets () -> Weight { // Proof Size summary in bytes: - // Measured: `32` + // Measured: `69` // Estimated: `1489` - // Minimum execution time: 50_092_000 picoseconds. - Weight::from_parts(53_236_000, 1489) + // Minimum execution time: 39_580_000 picoseconds. + Weight::from_parts(40_240_000, 1489) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: Benchmark Override (r:0 w:0) @@ -96,8 +96,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 24_237_000 picoseconds. - Weight::from_parts(25_925_000, 0) + // Minimum execution time: 18_748_000 picoseconds. + Weight::from_parts(18_968_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: PolkadotXcm SafeXcmVersion (r:0 w:1) @@ -106,8 +106,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_916_000 picoseconds. - Weight::from_parts(8_452_000, 0) + // Minimum execution time: 6_363_000 picoseconds. + Weight::from_parts(6_453_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: PolkadotXcm VersionNotifiers (r:1 w:1) @@ -129,9 +129,9 @@ impl pallet_xcm::WeightInfo for WeightInfo { fn force_subscribe_version_notify () -> Weight { // Proof Size summary in bytes: // Measured: `107` - // Estimated: `15211` - // Minimum execution time: 74_887_000 picoseconds. - Weight::from_parts(82_833_000, 15211) + // Estimated: `3572` + // Minimum execution time: 58_518_000 picoseconds. + Weight::from_parts(59_028_000, 3572) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -152,20 +152,30 @@ impl pallet_xcm::WeightInfo for WeightInfo { fn force_unsubscribe_version_notify () -> Weight { // Proof Size summary in bytes: // Measured: `290` - // Estimated: `14900` - // Minimum execution time: 75_636_000 picoseconds. - Weight::from_parts(79_084_000, 14900) + // Estimated: `3755` + // Minimum execution time: 58_778_000 picoseconds. + Weight::from_parts(59_099_000, 3755) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } + /// Storage: PolkadotXcm XcmExecutionSuspended (r:0 w:1) + /// Proof Skipped: PolkadotXcm XcmExecutionSuspended (max_values: Some(1), max_size: None, mode: Measured) + fn force_suspension () -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 6_182_000 picoseconds. + Weight::from_parts(6_603_000, 0) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } /// Storage: PolkadotXcm SupportedVersion (r:4 w:2) /// Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured) fn migrate_supported_version () -> Weight { // Proof Size summary in bytes: // Measured: `162` // Estimated: `11052` - // Minimum execution time: 37_859_000 picoseconds. - Weight::from_parts(39_910_000, 11052) + // Minimum execution time: 31_032_000 picoseconds. + Weight::from_parts(31_633_000, 11052) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -175,8 +185,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `166` // Estimated: `11056` - // Minimum execution time: 37_743_000 picoseconds. - Weight::from_parts(38_610_000, 11056) + // Minimum execution time: 31_082_000 picoseconds. + Weight::from_parts(31_813_000, 11056) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -186,8 +196,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `173` // Estimated: `13538` - // Minimum execution time: 39_717_000 picoseconds. - Weight::from_parts(41_478_000, 13538) + // Minimum execution time: 32_806_000 picoseconds. + Weight::from_parts(33_317_000, 13538) .saturating_add(T::DbWeight::get().reads(5_u64)) } /// Storage: PolkadotXcm VersionNotifyTargets (r:2 w:1) @@ -205,9 +215,9 @@ impl pallet_xcm::WeightInfo for WeightInfo { fn notify_current_targets () -> Weight { // Proof Size summary in bytes: // Measured: `174` - // Estimated: `16389` - // Minimum execution time: 69_610_000 picoseconds. - Weight::from_parts(77_275_000, 16389) + // Estimated: `6114` + // Minimum execution time: 54_690_000 picoseconds. + Weight::from_parts(55_060_000, 6114) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -217,8 +227,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `206` // Estimated: `8621` - // Minimum execution time: 22_273_000 picoseconds. - Weight::from_parts(22_672_000, 8621) + // Minimum execution time: 18_016_000 picoseconds. + Weight::from_parts(18_387_000, 8621) .saturating_add(T::DbWeight::get().reads(3_u64)) } /// Storage: PolkadotXcm VersionNotifyTargets (r:4 w:2) @@ -227,8 +237,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `173` // Estimated: `11063` - // Minimum execution time: 39_760_000 picoseconds. - Weight::from_parts(40_857_000, 11063) + // Minimum execution time: 31_664_000 picoseconds. + Weight::from_parts(33_247_000, 11063) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -247,16 +257,9 @@ impl pallet_xcm::WeightInfo for WeightInfo { fn migrate_and_notify_old_targets () -> Weight { // Proof Size summary in bytes: // Measured: `177` - // Estimated: `21357` - // Minimum execution time: 88_134_000 picoseconds. - Weight::from_parts(97_021_000, 21357) - .saturating_add(T::DbWeight::get().reads(9_u64)) - .saturating_add(T::DbWeight::get().writes(4_u64)) - } - - fn force_suspension() -> Weight { - // todo: write and run benchmark - Weight::from_parts(97_021_000, 21357) + // Estimated: `11067` + // Minimum execution time: 66_794_000 picoseconds. + Weight::from_parts(67_596_000, 11067) .saturating_add(T::DbWeight::get().reads(9_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } diff --git a/parachain/runtime/interlay/src/weights/pallet_xcm_benchmarks_fungible.rs b/parachain/runtime/interlay/src/weights/pallet_xcm_benchmarks_fungible.rs index c44e4fd122..441c30d05c 100644 --- a/parachain/runtime/interlay/src/weights/pallet_xcm_benchmarks_fungible.rs +++ b/parachain/runtime/interlay/src/weights/pallet_xcm_benchmarks_fungible.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for pallet_xcm_benchmarks::fungible //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-jrrg4`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/interlay/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -48,10 +48,10 @@ impl WeightInfo { /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) pub fn withdraw_asset () -> Weight { // Proof Size summary in bytes: - // Measured: `544` - // Estimated: `11089` - // Minimum execution time: 63_422_000 picoseconds. - Weight::from_parts(75_445_000, 11089) + // Measured: `761` + // Estimated: `4226` + // Minimum execution time: 55_160_000 picoseconds. + Weight::from_parts(81_553_000, 4226) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -61,10 +61,10 @@ impl WeightInfo { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) pub fn transfer_asset () -> Weight { // Proof Size summary in bytes: - // Measured: `370` - // Estimated: `12366` - // Minimum execution time: 80_750_000 picoseconds. - Weight::from_parts(82_773_000, 12366) + // Measured: `715` + // Estimated: `6196` + // Minimum execution time: 71_543_000 picoseconds. + Weight::from_parts(72_395_000, 6196) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -86,10 +86,10 @@ impl WeightInfo { /// Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) pub fn transfer_reserve_asset () -> Weight { // Proof Size summary in bytes: - // Measured: `509` - // Estimated: `25805` - // Minimum execution time: 134_171_000 picoseconds. - Weight::from_parts(140_144_000, 25805) + // Measured: `891` + // Estimated: `6196` + // Minimum execution time: 111_123_000 picoseconds. + Weight::from_parts(112_295_000, 6196) .saturating_add(T::DbWeight::get().reads(10_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -101,10 +101,10 @@ impl WeightInfo { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) pub fn deposit_asset () -> Weight { // Proof Size summary in bytes: - // Measured: `218` - // Estimated: `10673` - // Minimum execution time: 69_690_000 picoseconds. - Weight::from_parts(73_001_000, 10673) + // Measured: `513` + // Estimated: `3593` + // Minimum execution time: 57_986_000 picoseconds. + Weight::from_parts(58_517_000, 3593) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -128,10 +128,10 @@ impl WeightInfo { /// Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) pub fn deposit_reserve_asset () -> Weight { // Proof Size summary in bytes: - // Measured: `357` - // Estimated: `23352` - // Minimum execution time: 126_531_000 picoseconds. - Weight::from_parts(128_286_000, 23352) + // Measured: `689` + // Estimated: `4154` + // Minimum execution time: 103_648_000 picoseconds. + Weight::from_parts(105_992_000, 4154) .saturating_add(T::DbWeight::get().reads(9_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -149,10 +149,10 @@ impl WeightInfo { /// Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) pub fn initiate_teleport () -> Weight { // Proof Size summary in bytes: - // Measured: `139` - // Estimated: `11589` - // Minimum execution time: 66_860_000 picoseconds. - Weight::from_parts(79_180_000, 11589) + // Measured: `176` + // Estimated: `3641` + // Minimum execution time: 49_880_000 picoseconds. + Weight::from_parts(50_912_000, 3641) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } diff --git a/parachain/runtime/interlay/src/weights/pallet_xcm_benchmarks_generic.rs b/parachain/runtime/interlay/src/weights/pallet_xcm_benchmarks_generic.rs index eb977d473b..534dc34255 100644 --- a/parachain/runtime/interlay/src/weights/pallet_xcm_benchmarks_generic.rs +++ b/parachain/runtime/interlay/src/weights/pallet_xcm_benchmarks_generic.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for pallet_xcm_benchmarks::generic //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-jrrg4`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/interlay/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -54,10 +54,10 @@ impl WeightInfo { /// Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) pub fn report_holding () -> Weight { // Proof Size summary in bytes: - // Measured: `139` - // Estimated: `11589` - // Minimum execution time: 161_504_000 picoseconds. - Weight::from_parts(179_386_000, 11589) + // Measured: `176` + // Estimated: `3641` + // Minimum execution time: 108_617_000 picoseconds. + Weight::from_parts(109_519_000, 3641) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -65,8 +65,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_605_000 picoseconds. - Weight::from_parts(5_302_000, 0) + // Minimum execution time: 3_006_000 picoseconds. + Weight::from_parts(3_066_000, 0) } /// Storage: PolkadotXcm Queries (r:1 w:0) /// Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) @@ -74,61 +74,61 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `103` // Estimated: `3568` - // Minimum execution time: 24_352_000 picoseconds. - Weight::from_parts(26_768_000, 3568) + // Minimum execution time: 18_467_000 picoseconds. + Weight::from_parts(18_678_000, 3568) .saturating_add(T::DbWeight::get().reads(1_u64)) } pub fn transact () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 15_067_000 picoseconds. - Weight::from_parts(15_999_000, 0) + // Minimum execution time: 10_612_000 picoseconds. + Weight::from_parts(11_012_000, 0) } /// Storage: ParachainInfo ParachainId (r:1 w:0) /// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) pub fn refund_surplus () -> Weight { // Proof Size summary in bytes: - // Measured: `32` + // Measured: `69` // Estimated: `1489` - // Minimum execution time: 14_037_000 picoseconds. - Weight::from_parts(15_172_000, 1489) + // Minimum execution time: 11_703_000 picoseconds. + Weight::from_parts(11_994_000, 1489) .saturating_add(T::DbWeight::get().reads(1_u64)) } pub fn set_error_handler () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_281_000 picoseconds. - Weight::from_parts(4_458_000, 0) + // Minimum execution time: 2_695_000 picoseconds. + Weight::from_parts(2_806_000, 0) } pub fn set_appendix () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_256_000 picoseconds. - Weight::from_parts(6_556_000, 0) + // Minimum execution time: 2_736_000 picoseconds. + Weight::from_parts(2_815_000, 0) } pub fn clear_error () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_217_000 picoseconds. - Weight::from_parts(6_289_000, 0) + // Minimum execution time: 2_605_000 picoseconds. + Weight::from_parts(2_695_000, 0) } pub fn descend_origin () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_375_000 picoseconds. - Weight::from_parts(5_847_000, 0) + // Minimum execution time: 3_407_000 picoseconds. + Weight::from_parts(3_507_000, 0) } pub fn clear_origin () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_119_000 picoseconds. - Weight::from_parts(4_250_000, 0) + // Minimum execution time: 2_575_000 picoseconds. + Weight::from_parts(2_725_000, 0) } /// Storage: ParachainInfo ParachainId (r:1 w:0) /// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -144,10 +144,10 @@ impl WeightInfo { /// Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) pub fn report_error () -> Weight { // Proof Size summary in bytes: - // Measured: `139` - // Estimated: `11589` - // Minimum execution time: 55_788_000 picoseconds. - Weight::from_parts(61_921_000, 11589) + // Measured: `176` + // Estimated: `3641` + // Minimum execution time: 43_447_000 picoseconds. + Weight::from_parts(43_928_000, 3641) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -157,8 +157,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `160` // Estimated: `3625` - // Minimum execution time: 33_340_000 picoseconds. - Weight::from_parts(36_931_000, 3625) + // Minimum execution time: 25_631_000 picoseconds. + Weight::from_parts(26_152_000, 3625) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -166,8 +166,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_200_000 picoseconds. - Weight::from_parts(4_454_000, 0) + // Minimum execution time: 2_615_000 picoseconds. + Weight::from_parts(2_715_000, 0) } /// Storage: PolkadotXcm VersionNotifyTargets (r:1 w:1) /// Proof Skipped: PolkadotXcm VersionNotifyTargets (max_values: None, max_size: None, mode: Measured) @@ -184,9 +184,9 @@ impl WeightInfo { pub fn subscribe_version () -> Weight { // Proof Size summary in bytes: // Measured: `107` - // Estimated: `13512` - // Minimum execution time: 61_838_000 picoseconds. - Weight::from_parts(64_080_000, 13512) + // Estimated: `3572` + // Minimum execution time: 49_099_000 picoseconds. + Weight::from_parts(49_399_000, 3572) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -196,8 +196,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 9_565_000 picoseconds. - Weight::from_parts(10_474_000, 0) + // Minimum execution time: 6_774_000 picoseconds. + Weight::from_parts(6_934_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: ParachainInfo ParachainId (r:1 w:0) @@ -214,10 +214,10 @@ impl WeightInfo { /// Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) pub fn initiate_reserve_withdraw () -> Weight { // Proof Size summary in bytes: - // Measured: `139` - // Estimated: `11589` - // Minimum execution time: 154_343_000 picoseconds. - Weight::from_parts(165_251_000, 11589) + // Measured: `176` + // Estimated: `3641` + // Minimum execution time: 102_094_000 picoseconds. + Weight::from_parts(103_127_000, 3641) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -225,36 +225,36 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 30_106_000 picoseconds. - Weight::from_parts(31_191_000, 0) + // Minimum execution time: 17_415_000 picoseconds. + Weight::from_parts(17_505_000, 0) } pub fn expect_asset () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 6_040_000 picoseconds. - Weight::from_parts(6_502_000, 0) + // Minimum execution time: 3_868_000 picoseconds. + Weight::from_parts(3_998_000, 0) } pub fn expect_origin () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_319_000 picoseconds. - Weight::from_parts(4_916_000, 0) + // Minimum execution time: 2_746_000 picoseconds. + Weight::from_parts(2_856_000, 0) } pub fn expect_error () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_163_000 picoseconds. - Weight::from_parts(4_830_000, 0) + // Minimum execution time: 2_615_000 picoseconds. + Weight::from_parts(2_755_000, 0) } pub fn expect_transact_status () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_635_000 picoseconds. - Weight::from_parts(4_687_000, 0) + // Minimum execution time: 2_996_000 picoseconds. + Weight::from_parts(3_046_000, 0) } /// Storage: ParachainInfo ParachainId (r:1 w:0) /// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -270,10 +270,10 @@ impl WeightInfo { /// Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) pub fn query_pallet () -> Weight { // Proof Size summary in bytes: - // Measured: `139` - // Estimated: `11589` - // Minimum execution time: 84_125_000 picoseconds. - Weight::from_parts(86_998_000, 11589) + // Measured: `176` + // Estimated: `3641` + // Minimum execution time: 67_074_000 picoseconds. + Weight::from_parts(67_846_000, 3641) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -281,8 +281,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 25_588_000 picoseconds. - Weight::from_parts(26_555_000, 0) + // Minimum execution time: 22_164_000 picoseconds. + Weight::from_parts(22_566_000, 0) } /// Storage: ParachainInfo ParachainId (r:1 w:0) /// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -298,10 +298,10 @@ impl WeightInfo { /// Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) pub fn report_transact_status () -> Weight { // Proof Size summary in bytes: - // Measured: `139` - // Estimated: `11589` - // Minimum execution time: 56_117_000 picoseconds. - Weight::from_parts(67_543_000, 11589) + // Measured: `176` + // Estimated: `3641` + // Minimum execution time: 43_667_000 picoseconds. + Weight::from_parts(44_108_000, 3641) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -309,35 +309,35 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_335_000 picoseconds. - Weight::from_parts(6_706_000, 0) + // Minimum execution time: 2_786_000 picoseconds. + Weight::from_parts(2_875_000, 0) } pub fn set_topic () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_137_000 picoseconds. - Weight::from_parts(4_484_000, 0) + // Minimum execution time: 2_705_000 picoseconds. + Weight::from_parts(2_795_000, 0) } pub fn clear_topic () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_133_000 picoseconds. - Weight::from_parts(4_338_000, 0) + // Minimum execution time: 2_585_000 picoseconds. + Weight::from_parts(2_635_000, 0) } pub fn set_fees_mode () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_068_000 picoseconds. - Weight::from_parts(4_240_000, 0) + // Minimum execution time: 2_605_000 picoseconds. + Weight::from_parts(2_725_000, 0) } pub fn unpaid_execution () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_389_000 picoseconds. - Weight::from_parts(9_599_000, 0) + // Minimum execution time: 2_835_000 picoseconds. + Weight::from_parts(2_915_000, 0) } } \ No newline at end of file diff --git a/parachain/runtime/interlay/src/weights/redeem.rs b/parachain/runtime/interlay/src/weights/redeem.rs index 208a07378d..296c5bdfa6 100644 --- a/parachain/runtime/interlay/src/weights/redeem.rs +++ b/parachain/runtime/interlay/src/weights/redeem.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for redeem //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-jrrg4`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/interlay/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -40,8 +40,6 @@ pub struct WeightInfo(PhantomData); impl redeem::WeightInfo for WeightInfo { - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:2 w:1) /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) /// Storage: Fee RedeemFee (r:1 w:0) @@ -96,11 +94,11 @@ impl redeem::WeightInfo for WeightInfo { /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(245), added: 2720, mode: MaxEncodedLen) fn request_redeem () -> Weight { // Proof Size summary in bytes: - // Measured: `2928` - // Estimated: `73398` - // Minimum execution time: 414_761_000 picoseconds. - Weight::from_parts(438_116_000, 73398) - .saturating_add(T::DbWeight::get().reads(29_u64)) + // Measured: `3155` + // Estimated: `6260` + // Minimum execution time: 310_652_000 picoseconds. + Weight::from_parts(313_168_000, 6260) + .saturating_add(T::DbWeight::get().reads(28_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } /// Storage: Tokens Accounts (r:3 w:3) @@ -129,10 +127,10 @@ impl redeem::WeightInfo for WeightInfo { /// Proof: Loans AccountDeposits (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) fn liquidation_redeem () -> Weight { // Proof Size summary in bytes: - // Measured: `1918` - // Estimated: `52855` - // Minimum execution time: 379_381_000 picoseconds. - Weight::from_parts(394_071_000, 52855) + // Measured: `2173` + // Estimated: `8760` + // Minimum execution time: 283_197_000 picoseconds. + Weight::from_parts(284_509_000, 8760) .saturating_add(T::DbWeight::get().reads(16_u64)) .saturating_add(T::DbWeight::get().writes(11_u64)) } @@ -162,23 +160,23 @@ impl redeem::WeightInfo for WeightInfo { /// The range of component `i` is `[1, 10]`. /// The range of component `o` is `[2, 3]`. /// The range of component `b` is `[541, 2048]`. - fn execute_redeem (h: u32, i: u32, _o: u32, b: u32, ) -> Weight { + fn execute_redeem (h: u32, i: u32, o: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `2122` - // Estimated: `29111` - // Minimum execution time: 242_719_000 picoseconds. - Weight::from_parts(223_820_863, 29111) - // Standard Error: 136_817 - .saturating_add(Weight::from_parts(8_379_355, 0).saturating_mul(h.into())) - // Standard Error: 123_343 - .saturating_add(Weight::from_parts(836_211, 0).saturating_mul(i.into())) - // Standard Error: 753 - .saturating_add(Weight::from_parts(4_951, 0).saturating_mul(b.into())) + // Measured: `2295 + o * (1 ±0)` + // Estimated: `3725` + // Minimum execution time: 183_618_000 picoseconds. + Weight::from_parts(155_534_743, 3725) + // Standard Error: 117_935 + .saturating_add(Weight::from_parts(3_687_939, 0).saturating_mul(h.into())) + // Standard Error: 106_320 + .saturating_add(Weight::from_parts(952_959, 0).saturating_mul(i.into())) + // Standard Error: 644_527 + .saturating_add(Weight::from_parts(862_990, 0).saturating_mul(o.into())) + // Standard Error: 649 + .saturating_add(Weight::from_parts(4_928, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(11_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: Redeem RedeemRequests (r:1 w:1) /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(245), added: 2720, mode: MaxEncodedLen) /// Storage: Redeem RedeemPeriod (r:1 w:0) @@ -250,11 +248,11 @@ impl redeem::WeightInfo for WeightInfo { /// Storage: VaultRewards TotalStake (r:1 w:1) /// Proof: VaultRewards TotalStake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) /// Storage: VaultRewards RewardCurrencies (r:1 w:0) - /// Proof: VaultRewards RewardCurrencies (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) + /// Proof: VaultRewards RewardCurrencies (max_values: None, max_size: Some(50), added: 2525, mode: MaxEncodedLen) /// Storage: VaultCapacity TotalStake (r:1 w:1) /// Proof: VaultCapacity TotalStake (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) /// Storage: VaultCapacity RewardCurrencies (r:1 w:0) - /// Proof: VaultCapacity RewardCurrencies (max_values: None, max_size: Some(127), added: 2602, mode: MaxEncodedLen) + /// Proof: VaultCapacity RewardCurrencies (max_values: None, max_size: Some(39), added: 2514, mode: MaxEncodedLen) /// Storage: Loans RewardSupplyState (r:1 w:1) /// Proof: Loans RewardSupplyState (max_values: None, max_size: Some(47), added: 2522, mode: MaxEncodedLen) /// Storage: Loans RewardSupplySpeed (r:1 w:0) @@ -269,15 +267,13 @@ impl redeem::WeightInfo for WeightInfo { /// Proof: VaultRegistry PunishmentDelay (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) fn cancel_redeem_reimburse () -> Weight { // Proof Size summary in bytes: - // Measured: `5091` - // Estimated: `179726` - // Minimum execution time: 1_189_309_000 picoseconds. - Weight::from_parts(1_214_681_000, 179726) - .saturating_add(T::DbWeight::get().reads(60_u64)) + // Measured: `5396` + // Estimated: `11350` + // Minimum execution time: 847_787_000 picoseconds. + Weight::from_parts(851_295_000, 11350) + .saturating_add(T::DbWeight::get().reads(59_u64)) .saturating_add(T::DbWeight::get().writes(29_u64)) } - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: Redeem RedeemRequests (r:1 w:1) /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(245), added: 2720, mode: MaxEncodedLen) /// Storage: Redeem RedeemPeriod (r:1 w:0) @@ -349,11 +345,11 @@ impl redeem::WeightInfo for WeightInfo { /// Storage: VaultRewards TotalStake (r:1 w:1) /// Proof: VaultRewards TotalStake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) /// Storage: VaultRewards RewardCurrencies (r:1 w:0) - /// Proof: VaultRewards RewardCurrencies (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) + /// Proof: VaultRewards RewardCurrencies (max_values: None, max_size: Some(50), added: 2525, mode: MaxEncodedLen) /// Storage: VaultCapacity TotalStake (r:1 w:1) /// Proof: VaultCapacity TotalStake (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) /// Storage: VaultCapacity RewardCurrencies (r:1 w:0) - /// Proof: VaultCapacity RewardCurrencies (max_values: None, max_size: Some(127), added: 2602, mode: MaxEncodedLen) + /// Proof: VaultCapacity RewardCurrencies (max_values: None, max_size: Some(39), added: 2514, mode: MaxEncodedLen) /// Storage: Loans RewardSupplyState (r:1 w:1) /// Proof: Loans RewardSupplyState (max_values: None, max_size: Some(47), added: 2522, mode: MaxEncodedLen) /// Storage: Loans RewardSupplySpeed (r:1 w:0) @@ -368,11 +364,11 @@ impl redeem::WeightInfo for WeightInfo { /// Proof: VaultRegistry PunishmentDelay (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) fn cancel_redeem_retry () -> Weight { // Proof Size summary in bytes: - // Measured: `5091` - // Estimated: `177216` - // Minimum execution time: 1_087_583_000 picoseconds. - Weight::from_parts(1_120_115_000, 177216) - .saturating_add(T::DbWeight::get().reads(59_u64)) + // Measured: `5396` + // Estimated: `11350` + // Minimum execution time: 775_122_000 picoseconds. + Weight::from_parts(783_890_000, 11350) + .saturating_add(T::DbWeight::get().reads(58_u64)) .saturating_add(T::DbWeight::get().writes(28_u64)) } /// Storage: Redeem RedeemPeriod (r:0 w:1) @@ -381,8 +377,8 @@ impl redeem::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 22_297_000 picoseconds. - Weight::from_parts(22_756_000, 0) + // Minimum execution time: 18_136_000 picoseconds. + Weight::from_parts(18_727_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: VaultRegistry Vaults (r:1 w:1) @@ -393,11 +389,71 @@ impl redeem::WeightInfo for WeightInfo { /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) fn self_redeem () -> Weight { // Proof Size summary in bytes: - // Measured: `1171` - // Estimated: `10805` - // Minimum execution time: 194_312_000 picoseconds. - Weight::from_parts(202_058_000, 10805) + // Measured: `1427` + // Estimated: `3725` + // Minimum execution time: 149_329_000 picoseconds. + Weight::from_parts(152_415_000, 3725) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } + + /// Storage: VaultRegistry Vaults (r:2 w:2) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) + /// Storage: BTCRelay StartBlockHeight (r:1 w:0) + /// Proof: BTCRelay StartBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: BTCRelay StableBitcoinConfirmations (r:1 w:0) + /// Proof: BTCRelay StableBitcoinConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: BTCRelay BestBlockHeight (r:1 w:0) + /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: Oracle Aggregate (r:3 w:0) + /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) + /// Storage: Fee IssueGriefingCollateral (r:1 w:0) + /// Proof: Fee IssueGriefingCollateral (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:1 w:1) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: Issue IssueBtcDustValue (r:1 w:0) + /// Proof: Issue IssueBtcDustValue (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) + /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) + /// Storage: VaultStaking Nonce (r:2 w:0) + /// Proof: VaultStaking Nonce (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) + /// Storage: VaultStaking TotalCurrentStake (r:2 w:0) + /// Proof: VaultStaking TotalCurrentStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) + /// Storage: Fee IssueFee (r:1 w:0) + /// Proof: Fee IssueFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// Storage: Security Nonce (r:1 w:1) + /// Proof: Security Nonce (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) + /// Storage: System ParentHash (r:1 w:0) + /// Proof: System ParentHash (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) + /// Storage: VaultRegistry VaultBitcoinPublicKey (r:1 w:0) + /// Proof: VaultRegistry VaultBitcoinPublicKey (max_values: None, max_size: Some(81), added: 2556, mode: MaxEncodedLen) + /// Storage: Security ActiveBlockCount (r:1 w:0) + /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: Issue IssuePeriod (r:1 w:0) + /// Proof: Issue IssuePeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: Fee RedeemFee (r:1 w:0) + /// Proof: Fee RedeemFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// Storage: Redeem RedeemTransactionSize (r:1 w:0) + /// Proof: Redeem RedeemTransactionSize (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: Redeem RedeemBtcDustValue (r:1 w:0) + /// Proof: Redeem RedeemBtcDustValue (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// Storage: VaultRegistry PremiumRedeemThreshold (r:1 w:0) + /// Proof: VaultRegistry PremiumRedeemThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) + /// Storage: Redeem RedeemPeriod (r:1 w:0) + /// Proof: Redeem RedeemPeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: Issue IssueRequests (r:0 w:1) + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) + /// Storage: Redeem RedeemRequests (r:0 w:1) + /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(278), added: 2753, mode: MaxEncodedLen) + /// Storage: Redeem Requests (r:0 w:1) + /// Proof: Redeem Requests (max_values: None, max_size: Some(80), added: 2555, mode: MaxEncodedLen) + fn request_replace() -> Weight { + // Proof Size summary in bytes: + // Measured: `3277` + // Estimated: `8547` + // Minimum execution time: 39_015_000_000 picoseconds. + Weight::from_parts(39_015_000_000, 8547) + .saturating_add(T::DbWeight::get().reads(27_u64)) + .saturating_add(T::DbWeight::get().writes(7_u64)) + } } \ No newline at end of file diff --git a/parachain/runtime/interlay/src/weights/replace.rs b/parachain/runtime/interlay/src/weights/replace.rs deleted file mode 100644 index 5c58c34c88..0000000000 --- a/parachain/runtime/interlay/src/weights/replace.rs +++ /dev/null @@ -1,321 +0,0 @@ - -//! Autogenerated weights for replace -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 - -// Executed Command: -// target/release/interbtc-parachain -// benchmark -// pallet -// --pallet -// * -// --extrinsic -// * -// --chain -// interlay-dev -// --execution=wasm -// --wasm-execution=compiled -// --steps -// 50 -// --repeat -// 10 -// --output -// ../tmp-weight/ -// --template -// .deploy/runtime-weight-template.hbs - -#![cfg_attr(rustfmt, rustfmt_skip)] -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use sp_std::marker::PhantomData; - -/// Weights for replace using the Substrate node and recommended hardware. -pub struct WeightInfo(PhantomData); - -impl replace::WeightInfo for WeightInfo { - - /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) - /// Storage: Nomination Vaults (r:1 w:0) - /// Proof: Nomination Vaults (max_values: None, max_size: Some(71), added: 2546, mode: MaxEncodedLen) - /// Storage: Replace ReplaceBtcDustValue (r:1 w:0) - /// Proof: Replace ReplaceBtcDustValue (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: Oracle Aggregate (r:1 w:0) - /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) - /// Storage: Fee ReplaceGriefingCollateral (r:1 w:0) - /// Proof: Fee ReplaceGriefingCollateral (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:1 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - fn request_replace () -> Weight { - // Proof Size summary in bytes: - // Measured: `1777` - // Estimated: `18838` - // Minimum execution time: 174_897_000 picoseconds. - Weight::from_parts(181_413_000, 18838) - .saturating_add(T::DbWeight::get().reads(7_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - } - /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) - fn withdraw_replace () -> Weight { - // Proof Size summary in bytes: - // Measured: `701` - // Estimated: `3725` - // Minimum execution time: 78_794_000 picoseconds. - Weight::from_parts(86_238_000, 3725) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: VaultRegistry Vaults (r:2 w:2) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) - /// Storage: Replace ReplaceBtcDustValue (r:1 w:0) - /// Proof: Replace ReplaceBtcDustValue (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: VaultCapacity Stake (r:1 w:1) - /// Proof: VaultCapacity Stake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultCapacity RewardPerToken (r:2 w:0) - /// Proof: VaultCapacity RewardPerToken (max_values: None, max_size: Some(59), added: 2534, mode: MaxEncodedLen) - /// Storage: VaultCapacity RewardTally (r:2 w:2) - /// Proof: VaultCapacity RewardTally (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) - /// Storage: VaultCapacity TotalRewards (r:2 w:2) - /// Proof: VaultCapacity TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultRewards Stake (r:1 w:1) - /// Proof: VaultRewards Stake (max_values: None, max_size: Some(97), added: 2572, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardPerToken (r:2 w:0) - /// Proof: VaultRewards RewardPerToken (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardTally (r:2 w:2) - /// Proof: VaultRewards RewardTally (max_values: None, max_size: Some(124), added: 2599, mode: MaxEncodedLen) - /// Storage: VaultRewards TotalRewards (r:2 w:2) - /// Proof: VaultRewards TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Fee Commission (r:1 w:0) - /// Proof: Fee Commission (max_values: None, max_size: Some(86), added: 2561, mode: MaxEncodedLen) - /// Storage: VaultStaking Nonce (r:1 w:0) - /// Proof: VaultStaking Nonce (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) - /// Storage: VaultStaking TotalCurrentStake (r:1 w:1) - /// Proof: VaultStaking TotalCurrentStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultStaking RewardPerToken (r:2 w:2) - /// Proof: VaultStaking RewardPerToken (max_values: None, max_size: Some(117), added: 2592, mode: MaxEncodedLen) - /// Storage: VaultStaking Stake (r:1 w:1) - /// Proof: VaultStaking Stake (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) - /// Storage: VaultStaking SlashPerToken (r:1 w:0) - /// Proof: VaultStaking SlashPerToken (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultStaking SlashTally (r:1 w:1) - /// Proof: VaultStaking SlashTally (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) - /// Storage: VaultStaking TotalStake (r:1 w:1) - /// Proof: VaultStaking TotalStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultStaking RewardTally (r:2 w:2) - /// Proof: VaultStaking RewardTally (max_values: None, max_size: Some(149), added: 2624, mode: MaxEncodedLen) - /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) - /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: VaultRewards TotalStake (r:1 w:1) - /// Proof: VaultRewards TotalStake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardCurrencies (r:1 w:0) - /// Proof: VaultRewards RewardCurrencies (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: Oracle Aggregate (r:1 w:0) - /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) - /// Storage: VaultCapacity TotalStake (r:1 w:1) - /// Proof: VaultCapacity TotalStake (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) - /// Storage: VaultCapacity RewardCurrencies (r:1 w:0) - /// Proof: VaultCapacity RewardCurrencies (max_values: None, max_size: Some(127), added: 2602, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:1 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: VaultRegistry TotalUserVaultCollateral (r:1 w:1) - /// Proof: VaultRegistry TotalUserVaultCollateral (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: VaultRegistry SystemCollateralCeiling (r:1 w:0) - /// Proof: VaultRegistry SystemCollateralCeiling (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: Security Nonce (r:1 w:1) - /// Proof: Security Nonce (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: System ParentHash (r:1 w:0) - /// Proof: System ParentHash (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Replace ReplacePeriod (r:1 w:0) - /// Proof: Replace ReplacePeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlockHeight (r:1 w:0) - /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Replace ReplaceRequests (r:0 w:1) - /// Proof: Replace ReplaceRequests (max_values: None, max_size: Some(250), added: 2725, mode: MaxEncodedLen) - fn accept_replace () -> Weight { - // Proof Size summary in bytes: - // Measured: `4114` - // Estimated: `129743` - // Minimum execution time: 792_846_000 picoseconds. - Weight::from_parts(804_374_000, 129743) - .saturating_add(T::DbWeight::get().reads(43_u64)) - .saturating_add(T::DbWeight::get().writes(26_u64)) - } - /// Storage: Replace ReplaceRequests (r:1 w:1) - /// Proof: Replace ReplaceRequests (max_values: None, max_size: Some(250), added: 2725, mode: MaxEncodedLen) - /// Storage: BTCRelay DisableInclusionCheck (r:1 w:0) - /// Proof: BTCRelay DisableInclusionCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlockHeight (r:1 w:0) - /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay Chains (r:1 w:0) - /// Proof: BTCRelay Chains (max_values: None, max_size: Some(24), added: 2499, mode: MaxEncodedLen) - /// Storage: BTCRelay BlockHeaders (r:1 w:0) - /// Proof: BTCRelay BlockHeaders (max_values: None, max_size: Some(200), added: 2675, mode: MaxEncodedLen) - /// Storage: BTCRelay StableBitcoinConfirmations (r:1 w:0) - /// Proof: BTCRelay StableBitcoinConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay StableParachainConfirmations (r:1 w:0) - /// Proof: BTCRelay StableParachainConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: VaultRegistry Vaults (r:2 w:2) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:1 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// The range of component `h` is `[2, 10]`. - /// The range of component `i` is `[1, 10]`. - /// The range of component `o` is `[2, 3]`. - /// The range of component `b` is `[541, 2048]`. - fn execute_pending_replace (h: u32, i: u32, o: u32, b: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `3700` - // Estimated: `28351` - // Minimum execution time: 321_693_000 picoseconds. - Weight::from_parts(299_069_738, 28351) - // Standard Error: 116_546 - .saturating_add(Weight::from_parts(2_709_504, 0).saturating_mul(h.into())) - // Standard Error: 105_067 - .saturating_add(Weight::from_parts(1_555_605, 0).saturating_mul(i.into())) - // Standard Error: 636_932 - .saturating_add(Weight::from_parts(1_431_533, 0).saturating_mul(o.into())) - // Standard Error: 641 - .saturating_add(Weight::from_parts(8_464, 0).saturating_mul(b.into())) - .saturating_add(T::DbWeight::get().reads(11_u64)) - .saturating_add(T::DbWeight::get().writes(4_u64)) - } - /// Storage: Replace ReplaceRequests (r:1 w:1) - /// Proof: Replace ReplaceRequests (max_values: None, max_size: Some(250), added: 2725, mode: MaxEncodedLen) - /// Storage: BTCRelay DisableInclusionCheck (r:1 w:0) - /// Proof: BTCRelay DisableInclusionCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlockHeight (r:1 w:0) - /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay Chains (r:1 w:0) - /// Proof: BTCRelay Chains (max_values: None, max_size: Some(24), added: 2499, mode: MaxEncodedLen) - /// Storage: BTCRelay BlockHeaders (r:1 w:0) - /// Proof: BTCRelay BlockHeaders (max_values: None, max_size: Some(200), added: 2675, mode: MaxEncodedLen) - /// Storage: BTCRelay StableBitcoinConfirmations (r:1 w:0) - /// Proof: BTCRelay StableBitcoinConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay StableParachainConfirmations (r:1 w:0) - /// Proof: BTCRelay StableParachainConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: VaultRegistry Vaults (r:2 w:2) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) - /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) - /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: Oracle Aggregate (r:1 w:0) - /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) - /// Storage: VaultStaking Nonce (r:1 w:0) - /// Proof: VaultStaking Nonce (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) - /// Storage: VaultStaking TotalCurrentStake (r:1 w:0) - /// Proof: VaultStaking TotalCurrentStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// The range of component `h` is `[2, 10]`. - /// The range of component `i` is `[1, 10]`. - /// The range of component `o` is `[2, 3]`. - /// The range of component `b` is `[541, 2048]`. - fn execute_cancelled_replace (h: u32, i: u32, _o: u32, b: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `4006` - // Estimated: `40395` - // Minimum execution time: 387_665_000 picoseconds. - Weight::from_parts(383_077_649, 40395) - // Standard Error: 175_118 - .saturating_add(Weight::from_parts(2_479_693, 0).saturating_mul(h.into())) - // Standard Error: 157_871 - .saturating_add(Weight::from_parts(1_580_414, 0).saturating_mul(i.into())) - // Standard Error: 964 - .saturating_add(Weight::from_parts(4_640, 0).saturating_mul(b.into())) - .saturating_add(T::DbWeight::get().reads(15_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) - } - /// Storage: Replace ReplaceRequests (r:1 w:1) - /// Proof: Replace ReplaceRequests (max_values: None, max_size: Some(250), added: 2725, mode: MaxEncodedLen) - /// Storage: Replace ReplacePeriod (r:1 w:0) - /// Proof: Replace ReplacePeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlockHeight (r:1 w:0) - /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: VaultRegistry Vaults (r:2 w:2) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:2 w:2) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: VaultStaking Nonce (r:1 w:0) - /// Proof: VaultStaking Nonce (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) - /// Storage: VaultStaking TotalCurrentStake (r:1 w:0) - /// Proof: VaultStaking TotalCurrentStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultRegistry MinimumCollateralVault (r:1 w:0) - /// Proof: VaultRegistry MinimumCollateralVault (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) - /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: Oracle Aggregate (r:1 w:0) - /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) - /// Storage: VaultRegistry TotalUserVaultCollateral (r:1 w:1) - /// Proof: VaultRegistry TotalUserVaultCollateral (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: VaultCapacity Stake (r:1 w:0) - /// Proof: VaultCapacity Stake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultCapacity RewardPerToken (r:2 w:0) - /// Proof: VaultCapacity RewardPerToken (max_values: None, max_size: Some(59), added: 2534, mode: MaxEncodedLen) - /// Storage: VaultCapacity RewardTally (r:2 w:2) - /// Proof: VaultCapacity RewardTally (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) - /// Storage: VaultCapacity TotalRewards (r:2 w:2) - /// Proof: VaultCapacity TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultRewards Stake (r:1 w:0) - /// Proof: VaultRewards Stake (max_values: None, max_size: Some(97), added: 2572, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardPerToken (r:2 w:0) - /// Proof: VaultRewards RewardPerToken (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardTally (r:2 w:2) - /// Proof: VaultRewards RewardTally (max_values: None, max_size: Some(124), added: 2599, mode: MaxEncodedLen) - /// Storage: VaultRewards TotalRewards (r:2 w:2) - /// Proof: VaultRewards TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Fee Commission (r:1 w:0) - /// Proof: Fee Commission (max_values: None, max_size: Some(86), added: 2561, mode: MaxEncodedLen) - /// Storage: VaultStaking RewardPerToken (r:2 w:2) - /// Proof: VaultStaking RewardPerToken (max_values: None, max_size: Some(117), added: 2592, mode: MaxEncodedLen) - /// Storage: VaultStaking Stake (r:1 w:1) - /// Proof: VaultStaking Stake (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) - /// Storage: VaultStaking SlashPerToken (r:1 w:0) - /// Proof: VaultStaking SlashPerToken (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultStaking SlashTally (r:1 w:1) - /// Proof: VaultStaking SlashTally (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) - /// Storage: VaultStaking TotalStake (r:1 w:1) - /// Proof: VaultStaking TotalStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultRewards TotalStake (r:1 w:0) - /// Proof: VaultRewards TotalStake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - fn cancel_replace () -> Weight { - // Proof Size summary in bytes: - // Measured: `4406` - // Estimated: `118165` - // Minimum execution time: 723_347_000 picoseconds. - Weight::from_parts(746_025_000, 118165) - .saturating_add(T::DbWeight::get().reads(38_u64)) - .saturating_add(T::DbWeight::get().writes(19_u64)) - } - /// Storage: Replace ReplacePeriod (r:0 w:1) - /// Proof: Replace ReplacePeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - fn set_replace_period () -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 22_574_000 picoseconds. - Weight::from_parts(23_334_000, 0) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } -} \ No newline at end of file diff --git a/parachain/runtime/interlay/src/weights/security.rs b/parachain/runtime/interlay/src/weights/security.rs index dab8110d45..a34d043d73 100644 --- a/parachain/runtime/interlay/src/weights/security.rs +++ b/parachain/runtime/interlay/src/weights/security.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for security //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-jrrg4`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/interlay/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -34,34 +34,33 @@ use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; use sp_std::marker::PhantomData; -use frame_system::RawOrigin; /// Weights for security using the Substrate node and recommended hardware. pub struct WeightInfo(PhantomData); impl security::WeightInfo for WeightInfo { - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) + /// Storage: Security IsDeactivated (r:1 w:0) + /// Proof: Security IsDeactivated (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: Security ActiveBlockCount (r:1 w:1) /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) fn on_initialize () -> Weight { // Proof Size summary in bytes: - // Measured: `126` - // Estimated: `2975` - // Minimum execution time: 22_966_000 picoseconds. - Weight::from_parts(23_794_000, 2975) + // Measured: `99` + // Estimated: `1489` + // Minimum execution time: 17_345_000 picoseconds. + Weight::from_parts(18_226_000, 1489) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } - /// Storage: Security ParachainStatus (r:0 w:1) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) + /// Storage: Security IsDeactivated (r:0 w:1) + /// Proof: Security IsDeactivated (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) fn activate_counter () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 10_665_000 picoseconds. - Weight::from_parts(10_979_000, 0) + // Minimum execution time: 14_158_000 picoseconds. + Weight::from_parts(15_060_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } } \ No newline at end of file diff --git a/parachain/runtime/interlay/src/weights/supply.rs b/parachain/runtime/interlay/src/weights/supply.rs index 346d903e3f..6e3f345469 100644 --- a/parachain/runtime/interlay/src/weights/supply.rs +++ b/parachain/runtime/interlay/src/weights/supply.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for supply //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-jrrg4`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/interlay/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -52,10 +52,10 @@ impl supply::WeightInfo for WeightInfo { /// Proof: Supply LastEmission (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) fn on_initialize () -> Weight { // Proof Size summary in bytes: - // Measured: `299` - // Estimated: `22547` - // Minimum execution time: 231_169_000 picoseconds. - Weight::from_parts(235_848_000, 22547) + // Measured: `606` + // Estimated: `11350` + // Minimum execution time: 197_536_000 picoseconds. + Weight::from_parts(199_199_000, 11350) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(8_u64)) } @@ -65,8 +65,8 @@ impl supply::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 11_652_000 picoseconds. - Weight::from_parts(12_229_000, 0) + // Minimum execution time: 9_499_000 picoseconds. + Weight::from_parts(9_769_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } } \ No newline at end of file diff --git a/parachain/runtime/interlay/src/weights/tx_pause.rs b/parachain/runtime/interlay/src/weights/tx_pause.rs index 89ec621090..d22e2ed604 100644 --- a/parachain/runtime/interlay/src/weights/tx_pause.rs +++ b/parachain/runtime/interlay/src/weights/tx_pause.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for tx_pause //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-jrrg4`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/interlay/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -46,8 +46,8 @@ impl tx_pause::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `6494` - // Minimum execution time: 39_692_000 picoseconds. - Weight::from_parts(41_248_000, 6494) + // Minimum execution time: 32_074_000 picoseconds. + Weight::from_parts(32_575_000, 6494) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -57,8 +57,8 @@ impl tx_pause::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `308` // Estimated: `6494` - // Minimum execution time: 45_488_000 picoseconds. - Weight::from_parts(46_533_000, 6494) + // Minimum execution time: 36_412_000 picoseconds. + Weight::from_parts(37_174_000, 6494) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } diff --git a/parachain/runtime/interlay/src/weights/vault_registry.rs b/parachain/runtime/interlay/src/weights/vault_registry.rs index d210cd78e3..5cb215bb7e 100644 --- a/parachain/runtime/interlay/src/weights/vault_registry.rs +++ b/parachain/runtime/interlay/src/weights/vault_registry.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for vault_registry //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-jrrg4`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/interlay/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -112,19 +112,17 @@ impl vault_registry::WeightInfo for WeightInfo { /// Proof: Loans MinExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: Loans MaxExchangeRate (r:1 w:0) /// Proof: Loans MaxExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: Oracle Aggregate (r:1 w:0) /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) /// Storage: VaultRegistry TotalUserVaultCollateral (r:1 w:1) /// Proof: VaultRegistry TotalUserVaultCollateral (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) fn register_vault () -> Weight { // Proof Size summary in bytes: - // Measured: `2500` - // Estimated: `153273` - // Minimum execution time: 599_603_000 picoseconds. - Weight::from_parts(620_154_000, 153273) - .saturating_add(T::DbWeight::get().reads(48_u64)) + // Measured: `2723` + // Estimated: `6260` + // Minimum execution time: 470_102_000 picoseconds. + Weight::from_parts(474_480_000, 6260) + .saturating_add(T::DbWeight::get().reads(47_u64)) .saturating_add(T::DbWeight::get().writes(17_u64)) } /// Storage: VaultRegistry VaultBitcoinPublicKey (r:1 w:1) @@ -133,8 +131,8 @@ impl vault_registry::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `365` // Estimated: `3546` - // Minimum execution time: 41_173_000 picoseconds. - Weight::from_parts(41_816_000, 3546) + // Minimum execution time: 30_792_000 picoseconds. + Weight::from_parts(31_042_000, 3546) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -190,17 +188,15 @@ impl vault_registry::WeightInfo for WeightInfo { /// Proof: Loans MinExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: Loans MaxExchangeRate (r:1 w:0) /// Proof: Loans MaxExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: Oracle Aggregate (r:1 w:0) /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) fn accept_new_issues () -> Weight { // Proof Size summary in bytes: - // Measured: `3442` - // Estimated: `111557` - // Minimum execution time: 484_070_000 picoseconds. - Weight::from_parts(505_433_000, 111557) - .saturating_add(T::DbWeight::get().reads(36_u64)) + // Measured: `3665` + // Estimated: `6260` + // Minimum execution time: 372_286_000 picoseconds. + Weight::from_parts(375_271_000, 6260) + .saturating_add(T::DbWeight::get().reads(35_u64)) .saturating_add(T::DbWeight::get().writes(12_u64)) } /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) @@ -255,17 +251,15 @@ impl vault_registry::WeightInfo for WeightInfo { /// Proof: Loans MinExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: Loans MaxExchangeRate (r:1 w:0) /// Proof: Loans MaxExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: Oracle Aggregate (r:1 w:0) /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) fn set_custom_secure_threshold () -> Weight { // Proof Size summary in bytes: - // Measured: `3442` - // Estimated: `111557` - // Minimum execution time: 491_781_000 picoseconds. - Weight::from_parts(504_920_000, 111557) - .saturating_add(T::DbWeight::get().reads(36_u64)) + // Measured: `3665` + // Estimated: `6260` + // Minimum execution time: 370_863_000 picoseconds. + Weight::from_parts(377_126_000, 6260) + .saturating_add(T::DbWeight::get().reads(35_u64)) .saturating_add(T::DbWeight::get().writes(12_u64)) } /// Storage: VaultRegistry MinimumCollateralVault (r:0 w:1) @@ -274,8 +268,8 @@ impl vault_registry::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 12_864_000 picoseconds. - Weight::from_parts(13_979_000, 0) + // Minimum execution time: 10_281_000 picoseconds. + Weight::from_parts(10_431_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: VaultRegistry SystemCollateralCeiling (r:0 w:1) @@ -284,8 +278,8 @@ impl vault_registry::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 13_539_000 picoseconds. - Weight::from_parts(14_105_000, 0) + // Minimum execution time: 10_441_000 picoseconds. + Weight::from_parts(10_581_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: VaultRegistry SecureCollateralThreshold (r:0 w:1) @@ -294,8 +288,8 @@ impl vault_registry::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 25_949_000 picoseconds. - Weight::from_parts(26_888_000, 0) + // Minimum execution time: 20_171_000 picoseconds. + Weight::from_parts(20_662_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: VaultRegistry PremiumRedeemThreshold (r:0 w:1) @@ -304,8 +298,8 @@ impl vault_registry::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 26_027_000 picoseconds. - Weight::from_parts(27_337_000, 0) + // Minimum execution time: 20_311_000 picoseconds. + Weight::from_parts(20_812_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: VaultRegistry LiquidationCollateralThreshold (r:0 w:1) @@ -314,8 +308,8 @@ impl vault_registry::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 42_707_000 picoseconds. - Weight::from_parts(50_021_000, 0) + // Minimum execution time: 20_170_000 picoseconds. + Weight::from_parts(20_982_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: VaultRegistry Vaults (r:1 w:1) @@ -348,8 +342,6 @@ impl vault_registry::WeightInfo for WeightInfo { /// Proof: Loans MinExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: Loans MaxExchangeRate (r:1 w:0) /// Proof: Loans MaxExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: Oracle Aggregate (r:1 w:0) /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) /// Storage: VaultStaking Stake (r:1 w:1) @@ -358,7 +350,7 @@ impl vault_registry::WeightInfo for WeightInfo { /// Proof: VaultStaking SlashPerToken (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) /// Storage: VaultStaking SlashTally (r:1 w:1) /// Proof: VaultStaking SlashTally (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) - /// Storage: VaultCapacity Stake (r:1 w:1) + /// Storage: VaultCapacity Stake (r:1 w:0) /// Proof: VaultCapacity Stake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) /// Storage: VaultCapacity RewardPerToken (r:2 w:0) /// Proof: VaultCapacity RewardPerToken (max_values: None, max_size: Some(59), added: 2534, mode: MaxEncodedLen) @@ -384,14 +376,10 @@ impl vault_registry::WeightInfo for WeightInfo { /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) /// Storage: VaultRewards TotalStake (r:1 w:1) /// Proof: VaultRewards TotalStake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultCapacity TotalStake (r:1 w:1) - /// Proof: VaultCapacity TotalStake (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) - /// Storage: VaultCapacity RewardCurrencies (r:1 w:0) - /// Proof: VaultCapacity RewardCurrencies (max_values: None, max_size: Some(127), added: 2602, mode: MaxEncodedLen) /// Storage: VaultStaking RewardTally (r:2 w:2) /// Proof: VaultStaking RewardTally (max_values: None, max_size: Some(149), added: 2624, mode: MaxEncodedLen) /// Storage: VaultRewards RewardCurrencies (r:1 w:0) - /// Proof: VaultRewards RewardCurrencies (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) + /// Proof: VaultRewards RewardCurrencies (max_values: None, max_size: Some(50), added: 2525, mode: MaxEncodedLen) /// Storage: VaultRegistry TotalUserVaultCollateral (r:1 w:1) /// Proof: VaultRegistry TotalUserVaultCollateral (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) /// Storage: Loans RewardSupplyState (r:1 w:1) @@ -410,12 +398,12 @@ impl vault_registry::WeightInfo for WeightInfo { /// Proof: VaultRegistry LiquidationVault (max_values: None, max_size: Some(124), added: 2599, mode: MaxEncodedLen) fn report_undercollateralized_vault () -> Weight { // Proof Size summary in bytes: - // Measured: `4670` - // Estimated: `190133` - // Minimum execution time: 1_770_343_000 picoseconds. - Weight::from_parts(1_812_136_000, 190133) - .saturating_add(T::DbWeight::get().reads(60_u64)) - .saturating_add(T::DbWeight::get().writes(32_u64)) + // Measured: `4926` + // Estimated: `8799` + // Minimum execution time: 1_391_186_000 picoseconds. + Weight::from_parts(1_425_946_000, 8799) + .saturating_add(T::DbWeight::get().reads(57_u64)) + .saturating_add(T::DbWeight::get().writes(30_u64)) } /// Storage: VaultRegistry Vaults (r:1 w:1) /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) @@ -423,8 +411,8 @@ impl vault_registry::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `669` // Estimated: `3725` - // Minimum execution time: 43_053_000 picoseconds. - Weight::from_parts(46_600_000, 3725) + // Minimum execution time: 30_451_000 picoseconds. + Weight::from_parts(31_273_000, 3725) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } diff --git a/parachain/runtime/interlay/src/xcm_config.rs b/parachain/runtime/interlay/src/xcm_config.rs index 1cb0f0e598..26bda8bc07 100644 --- a/parachain/runtime/interlay/src/xcm_config.rs +++ b/parachain/runtime/interlay/src/xcm_config.rs @@ -180,7 +180,7 @@ impl Contains for SafeCallFilter { // these calls can recurse - disallow false } - RuntimeCall::Issue(..) | RuntimeCall::Replace(..) | RuntimeCall::Redeem(..) | RuntimeCall::BTCRelay(..) => { + RuntimeCall::Issue(..) | RuntimeCall::Redeem(..) | RuntimeCall::BTCRelay(..) => { // disallow anything to do with btc transactions since btc tx may be unbounded false } diff --git a/parachain/runtime/kintsugi/Cargo.toml b/parachain/runtime/kintsugi/Cargo.toml index 2ef39bee03..3a23543600 100644 --- a/parachain/runtime/kintsugi/Cargo.toml +++ b/parachain/runtime/kintsugi/Cargo.toml @@ -101,7 +101,6 @@ multi-transaction-payment = { path = "../../../crates/multi-transaction-payment" nomination = { path = "../../../crates/nomination", default-features = false } oracle = { path = "../../../crates/oracle", default-features = false } redeem = { path = "../../../crates/redeem", default-features = false } -replace = { path = "../../../crates/replace", default-features = false } reward = { path = "../../../crates/reward", default-features = false } security = { path = "../../../crates/security", default-features = false } staking = { path = "../../../crates/staking", default-features = false } @@ -121,7 +120,6 @@ issue-rpc-runtime-api = { path = "../../../crates/issue/rpc/runtime-api", defaul loans-rpc-runtime-api = { path = "../../../crates/loans/rpc/runtime-api", default-features = false } oracle-rpc-runtime-api = { path = "../../../crates/oracle/rpc/runtime-api", default-features = false } redeem-rpc-runtime-api = { path = "../../../crates/redeem/rpc/runtime-api", default-features = false } -replace-rpc-runtime-api = { path = "../../../crates/replace/rpc/runtime-api", default-features = false } reward-rpc-runtime-api = { path = "../../../crates/reward/rpc/runtime-api", default-features = false } vault-registry-rpc-runtime-api = { path = "../../../crates/vault-registry/rpc/runtime-api", default-features = false } @@ -245,7 +243,6 @@ std = [ "nomination/std", "oracle/std", "redeem/std", - "replace/std", "reward/std", "security/std", "staking/std", @@ -265,7 +262,6 @@ std = [ "loans-rpc-runtime-api/std", "oracle-rpc-runtime-api/std", "redeem-rpc-runtime-api/std", - "replace-rpc-runtime-api/std", "reward-rpc-runtime-api/std", "vault-registry-rpc-runtime-api/std", @@ -325,7 +321,6 @@ runtime-benchmarks = [ "nomination/runtime-benchmarks", "oracle/runtime-benchmarks", "redeem/runtime-benchmarks", - "replace/runtime-benchmarks", "security/runtime-benchmarks", "supply/runtime-benchmarks", "traits/runtime-benchmarks", @@ -387,7 +382,6 @@ try-runtime = [ "nomination/try-runtime", "oracle/try-runtime", "redeem/try-runtime", - "replace/try-runtime", "reward/try-runtime", "security/try-runtime", "staking/try-runtime", diff --git a/parachain/runtime/kintsugi/src/contracts.rs b/parachain/runtime/kintsugi/src/contracts.rs index 9347f866aa..182e941ea9 100644 --- a/parachain/runtime/kintsugi/src/contracts.rs +++ b/parachain/runtime/kintsugi/src/contracts.rs @@ -1,5 +1,4 @@ -use crate::{BaseCallFilter, NativeCurrency, Runtime, RuntimeCall, RuntimeEvent, Timestamp, Weight}; -use bitcoin::types::{MerkleProof, Transaction}; +use crate::{NativeCurrency, Runtime, RuntimeCall, RuntimeEvent, Timestamp, Weight}; use btc_relay::FullTransactionProof; use codec::{Decode, Encode}; use frame_support::{ @@ -36,14 +35,17 @@ impl Convert for DummyWeightPrice { // contracts parameter_types! { pub const DeletionQueueDepth: u32 = 10; - pub const DeletionWeightLimit: Weight = Weight::from_ref_time(100000000 as u64); + pub const DeletionWeightLimit: Weight = Weight::from_parts(100000000, 0); pub const DepositPerByte: Balance = 1; pub const DepositPerItem: Balance = 1; - pub const MaxCodeLen: u32 = 123 * 1024; + // can't increase much beyond 400k unless we decrease max call stack height + pub const MaxCodeLen: u32 = 400_000; pub const MaxStorageKeyLen: u32 = 128; pub const UnsafeUnstableInterface: bool = false; pub const MaxDebugBufferLen: u32 = 2 * 1024 * 1024; pub const DefaultDepositLimit: Balance = 1_000_000_000_000; + // address 943dd009e661df00c8a21661ce6b89d4 + pub storage EnableContracts: bool = false; } pub struct NativeCurrencyWithEd; @@ -266,7 +268,7 @@ impl pallet_contracts::Config for Runtime { type WeightInfo = (); type ChainExtension = BtcRelayExtension; type Schedule = DefaultSchedule; - type CallStack = [pallet_contracts::Frame; 5]; + type CallStack = [pallet_contracts::Frame; 1]; type DepositPerByte = DepositPerByte; type DepositPerItem = DepositPerItem; type DefaultDepositLimit = DefaultDepositLimit; diff --git a/parachain/runtime/kintsugi/src/lib.rs b/parachain/runtime/kintsugi/src/lib.rs index c38af2bb91..2f835f2dee 100644 --- a/parachain/runtime/kintsugi/src/lib.rs +++ b/parachain/runtime/kintsugi/src/lib.rs @@ -28,6 +28,7 @@ use frame_system::{ use loans::{OnSlashHook, PostDeposit, PostTransfer, PreDeposit, PreTransfer}; use orml_asset_registry::SequentialId; use orml_traits::{currency::MutationHooks, parameter_type_with_key}; +use pallet_contracts_primitives::ContractResult; use pallet_transaction_payment::{Multiplier, TargetedFeeAdjustment}; use sp_api::impl_runtime_apis; use sp_core::{OpaqueMetadata, H256}; @@ -112,7 +113,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("kintsugi-parachain"), impl_name: create_runtime_str!("kintsugi-parachain"), authoring_version: 1, - spec_version: 1025000, + spec_version: 1025001, impl_version: 1, transaction_version: 4, apis: RUNTIME_API_VERSIONS, @@ -1155,13 +1156,6 @@ impl redeem::Config for Runtime { type WeightInfo = weights::redeem::WeightInfo; } -pub use replace::ReplaceRequest; - -impl replace::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type WeightInfo = weights::replace::WeightInfo; -} - pub use nomination::Event as NominationEvent; impl nomination::Config for Runtime { @@ -1253,8 +1247,7 @@ construct_runtime! { Oracle: oracle::{Pallet, Call, Config, Storage, Event} = 62, Issue: issue::{Pallet, Call, Config, Storage, Event} = 63, Redeem: redeem::{Pallet, Call, Config, Storage, Event} = 64, - Replace: replace::{Pallet, Call, Config, Storage, Event} = 65, - Fee: fee::{Pallet, Call, Config, Storage} = 66, + Fee: fee::{Pallet, Call, Config, Storage} = 65, // Refund: 67 Nomination: nomination::{Pallet, Call, Config, Storage, Event} = 68, ClientsInfo: clients_info::{Pallet, Call, Storage, Event} = 69, @@ -1326,12 +1319,7 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, - ( - orml_asset_registry::Migration, - orml_unknown_tokens::Migration, - issue::migration::v1::Migration, - evm::SetEvmChainId, - ), + (evm::SetEvmChainId,), >; impl fp_self_contained::SelfContainedCall for RuntimeCall { @@ -1439,7 +1427,6 @@ mod benches { [nomination, Nomination] [oracle, Oracle] [redeem, Redeem] - [replace, Replace] [security, Security] [supply, Supply] [tx_pause, TxPause] @@ -1824,21 +1811,6 @@ impl_runtime_apis! { } } - impl replace_rpc_runtime_api::ReplaceApi< - Block, - AccountId, - H256, - ReplaceRequest - > for Runtime { - fn get_old_vault_replace_requests(vault_id: AccountId) -> Vec { - Replace::get_replace_requests_for_old_vault(vault_id) - } - - fn get_new_vault_replace_requests(vault_id: AccountId) -> Vec { - Replace::get_replace_requests_for_new_vault(vault_id) - } - } - impl loans_rpc_runtime_api::LoansApi< Block, AccountId, @@ -2161,6 +2133,133 @@ impl_runtime_apis! { ) } } + + impl pallet_contracts::ContractsApi for Runtime { + fn call( + origin: AccountId, + dest: AccountId, + value: Balance, + gas_limit: Option, + storage_deposit_limit: Option, + input_data: Vec, + ) -> pallet_contracts_primitives::ContractExecResult { + if !contracts::EnableContracts::get() { + return ContractResult { + gas_consumed: Default::default(), + gas_required: Default::default(), + storage_deposit: Default::default(), + debug_message: Default::default(), + result: Err(sp_runtime::DispatchError::Other("pallet_contracts is disabled")), + }; + } + + let gas_limit = gas_limit.unwrap_or(RuntimeBlockWeights::get().max_block); + Contracts::bare_call( + origin, + dest, + value, + gas_limit, + storage_deposit_limit, + input_data, + true, + pallet_contracts::Determinism::Enforced, + ) + } + + fn instantiate( + origin: AccountId, + value: Balance, + gas_limit: Option, + storage_deposit_limit: Option, + code: pallet_contracts_primitives::Code, + data: Vec, + salt: Vec, + ) -> pallet_contracts_primitives::ContractInstantiateResult { + if !contracts::EnableContracts::get() { + return ContractResult { + gas_consumed: Default::default(), + gas_required: Default::default(), + storage_deposit: Default::default(), + debug_message: Default::default(), + result: Err(sp_runtime::DispatchError::Other("pallet_contracts is disabled")), + }; + } + + let gas_limit = gas_limit.unwrap_or(RuntimeBlockWeights::get().max_block); + Contracts::bare_instantiate( + origin, + value, + gas_limit, + storage_deposit_limit, + code, + data, + salt, + true, + ) + } + + fn upload_code( + origin: AccountId, + code: Vec, + storage_deposit_limit: Option, + determinism: pallet_contracts::Determinism, + ) -> pallet_contracts_primitives::CodeUploadResult + { + if !contracts::EnableContracts::get() { + return Err(sp_runtime::DispatchError::Other("pallet_contracts is disabled")); + } + Contracts::bare_upload_code(origin, code, storage_deposit_limit, determinism) + } + + fn get_storage( + address: AccountId, + key: Vec, + ) -> pallet_contracts_primitives::GetStorageResult { + Contracts::get_storage(address, key) + } + } + + // todo: enable this once we add contracts benchmarking +// #[cfg(feature = "runtime-benchmarks")] +// impl frame_benchmarking::Benchmark for Runtime { +// fn benchmark_metadata(extra: bool) -> ( +// Vec, +// Vec, +// ) { +// use frame_benchmarking::{baseline, Benchmarking, BenchmarkList}; +// use frame_support::traits::StorageInfoTrait; +// use frame_system_benchmarking::Pallet as SystemBench; +// use baseline::Pallet as BaselineBench; +// +// let mut list = Vec::::new(); +// list_benchmarks!(list, extra); +// +// let storage_info = AllPalletsWithSystem::storage_info(); +// +// (list, storage_info) +// } +// +// fn dispatch_benchmark( +// config: frame_benchmarking::BenchmarkConfig +// ) -> Result, sp_runtime::RuntimeString> { +// use frame_benchmarking::{baseline, Benchmarking, BenchmarkBatch, TrackedStorageKey}; +// use frame_system_benchmarking::Pallet as SystemBench; +// use baseline::Pallet as BaselineBench; +// +// impl frame_system_benchmarking::Config for Runtime {} +// impl baseline::Config for Runtime {} +// +// use frame_support::traits::WhitelistedStorageKeys; +// let whitelist: Vec = AllPalletsWithSystem::whitelisted_storage_keys(); +// +// let mut batches = Vec::::new(); +// let params = (&config, &whitelist); +// add_benchmarks!(params, batches); +// +// if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) } +// Ok(batches) +// } +// } } struct CheckInherents; diff --git a/parachain/runtime/kintsugi/src/weights/annuity_escrow_annuity.rs b/parachain/runtime/kintsugi/src/weights/annuity_escrow_annuity.rs index 66ab9ad633..e2eff42995 100644 --- a/parachain/runtime/kintsugi/src/weights/annuity_escrow_annuity.rs +++ b/parachain/runtime/kintsugi/src/weights/annuity_escrow_annuity.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for annuity //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-kcxvd`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/kintsugi/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -44,8 +44,8 @@ impl annuity::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 17_085_000 picoseconds. - Weight::from_parts(18_252_000, 0) + // Minimum execution time: 13_728_000 picoseconds. + Weight::from_parts(14_158_000, 0) } /// Storage: EscrowRewards Stake (r:1 w:0) /// Proof: EscrowRewards Stake (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) @@ -61,10 +61,10 @@ impl annuity::WeightInfo for WeightInfo { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn withdraw_rewards () -> Weight { // Proof Size summary in bytes: - // Measured: `747` - // Estimated: `23880` - // Minimum execution time: 153_976_000 picoseconds. - Weight::from_parts(164_810_000, 23880) + // Measured: `1014` + // Estimated: `6170` + // Minimum execution time: 121_143_000 picoseconds. + Weight::from_parts(123_798_000, 6170) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -72,17 +72,17 @@ impl annuity::WeightInfo for WeightInfo { /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) fn update_rewards () -> Weight { // Proof Size summary in bytes: - // Measured: `319` + // Measured: `536` // Estimated: `3580` - // Minimum execution time: 27_481_000 picoseconds. - Weight::from_parts(29_748_000, 3580) + // Minimum execution time: 22_445_000 picoseconds. + Weight::from_parts(23_297_000, 3580) .saturating_add(T::DbWeight::get().reads(1_u64)) } fn set_reward_per_wrapped () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 10_313_000 picoseconds. - Weight::from_parts(10_906_000, 0) + // Minimum execution time: 8_597_000 picoseconds. + Weight::from_parts(9_098_000, 0) } } \ No newline at end of file diff --git a/parachain/runtime/kintsugi/src/weights/annuity_vault_annuity.rs b/parachain/runtime/kintsugi/src/weights/annuity_vault_annuity.rs index 6d3689fa5e..5b5d2c3996 100644 --- a/parachain/runtime/kintsugi/src/weights/annuity_vault_annuity.rs +++ b/parachain/runtime/kintsugi/src/weights/annuity_vault_annuity.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for annuity //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-kcxvd`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/kintsugi/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -44,8 +44,8 @@ impl annuity::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 17_766_000 picoseconds. - Weight::from_parts(19_482_000, 0) + // Minimum execution time: 14_188_000 picoseconds. + Weight::from_parts(14_780_000, 0) } fn withdraw_rewards () -> Weight { // Proof Size summary in bytes: @@ -58,17 +58,17 @@ impl annuity::WeightInfo for WeightInfo { /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) fn update_rewards () -> Weight { // Proof Size summary in bytes: - // Measured: `319` + // Measured: `536` // Estimated: `3580` - // Minimum execution time: 27_247_000 picoseconds. - Weight::from_parts(28_914_000, 3580) + // Minimum execution time: 22_295_000 picoseconds. + Weight::from_parts(23_336_000, 3580) .saturating_add(T::DbWeight::get().reads(1_u64)) } fn set_reward_per_wrapped () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 10_352_000 picoseconds. - Weight::from_parts(11_276_000, 0) + // Minimum execution time: 8_397_000 picoseconds. + Weight::from_parts(8_838_000, 0) } } \ No newline at end of file diff --git a/parachain/runtime/kintsugi/src/weights/btc_relay.rs b/parachain/runtime/kintsugi/src/weights/btc_relay.rs index 6b304bca0f..4a89ccbe56 100644 --- a/parachain/runtime/kintsugi/src/weights/btc_relay.rs +++ b/parachain/runtime/kintsugi/src/weights/btc_relay.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for btc_relay //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-kcxvd`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/kintsugi/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -62,10 +62,10 @@ impl btc_relay::WeightInfo for WeightInfo { /// Proof: BTCRelay BlockHeaders (max_values: None, max_size: Some(200), added: 2675, mode: MaxEncodedLen) fn initialize () -> Weight { // Proof Size summary in bytes: - // Measured: `430` - // Estimated: `9470` - // Minimum execution time: 88_622_000 picoseconds. - Weight::from_parts(92_834_000, 9470) + // Measured: `403` + // Estimated: `3489` + // Minimum execution time: 66_834_000 picoseconds. + Weight::from_parts(67_535_000, 3489) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(8_u64)) } @@ -87,10 +87,10 @@ impl btc_relay::WeightInfo for WeightInfo { /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) fn store_block_header () -> Weight { // Proof Size summary in bytes: - // Measured: `901` - // Estimated: `17838` - // Minimum execution time: 107_478_000 picoseconds. - Weight::from_parts(124_199_000, 17838) + // Measured: `874` + // Estimated: `6340` + // Minimum execution time: 82_235_000 picoseconds. + Weight::from_parts(83_036_000, 6340) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -113,16 +113,16 @@ impl btc_relay::WeightInfo for WeightInfo { /// The range of component `f` is `[1, 6]`. fn store_block_header_new_fork_sorted (f: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `841 + f * (92 ±0)` - // Estimated: `16800 + f * (5006 ±0)` - // Minimum execution time: 127_171_000 picoseconds. - Weight::from_parts(119_162_694, 16800) - // Standard Error: 289_559 - .saturating_add(Weight::from_parts(15_384_438, 0).saturating_mul(f.into())) + // Measured: `806 + f * (101 ±0)` + // Estimated: `6340 + f * (2507 ±0)` + // Minimum execution time: 93_938_000 picoseconds. + Weight::from_parts(85_636_123, 6340) + // Standard Error: 86_395 + .saturating_add(Weight::from_parts(10_763_758, 0).saturating_mul(f.into())) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(f.into()))) .saturating_add(T::DbWeight::get().writes(5_u64)) - .saturating_add(Weight::from_parts(0, 5006).saturating_mul(f.into())) + .saturating_add(Weight::from_parts(0, 2507).saturating_mul(f.into())) } /// Storage: BTCRelay ChainCounter (r:1 w:1) /// Proof: BTCRelay ChainCounter (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -143,17 +143,17 @@ impl btc_relay::WeightInfo for WeightInfo { /// The range of component `f` is `[1, 6]`. fn store_block_header_new_fork_unsorted (f: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `920 + f * (98 ±0)` - // Estimated: `19871 + f * (2975 ±0)` - // Minimum execution time: 129_690_000 picoseconds. - Weight::from_parts(125_641_286, 19871) - // Standard Error: 277_759 - .saturating_add(Weight::from_parts(17_567_366, 0).saturating_mul(f.into())) + // Measured: `842 + f * (99 ±0)` + // Estimated: `6340 + f * (2499 ±31)` + // Minimum execution time: 95_491_000 picoseconds. + Weight::from_parts(87_545_230, 6340) + // Standard Error: 88_777 + .saturating_add(Weight::from_parts(13_033_203, 0).saturating_mul(f.into())) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(f.into()))) .saturating_add(T::DbWeight::get().writes(4_u64)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(f.into()))) - .saturating_add(Weight::from_parts(0, 2975).saturating_mul(f.into())) + .saturating_add(Weight::from_parts(0, 2499).saturating_mul(f.into())) } /// Storage: BTCRelay ChainCounter (r:1 w:0) /// Proof: BTCRelay ChainCounter (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -178,12 +178,12 @@ impl btc_relay::WeightInfo for WeightInfo { /// The range of component `f` is `[3, 6]`. fn store_block_header_reorganize_chains (f: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `4937 + f * (199 ±0)` - // Estimated: `109561 + f * (1340 ±45)` - // Minimum execution time: 663_509_000 picoseconds. - Weight::from_parts(656_899_818, 109561) - // Standard Error: 923_781 - .saturating_add(Weight::from_parts(16_944_084, 0).saturating_mul(f.into())) + // Measured: `4741 + f * (240 ±0)` + // Estimated: `54490 + f * (1340 ±45)` + // Minimum execution time: 513_248_000 picoseconds. + Weight::from_parts(504_054_659, 54490) + // Standard Error: 322_620 + .saturating_add(Weight::from_parts(7_203_738, 0).saturating_mul(f.into())) .saturating_add(T::DbWeight::get().reads(42_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(f.into()))) .saturating_add(T::DbWeight::get().writes(46_u64)) diff --git a/parachain/runtime/kintsugi/src/weights/clients_info.rs b/parachain/runtime/kintsugi/src/weights/clients_info.rs index 6a28c005e4..8002badb38 100644 --- a/parachain/runtime/kintsugi/src/weights/clients_info.rs +++ b/parachain/runtime/kintsugi/src/weights/clients_info.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for clients_info //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-kcxvd`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/kintsugi/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -44,30 +44,30 @@ impl clients_info::WeightInfo for WeightInfo { /// Proof: ClientsInfo CurrentClientReleases (max_values: None, max_size: Some(562), added: 3037, mode: MaxEncodedLen) /// The range of component `n` is `[0, 255]`. /// The range of component `u` is `[0, 255]`. - fn set_current_client_release (n: u32, _u: u32, ) -> Weight { + fn set_current_client_release (n: u32, u: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 29_991_000 picoseconds. - Weight::from_parts(33_156_363, 0) - // Standard Error: 2_280 - .saturating_add(Weight::from_parts(5_748, 0).saturating_mul(n.into())) + // Minimum execution time: 23_156_000 picoseconds. + Weight::from_parts(15_199_745, 0) + // Standard Error: 2_357 + .saturating_add(Weight::from_parts(33_907, 0).saturating_mul(n.into())) + // Standard Error: 2_357 + .saturating_add(Weight::from_parts(25_678, 0).saturating_mul(u.into())) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: ClientsInfo PendingClientReleases (r:0 w:1) /// Proof: ClientsInfo PendingClientReleases (max_values: None, max_size: Some(562), added: 3037, mode: MaxEncodedLen) /// The range of component `n` is `[0, 255]`. /// The range of component `u` is `[0, 255]`. - fn set_pending_client_release (n: u32, u: u32, ) -> Weight { + fn set_pending_client_release (_n: u32, u: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 30_050_000 picoseconds. - Weight::from_parts(30_251_578, 0) - // Standard Error: 1_658 - .saturating_add(Weight::from_parts(12_923, 0).saturating_mul(n.into())) - // Standard Error: 1_658 - .saturating_add(Weight::from_parts(6_099, 0).saturating_mul(u.into())) + // Minimum execution time: 23_888_000 picoseconds. + Weight::from_parts(25_894_200, 0) + // Standard Error: 752 + .saturating_add(Weight::from_parts(712, 0).saturating_mul(u.into())) .saturating_add(T::DbWeight::get().writes(1_u64)) } } \ No newline at end of file diff --git a/parachain/runtime/kintsugi/src/weights/collator_selection.rs b/parachain/runtime/kintsugi/src/weights/collator_selection.rs index ef73b545f7..6c9695a663 100644 --- a/parachain/runtime/kintsugi/src/weights/collator_selection.rs +++ b/parachain/runtime/kintsugi/src/weights/collator_selection.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for collator_selection //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-kcxvd`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/kintsugi/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -47,12 +47,12 @@ impl collator_selection::WeightInfo for WeightInfo { /// The range of component `b` is `[1, 100]`. fn set_invulnerables (b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `217 + b * (78 ±0)` - // Estimated: `1207 + b * (2554 ±0)` - // Minimum execution time: 35_613_000 picoseconds. - Weight::from_parts(31_790_848, 1207) - // Standard Error: 36_475 - .saturating_add(Weight::from_parts(6_820_740, 0).saturating_mul(b.into())) + // Measured: `252 + b * (78 ±0)` + // Estimated: `1241 + b * (2554 ±0)` + // Minimum execution time: 28_928_000 picoseconds. + Weight::from_parts(30_022_286, 1241) + // Standard Error: 9_605 + .saturating_add(Weight::from_parts(4_927_606, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(1_u64)) .saturating_add(Weight::from_parts(0, 2554).saturating_mul(b.into())) @@ -63,8 +63,8 @@ impl collator_selection::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 18_488_000 picoseconds. - Weight::from_parts(19_167_000, 0) + // Minimum execution time: 15_451_000 picoseconds. + Weight::from_parts(15_882_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: CollatorSelection CandidacyBond (r:0 w:1) @@ -73,8 +73,8 @@ impl collator_selection::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 18_984_000 picoseconds. - Weight::from_parts(19_609_000, 0) + // Minimum execution time: 16_102_000 picoseconds. + Weight::from_parts(16_673_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: CollatorSelection Candidates (r:1 w:1) @@ -95,18 +95,18 @@ impl collator_selection::WeightInfo for WeightInfo { /// Proof: Escrow Reserved (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) /// Storage: CollatorSelection LastAuthoredBlock (r:0 w:1) /// Proof: CollatorSelection LastAuthoredBlock (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) - /// The range of component `c` is `[1, 999]`. + /// The range of component `c` is `[1, 19]`. fn register_as_candidate (c: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `2801 + c * (49 ±0)` - // Estimated: `73766 + c * (50 ±0)` - // Minimum execution time: 98_960_000 picoseconds. - Weight::from_parts(132_006_984, 73766) - // Standard Error: 4_063 - .saturating_add(Weight::from_parts(281_283, 0).saturating_mul(c.into())) + // Measured: `902 + c * (96 ±0)` + // Estimated: `49487 + c * (97 ±0)` + // Minimum execution time: 77_295_000 picoseconds. + Weight::from_parts(80_119_617, 49487) + // Standard Error: 10_631 + .saturating_add(Weight::from_parts(333_051, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) - .saturating_add(Weight::from_parts(0, 50).saturating_mul(c.into())) + .saturating_add(Weight::from_parts(0, 97).saturating_mul(c.into())) } /// Storage: CollatorSelection Candidates (r:1 w:1) /// Proof: CollatorSelection Candidates (max_values: Some(1), max_size: Some(48002), added: 48497, mode: MaxEncodedLen) @@ -114,15 +114,15 @@ impl collator_selection::WeightInfo for WeightInfo { /// Proof: Escrow Reserved (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) /// Storage: CollatorSelection LastAuthoredBlock (r:0 w:1) /// Proof: CollatorSelection LastAuthoredBlock (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) - /// The range of component `c` is `[6, 1000]`. + /// The range of component `c` is `[6, 20]`. fn leave_intent (c: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `983 + c * (48 ±0)` - // Estimated: `53016` - // Minimum execution time: 58_156_000 picoseconds. - Weight::from_parts(94_971_545, 53016) - // Standard Error: 13_379 - .saturating_add(Weight::from_parts(252_123, 0).saturating_mul(c.into())) + // Measured: `402 + c * (64 ±0)` + // Estimated: `49487` + // Minimum execution time: 41_543_000 picoseconds. + Weight::from_parts(41_188_765, 49487) + // Standard Error: 10_873 + .saturating_add(Weight::from_parts(201_069, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -134,10 +134,10 @@ impl collator_selection::WeightInfo for WeightInfo { /// Proof: CollatorSelection LastAuthoredBlock (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) fn note_author () -> Weight { // Proof Size summary in bytes: - // Measured: `319` - // Estimated: `9763` - // Minimum execution time: 84_973_000 picoseconds. - Weight::from_parts(87_916_000, 9763) + // Measured: `650` + // Estimated: `6170` + // Minimum execution time: 71_283_000 picoseconds. + Weight::from_parts(72_435_000, 6170) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -145,30 +145,30 @@ impl collator_selection::WeightInfo for WeightInfo { /// Proof: CollatorSelection Candidates (max_values: Some(1), max_size: Some(48002), added: 48497, mode: MaxEncodedLen) /// Storage: CollatorSelection CandidacyBond (r:1 w:0) /// Proof: CollatorSelection CandidacyBond (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: CollatorSelection LastAuthoredBlock (r:999 w:0) + /// Storage: CollatorSelection LastAuthoredBlock (r:20 w:0) /// Proof: CollatorSelection LastAuthoredBlock (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) - /// Storage: Escrow UserPointEpoch (r:999 w:0) + /// Storage: Escrow UserPointEpoch (r:20 w:0) /// Proof: Escrow UserPointEpoch (max_values: None, max_size: Some(52), added: 2527, mode: MaxEncodedLen) - /// Storage: Escrow UserPointHistory (r:999 w:0) + /// Storage: Escrow UserPointHistory (r:20 w:0) /// Proof: Escrow UserPointHistory (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen) /// Storage: CollatorSelection Invulnerables (r:1 w:0) /// Proof: CollatorSelection Invulnerables (max_values: Some(1), max_size: Some(3202), added: 3697, mode: MaxEncodedLen) - /// Storage: Escrow Reserved (r:995 w:995) + /// Storage: Escrow Reserved (r:15 w:15) /// Proof: Escrow Reserved (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) - /// The range of component `r` is `[1, 1000]`. - /// The range of component `c` is `[1, 1000]`. + /// The range of component `r` is `[1, 20]`. + /// The range of component `c` is `[1, 20]`. fn new_session (r: u32, c: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `23641 + r * (50 ±0) + c * (193 ±0)` - // Estimated: `58645 + c * (7610 ±0) + r * (2538 ±0)` - // Minimum execution time: 69_800_000 picoseconds. - Weight::from_parts(71_300_000, 58645) - // Standard Error: 1_581_374 - .saturating_add(Weight::from_parts(89_845_173, 0).saturating_mul(c.into())) + // Measured: `793 + c * (194 ±0) + r * (47 ±0)` + // Estimated: `49487 + c * (2563 ±0) + r * (2207 ±23)` + // Minimum execution time: 52_586_000 picoseconds. + Weight::from_parts(53_397_000, 49487) + // Standard Error: 441_635 + .saturating_add(Weight::from_parts(25_597_481, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(c.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(c.into()))) - .saturating_add(Weight::from_parts(0, 7610).saturating_mul(c.into())) - .saturating_add(Weight::from_parts(0, 2538).saturating_mul(r.into())) + .saturating_add(Weight::from_parts(0, 2563).saturating_mul(c.into())) + .saturating_add(Weight::from_parts(0, 2207).saturating_mul(r.into())) } } \ No newline at end of file diff --git a/parachain/runtime/kintsugi/src/weights/cumulus_pallet_xcmp_queue.rs b/parachain/runtime/kintsugi/src/weights/cumulus_pallet_xcmp_queue.rs index 4ddfa187d4..1325f37aa3 100644 --- a/parachain/runtime/kintsugi/src/weights/cumulus_pallet_xcmp_queue.rs +++ b/parachain/runtime/kintsugi/src/weights/cumulus_pallet_xcmp_queue.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for cumulus_pallet_xcmp_queue //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-kcxvd`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/kintsugi/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -46,8 +46,8 @@ impl cumulus_pallet_xcmp_queue::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `4` // Estimated: `1489` - // Minimum execution time: 13_474_000 picoseconds. - Weight::from_parts(14_433_000, 1489) + // Minimum execution time: 10_922_000 picoseconds. + Weight::from_parts(11_643_000, 1489) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -57,8 +57,8 @@ impl cumulus_pallet_xcmp_queue::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `4` // Estimated: `1489` - // Minimum execution time: 13_779_000 picoseconds. - Weight::from_parts(14_656_000, 1489) + // Minimum execution time: 10_761_000 picoseconds. + Weight::from_parts(11_012_000, 1489) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } diff --git a/parachain/runtime/kintsugi/src/weights/democracy.rs b/parachain/runtime/kintsugi/src/weights/democracy.rs index 1e7682031b..586b9d429f 100644 --- a/parachain/runtime/kintsugi/src/weights/democracy.rs +++ b/parachain/runtime/kintsugi/src/weights/democracy.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for democracy //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-kcxvd`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/kintsugi/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -54,10 +54,10 @@ impl democracy::WeightInfo for WeightInfo { /// Proof: Democracy DepositOf (max_values: None, max_size: Some(3230), added: 5705, mode: MaxEncodedLen) fn propose () -> Weight { // Proof Size summary in bytes: - // Measured: `6110` - // Estimated: `30275` - // Minimum execution time: 117_322_000 picoseconds. - Weight::from_parts(131_587_000, 30275) + // Measured: `6137` + // Estimated: `18187` + // Minimum execution time: 71_353_000 picoseconds. + Weight::from_parts(72_285_000, 18187) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -71,10 +71,10 @@ impl democracy::WeightInfo for WeightInfo { /// Proof: Escrow Reserved (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) fn second () -> Weight { // Proof Size summary in bytes: - // Measured: `4802` - // Estimated: `17294` - // Minimum execution time: 89_592_000 picoseconds. - Weight::from_parts(97_799_000, 17294) + // Measured: `4829` + // Estimated: `6695` + // Minimum execution time: 57_224_000 picoseconds. + Weight::from_parts(58_467_000, 6695) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -90,10 +90,10 @@ impl democracy::WeightInfo for WeightInfo { /// Proof: Democracy VotingOf (max_values: None, max_size: Some(2142), added: 4617, mode: MaxEncodedLen) fn vote_new () -> Weight { // Proof Size summary in bytes: - // Measured: `3160` - // Estimated: `19872` - // Minimum execution time: 93_699_000 picoseconds. - Weight::from_parts(101_855_000, 19872) + // Measured: `3187` + // Estimated: `5607` + // Minimum execution time: 57_756_000 picoseconds. + Weight::from_parts(59_539_000, 5607) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -109,10 +109,10 @@ impl democracy::WeightInfo for WeightInfo { /// Proof: Democracy VotingOf (max_values: None, max_size: Some(2142), added: 4617, mode: MaxEncodedLen) fn vote_existing () -> Weight { // Proof Size summary in bytes: - // Measured: `3181` - // Estimated: `19872` - // Minimum execution time: 97_734_000 picoseconds. - Weight::from_parts(106_301_000, 19872) + // Measured: `3208` + // Estimated: `5607` + // Minimum execution time: 57_966_000 picoseconds. + Weight::from_parts(58_347_000, 5607) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -128,10 +128,10 @@ impl democracy::WeightInfo for WeightInfo { /// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen) fn fast_track () -> Weight { // Proof Size summary in bytes: - // Measured: `398` - // Estimated: `29900` - // Minimum execution time: 74_046_000 picoseconds. - Weight::from_parts(75_221_000, 29900) + // Measured: `425` + // Estimated: `18187` + // Minimum execution time: 57_796_000 picoseconds. + Weight::from_parts(59_529_000, 18187) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -139,10 +139,10 @@ impl democracy::WeightInfo for WeightInfo { /// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen) fn fast_track_referendum () -> Weight { // Proof Size summary in bytes: - // Measured: `221` + // Measured: `248` // Estimated: `3666` - // Minimum execution time: 40_319_000 picoseconds. - Weight::from_parts(42_100_000, 3666) + // Minimum execution time: 32_916_000 picoseconds. + Weight::from_parts(33_847_000, 3666) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -154,10 +154,10 @@ impl democracy::WeightInfo for WeightInfo { /// Proof: Escrow Reserved (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) fn cancel_proposal () -> Weight { // Proof Size summary in bytes: - // Measured: `6169` - // Estimated: `28411` - // Minimum execution time: 151_246_000 picoseconds. - Weight::from_parts(159_233_000, 28411) + // Measured: `6196` + // Estimated: `18187` + // Minimum execution time: 93_818_000 picoseconds. + Weight::from_parts(96_243_000, 18187) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -165,10 +165,10 @@ impl democracy::WeightInfo for WeightInfo { /// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen) fn cancel_referendum () -> Weight { // Proof Size summary in bytes: - // Measured: `221` + // Measured: `248` // Estimated: `3666` - // Minimum execution time: 35_511_000 picoseconds. - Weight::from_parts(36_860_000, 3666) + // Minimum execution time: 27_725_000 picoseconds. + Weight::from_parts(28_487_000, 3666) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -195,12 +195,12 @@ impl democracy::WeightInfo for WeightInfo { /// The range of component `r` is `[0, 99]`. fn on_initialize_public (r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `426 + r * (86 ±0)` - // Estimated: `40282 + r * (2677 ±0)` - // Minimum execution time: 83_314_000 picoseconds. - Weight::from_parts(95_868_472, 40282) - // Standard Error: 58_322 - .saturating_add(Weight::from_parts(24_100_198, 0).saturating_mul(r.into())) + // Measured: `453 + r * (86 ±0)` + // Estimated: `18187 + r * (2677 ±0)` + // Minimum execution time: 69_790_000 picoseconds. + Weight::from_parts(74_778_560, 18187) + // Standard Error: 33_978 + .saturating_add(Weight::from_parts(19_026_642, 0).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(9_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(6_u64)) @@ -222,12 +222,12 @@ impl democracy::WeightInfo for WeightInfo { /// The range of component `r` is `[0, 99]`. fn on_initialize_base (r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `144 + r * (86 ±0)` - // Estimated: `25141 + r * (2676 ±0)` - // Minimum execution time: 21_865_000 picoseconds. - Weight::from_parts(22_116_633, 25141) - // Standard Error: 26_988 - .saturating_add(Weight::from_parts(6_739_860, 0).saturating_mul(r.into())) + // Measured: `171 + r * (86 ±0)` + // Estimated: `18187 + r * (2676 ±0)` + // Minimum execution time: 19_809_000 picoseconds. + Weight::from_parts(20_605_829, 18187) + // Standard Error: 11_119 + .saturating_add(Weight::from_parts(5_000_060, 0).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(1_u64)) @@ -248,12 +248,12 @@ impl democracy::WeightInfo for WeightInfo { /// The range of component `r` is `[0, 99]`. fn on_initialize_base_with_launch_period (r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `144 + r * (86 ±0)` - // Estimated: `25141 + r * (2676 ±0)` - // Minimum execution time: 21_960_000 picoseconds. - Weight::from_parts(22_159_000, 25141) - // Standard Error: 160_991 - .saturating_add(Weight::from_parts(7_413_232, 0).saturating_mul(r.into())) + // Measured: `171 + r * (86 ±0)` + // Estimated: `18187 + r * (2676 ±0)` + // Minimum execution time: 19_840_000 picoseconds. + Weight::from_parts(13_604_611, 18187) + // Standard Error: 72_687 + .saturating_add(Weight::from_parts(5_272_806, 0).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(1_u64)) @@ -265,8 +265,8 @@ impl democracy::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 17_879_000 picoseconds. - Weight::from_parts(26_076_000, 0) + // Minimum execution time: 6_814_000 picoseconds. + Weight::from_parts(7_104_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: Democracy ReferendumInfoOf (r:1 w:1) @@ -276,12 +276,12 @@ impl democracy::WeightInfo for WeightInfo { /// The range of component `r` is `[1, 100]`. fn remove_vote (r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `598 + r * (25 ±0)` - // Estimated: `9273` - // Minimum execution time: 41_711_000 picoseconds. - Weight::from_parts(100_426_550, 9273) - // Standard Error: 108_886 - .saturating_add(Weight::from_parts(797_476, 0).saturating_mul(r.into())) + // Measured: `625 + r * (25 ±0)` + // Estimated: `5607` + // Minimum execution time: 28_086_000 picoseconds. + Weight::from_parts(33_138_291, 5607) + // Standard Error: 3_852 + .saturating_add(Weight::from_parts(113_162, 0).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -291,10 +291,10 @@ impl democracy::WeightInfo for WeightInfo { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn spend_from_treasury () -> Weight { // Proof Size summary in bytes: - // Measured: `319` - // Estimated: `9763` - // Minimum execution time: 151_809_000 picoseconds. - Weight::from_parts(255_556_000, 9763) + // Measured: `536` + // Estimated: `6170` + // Minimum execution time: 67_766_000 picoseconds. + Weight::from_parts(69_309_000, 6170) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } diff --git a/parachain/runtime/kintsugi/src/weights/dex_general.rs b/parachain/runtime/kintsugi/src/weights/dex_general.rs index fa2c68af89..7d520b8937 100644 --- a/parachain/runtime/kintsugi/src/weights/dex_general.rs +++ b/parachain/runtime/kintsugi/src/weights/dex_general.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for dex_general //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-kcxvd`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/kintsugi/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -44,10 +44,10 @@ impl dex_general::WeightInfo for WeightInfo { /// Proof: DexGeneral FeeMeta (max_values: Some(1), max_size: Some(34), added: 529, mode: MaxEncodedLen) fn set_fee_receiver () -> Weight { // Proof Size summary in bytes: - // Measured: `3` + // Measured: `4` // Estimated: `1519` - // Minimum execution time: 30_872_000 picoseconds. - Weight::from_parts(33_884_000, 1519) + // Minimum execution time: 13_237_000 picoseconds. + Weight::from_parts(13_527_000, 1519) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -55,10 +55,10 @@ impl dex_general::WeightInfo for WeightInfo { /// Proof: DexGeneral FeeMeta (max_values: Some(1), max_size: Some(34), added: 529, mode: MaxEncodedLen) fn set_fee_point () -> Weight { // Proof Size summary in bytes: - // Measured: `3` + // Measured: `4` // Estimated: `1519` - // Minimum execution time: 48_165_000 picoseconds. - Weight::from_parts(56_968_000, 1519) + // Minimum execution time: 22_024_000 picoseconds. + Weight::from_parts(22_796_000, 1519) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -68,10 +68,10 @@ impl dex_general::WeightInfo for WeightInfo { /// Proof: DexGeneral LiquidityPairs (max_values: None, max_size: Some(50), added: 2525, mode: MaxEncodedLen) fn create_pair () -> Weight { // Proof Size summary in bytes: - // Measured: `3` + // Measured: `4` // Estimated: `3628` - // Minimum execution time: 63_937_000 picoseconds. - Weight::from_parts(86_321_000, 3628) + // Minimum execution time: 32_094_000 picoseconds. + Weight::from_parts(32_836_000, 3628) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -85,14 +85,14 @@ impl dex_general::WeightInfo for WeightInfo { /// The range of component `l` is `[1, 10]`. fn bootstrap_create (r: u32, l: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `3` + // Measured: `4` // Estimated: `3628` - // Minimum execution time: 51_733_000 picoseconds. - Weight::from_parts(110_419_525, 3628) - // Standard Error: 803_059 - .saturating_add(Weight::from_parts(1_188_210, 0).saturating_mul(r.into())) - // Standard Error: 803_059 - .saturating_add(Weight::from_parts(1_519_748, 0).saturating_mul(l.into())) + // Minimum execution time: 38_747_000 picoseconds. + Weight::from_parts(38_599_014, 3628) + // Standard Error: 6_559 + .saturating_add(Weight::from_parts(69_180, 0).saturating_mul(r.into())) + // Standard Error: 6_559 + .saturating_add(Weight::from_parts(152_288, 0).saturating_mul(l.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -108,10 +108,10 @@ impl dex_general::WeightInfo for WeightInfo { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn bootstrap_contribute () -> Weight { // Proof Size summary in bytes: - // Measured: `671` - // Estimated: `52635` - // Minimum execution time: 216_308_000 picoseconds. - Weight::from_parts(740_397_000, 52635) + // Measured: `941` + // Estimated: `30497` + // Minimum execution time: 156_172_000 picoseconds. + Weight::from_parts(158_808_000, 30497) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(7_u64)) } @@ -131,10 +131,10 @@ impl dex_general::WeightInfo for WeightInfo { /// Proof: DexGeneral BootstrapRewards (max_values: None, max_size: Some(27032), added: 29507, mode: MaxEncodedLen) fn bootstrap_claim () -> Weight { // Proof Size summary in bytes: - // Measured: `1231` - // Estimated: `54598` - // Minimum execution time: 295_123_000 picoseconds. - Weight::from_parts(514_541_000, 54598) + // Measured: `1486` + // Estimated: `30497` + // Minimum execution time: 131_593_000 picoseconds. + Weight::from_parts(133_668_000, 30497) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -152,10 +152,10 @@ impl dex_general::WeightInfo for WeightInfo { /// Proof: DexGeneral BootstrapEndStatus (max_values: None, max_size: Some(163), added: 2638, mode: MaxEncodedLen) fn bootstrap_end () -> Weight { // Proof Size summary in bytes: - // Measured: `893` - // Estimated: `27264` - // Minimum execution time: 489_279_000 picoseconds. - Weight::from_parts(1_033_867_000, 27264) + // Measured: `1200` + // Estimated: `13940` + // Minimum execution time: 193_808_000 picoseconds. + Weight::from_parts(195_532_000, 13940) .saturating_add(T::DbWeight::get().reads(9_u64)) .saturating_add(T::DbWeight::get().writes(10_u64)) } @@ -169,14 +169,14 @@ impl dex_general::WeightInfo for WeightInfo { /// The range of component `l` is `[1, 10]`. fn bootstrap_update (r: u32, l: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `259 + r * (21 ±0)` - // Estimated: `34125` - // Minimum execution time: 63_115_000 picoseconds. - Weight::from_parts(128_977_323, 34125) - // Standard Error: 845_796 - .saturating_add(Weight::from_parts(1_311_388, 0).saturating_mul(r.into())) - // Standard Error: 845_796 - .saturating_add(Weight::from_parts(1_817_881, 0).saturating_mul(l.into())) + // Measured: `260 + r * (21 ±0)` + // Estimated: `30497` + // Minimum execution time: 47_184_000 picoseconds. + Weight::from_parts(46_969_960, 30497) + // Standard Error: 17_557 + .saturating_add(Weight::from_parts(280_693, 0).saturating_mul(r.into())) + // Standard Error: 17_557 + .saturating_add(Weight::from_parts(82_621, 0).saturating_mul(l.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -190,10 +190,10 @@ impl dex_general::WeightInfo for WeightInfo { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn bootstrap_refund () -> Weight { // Proof Size summary in bytes: - // Measured: `1046` - // Estimated: `22138` - // Minimum execution time: 263_656_000 picoseconds. - Weight::from_parts(354_866_000, 22138) + // Measured: `1301` + // Estimated: `11350` + // Minimum execution time: 121_774_000 picoseconds. + Weight::from_parts(123_046_000, 11350) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(6_u64)) } @@ -213,10 +213,10 @@ impl dex_general::WeightInfo for WeightInfo { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn add_liquidity () -> Weight { // Proof Size summary in bytes: - // Measured: `704` - // Estimated: `33222` - // Minimum execution time: 496_537_000 picoseconds. - Weight::from_parts(659_502_000, 33222) + // Measured: `974` + // Estimated: `13940` + // Minimum execution time: 215_782_000 picoseconds. + Weight::from_parts(216_514_000, 13940) .saturating_add(T::DbWeight::get().reads(11_u64)) .saturating_add(T::DbWeight::get().writes(9_u64)) } @@ -236,10 +236,10 @@ impl dex_general::WeightInfo for WeightInfo { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn remove_liquidity () -> Weight { // Proof Size summary in bytes: - // Measured: `1188` - // Estimated: `33222` - // Minimum execution time: 422_836_000 picoseconds. - Weight::from_parts(483_090_000, 33222) + // Measured: `1443` + // Estimated: `13940` + // Minimum execution time: 182_105_000 picoseconds. + Weight::from_parts(183_497_000, 13940) .saturating_add(T::DbWeight::get().reads(11_u64)) .saturating_add(T::DbWeight::get().writes(8_u64)) } @@ -252,16 +252,16 @@ impl dex_general::WeightInfo for WeightInfo { /// The range of component `a` is `[2, 10]`. fn swap_exact_assets_for_assets (a: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `0 + a * (435 ±0)` - // Estimated: `8211 + a * (8825 ±0)` - // Minimum execution time: 172_610_000 picoseconds. - Weight::from_parts(29_758_854, 8211) - // Standard Error: 5_812_451 - .saturating_add(Weight::from_parts(186_798_476, 0).saturating_mul(a.into())) + // Measured: `224 + a * (459 ±0)` + // Estimated: `3628 + a * (5180 ±0)` + // Minimum execution time: 134_419_000 picoseconds. + Weight::from_parts(8_495_929, 3628) + // Standard Error: 92_959 + .saturating_add(Weight::from_parts(64_344_913, 0).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(a.into()))) - .saturating_add(Weight::from_parts(0, 8825).saturating_mul(a.into())) + .saturating_add(Weight::from_parts(0, 5180).saturating_mul(a.into())) } /// Storage: Tokens Accounts (r:20 w:20) /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) @@ -272,16 +272,16 @@ impl dex_general::WeightInfo for WeightInfo { /// The range of component `a` is `[2, 10]`. fn swap_assets_for_exact_assets (a: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `0 + a * (435 ±0)` - // Estimated: `8211 + a * (8825 ±22)` - // Minimum execution time: 182_279_000 picoseconds. - Weight::from_parts(470_682_585, 8211) - // Standard Error: 3_226_168 - .saturating_add(Weight::from_parts(29_735_625, 0).saturating_mul(a.into())) + // Measured: `224 + a * (459 ±0)` + // Estimated: `3628 + a * (5180 ±22)` + // Minimum execution time: 134_610_000 picoseconds. + Weight::from_parts(9_747_661, 3628) + // Standard Error: 97_108 + .saturating_add(Weight::from_parts(63_951_511, 0).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(a.into()))) - .saturating_add(Weight::from_parts(0, 8825).saturating_mul(a.into())) + .saturating_add(Weight::from_parts(0, 5180).saturating_mul(a.into())) } /// Storage: DexGeneral BootstrapRewards (r:1 w:1) /// Proof: DexGeneral BootstrapRewards (max_values: None, max_size: Some(27032), added: 29507, mode: MaxEncodedLen) @@ -292,12 +292,12 @@ impl dex_general::WeightInfo for WeightInfo { /// The range of component `r` is `[1, 10]`. fn bootstrap_charge_reward (r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `376 + r * (88 ±0)` - // Estimated: `35080 + r * (5180 ±0)` - // Minimum execution time: 110_830_000 picoseconds. - Weight::from_parts(66_891_238, 35080) - // Standard Error: 239_313 - .saturating_add(Weight::from_parts(56_380_379, 0).saturating_mul(r.into())) + // Measured: `646 + r * (88 ±0)` + // Estimated: `30497 + r * (5180 ±0)` + // Minimum execution time: 93_807_000 picoseconds. + Weight::from_parts(52_406_460, 30497) + // Standard Error: 40_599 + .saturating_add(Weight::from_parts(43_799_179, 0).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().writes(2_u64)) @@ -308,10 +308,10 @@ impl dex_general::WeightInfo for WeightInfo { /// Proof: DexGeneral BootstrapRewards (max_values: None, max_size: Some(27032), added: 29507, mode: MaxEncodedLen) fn bootstrap_withdraw_reward () -> Weight { // Proof Size summary in bytes: - // Measured: `135` + // Measured: `136` // Estimated: `30497` - // Minimum execution time: 39_192_000 picoseconds. - Weight::from_parts(42_401_000, 30497) + // Minimum execution time: 29_780_000 picoseconds. + Weight::from_parts(30_321_000, 30497) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } diff --git a/parachain/runtime/kintsugi/src/weights/dex_stable.rs b/parachain/runtime/kintsugi/src/weights/dex_stable.rs index fb3ff28b75..93ac2b6b24 100644 --- a/parachain/runtime/kintsugi/src/weights/dex_stable.rs +++ b/parachain/runtime/kintsugi/src/weights/dex_stable.rs @@ -2,17 +2,17 @@ //! Autogenerated weights for dex_stable //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-07-10, STEPS: `10`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: ``, CPU: `Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-kcxvd`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 // Executed Command: -// ./target/debug/interbtc-parachain +// target/release/interbtc-parachain // benchmark // pallet // --pallet -// dex-stable +// * // --extrinsic // * // --chain @@ -20,11 +20,11 @@ // --execution=wasm // --wasm-execution=compiled // --steps -// 10 +// 50 // --repeat -// 1 +// 10 // --output -// parachain/runtime/kintsugi/src/weights +// parachain/runtime/kintsugi/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -52,12 +52,12 @@ impl dex_stable::WeightInfo for WeightInfo { /// The range of component `s` is `[0, 50]`. fn create_base_pool (b: u32, _s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `175` + // Measured: `227` // Estimated: `4281` - // Minimum execution time: 923_222_000 picoseconds. - Weight::from_parts(930_939_034, 4281) - // Standard Error: 317_902 - .saturating_add(Weight::from_parts(154_311, 0).saturating_mul(b.into())) + // Minimum execution time: 55_992_000 picoseconds. + Weight::from_parts(56_658_626, 4281) + // Standard Error: 8_375 + .saturating_add(Weight::from_parts(154_956, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -77,14 +77,14 @@ impl dex_stable::WeightInfo for WeightInfo { /// The range of component `s` is `[0, 50]`. fn create_meta_pool (m: u32, s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1355` + // Measured: `1426` // Estimated: `7572` - // Minimum execution time: 1_510_682_000 picoseconds. - Weight::from_parts(1_509_960_386, 7572) - // Standard Error: 602_158 - .saturating_add(Weight::from_parts(914_689, 0).saturating_mul(m.into())) - // Standard Error: 103_829 - .saturating_add(Weight::from_parts(96_679, 0).saturating_mul(s.into())) + // Minimum execution time: 104_991_000 picoseconds. + Weight::from_parts(106_170_089, 7572) + // Standard Error: 150_554 + .saturating_add(Weight::from_parts(92_297, 0).saturating_mul(m.into())) + // Standard Error: 25_055 + .saturating_add(Weight::from_parts(69_010, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -101,12 +101,12 @@ impl dex_stable::WeightInfo for WeightInfo { /// The range of component `b` is `[2, 10]`. fn add_liquidity (b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `948 + b * (125 ±0)` + // Measured: `1264 + b * (125 ±0)` // Estimated: `4281 + b * (5180 ±0)` - // Minimum execution time: 3_222_842_000 picoseconds. - Weight::from_parts(1_446_309_446, 4281) - // Standard Error: 885_938 - .saturating_add(Weight::from_parts(889_673_438, 0).saturating_mul(b.into())) + // Minimum execution time: 196_874_000 picoseconds. + Weight::from_parts(98_585_099, 4281) + // Standard Error: 77_387 + .saturating_add(Weight::from_parts(50_481_828, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(4_u64)) @@ -123,10 +123,10 @@ impl dex_stable::WeightInfo for WeightInfo { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn swap () -> Weight { // Proof Size summary in bytes: - // Measured: `2108` + // Measured: `2366` // Estimated: `11350` - // Minimum execution time: 2_137_339_000 picoseconds. - Weight::from_parts(2_137_339_000, 11350) + // Minimum execution time: 155_441_000 picoseconds. + Weight::from_parts(157_406_000, 11350) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -141,12 +141,12 @@ impl dex_stable::WeightInfo for WeightInfo { /// The range of component `b` is `[2, 10]`. fn remove_liquidity (b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1057 + b * (192 ±0)` + // Measured: `1315 + b * (192 ±0)` // Estimated: `4281 + b * (5180 ±0)` - // Minimum execution time: 2_515_350_000 picoseconds. - Weight::from_parts(1_306_368_241, 4281) - // Standard Error: 2_505_739 - .saturating_add(Weight::from_parts(599_062_653, 0).saturating_mul(b.into())) + // Minimum execution time: 152_626_000 picoseconds. + Weight::from_parts(84_999_040, 4281) + // Standard Error: 67_946 + .saturating_add(Weight::from_parts(34_274_766, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(3_u64)) @@ -165,10 +165,10 @@ impl dex_stable::WeightInfo for WeightInfo { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn remove_liquidity_one_currency () -> Weight { // Proof Size summary in bytes: - // Measured: `2207` + // Measured: `2465` // Estimated: `8760` - // Minimum execution time: 2_167_491_000 picoseconds. - Weight::from_parts(2_167_491_000, 8760) + // Minimum execution time: 178_487_000 picoseconds. + Weight::from_parts(180_611_000, 8760) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -185,12 +185,12 @@ impl dex_stable::WeightInfo for WeightInfo { /// The range of component `b` is `[2, 10]`. fn remove_liquidity_imbalance (b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1099 + b * (192 ±0)` + // Measured: `1357 + b * (192 ±0)` // Estimated: `4281 + b * (5180 ±0)` - // Minimum execution time: 2_586_449_000 picoseconds. - Weight::from_parts(1_361_082_704, 4281) - // Standard Error: 2_175_713 - .saturating_add(Weight::from_parts(608_779_034, 0).saturating_mul(b.into())) + // Minimum execution time: 177_556_000 picoseconds. + Weight::from_parts(99_852_974, 4281) + // Standard Error: 65_802 + .saturating_add(Weight::from_parts(39_938_485, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(3_u64)) @@ -211,14 +211,14 @@ impl dex_stable::WeightInfo for WeightInfo { /// The range of component `m` is `[2, 10]`. fn add_pool_and_base_pool_liquidity (b: u32, m: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1437 + b * (187 ±0) + m * (121 ±0)` + // Measured: `1733 + b * (187 ±0) + m * (117 ±0)` // Estimated: `7572 + b * (5180 ±0) + m * (5180 ±0)` - // Minimum execution time: 11_589_457_000 picoseconds. - Weight::from_parts(2_489_097_862, 7572) - // Standard Error: 1_840_926 - .saturating_add(Weight::from_parts(730_145_710, 0).saturating_mul(b.into())) - // Standard Error: 1_840_926 - .saturating_add(Weight::from_parts(896_050_781, 0).saturating_mul(m.into())) + // Minimum execution time: 703_438_000 picoseconds. + Weight::from_parts(153_195_964, 7572) + // Standard Error: 149_131 + .saturating_add(Weight::from_parts(44_949_828, 0).saturating_mul(b.into())) + // Standard Error: 149_131 + .saturating_add(Weight::from_parts(55_200_238, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(m.into()))) @@ -240,14 +240,14 @@ impl dex_stable::WeightInfo for WeightInfo { /// The range of component `m` is `[2, 10]`. fn remove_pool_and_base_pool_liquidity (b: u32, m: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `1658 + b * (187 ±0) + m * (187 ±0)` + // Measured: `1978 + b * (187 ±0) + m * (185 ±0)` // Estimated: `7572 + b * (5180 ±0) + m * (5180 ±0)` - // Minimum execution time: 9_593_347_000 picoseconds. - Weight::from_parts(2_422_602_274, 7572) - // Standard Error: 3_066_114 - .saturating_add(Weight::from_parts(599_022_504, 0).saturating_mul(b.into())) - // Standard Error: 3_066_114 - .saturating_add(Weight::from_parts(598_545_261, 0).saturating_mul(m.into())) + // Minimum execution time: 556_584_000 picoseconds. + Weight::from_parts(166_130_458, 7572) + // Standard Error: 92_741 + .saturating_add(Weight::from_parts(33_437_802, 0).saturating_mul(b.into())) + // Standard Error: 92_741 + .saturating_add(Weight::from_parts(33_260_031, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(m.into()))) @@ -269,10 +269,10 @@ impl dex_stable::WeightInfo for WeightInfo { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn remove_pool_and_base_pool_liquidity_one_currency () -> Weight { // Proof Size summary in bytes: - // Measured: `4012` + // Measured: `4307` // Estimated: `13940` - // Minimum execution time: 4_107_621_000 picoseconds. - Weight::from_parts(4_107_621_000, 13940) + // Minimum execution time: 346_995_000 picoseconds. + Weight::from_parts(349_299_000, 13940) .saturating_add(T::DbWeight::get().reads(12_u64)) .saturating_add(T::DbWeight::get().writes(9_u64)) } @@ -288,10 +288,10 @@ impl dex_stable::WeightInfo for WeightInfo { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn swap_pool_from_base () -> Weight { // Proof Size summary in bytes: - // Measured: `4279` + // Measured: `4537` // Estimated: `39840` - // Minimum execution time: 5_638_902_000 picoseconds. - Weight::from_parts(5_638_902_000, 39840) + // Minimum execution time: 418_448_000 picoseconds. + Weight::from_parts(420_742_000, 39840) .saturating_add(T::DbWeight::get().reads(20_u64)) .saturating_add(T::DbWeight::get().writes(9_u64)) } @@ -307,10 +307,10 @@ impl dex_stable::WeightInfo for WeightInfo { /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) fn swap_pool_to_base () -> Weight { // Proof Size summary in bytes: - // Measured: `4042` + // Measured: `4337` // Estimated: `16530` - // Minimum execution time: 4_095_901_000 picoseconds. - Weight::from_parts(4_095_901_000, 16530) + // Minimum execution time: 325_201_000 picoseconds. + Weight::from_parts(328_067_000, 16530) .saturating_add(T::DbWeight::get().reads(12_u64)) .saturating_add(T::DbWeight::get().writes(9_u64)) } @@ -324,10 +324,10 @@ impl dex_stable::WeightInfo for WeightInfo { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn swap_meta_pool_underlying () -> Weight { // Proof Size summary in bytes: - // Measured: `2459` + // Measured: `2680` // Estimated: `11350` - // Minimum execution time: 2_196_520_000 picoseconds. - Weight::from_parts(2_196_520_000, 11350) + // Minimum execution time: 161_353_000 picoseconds. + Weight::from_parts(162_265_000, 11350) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -337,8 +337,8 @@ impl dex_stable::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `874` // Estimated: `4281` - // Minimum execution time: 505_835_000 picoseconds. - Weight::from_parts(505_835_000, 4281) + // Minimum execution time: 33_076_000 picoseconds. + Weight::from_parts(33_587_000, 4281) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -348,8 +348,8 @@ impl dex_stable::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `874` // Estimated: `4281` - // Minimum execution time: 516_813_000 picoseconds. - Weight::from_parts(516_813_000, 4281) + // Minimum execution time: 33_607_000 picoseconds. + Weight::from_parts(34_058_000, 4281) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -359,8 +359,8 @@ impl dex_stable::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `874` // Estimated: `4281` - // Minimum execution time: 506_259_000 picoseconds. - Weight::from_parts(506_259_000, 4281) + // Minimum execution time: 33_196_000 picoseconds. + Weight::from_parts(33_427_000, 4281) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -372,8 +372,8 @@ impl dex_stable::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `968` // Estimated: `4281` - // Minimum execution time: 651_728_000 picoseconds. - Weight::from_parts(651_728_000, 4281) + // Minimum execution time: 41_062_000 picoseconds. + Weight::from_parts(41_213_000, 4281) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -385,8 +385,8 @@ impl dex_stable::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `968` // Estimated: `4281` - // Minimum execution time: 643_370_000 picoseconds. - Weight::from_parts(643_370_000, 4281) + // Minimum execution time: 40_882_000 picoseconds. + Weight::from_parts(41_273_000, 4281) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -396,10 +396,10 @@ impl dex_stable::WeightInfo for WeightInfo { /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) fn withdraw_admin_fee () -> Weight { // Proof Size summary in bytes: - // Measured: `1843` + // Measured: `2064` // Estimated: `26890` - // Minimum execution time: 2_877_773_000 picoseconds. - Weight::from_parts(2_877_773_000, 26890) + // Minimum execution time: 170_291_000 picoseconds. + Weight::from_parts(171_493_000, 26890) .saturating_add(T::DbWeight::get().reads(11_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } diff --git a/parachain/runtime/kintsugi/src/weights/dex_swap_router.rs b/parachain/runtime/kintsugi/src/weights/dex_swap_router.rs index fb79e2af29..16e8120fc8 100644 --- a/parachain/runtime/kintsugi/src/weights/dex_swap_router.rs +++ b/parachain/runtime/kintsugi/src/weights/dex_swap_router.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for dex_swap_router //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-kcxvd`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/kintsugi/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -45,9 +45,9 @@ impl dex_swap_router::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 787_000 picoseconds. - Weight::from_parts(687_931, 0) - // Standard Error: 1_758 - .saturating_add(Weight::from_parts(122_125, 0).saturating_mul(a.into())) + // Minimum execution time: 602_000 picoseconds. + Weight::from_parts(481_496, 0) + // Standard Error: 648 + .saturating_add(Weight::from_parts(104_815, 0).saturating_mul(a.into())) } } \ No newline at end of file diff --git a/parachain/runtime/kintsugi/src/weights/escrow.rs b/parachain/runtime/kintsugi/src/weights/escrow.rs index e5f68849f8..4ae4fb65d8 100644 --- a/parachain/runtime/kintsugi/src/weights/escrow.rs +++ b/parachain/runtime/kintsugi/src/weights/escrow.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for escrow //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-kcxvd`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/kintsugi/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -65,17 +65,21 @@ impl escrow::WeightInfo for WeightInfo { /// Storage: EscrowRewards TotalStake (r:1 w:1) /// Proof: EscrowRewards TotalStake (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) /// Storage: EscrowRewards RewardCurrencies (r:1 w:0) - /// Proof: EscrowRewards RewardCurrencies (max_values: None, max_size: Some(127), added: 2602, mode: MaxEncodedLen) + /// Proof: EscrowRewards RewardCurrencies (max_values: None, max_size: Some(28), added: 2503, mode: MaxEncodedLen) + /// Storage: EscrowRewards RewardTally (r:1 w:1) + /// Proof: EscrowRewards RewardTally (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: EscrowRewards RewardPerToken (r:1 w:0) + /// Proof: EscrowRewards RewardPerToken (max_values: None, max_size: Some(59), added: 2534, mode: MaxEncodedLen) /// Storage: Escrow UserPointHistory (r:0 w:1) /// Proof: Escrow UserPointHistory (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen) fn create_lock () -> Weight { // Proof Size summary in bytes: - // Measured: `540` - // Estimated: `178187` - // Minimum execution time: 545_084_000 picoseconds. - Weight::from_parts(554_318_000, 178187) - .saturating_add(T::DbWeight::get().reads(66_u64)) - .saturating_add(T::DbWeight::get().writes(62_u64)) + // Measured: `1094` + // Estimated: `136584` + // Minimum execution time: 463_989_000 picoseconds. + Weight::from_parts(466_794_000, 136584) + .saturating_add(T::DbWeight::get().reads(68_u64)) + .saturating_add(T::DbWeight::get().writes(63_u64)) } /// Storage: Escrow Locked (r:1 w:1) /// Proof: Escrow Locked (max_values: None, max_size: Some(68), added: 2543, mode: MaxEncodedLen) @@ -100,17 +104,21 @@ impl escrow::WeightInfo for WeightInfo { /// Storage: EscrowRewards TotalStake (r:1 w:1) /// Proof: EscrowRewards TotalStake (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) /// Storage: EscrowRewards RewardCurrencies (r:1 w:0) - /// Proof: EscrowRewards RewardCurrencies (max_values: None, max_size: Some(127), added: 2602, mode: MaxEncodedLen) + /// Proof: EscrowRewards RewardCurrencies (max_values: None, max_size: Some(28), added: 2503, mode: MaxEncodedLen) + /// Storage: EscrowRewards RewardTally (r:1 w:1) + /// Proof: EscrowRewards RewardTally (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: EscrowRewards RewardPerToken (r:1 w:0) + /// Proof: EscrowRewards RewardPerToken (max_values: None, max_size: Some(59), added: 2534, mode: MaxEncodedLen) /// Storage: Escrow UserPointHistory (r:0 w:1) /// Proof: Escrow UserPointHistory (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen) fn increase_amount () -> Weight { // Proof Size summary in bytes: - // Measured: `1273` - // Estimated: `41511` - // Minimum execution time: 239_088_000 picoseconds. - Weight::from_parts(246_953_000, 41511) - .saturating_add(T::DbWeight::get().reads(12_u64)) - .saturating_add(T::DbWeight::get().writes(10_u64)) + // Measured: `1683` + // Estimated: `4733` + // Minimum execution time: 207_245_000 picoseconds. + Weight::from_parts(208_998_000, 4733) + .saturating_add(T::DbWeight::get().reads(14_u64)) + .saturating_add(T::DbWeight::get().writes(11_u64)) } /// Storage: Escrow Locked (r:1 w:1) /// Proof: Escrow Locked (max_values: None, max_size: Some(68), added: 2543, mode: MaxEncodedLen) @@ -135,17 +143,21 @@ impl escrow::WeightInfo for WeightInfo { /// Storage: EscrowRewards TotalStake (r:1 w:1) /// Proof: EscrowRewards TotalStake (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) /// Storage: EscrowRewards RewardCurrencies (r:1 w:0) - /// Proof: EscrowRewards RewardCurrencies (max_values: None, max_size: Some(127), added: 2602, mode: MaxEncodedLen) + /// Proof: EscrowRewards RewardCurrencies (max_values: None, max_size: Some(28), added: 2503, mode: MaxEncodedLen) + /// Storage: EscrowRewards RewardTally (r:1 w:1) + /// Proof: EscrowRewards RewardTally (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: EscrowRewards RewardPerToken (r:1 w:0) + /// Proof: EscrowRewards RewardPerToken (max_values: None, max_size: Some(59), added: 2534, mode: MaxEncodedLen) /// Storage: Escrow UserPointHistory (r:0 w:1) /// Proof: Escrow UserPointHistory (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen) fn increase_unlock_height () -> Weight { // Proof Size summary in bytes: - // Measured: `1273` - // Estimated: `282567` - // Minimum execution time: 854_940_000 picoseconds. - Weight::from_parts(889_374_000, 282567) - .saturating_add(T::DbWeight::get().reads(108_u64)) - .saturating_add(T::DbWeight::get().writes(105_u64)) + // Measured: `1683` + // Estimated: `244557` + // Minimum execution time: 699_982_000 picoseconds. + Weight::from_parts(706_124_000, 244557) + .saturating_add(T::DbWeight::get().reads(110_u64)) + .saturating_add(T::DbWeight::get().writes(106_u64)) } /// Storage: Escrow Locked (r:1 w:1) /// Proof: Escrow Locked (max_values: None, max_size: Some(68), added: 2543, mode: MaxEncodedLen) @@ -154,7 +166,11 @@ impl escrow::WeightInfo for WeightInfo { /// Storage: EscrowRewards TotalStake (r:1 w:1) /// Proof: EscrowRewards TotalStake (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) /// Storage: EscrowRewards RewardCurrencies (r:1 w:0) - /// Proof: EscrowRewards RewardCurrencies (max_values: None, max_size: Some(127), added: 2602, mode: MaxEncodedLen) + /// Proof: EscrowRewards RewardCurrencies (max_values: None, max_size: Some(28), added: 2503, mode: MaxEncodedLen) + /// Storage: EscrowRewards RewardTally (r:1 w:1) + /// Proof: EscrowRewards RewardTally (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: EscrowRewards RewardPerToken (r:1 w:0) + /// Proof: EscrowRewards RewardPerToken (max_values: None, max_size: Some(59), added: 2534, mode: MaxEncodedLen) /// Storage: Escrow SlopeChanges (r:97 w:0) /// Proof: Escrow SlopeChanges (max_values: None, max_size: Some(36), added: 2511, mode: MaxEncodedLen) /// Storage: Escrow Epoch (r:1 w:1) @@ -173,15 +189,33 @@ impl escrow::WeightInfo for WeightInfo { /// Proof: Escrow UserPointHistory (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen) fn withdraw () -> Weight { // Proof Size summary in bytes: - // Measured: `1455` - // Estimated: `282678` - // Minimum execution time: 847_706_000 picoseconds. - Weight::from_parts(869_922_000, 282678) - .saturating_add(T::DbWeight::get().reads(108_u64)) - .saturating_add(T::DbWeight::get().writes(107_u64)) + // Measured: `1902` + // Estimated: `244557` + // Minimum execution time: 681_896_000 picoseconds. + Weight::from_parts(684_381_000, 244557) + .saturating_add(T::DbWeight::get().reads(110_u64)) + .saturating_add(T::DbWeight::get().writes(108_u64)) + } + /// Storage: Escrow Limits (r:0 w:1) + /// Proof: Escrow Limits (max_values: None, max_size: Some(56), added: 2531, mode: MaxEncodedLen) + fn set_account_limit () -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 10_631_000 picoseconds. + Weight::from_parts(10_732_000, 0) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: Escrow Blocks (r:0 w:1) + /// Proof: Escrow Blocks (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) + fn set_account_block () -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 10_291_000 picoseconds. + Weight::from_parts(10_481_000, 0) + .saturating_add(T::DbWeight::get().writes(1_u64)) } - /// Storage: EscrowRewards Stake (r:1 w:1) - /// Proof: EscrowRewards Stake (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) /// Storage: Escrow Locked (r:1 w:1) /// Proof: Escrow Locked (max_values: None, max_size: Some(68), added: 2543, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:1 w:1) @@ -200,41 +234,21 @@ impl escrow::WeightInfo for WeightInfo { /// Proof: Escrow PointHistory (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen) /// Storage: Escrow UserPointEpoch (r:1 w:1) /// Proof: Escrow UserPointEpoch (max_values: None, max_size: Some(52), added: 2527, mode: MaxEncodedLen) + /// Storage: EscrowRewards Stake (r:1 w:1) + /// Proof: EscrowRewards Stake (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) /// Storage: EscrowRewards TotalStake (r:1 w:1) /// Proof: EscrowRewards TotalStake (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) /// Storage: EscrowRewards RewardCurrencies (r:1 w:0) - /// Proof: EscrowRewards RewardCurrencies (max_values: None, max_size: Some(127), added: 2602, mode: MaxEncodedLen) - /// Storage: Escrow ThresholdPercentage (r:1 w:0) - /// Proof: Escrow ThresholdPercentage (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) + /// Proof: EscrowRewards RewardCurrencies (max_values: None, max_size: Some(28), added: 2503, mode: MaxEncodedLen) /// Storage: Escrow UserPointHistory (r:0 w:1) /// Proof: Escrow UserPointHistory (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen) fn update_user_stake () -> Weight { // Proof Size summary in bytes: - // Measured: `1273` - // Estimated: `281542` - // Minimum execution time: 359_000_000 picoseconds. - Weight::from_parts(363_000_000, 281542) - .saturating_add(T::DbWeight::get().reads(108_u64)) - .saturating_add(T::DbWeight::get().writes(104_u64)) - } - - fn set_account_limit () -> Weight { - // Proof Size summary in bytes: - // Measured: `1273` - // Estimated: `281542` - // Minimum execution time: 359_000_000 picoseconds. - Weight::from_parts(363_000_000, 281542) - .saturating_add(T::DbWeight::get().reads(108_u64)) - .saturating_add(T::DbWeight::get().writes(104_u64)) - } - - fn set_account_block () -> Weight { - // Proof Size summary in bytes: - // Measured: `1273` - // Estimated: `281542` - // Minimum execution time: 359_000_000 picoseconds. - Weight::from_parts(363_000_000, 281542) - .saturating_add(T::DbWeight::get().reads(108_u64)) + // Measured: `1490` + // Estimated: `242046` + // Minimum execution time: 661_555_000 picoseconds. + Weight::from_parts(667_447_000, 242046) + .saturating_add(T::DbWeight::get().reads(107_u64)) .saturating_add(T::DbWeight::get().writes(104_u64)) } } \ No newline at end of file diff --git a/parachain/runtime/kintsugi/src/weights/farming.rs b/parachain/runtime/kintsugi/src/weights/farming.rs index 0e183f8620..1722a01b33 100644 --- a/parachain/runtime/kintsugi/src/weights/farming.rs +++ b/parachain/runtime/kintsugi/src/weights/farming.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for farming //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-kcxvd`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/kintsugi/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -47,15 +47,15 @@ impl farming::WeightInfo for WeightInfo { /// The range of component `c` is `[1, 4]`. fn on_initialize (c: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `189 + c * (41 ±0)` - // Estimated: `6342 + c * (3717 ±45)` - // Minimum execution time: 36_730_000 picoseconds. - Weight::from_parts(24_682_700, 6342) - // Standard Error: 165_655 - .saturating_add(Weight::from_parts(14_905_914, 0).saturating_mul(c.into())) + // Measured: `208 + c * (41 ±0)` + // Estimated: `3539 + c * (2549 ±0)` + // Minimum execution time: 28_858_000 picoseconds. + Weight::from_parts(18_114_846, 3539) + // Standard Error: 91_877 + .saturating_add(Weight::from_parts(12_423_979, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(c.into()))) - .saturating_add(Weight::from_parts(0, 3717).saturating_mul(c.into())) + .saturating_add(Weight::from_parts(0, 2549).saturating_mul(c.into())) } /// Storage: Tokens Accounts (r:2 w:2) /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) @@ -65,10 +65,10 @@ impl farming::WeightInfo for WeightInfo { /// Proof: Farming RewardSchedules (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) fn update_reward_schedule () -> Weight { // Proof Size summary in bytes: - // Measured: `435` - // Estimated: `13302` - // Minimum execution time: 118_144_000 picoseconds. - Weight::from_parts(133_960_000, 13302) + // Measured: `847` + // Estimated: `6170` + // Minimum execution time: 97_555_000 picoseconds. + Weight::from_parts(97_986_000, 6170) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -80,10 +80,10 @@ impl farming::WeightInfo for WeightInfo { /// Proof: Farming RewardSchedules (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) fn remove_reward_schedule () -> Weight { // Proof Size summary in bytes: - // Measured: `582` - // Estimated: `9763` - // Minimum execution time: 94_335_000 picoseconds. - Weight::from_parts(101_456_000, 9763) + // Measured: `945` + // Estimated: `6170` + // Minimum execution time: 76_313_000 picoseconds. + Weight::from_parts(76_793_000, 6170) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -102,17 +102,17 @@ impl farming::WeightInfo for WeightInfo { /// The range of component `c` is `[1, 4]`. fn deposit (c: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `683 + c * (70 ±0)` - // Estimated: `16211 + c * (5122 ±0)` - // Minimum execution time: 118_990_000 picoseconds. - Weight::from_parts(108_592_878, 16211) - // Standard Error: 360_926 - .saturating_add(Weight::from_parts(18_648_671, 0).saturating_mul(c.into())) + // Measured: `900 + c * (70 ±0)` + // Estimated: `3603 + c * (2577 ±0)` + // Minimum execution time: 92_445_000 picoseconds. + Weight::from_parts(81_740_057, 3603) + // Standard Error: 37_348 + .saturating_add(Weight::from_parts(12_635_191, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(c.into()))) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(c.into()))) - .saturating_add(Weight::from_parts(0, 5122).saturating_mul(c.into())) + .saturating_add(Weight::from_parts(0, 2577).saturating_mul(c.into())) } /// Storage: FarmingRewards RewardCurrencies (r:1 w:0) /// Proof: FarmingRewards RewardCurrencies (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) @@ -129,17 +129,17 @@ impl farming::WeightInfo for WeightInfo { /// The range of component `c` is `[1, 4]`. fn withdraw (c: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `683 + c * (70 ±0)` - // Estimated: `16211 + c * (5122 ±0)` - // Minimum execution time: 110_617_000 picoseconds. - Weight::from_parts(98_027_403, 16211) - // Standard Error: 283_984 - .saturating_add(Weight::from_parts(18_696_973, 0).saturating_mul(c.into())) + // Measured: `900 + c * (70 ±0)` + // Estimated: `3603 + c * (2577 ±0)` + // Minimum execution time: 85_862_000 picoseconds. + Weight::from_parts(74_571_773, 3603) + // Standard Error: 47_353 + .saturating_add(Weight::from_parts(12_753_635, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(c.into()))) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(c.into()))) - .saturating_add(Weight::from_parts(0, 5122).saturating_mul(c.into())) + .saturating_add(Weight::from_parts(0, 2577).saturating_mul(c.into())) } /// Storage: FarmingRewards Stake (r:1 w:0) /// Proof: FarmingRewards Stake (max_values: None, max_size: Some(75), added: 2550, mode: MaxEncodedLen) @@ -155,10 +155,10 @@ impl farming::WeightInfo for WeightInfo { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn claim () -> Weight { // Proof Size summary in bytes: - // Measured: `956` - // Estimated: `23913` - // Minimum execution time: 160_561_000 picoseconds. - Weight::from_parts(171_999_000, 23913) + // Measured: `1318` + // Estimated: `6170` + // Minimum execution time: 127_536_000 picoseconds. + Weight::from_parts(130_081_000, 6170) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } diff --git a/parachain/runtime/kintsugi/src/weights/fee.rs b/parachain/runtime/kintsugi/src/weights/fee.rs index b56e56275f..0829a577f0 100644 --- a/parachain/runtime/kintsugi/src/weights/fee.rs +++ b/parachain/runtime/kintsugi/src/weights/fee.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for fee //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-kcxvd`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/kintsugi/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -51,7 +51,7 @@ impl fee::WeightInfo for WeightInfo { /// Storage: VaultRewards TotalStake (r:1 w:0) /// Proof: VaultRewards TotalStake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) /// Storage: VaultRewards RewardCurrencies (r:1 w:1) - /// Proof: VaultRewards RewardCurrencies (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) + /// Proof: VaultRewards RewardCurrencies (max_values: None, max_size: Some(50), added: 2525, mode: MaxEncodedLen) /// Storage: VaultRewards RewardPerToken (r:2 w:2) /// Proof: VaultRewards RewardPerToken (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) /// Storage: VaultRewards TotalRewards (r:2 w:2) @@ -86,10 +86,10 @@ impl fee::WeightInfo for WeightInfo { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn withdraw_rewards () -> Weight { // Proof Size summary in bytes: - // Measured: `2602` - // Estimated: `111780` - // Minimum execution time: 754_264_000 picoseconds. - Weight::from_parts(767_173_000, 111780) + // Measured: `2962` + // Estimated: `11350` + // Minimum execution time: 590_372_000 picoseconds. + Weight::from_parts(594_450_000, 11350) .saturating_add(T::DbWeight::get().reads(35_u64)) .saturating_add(T::DbWeight::get().writes(25_u64)) } @@ -99,8 +99,8 @@ impl fee::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 10_847_000 picoseconds. - Weight::from_parts(11_537_000, 0) + // Minimum execution time: 8_747_000 picoseconds. + Weight::from_parts(9_008_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: Fee IssueGriefingCollateral (r:0 w:1) @@ -109,8 +109,8 @@ impl fee::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 10_990_000 picoseconds. - Weight::from_parts(11_634_000, 0) + // Minimum execution time: 8_737_000 picoseconds. + Weight::from_parts(8_998_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: Fee RedeemFee (r:0 w:1) @@ -119,8 +119,8 @@ impl fee::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 11_158_000 picoseconds. - Weight::from_parts(11_732_000, 0) + // Minimum execution time: 8_868_000 picoseconds. + Weight::from_parts(9_038_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: Fee PremiumRedeemFee (r:0 w:1) @@ -129,8 +129,8 @@ impl fee::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 11_054_000 picoseconds. - Weight::from_parts(11_731_000, 0) + // Minimum execution time: 8_757_000 picoseconds. + Weight::from_parts(8_957_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: Fee PunishmentFee (r:0 w:1) @@ -139,8 +139,8 @@ impl fee::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 11_047_000 picoseconds. - Weight::from_parts(12_013_000, 0) + // Minimum execution time: 8_948_000 picoseconds. + Weight::from_parts(9_099_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: Fee ReplaceGriefingCollateral (r:0 w:1) @@ -149,18 +149,21 @@ impl fee::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 10_872_000 picoseconds. - Weight::from_parts(11_479_000, 0) + // Minimum execution time: 8_858_000 picoseconds. + Weight::from_parts(9_028_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } + /// Storage: Nomination Vaults (r:1 w:0) + /// Proof: Nomination Vaults (max_values: None, max_size: Some(71), added: 2546, mode: MaxEncodedLen) /// Storage: Fee Commission (r:0 w:1) /// Proof: Fee Commission (max_values: None, max_size: Some(86), added: 2561, mode: MaxEncodedLen) fn set_commission () -> Weight { // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 14_132_000 picoseconds. - Weight::from_parts(14_831_000, 0) + // Measured: `167` + // Estimated: `3536` + // Minimum execution time: 19_309_000 picoseconds. + Weight::from_parts(19_509_000, 3536) + .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } } \ No newline at end of file diff --git a/parachain/runtime/kintsugi/src/weights/frame_system.rs b/parachain/runtime/kintsugi/src/weights/frame_system.rs index ef4cd08092..8c038c2c74 100644 --- a/parachain/runtime/kintsugi/src/weights/frame_system.rs +++ b/parachain/runtime/kintsugi/src/weights/frame_system.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for frame_system //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-kcxvd`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/kintsugi/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -45,20 +45,20 @@ impl frame_system::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 6_185_000 picoseconds. - Weight::from_parts(6_457_000, 0) - // Standard Error: 1 - .saturating_add(Weight::from_parts(676, 0).saturating_mul(b.into())) + // Minimum execution time: 4_750_000 picoseconds. + Weight::from_parts(15_710_877, 0) + // Standard Error: 14 + .saturating_add(Weight::from_parts(576, 0).saturating_mul(b.into())) } /// The range of component `b` is `[0, 3932160]`. fn remark_with_event (b: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 20_064_000 picoseconds. - Weight::from_parts(20_580_000, 0) - // Standard Error: 2 - .saturating_add(Weight::from_parts(2_705, 0).saturating_mul(b.into())) + // Minimum execution time: 15_521_000 picoseconds. + Weight::from_parts(15_681_000, 0) + // Standard Error: 7 + .saturating_add(Weight::from_parts(1_829, 0).saturating_mul(b.into())) } /// Storage: System Digest (r:1 w:1) /// Proof Skipped: System Digest (max_values: Some(1), max_size: None, mode: Measured) @@ -68,8 +68,8 @@ impl frame_system::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `1485` - // Minimum execution time: 11_596_000 picoseconds. - Weight::from_parts(12_481_000, 1485) + // Minimum execution time: 9_218_000 picoseconds. + Weight::from_parts(9_369_000, 1485) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -80,10 +80,10 @@ impl frame_system::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 6_243_000 picoseconds. - Weight::from_parts(6_294_000, 0) - // Standard Error: 3_877 - .saturating_add(Weight::from_parts(1_691_833, 0).saturating_mul(i.into())) + // Minimum execution time: 4_710_000 picoseconds. + Weight::from_parts(4_800_000, 0) + // Standard Error: 7_041 + .saturating_add(Weight::from_parts(1_289_318, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into()))) } /// Storage: Skipped Metadata (r:0 w:0) @@ -93,10 +93,10 @@ impl frame_system::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 6_147_000 picoseconds. - Weight::from_parts(6_203_000, 0) - // Standard Error: 2_228 - .saturating_add(Weight::from_parts(1_139_334, 0).saturating_mul(i.into())) + // Minimum execution time: 4_789_000 picoseconds. + Weight::from_parts(4_920_000, 0) + // Standard Error: 2_480 + .saturating_add(Weight::from_parts(867_765, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into()))) } /// Storage: Skipped Metadata (r:0 w:0) @@ -104,12 +104,12 @@ impl frame_system::WeightInfo for WeightInfo { /// The range of component `p` is `[0, 1000]`. fn kill_prefix (p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `98 + p * (69 ±0)` - // Estimated: `94 + p * (70 ±0)` - // Minimum execution time: 10_838_000 picoseconds. - Weight::from_parts(11_004_000, 94) - // Standard Error: 5_042 - .saturating_add(Weight::from_parts(2_160_326, 0).saturating_mul(p.into())) + // Measured: `124 + p * (69 ±0)` + // Estimated: `111 + p * (70 ±0)` + // Minimum execution time: 8_587_000 picoseconds. + Weight::from_parts(8_767_000, 111) + // Standard Error: 1_790 + .saturating_add(Weight::from_parts(1_508_078, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into()))) .saturating_add(Weight::from_parts(0, 70).saturating_mul(p.into())) diff --git a/parachain/runtime/kintsugi/src/weights/issue.rs b/parachain/runtime/kintsugi/src/weights/issue.rs index ac2222ea27..10f28c57a2 100644 --- a/parachain/runtime/kintsugi/src/weights/issue.rs +++ b/parachain/runtime/kintsugi/src/weights/issue.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for issue //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-kcxvd`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/kintsugi/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -48,8 +48,6 @@ impl issue::WeightInfo for WeightInfo { /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:1) /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: Oracle Aggregate (r:2 w:0) /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) /// Storage: Fee IssueGriefingCollateral (r:1 w:0) @@ -80,11 +78,11 @@ impl issue::WeightInfo for WeightInfo { /// Proof: Issue IssueRequests (max_values: None, max_size: Some(272), added: 2747, mode: MaxEncodedLen) fn request_issue () -> Weight { // Proof Size summary in bytes: - // Measured: `2485` - // Estimated: `43976` - // Minimum execution time: 814_670_000 picoseconds. - Weight::from_parts(855_324_000, 43976) - .saturating_add(T::DbWeight::get().reads(19_u64)) + // Measured: `2718` + // Estimated: `6028` + // Minimum execution time: 558_298_000 picoseconds. + Weight::from_parts(565_393_000, 6028) + .saturating_add(T::DbWeight::get().reads(18_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } /// Storage: Issue IssueRequests (r:1 w:1) @@ -117,18 +115,18 @@ impl issue::WeightInfo for WeightInfo { /// The range of component `b` is `[770, 2048]`. fn execute_issue_exact (h: u32, i: u32, o: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `2196` - // Estimated: `32731` - // Minimum execution time: 258_357_000 picoseconds. - Weight::from_parts(229_089_248, 32731) - // Standard Error: 163_921 - .saturating_add(Weight::from_parts(6_691_991, 0).saturating_mul(h.into())) - // Standard Error: 147_709 - .saturating_add(Weight::from_parts(1_729_821, 0).saturating_mul(i.into())) - // Standard Error: 147_709 - .saturating_add(Weight::from_parts(601_182, 0).saturating_mul(o.into())) - // Standard Error: 1_059 - .saturating_add(Weight::from_parts(6_098, 0).saturating_mul(b.into())) + // Measured: `2434` + // Estimated: `3737` + // Minimum execution time: 198_538_000 picoseconds. + Weight::from_parts(171_478_384, 3737) + // Standard Error: 67_279 + .saturating_add(Weight::from_parts(3_496_696, 0).saturating_mul(h.into())) + // Standard Error: 60_626 + .saturating_add(Weight::from_parts(794_967, 0).saturating_mul(i.into())) + // Standard Error: 60_626 + .saturating_add(Weight::from_parts(420_219, 0).saturating_mul(o.into())) + // Standard Error: 435 + .saturating_add(Weight::from_parts(5_157, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(12_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -152,8 +150,6 @@ impl issue::WeightInfo for WeightInfo { /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: Oracle Aggregate (r:1 w:0) /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) /// Storage: VaultStaking Nonce (r:1 w:0) @@ -174,19 +170,19 @@ impl issue::WeightInfo for WeightInfo { /// The range of component `b` is `[770, 2048]`. fn execute_issue_overpayment (h: u32, i: u32, o: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `3018` - // Estimated: `49856` - // Minimum execution time: 417_315_000 picoseconds. - Weight::from_parts(426_906_569, 49856) - // Standard Error: 220_929 - .saturating_add(Weight::from_parts(7_225_197, 0).saturating_mul(h.into())) - // Standard Error: 199_079 - .saturating_add(Weight::from_parts(393_016, 0).saturating_mul(i.into())) - // Standard Error: 199_079 - .saturating_add(Weight::from_parts(13_273, 0).saturating_mul(o.into())) - // Standard Error: 1_428 - .saturating_add(Weight::from_parts(257, 0).saturating_mul(b.into())) - .saturating_add(T::DbWeight::get().reads(18_u64)) + // Measured: `3285` + // Estimated: `3737` + // Minimum execution time: 316_013_000 picoseconds. + Weight::from_parts(296_206_373, 3737) + // Standard Error: 170_956 + .saturating_add(Weight::from_parts(3_648_998, 0).saturating_mul(h.into())) + // Standard Error: 154_049 + .saturating_add(Weight::from_parts(965_687, 0).saturating_mul(i.into())) + // Standard Error: 154_049 + .saturating_add(Weight::from_parts(440_368, 0).saturating_mul(o.into())) + // Standard Error: 1_105 + .saturating_add(Weight::from_parts(1_242, 0).saturating_mul(b.into())) + .saturating_add(T::DbWeight::get().reads(17_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } /// Storage: Issue IssueRequests (r:1 w:1) @@ -219,20 +215,18 @@ impl issue::WeightInfo for WeightInfo { /// The range of component `i` is `[1, 10]`. /// The range of component `o` is `[1, 10]`. /// The range of component `b` is `[770, 2048]`. - fn execute_issue_underpayment (h: u32, i: u32, o: u32, b: u32, ) -> Weight { + fn execute_issue_underpayment (h: u32, i: u32, o: u32, _b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `2449` - // Estimated: `34232` - // Minimum execution time: 307_256_000 picoseconds. - Weight::from_parts(293_418_122, 34232) - // Standard Error: 194_866 - .saturating_add(Weight::from_parts(6_661_934, 0).saturating_mul(h.into())) - // Standard Error: 175_594 - .saturating_add(Weight::from_parts(781_581, 0).saturating_mul(i.into())) - // Standard Error: 175_594 - .saturating_add(Weight::from_parts(408_936, 0).saturating_mul(o.into())) - // Standard Error: 1_260 - .saturating_add(Weight::from_parts(5_842, 0).saturating_mul(b.into())) + // Measured: `2739` + // Estimated: `3737` + // Minimum execution time: 236_814_000 picoseconds. + Weight::from_parts(218_087_002, 3737) + // Standard Error: 143_849 + .saturating_add(Weight::from_parts(3_739_468, 0).saturating_mul(h.into())) + // Standard Error: 129_622 + .saturating_add(Weight::from_parts(1_289_008, 0).saturating_mul(i.into())) + // Standard Error: 129_622 + .saturating_add(Weight::from_parts(452_541, 0).saturating_mul(o.into())) .saturating_add(T::DbWeight::get().reads(13_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -266,18 +260,18 @@ impl issue::WeightInfo for WeightInfo { /// The range of component `b` is `[770, 2048]`. fn execute_expired_issue_exact (h: u32, i: u32, o: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `3119 + o * (8 ±0)` - // Estimated: `32731` - // Minimum execution time: 321_847_000 picoseconds. - Weight::from_parts(307_881_120, 32731) - // Standard Error: 116_140 - .saturating_add(Weight::from_parts(2_633_088, 0).saturating_mul(h.into())) - // Standard Error: 104_654 - .saturating_add(Weight::from_parts(1_883_088, 0).saturating_mul(i.into())) - // Standard Error: 104_654 - .saturating_add(Weight::from_parts(516_606, 0).saturating_mul(o.into())) - // Standard Error: 751 - .saturating_add(Weight::from_parts(7_190, 0).saturating_mul(b.into())) + // Measured: `3567` + // Estimated: `3737` + // Minimum execution time: 206_463_000 picoseconds. + Weight::from_parts(179_023_981, 3737) + // Standard Error: 118_695 + .saturating_add(Weight::from_parts(3_632_454, 0).saturating_mul(h.into())) + // Standard Error: 106_956 + .saturating_add(Weight::from_parts(825_036, 0).saturating_mul(i.into())) + // Standard Error: 106_956 + .saturating_add(Weight::from_parts(185_589, 0).saturating_mul(o.into())) + // Standard Error: 767 + .saturating_add(Weight::from_parts(6_936, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(12_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -301,8 +295,6 @@ impl issue::WeightInfo for WeightInfo { /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: Oracle Aggregate (r:1 w:0) /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) /// Storage: VaultStaking Nonce (r:1 w:0) @@ -321,17 +313,21 @@ impl issue::WeightInfo for WeightInfo { /// The range of component `i` is `[1, 10]`. /// The range of component `o` is `[1, 10]`. /// The range of component `b` is `[770, 2048]`. - fn execute_expired_issue_overpayment (h: u32, i: u32, _o: u32, _b: u32, ) -> Weight { + fn execute_expired_issue_overpayment (h: u32, i: u32, o: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `3787 + i * (9 ±0)` - // Estimated: `49856` - // Minimum execution time: 509_824_000 picoseconds. - Weight::from_parts(524_007_287, 49856) - // Standard Error: 167_179 - .saturating_add(Weight::from_parts(2_125_670, 0).saturating_mul(h.into())) - // Standard Error: 150_645 - .saturating_add(Weight::from_parts(1_433_567, 0).saturating_mul(i.into())) - .saturating_add(T::DbWeight::get().reads(18_u64)) + // Measured: `4039 + h * (17 ±0) + i * (2 ±0)` + // Estimated: `3737` + // Minimum execution time: 326_534_000 picoseconds. + Weight::from_parts(312_629_634, 3737) + // Standard Error: 118_522 + .saturating_add(Weight::from_parts(3_380_960, 0).saturating_mul(h.into())) + // Standard Error: 106_800 + .saturating_add(Weight::from_parts(561_891, 0).saturating_mul(i.into())) + // Standard Error: 106_800 + .saturating_add(Weight::from_parts(164_257, 0).saturating_mul(o.into())) + // Standard Error: 766 + .saturating_add(Weight::from_parts(3_419, 0).saturating_mul(b.into())) + .saturating_add(T::DbWeight::get().reads(17_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } /// Storage: Issue IssueRequests (r:1 w:1) @@ -366,18 +362,18 @@ impl issue::WeightInfo for WeightInfo { /// The range of component `b` is `[770, 2048]`. fn execute_expired_issue_underpayment (h: u32, i: u32, o: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `3256 + h * (9 ±0) + i * (13 ±0)` - // Estimated: `34232` - // Minimum execution time: 389_642_000 picoseconds. - Weight::from_parts(379_986_977, 34232) - // Standard Error: 121_056 - .saturating_add(Weight::from_parts(2_111_609, 0).saturating_mul(h.into())) - // Standard Error: 109_084 - .saturating_add(Weight::from_parts(1_421_025, 0).saturating_mul(i.into())) - // Standard Error: 109_084 - .saturating_add(Weight::from_parts(541_226, 0).saturating_mul(o.into())) - // Standard Error: 782 - .saturating_add(Weight::from_parts(3_847, 0).saturating_mul(b.into())) + // Measured: `3633 + o * (11 ±0)` + // Estimated: `3737` + // Minimum execution time: 245_292_000 picoseconds. + Weight::from_parts(218_248_263, 3737) + // Standard Error: 75_656 + .saturating_add(Weight::from_parts(3_638_323, 0).saturating_mul(h.into())) + // Standard Error: 68_174 + .saturating_add(Weight::from_parts(1_189_484, 0).saturating_mul(i.into())) + // Standard Error: 68_174 + .saturating_add(Weight::from_parts(378_537, 0).saturating_mul(o.into())) + // Standard Error: 489 + .saturating_add(Weight::from_parts(4_279, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(13_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -393,10 +389,10 @@ impl issue::WeightInfo for WeightInfo { /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) fn cancel_issue () -> Weight { // Proof Size summary in bytes: - // Measured: `1496` - // Estimated: `11929` - // Minimum execution time: 173_735_000 picoseconds. - Weight::from_parts(181_182_000, 11929) + // Measured: `1495` + // Estimated: `3737` + // Minimum execution time: 91_653_000 picoseconds. + Weight::from_parts(93_397_000, 3737) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -406,8 +402,8 @@ impl issue::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 23_418_000 picoseconds. - Weight::from_parts(24_350_000, 0) + // Minimum execution time: 18_417_000 picoseconds. + Weight::from_parts(18_597_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } } \ No newline at end of file diff --git a/parachain/runtime/kintsugi/src/weights/loans.rs b/parachain/runtime/kintsugi/src/weights/loans.rs index d0a1374a8d..3b4ad2cf10 100644 --- a/parachain/runtime/kintsugi/src/weights/loans.rs +++ b/parachain/runtime/kintsugi/src/weights/loans.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for loans //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-kcxvd`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/kintsugi/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -53,9 +53,9 @@ impl loans::WeightInfo for WeightInfo { fn add_market () -> Weight { // Proof Size summary in bytes: // Measured: `78` - // Estimated: `11264` - // Minimum execution time: 70_297_000 picoseconds. - Weight::from_parts(77_026_000, 11264) + // Estimated: `6260` + // Minimum execution time: 55_221_000 picoseconds. + Weight::from_parts(55_742_000, 6260) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -65,8 +65,8 @@ impl loans::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `343` // Estimated: `3625` - // Minimum execution time: 35_711_000 picoseconds. - Weight::from_parts(38_488_000, 3625) + // Minimum execution time: 27_365_000 picoseconds. + Weight::from_parts(27_936_000, 3625) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -76,8 +76,8 @@ impl loans::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `343` // Estimated: `3625` - // Minimum execution time: 37_390_000 picoseconds. - Weight::from_parts(40_074_000, 3625) + // Minimum execution time: 28_928_000 picoseconds. + Weight::from_parts(29_940_000, 3625) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -87,8 +87,8 @@ impl loans::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `343` // Estimated: `3625` - // Minimum execution time: 41_759_000 picoseconds. - Weight::from_parts(43_543_000, 3625) + // Minimum execution time: 32_194_000 picoseconds. + Weight::from_parts(32_676_000, 3625) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -99,9 +99,9 @@ impl loans::WeightInfo for WeightInfo { fn force_update_market () -> Weight { // Proof Size summary in bytes: // Measured: `354` - // Estimated: `7128` - // Minimum execution time: 50_832_000 picoseconds. - Weight::from_parts(53_132_000, 7128) + // Estimated: `3625` + // Minimum execution time: 39_650_000 picoseconds. + Weight::from_parts(40_211_000, 3625) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -111,10 +111,10 @@ impl loans::WeightInfo for WeightInfo { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn add_reward () -> Weight { // Proof Size summary in bytes: - // Measured: `490` - // Estimated: `9763` - // Minimum execution time: 101_577_000 picoseconds. - Weight::from_parts(104_741_000, 9763) + // Measured: `821` + // Estimated: `6170` + // Minimum execution time: 85_942_000 picoseconds. + Weight::from_parts(86_864_000, 6170) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -131,9 +131,9 @@ impl loans::WeightInfo for WeightInfo { fn update_market_reward_speed () -> Weight { // Proof Size summary in bytes: // Measured: `357` - // Estimated: `20300` - // Minimum execution time: 83_498_000 picoseconds. - Weight::from_parts(84_524_000, 20300) + // Estimated: `6260` + // Minimum execution time: 64_088_000 picoseconds. + Weight::from_parts(64_479_000, 6260) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -167,10 +167,10 @@ impl loans::WeightInfo for WeightInfo { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn claim_reward () -> Weight { // Proof Size summary in bytes: - // Measured: `1808` - // Estimated: `57382` - // Minimum execution time: 268_339_000 picoseconds. - Weight::from_parts(289_641_000, 57382) + // Measured: `2066` + // Estimated: `8760` + // Minimum execution time: 207_856_000 picoseconds. + Weight::from_parts(209_128_000, 8760) .saturating_add(T::DbWeight::get().reads(17_u64)) .saturating_add(T::DbWeight::get().writes(7_u64)) } @@ -204,10 +204,10 @@ impl loans::WeightInfo for WeightInfo { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn claim_reward_for_market () -> Weight { // Proof Size summary in bytes: - // Measured: `1808` - // Estimated: `54747` - // Minimum execution time: 251_481_000 picoseconds. - Weight::from_parts(262_703_000, 54747) + // Measured: `2066` + // Estimated: `8760` + // Minimum execution time: 196_654_000 picoseconds. + Weight::from_parts(199_430_000, 8760) .saturating_add(T::DbWeight::get().reads(16_u64)) .saturating_add(T::DbWeight::get().writes(7_u64)) } @@ -243,10 +243,10 @@ impl loans::WeightInfo for WeightInfo { /// Proof: Loans AccountDeposits (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) fn mint () -> Weight { // Proof Size summary in bytes: - // Measured: `1188` - // Estimated: `56787` - // Minimum execution time: 366_030_000 picoseconds. - Weight::from_parts(379_785_000, 56787) + // Measured: `1481` + // Estimated: `8760` + // Minimum execution time: 284_911_000 picoseconds. + Weight::from_parts(286_594_000, 8760) .saturating_add(T::DbWeight::get().reads(18_u64)) .saturating_add(T::DbWeight::get().writes(9_u64)) } @@ -288,10 +288,10 @@ impl loans::WeightInfo for WeightInfo { /// Proof: Loans BorrowIndex (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) fn borrow () -> Weight { // Proof Size summary in bytes: - // Measured: `1698` - // Estimated: `62778` - // Minimum execution time: 349_521_000 picoseconds. - Weight::from_parts(356_928_000, 62778) + // Measured: `1991` + // Estimated: `6260` + // Minimum execution time: 265_201_000 picoseconds. + Weight::from_parts(267_325_000, 6260) .saturating_add(T::DbWeight::get().reads(20_u64)) .saturating_add(T::DbWeight::get().writes(8_u64)) } @@ -329,10 +329,10 @@ impl loans::WeightInfo for WeightInfo { /// Proof: Loans RewardAccrued (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) fn redeem () -> Weight { // Proof Size summary in bytes: - // Measured: `1723` - // Estimated: `58288` - // Minimum execution time: 438_880_000 picoseconds. - Weight::from_parts(444_590_000, 58288) + // Measured: `2016` + // Estimated: `8760` + // Minimum execution time: 345_392_000 picoseconds. + Weight::from_parts(346_684_000, 8760) .saturating_add(T::DbWeight::get().reads(19_u64)) .saturating_add(T::DbWeight::get().writes(8_u64)) } @@ -370,10 +370,10 @@ impl loans::WeightInfo for WeightInfo { /// Proof: Loans RewardAccrued (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) fn redeem_all () -> Weight { // Proof Size summary in bytes: - // Measured: `1723` - // Estimated: `58288` - // Minimum execution time: 445_559_000 picoseconds. - Weight::from_parts(457_766_000, 58288) + // Measured: `2016` + // Estimated: `8760` + // Minimum execution time: 347_676_000 picoseconds. + Weight::from_parts(351_133_000, 8760) .saturating_add(T::DbWeight::get().reads(19_u64)) .saturating_add(T::DbWeight::get().writes(8_u64)) } @@ -401,10 +401,10 @@ impl loans::WeightInfo for WeightInfo { /// Proof: Loans TotalBorrows (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) fn repay_borrow () -> Weight { // Proof Size summary in bytes: - // Measured: `1620` - // Estimated: `42116` - // Minimum execution time: 230_178_000 picoseconds. - Weight::from_parts(233_446_000, 42116) + // Measured: `1875` + // Estimated: `6260` + // Minimum execution time: 173_257_000 picoseconds. + Weight::from_parts(179_420_000, 6260) .saturating_add(T::DbWeight::get().reads(13_u64)) .saturating_add(T::DbWeight::get().writes(8_u64)) } @@ -432,10 +432,10 @@ impl loans::WeightInfo for WeightInfo { /// Proof: Loans TotalBorrows (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) fn repay_borrow_all () -> Weight { // Proof Size summary in bytes: - // Measured: `1620` - // Estimated: `42116` - // Minimum execution time: 252_936_000 picoseconds. - Weight::from_parts(268_865_000, 42116) + // Measured: `1875` + // Estimated: `6260` + // Minimum execution time: 195_352_000 picoseconds. + Weight::from_parts(198_989_000, 6260) .saturating_add(T::DbWeight::get().reads(13_u64)) .saturating_add(T::DbWeight::get().writes(8_u64)) } @@ -449,10 +449,10 @@ impl loans::WeightInfo for WeightInfo { /// Proof: Loans AccountDeposits (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) fn deposit_all_collateral () -> Weight { // Proof Size summary in bytes: - // Measured: `967` - // Estimated: `16899` - // Minimum execution time: 125_959_000 picoseconds. - Weight::from_parts(131_088_000, 16899) + // Measured: `1184` + // Estimated: `6260` + // Minimum execution time: 96_693_000 picoseconds. + Weight::from_parts(98_488_000, 6260) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -484,10 +484,10 @@ impl loans::WeightInfo for WeightInfo { /// Proof: Loans AccountBorrows (max_values: None, max_size: Some(107), added: 2582, mode: MaxEncodedLen) fn withdraw_all_collateral () -> Weight { // Proof Size summary in bytes: - // Measured: `1628` - // Estimated: `45165` - // Minimum execution time: 290_826_000 picoseconds. - Weight::from_parts(307_097_000, 45165) + // Measured: `1921` + // Estimated: `6260` + // Minimum execution time: 226_734_000 picoseconds. + Weight::from_parts(229_600_000, 6260) .saturating_add(T::DbWeight::get().reads(15_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -515,8 +515,6 @@ impl loans::WeightInfo for WeightInfo { /// Proof: Loans MinExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: Loans MaxExchangeRate (r:1 w:0) /// Proof: Loans MaxExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: Oracle Aggregate (r:1 w:0) /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) /// Storage: Loans AccountBorrows (r:3 w:1) @@ -539,11 +537,11 @@ impl loans::WeightInfo for WeightInfo { /// Proof: Loans RewardSupplierIndex (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) fn liquidate_borrow () -> Weight { // Proof Size summary in bytes: - // Measured: `3348` - // Estimated: `127253` - // Minimum execution time: 1_282_053_000 picoseconds. - Weight::from_parts(1_327_267_000, 127253) - .saturating_add(T::DbWeight::get().reads(44_u64)) + // Measured: `3610` + // Estimated: `16530` + // Minimum execution time: 803_780_000 picoseconds. + Weight::from_parts(830_373_000, 16530) + .saturating_add(T::DbWeight::get().reads(43_u64)) .saturating_add(T::DbWeight::get().writes(21_u64)) } /// Storage: Loans Markets (r:2 w:0) @@ -580,10 +578,10 @@ impl loans::WeightInfo for WeightInfo { /// Proof: Loans RewardAccrued (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) fn reduce_incentive_reserves () -> Weight { // Proof Size summary in bytes: - // Measured: `2653` - // Estimated: `63481` - // Minimum execution time: 577_697_000 picoseconds. - Weight::from_parts(618_245_000, 63481) + // Measured: `2949` + // Estimated: `11350` + // Minimum execution time: 441_074_000 picoseconds. + Weight::from_parts(442_466_000, 11350) .saturating_add(T::DbWeight::get().reads(21_u64)) .saturating_add(T::DbWeight::get().writes(10_u64)) } @@ -601,10 +599,10 @@ impl loans::WeightInfo for WeightInfo { /// Proof: Loans TotalReserves (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) fn add_reserves () -> Weight { // Proof Size summary in bytes: - // Measured: `1012` - // Estimated: `24524` - // Minimum execution time: 159_083_000 picoseconds. - Weight::from_parts(167_413_000, 24524) + // Measured: `1305` + // Estimated: `6260` + // Minimum execution time: 123_878_000 picoseconds. + Weight::from_parts(124_660_000, 6260) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -622,10 +620,10 @@ impl loans::WeightInfo for WeightInfo { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) fn reduce_reserves () -> Weight { // Proof Size summary in bytes: - // Measured: `1243` - // Estimated: `24524` - // Minimum execution time: 142_174_000 picoseconds. - Weight::from_parts(151_776_000, 24524) + // Measured: `1536` + // Estimated: `6260` + // Minimum execution time: 107_725_000 picoseconds. + Weight::from_parts(108_537_000, 6260) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } diff --git a/parachain/runtime/kintsugi/src/weights/mod.rs b/parachain/runtime/kintsugi/src/weights/mod.rs index 9c557d49d7..792af080bb 100644 --- a/parachain/runtime/kintsugi/src/weights/mod.rs +++ b/parachain/runtime/kintsugi/src/weights/mod.rs @@ -34,7 +34,6 @@ pub mod pallet_xcm; pub mod pallet_xcm_benchmarks_fungible; pub mod pallet_xcm_benchmarks_generic; pub mod redeem; -pub mod replace; pub mod security; pub mod supply; pub mod tx_pause; diff --git a/parachain/runtime/kintsugi/src/weights/nomination.rs b/parachain/runtime/kintsugi/src/weights/nomination.rs index 81514a23ce..5c9825279e 100644 --- a/parachain/runtime/kintsugi/src/weights/nomination.rs +++ b/parachain/runtime/kintsugi/src/weights/nomination.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for nomination //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-kcxvd`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/kintsugi/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -46,25 +46,20 @@ impl nomination::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 10_494_000 picoseconds. - Weight::from_parts(11_404_000, 0) + // Minimum execution time: 8_698_000 picoseconds. + Weight::from_parts(8_858_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: Nomination NominationLimit (r:0 w:1) /// Proof: Nomination NominationLimit (max_values: None, max_size: Some(86), added: 2561, mode: MaxEncodedLen) fn set_nomination_limit () -> Weight { // Proof Size summary in bytes: - // Measured: `126` - // Estimated: `1486` - // Minimum execution time: 26_907_000 picoseconds. - Weight::from_parts(28_499_000, 1486) - .saturating_add(T::DbWeight::get().reads(1_u64)) + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 12_535_000 picoseconds. + Weight::from_parts(12_716_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: Nomination NominationEnabled (r:1 w:0) /// Proof: Nomination NominationEnabled (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:0) @@ -73,15 +68,13 @@ impl nomination::WeightInfo for WeightInfo { /// Proof: Nomination Vaults (max_values: None, max_size: Some(71), added: 2546, mode: MaxEncodedLen) fn opt_in_to_nomination () -> Weight { // Proof Size summary in bytes: - // Measured: `767` - // Estimated: `10233` - // Minimum execution time: 70_702_000 picoseconds. - Weight::from_parts(72_928_000, 10233) - .saturating_add(T::DbWeight::get().reads(4_u64)) + // Measured: `642` + // Estimated: `3725` + // Minimum execution time: 44_139_000 picoseconds. + Weight::from_parts(44_489_000, 3725) + .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: Nomination Vaults (r:1 w:1) /// Proof: Nomination Vaults (max_values: None, max_size: Some(71), added: 2546, mode: MaxEncodedLen) /// Storage: VaultStaking Nonce (r:1 w:1) @@ -154,15 +147,13 @@ impl nomination::WeightInfo for WeightInfo { /// Proof: VaultRegistry TotalUserVaultCollateral (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) fn opt_out_of_nomination () -> Weight { // Proof Size summary in bytes: - // Measured: `4345` - // Estimated: `166107` - // Minimum execution time: 923_485_000 picoseconds. - Weight::from_parts(956_978_000, 166107) - .saturating_add(T::DbWeight::get().reads(54_u64)) + // Measured: `4568` + // Estimated: `11486` + // Minimum execution time: 712_978_000 picoseconds. + Weight::from_parts(716_875_000, 11486) + .saturating_add(T::DbWeight::get().reads(53_u64)) .saturating_add(T::DbWeight::get().writes(26_u64)) } - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: VaultStaking Nonce (r:1 w:0) /// Proof: VaultStaking Nonce (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) /// Storage: VaultStaking TotalCurrentStake (r:1 w:1) @@ -205,18 +196,24 @@ impl nomination::WeightInfo for WeightInfo { /// Proof: VaultCapacity RewardTally (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) /// Storage: VaultCapacity TotalRewards (r:2 w:2) /// Proof: VaultCapacity TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: VaultRewards TotalStake (r:1 w:1) + /// Proof: VaultRewards TotalStake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: VaultRewards RewardCurrencies (r:1 w:1) + /// Proof: VaultRewards RewardCurrencies (max_values: None, max_size: Some(50), added: 2525, mode: MaxEncodedLen) + /// Storage: VaultRewards RewardPerToken (r:2 w:2) + /// Proof: VaultRewards RewardPerToken (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) + /// Storage: VaultRewards TotalRewards (r:2 w:2) + /// Proof: VaultRewards TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) /// Storage: VaultRewards Stake (r:1 w:1) /// Proof: VaultRewards Stake (max_values: None, max_size: Some(97), added: 2572, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardPerToken (r:2 w:0) - /// Proof: VaultRewards RewardPerToken (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) /// Storage: VaultRewards RewardTally (r:2 w:2) /// Proof: VaultRewards RewardTally (max_values: None, max_size: Some(124), added: 2599, mode: MaxEncodedLen) - /// Storage: VaultRewards TotalRewards (r:2 w:2) - /// Proof: VaultRewards TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) /// Storage: Fee Commission (r:1 w:0) /// Proof: Fee Commission (max_values: None, max_size: Some(86), added: 2561, mode: MaxEncodedLen) /// Storage: VaultStaking RewardPerToken (r:2 w:2) /// Proof: VaultStaking RewardPerToken (max_values: None, max_size: Some(117), added: 2592, mode: MaxEncodedLen) + /// Storage: VaultStaking TotalRewards (r:2 w:2) + /// Proof: VaultStaking TotalRewards (max_values: None, max_size: Some(117), added: 2592, mode: MaxEncodedLen) /// Storage: VaultStaking TotalStake (r:1 w:1) /// Proof: VaultStaking TotalStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) /// Storage: VaultStaking RewardTally (r:2 w:2) @@ -225,10 +222,6 @@ impl nomination::WeightInfo for WeightInfo { /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: VaultRewards TotalStake (r:1 w:1) - /// Proof: VaultRewards TotalStake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardCurrencies (r:1 w:0) - /// Proof: VaultRewards RewardCurrencies (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) /// Storage: Loans LastAccruedInterestTime (r:1 w:1) @@ -248,22 +241,20 @@ impl nomination::WeightInfo for WeightInfo { /// Storage: VaultCapacity TotalStake (r:1 w:1) /// Proof: VaultCapacity TotalStake (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) /// Storage: VaultCapacity RewardCurrencies (r:1 w:0) - /// Proof: VaultCapacity RewardCurrencies (max_values: None, max_size: Some(127), added: 2602, mode: MaxEncodedLen) + /// Proof: VaultCapacity RewardCurrencies (max_values: None, max_size: Some(39), added: 2514, mode: MaxEncodedLen) /// Storage: VaultRegistry TotalUserVaultCollateral (r:1 w:1) /// Proof: VaultRegistry TotalUserVaultCollateral (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) /// Storage: VaultRegistry SystemCollateralCeiling (r:1 w:0) /// Proof: VaultRegistry SystemCollateralCeiling (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) fn deposit_collateral () -> Weight { // Proof Size summary in bytes: - // Measured: `5203` - // Estimated: `194221` - // Minimum execution time: 935_213_000 picoseconds. - Weight::from_parts(1_003_816_000, 194221) - .saturating_add(T::DbWeight::get().reads(62_u64)) - .saturating_add(T::DbWeight::get().writes(29_u64)) + // Measured: `5749` + // Estimated: `8760` + // Minimum execution time: 858_288_000 picoseconds. + Weight::from_parts(864_521_000, 8760) + .saturating_add(T::DbWeight::get().reads(63_u64)) + .saturating_add(T::DbWeight::get().writes(34_u64)) } - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: VaultStaking Nonce (r:1 w:0) /// Proof: VaultStaking Nonce (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:0) @@ -302,8 +293,6 @@ impl nomination::WeightInfo for WeightInfo { /// Proof: Nomination NominationEnabled (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: Nomination Vaults (r:1 w:0) /// Proof: Nomination Vaults (max_values: None, max_size: Some(71), added: 2546, mode: MaxEncodedLen) - /// Storage: VaultRegistry TotalUserVaultCollateral (r:1 w:1) - /// Proof: VaultRegistry TotalUserVaultCollateral (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) /// Storage: VaultCapacity Stake (r:1 w:1) /// Proof: VaultCapacity Stake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) /// Storage: VaultCapacity RewardPerToken (r:2 w:0) @@ -312,18 +301,24 @@ impl nomination::WeightInfo for WeightInfo { /// Proof: VaultCapacity RewardTally (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) /// Storage: VaultCapacity TotalRewards (r:2 w:2) /// Proof: VaultCapacity TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: VaultRewards TotalStake (r:1 w:1) + /// Proof: VaultRewards TotalStake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: VaultRewards RewardCurrencies (r:1 w:1) + /// Proof: VaultRewards RewardCurrencies (max_values: None, max_size: Some(50), added: 2525, mode: MaxEncodedLen) + /// Storage: VaultRewards RewardPerToken (r:2 w:2) + /// Proof: VaultRewards RewardPerToken (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) + /// Storage: VaultRewards TotalRewards (r:2 w:2) + /// Proof: VaultRewards TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) /// Storage: VaultRewards Stake (r:1 w:1) /// Proof: VaultRewards Stake (max_values: None, max_size: Some(97), added: 2572, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardPerToken (r:2 w:0) - /// Proof: VaultRewards RewardPerToken (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) /// Storage: VaultRewards RewardTally (r:2 w:2) /// Proof: VaultRewards RewardTally (max_values: None, max_size: Some(124), added: 2599, mode: MaxEncodedLen) - /// Storage: VaultRewards TotalRewards (r:2 w:2) - /// Proof: VaultRewards TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) /// Storage: Fee Commission (r:1 w:0) /// Proof: Fee Commission (max_values: None, max_size: Some(86), added: 2561, mode: MaxEncodedLen) /// Storage: VaultStaking RewardPerToken (r:2 w:2) /// Proof: VaultStaking RewardPerToken (max_values: None, max_size: Some(117), added: 2592, mode: MaxEncodedLen) + /// Storage: VaultStaking TotalRewards (r:2 w:2) + /// Proof: VaultStaking TotalRewards (max_values: None, max_size: Some(117), added: 2592, mode: MaxEncodedLen) /// Storage: VaultStaking Stake (r:1 w:1) /// Proof: VaultStaking Stake (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) /// Storage: VaultStaking SlashPerToken (r:1 w:0) @@ -334,14 +329,10 @@ impl nomination::WeightInfo for WeightInfo { /// Proof: VaultStaking TotalStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) /// Storage: VaultStaking RewardTally (r:2 w:2) /// Proof: VaultStaking RewardTally (max_values: None, max_size: Some(149), added: 2624, mode: MaxEncodedLen) - /// Storage: VaultRewards TotalStake (r:1 w:1) - /// Proof: VaultRewards TotalStake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardCurrencies (r:1 w:0) - /// Proof: VaultRewards RewardCurrencies (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) /// Storage: VaultCapacity TotalStake (r:1 w:1) /// Proof: VaultCapacity TotalStake (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) /// Storage: VaultCapacity RewardCurrencies (r:1 w:0) - /// Proof: VaultCapacity RewardCurrencies (max_values: None, max_size: Some(127), added: 2602, mode: MaxEncodedLen) + /// Proof: VaultCapacity RewardCurrencies (max_values: None, max_size: Some(39), added: 2514, mode: MaxEncodedLen) /// Storage: Loans RewardSupplyState (r:1 w:1) /// Proof: Loans RewardSupplyState (max_values: None, max_size: Some(47), added: 2522, mode: MaxEncodedLen) /// Storage: Loans RewardSupplySpeed (r:1 w:0) @@ -352,13 +343,15 @@ impl nomination::WeightInfo for WeightInfo { /// Proof: Loans RewardAccrued (max_values: None, max_size: Some(64), added: 2539, mode: MaxEncodedLen) /// Storage: Loans AccountDeposits (r:1 w:0) /// Proof: Loans AccountDeposits (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: VaultRegistry TotalUserVaultCollateral (r:1 w:1) + /// Proof: VaultRegistry TotalUserVaultCollateral (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) fn withdraw_collateral () -> Weight { // Proof Size summary in bytes: - // Measured: `5540` - // Estimated: `185433` - // Minimum execution time: 1_009_954_000 picoseconds. - Weight::from_parts(1_033_867_000, 185433) - .saturating_add(T::DbWeight::get().reads(59_u64)) - .saturating_add(T::DbWeight::get().writes(29_u64)) + // Measured: `6074` + // Estimated: `8760` + // Minimum execution time: 914_051_000 picoseconds. + Weight::from_parts(922_347_000, 8760) + .saturating_add(T::DbWeight::get().reads(60_u64)) + .saturating_add(T::DbWeight::get().writes(34_u64)) } } \ No newline at end of file diff --git a/parachain/runtime/kintsugi/src/weights/oracle.rs b/parachain/runtime/kintsugi/src/weights/oracle.rs index dbf396ddfe..ac6c254bde 100644 --- a/parachain/runtime/kintsugi/src/weights/oracle.rs +++ b/parachain/runtime/kintsugi/src/weights/oracle.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for oracle //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-kcxvd`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/kintsugi/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -50,10 +50,10 @@ impl oracle::WeightInfo for WeightInfo { /// Proof: Oracle MaxDelay (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) /// Storage: VaultRewards TotalStake (r:999 w:0) /// Proof: VaultRewards TotalStake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Security ParachainStatus (r:1 w:1) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: Security Errors (r:1 w:1) - /// Proof: Security Errors (max_values: Some(1), max_size: Some(2), added: 497, mode: MaxEncodedLen) + /// Storage: VaultCapacity Stake (r:999 w:0) + /// Proof: VaultCapacity Stake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Loans Markets (r:999 w:0) + /// Proof: Loans Markets (max_values: None, max_size: Some(160), added: 2635, mode: MaxEncodedLen) /// Storage: Oracle Aggregate (r:0 w:999) /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) /// Storage: Oracle ValidUntil (r:0 w:999) @@ -61,17 +61,16 @@ impl oracle::WeightInfo for WeightInfo { /// The range of component `u` is `[1, 1000]`. fn on_initialize (u: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `687 + u * (127 ±0)` - // Estimated: `11433 + u * (10172 ±0)` - // Minimum execution time: 127_261_000 picoseconds. - Weight::from_parts(128_970_000, 11433) - // Standard Error: 50_008 - .saturating_add(Weight::from_parts(52_126_479, 0).saturating_mul(u.into())) - .saturating_add(T::DbWeight::get().reads(5_u64)) - .saturating_add(T::DbWeight::get().reads((4_u64).saturating_mul(u.into()))) - .saturating_add(T::DbWeight::get().writes(2_u64)) + // Measured: `678 + u * (127 ±0)` + // Estimated: `3494 + u * (5150 ±0)` + // Minimum execution time: 84_258_000 picoseconds. + Weight::from_parts(85_090_000, 3494) + // Standard Error: 50_885 + .saturating_add(Weight::from_parts(45_702_615, 0).saturating_mul(u.into())) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().reads((6_u64).saturating_mul(u.into()))) .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(u.into()))) - .saturating_add(Weight::from_parts(0, 10172).saturating_mul(u.into())) + .saturating_add(Weight::from_parts(0, 5150).saturating_mul(u.into())) } /// Storage: Oracle AuthorizedOracles (r:1 w:0) /// Proof: Oracle AuthorizedOracles (max_values: None, max_size: Some(305), added: 2780, mode: MaxEncodedLen) @@ -85,11 +84,11 @@ impl oracle::WeightInfo for WeightInfo { fn feed_values (u: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `295` - // Estimated: `5263` - // Minimum execution time: 49_951_000 picoseconds. - Weight::from_parts(51_093_000, 5263) - // Standard Error: 15_237 - .saturating_add(Weight::from_parts(10_441_256, 0).saturating_mul(u.into())) + // Estimated: `3770` + // Minimum execution time: 38_156_000 picoseconds. + Weight::from_parts(38_637_000, 3770) + // Standard Error: 33_449 + .saturating_add(Weight::from_parts(8_275_546, 0).saturating_mul(u.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(u.into()))) } @@ -99,8 +98,8 @@ impl oracle::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 30_897_000 picoseconds. - Weight::from_parts(33_392_000, 0) + // Minimum execution time: 23_347_000 picoseconds. + Weight::from_parts(23_587_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: Oracle AuthorizedOracles (r:0 w:1) @@ -109,8 +108,8 @@ impl oracle::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 27_673_000 picoseconds. - Weight::from_parts(29_602_000, 0) + // Minimum execution time: 20_942_000 picoseconds. + Weight::from_parts(21_332_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } } \ No newline at end of file diff --git a/parachain/runtime/kintsugi/src/weights/orml_asset_registry.rs b/parachain/runtime/kintsugi/src/weights/orml_asset_registry.rs index 8de949beb6..e250abf53e 100644 --- a/parachain/runtime/kintsugi/src/weights/orml_asset_registry.rs +++ b/parachain/runtime/kintsugi/src/weights/orml_asset_registry.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for orml_asset_registry //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-kcxvd`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/kintsugi/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -49,9 +49,9 @@ impl orml_asset_registry::WeightInfo for WeightInfo fn register_asset () -> Weight { // Proof Size summary in bytes: // Measured: `107` - // Estimated: `8736` - // Minimum execution time: 56_246_000 picoseconds. - Weight::from_parts(58_393_000, 8736) + // Estimated: `3572` + // Minimum execution time: 43_197_000 picoseconds. + Weight::from_parts(43_718_000, 3572) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -62,9 +62,9 @@ impl orml_asset_registry::WeightInfo for WeightInfo fn update_asset () -> Weight { // Proof Size summary in bytes: // Measured: `774` - // Estimated: `8478` - // Minimum execution time: 69_020_000 picoseconds. - Weight::from_parts(71_366_000, 8478) + // Estimated: `4239` + // Minimum execution time: 51_513_000 picoseconds. + Weight::from_parts(52_796_000, 4239) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -72,7 +72,7 @@ impl orml_asset_registry::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 527_000 picoseconds. - Weight::from_parts(614_000, 0) + // Minimum execution time: 421_000 picoseconds. + Weight::from_parts(451_000, 0) } } \ No newline at end of file diff --git a/parachain/runtime/kintsugi/src/weights/orml_tokens.rs b/parachain/runtime/kintsugi/src/weights/orml_tokens.rs index dd0bbfb86d..50e442332c 100644 --- a/parachain/runtime/kintsugi/src/weights/orml_tokens.rs +++ b/parachain/runtime/kintsugi/src/weights/orml_tokens.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for orml_tokens //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-kcxvd`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/kintsugi/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -60,10 +60,10 @@ impl orml_tokens::WeightInfo for WeightInfo { /// Proof: Loans AccountDeposits (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) fn transfer () -> Weight { // Proof Size summary in bytes: - // Measured: `1517` - // Estimated: `42199` - // Minimum execution time: 261_154_000 picoseconds. - Weight::from_parts(272_290_000, 42199) + // Measured: `1743` + // Estimated: `6260` + // Minimum execution time: 211_062_000 picoseconds. + Weight::from_parts(213_427_000, 6260) .saturating_add(T::DbWeight::get().reads(13_u64)) .saturating_add(T::DbWeight::get().writes(8_u64)) } @@ -87,10 +87,10 @@ impl orml_tokens::WeightInfo for WeightInfo { /// Proof: Loans AccountDeposits (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) fn transfer_all () -> Weight { // Proof Size summary in bytes: - // Measured: `1517` - // Estimated: `42199` - // Minimum execution time: 275_185_000 picoseconds. - Weight::from_parts(301_987_000, 42199) + // Measured: `1743` + // Estimated: `6260` + // Minimum execution time: 217_896_000 picoseconds. + Weight::from_parts(220_561_000, 6260) .saturating_add(T::DbWeight::get().reads(13_u64)) .saturating_add(T::DbWeight::get().writes(8_u64)) } @@ -114,10 +114,10 @@ impl orml_tokens::WeightInfo for WeightInfo { /// Proof: Loans AccountDeposits (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) fn transfer_keep_alive () -> Weight { // Proof Size summary in bytes: - // Measured: `1517` - // Estimated: `42199` - // Minimum execution time: 262_301_000 picoseconds. - Weight::from_parts(281_639_000, 42199) + // Measured: `1743` + // Estimated: `6260` + // Minimum execution time: 208_959_000 picoseconds. + Weight::from_parts(214_179_000, 6260) .saturating_add(T::DbWeight::get().reads(13_u64)) .saturating_add(T::DbWeight::get().writes(8_u64)) } @@ -141,10 +141,10 @@ impl orml_tokens::WeightInfo for WeightInfo { /// Proof: Loans AccountDeposits (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) fn force_transfer () -> Weight { // Proof Size summary in bytes: - // Measured: `1517` - // Estimated: `42199` - // Minimum execution time: 264_521_000 picoseconds. - Weight::from_parts(282_929_000, 42199) + // Measured: `1743` + // Estimated: `6260` + // Minimum execution time: 210_782_000 picoseconds. + Weight::from_parts(211_844_000, 6260) .saturating_add(T::DbWeight::get().reads(13_u64)) .saturating_add(T::DbWeight::get().writes(8_u64)) } @@ -154,10 +154,10 @@ impl orml_tokens::WeightInfo for WeightInfo { /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) fn set_balance () -> Weight { // Proof Size summary in bytes: - // Measured: `218` - // Estimated: `7080` - // Minimum execution time: 67_303_000 picoseconds. - Weight::from_parts(70_396_000, 7080) + // Measured: `435` + // Estimated: `3580` + // Minimum execution time: 53_407_000 picoseconds. + Weight::from_parts(54_209_000, 3580) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } diff --git a/parachain/runtime/kintsugi/src/weights/orml_vesting.rs b/parachain/runtime/kintsugi/src/weights/orml_vesting.rs index 9f4435e3bd..2e6e6d62fe 100644 --- a/parachain/runtime/kintsugi/src/weights/orml_vesting.rs +++ b/parachain/runtime/kintsugi/src/weights/orml_vesting.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for orml_vesting //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-kcxvd`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/kintsugi/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -51,10 +51,10 @@ impl orml_vesting::WeightInfo for WeightInfo { /// The range of component `n` is `[0, 1]`. fn claim (_n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `315 + n * (306 ±0)` - // Estimated: `15448` - // Minimum execution time: 87_385_000 picoseconds. - Weight::from_parts(101_058_776, 15448) + // Measured: `771 + n * (109 ±0)` + // Estimated: `4733` + // Minimum execution time: 69_630_000 picoseconds. + Weight::from_parts(85_988_378, 4733) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } @@ -68,10 +68,10 @@ impl orml_vesting::WeightInfo for WeightInfo { /// Proof: Tokens Locks (max_values: None, max_size: Some(1268), added: 3743, mode: MaxEncodedLen) fn vested_transfer () -> Weight { // Proof Size summary in bytes: - // Measured: `395` - // Estimated: `18038` - // Minimum execution time: 156_905_000 picoseconds. - Weight::from_parts(162_668_000, 18038) + // Measured: `851` + // Estimated: `6170` + // Minimum execution time: 133_136_000 picoseconds. + Weight::from_parts(135_141_000, 6170) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -86,10 +86,10 @@ impl orml_vesting::WeightInfo for WeightInfo { /// The range of component `n` is `[0, 1]`. fn update_vesting_schedules (_n: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `560` - // Estimated: `11906` - // Minimum execution time: 86_877_000 picoseconds. - Weight::from_parts(93_145_134, 11906) + // Measured: `894` + // Estimated: `4733` + // Minimum execution time: 73_317_000 picoseconds. + Weight::from_parts(77_789_707, 4733) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } diff --git a/parachain/runtime/kintsugi/src/weights/pallet_collective.rs b/parachain/runtime/kintsugi/src/weights/pallet_collective.rs index c20e036b69..7b8d54f478 100644 --- a/parachain/runtime/kintsugi/src/weights/pallet_collective.rs +++ b/parachain/runtime/kintsugi/src/weights/pallet_collective.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for pallet_collective //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-kcxvd`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/kintsugi/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -54,19 +54,19 @@ impl pallet_collective::WeightInfo for WeightInfo { fn set_members (m: u32, _n: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0 + m * (3232 ±0) + p * (3190 ±0)` - // Estimated: `19032 + m * (7796 ±30) + p * (10110 ±30)` - // Minimum execution time: 37_038_000 picoseconds. - Weight::from_parts(37_465_000, 19032) - // Standard Error: 171_101 - .saturating_add(Weight::from_parts(9_767_979, 0).saturating_mul(m.into())) - // Standard Error: 171_101 - .saturating_add(Weight::from_parts(17_255_253, 0).saturating_mul(p.into())) + // Estimated: `15762 + m * (1966 ±32) + p * (4332 ±32)` + // Minimum execution time: 27_555_000 picoseconds. + Weight::from_parts(27_886_000, 15762) + // Standard Error: 110_698 + .saturating_add(Weight::from_parts(6_544_430, 0).saturating_mul(m.into())) + // Standard Error: 110_698 + .saturating_add(Weight::from_parts(11_901_208, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) .saturating_add(T::DbWeight::get().writes(2_u64)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into()))) - .saturating_add(Weight::from_parts(0, 7796).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 10110).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 1966).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 4332).saturating_mul(p.into())) } /// Storage: TechnicalCommittee Members (r:1 w:0) /// Proof Skipped: TechnicalCommittee Members (max_values: Some(1), max_size: None, mode: Measured) @@ -76,12 +76,12 @@ impl pallet_collective::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `103 + m * (32 ±0)` // Estimated: `1589 + m * (32 ±0)` - // Minimum execution time: 39_809_000 picoseconds. - Weight::from_parts(42_027_148, 1589) - // Standard Error: 653 - .saturating_add(Weight::from_parts(1_485, 0).saturating_mul(b.into())) - // Standard Error: 6_734 - .saturating_add(Weight::from_parts(27_554, 0).saturating_mul(m.into())) + // Minimum execution time: 30_882_000 picoseconds. + Weight::from_parts(30_466_976, 1589) + // Standard Error: 124 + .saturating_add(Weight::from_parts(2_030, 0).saturating_mul(b.into())) + // Standard Error: 1_283 + .saturating_add(Weight::from_parts(15_394, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } @@ -94,15 +94,15 @@ impl pallet_collective::WeightInfo for WeightInfo { fn propose_execute (b: u32, m: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `103 + m * (32 ±0)` - // Estimated: `5158 + m * (64 ±0)` - // Minimum execution time: 45_239_000 picoseconds. - Weight::from_parts(48_094_466, 5158) - // Standard Error: 754 - .saturating_add(Weight::from_parts(792, 0).saturating_mul(b.into())) - // Standard Error: 7_772 - .saturating_add(Weight::from_parts(45_343, 0).saturating_mul(m.into())) + // Estimated: `3569 + m * (32 ±0)` + // Minimum execution time: 35_902_000 picoseconds. + Weight::from_parts(35_558_309, 3569) + // Standard Error: 98 + .saturating_add(Weight::from_parts(1_600, 0).saturating_mul(b.into())) + // Standard Error: 1_013 + .saturating_add(Weight::from_parts(25_869, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } /// Storage: TechnicalCommittee Members (r:1 w:0) /// Proof Skipped: TechnicalCommittee Members (max_values: Some(1), max_size: None, mode: Measured) @@ -120,19 +120,19 @@ impl pallet_collective::WeightInfo for WeightInfo { fn propose_proposed (b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `393 + m * (32 ±0) + p * (36 ±0)` - // Estimated: `9510 + m * (165 ±0) + p * (180 ±0)` - // Minimum execution time: 60_312_000 picoseconds. - Weight::from_parts(59_919_902, 9510) - // Standard Error: 1_108 - .saturating_add(Weight::from_parts(6_692, 0).saturating_mul(b.into())) - // Standard Error: 11_569 - .saturating_add(Weight::from_parts(68_898, 0).saturating_mul(m.into())) - // Standard Error: 11_423 - .saturating_add(Weight::from_parts(653_673, 0).saturating_mul(p.into())) + // Estimated: `3783 + m * (33 ±0) + p * (36 ±0)` + // Minimum execution time: 46_312_000 picoseconds. + Weight::from_parts(46_713_011, 3783) + // Standard Error: 709 + .saturating_add(Weight::from_parts(4_788, 0).saturating_mul(b.into())) + // Standard Error: 7_405 + .saturating_add(Weight::from_parts(15_986, 0).saturating_mul(m.into())) + // Standard Error: 7_311 + .saturating_add(Weight::from_parts(298_350, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) - .saturating_add(Weight::from_parts(0, 165).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 180).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 33).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) } /// Storage: TechnicalCommittee Members (r:1 w:0) /// Proof Skipped: TechnicalCommittee Members (max_values: Some(1), max_size: None, mode: Measured) @@ -142,14 +142,14 @@ impl pallet_collective::WeightInfo for WeightInfo { fn vote (m: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `842 + m * (64 ±0)` - // Estimated: `6632 + m * (128 ±0)` - // Minimum execution time: 69_321_000 picoseconds. - Weight::from_parts(76_588_048, 6632) - // Standard Error: 11_838 - .saturating_add(Weight::from_parts(153_256, 0).saturating_mul(m.into())) + // Estimated: `4306 + m * (64 ±0)` + // Minimum execution time: 39_509_000 picoseconds. + Weight::from_parts(41_107_426, 4306) + // Standard Error: 2_944 + .saturating_add(Weight::from_parts(44_135, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) - .saturating_add(Weight::from_parts(0, 128).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) } /// Storage: TechnicalCommittee Voting (r:1 w:1) /// Proof Skipped: TechnicalCommittee Voting (max_values: None, max_size: None, mode: Measured) @@ -164,17 +164,17 @@ impl pallet_collective::WeightInfo for WeightInfo { fn close_early_disapproved (m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `431 + m * (64 ±0) + p * (36 ±0)` - // Estimated: `8075 + m * (260 ±0) + p * (144 ±0)` - // Minimum execution time: 70_839_000 picoseconds. - Weight::from_parts(69_678_612, 8075) - // Standard Error: 11_105 - .saturating_add(Weight::from_parts(106_289, 0).saturating_mul(m.into())) - // Standard Error: 10_829 - .saturating_add(Weight::from_parts(572_328, 0).saturating_mul(p.into())) + // Estimated: `3875 + m * (65 ±0) + p * (36 ±0)` + // Minimum execution time: 49_359_000 picoseconds. + Weight::from_parts(49_169_939, 3875) + // Standard Error: 10_006 + .saturating_add(Weight::from_parts(62_030, 0).saturating_mul(m.into())) + // Standard Error: 9_757 + .saturating_add(Weight::from_parts(323_855, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) - .saturating_add(Weight::from_parts(0, 260).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 144).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) } /// Storage: TechnicalCommittee Voting (r:1 w:1) /// Proof Skipped: TechnicalCommittee Voting (max_values: None, max_size: None, mode: Measured) @@ -190,20 +190,20 @@ impl pallet_collective::WeightInfo for WeightInfo { fn close_early_approved (b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `733 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` - // Estimated: `12228 + b * (4 ±0) + m * (264 ±0) + p * (160 ±0)` - // Minimum execution time: 101_255_000 picoseconds. - Weight::from_parts(113_763_725, 12228) - // Standard Error: 1_293 - .saturating_add(Weight::from_parts(5_131, 0).saturating_mul(b.into())) - // Standard Error: 13_671 - .saturating_add(Weight::from_parts(40_880, 0).saturating_mul(m.into())) - // Standard Error: 13_326 - .saturating_add(Weight::from_parts(679_723, 0).saturating_mul(p.into())) + // Estimated: `4047 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` + // Minimum execution time: 75_562_000 picoseconds. + Weight::from_parts(77_588_078, 4047) + // Standard Error: 841 + .saturating_add(Weight::from_parts(2_992, 0).saturating_mul(b.into())) + // Standard Error: 8_896 + .saturating_add(Weight::from_parts(19_739, 0).saturating_mul(m.into())) + // Standard Error: 8_672 + .saturating_add(Weight::from_parts(301_339, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) - .saturating_add(Weight::from_parts(0, 4).saturating_mul(b.into())) - .saturating_add(Weight::from_parts(0, 264).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 160).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) + .saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into())) } /// Storage: TechnicalCommittee Voting (r:1 w:1) /// Proof Skipped: TechnicalCommittee Voting (max_values: None, max_size: None, mode: Measured) @@ -220,17 +220,17 @@ impl pallet_collective::WeightInfo for WeightInfo { fn close_disapproved (m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `451 + m * (64 ±0) + p * (36 ±0)` - // Estimated: `10070 + m * (325 ±0) + p * (180 ±0)` - // Minimum execution time: 75_093_000 picoseconds. - Weight::from_parts(77_876_620, 10070) - // Standard Error: 14_725 - .saturating_add(Weight::from_parts(75_929, 0).saturating_mul(m.into())) - // Standard Error: 14_358 - .saturating_add(Weight::from_parts(632_851, 0).saturating_mul(p.into())) + // Estimated: `3895 + m * (65 ±0) + p * (36 ±0)` + // Minimum execution time: 54_519_000 picoseconds. + Weight::from_parts(59_296_119, 3895) + // Standard Error: 10_728 + .saturating_add(Weight::from_parts(29_077, 0).saturating_mul(m.into())) + // Standard Error: 10_461 + .saturating_add(Weight::from_parts(288_109, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) - .saturating_add(Weight::from_parts(0, 325).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 180).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) } /// Storage: TechnicalCommittee Voting (r:1 w:1) /// Proof Skipped: TechnicalCommittee Voting (max_values: None, max_size: None, mode: Measured) @@ -248,20 +248,20 @@ impl pallet_collective::WeightInfo for WeightInfo { fn close_approved (b: u32, m: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `753 + b * (1 ±0) + m * (64 ±0) + p * (40 ±0)` - // Estimated: `14395 + b * (5 ±0) + m * (330 ±0) + p * (200 ±0)` - // Minimum execution time: 104_177_000 picoseconds. - Weight::from_parts(113_086_530, 14395) - // Standard Error: 1_484 - .saturating_add(Weight::from_parts(9_539, 0).saturating_mul(b.into())) - // Standard Error: 15_687 - .saturating_add(Weight::from_parts(67_273, 0).saturating_mul(m.into())) - // Standard Error: 15_291 - .saturating_add(Weight::from_parts(695_647, 0).saturating_mul(p.into())) + // Estimated: `4067 + b * (1 ±0) + m * (66 ±0) + p * (40 ±0)` + // Minimum execution time: 80_241_000 picoseconds. + Weight::from_parts(86_535_840, 4067) + // Standard Error: 920 + .saturating_add(Weight::from_parts(1_512, 0).saturating_mul(b.into())) + // Standard Error: 9_730 + .saturating_add(Weight::from_parts(16_230, 0).saturating_mul(m.into())) + // Standard Error: 9_484 + .saturating_add(Weight::from_parts(269_700, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) - .saturating_add(Weight::from_parts(0, 5).saturating_mul(b.into())) - .saturating_add(Weight::from_parts(0, 330).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 200).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) + .saturating_add(Weight::from_parts(0, 66).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 40).saturating_mul(p.into())) } /// Storage: TechnicalCommittee Proposals (r:1 w:1) /// Proof Skipped: TechnicalCommittee Proposals (max_values: Some(1), max_size: None, mode: Measured) @@ -273,13 +273,13 @@ impl pallet_collective::WeightInfo for WeightInfo { fn disapprove_proposal (p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `260 + p * (32 ±0)` - // Estimated: `2265 + p * (96 ±0)` - // Minimum execution time: 38_480_000 picoseconds. - Weight::from_parts(46_358_938, 2265) - // Standard Error: 11_896 - .saturating_add(Weight::from_parts(566_906, 0).saturating_mul(p.into())) + // Estimated: `1745 + p * (32 ±0)` + // Minimum execution time: 29_068_000 picoseconds. + Weight::from_parts(32_132_833, 1745) + // Standard Error: 8_681 + .saturating_add(Weight::from_parts(271_198, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) - .saturating_add(Weight::from_parts(0, 96).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 32).saturating_mul(p.into())) } } \ No newline at end of file diff --git a/parachain/runtime/kintsugi/src/weights/pallet_identity.rs b/parachain/runtime/kintsugi/src/weights/pallet_identity.rs index 4fe03dd626..d856d4081c 100644 --- a/parachain/runtime/kintsugi/src/weights/pallet_identity.rs +++ b/parachain/runtime/kintsugi/src/weights/pallet_identity.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for pallet_identity //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-kcxvd`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/kintsugi/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -45,12 +45,12 @@ impl pallet_identity::WeightInfo for WeightInfo { /// The range of component `r` is `[1, 19]`. fn add_registrar (r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `31 + r * (57 ±0)` + // Measured: `32 + r * (57 ±0)` // Estimated: `2626` - // Minimum execution time: 29_658_000 picoseconds. - Weight::from_parts(32_388_262, 2626) - // Standard Error: 28_613 - .saturating_add(Weight::from_parts(560_664, 0).saturating_mul(r.into())) + // Minimum execution time: 22_986_000 picoseconds. + Weight::from_parts(24_181_833, 2626) + // Standard Error: 4_421 + .saturating_add(Weight::from_parts(159_851, 0).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -62,14 +62,14 @@ impl pallet_identity::WeightInfo for WeightInfo { /// The range of component `x` is `[0, 100]`. fn set_identity (r: u32, x: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `797 + r * (17 ±0)` - // Estimated: `14583` - // Minimum execution time: 94_610_000 picoseconds. - Weight::from_parts(94_849_003, 14583) - // Standard Error: 77_224 - .saturating_add(Weight::from_parts(1_014_324, 0).saturating_mul(r.into())) - // Standard Error: 14_688 - .saturating_add(Weight::from_parts(1_265_870, 0).saturating_mul(x.into())) + // Measured: `1017 + r * (12 ±0)` + // Estimated: `11003` + // Minimum execution time: 65_391_000 picoseconds. + Weight::from_parts(69_077_970, 11003) + // Standard Error: 100_599 + .saturating_add(Weight::from_parts(449_513, 0).saturating_mul(r.into())) + // Standard Error: 19_134 + .saturating_add(Weight::from_parts(1_062_920, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -84,12 +84,12 @@ impl pallet_identity::WeightInfo for WeightInfo { /// The range of component `s` is `[0, 100]`. fn set_subs_new (s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `419` - // Estimated: `22296 + s * (2589 ±0)` - // Minimum execution time: 23_473_000 picoseconds. - Weight::from_parts(65_673_234, 22296) - // Standard Error: 31_908 - .saturating_add(Weight::from_parts(7_788_428, 0).saturating_mul(s.into())) + // Measured: `637` + // Estimated: `11003 + s * (2589 ±0)` + // Minimum execution time: 17_816_000 picoseconds. + Weight::from_parts(55_350_473, 11003) + // Standard Error: 13_184 + .saturating_add(Weight::from_parts(6_219_407, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(s.into()))) .saturating_add(T::DbWeight::get().writes(2_u64)) @@ -107,12 +107,12 @@ impl pallet_identity::WeightInfo for WeightInfo { /// The range of component `p` is `[0, 100]`. fn set_subs_old (p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `512 + p * (32 ±0)` - // Estimated: `21306` - // Minimum execution time: 23_235_000 picoseconds. - Weight::from_parts(62_542_236, 21306) - // Standard Error: 18_980 - .saturating_add(Weight::from_parts(3_254_754, 0).saturating_mul(p.into())) + // Measured: `730 + p * (32 ±0)` + // Estimated: `11003` + // Minimum execution time: 18_006_000 picoseconds. + Weight::from_parts(46_076_762, 11003) + // Standard Error: 8_675 + .saturating_add(Weight::from_parts(2_452_286, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into()))) @@ -128,18 +128,16 @@ impl pallet_identity::WeightInfo for WeightInfo { /// The range of component `r` is `[1, 20]`. /// The range of component `s` is `[0, 100]`. /// The range of component `x` is `[0, 100]`. - fn clear_identity (r: u32, s: u32, x: u32, ) -> Weight { + fn clear_identity (_r: u32, s: u32, x: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `825 + r * (17 ±0) + s * (32 ±0) + x * (66 ±0)` - // Estimated: `21306` - // Minimum execution time: 159_212_000 picoseconds. - Weight::from_parts(63_613_007, 21306) - // Standard Error: 108_422 - .saturating_add(Weight::from_parts(1_303_079, 0).saturating_mul(r.into())) - // Standard Error: 20_487 - .saturating_add(Weight::from_parts(3_343_144, 0).saturating_mul(s.into())) - // Standard Error: 20_487 - .saturating_add(Weight::from_parts(796_591, 0).saturating_mul(x.into())) + // Measured: `1049 + r * (12 ±0) + s * (32 ±0) + x * (66 ±0)` + // Estimated: `11003` + // Minimum execution time: 113_047_000 picoseconds. + Weight::from_parts(65_764_584, 11003) + // Standard Error: 31_578 + .saturating_add(Weight::from_parts(2_452_246, 0).saturating_mul(s.into())) + // Standard Error: 31_578 + .saturating_add(Weight::from_parts(545_909, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(s.into()))) @@ -154,14 +152,14 @@ impl pallet_identity::WeightInfo for WeightInfo { /// The range of component `x` is `[0, 100]`. fn request_judgement (r: u32, x: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `721 + r * (69 ±0) + x * (66 ±0)` - // Estimated: `17209` - // Minimum execution time: 100_013_000 picoseconds. - Weight::from_parts(92_611_653, 17209) - // Standard Error: 70_701 - .saturating_add(Weight::from_parts(735_891, 0).saturating_mul(r.into())) - // Standard Error: 13_447 - .saturating_add(Weight::from_parts(1_326_583, 0).saturating_mul(x.into())) + // Measured: `942 + r * (64 ±0) + x * (66 ±0)` + // Estimated: `11003` + // Minimum execution time: 73_097_000 picoseconds. + Weight::from_parts(76_938_006, 11003) + // Standard Error: 59_507 + .saturating_add(Weight::from_parts(143_637, 0).saturating_mul(r.into())) + // Standard Error: 11_318 + .saturating_add(Weight::from_parts(1_036_500, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -173,14 +171,14 @@ impl pallet_identity::WeightInfo for WeightInfo { /// The range of component `x` is `[0, 100]`. fn cancel_request (r: u32, x: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `753 + r * (12 ±0) + x * (66 ±0)` - // Estimated: `14583` - // Minimum execution time: 85_034_000 picoseconds. - Weight::from_parts(85_245_033, 14583) - // Standard Error: 73_722 - .saturating_add(Weight::from_parts(553_864, 0).saturating_mul(r.into())) - // Standard Error: 14_022 - .saturating_add(Weight::from_parts(1_236_075, 0).saturating_mul(x.into())) + // Measured: `973 + r * (7 ±0) + x * (66 ±0)` + // Estimated: `11003` + // Minimum execution time: 61_433_000 picoseconds. + Weight::from_parts(56_726_772, 11003) + // Standard Error: 87_425 + .saturating_add(Weight::from_parts(392_867, 0).saturating_mul(r.into())) + // Standard Error: 16_628 + .saturating_add(Weight::from_parts(1_113_492, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -189,12 +187,12 @@ impl pallet_identity::WeightInfo for WeightInfo { /// The range of component `r` is `[1, 19]`. fn set_fee (r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `88 + r * (57 ±0)` + // Measured: `89 + r * (57 ±0)` // Estimated: `2626` - // Minimum execution time: 18_469_000 picoseconds. - Weight::from_parts(20_943_735, 2626) - // Standard Error: 20_706 - .saturating_add(Weight::from_parts(336_620, 0).saturating_mul(r.into())) + // Minimum execution time: 14_549_000 picoseconds. + Weight::from_parts(15_310_600, 2626) + // Standard Error: 2_952 + .saturating_add(Weight::from_parts(142_391, 0).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -203,12 +201,12 @@ impl pallet_identity::WeightInfo for WeightInfo { /// The range of component `r` is `[1, 19]`. fn set_account_id (r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `88 + r * (57 ±0)` + // Measured: `89 + r * (57 ±0)` // Estimated: `2626` - // Minimum execution time: 19_117_000 picoseconds. - Weight::from_parts(20_689_970, 2626) - // Standard Error: 18_307 - .saturating_add(Weight::from_parts(420_655, 0).saturating_mul(r.into())) + // Minimum execution time: 14_779_000 picoseconds. + Weight::from_parts(15_555_149, 2626) + // Standard Error: 3_115 + .saturating_add(Weight::from_parts(133_559, 0).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -217,12 +215,12 @@ impl pallet_identity::WeightInfo for WeightInfo { /// The range of component `r` is `[1, 19]`. fn set_fields (r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `88 + r * (57 ±0)` + // Measured: `89 + r * (57 ±0)` // Estimated: `2626` - // Minimum execution time: 18_914_000 picoseconds. - Weight::from_parts(20_051_136, 2626) - // Standard Error: 16_530 - .saturating_add(Weight::from_parts(400_692, 0).saturating_mul(r.into())) + // Minimum execution time: 14_950_000 picoseconds. + Weight::from_parts(15_454_648, 2626) + // Standard Error: 5_499 + .saturating_add(Weight::from_parts(143_851, 0).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -234,14 +232,14 @@ impl pallet_identity::WeightInfo for WeightInfo { /// The range of component `x` is `[0, 100]`. fn provide_judgement (r: u32, x: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `444 + r * (57 ±0) + x * (66 ±0)` - // Estimated: `13629` - // Minimum execution time: 61_446_000 picoseconds. - Weight::from_parts(59_775_124, 13629) - // Standard Error: 74_686 - .saturating_add(Weight::from_parts(537_571, 0).saturating_mul(r.into())) - // Standard Error: 13_488 - .saturating_add(Weight::from_parts(2_024_583, 0).saturating_mul(x.into())) + // Measured: `445 + r * (57 ±0) + x * (66 ±0)` + // Estimated: `11003` + // Minimum execution time: 43_538_000 picoseconds. + Weight::from_parts(42_981_123, 11003) + // Standard Error: 10_221 + .saturating_add(Weight::from_parts(122_856, 0).saturating_mul(r.into())) + // Standard Error: 1_846 + .saturating_add(Weight::from_parts(1_731_196, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -260,16 +258,16 @@ impl pallet_identity::WeightInfo for WeightInfo { /// The range of component `x` is `[0, 100]`. fn kill_identity (r: u32, s: u32, x: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `879 + r * (13 ±0) + s * (32 ±0) + x * (66 ±0)` - // Estimated: `24806` - // Minimum execution time: 276_358_000 picoseconds. - Weight::from_parts(324_219_120, 24806) - // Standard Error: 363_435 - .saturating_add(Weight::from_parts(770_952, 0).saturating_mul(r.into())) - // Standard Error: 68_674 - .saturating_add(Weight::from_parts(3_084_393, 0).saturating_mul(s.into())) - // Standard Error: 68_674 - .saturating_add(Weight::from_parts(536_488, 0).saturating_mul(x.into())) + // Measured: `1133 + r * (8 ±0) + s * (32 ±0) + x * (66 ±0)` + // Estimated: `11003` + // Minimum execution time: 139_149_000 picoseconds. + Weight::from_parts(78_040_120, 11003) + // Standard Error: 90_340 + .saturating_add(Weight::from_parts(364_164, 0).saturating_mul(r.into())) + // Standard Error: 17_070 + .saturating_add(Weight::from_parts(2_466_284, 0).saturating_mul(s.into())) + // Standard Error: 17_070 + .saturating_add(Weight::from_parts(592_129, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(s.into()))) @@ -285,12 +283,12 @@ impl pallet_identity::WeightInfo for WeightInfo { /// The range of component `s` is `[0, 99]`. fn add_sub (s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `793 + s * (36 ±0)` - // Estimated: `24885` - // Minimum execution time: 82_290_000 picoseconds. - Weight::from_parts(99_654_375, 24885) - // Standard Error: 16_641 - .saturating_add(Weight::from_parts(280_950, 0).saturating_mul(s.into())) + // Measured: `1011 + s * (36 ±0)` + // Estimated: `11003` + // Minimum execution time: 66_964_000 picoseconds. + Weight::from_parts(73_507_098, 11003) + // Standard Error: 2_409 + .saturating_add(Weight::from_parts(83_629, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -301,12 +299,12 @@ impl pallet_identity::WeightInfo for WeightInfo { /// The range of component `s` is `[1, 100]`. fn rename_sub (s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `590 + s * (3 ±0)` - // Estimated: `14582` - // Minimum execution time: 30_792_000 picoseconds. - Weight::from_parts(37_031_865, 14582) - // Standard Error: 6_382 - .saturating_add(Weight::from_parts(107_280, 0).saturating_mul(s.into())) + // Measured: `591 + s * (3 ±0)` + // Estimated: `11003` + // Minimum execution time: 23_928_000 picoseconds. + Weight::from_parts(26_136_297, 11003) + // Standard Error: 932 + .saturating_add(Weight::from_parts(17_948, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -321,12 +319,12 @@ impl pallet_identity::WeightInfo for WeightInfo { /// The range of component `s` is `[1, 100]`. fn remove_sub (s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `956 + s * (35 ±0)` - // Estimated: `24885` - // Minimum execution time: 83_312_000 picoseconds. - Weight::from_parts(92_869_808, 24885) - // Standard Error: 12_562 - .saturating_add(Weight::from_parts(235_070, 0).saturating_mul(s.into())) + // Measured: `1174 + s * (35 ±0)` + // Estimated: `11003` + // Minimum execution time: 64_009_000 picoseconds. + Weight::from_parts(68_461_962, 11003) + // Standard Error: 2_247 + .saturating_add(Weight::from_parts(68_630, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -339,12 +337,12 @@ impl pallet_identity::WeightInfo for WeightInfo { /// The range of component `s` is `[0, 99]`. fn quit_sub (s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `882 + s * (37 ±0)` - // Estimated: `16472` - // Minimum execution time: 136_997_000 picoseconds. - Weight::from_parts(148_870_524, 16472) - // Standard Error: 19_849 - .saturating_add(Weight::from_parts(185_985, 0).saturating_mul(s.into())) + // Measured: `1100 + s * (37 ±0)` + // Estimated: `6723` + // Minimum execution time: 106_002_000 picoseconds. + Weight::from_parts(110_225_941, 6723) + // Standard Error: 2_866 + .saturating_add(Weight::from_parts(73_759, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } diff --git a/parachain/runtime/kintsugi/src/weights/pallet_membership.rs b/parachain/runtime/kintsugi/src/weights/pallet_membership.rs index c2a0d1daa3..26f19606c7 100644 --- a/parachain/runtime/kintsugi/src/weights/pallet_membership.rs +++ b/parachain/runtime/kintsugi/src/weights/pallet_membership.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for pallet_membership //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-kcxvd`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/kintsugi/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -52,14 +52,14 @@ impl pallet_membership::WeightInfo for WeightInfo { fn add_member (m: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `135 + m * (64 ±0)` - // Estimated: `6574 + m * (192 ±0)` - // Minimum execution time: 39_085_000 picoseconds. - Weight::from_parts(41_405_258, 6574) - // Standard Error: 4_530 - .saturating_add(Weight::from_parts(61_425, 0).saturating_mul(m.into())) + // Estimated: `4687 + m * (64 ±0)` + // Minimum execution time: 28_968_000 picoseconds. + Weight::from_parts(30_406_093, 4687) + // Standard Error: 1_278 + .saturating_add(Weight::from_parts(49_047, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) - .saturating_add(Weight::from_parts(0, 192).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) } /// Storage: TechnicalMembership Members (r:1 w:1) /// Proof: TechnicalMembership Members (max_values: Some(1), max_size: Some(3202), added: 3697, mode: MaxEncodedLen) @@ -75,14 +75,14 @@ impl pallet_membership::WeightInfo for WeightInfo { fn remove_member (m: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `239 + m * (64 ±0)` - // Estimated: `8403 + m * (192 ±0)` - // Minimum execution time: 44_438_000 picoseconds. - Weight::from_parts(48_579_071, 8403) - // Standard Error: 6_870 - .saturating_add(Weight::from_parts(54_770, 0).saturating_mul(m.into())) + // Estimated: `4687 + m * (64 ±0)` + // Minimum execution time: 33_617_000 picoseconds. + Weight::from_parts(35_067_538, 4687) + // Standard Error: 993 + .saturating_add(Weight::from_parts(39_985, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) - .saturating_add(Weight::from_parts(0, 192).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) } /// Storage: TechnicalMembership Members (r:1 w:1) /// Proof: TechnicalMembership Members (max_values: Some(1), max_size: Some(3202), added: 3697, mode: MaxEncodedLen) @@ -98,14 +98,14 @@ impl pallet_membership::WeightInfo for WeightInfo { fn swap_member (m: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `239 + m * (64 ±0)` - // Estimated: `8403 + m * (192 ±0)` - // Minimum execution time: 45_097_000 picoseconds. - Weight::from_parts(47_597_110, 8403) - // Standard Error: 5_780 - .saturating_add(Weight::from_parts(109_005, 0).saturating_mul(m.into())) + // Estimated: `4687 + m * (64 ±0)` + // Minimum execution time: 33_948_000 picoseconds. + Weight::from_parts(35_532_376, 4687) + // Standard Error: 1_402 + .saturating_add(Weight::from_parts(59_658, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) - .saturating_add(Weight::from_parts(0, 192).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) } /// Storage: TechnicalMembership Members (r:1 w:1) /// Proof: TechnicalMembership Members (max_values: Some(1), max_size: Some(3202), added: 3697, mode: MaxEncodedLen) @@ -121,14 +121,14 @@ impl pallet_membership::WeightInfo for WeightInfo { fn reset_member (m: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `239 + m * (64 ±0)` - // Estimated: `8403 + m * (192 ±0)` - // Minimum execution time: 43_376_000 picoseconds. - Weight::from_parts(48_396_887, 8403) - // Standard Error: 7_577 - .saturating_add(Weight::from_parts(326_626, 0).saturating_mul(m.into())) + // Estimated: `4687 + m * (64 ±0)` + // Minimum execution time: 33_547_000 picoseconds. + Weight::from_parts(36_327_634, 4687) + // Standard Error: 2_341 + .saturating_add(Weight::from_parts(204_204, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) - .saturating_add(Weight::from_parts(0, 192).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) } /// Storage: TechnicalMembership Members (r:1 w:1) /// Proof: TechnicalMembership Members (max_values: Some(1), max_size: Some(3202), added: 3697, mode: MaxEncodedLen) @@ -144,14 +144,14 @@ impl pallet_membership::WeightInfo for WeightInfo { fn change_key (m: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `239 + m * (64 ±0)` - // Estimated: `8403 + m * (192 ±0)` - // Minimum execution time: 46_090_000 picoseconds. - Weight::from_parts(51_337_586, 8403) - // Standard Error: 7_433 - .saturating_add(Weight::from_parts(81_678, 0).saturating_mul(m.into())) + // Estimated: `4687 + m * (64 ±0)` + // Minimum execution time: 35_011_000 picoseconds. + Weight::from_parts(29_075_546, 4687) + // Standard Error: 51_828 + .saturating_add(Weight::from_parts(376_828, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) - .saturating_add(Weight::from_parts(0, 192).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) } /// Storage: TechnicalMembership Members (r:1 w:0) /// Proof: TechnicalMembership Members (max_values: Some(1), max_size: Some(3202), added: 3697, mode: MaxEncodedLen) @@ -163,11 +163,11 @@ impl pallet_membership::WeightInfo for WeightInfo { fn set_prime (m: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `31 + m * (32 ±0)` - // Estimated: `4718 + m * (32 ±0)` - // Minimum execution time: 17_347_000 picoseconds. - Weight::from_parts(18_472_794, 4718) - // Standard Error: 1_957 - .saturating_add(Weight::from_parts(18_190, 0).saturating_mul(m.into())) + // Estimated: `4687 + m * (32 ±0)` + // Minimum execution time: 13_086_000 picoseconds. + Weight::from_parts(13_651_393, 4687) + // Standard Error: 319 + .saturating_add(Weight::from_parts(10_056, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) @@ -181,10 +181,10 @@ impl pallet_membership::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 8_361_000 picoseconds. - Weight::from_parts(9_043_690, 0) - // Standard Error: 2_026 - .saturating_add(Weight::from_parts(2_727, 0).saturating_mul(m.into())) + // Minimum execution time: 6_604_000 picoseconds. + Weight::from_parts(6_889_967, 0) + // Standard Error: 177 + .saturating_add(Weight::from_parts(140, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().writes(2_u64)) } } \ No newline at end of file diff --git a/parachain/runtime/kintsugi/src/weights/pallet_multisig.rs b/parachain/runtime/kintsugi/src/weights/pallet_multisig.rs index 3c3c097f08..ed467fcc23 100644 --- a/parachain/runtime/kintsugi/src/weights/pallet_multisig.rs +++ b/parachain/runtime/kintsugi/src/weights/pallet_multisig.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for pallet_multisig //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-kcxvd`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/kintsugi/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -45,10 +45,10 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 39_641_000 picoseconds. - Weight::from_parts(46_443_344, 0) - // Standard Error: 68 - .saturating_add(Weight::from_parts(884, 0).saturating_mul(z.into())) + // Minimum execution time: 19_699_000 picoseconds. + Weight::from_parts(20_731_704, 0) + // Standard Error: 31 + .saturating_add(Weight::from_parts(849, 0).saturating_mul(z.into())) } /// Storage: Multisig Multisigs (r:1 w:1) /// Proof: Multisig Multisigs (max_values: None, max_size: Some(3346), added: 5821, mode: MaxEncodedLen) @@ -58,14 +58,14 @@ impl pallet_multisig::WeightInfo for WeightInfo { /// The range of component `z` is `[0, 10000]`. fn as_multi_create (s: u32, z: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `679 + s * (3 ±0)` - // Estimated: `10391` - // Minimum execution time: 100_464_000 picoseconds. - Weight::from_parts(83_410_474, 10391) - // Standard Error: 14_982 - .saturating_add(Weight::from_parts(499_673, 0).saturating_mul(s.into())) - // Standard Error: 146 - .saturating_add(Weight::from_parts(2_211, 0).saturating_mul(z.into())) + // Measured: `785 + s * (2 ±0)` + // Estimated: `6811` + // Minimum execution time: 75_772_000 picoseconds. + Weight::from_parts(64_296_985, 6811) + // Standard Error: 4_662 + .saturating_add(Weight::from_parts(128_896, 0).saturating_mul(s.into())) + // Standard Error: 45 + .saturating_add(Weight::from_parts(1_998, 0).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -77,12 +77,12 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `210` // Estimated: `6811` - // Minimum execution time: 67_939_000 picoseconds. - Weight::from_parts(57_002_710, 6811) - // Standard Error: 10_860 - .saturating_add(Weight::from_parts(329_023, 0).saturating_mul(s.into())) - // Standard Error: 106 - .saturating_add(Weight::from_parts(1_774, 0).saturating_mul(z.into())) + // Minimum execution time: 44_058_000 picoseconds. + Weight::from_parts(35_694_610, 6811) + // Standard Error: 8_198 + .saturating_add(Weight::from_parts(94_572, 0).saturating_mul(s.into())) + // Standard Error: 80 + .saturating_add(Weight::from_parts(2_060, 0).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -94,14 +94,14 @@ impl pallet_multisig::WeightInfo for WeightInfo { /// The range of component `z` is `[0, 10000]`. fn as_multi_complete (s: u32, z: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `820 + s * (35 ±0)` - // Estimated: `10391` - // Minimum execution time: 101_575_000 picoseconds. - Weight::from_parts(81_885_681, 10391) - // Standard Error: 18_975 - .saturating_add(Weight::from_parts(601_187, 0).saturating_mul(s.into())) - // Standard Error: 185 - .saturating_add(Weight::from_parts(3_377, 0).saturating_mul(z.into())) + // Measured: `927 + s * (34 ±0)` + // Estimated: `6811` + // Minimum execution time: 76_092_000 picoseconds. + Weight::from_parts(65_547_375, 6811) + // Standard Error: 7_511 + .saturating_add(Weight::from_parts(130_275, 0).saturating_mul(s.into())) + // Standard Error: 73 + .saturating_add(Weight::from_parts(1_958, 0).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -112,12 +112,12 @@ impl pallet_multisig::WeightInfo for WeightInfo { /// The range of component `s` is `[2, 100]`. fn approve_as_multi_create (s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `681 + s * (3 ±0)` - // Estimated: `10391` - // Minimum execution time: 76_682_000 picoseconds. - Weight::from_parts(84_569_982, 10391) - // Standard Error: 14_936 - .saturating_add(Weight::from_parts(424_166, 0).saturating_mul(s.into())) + // Measured: `785 + s * (2 ±0)` + // Estimated: `6811` + // Minimum execution time: 60_962_000 picoseconds. + Weight::from_parts(64_772_974, 6811) + // Standard Error: 5_069 + .saturating_add(Weight::from_parts(139_789, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -128,10 +128,10 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `210` // Estimated: `6811` - // Minimum execution time: 43_869_000 picoseconds. - Weight::from_parts(47_979_585, 6811) - // Standard Error: 10_160 - .saturating_add(Weight::from_parts(366_385, 0).saturating_mul(s.into())) + // Minimum execution time: 33_758_000 picoseconds. + Weight::from_parts(35_053_040, 6811) + // Standard Error: 2_247 + .saturating_add(Weight::from_parts(84_131, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -142,12 +142,12 @@ impl pallet_multisig::WeightInfo for WeightInfo { /// The range of component `s` is `[2, 100]`. fn cancel_as_multi (s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `887 + s * (3 ±0)` - // Estimated: `10391` - // Minimum execution time: 70_160_000 picoseconds. - Weight::from_parts(78_936_731, 10391) - // Standard Error: 14_286 - .saturating_add(Weight::from_parts(430_817, 0).saturating_mul(s.into())) + // Measured: `991 + s * (2 ±0)` + // Estimated: `6811` + // Minimum execution time: 57_826_000 picoseconds. + Weight::from_parts(59_602_564, 6811) + // Standard Error: 1_749 + .saturating_add(Weight::from_parts(85_294, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } diff --git a/parachain/runtime/kintsugi/src/weights/pallet_preimage.rs b/parachain/runtime/kintsugi/src/weights/pallet_preimage.rs index 1a71bcdb11..de92679776 100644 --- a/parachain/runtime/kintsugi/src/weights/pallet_preimage.rs +++ b/parachain/runtime/kintsugi/src/weights/pallet_preimage.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for pallet_preimage //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-kcxvd`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/kintsugi/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -49,12 +49,12 @@ impl pallet_preimage::WeightInfo for WeightInfo { /// The range of component `s` is `[0, 4194304]`. fn note_preimage (s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `361` - // Estimated: `7136` - // Minimum execution time: 72_936_000 picoseconds. - Weight::from_parts(74_008_000, 7136) - // Standard Error: 18 - .saturating_add(Weight::from_parts(4_520, 0).saturating_mul(s.into())) + // Measured: `578` + // Estimated: `3580` + // Minimum execution time: 56_944_000 picoseconds. + Weight::from_parts(57_275_000, 3580) + // Standard Error: 9 + .saturating_add(Weight::from_parts(2_434, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -67,10 +67,10 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `106` // Estimated: `3556` - // Minimum execution time: 40_666_000 picoseconds. - Weight::from_parts(41_275_000, 3556) - // Standard Error: 18 - .saturating_add(Weight::from_parts(4_447, 0).saturating_mul(s.into())) + // Minimum execution time: 30_802_000 picoseconds. + Weight::from_parts(31_073_000, 3556) + // Standard Error: 9 + .saturating_add(Weight::from_parts(2_454, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -83,10 +83,10 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `106` // Estimated: `3556` - // Minimum execution time: 38_449_000 picoseconds. - Weight::from_parts(39_199_000, 3556) - // Standard Error: 18 - .saturating_add(Weight::from_parts(4_438, 0).saturating_mul(s.into())) + // Minimum execution time: 29_569_000 picoseconds. + Weight::from_parts(29_820_000, 3556) + // Standard Error: 9 + .saturating_add(Weight::from_parts(2_407, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -98,10 +98,10 @@ impl pallet_preimage::WeightInfo for WeightInfo { /// Proof: Preimage PreimageFor (max_values: None, max_size: Some(4194344), added: 4196819, mode: MaxEncodedLen) fn unnote_preimage () -> Weight { // Proof Size summary in bytes: - // Measured: `507` - // Estimated: `7136` - // Minimum execution time: 114_713_000 picoseconds. - Weight::from_parts(124_116_000, 7136) + // Measured: `724` + // Estimated: `3580` + // Minimum execution time: 80_381_000 picoseconds. + Weight::from_parts(82_065_000, 3580) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -113,8 +113,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `144` // Estimated: `3556` - // Minimum execution time: 80_966_000 picoseconds. - Weight::from_parts(84_573_000, 3556) + // Minimum execution time: 50_932_000 picoseconds. + Weight::from_parts(51_904_000, 3556) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -124,8 +124,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `188` // Estimated: `3556` - // Minimum execution time: 74_080_000 picoseconds. - Weight::from_parts(77_561_000, 3556) + // Minimum execution time: 42_375_000 picoseconds. + Weight::from_parts(45_581_000, 3556) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -135,8 +135,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `144` // Estimated: `3556` - // Minimum execution time: 50_561_000 picoseconds. - Weight::from_parts(53_043_000, 3556) + // Minimum execution time: 26_243_000 picoseconds. + Weight::from_parts(27_585_000, 3556) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -146,8 +146,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `42` // Estimated: `3556` - // Minimum execution time: 56_504_000 picoseconds. - Weight::from_parts(59_736_000, 3556) + // Minimum execution time: 24_670_000 picoseconds. + Weight::from_parts(25_682_000, 3556) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -157,8 +157,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `106` // Estimated: `3556` - // Minimum execution time: 25_948_000 picoseconds. - Weight::from_parts(27_809_000, 3556) + // Minimum execution time: 15_211_000 picoseconds. + Weight::from_parts(15_431_000, 3556) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -170,8 +170,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `144` // Estimated: `3556` - // Minimum execution time: 76_610_000 picoseconds. - Weight::from_parts(82_031_000, 3556) + // Minimum execution time: 46_233_000 picoseconds. + Weight::from_parts(46_873_000, 3556) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -181,8 +181,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `106` // Estimated: `3556` - // Minimum execution time: 25_434_000 picoseconds. - Weight::from_parts(26_929_000, 3556) + // Minimum execution time: 15_160_000 picoseconds. + Weight::from_parts(15_912_000, 3556) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -192,8 +192,8 @@ impl pallet_preimage::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `106` // Estimated: `3556` - // Minimum execution time: 25_614_000 picoseconds. - Weight::from_parts(27_250_000, 3556) + // Minimum execution time: 15_311_000 picoseconds. + Weight::from_parts(15_792_000, 3556) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } diff --git a/parachain/runtime/kintsugi/src/weights/pallet_proxy.rs b/parachain/runtime/kintsugi/src/weights/pallet_proxy.rs index cbff9543b7..14afb2498c 100644 --- a/parachain/runtime/kintsugi/src/weights/pallet_proxy.rs +++ b/parachain/runtime/kintsugi/src/weights/pallet_proxy.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for pallet_proxy //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-kcxvd`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/kintsugi/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -45,12 +45,12 @@ impl pallet_proxy::WeightInfo for WeightInfo { /// The range of component `p` is `[1, 31]`. fn proxy (p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `199 + p * (37 ±0)` + // Measured: `251 + p * (37 ±0)` // Estimated: `4706` - // Minimum execution time: 40_072_000 picoseconds. - Weight::from_parts(42_586_510, 4706) - // Standard Error: 17_676 - .saturating_add(Weight::from_parts(148_242, 0).saturating_mul(p.into())) + // Minimum execution time: 31_042_000 picoseconds. + Weight::from_parts(31_696_042, 4706) + // Standard Error: 1_810 + .saturating_add(Weight::from_parts(29_815, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: Proxy Proxies (r:1 w:0) @@ -63,14 +63,14 @@ impl pallet_proxy::WeightInfo for WeightInfo { /// The range of component `p` is `[1, 31]`. fn proxy_announced (a: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `771 + a * (68 ±0) + p * (37 ±0)` - // Estimated: `13984` - // Minimum execution time: 89_488_000 picoseconds. - Weight::from_parts(89_482_872, 13984) - // Standard Error: 32_345 - .saturating_add(Weight::from_parts(691_852, 0).saturating_mul(a.into())) - // Standard Error: 33_465 - .saturating_add(Weight::from_parts(223_874, 0).saturating_mul(p.into())) + // Measured: `1011 + a * (68 ±0) + p * (37 ±0)` + // Estimated: `5698` + // Minimum execution time: 68_858_000 picoseconds. + Weight::from_parts(71_304_525, 5698) + // Standard Error: 4_860 + .saturating_add(Weight::from_parts(292_426, 0).saturating_mul(a.into())) + // Standard Error: 5_028 + .saturating_add(Weight::from_parts(20_095, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -82,12 +82,12 @@ impl pallet_proxy::WeightInfo for WeightInfo { /// The range of component `p` is `[1, 31]`. fn remove_announcement (a: u32, _p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `686 + a * (68 ±0)` - // Estimated: `9278` - // Minimum execution time: 56_423_000 picoseconds. - Weight::from_parts(66_546_340, 9278) - // Standard Error: 26_492 - .saturating_add(Weight::from_parts(428_552, 0).saturating_mul(a.into())) + // Measured: `926 + a * (68 ±0)` + // Estimated: `5698` + // Minimum execution time: 45_691_000 picoseconds. + Weight::from_parts(46_976_313, 5698) + // Standard Error: 37_400 + .saturating_add(Weight::from_parts(429_525, 0).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -99,14 +99,14 @@ impl pallet_proxy::WeightInfo for WeightInfo { /// The range of component `p` is `[1, 31]`. fn reject_announcement (a: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `686 + a * (68 ±0)` - // Estimated: `9278` - // Minimum execution time: 57_532_000 picoseconds. - Weight::from_parts(56_676_168, 9278) - // Standard Error: 54_986 - .saturating_add(Weight::from_parts(554_940, 0).saturating_mul(a.into())) - // Standard Error: 56_889 - .saturating_add(Weight::from_parts(249_802, 0).saturating_mul(p.into())) + // Measured: `926 + a * (68 ±0)` + // Estimated: `5698` + // Minimum execution time: 45_441_000 picoseconds. + Weight::from_parts(47_659_912, 5698) + // Standard Error: 3_967 + .saturating_add(Weight::from_parts(304_018, 0).saturating_mul(a.into())) + // Standard Error: 4_105 + .saturating_add(Weight::from_parts(5_528, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -120,14 +120,14 @@ impl pallet_proxy::WeightInfo for WeightInfo { /// The range of component `p` is `[1, 31]`. fn announce (a: u32, p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `703 + a * (68 ±0) + p * (37 ±0)` - // Estimated: `13984` - // Minimum execution time: 84_868_000 picoseconds. - Weight::from_parts(87_897_680, 13984) - // Standard Error: 37_442 - .saturating_add(Weight::from_parts(547_338, 0).saturating_mul(a.into())) - // Standard Error: 38_737 - .saturating_add(Weight::from_parts(209_492, 0).saturating_mul(p.into())) + // Measured: `943 + a * (68 ±0) + p * (37 ±0)` + // Estimated: `5698` + // Minimum execution time: 69_500_000 picoseconds. + Weight::from_parts(71_450_204, 5698) + // Standard Error: 3_637 + .saturating_add(Weight::from_parts(294_087, 0).saturating_mul(a.into())) + // Standard Error: 3_763 + .saturating_add(Weight::from_parts(33_253, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -138,12 +138,12 @@ impl pallet_proxy::WeightInfo for WeightInfo { /// The range of component `p` is `[1, 31]`. fn add_proxy (p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `518 + p * (37 ±0)` - // Estimated: `8286` - // Minimum execution time: 73_867_000 picoseconds. - Weight::from_parts(78_075_648, 8286) - // Standard Error: 24_031 - .saturating_add(Weight::from_parts(225_503, 0).saturating_mul(p.into())) + // Measured: `787 + p * (37 ±0)` + // Estimated: `4706` + // Minimum execution time: 60_491_000 picoseconds. + Weight::from_parts(61_796_024, 4706) + // Standard Error: 5_264 + .saturating_add(Weight::from_parts(83_677, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -154,12 +154,12 @@ impl pallet_proxy::WeightInfo for WeightInfo { /// The range of component `p` is `[1, 31]`. fn remove_proxy (p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `518 + p * (37 ±0)` - // Estimated: `8286` - // Minimum execution time: 64_216_000 picoseconds. - Weight::from_parts(71_319_965, 8286) - // Standard Error: 26_952 - .saturating_add(Weight::from_parts(159_834, 0).saturating_mul(p.into())) + // Measured: `787 + p * (37 ±0)` + // Estimated: `4706` + // Minimum execution time: 52_626_000 picoseconds. + Weight::from_parts(54_526_510, 4706) + // Standard Error: 4_342 + .saturating_add(Weight::from_parts(94_311, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -170,12 +170,12 @@ impl pallet_proxy::WeightInfo for WeightInfo { /// The range of component `p` is `[1, 31]`. fn remove_proxies (p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `518 + p * (37 ±0)` - // Estimated: `8286` - // Minimum execution time: 53_263_000 picoseconds. - Weight::from_parts(57_811_011, 8286) - // Standard Error: 35_717 - .saturating_add(Weight::from_parts(111_718, 0).saturating_mul(p.into())) + // Measured: `787 + p * (37 ±0)` + // Estimated: `4706` + // Minimum execution time: 43_587_000 picoseconds. + Weight::from_parts(44_521_020, 4706) + // Standard Error: 2_924 + .saturating_add(Weight::from_parts(22_119, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -186,12 +186,12 @@ impl pallet_proxy::WeightInfo for WeightInfo { /// The range of component `p` is `[1, 31]`. fn create_pure (p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `530` - // Estimated: `8286` - // Minimum execution time: 79_640_000 picoseconds. - Weight::from_parts(85_976_909, 8286) - // Standard Error: 30_283 - .saturating_add(Weight::from_parts(43_869, 0).saturating_mul(p.into())) + // Measured: `799` + // Estimated: `4706` + // Minimum execution time: 64_509_000 picoseconds. + Weight::from_parts(65_543_540, 4706) + // Standard Error: 77_269 + .saturating_add(Weight::from_parts(318_410, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -200,14 +200,12 @@ impl pallet_proxy::WeightInfo for WeightInfo { /// Storage: Tokens Accounts (r:1 w:1) /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) /// The range of component `p` is `[0, 30]`. - fn kill_pure (p: u32, ) -> Weight { + fn kill_pure (_p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `588 + p * (37 ±0)` - // Estimated: `8286` - // Minimum execution time: 56_441_000 picoseconds. - Weight::from_parts(60_343_237, 8286) - // Standard Error: 27_938 - .saturating_add(Weight::from_parts(139_626, 0).saturating_mul(p.into())) + // Measured: `857 + p * (37 ±0)` + // Estimated: `4706` + // Minimum execution time: 45_491_000 picoseconds. + Weight::from_parts(49_718_434, 4706) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } diff --git a/parachain/runtime/kintsugi/src/weights/pallet_scheduler.rs b/parachain/runtime/kintsugi/src/weights/pallet_scheduler.rs index ffb4901028..44b6ba58ff 100644 --- a/parachain/runtime/kintsugi/src/weights/pallet_scheduler.rs +++ b/parachain/runtime/kintsugi/src/weights/pallet_scheduler.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for pallet_scheduler //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-kcxvd`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/kintsugi/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -46,8 +46,8 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `31` // Estimated: `1489` - // Minimum execution time: 8_541_000 picoseconds. - Weight::from_parts(8_927_000, 1489) + // Minimum execution time: 6_894_000 picoseconds. + Weight::from_parts(6_984_000, 1489) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -58,10 +58,10 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `78 + s * (177 ±0)` // Estimated: `26848` - // Minimum execution time: 8_310_000 picoseconds. - Weight::from_parts(14_633_812, 26848) - // Standard Error: 16_105 - .saturating_add(Weight::from_parts(1_841_470, 0).saturating_mul(s.into())) + // Minimum execution time: 6_663_000 picoseconds. + Weight::from_parts(11_579_469, 26848) + // Standard Error: 7_998 + .saturating_add(Weight::from_parts(1_246_104, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -69,8 +69,8 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 14_924_000 picoseconds. - Weight::from_parts(15_279_000, 0) + // Minimum execution time: 11_183_000 picoseconds. + Weight::from_parts(11_724_000, 0) } /// Storage: Preimage PreimageFor (r:1 w:1) /// Proof: Preimage PreimageFor (max_values: None, max_size: Some(4194344), added: 4196819, mode: Measured) @@ -80,11 +80,11 @@ impl pallet_scheduler::WeightInfo for WeightInfo { fn service_task_fetched (s: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `179 + s * (1 ±0)` - // Estimated: `7200 + s * (1 ±0)` - // Minimum execution time: 49_555_000 picoseconds. - Weight::from_parts(51_008_000, 7200) - // Standard Error: 46 - .saturating_add(Weight::from_parts(2_955, 0).saturating_mul(s.into())) + // Estimated: `3644 + s * (1 ±0)` + // Minimum execution time: 37_595_000 picoseconds. + Weight::from_parts(37_886_000, 3644) + // Standard Error: 22 + .saturating_add(Weight::from_parts(1_735, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(s.into())) @@ -95,30 +95,30 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 19_039_000 picoseconds. - Weight::from_parts(20_529_000, 0) + // Minimum execution time: 14_689_000 picoseconds. + Weight::from_parts(14_970_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } fn service_task_periodic () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 14_412_000 picoseconds. - Weight::from_parts(15_086_000, 0) + // Minimum execution time: 11_463_000 picoseconds. + Weight::from_parts(11_683_000, 0) } fn execute_dispatch_signed () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_791_000 picoseconds. - Weight::from_parts(8_118_000, 0) + // Minimum execution time: 5_771_000 picoseconds. + Weight::from_parts(5_992_000, 0) } fn execute_dispatch_unsigned () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_642_000 picoseconds. - Weight::from_parts(7_739_000, 0) + // Minimum execution time: 5_961_000 picoseconds. + Weight::from_parts(6_042_000, 0) } /// Storage: Scheduler Agenda (r:1 w:1) /// Proof: Scheduler Agenda (max_values: None, max_size: Some(23383), added: 25858, mode: MaxEncodedLen) @@ -127,10 +127,10 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `78 + s * (177 ±0)` // Estimated: `26848` - // Minimum execution time: 32_937_000 picoseconds. - Weight::from_parts(40_348_469, 26848) - // Standard Error: 29_638 - .saturating_add(Weight::from_parts(2_085_210, 0).saturating_mul(s.into())) + // Minimum execution time: 26_003_000 picoseconds. + Weight::from_parts(30_478_209, 26848) + // Standard Error: 8_002 + .saturating_add(Weight::from_parts(1_211_223, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -143,10 +143,10 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `78 + s * (177 ±0)` // Estimated: `26848` - // Minimum execution time: 42_431_000 picoseconds. - Weight::from_parts(42_330_018, 26848) - // Standard Error: 35_409 - .saturating_add(Weight::from_parts(3_440_153, 0).saturating_mul(s.into())) + // Minimum execution time: 32_545_000 picoseconds. + Weight::from_parts(31_295_302, 26848) + // Standard Error: 8_871 + .saturating_add(Weight::from_parts(2_180_262, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -158,11 +158,11 @@ impl pallet_scheduler::WeightInfo for WeightInfo { fn schedule_named (s: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `186 + s * (189 ±0)` - // Estimated: `30361` - // Minimum execution time: 42_127_000 picoseconds. - Weight::from_parts(48_984_466, 30361) - // Standard Error: 43_916 - .saturating_add(Weight::from_parts(2_231_913, 0).saturating_mul(s.into())) + // Estimated: `26848` + // Minimum execution time: 32_144_000 picoseconds. + Weight::from_parts(37_517_490, 26848) + // Standard Error: 13_180 + .saturating_add(Weight::from_parts(1_293_394, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -174,11 +174,11 @@ impl pallet_scheduler::WeightInfo for WeightInfo { fn cancel_named (s: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `217 + s * (188 ±0)` - // Estimated: `30361` - // Minimum execution time: 45_262_000 picoseconds. - Weight::from_parts(44_229_671, 30361) - // Standard Error: 34_685 - .saturating_add(Weight::from_parts(3_525_498, 0).saturating_mul(s.into())) + // Estimated: `26848` + // Minimum execution time: 35_391_000 picoseconds. + Weight::from_parts(35_199_015, 26848) + // Standard Error: 9_723 + .saturating_add(Weight::from_parts(2_176_761, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } diff --git a/parachain/runtime/kintsugi/src/weights/pallet_timestamp.rs b/parachain/runtime/kintsugi/src/weights/pallet_timestamp.rs index 6931ab7c27..019b5e9462 100644 --- a/parachain/runtime/kintsugi/src/weights/pallet_timestamp.rs +++ b/parachain/runtime/kintsugi/src/weights/pallet_timestamp.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for pallet_timestamp //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-kcxvd`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/kintsugi/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -42,14 +42,14 @@ impl pallet_timestamp::WeightInfo for WeightInfo { /// Storage: Timestamp Now (r:1 w:1) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: Aura CurrentSlot (r:1 w:0) - /// Proof: Aura CurrentSlot (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + /// Storage: unknown `0x13fe8e6572d0617ab8b9721f4e28cb46` (r:1 w:0) + /// Proof Skipped: unknown `0x13fe8e6572d0617ab8b9721f4e28cb46` (r:1 w:0) fn set () -> Weight { // Proof Size summary in bytes: - // Measured: `194` - // Estimated: `2986` - // Minimum execution time: 22_496_000 picoseconds. - Weight::from_parts(24_059_000, 2986) + // Measured: `166` + // Estimated: `3631` + // Minimum execution time: 16_172_000 picoseconds. + Weight::from_parts(16_593_000, 3631) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -57,7 +57,7 @@ impl pallet_timestamp::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `94` // Estimated: `0` - // Minimum execution time: 8_958_000 picoseconds. - Weight::from_parts(9_191_000, 0) + // Minimum execution time: 6_914_000 picoseconds. + Weight::from_parts(7_194_000, 0) } } \ No newline at end of file diff --git a/parachain/runtime/kintsugi/src/weights/pallet_utility.rs b/parachain/runtime/kintsugi/src/weights/pallet_utility.rs index 01123199c0..d362bba118 100644 --- a/parachain/runtime/kintsugi/src/weights/pallet_utility.rs +++ b/parachain/runtime/kintsugi/src/weights/pallet_utility.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for pallet_utility //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-kcxvd`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/kintsugi/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -45,43 +45,43 @@ impl pallet_utility::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 18_126_000 picoseconds. - Weight::from_parts(18_400_000, 0) - // Standard Error: 12_779 - .saturating_add(Weight::from_parts(14_066_216, 0).saturating_mul(c.into())) + // Minimum execution time: 14_058_000 picoseconds. + Weight::from_parts(14_189_000, 0) + // Standard Error: 4_520 + .saturating_add(Weight::from_parts(10_937_825, 0).saturating_mul(c.into())) } fn as_derivative () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 14_487_000 picoseconds. - Weight::from_parts(15_128_000, 0) + // Minimum execution time: 11_062_000 picoseconds. + Weight::from_parts(11_383_000, 0) } /// The range of component `c` is `[0, 1000]`. fn batch_all (c: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 18_235_000 picoseconds. - Weight::from_parts(18_356_000, 0) - // Standard Error: 15_030 - .saturating_add(Weight::from_parts(14_801_634, 0).saturating_mul(c.into())) + // Minimum execution time: 14_068_000 picoseconds. + Weight::from_parts(20_266_041, 0) + // Standard Error: 6_485 + .saturating_add(Weight::from_parts(11_505_085, 0).saturating_mul(c.into())) } fn dispatch_as () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 24_836_000 picoseconds. - Weight::from_parts(25_824_000, 0) + // Minimum execution time: 19_228_000 picoseconds. + Weight::from_parts(20_481_000, 0) } /// The range of component `c` is `[0, 1000]`. fn force_batch (c: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 18_494_000 picoseconds. - Weight::from_parts(1_478_718, 0) - // Standard Error: 28_923 - .saturating_add(Weight::from_parts(14_190_278, 0).saturating_mul(c.into())) + // Minimum execution time: 14_228_000 picoseconds. + Weight::from_parts(6_535_190, 0) + // Standard Error: 79_731 + .saturating_add(Weight::from_parts(11_047_964, 0).saturating_mul(c.into())) } } \ No newline at end of file diff --git a/parachain/runtime/kintsugi/src/weights/pallet_xcm.rs b/parachain/runtime/kintsugi/src/weights/pallet_xcm.rs index 8155de06ec..e432f895ad 100644 --- a/parachain/runtime/kintsugi/src/weights/pallet_xcm.rs +++ b/parachain/runtime/kintsugi/src/weights/pallet_xcm.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for pallet_xcm //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-kcxvd`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/kintsugi/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -53,9 +53,9 @@ impl pallet_xcm::WeightInfo for WeightInfo { fn send () -> Weight { // Proof Size summary in bytes: // Measured: `107` - // Estimated: `9940` - // Minimum execution time: 66_537_000 picoseconds. - Weight::from_parts(74_628_000, 9940) + // Estimated: `3572` + // Minimum execution time: 51_082_000 picoseconds. + Weight::from_parts(52_054_000, 3572) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -65,20 +65,20 @@ impl pallet_xcm::WeightInfo for WeightInfo { /// Proof Skipped: UnknownTokens ConcreteFungibleBalances (max_values: None, max_size: None, mode: Measured) fn teleport_assets () -> Weight { // Proof Size summary in bytes: - // Measured: `245` - // Estimated: `5199` - // Minimum execution time: 69_869_000 picoseconds. - Weight::from_parts(79_130_000, 5199) + // Measured: `282` + // Estimated: `3747` + // Minimum execution time: 56_533_000 picoseconds. + Weight::from_parts(58_086_000, 3747) .saturating_add(T::DbWeight::get().reads(2_u64)) } /// Storage: ParachainInfo ParachainId (r:1 w:0) /// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) fn reserve_transfer_assets () -> Weight { // Proof Size summary in bytes: - // Measured: `32` + // Measured: `69` // Estimated: `1489` - // Minimum execution time: 50_860_000 picoseconds. - Weight::from_parts(59_327_000, 1489) + // Minimum execution time: 40_611_000 picoseconds. + Weight::from_parts(42_425_000, 1489) .saturating_add(T::DbWeight::get().reads(1_u64)) } /// Storage: Benchmark Override (r:0 w:0) @@ -96,8 +96,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 25_304_000 picoseconds. - Weight::from_parts(26_576_000, 0) + // Minimum execution time: 19_199_000 picoseconds. + Weight::from_parts(19_539_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: PolkadotXcm SafeXcmVersion (r:0 w:1) @@ -106,8 +106,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 8_211_000 picoseconds. - Weight::from_parts(8_870_000, 0) + // Minimum execution time: 6_563_000 picoseconds. + Weight::from_parts(6_774_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: PolkadotXcm VersionNotifiers (r:1 w:1) @@ -129,9 +129,9 @@ impl pallet_xcm::WeightInfo for WeightInfo { fn force_subscribe_version_notify () -> Weight { // Proof Size summary in bytes: // Measured: `107` - // Estimated: `15211` - // Minimum execution time: 78_883_000 picoseconds. - Weight::from_parts(79_870_000, 15211) + // Estimated: `3572` + // Minimum execution time: 59_699_000 picoseconds. + Weight::from_parts(60_862_000, 3572) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -152,20 +152,30 @@ impl pallet_xcm::WeightInfo for WeightInfo { fn force_unsubscribe_version_notify () -> Weight { // Proof Size summary in bytes: // Measured: `290` - // Estimated: `14900` - // Minimum execution time: 80_745_000 picoseconds. - Weight::from_parts(91_782_000, 14900) + // Estimated: `3755` + // Minimum execution time: 59_269_000 picoseconds. + Weight::from_parts(60_111_000, 3755) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } + /// Storage: PolkadotXcm XcmExecutionSuspended (r:0 w:1) + /// Proof Skipped: PolkadotXcm XcmExecutionSuspended (max_values: Some(1), max_size: None, mode: Measured) + fn force_suspension () -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 6_423_000 picoseconds. + Weight::from_parts(6_623_000, 0) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } /// Storage: PolkadotXcm SupportedVersion (r:4 w:2) /// Proof Skipped: PolkadotXcm SupportedVersion (max_values: None, max_size: None, mode: Measured) fn migrate_supported_version () -> Weight { // Proof Size summary in bytes: // Measured: `162` // Estimated: `11052` - // Minimum execution time: 39_508_000 picoseconds. - Weight::from_parts(40_092_000, 11052) + // Minimum execution time: 32_595_000 picoseconds. + Weight::from_parts(33_016_000, 11052) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -175,8 +185,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `166` // Estimated: `11056` - // Minimum execution time: 37_997_000 picoseconds. - Weight::from_parts(39_630_000, 11056) + // Minimum execution time: 32_074_000 picoseconds. + Weight::from_parts(32_405_000, 11056) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -186,8 +196,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `173` // Estimated: `13538` - // Minimum execution time: 40_462_000 picoseconds. - Weight::from_parts(43_235_000, 13538) + // Minimum execution time: 33_587_000 picoseconds. + Weight::from_parts(34_449_000, 13538) .saturating_add(T::DbWeight::get().reads(5_u64)) } /// Storage: PolkadotXcm VersionNotifyTargets (r:2 w:1) @@ -205,9 +215,9 @@ impl pallet_xcm::WeightInfo for WeightInfo { fn notify_current_targets () -> Weight { // Proof Size summary in bytes: // Measured: `174` - // Estimated: `16389` - // Minimum execution time: 71_805_000 picoseconds. - Weight::from_parts(76_253_000, 16389) + // Estimated: `6114` + // Minimum execution time: 55_441_000 picoseconds. + Weight::from_parts(56_223_000, 6114) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -217,8 +227,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `206` // Estimated: `8621` - // Minimum execution time: 22_383_000 picoseconds. - Weight::from_parts(23_043_000, 8621) + // Minimum execution time: 18_367_000 picoseconds. + Weight::from_parts(18_698_000, 8621) .saturating_add(T::DbWeight::get().reads(3_u64)) } /// Storage: PolkadotXcm VersionNotifyTargets (r:4 w:2) @@ -227,8 +237,8 @@ impl pallet_xcm::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `173` // Estimated: `11063` - // Minimum execution time: 40_122_000 picoseconds. - Weight::from_parts(41_402_000, 11063) + // Minimum execution time: 31_713_000 picoseconds. + Weight::from_parts(32_324_000, 11063) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -247,16 +257,9 @@ impl pallet_xcm::WeightInfo for WeightInfo { fn migrate_and_notify_old_targets () -> Weight { // Proof Size summary in bytes: // Measured: `177` - // Estimated: `21357` - // Minimum execution time: 88_488_000 picoseconds. - Weight::from_parts(97_923_000, 21357) - .saturating_add(T::DbWeight::get().reads(9_u64)) - .saturating_add(T::DbWeight::get().writes(4_u64)) - } - - fn force_suspension() -> Weight { - // todo: write and run benchmark - Weight::from_parts(97_021_000, 21357) + // Estimated: `11067` + // Minimum execution time: 68_216_000 picoseconds. + Weight::from_parts(68_848_000, 11067) .saturating_add(T::DbWeight::get().reads(9_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } diff --git a/parachain/runtime/kintsugi/src/weights/pallet_xcm_benchmarks_fungible.rs b/parachain/runtime/kintsugi/src/weights/pallet_xcm_benchmarks_fungible.rs index 046d71cadd..fe7d553d49 100644 --- a/parachain/runtime/kintsugi/src/weights/pallet_xcm_benchmarks_fungible.rs +++ b/parachain/runtime/kintsugi/src/weights/pallet_xcm_benchmarks_fungible.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for pallet_xcm_benchmarks::fungible //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-kcxvd`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/kintsugi/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -48,10 +48,10 @@ impl WeightInfo { /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) pub fn withdraw_asset () -> Weight { // Proof Size summary in bytes: - // Measured: `544` - // Estimated: `11089` - // Minimum execution time: 64_173_000 picoseconds. - Weight::from_parts(66_120_000, 11089) + // Measured: `761` + // Estimated: `4226` + // Minimum execution time: 54_249_000 picoseconds. + Weight::from_parts(55_932_000, 4226) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -61,10 +61,10 @@ impl WeightInfo { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) pub fn transfer_asset () -> Weight { // Proof Size summary in bytes: - // Measured: `370` - // Estimated: `12366` - // Minimum execution time: 81_841_000 picoseconds. - Weight::from_parts(83_747_000, 12366) + // Measured: `715` + // Estimated: `6196` + // Minimum execution time: 72_435_000 picoseconds. + Weight::from_parts(73_036_000, 6196) .saturating_add(T::DbWeight::get().reads(4_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -86,10 +86,10 @@ impl WeightInfo { /// Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) pub fn transfer_reserve_asset () -> Weight { // Proof Size summary in bytes: - // Measured: `509` - // Estimated: `25805` - // Minimum execution time: 140_692_000 picoseconds. - Weight::from_parts(160_704_000, 25805) + // Measured: `891` + // Estimated: `6196` + // Minimum execution time: 112_976_000 picoseconds. + Weight::from_parts(114_389_000, 6196) .saturating_add(T::DbWeight::get().reads(10_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -101,10 +101,10 @@ impl WeightInfo { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) pub fn deposit_asset () -> Weight { // Proof Size summary in bytes: - // Measured: `218` - // Estimated: `10673` - // Minimum execution time: 71_386_000 picoseconds. - Weight::from_parts(73_084_000, 10673) + // Measured: `513` + // Estimated: `3593` + // Minimum execution time: 58_737_000 picoseconds. + Weight::from_parts(60_220_000, 3593) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -128,10 +128,10 @@ impl WeightInfo { /// Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) pub fn deposit_reserve_asset () -> Weight { // Proof Size summary in bytes: - // Measured: `357` - // Estimated: `23352` - // Minimum execution time: 128_099_000 picoseconds. - Weight::from_parts(131_486_000, 23352) + // Measured: `689` + // Estimated: `4154` + // Minimum execution time: 105_722_000 picoseconds. + Weight::from_parts(107_395_000, 4154) .saturating_add(T::DbWeight::get().reads(9_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -149,10 +149,10 @@ impl WeightInfo { /// Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) pub fn initiate_teleport () -> Weight { // Proof Size summary in bytes: - // Measured: `139` - // Estimated: `11589` - // Minimum execution time: 67_096_000 picoseconds. - Weight::from_parts(72_255_000, 11589) + // Measured: `176` + // Estimated: `3641` + // Minimum execution time: 50_992_000 picoseconds. + Weight::from_parts(52_284_000, 3641) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } diff --git a/parachain/runtime/kintsugi/src/weights/pallet_xcm_benchmarks_generic.rs b/parachain/runtime/kintsugi/src/weights/pallet_xcm_benchmarks_generic.rs index 656ab94675..397efb636a 100644 --- a/parachain/runtime/kintsugi/src/weights/pallet_xcm_benchmarks_generic.rs +++ b/parachain/runtime/kintsugi/src/weights/pallet_xcm_benchmarks_generic.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for pallet_xcm_benchmarks::generic //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-kcxvd`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/kintsugi/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -54,10 +54,10 @@ impl WeightInfo { /// Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) pub fn report_holding () -> Weight { // Proof Size summary in bytes: - // Measured: `139` - // Estimated: `11589` - // Minimum execution time: 156_300_000 picoseconds. - Weight::from_parts(160_113_000, 11589) + // Measured: `176` + // Estimated: `3641` + // Minimum execution time: 107_866_000 picoseconds. + Weight::from_parts(109_589_000, 3641) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -65,8 +65,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_353_000 picoseconds. - Weight::from_parts(4_685_000, 0) + // Minimum execution time: 3_166_000 picoseconds. + Weight::from_parts(3_868_000, 0) } /// Storage: PolkadotXcm Queries (r:1 w:0) /// Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) @@ -74,61 +74,61 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `103` // Estimated: `3568` - // Minimum execution time: 25_335_000 picoseconds. - Weight::from_parts(26_810_000, 3568) + // Minimum execution time: 19_479_000 picoseconds. + Weight::from_parts(20_210_000, 3568) .saturating_add(T::DbWeight::get().reads(1_u64)) } pub fn transact () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 16_471_000 picoseconds. - Weight::from_parts(19_132_000, 0) + // Minimum execution time: 11_463_000 picoseconds. + Weight::from_parts(12_274_000, 0) } /// Storage: ParachainInfo ParachainId (r:1 w:0) /// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) pub fn refund_surplus () -> Weight { // Proof Size summary in bytes: - // Measured: `32` + // Measured: `69` // Estimated: `1489` - // Minimum execution time: 14_485_000 picoseconds. - Weight::from_parts(15_439_000, 1489) + // Minimum execution time: 12_525_000 picoseconds. + Weight::from_parts(13_066_000, 1489) .saturating_add(T::DbWeight::get().reads(1_u64)) } pub fn set_error_handler () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_213_000 picoseconds. - Weight::from_parts(5_462_000, 0) + // Minimum execution time: 3_507_000 picoseconds. + Weight::from_parts(3_607_000, 0) } pub fn set_appendix () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_252_000 picoseconds. - Weight::from_parts(4_679_000, 0) + // Minimum execution time: 2_796_000 picoseconds. + Weight::from_parts(3_637_000, 0) } pub fn clear_error () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_155_000 picoseconds. - Weight::from_parts(4_524_000, 0) + // Minimum execution time: 2_755_000 picoseconds. + Weight::from_parts(3_527_000, 0) } pub fn descend_origin () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_300_000 picoseconds. - Weight::from_parts(5_600_000, 0) + // Minimum execution time: 3_587_000 picoseconds. + Weight::from_parts(4_399_000, 0) } pub fn clear_origin () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_157_000 picoseconds. - Weight::from_parts(4_453_000, 0) + // Minimum execution time: 2_716_000 picoseconds. + Weight::from_parts(3_497_000, 0) } /// Storage: ParachainInfo ParachainId (r:1 w:0) /// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -144,10 +144,10 @@ impl WeightInfo { /// Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) pub fn report_error () -> Weight { // Proof Size summary in bytes: - // Measured: `139` - // Estimated: `11589` - // Minimum execution time: 58_588_000 picoseconds. - Weight::from_parts(63_887_000, 11589) + // Measured: `176` + // Estimated: `3641` + // Minimum execution time: 44_138_000 picoseconds. + Weight::from_parts(44_930_000, 3641) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -157,8 +157,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `160` // Estimated: `3625` - // Minimum execution time: 34_655_000 picoseconds. - Weight::from_parts(38_112_000, 3625) + // Minimum execution time: 26_774_000 picoseconds. + Weight::from_parts(27_084_000, 3625) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -166,8 +166,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_282_000 picoseconds. - Weight::from_parts(5_323_000, 0) + // Minimum execution time: 2_905_000 picoseconds. + Weight::from_parts(3_507_000, 0) } /// Storage: PolkadotXcm VersionNotifyTargets (r:1 w:1) /// Proof Skipped: PolkadotXcm VersionNotifyTargets (max_values: None, max_size: None, mode: Measured) @@ -184,9 +184,9 @@ impl WeightInfo { pub fn subscribe_version () -> Weight { // Proof Size summary in bytes: // Measured: `107` - // Estimated: `13512` - // Minimum execution time: 65_611_000 picoseconds. - Weight::from_parts(69_807_000, 13512) + // Estimated: `3572` + // Minimum execution time: 50_241_000 picoseconds. + Weight::from_parts(51_043_000, 3572) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -196,8 +196,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 9_506_000 picoseconds. - Weight::from_parts(10_399_000, 0) + // Minimum execution time: 7_625_000 picoseconds. + Weight::from_parts(7_806_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: ParachainInfo ParachainId (r:1 w:0) @@ -214,10 +214,10 @@ impl WeightInfo { /// Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) pub fn initiate_reserve_withdraw () -> Weight { // Proof Size summary in bytes: - // Measured: `139` - // Estimated: `11589` - // Minimum execution time: 151_961_000 picoseconds. - Weight::from_parts(161_253_000, 11589) + // Measured: `176` + // Estimated: `3641` + // Minimum execution time: 104_399_000 picoseconds. + Weight::from_parts(106_212_000, 3641) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -225,36 +225,36 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 29_487_000 picoseconds. - Weight::from_parts(30_374_000, 0) + // Minimum execution time: 19_429_000 picoseconds. + Weight::from_parts(20_181_000, 0) } pub fn expect_asset () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_760_000 picoseconds. - Weight::from_parts(6_040_000, 0) + // Minimum execution time: 4_649_000 picoseconds. + Weight::from_parts(4_750_000, 0) } pub fn expect_origin () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_327_000 picoseconds. - Weight::from_parts(4_653_000, 0) + // Minimum execution time: 3_608_000 picoseconds. + Weight::from_parts(3_707_000, 0) } pub fn expect_error () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_229_000 picoseconds. - Weight::from_parts(4_342_000, 0) + // Minimum execution time: 2_716_000 picoseconds. + Weight::from_parts(3_477_000, 0) } pub fn expect_transact_status () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_686_000 picoseconds. - Weight::from_parts(6_677_000, 0) + // Minimum execution time: 3_798_000 picoseconds. + Weight::from_parts(3_858_000, 0) } /// Storage: ParachainInfo ParachainId (r:1 w:0) /// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -270,10 +270,10 @@ impl WeightInfo { /// Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) pub fn query_pallet () -> Weight { // Proof Size summary in bytes: - // Measured: `139` - // Estimated: `11589` - // Minimum execution time: 85_092_000 picoseconds. - Weight::from_parts(96_210_000, 11589) + // Measured: `176` + // Estimated: `3641` + // Minimum execution time: 67_836_000 picoseconds. + Weight::from_parts(69_259_000, 3641) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -281,8 +281,8 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 25_774_000 picoseconds. - Weight::from_parts(26_317_000, 0) + // Minimum execution time: 23_076_000 picoseconds. + Weight::from_parts(23_518_000, 0) } /// Storage: ParachainInfo ParachainId (r:1 w:0) /// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -298,10 +298,10 @@ impl WeightInfo { /// Proof Skipped: ParachainSystem PendingUpwardMessages (max_values: Some(1), max_size: None, mode: Measured) pub fn report_transact_status () -> Weight { // Proof Size summary in bytes: - // Measured: `139` - // Estimated: `11589` - // Minimum execution time: 57_377_000 picoseconds. - Weight::from_parts(61_363_000, 11589) + // Measured: `176` + // Estimated: `3641` + // Minimum execution time: 44_268_000 picoseconds. + Weight::from_parts(45_131_000, 3641) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -309,35 +309,35 @@ impl WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_255_000 picoseconds. - Weight::from_parts(4_485_000, 0) + // Minimum execution time: 2_746_000 picoseconds. + Weight::from_parts(3_547_000, 0) } pub fn set_topic () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_172_000 picoseconds. - Weight::from_parts(4_614_000, 0) + // Minimum execution time: 2_665_000 picoseconds. + Weight::from_parts(3_467_000, 0) } pub fn clear_topic () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_104_000 picoseconds. - Weight::from_parts(4_561_000, 0) + // Minimum execution time: 3_266_000 picoseconds. + Weight::from_parts(3_467_000, 0) } pub fn set_fees_mode () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_145_000 picoseconds. - Weight::from_parts(4_417_000, 0) + // Minimum execution time: 2_786_000 picoseconds. + Weight::from_parts(3_447_000, 0) } pub fn unpaid_execution () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_399_000 picoseconds. - Weight::from_parts(4_617_000, 0) + // Minimum execution time: 3_537_000 picoseconds. + Weight::from_parts(3_657_000, 0) } } \ No newline at end of file diff --git a/parachain/runtime/kintsugi/src/weights/redeem.rs b/parachain/runtime/kintsugi/src/weights/redeem.rs index a5e98e185d..44a280e029 100644 --- a/parachain/runtime/kintsugi/src/weights/redeem.rs +++ b/parachain/runtime/kintsugi/src/weights/redeem.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for redeem //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-kcxvd`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/kintsugi/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -40,8 +40,6 @@ pub struct WeightInfo(PhantomData); impl redeem::WeightInfo for WeightInfo { - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:2 w:1) /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) /// Storage: Fee RedeemFee (r:1 w:0) @@ -96,11 +94,11 @@ impl redeem::WeightInfo for WeightInfo { /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(245), added: 2720, mode: MaxEncodedLen) fn request_redeem () -> Weight { // Proof Size summary in bytes: - // Measured: `2962` - // Estimated: `73398` - // Minimum execution time: 424_725_000 picoseconds. - Weight::from_parts(436_272_000, 73398) - .saturating_add(T::DbWeight::get().reads(29_u64)) + // Measured: `3189` + // Estimated: `6260` + // Minimum execution time: 311_614_000 picoseconds. + Weight::from_parts(319_349_000, 6260) + .saturating_add(T::DbWeight::get().reads(28_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } /// Storage: Tokens Accounts (r:3 w:3) @@ -129,10 +127,10 @@ impl redeem::WeightInfo for WeightInfo { /// Proof: Loans AccountDeposits (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) fn liquidation_redeem () -> Weight { // Proof Size summary in bytes: - // Measured: `1918` - // Estimated: `52855` - // Minimum execution time: 381_943_000 picoseconds. - Weight::from_parts(397_011_000, 52855) + // Measured: `2173` + // Estimated: `8760` + // Minimum execution time: 287_687_000 picoseconds. + Weight::from_parts(292_145_000, 8760) .saturating_add(T::DbWeight::get().reads(16_u64)) .saturating_add(T::DbWeight::get().writes(11_u64)) } @@ -162,23 +160,23 @@ impl redeem::WeightInfo for WeightInfo { /// The range of component `i` is `[1, 10]`. /// The range of component `o` is `[2, 3]`. /// The range of component `b` is `[541, 2048]`. - fn execute_redeem (h: u32, i: u32, _o: u32, b: u32, ) -> Weight { + fn execute_redeem (h: u32, i: u32, o: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `2122` - // Estimated: `29111` - // Minimum execution time: 240_578_000 picoseconds. - Weight::from_parts(218_934_992, 29111) - // Standard Error: 139_944 - .saturating_add(Weight::from_parts(8_639_545, 0).saturating_mul(h.into())) - // Standard Error: 126_161 - .saturating_add(Weight::from_parts(856_176, 0).saturating_mul(i.into())) - // Standard Error: 770 - .saturating_add(Weight::from_parts(4_629, 0).saturating_mul(b.into())) + // Measured: `2295 + o * (1 ±0)` + // Estimated: `3725` + // Minimum execution time: 184_800_000 picoseconds. + Weight::from_parts(149_034_719, 3725) + // Standard Error: 137_585 + .saturating_add(Weight::from_parts(3_833_551, 0).saturating_mul(h.into())) + // Standard Error: 124_035 + .saturating_add(Weight::from_parts(1_176_171, 0).saturating_mul(i.into())) + // Standard Error: 751_913 + .saturating_add(Weight::from_parts(1_964_806, 0).saturating_mul(o.into())) + // Standard Error: 757 + .saturating_add(Weight::from_parts(5_490, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(11_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: Redeem RedeemRequests (r:1 w:1) /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(245), added: 2720, mode: MaxEncodedLen) /// Storage: Redeem RedeemPeriod (r:1 w:0) @@ -250,11 +248,11 @@ impl redeem::WeightInfo for WeightInfo { /// Storage: VaultRewards TotalStake (r:1 w:1) /// Proof: VaultRewards TotalStake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) /// Storage: VaultRewards RewardCurrencies (r:1 w:0) - /// Proof: VaultRewards RewardCurrencies (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) + /// Proof: VaultRewards RewardCurrencies (max_values: None, max_size: Some(50), added: 2525, mode: MaxEncodedLen) /// Storage: VaultCapacity TotalStake (r:1 w:1) /// Proof: VaultCapacity TotalStake (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) /// Storage: VaultCapacity RewardCurrencies (r:1 w:0) - /// Proof: VaultCapacity RewardCurrencies (max_values: None, max_size: Some(127), added: 2602, mode: MaxEncodedLen) + /// Proof: VaultCapacity RewardCurrencies (max_values: None, max_size: Some(39), added: 2514, mode: MaxEncodedLen) /// Storage: Loans RewardSupplyState (r:1 w:1) /// Proof: Loans RewardSupplyState (max_values: None, max_size: Some(47), added: 2522, mode: MaxEncodedLen) /// Storage: Loans RewardSupplySpeed (r:1 w:0) @@ -269,15 +267,13 @@ impl redeem::WeightInfo for WeightInfo { /// Proof: VaultRegistry PunishmentDelay (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) fn cancel_redeem_reimburse () -> Weight { // Proof Size summary in bytes: - // Measured: `5125` - // Estimated: `179726` - // Minimum execution time: 1_201_453_000 picoseconds. - Weight::from_parts(1_239_154_000, 179726) - .saturating_add(T::DbWeight::get().reads(60_u64)) + // Measured: `5430` + // Estimated: `11350` + // Minimum execution time: 850_042_000 picoseconds. + Weight::from_parts(865_223_000, 11350) + .saturating_add(T::DbWeight::get().reads(59_u64)) .saturating_add(T::DbWeight::get().writes(29_u64)) } - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: Redeem RedeemRequests (r:1 w:1) /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(245), added: 2720, mode: MaxEncodedLen) /// Storage: Redeem RedeemPeriod (r:1 w:0) @@ -349,11 +345,11 @@ impl redeem::WeightInfo for WeightInfo { /// Storage: VaultRewards TotalStake (r:1 w:1) /// Proof: VaultRewards TotalStake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) /// Storage: VaultRewards RewardCurrencies (r:1 w:0) - /// Proof: VaultRewards RewardCurrencies (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) + /// Proof: VaultRewards RewardCurrencies (max_values: None, max_size: Some(50), added: 2525, mode: MaxEncodedLen) /// Storage: VaultCapacity TotalStake (r:1 w:1) /// Proof: VaultCapacity TotalStake (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) /// Storage: VaultCapacity RewardCurrencies (r:1 w:0) - /// Proof: VaultCapacity RewardCurrencies (max_values: None, max_size: Some(127), added: 2602, mode: MaxEncodedLen) + /// Proof: VaultCapacity RewardCurrencies (max_values: None, max_size: Some(39), added: 2514, mode: MaxEncodedLen) /// Storage: Loans RewardSupplyState (r:1 w:1) /// Proof: Loans RewardSupplyState (max_values: None, max_size: Some(47), added: 2522, mode: MaxEncodedLen) /// Storage: Loans RewardSupplySpeed (r:1 w:0) @@ -368,11 +364,11 @@ impl redeem::WeightInfo for WeightInfo { /// Proof: VaultRegistry PunishmentDelay (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) fn cancel_redeem_retry () -> Weight { // Proof Size summary in bytes: - // Measured: `5125` - // Estimated: `177216` - // Minimum execution time: 1_130_199_000 picoseconds. - Weight::from_parts(1_160_823_000, 177216) - .saturating_add(T::DbWeight::get().reads(59_u64)) + // Measured: `5430` + // Estimated: `11350` + // Minimum execution time: 773_779_000 picoseconds. + Weight::from_parts(789_120_000, 11350) + .saturating_add(T::DbWeight::get().reads(58_u64)) .saturating_add(T::DbWeight::get().writes(28_u64)) } /// Storage: Redeem RedeemPeriod (r:0 w:1) @@ -381,8 +377,8 @@ impl redeem::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 23_819_000 picoseconds. - Weight::from_parts(25_640_000, 0) + // Minimum execution time: 18_106_000 picoseconds. + Weight::from_parts(18_667_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: VaultRegistry Vaults (r:1 w:1) @@ -393,11 +389,70 @@ impl redeem::WeightInfo for WeightInfo { /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) fn self_redeem () -> Weight { // Proof Size summary in bytes: - // Measured: `1171` - // Estimated: `10805` - // Minimum execution time: 197_605_000 picoseconds. - Weight::from_parts(204_517_000, 10805) + // Measured: `1427` + // Estimated: `3725` + // Minimum execution time: 150_121_000 picoseconds. + Weight::from_parts(151_013_000, 3725) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } + /// Storage: VaultRegistry Vaults (r:2 w:2) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) + /// Storage: BTCRelay StartBlockHeight (r:1 w:0) + /// Proof: BTCRelay StartBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: BTCRelay StableBitcoinConfirmations (r:1 w:0) + /// Proof: BTCRelay StableBitcoinConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: BTCRelay BestBlockHeight (r:1 w:0) + /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: Oracle Aggregate (r:3 w:0) + /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) + /// Storage: Fee IssueGriefingCollateral (r:1 w:0) + /// Proof: Fee IssueGriefingCollateral (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:1 w:1) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: Issue IssueBtcDustValue (r:1 w:0) + /// Proof: Issue IssueBtcDustValue (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) + /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) + /// Storage: VaultStaking Nonce (r:2 w:0) + /// Proof: VaultStaking Nonce (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) + /// Storage: VaultStaking TotalCurrentStake (r:2 w:0) + /// Proof: VaultStaking TotalCurrentStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) + /// Storage: Fee IssueFee (r:1 w:0) + /// Proof: Fee IssueFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// Storage: Security Nonce (r:1 w:1) + /// Proof: Security Nonce (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) + /// Storage: System ParentHash (r:1 w:0) + /// Proof: System ParentHash (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) + /// Storage: VaultRegistry VaultBitcoinPublicKey (r:1 w:0) + /// Proof: VaultRegistry VaultBitcoinPublicKey (max_values: None, max_size: Some(81), added: 2556, mode: MaxEncodedLen) + /// Storage: Security ActiveBlockCount (r:1 w:0) + /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: Issue IssuePeriod (r:1 w:0) + /// Proof: Issue IssuePeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: Fee RedeemFee (r:1 w:0) + /// Proof: Fee RedeemFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// Storage: Redeem RedeemTransactionSize (r:1 w:0) + /// Proof: Redeem RedeemTransactionSize (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: Redeem RedeemBtcDustValue (r:1 w:0) + /// Proof: Redeem RedeemBtcDustValue (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// Storage: VaultRegistry PremiumRedeemThreshold (r:1 w:0) + /// Proof: VaultRegistry PremiumRedeemThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) + /// Storage: Redeem RedeemPeriod (r:1 w:0) + /// Proof: Redeem RedeemPeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: Issue IssueRequests (r:0 w:1) + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) + /// Storage: Redeem RedeemRequests (r:0 w:1) + /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(278), added: 2753, mode: MaxEncodedLen) + /// Storage: Redeem Requests (r:0 w:1) + /// Proof: Redeem Requests (max_values: None, max_size: Some(80), added: 2555, mode: MaxEncodedLen) + fn request_replace () -> Weight { + // Proof Size summary in bytes: + // Measured: `3371` + // Estimated: `8547` + // Minimum execution time: 38_952_000_000 picoseconds. + Weight::from_parts(38_952_000_000, 8547) + .saturating_add(T::DbWeight::get().reads(27_u64)) + .saturating_add(T::DbWeight::get().writes(7_u64)) + } } \ No newline at end of file diff --git a/parachain/runtime/kintsugi/src/weights/replace.rs b/parachain/runtime/kintsugi/src/weights/replace.rs deleted file mode 100644 index 1c3a20f9fd..0000000000 --- a/parachain/runtime/kintsugi/src/weights/replace.rs +++ /dev/null @@ -1,323 +0,0 @@ - -//! Autogenerated weights for replace -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 - -// Executed Command: -// target/release/interbtc-parachain -// benchmark -// pallet -// --pallet -// * -// --extrinsic -// * -// --chain -// kintsugi-dev -// --execution=wasm -// --wasm-execution=compiled -// --steps -// 50 -// --repeat -// 10 -// --output -// ../tmp-weight/ -// --template -// .deploy/runtime-weight-template.hbs - -#![cfg_attr(rustfmt, rustfmt_skip)] -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use sp_std::marker::PhantomData; - -/// Weights for replace using the Substrate node and recommended hardware. -pub struct WeightInfo(PhantomData); - -impl replace::WeightInfo for WeightInfo { - - /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) - /// Storage: Nomination Vaults (r:1 w:0) - /// Proof: Nomination Vaults (max_values: None, max_size: Some(71), added: 2546, mode: MaxEncodedLen) - /// Storage: Replace ReplaceBtcDustValue (r:1 w:0) - /// Proof: Replace ReplaceBtcDustValue (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: Oracle Aggregate (r:1 w:0) - /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) - /// Storage: Fee ReplaceGriefingCollateral (r:1 w:0) - /// Proof: Fee ReplaceGriefingCollateral (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:1 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - fn request_replace () -> Weight { - // Proof Size summary in bytes: - // Measured: `1777` - // Estimated: `18838` - // Minimum execution time: 183_813_000 picoseconds. - Weight::from_parts(190_921_000, 18838) - .saturating_add(T::DbWeight::get().reads(7_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - } - /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) - fn withdraw_replace () -> Weight { - // Proof Size summary in bytes: - // Measured: `701` - // Estimated: `3725` - // Minimum execution time: 84_337_000 picoseconds. - Weight::from_parts(88_867_000, 3725) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: VaultRegistry Vaults (r:2 w:2) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) - /// Storage: Replace ReplaceBtcDustValue (r:1 w:0) - /// Proof: Replace ReplaceBtcDustValue (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: VaultCapacity Stake (r:1 w:1) - /// Proof: VaultCapacity Stake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultCapacity RewardPerToken (r:2 w:0) - /// Proof: VaultCapacity RewardPerToken (max_values: None, max_size: Some(59), added: 2534, mode: MaxEncodedLen) - /// Storage: VaultCapacity RewardTally (r:2 w:2) - /// Proof: VaultCapacity RewardTally (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) - /// Storage: VaultCapacity TotalRewards (r:2 w:2) - /// Proof: VaultCapacity TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultRewards Stake (r:1 w:1) - /// Proof: VaultRewards Stake (max_values: None, max_size: Some(97), added: 2572, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardPerToken (r:2 w:0) - /// Proof: VaultRewards RewardPerToken (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardTally (r:2 w:2) - /// Proof: VaultRewards RewardTally (max_values: None, max_size: Some(124), added: 2599, mode: MaxEncodedLen) - /// Storage: VaultRewards TotalRewards (r:2 w:2) - /// Proof: VaultRewards TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Fee Commission (r:1 w:0) - /// Proof: Fee Commission (max_values: None, max_size: Some(86), added: 2561, mode: MaxEncodedLen) - /// Storage: VaultStaking Nonce (r:1 w:0) - /// Proof: VaultStaking Nonce (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) - /// Storage: VaultStaking TotalCurrentStake (r:1 w:1) - /// Proof: VaultStaking TotalCurrentStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultStaking RewardPerToken (r:2 w:2) - /// Proof: VaultStaking RewardPerToken (max_values: None, max_size: Some(117), added: 2592, mode: MaxEncodedLen) - /// Storage: VaultStaking Stake (r:1 w:1) - /// Proof: VaultStaking Stake (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) - /// Storage: VaultStaking SlashPerToken (r:1 w:0) - /// Proof: VaultStaking SlashPerToken (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultStaking SlashTally (r:1 w:1) - /// Proof: VaultStaking SlashTally (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) - /// Storage: VaultStaking TotalStake (r:1 w:1) - /// Proof: VaultStaking TotalStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultStaking RewardTally (r:2 w:2) - /// Proof: VaultStaking RewardTally (max_values: None, max_size: Some(149), added: 2624, mode: MaxEncodedLen) - /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) - /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: VaultRewards TotalStake (r:1 w:1) - /// Proof: VaultRewards TotalStake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardCurrencies (r:1 w:0) - /// Proof: VaultRewards RewardCurrencies (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: Oracle Aggregate (r:1 w:0) - /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) - /// Storage: VaultCapacity TotalStake (r:1 w:1) - /// Proof: VaultCapacity TotalStake (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) - /// Storage: VaultCapacity RewardCurrencies (r:1 w:0) - /// Proof: VaultCapacity RewardCurrencies (max_values: None, max_size: Some(127), added: 2602, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:1 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: VaultRegistry TotalUserVaultCollateral (r:1 w:1) - /// Proof: VaultRegistry TotalUserVaultCollateral (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: VaultRegistry SystemCollateralCeiling (r:1 w:0) - /// Proof: VaultRegistry SystemCollateralCeiling (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: Security Nonce (r:1 w:1) - /// Proof: Security Nonce (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: System ParentHash (r:1 w:0) - /// Proof: System ParentHash (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Replace ReplacePeriod (r:1 w:0) - /// Proof: Replace ReplacePeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlockHeight (r:1 w:0) - /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Replace ReplaceRequests (r:0 w:1) - /// Proof: Replace ReplaceRequests (max_values: None, max_size: Some(250), added: 2725, mode: MaxEncodedLen) - fn accept_replace () -> Weight { - // Proof Size summary in bytes: - // Measured: `4188` - // Estimated: `129743` - // Minimum execution time: 829_872_000 picoseconds. - Weight::from_parts(849_278_000, 129743) - .saturating_add(T::DbWeight::get().reads(43_u64)) - .saturating_add(T::DbWeight::get().writes(26_u64)) - } - /// Storage: Replace ReplaceRequests (r:1 w:1) - /// Proof: Replace ReplaceRequests (max_values: None, max_size: Some(250), added: 2725, mode: MaxEncodedLen) - /// Storage: BTCRelay DisableInclusionCheck (r:1 w:0) - /// Proof: BTCRelay DisableInclusionCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlockHeight (r:1 w:0) - /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay Chains (r:1 w:0) - /// Proof: BTCRelay Chains (max_values: None, max_size: Some(24), added: 2499, mode: MaxEncodedLen) - /// Storage: BTCRelay BlockHeaders (r:1 w:0) - /// Proof: BTCRelay BlockHeaders (max_values: None, max_size: Some(200), added: 2675, mode: MaxEncodedLen) - /// Storage: BTCRelay StableBitcoinConfirmations (r:1 w:0) - /// Proof: BTCRelay StableBitcoinConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay StableParachainConfirmations (r:1 w:0) - /// Proof: BTCRelay StableParachainConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: VaultRegistry Vaults (r:2 w:2) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:1 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// The range of component `h` is `[2, 10]`. - /// The range of component `i` is `[1, 10]`. - /// The range of component `o` is `[2, 3]`. - /// The range of component `b` is `[541, 2048]`. - fn execute_pending_replace (h: u32, i: u32, o: u32, b: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `3700` - // Estimated: `28351` - // Minimum execution time: 324_333_000 picoseconds. - Weight::from_parts(299_064_148, 28351) - // Standard Error: 123_808 - .saturating_add(Weight::from_parts(2_843_688, 0).saturating_mul(h.into())) - // Standard Error: 111_614 - .saturating_add(Weight::from_parts(1_702_946, 0).saturating_mul(i.into())) - // Standard Error: 676_619 - .saturating_add(Weight::from_parts(1_855_038, 0).saturating_mul(o.into())) - // Standard Error: 681 - .saturating_add(Weight::from_parts(8_534, 0).saturating_mul(b.into())) - .saturating_add(T::DbWeight::get().reads(11_u64)) - .saturating_add(T::DbWeight::get().writes(4_u64)) - } - /// Storage: Replace ReplaceRequests (r:1 w:1) - /// Proof: Replace ReplaceRequests (max_values: None, max_size: Some(250), added: 2725, mode: MaxEncodedLen) - /// Storage: BTCRelay DisableInclusionCheck (r:1 w:0) - /// Proof: BTCRelay DisableInclusionCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlockHeight (r:1 w:0) - /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay Chains (r:1 w:0) - /// Proof: BTCRelay Chains (max_values: None, max_size: Some(24), added: 2499, mode: MaxEncodedLen) - /// Storage: BTCRelay BlockHeaders (r:1 w:0) - /// Proof: BTCRelay BlockHeaders (max_values: None, max_size: Some(200), added: 2675, mode: MaxEncodedLen) - /// Storage: BTCRelay StableBitcoinConfirmations (r:1 w:0) - /// Proof: BTCRelay StableBitcoinConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay StableParachainConfirmations (r:1 w:0) - /// Proof: BTCRelay StableParachainConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: VaultRegistry Vaults (r:2 w:2) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) - /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) - /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: Oracle Aggregate (r:1 w:0) - /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) - /// Storage: VaultStaking Nonce (r:1 w:0) - /// Proof: VaultStaking Nonce (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) - /// Storage: VaultStaking TotalCurrentStake (r:1 w:0) - /// Proof: VaultStaking TotalCurrentStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// The range of component `h` is `[2, 10]`. - /// The range of component `i` is `[1, 10]`. - /// The range of component `o` is `[2, 3]`. - /// The range of component `b` is `[541, 2048]`. - fn execute_cancelled_replace (h: u32, i: u32, o: u32, b: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `4043` - // Estimated: `40395` - // Minimum execution time: 395_129_000 picoseconds. - Weight::from_parts(381_847_541, 40395) - // Standard Error: 132_878 - .saturating_add(Weight::from_parts(2_710_540, 0).saturating_mul(h.into())) - // Standard Error: 119_791 - .saturating_add(Weight::from_parts(1_346_976, 0).saturating_mul(i.into())) - // Standard Error: 726_188 - .saturating_add(Weight::from_parts(2_525_594, 0).saturating_mul(o.into())) - // Standard Error: 731 - .saturating_add(Weight::from_parts(4_989, 0).saturating_mul(b.into())) - .saturating_add(T::DbWeight::get().reads(15_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) - } - /// Storage: Replace ReplaceRequests (r:1 w:1) - /// Proof: Replace ReplaceRequests (max_values: None, max_size: Some(250), added: 2725, mode: MaxEncodedLen) - /// Storage: Replace ReplacePeriod (r:1 w:0) - /// Proof: Replace ReplacePeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Security ActiveBlockCount (r:1 w:0) - /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: BTCRelay BestBlockHeight (r:1 w:0) - /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: VaultRegistry Vaults (r:2 w:2) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:2 w:2) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: VaultStaking Nonce (r:1 w:0) - /// Proof: VaultStaking Nonce (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) - /// Storage: VaultStaking TotalCurrentStake (r:1 w:0) - /// Proof: VaultStaking TotalCurrentStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultRegistry MinimumCollateralVault (r:1 w:0) - /// Proof: VaultRegistry MinimumCollateralVault (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) - /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: Oracle Aggregate (r:1 w:0) - /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) - /// Storage: VaultRegistry TotalUserVaultCollateral (r:1 w:1) - /// Proof: VaultRegistry TotalUserVaultCollateral (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: VaultCapacity Stake (r:1 w:0) - /// Proof: VaultCapacity Stake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultCapacity RewardPerToken (r:2 w:0) - /// Proof: VaultCapacity RewardPerToken (max_values: None, max_size: Some(59), added: 2534, mode: MaxEncodedLen) - /// Storage: VaultCapacity RewardTally (r:2 w:2) - /// Proof: VaultCapacity RewardTally (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) - /// Storage: VaultCapacity TotalRewards (r:2 w:2) - /// Proof: VaultCapacity TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultRewards Stake (r:1 w:0) - /// Proof: VaultRewards Stake (max_values: None, max_size: Some(97), added: 2572, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardPerToken (r:2 w:0) - /// Proof: VaultRewards RewardPerToken (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) - /// Storage: VaultRewards RewardTally (r:2 w:2) - /// Proof: VaultRewards RewardTally (max_values: None, max_size: Some(124), added: 2599, mode: MaxEncodedLen) - /// Storage: VaultRewards TotalRewards (r:2 w:2) - /// Proof: VaultRewards TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Fee Commission (r:1 w:0) - /// Proof: Fee Commission (max_values: None, max_size: Some(86), added: 2561, mode: MaxEncodedLen) - /// Storage: VaultStaking RewardPerToken (r:2 w:2) - /// Proof: VaultStaking RewardPerToken (max_values: None, max_size: Some(117), added: 2592, mode: MaxEncodedLen) - /// Storage: VaultStaking Stake (r:1 w:1) - /// Proof: VaultStaking Stake (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) - /// Storage: VaultStaking SlashPerToken (r:1 w:0) - /// Proof: VaultStaking SlashPerToken (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultStaking SlashTally (r:1 w:1) - /// Proof: VaultStaking SlashTally (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) - /// Storage: VaultStaking TotalStake (r:1 w:1) - /// Proof: VaultStaking TotalStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: VaultRewards TotalStake (r:1 w:0) - /// Proof: VaultRewards TotalStake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - fn cancel_replace () -> Weight { - // Proof Size summary in bytes: - // Measured: `4480` - // Estimated: `118165` - // Minimum execution time: 754_304_000 picoseconds. - Weight::from_parts(769_377_000, 118165) - .saturating_add(T::DbWeight::get().reads(38_u64)) - .saturating_add(T::DbWeight::get().writes(19_u64)) - } - /// Storage: Replace ReplacePeriod (r:0 w:1) - /// Proof: Replace ReplacePeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - fn set_replace_period () -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 23_951_000 picoseconds. - Weight::from_parts(24_723_000, 0) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } -} \ No newline at end of file diff --git a/parachain/runtime/kintsugi/src/weights/security.rs b/parachain/runtime/kintsugi/src/weights/security.rs index 24a4504223..4731d80a1c 100644 --- a/parachain/runtime/kintsugi/src/weights/security.rs +++ b/parachain/runtime/kintsugi/src/weights/security.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for security //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-kcxvd`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/kintsugi/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -40,27 +40,27 @@ pub struct WeightInfo(PhantomData); impl security::WeightInfo for WeightInfo { - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) + /// Storage: Security IsDeactivated (r:1 w:0) + /// Proof: Security IsDeactivated (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: Security ActiveBlockCount (r:1 w:1) /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) fn on_initialize () -> Weight { // Proof Size summary in bytes: - // Measured: `126` - // Estimated: `2975` - // Minimum execution time: 24_245_000 picoseconds. - Weight::from_parts(25_061_000, 2975) + // Measured: `99` + // Estimated: `1489` + // Minimum execution time: 17_645_000 picoseconds. + Weight::from_parts(18_257_000, 1489) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } - /// Storage: Security ParachainStatus (r:0 w:1) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) + /// Storage: Security IsDeactivated (r:0 w:1) + /// Proof: Security IsDeactivated (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) fn activate_counter () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 11_345_000 picoseconds. - Weight::from_parts(11_730_000, 0) + // Minimum execution time: 14_820_000 picoseconds. + Weight::from_parts(15_040_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } } \ No newline at end of file diff --git a/parachain/runtime/kintsugi/src/weights/supply.rs b/parachain/runtime/kintsugi/src/weights/supply.rs index 577ccbca59..45fdddbfd4 100644 --- a/parachain/runtime/kintsugi/src/weights/supply.rs +++ b/parachain/runtime/kintsugi/src/weights/supply.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for supply //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-kcxvd`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/kintsugi/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -52,10 +52,10 @@ impl supply::WeightInfo for WeightInfo { /// Proof: Supply LastEmission (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) fn on_initialize () -> Weight { // Proof Size summary in bytes: - // Measured: `299` - // Estimated: `22547` - // Minimum execution time: 239_051_000 picoseconds. - Weight::from_parts(246_001_000, 22547) + // Measured: `606` + // Estimated: `11350` + // Minimum execution time: 199_900_000 picoseconds. + Weight::from_parts(201_875_000, 11350) .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().writes(8_u64)) } @@ -65,8 +65,8 @@ impl supply::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 11_510_000 picoseconds. - Weight::from_parts(12_029_000, 0) + // Minimum execution time: 9_619_000 picoseconds. + Weight::from_parts(9_890_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } } \ No newline at end of file diff --git a/parachain/runtime/kintsugi/src/weights/tx_pause.rs b/parachain/runtime/kintsugi/src/weights/tx_pause.rs index a1e19d2982..23428dd485 100644 --- a/parachain/runtime/kintsugi/src/weights/tx_pause.rs +++ b/parachain/runtime/kintsugi/src/weights/tx_pause.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for tx_pause //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-kcxvd`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/kintsugi/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -46,8 +46,8 @@ impl tx_pause::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `3` // Estimated: `6494` - // Minimum execution time: 44_087_000 picoseconds. - Weight::from_parts(67_410_000, 6494) + // Minimum execution time: 32_134_000 picoseconds. + Weight::from_parts(32_656_000, 6494) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -57,8 +57,8 @@ impl tx_pause::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `308` // Estimated: `6494` - // Minimum execution time: 49_633_000 picoseconds. - Weight::from_parts(54_657_000, 6494) + // Minimum execution time: 36_964_000 picoseconds. + Weight::from_parts(37_264_000, 6494) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } diff --git a/parachain/runtime/kintsugi/src/weights/vault_registry.rs b/parachain/runtime/kintsugi/src/weights/vault_registry.rs index e7312b1ac3..2a8fa6c922 100644 --- a/parachain/runtime/kintsugi/src/weights/vault_registry.rs +++ b/parachain/runtime/kintsugi/src/weights/vault_registry.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for vault_registry //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-05, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `dev-benchmark`, CPU: `Intel(R) Xeon(R) CPU @ 2.20GHz` +//! HOSTNAME: `interlay-rust-runner-2mz2v-kcxvd`, CPU: `AMD EPYC 7502P 32-Core Processor` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 // Executed Command: @@ -24,7 +24,7 @@ // --repeat // 10 // --output -// ../tmp-weight/ +// parachain/runtime/kintsugi/src/weights/ // --template // .deploy/runtime-weight-template.hbs @@ -112,19 +112,17 @@ impl vault_registry::WeightInfo for WeightInfo { /// Proof: Loans MinExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: Loans MaxExchangeRate (r:1 w:0) /// Proof: Loans MaxExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: Oracle Aggregate (r:1 w:0) /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) /// Storage: VaultRegistry TotalUserVaultCollateral (r:1 w:1) /// Proof: VaultRegistry TotalUserVaultCollateral (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) fn register_vault () -> Weight { // Proof Size summary in bytes: - // Measured: `2670` - // Estimated: `153273` - // Minimum execution time: 616_091_000 picoseconds. - Weight::from_parts(645_003_000, 153273) - .saturating_add(T::DbWeight::get().reads(48_u64)) + // Measured: `2893` + // Estimated: `6260` + // Minimum execution time: 471_203_000 picoseconds. + Weight::from_parts(474_851_000, 6260) + .saturating_add(T::DbWeight::get().reads(47_u64)) .saturating_add(T::DbWeight::get().writes(17_u64)) } /// Storage: VaultRegistry VaultBitcoinPublicKey (r:1 w:1) @@ -133,8 +131,8 @@ impl vault_registry::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `365` // Estimated: `3546` - // Minimum execution time: 43_020_000 picoseconds. - Weight::from_parts(44_952_000, 3546) + // Minimum execution time: 30_832_000 picoseconds. + Weight::from_parts(31_053_000, 3546) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -190,17 +188,15 @@ impl vault_registry::WeightInfo for WeightInfo { /// Proof: Loans MinExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: Loans MaxExchangeRate (r:1 w:0) /// Proof: Loans MaxExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: Oracle Aggregate (r:1 w:0) /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) fn accept_new_issues () -> Weight { // Proof Size summary in bytes: - // Measured: `3476` - // Estimated: `111557` - // Minimum execution time: 504_658_000 picoseconds. - Weight::from_parts(532_058_000, 111557) - .saturating_add(T::DbWeight::get().reads(36_u64)) + // Measured: `3699` + // Estimated: `6260` + // Minimum execution time: 373_849_000 picoseconds. + Weight::from_parts(377_957_000, 6260) + .saturating_add(T::DbWeight::get().reads(35_u64)) .saturating_add(T::DbWeight::get().writes(12_u64)) } /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) @@ -255,17 +251,15 @@ impl vault_registry::WeightInfo for WeightInfo { /// Proof: Loans MinExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: Loans MaxExchangeRate (r:1 w:0) /// Proof: Loans MaxExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: Oracle Aggregate (r:1 w:0) /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) fn set_custom_secure_threshold () -> Weight { // Proof Size summary in bytes: - // Measured: `3476` - // Estimated: `111557` - // Minimum execution time: 506_597_000 picoseconds. - Weight::from_parts(530_459_000, 111557) - .saturating_add(T::DbWeight::get().reads(36_u64)) + // Measured: `3699` + // Estimated: `6260` + // Minimum execution time: 377_576_000 picoseconds. + Weight::from_parts(378_928_000, 6260) + .saturating_add(T::DbWeight::get().reads(35_u64)) .saturating_add(T::DbWeight::get().writes(12_u64)) } /// Storage: VaultRegistry MinimumCollateralVault (r:0 w:1) @@ -274,8 +268,8 @@ impl vault_registry::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 12_931_000 picoseconds. - Weight::from_parts(13_682_000, 0) + // Minimum execution time: 10_461_000 picoseconds. + Weight::from_parts(10_722_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: VaultRegistry SystemCollateralCeiling (r:0 w:1) @@ -284,8 +278,8 @@ impl vault_registry::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 13_757_000 picoseconds. - Weight::from_parts(14_215_000, 0) + // Minimum execution time: 10_341_000 picoseconds. + Weight::from_parts(10_671_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: VaultRegistry SecureCollateralThreshold (r:0 w:1) @@ -294,8 +288,8 @@ impl vault_registry::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 27_005_000 picoseconds. - Weight::from_parts(27_844_000, 0) + // Minimum execution time: 20_762_000 picoseconds. + Weight::from_parts(21_152_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: VaultRegistry PremiumRedeemThreshold (r:0 w:1) @@ -304,8 +298,8 @@ impl vault_registry::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 27_292_000 picoseconds. - Weight::from_parts(28_795_000, 0) + // Minimum execution time: 20_591_000 picoseconds. + Weight::from_parts(20_962_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: VaultRegistry LiquidationCollateralThreshold (r:0 w:1) @@ -314,8 +308,8 @@ impl vault_registry::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 27_149_000 picoseconds. - Weight::from_parts(28_884_000, 0) + // Minimum execution time: 20_831_000 picoseconds. + Weight::from_parts(21_163_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: VaultRegistry Vaults (r:1 w:1) @@ -348,8 +342,6 @@ impl vault_registry::WeightInfo for WeightInfo { /// Proof: Loans MinExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: Loans MaxExchangeRate (r:1 w:0) /// Proof: Loans MaxExchangeRate (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: Oracle Aggregate (r:1 w:0) /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) /// Storage: VaultStaking Stake (r:1 w:1) @@ -358,7 +350,7 @@ impl vault_registry::WeightInfo for WeightInfo { /// Proof: VaultStaking SlashPerToken (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) /// Storage: VaultStaking SlashTally (r:1 w:1) /// Proof: VaultStaking SlashTally (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) - /// Storage: VaultCapacity Stake (r:1 w:1) + /// Storage: VaultCapacity Stake (r:1 w:0) /// Proof: VaultCapacity Stake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) /// Storage: VaultCapacity RewardPerToken (r:2 w:0) /// Proof: VaultCapacity RewardPerToken (max_values: None, max_size: Some(59), added: 2534, mode: MaxEncodedLen) @@ -384,14 +376,10 @@ impl vault_registry::WeightInfo for WeightInfo { /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) /// Storage: VaultRewards TotalStake (r:1 w:1) /// Proof: VaultRewards TotalStake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: VaultCapacity TotalStake (r:1 w:1) - /// Proof: VaultCapacity TotalStake (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) - /// Storage: VaultCapacity RewardCurrencies (r:1 w:0) - /// Proof: VaultCapacity RewardCurrencies (max_values: None, max_size: Some(127), added: 2602, mode: MaxEncodedLen) /// Storage: VaultStaking RewardTally (r:2 w:2) /// Proof: VaultStaking RewardTally (max_values: None, max_size: Some(149), added: 2624, mode: MaxEncodedLen) /// Storage: VaultRewards RewardCurrencies (r:1 w:0) - /// Proof: VaultRewards RewardCurrencies (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) + /// Proof: VaultRewards RewardCurrencies (max_values: None, max_size: Some(50), added: 2525, mode: MaxEncodedLen) /// Storage: VaultRegistry TotalUserVaultCollateral (r:1 w:1) /// Proof: VaultRegistry TotalUserVaultCollateral (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) /// Storage: Loans RewardSupplyState (r:1 w:1) @@ -410,12 +398,12 @@ impl vault_registry::WeightInfo for WeightInfo { /// Proof: VaultRegistry LiquidationVault (max_values: None, max_size: Some(124), added: 2599, mode: MaxEncodedLen) fn report_undercollateralized_vault () -> Weight { // Proof Size summary in bytes: - // Measured: `4772` - // Estimated: `190133` - // Minimum execution time: 1_872_129_000 picoseconds. - Weight::from_parts(1_909_898_000, 190133) - .saturating_add(T::DbWeight::get().reads(60_u64)) - .saturating_add(T::DbWeight::get().writes(32_u64)) + // Measured: `5028` + // Estimated: `8799` + // Minimum execution time: 1_409_222_000 picoseconds. + Weight::from_parts(1_423_390_000, 8799) + .saturating_add(T::DbWeight::get().reads(57_u64)) + .saturating_add(T::DbWeight::get().writes(30_u64)) } /// Storage: VaultRegistry Vaults (r:1 w:1) /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) @@ -423,8 +411,8 @@ impl vault_registry::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `669` // Estimated: `3725` - // Minimum execution time: 47_453_000 picoseconds. - Weight::from_parts(51_709_000, 3725) + // Minimum execution time: 30_602_000 picoseconds. + Weight::from_parts(30_982_000, 3725) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } diff --git a/parachain/runtime/kintsugi/src/xcm_config.rs b/parachain/runtime/kintsugi/src/xcm_config.rs index b625e7c8e6..4e102a741a 100644 --- a/parachain/runtime/kintsugi/src/xcm_config.rs +++ b/parachain/runtime/kintsugi/src/xcm_config.rs @@ -174,7 +174,7 @@ impl Contains for SafeCallFilter { // these calls can recurse - disallow false } - RuntimeCall::Issue(..) | RuntimeCall::Replace(..) | RuntimeCall::Redeem(..) | RuntimeCall::BTCRelay(..) => { + RuntimeCall::Issue(..) | RuntimeCall::Redeem(..) | RuntimeCall::BTCRelay(..) => { // disallow anything to do with btc transactions since btc tx may be unbounded false } diff --git a/parachain/runtime/runtime-tests/Cargo.toml b/parachain/runtime/runtime-tests/Cargo.toml index c03780f265..cb1c249eaa 100644 --- a/parachain/runtime/runtime-tests/Cargo.toml +++ b/parachain/runtime/runtime-tests/Cargo.toml @@ -101,7 +101,6 @@ oracle = { path = "../../../crates/oracle", features = ["testing-utils"] } fee = { path = "../../../crates/fee" } issue = { path = "../../../crates/issue" } redeem = { path = "../../../crates/redeem" } -replace = { path = "../../../crates/replace" } nomination = { path = "../../../crates/nomination" } reward = { path = "../../../crates/reward" } staking = { path = "../../../crates/staking", features = ["integration-tests"] } @@ -130,7 +129,6 @@ oracle-rpc-runtime-api = { path = "../../../crates/oracle/rpc/runtime-api" } vault-registry-rpc-runtime-api = { path = "../../../crates/vault-registry/rpc/runtime-api" } issue-rpc-runtime-api = { path = "../../../crates/issue/rpc/runtime-api" } redeem-rpc-runtime-api = { path = "../../../crates/redeem/rpc/runtime-api" } -replace-rpc-runtime-api = { path = "../../../crates/replace/rpc/runtime-api" } reward-rpc-runtime-api = { path = "../../../crates/reward/rpc/runtime-api" } # Orml dependencies @@ -178,7 +176,6 @@ runtime-benchmarks = [ "oracle/runtime-benchmarks", "issue/runtime-benchmarks", "redeem/runtime-benchmarks", - "replace/runtime-benchmarks", "vault-registry/runtime-benchmarks", "fee/runtime-benchmarks", "security/runtime-benchmarks", diff --git a/parachain/runtime/runtime-tests/src/parachain.rs b/parachain/runtime/runtime-tests/src/parachain.rs index cff8f8b063..bd810607a6 100644 --- a/parachain/runtime/runtime-tests/src/parachain.rs +++ b/parachain/runtime/runtime-tests/src/parachain.rs @@ -12,5 +12,4 @@ mod loans; mod multisig; mod nomination; mod redeem; -mod replace; mod vault_registry; diff --git a/parachain/runtime/runtime-tests/src/parachain/contracts.rs b/parachain/runtime/runtime-tests/src/parachain/contracts.rs index 7c4dff3976..0e1672390e 100644 --- a/parachain/runtime/runtime-tests/src/parachain/contracts.rs +++ b/parachain/runtime/runtime-tests/src/parachain/contracts.rs @@ -30,6 +30,9 @@ mod relay { fn test_basic_contract() { // not sure this case would ever be used, best we have a test for it anyway.. ExtBuilder::build().execute_with(|| { + let key = kintsugi_runtime_parachain::contracts::EnableContracts::key(); + let hex = hex::encode(key); + println!("key = {hex}"); // note: current working directory is diffent when you run this test, vs when you debug it. // However, the `PWD` env variable is (surprisingly) set to the workspace root in both cases. // So, we use a path relative to PWD diff --git a/parachain/runtime/runtime-tests/src/parachain/fee_pool.rs b/parachain/runtime/runtime-tests/src/parachain/fee_pool.rs index a6c09961c7..4dfb63db32 100644 --- a/parachain/runtime/runtime-tests/src/parachain/fee_pool.rs +++ b/parachain/runtime/runtime-tests/src/parachain/fee_pool.rs @@ -558,21 +558,7 @@ impl ConcreteAction { ConcreteAction::FailRedeem { vault_id, amount } => { expire_bans(); - let free_balance_before = CurrencySource::FreeBalance(vault_id.account_id.clone()) - .current_balance(DEFAULT_GRIEFING_CURRENCY) - .unwrap(); let redeem_id = setup_cancelable_redeem(USER, &vault_id, *amount); - let free_balance_after = CurrencySource::FreeBalance(vault_id.account_id.clone()) - .current_balance(DEFAULT_GRIEFING_CURRENCY) - .unwrap(); - - VaultRegistryPallet::transfer_funds( - CurrencySource::FreeBalance(vault_id.account_id.clone()), - CurrencySource::AvailableReplaceCollateral(vault_id.clone()), - &(free_balance_after - free_balance_before), - ) - .unwrap(); - let redeem = RedeemPallet::get_open_redeem_request_from_id(&redeem_id).unwrap(); let amount_without_fee_collateral = redeem.amount_without_fee_as_collateral(vault_id.collateral_currency()); diff --git a/parachain/runtime/runtime-tests/src/parachain/issue.rs b/parachain/runtime/runtime-tests/src/parachain/issue.rs index 8e32f60bff..f08afa49af 100644 --- a/parachain/runtime/runtime-tests/src/parachain/issue.rs +++ b/parachain/runtime/runtime-tests/src/parachain/issue.rs @@ -146,6 +146,7 @@ mod expiry_test { } mod request_issue_tests { + use primitives::AccountOrVault; use sp_runtime::traits::CheckedMul; use super::{assert_eq, *}; @@ -254,8 +255,7 @@ mod request_issue_tests { // give the vault a lot of griefing collateral, to check that this isn't available for backing new tokens let vault_id = vault_id; - let mut vault_data = CoreVaultData::vault(vault_id.clone()); - vault_data.griefing_collateral += griefing(1000000); + let vault_data = CoreVaultData::vault(vault_id.clone()); CoreVaultData::force_to(&vault_id, vault_data); assert_noop!( @@ -327,8 +327,7 @@ mod request_issue_tests { // give the vault a lot of griefing collateral, to check that this isn't available for backing new tokens let vault_id = vault_id; - let mut vault_data = CoreVaultData::vault(vault_id.clone()); - vault_data.griefing_collateral += griefing(1000000); + let vault_data = CoreVaultData::vault(vault_id.clone()); CoreVaultData::force_to(&vault_id, vault_data); assert_noop!( @@ -418,7 +417,7 @@ mod request_issue_tests { griefing_currency: DEFAULT_GRIEFING_CURRENCY, amount: (amount_btc - expected_fee).amount(), fee: expected_fee.amount(), - requester: account_of(USER), + requester: AccountOrVault::Account(account_of(USER)), btc_address: expected_btc_address, btc_public_key: expected_public_key, btc_height: expected_height, @@ -901,7 +900,7 @@ mod execute_cancelled_issue_tests { ExecuteIssueBuilder::new(issue_id) .with_amount(sent_amount) - .with_submitter(issue.requester.clone(), None) + .with_submitter(issue.requester.get_account().clone(), None) .execute() .unwrap(); diff --git a/parachain/runtime/runtime-tests/src/parachain/nomination.rs b/parachain/runtime/runtime-tests/src/parachain/nomination.rs index 28b40fcbfc..a93f3808b3 100644 --- a/parachain/runtime/runtime-tests/src/parachain/nomination.rs +++ b/parachain/runtime/runtime-tests/src/parachain/nomination.rs @@ -445,29 +445,6 @@ fn integration_test_nominated_collateral_cannot_exceed_nomination_limit() { fn integration_test_nominated_collateral_prevents_replace_requests() { test_with_nomination_enabled_and_vault_opted_in(|vault_id| { assert_nominate_collateral(&vault_id, account_of(USER), default_nomination(&vault_id)); - assert_noop!( - RuntimeCall::Replace(ReplaceCall::request_replace { - currency_pair: vault_id.currencies.clone(), - amount: 0, - }) - .dispatch(origin_of(vault_id.account_id.clone())), - ReplaceError::VaultHasEnabledNomination - ); - }); -} - -#[test] -fn integration_test_vaults_with_zero_nomination_cannot_request_replacement() { - test_with_nomination_enabled_and_vault_opted_in(|vault_id| { - let amount = DEFAULT_VAULT_ISSUED - DEFAULT_VAULT_TO_BE_REDEEMED - DEFAULT_VAULT_TO_BE_REPLACED; - assert_noop!( - RuntimeCall::Replace(ReplaceCall::request_replace { - currency_pair: vault_id.currencies.clone(), - amount: amount.amount(), - }) - .dispatch(origin_of(vault_id.account_id.clone())), - ReplaceError::VaultHasEnabledNomination - ); }); } diff --git a/parachain/runtime/runtime-tests/src/parachain/redeem.rs b/parachain/runtime/runtime-tests/src/parachain/redeem.rs index d6527cf1dc..76f227de2e 100644 --- a/parachain/runtime/runtime-tests/src/parachain/redeem.rs +++ b/parachain/runtime/runtime-tests/src/parachain/redeem.rs @@ -44,20 +44,6 @@ fn test_with(execute: impl Fn(VaultId) -> R) { test_with(LendToken(1), Token(IBTC), None); } -/// to-be-replaced & replace_collateral are decreased in request_redeem -fn consume_to_be_replaced(vault: &mut CoreVaultData, amount_btc: Amount) { - let to_be_replaced_decrease = amount_btc.min(&vault.to_be_replaced).unwrap(); - let released_replace_collateral = griefing( - (vault.replace_collateral.amount() * to_be_replaced_decrease.amount()) / vault.to_be_replaced.amount(), - ); - - vault.replace_collateral -= released_replace_collateral; - vault.griefing_collateral -= released_replace_collateral; - *vault.free_balance.get_mut(&DEFAULT_GRIEFING_CURRENCY).unwrap() += released_replace_collateral; - - vault.to_be_replaced -= to_be_replaced_decrease; -} - mod spec_based_tests { use primitives::VaultCurrencyPair; @@ -116,7 +102,6 @@ mod spec_based_tests { redeem.amount_btc() + redeem.transfer_fee_btc() + redeem.fee(); (*user.balances.get_mut(&vault_id.wrapped_currency()).unwrap()).locked += redeem.amount_btc() + redeem.transfer_fee_btc() + redeem.fee(); - consume_to_be_replaced(vault, redeem.amount_btc()); }) ); }); @@ -871,8 +856,6 @@ mod spec_based_tests { to_be_issued: vault_id.wrapped(0), to_be_redeemed: consumed_issued_tokens * 4, backing_collateral: collateral_vault, - to_be_replaced: vault_id.wrapped(0), - replace_collateral: griefing(0), ..default_vault_state(&vault_id) }, ); @@ -938,8 +921,6 @@ mod spec_based_tests { to_be_issued: vault_id.wrapped(0), to_be_redeemed: consumed_issued_tokens * 4, backing_collateral: collateral_vault, - to_be_replaced: vault_id.wrapped(0), - replace_collateral: griefing(0), ..default_vault_state(&vault_id) }, ); @@ -1163,7 +1144,6 @@ fn integration_test_redeem_execute_succeeds() { vault.issued -= redeem.amount_btc() + redeem.transfer_fee_btc(); (*user.balances.get_mut(&vault_id.wrapped_currency()).unwrap()).free -= issued_tokens; *fee_pool.rewards_for(&vault_id) += redeem.fee(); - consume_to_be_replaced(vault, redeem.amount_btc() + redeem.transfer_fee_btc()); }) ); }); @@ -1247,7 +1227,6 @@ fn integration_test_premium_redeem_wrapped_execute() { // premium is moved from vault to user vault.backing_collateral -= redeem.premium().unwrap(); (*user.balances.get_mut(¤cy_id).unwrap()).free += redeem.premium().unwrap(); - consume_to_be_replaced(vault, burned_amount); }) ); @@ -1451,8 +1430,6 @@ fn integration_test_redeem_wrapped_cancel_reimburse_sufficient_collateral_for_wr (*user.balances.get_mut(&vault_id.wrapped_currency()).unwrap()).free -= amount_btc; *fee_pool.rewards_for(&vault_id) += redeem.fee(); - - consume_to_be_replaced(vault, redeem.amount_btc() + redeem.transfer_fee_btc()); }) ); }); @@ -1504,8 +1481,6 @@ fn integration_test_redeem_wrapped_cancel_reimburse_insufficient_collateral_for_ (*user.balances.get_mut(&vault_id.wrapped_currency()).unwrap()).free -= amount_btc; *fee_pool.rewards_for(&vault_id) += redeem.fee(); - - consume_to_be_replaced(vault, redeem.amount_btc() + redeem.transfer_fee_btc()); }) ); @@ -1563,8 +1538,6 @@ fn integration_test_redeem_wrapped_cancel_no_reimburse() { (*user.balances.get_mut(¤cy_id).unwrap()).free += punishment_fee; vault.backing_collateral -= punishment_fee; - - consume_to_be_replaced(vault, redeem.amount_btc() + redeem.transfer_fee_btc()); }) ); }); @@ -1590,8 +1563,6 @@ fn integration_test_liquidation_redeem_with_cancel_redeem() { to_be_issued: vault_id.wrapped(0), to_be_redeemed: consumed_issued_tokens, backing_collateral: collateral_vault, - to_be_replaced: vault_id.wrapped(0), - replace_collateral: griefing(0), ..default_vault_state(&vault_id) }, ); @@ -1693,8 +1664,6 @@ fn integration_test_redeem_wrapped_cancel_liquidated_no_reimburse() { to_be_issued: vault_id.wrapped(0), to_be_redeemed: consumed_issued_tokens * 4, backing_collateral: collateral_vault, - to_be_replaced: vault_id.wrapped(0), - replace_collateral: griefing(0), ..default_vault_state(&vault_id) }, ); @@ -1755,8 +1724,6 @@ fn integration_test_redeem_wrapped_cancel_liquidated_reimburse() { to_be_issued: vault_id.wrapped(0), to_be_redeemed: consumed_issued_tokens * 4, backing_collateral: collateral_vault, - to_be_replaced: vault_id.wrapped(0), - replace_collateral: griefing(0), ..default_vault_state(&vault_id) }, ); @@ -1819,8 +1786,6 @@ fn integration_test_redeem_wrapped_execute_liquidated() { to_be_issued: vault_id.wrapped(0), to_be_redeemed: consumed_issued_tokens * 4, backing_collateral: collateral_vault, - to_be_replaced: vault_id.wrapped(0), - replace_collateral: griefing(0), ..default_vault_state(&vault_id) }, ); @@ -2018,7 +1983,6 @@ mod self_redeem { vault.issued -= consumed_issued_tokens; (*vault.free_balance.get_mut(&vault_id.wrapped_currency()).unwrap()) -= issued_tokens; *fee_pool.rewards_for(&vault_id) += fee; - consume_to_be_replaced(vault, consumed_issued_tokens); }) ); }); @@ -2041,7 +2005,6 @@ mod self_redeem { ParachainState::get_default(&vault_id).with_changes(|_, vault, _, _| { vault.issued -= issued_tokens; (*vault.free_balance.get_mut(&vault_id.wrapped_currency()).unwrap()) -= issued_tokens; - consume_to_be_replaced(vault, issued_tokens); }) ); }); diff --git a/parachain/runtime/runtime-tests/src/parachain/replace.rs b/parachain/runtime/runtime-tests/src/parachain/replace.rs deleted file mode 100644 index 1ef849c1d0..0000000000 --- a/parachain/runtime/runtime-tests/src/parachain/replace.rs +++ /dev/null @@ -1,1185 +0,0 @@ -use crate::{ - setup::{assert_eq, *}, - utils::{loans_utils::activate_lending_and_mint, replace_utils::*}, -}; -use currency::Amount; -use sp_core::H256; - -type IssueCall = issue::Call; - -pub type VaultRegistryError = vault_registry::Error; -pub type ReplaceError = replace::Error; - -const USER: [u8; 32] = ALICE; -const OLD_VAULT: [u8; 32] = BOB; -const NEW_VAULT: [u8; 32] = CAROL; - -fn test_with(execute: impl Fn(VaultId, VaultId) -> R) { - let test_with = |old_vault_currency, new_vault_currency, wrapped_currency, extra_vault_currency| { - ExtBuilder::build().execute_with(|| { - for currency_id in iter_collateral_currencies().filter(|c| !c.is_lend_token()) { - assert_ok!(OraclePallet::_set_exchange_rate(currency_id, FixedU128::one())); - } - if wrapped_currency != DEFAULT_WRAPPED_CURRENCY { - assert_ok!(OraclePallet::_set_exchange_rate(wrapped_currency, FixedU128::one())); - } - activate_lending_and_mint(Token(DOT), LendToken(1)); - set_default_thresholds(); - UserData::force_to(USER, default_user_state()); - let old_vault_id = VaultId::new(account_of(OLD_VAULT), old_vault_currency, wrapped_currency); - let new_vault_id = VaultId::new(account_of(NEW_VAULT), new_vault_currency, wrapped_currency); - CoreVaultData::force_to(&old_vault_id, default_vault_state(&old_vault_id)); - CoreVaultData::force_to(&new_vault_id, default_vault_state(&new_vault_id)); - LiquidationVaultData::force_to(default_liquidation_vault_state(&old_vault_id.currencies)); - - if let Some(other_currency) = extra_vault_currency { - assert_ok!(OraclePallet::_set_exchange_rate(other_currency, FixedU128::one())); - // check that having other vault with the same account id does not influence tests - let other_old_vault_id = VaultId::new( - old_vault_id.account_id.clone(), - other_currency, - old_vault_id.wrapped_currency(), - ); - CoreVaultData::force_to(&other_old_vault_id, default_vault_state(&other_old_vault_id)); - let other_new_vault_id = VaultId::new( - new_vault_id.account_id.clone(), - other_currency, - new_vault_id.wrapped_currency(), - ); - CoreVaultData::force_to(&other_new_vault_id, default_vault_state(&other_new_vault_id)); - } - VaultRegistryPallet::collateral_integrity_check(); - - execute(old_vault_id, new_vault_id) - }) - }; - test_with(Token(DOT), Token(KSM), Token(KBTC), None); - test_with(Token(DOT), Token(DOT), Token(IBTC), None); - test_with(Token(DOT), Token(DOT), Token(IBTC), Some(Token(KSM))); - test_with(Token(DOT), Token(KSM), Token(IBTC), None); - test_with(Token(KSM), Token(DOT), Token(IBTC), None); - test_with(ForeignAsset(1), Token(DOT), Token(IBTC), None); - test_with(Token(KSM), ForeignAsset(1), Token(IBTC), None); - test_with(LendToken(1), ForeignAsset(1), Token(IBTC), None); - test_with(Token(KSM), LendToken(1), Token(IBTC), None); -} - -fn test_without_initialization(execute: impl Fn(CurrencyId) -> R) { - ExtBuilder::build().execute_with(|| execute(Token(DOT))); - ExtBuilder::build().execute_with(|| execute(Token(KSM))); -} - -pub fn withdraw_replace(old_vault_id: &VaultId, amount: Amount) -> DispatchResultWithPostInfo { - VaultRegistryPallet::collateral_integrity_check(); - - RuntimeCall::Replace(ReplaceCall::withdraw_replace { - currency_pair: old_vault_id.currencies.clone(), - amount: amount.amount(), - }) - .dispatch(origin_of(old_vault_id.account_id.clone())) -} - -pub fn assert_replace_request_event() { - let events = SystemPallet::events(); - let ids = events.iter().filter_map(|r| match r.event { - RuntimeEvent::Replace(ReplaceEvent::RequestReplace { .. }) => Some(()), - _ => None, - }); - assert_eq!(ids.count(), 1); -} - -#[cfg(test)] -mod accept_replace_tests { - use super::{assert_eq, *}; - - fn assert_state_after_accept_replace_correct( - old_vault_id: &VaultId, - new_vault_id: &VaultId, - replace: &ReplaceRequest, - ) { - assert_eq!( - ParachainTwoVaultState::get(&old_vault_id, &new_vault_id), - ParachainTwoVaultState::get_default(&old_vault_id, &new_vault_id).with_changes( - |old_vault, new_vault, _| { - *new_vault - .free_balance - .get_mut(&new_vault_id.collateral_currency()) - .unwrap() -= replace.collateral().unwrap(); - new_vault.backing_collateral += replace.collateral().unwrap(); - - old_vault.replace_collateral -= griefing( - (old_vault.replace_collateral.amount() * replace.amount) / old_vault.to_be_replaced.amount(), - ); - old_vault.to_be_replaced -= replace.amount(); - - old_vault.to_be_redeemed += replace.amount(); - new_vault.to_be_issued += replace.amount(); - } - ) - ); - } - - #[test] - fn integration_test_replace_accept_replace_at_capacity_succeeds() { - test_with(|old_vault_id, new_vault_id| { - let accept_amount = new_vault_id.wrapped(DEFAULT_VAULT_TO_BE_REPLACED.amount()); - let new_vault_additional_collateral = Amount::new(10_000, new_vault_id.collateral_currency()); - - let (_, replace) = accept_replace( - &old_vault_id, - &new_vault_id, - accept_amount, - new_vault_additional_collateral, - Default::default(), - ) - .unwrap(); - - assert_eq!(replace.amount(), accept_amount); - assert_eq!(replace.collateral().unwrap(), new_vault_additional_collateral); - assert_eq!(replace.griefing_collateral(), DEFAULT_VAULT_REPLACE_COLLATERAL); - - assert_state_after_accept_replace_correct(&old_vault_id, &new_vault_id, &replace); - }); - } - - #[test] - fn integration_test_replace_accept_replace_below_capacity_succeeds() { - test_with(|old_vault_id, new_vault_id| { - // accept only 25% - - let accept_amount = DEFAULT_VAULT_TO_BE_REPLACED / 4; - let accept_amount = old_vault_id.wrapped(accept_amount.amount()); - let new_vault_additional_collateral = Amount::new(10_000, new_vault_id.collateral_currency()); - - let (_, replace) = accept_replace( - &old_vault_id, - &new_vault_id, - accept_amount, - new_vault_additional_collateral, - Default::default(), - ) - .unwrap(); - - assert_eq!(replace.amount(), accept_amount); - assert_eq!(replace.collateral().unwrap(), new_vault_additional_collateral); - assert_eq!(replace.griefing_collateral(), DEFAULT_VAULT_REPLACE_COLLATERAL / 4); - - assert_state_after_accept_replace_correct(&old_vault_id, &new_vault_id, &replace); - }); - } - - #[test] - fn integration_test_replace_accept_replace_above_capacity_succeeds() { - test_with(|old_vault_id, new_vault_id| { - // try to accept 400% - - let accept_amount = DEFAULT_VAULT_TO_BE_REPLACED * 4; - let accept_amount = old_vault_id.wrapped(accept_amount.amount()); - let new_vault_additional_collateral = Amount::new(10_000, new_vault_id.collateral_currency()); - - let (_, replace) = accept_replace( - &old_vault_id, - &new_vault_id, - accept_amount, - new_vault_additional_collateral, - Default::default(), - ) - .unwrap(); - - assert_eq!(replace.amount(), accept_amount / 4); - assert_eq!(replace.collateral().unwrap(), new_vault_additional_collateral / 4); - assert_eq!(replace.griefing_collateral(), DEFAULT_VAULT_REPLACE_COLLATERAL); - - assert_state_after_accept_replace_correct(&old_vault_id, &new_vault_id, &replace); - }); - } - - #[test] - fn integration_test_replace_accept_replace_by_vault_that_does_not_accept_issues_succeeds() { - test_with(|old_vault_id, new_vault_id| { - assert_ok!(RuntimeCall::VaultRegistry(VaultRegistryCall::accept_new_issues { - currency_pair: new_vault_id.currencies.clone(), - accept_new_issues: false - }) - .dispatch(origin_of(new_vault_id.account_id.clone()))); - - let (_, replace) = accept_replace( - &old_vault_id, - &new_vault_id, - old_vault_id.wrapped(1000), - griefing(1000), - Default::default(), - ) - .unwrap(); - - // Set `accept_new_issues` back to the default value so the parachain state check succeeds. - assert_ok!(RuntimeCall::VaultRegistry(VaultRegistryCall::accept_new_issues { - currency_pair: new_vault_id.currencies.clone(), - accept_new_issues: true - }) - .dispatch(origin_of(new_vault_id.account_id.clone()))); - - assert_state_after_accept_replace_correct(&old_vault_id, &new_vault_id, &replace); - }); - } - - #[test] - fn integration_test_replace_accept_replace_below_dust_fails() { - test_with(|old_vault_id, new_vault_id| { - // if the new_vault _asks_ for an amount below below DUST, it gets rejected - - assert_noop!( - accept_replace( - &old_vault_id, - &new_vault_id, - old_vault_id.wrapped(1), - griefing(10_000), - BtcAddress::P2PKH(H160([1; 20])) - ), - ReplaceError::AmountBelowDustAmount - ); - - // if the old_vault does not have sufficient to-be-replaced tokens, it gets rejected - CoreVaultData::force_to( - &old_vault_id, - CoreVaultData { - to_be_replaced: old_vault_id.wrapped(1), - ..default_vault_state(&old_vault_id) - }, - ); - assert_noop!( - accept_replace( - &old_vault_id, - &new_vault_id, - old_vault_id.wrapped(1), - griefing(10_000), - BtcAddress::P2PKH(H160([1; 20])) - ), - ReplaceError::AmountBelowDustAmount - ); - }); - } - - #[test] - fn integration_test_replace_accept_replace_self_fails() { - test_with(|old_vault_id, _new_vault_id| { - assert_noop!( - accept_replace( - &old_vault_id, - &old_vault_id, - DEFAULT_VAULT_TO_BE_REPLACED, - griefing(10_000), - BtcAddress::P2PKH(H160([1; 20])) - ), - ReplaceError::ReplaceSelfNotAllowed - ); - }); - } - - #[test] - fn integration_test_replace_other_wrapped_currency_fails() { - test_with(|old_vault_id, new_vault_id| { - let other_currency = if let Token(IBTC) = old_vault_id.wrapped_currency() { - Token(KBTC) - } else { - Token(IBTC) - }; - assert_ok!(OraclePallet::_set_exchange_rate(other_currency, FixedU128::one())); - - let new_vault_id = VaultId::new( - account_of(NEW_VAULT), - new_vault_id.collateral_currency(), - other_currency, - ); - CoreVaultData::force_to(&new_vault_id, default_vault_state(&new_vault_id)); - assert_noop!( - accept_replace( - &old_vault_id, - &new_vault_id, - old_vault_id.wrapped(10000), - griefing(10_000), - BtcAddress::P2PKH(H160([1; 20])) - ), - ReplaceError::InvalidWrappedCurrency - ); - }) - } -} - -mod request_replace_tests { - use super::{assert_eq, *}; - - #[test] - fn integration_test_replace_request_replace_at_capacity_succeeds() { - test_with(|old_vault_id, new_vault_id| { - let amount = DEFAULT_VAULT_ISSUED - DEFAULT_VAULT_TO_BE_REDEEMED - DEFAULT_VAULT_TO_BE_REPLACED; - let amount = old_vault_id.wrapped(amount.amount()); - let griefing_collateral = request_replace(&old_vault_id, amount); - // assert request event - assert_replace_request_event(); - - assert_eq!( - ParachainTwoVaultState::get(&old_vault_id, &new_vault_id), - ParachainTwoVaultState::get_default(&old_vault_id, &new_vault_id).with_changes(|old_vault, _, _| { - old_vault.to_be_replaced += amount; - old_vault.griefing_collateral += griefing_collateral; - old_vault.replace_collateral += griefing_collateral; - *old_vault.free_balance.get_mut(&DEFAULT_GRIEFING_CURRENCY).unwrap() -= griefing_collateral; - }) - ); - }); - } - - #[test] - fn integration_test_replace_request_replace_above_capacity_succeeds() { - test_with(|old_vault_id, new_vault_id| { - let amount = (DEFAULT_VAULT_ISSUED - DEFAULT_VAULT_TO_BE_REDEEMED - DEFAULT_VAULT_TO_BE_REPLACED) * 2; - let amount = old_vault_id.wrapped(amount.amount()); - - let griefing_collateral = request_replace(&old_vault_id, amount); - - // assert request event - assert_replace_request_event(); - - assert_eq!( - ParachainTwoVaultState::get(&old_vault_id, &new_vault_id), - ParachainTwoVaultState::get_default(&old_vault_id, &new_vault_id).with_changes(|old_vault, _, _| { - old_vault.to_be_replaced += amount / 2; - old_vault.griefing_collateral += griefing_collateral; - old_vault.replace_collateral += griefing_collateral; - *old_vault.free_balance.get_mut(&DEFAULT_GRIEFING_CURRENCY).unwrap() -= griefing_collateral; - }) - ); - }); - } - - #[test] - fn integration_test_replace_request_replace_below_capacity_succeeds() { - test_with(|old_vault_id, new_vault_id| { - let amount = (DEFAULT_VAULT_ISSUED - DEFAULT_VAULT_TO_BE_REDEEMED - DEFAULT_VAULT_TO_BE_REPLACED) / 2; - let amount = old_vault_id.wrapped(amount.amount()); - let griefing_collateral = request_replace(&old_vault_id, amount); - - // assert request event - let _request_id = assert_replace_request_event(); - - assert_eq!( - ParachainTwoVaultState::get(&old_vault_id, &new_vault_id), - ParachainTwoVaultState::get_default(&old_vault_id, &new_vault_id).with_changes(|old_vault, _, _| { - old_vault.to_be_replaced += amount; - old_vault.griefing_collateral += griefing_collateral; - old_vault.replace_collateral += griefing_collateral; - *old_vault.free_balance.get_mut(&DEFAULT_GRIEFING_CURRENCY).unwrap() -= griefing_collateral; - }) - ); - }); - } - - #[test] - fn integration_test_replace_request_replace_with_zero_btc_fails() { - test_with(|old_vault_id, _new_vault_id| { - assert_noop!( - RuntimeCall::Replace(ReplaceCall::request_replace { - currency_pair: old_vault_id.currencies.clone(), - amount: 0, - }) - .dispatch(origin_of(old_vault_id.account_id.clone())), - ReplaceError::ReplaceAmountZero - ); - }); - } - - #[test] - fn integration_test_replace_request_replace_with_insufficient_collateral() { - test_with(|old_vault_id, new_vault_id| { - let amount = old_vault_id.wrapped(1000); - - CoreVaultData::force_to( - &old_vault_id, - CoreVaultData { - to_be_replaced: old_vault_id.wrapped(5_000), - replace_collateral: griefing(1), - ..default_vault_state(&old_vault_id) - }, - ); - - let pre_request_state = ParachainTwoVaultState::get(&old_vault_id, &new_vault_id); - - // check that by locking sufficient collateral we can recover - let griefing_collateral = request_replace(&old_vault_id, amount); - - assert_eq!( - ParachainTwoVaultState::get(&old_vault_id, &new_vault_id), - pre_request_state.with_changes(|old_vault, _, _| { - old_vault.to_be_replaced += amount; - old_vault.griefing_collateral += griefing_collateral; - old_vault.replace_collateral += griefing_collateral; - *old_vault.free_balance.get_mut(&DEFAULT_GRIEFING_CURRENCY).unwrap() -= griefing_collateral; - }) - ); - }); - } -} - -mod withdraw_replace_tests { - use super::{assert_eq, *}; - - #[test] - fn integration_test_replace_withdraw_replace_at_capacity_succeeds() { - test_with(|old_vault_id, new_vault_id| { - let amount = DEFAULT_VAULT_TO_BE_REPLACED; - let amount = old_vault_id.wrapped(amount.amount()); - - assert_ok!(withdraw_replace(&old_vault_id, amount)); - - let released_collateral = DEFAULT_VAULT_REPLACE_COLLATERAL; - - assert_eq!( - ParachainTwoVaultState::get(&old_vault_id, &new_vault_id), - ParachainTwoVaultState::get_default(&old_vault_id, &new_vault_id).with_changes(|old_vault, _, _| { - old_vault.to_be_replaced -= amount; - - *old_vault.free_balance.get_mut(&DEFAULT_GRIEFING_CURRENCY).unwrap() += released_collateral; - old_vault.griefing_collateral -= released_collateral; - old_vault.replace_collateral -= released_collateral; - }) - ); - }); - } - - #[test] - fn integration_test_replace_withdraw_replace_below_capacity_succeeds() { - test_with(|old_vault_id, new_vault_id| { - // withdraw 25% - let amount = DEFAULT_VAULT_TO_BE_REPLACED / 4; - let amount = old_vault_id.wrapped(amount.amount()); - - assert_ok!(withdraw_replace(&old_vault_id, amount)); - - let released_collateral = DEFAULT_VAULT_REPLACE_COLLATERAL / 4; - - assert_eq!( - ParachainTwoVaultState::get(&old_vault_id, &new_vault_id), - ParachainTwoVaultState::get_default(&old_vault_id, &new_vault_id).with_changes(|old_vault, _, _| { - old_vault.to_be_replaced -= amount; - - *old_vault.free_balance.get_mut(&DEFAULT_GRIEFING_CURRENCY).unwrap() += released_collateral; - old_vault.griefing_collateral -= released_collateral; - old_vault.replace_collateral -= released_collateral; - }) - ); - }); - } - - #[test] - fn integration_test_replace_withdraw_replace_above_capacity_succeeds() { - test_with(|old_vault_id, new_vault_id| { - // withdraw 200% - should just be capped to 100% - let amount = DEFAULT_VAULT_TO_BE_REPLACED * 2; - let amount = old_vault_id.wrapped(amount.amount()); - - assert_ok!(withdraw_replace(&old_vault_id, amount)); - - let released_collateral = DEFAULT_VAULT_REPLACE_COLLATERAL; - - assert_eq!( - ParachainTwoVaultState::get(&old_vault_id, &new_vault_id), - ParachainTwoVaultState::get_default(&old_vault_id, &new_vault_id).with_changes(|old_vault, _, _| { - old_vault.to_be_replaced -= amount / 2; - - *old_vault.free_balance.get_mut(&DEFAULT_GRIEFING_CURRENCY).unwrap() += released_collateral; - old_vault.griefing_collateral -= released_collateral; - old_vault.replace_collateral -= released_collateral; - }) - ); - }); - } - #[test] - fn integration_test_replace_withdraw_replace_with_zero_to_be_replaced_tokens_fails() { - test_with(|old_vault_id, _new_vault_id| { - CoreVaultData::force_to( - &old_vault_id, - CoreVaultData { - to_be_replaced: old_vault_id.wrapped(0), - ..default_vault_state(&old_vault_id) - }, - ); - - assert_noop!( - withdraw_replace(&old_vault_id, old_vault_id.wrapped(1000)), - ReplaceError::NoPendingRequest - ); - }); - } -} - -mod expiry_test { - use super::{assert_eq, *}; - - /// test replace created by accept - fn test_with(initial_period: u32, execute: impl Fn(H256)) { - let amount_btc = wrapped(5_000); - let griefing_collateral = griefing(1000); - super::test_with(|old_vault_id, new_vault_id| { - set_replace_period(initial_period); - let (replace_id, _replace) = accept_replace( - &old_vault_id, - &new_vault_id, - amount_btc, - griefing_collateral, - BtcAddress::P2PKH(H160([1; 20])), - ) - .unwrap(); - execute(replace_id); - }); - } - - fn set_replace_period(period: u32) { - assert_ok!(RuntimeCall::Replace(ReplaceCall::set_replace_period { period }).dispatch(root())); - } - - fn cancel_replace(replace_id: H256) -> DispatchResultWithPostInfo { - RuntimeCall::Replace(ReplaceCall::cancel_replace { replace_id: replace_id }) - .dispatch(origin_of(account_of(NEW_VAULT))) - } - - #[test] - fn integration_test_replace_expiry_only_parachain_blocks_expired() { - test_with(1000, |replace_id| { - mine_blocks(1); - SecurityPallet::set_active_block_number(1500); - - assert_err!(cancel_replace(replace_id), ReplaceError::ReplacePeriodNotExpired); - assert_ok!(execute_replace(replace_id)); - }); - } - - #[test] - fn integration_test_replace_expiry_only_bitcoin_blocks_expired() { - test_with(1000, |replace_id| { - mine_blocks(15); - SecurityPallet::set_active_block_number(500); - - assert_err!(cancel_replace(replace_id), ReplaceError::ReplacePeriodNotExpired); - assert_ok!(execute_replace(replace_id)); - }); - } - - #[test] - fn integration_test_replace_expiry_no_period_change_pre_expiry() { - test_with(1000, |replace_id| { - mine_blocks(7); - SecurityPallet::set_active_block_number(750); - - assert_err!(cancel_replace(replace_id), ReplaceError::ReplacePeriodNotExpired); - assert_ok!(execute_replace(replace_id)); - }); - } - - #[test] - fn integration_test_replace_expiry_no_period_change_post_expiry() { - // can still execute after expiry - test_with(1000, |replace_id| { - mine_blocks(100); - SecurityPallet::set_active_block_number(1100); - - assert_ok!(execute_replace(replace_id)); - }); - - // but new-vault can also cancel.. whoever is first wins - test_with(1000, |replace_id| { - mine_blocks(100); - SecurityPallet::set_active_block_number(1100); - - assert_ok!(cancel_replace(replace_id)); - }); - } - - #[test] - fn integration_test_replace_expiry_with_period_decrease() { - test_with(2000, |replace_id| { - mine_blocks(15); - SecurityPallet::set_active_block_number(1100); - set_replace_period(1000); - - // request still uses period = 200, so cancel fails and execute succeeds - assert_err!(cancel_replace(replace_id), ReplaceError::ReplacePeriodNotExpired); - assert_ok!(execute_replace(replace_id)); - }); - } - - #[test] - fn integration_test_replace_expiry_with_period_increase() { - test_with(1000, |replace_id| { - mine_blocks(15); - SecurityPallet::set_active_block_number(1100); - set_replace_period(2000); - - // request uses period = 200, so execute succeeds and cancel fails - assert_err!(cancel_replace(replace_id), ReplaceError::ReplacePeriodNotExpired); - assert_ok!(execute_replace(replace_id)); - }); - } -} - -mod execute_replace_payment_limits { - use super::{assert_eq, *}; - - #[test] - fn integration_test_execute_replace_with_exact_amount_succeeds() { - test_with(|old_vault_id, new_vault_id| { - let (replace_id, replace) = accept_replace( - &old_vault_id, - &new_vault_id, - old_vault_id.wrapped(1000000), - DEFAULT_GRIEFING_COLLATERAL, - Default::default(), - ) - .unwrap(); - assert_ok!(execute_replace_with_amount(replace_id, replace.amount())); - }); - } - #[test] - fn integration_test_execute_replace_with_overpayment_fails() { - test_with(|old_vault_id, new_vault_id| { - let (replace_id, replace) = accept_replace( - &old_vault_id, - &new_vault_id, - old_vault_id.wrapped(1000000), - DEFAULT_GRIEFING_COLLATERAL, - Default::default(), - ) - .unwrap(); - assert_err!( - execute_replace_with_amount(replace_id, replace.amount().with_amount(|x| x + 1)), - BTCRelayError::InvalidPaymentAmount - ); - }); - } - #[test] - fn integration_test_execute_replace_with_underpayment_fails() { - test_with(|old_vault_id, new_vault_id| { - let (replace_id, replace) = accept_replace( - &old_vault_id, - &new_vault_id, - old_vault_id.wrapped(1000000), - DEFAULT_GRIEFING_COLLATERAL, - Default::default(), - ) - .unwrap(); - assert_err!( - execute_replace_with_amount(replace_id, replace.amount().with_amount(|x| x - 1)), - BTCRelayError::InvalidPaymentAmount - ); - }); - } -} - -#[test] -fn integration_test_replace_cancel_replace() { - test_with(|old_vault_id, new_vault_id| { - let (_, replace_id) = setup_replace(&old_vault_id, &new_vault_id, old_vault_id.wrapped(1000)); - - // set block height - // new_vault cancels replacement - mine_blocks(2); - SecurityPallet::set_active_block_number(30); - assert_ok!( - RuntimeCall::Replace(ReplaceCall::cancel_replace { replace_id: replace_id }) - .dispatch(origin_of(new_vault_id.account_id.clone())) - ); - }); -} - -// liquidation tests - -fn execute_replace(replace_id: H256) -> DispatchResultWithPostInfo { - let replace = ReplacePallet::get_open_or_cancelled_replace_request(&replace_id).unwrap(); - execute_replace_with_amount(replace_id, replace.amount()) -} - -fn execute_replace_with_amount(replace_id: H256, amount: Amount) -> DispatchResultWithPostInfo { - let replace = ReplacePallet::get_open_or_cancelled_replace_request(&replace_id).unwrap(); - - // send the btc from the old_vault to the new_vault - let (_tx_id, _tx_block_height, transaction) = generate_transaction_and_mine( - Default::default(), - vec![], - vec![(replace.btc_address, amount)], - vec![replace_id], - ); - - SecurityPallet::set_active_block_number(SecurityPallet::active_block_number() + CONFIRMATIONS); - - RuntimeCall::Replace(ReplaceCall::execute_replace { - replace_id, - unchecked_transaction: transaction, - }) - .dispatch(origin_of(account_of(OLD_VAULT))) -} - -fn cancel_replace(replace_id: H256) { - // set block height - mine_blocks(2); - SecurityPallet::set_active_block_number(30); - assert_ok!( - RuntimeCall::Replace(ReplaceCall::cancel_replace { replace_id: replace_id }) - .dispatch(origin_of(account_of(NEW_VAULT))) - ); -} - -#[test] -fn integration_test_replace_execute_replace_success() { - test_with(|old_vault_id, new_vault_id| { - let (replace, replace_id) = setup_replace(&old_vault_id, &new_vault_id, old_vault_id.wrapped(1000)); - - let pre_execute_state = ParachainTwoVaultState::get(&old_vault_id, &new_vault_id); - - assert_ok!(execute_replace(replace_id)); - - assert_eq!( - ParachainTwoVaultState::get(&old_vault_id, &new_vault_id), - pre_execute_state.with_changes(|old_vault, new_vault, _| { - new_vault.to_be_issued -= old_vault_id.wrapped(1000); - new_vault.issued += old_vault_id.wrapped(1000); - old_vault.to_be_redeemed -= old_vault_id.wrapped(1000); - old_vault.issued -= old_vault_id.wrapped(1000); - - old_vault.griefing_collateral -= replace.griefing_collateral(); - *old_vault.free_balance.get_mut(&DEFAULT_GRIEFING_CURRENCY).unwrap() += replace.griefing_collateral(); - }) - ); - }); -} - -fn calculate_replace_collateral( - vault_data: &CoreVaultData, - replace_amount: Amount, - currency_id: CurrencyId, -) -> Amount { - Amount::new( - (vault_data.backing_collateral.amount() * replace_amount.amount()) - / (vault_data.issued + vault_data.to_be_issued).amount(), - currency_id, - ) -} - -#[test] -fn integration_test_replace_execute_replace_old_vault_liquidated() { - test_with(|old_vault_id, new_vault_id| { - let replace_tokens = old_vault_id.wrapped(1000); - let (replace, replace_id) = setup_replace(&old_vault_id, &new_vault_id, replace_tokens); - - let old = CoreVaultData::vault(old_vault_id.clone()); - - liquidate_vault(&old_vault_id); - - let pre_execution_state = ParachainTwoVaultState::get(&old_vault_id, &new_vault_id); - - assert_ok!(execute_replace(replace_id)); - - let collateral_for_replace = - calculate_replace_collateral(&old, replace.amount(), old_vault_id.collateral_currency()); - - assert_eq!( - ParachainTwoVaultState::get(&old_vault_id, &new_vault_id), - pre_execution_state.with_changes(|old_vault, new_vault, liquidation_vault| { - let liquidation_vault = liquidation_vault.with_currency(&old_vault_id.currencies); - - liquidation_vault.issued -= old_vault_id.wrapped(1000); - liquidation_vault.to_be_redeemed -= old_vault_id.wrapped(1000); - - new_vault.to_be_issued -= old_vault_id.wrapped(1000); - new_vault.issued += old_vault_id.wrapped(1000); - - old_vault.to_be_redeemed -= old_vault_id.wrapped(1000); - old_vault.liquidated_collateral -= collateral_for_replace; - old_vault.backing_collateral += collateral_for_replace; // TODO: probably should be free - *old_vault.free_balance.get_mut(&DEFAULT_GRIEFING_CURRENCY).unwrap() += replace.griefing_collateral(); - old_vault.griefing_collateral -= replace.griefing_collateral(); - }) - ); - }); -} - -#[test] -fn integration_test_replace_execute_replace_new_vault_liquidated() { - test_with(|old_vault_id, new_vault_id| { - let replace_tokens = old_vault_id.wrapped(1000); - let (replace, replace_id) = setup_replace(&old_vault_id, &new_vault_id, replace_tokens); - - liquidate_vault(&new_vault_id); - let pre_execution_state = ParachainTwoVaultState::get(&old_vault_id, &new_vault_id); - - assert_ok!(execute_replace(replace_id)); - - assert_eq!( - ParachainTwoVaultState::get(&old_vault_id, &new_vault_id), - pre_execution_state.with_changes(|old_vault, _new_vault, liquidation_vault| { - let new_liquidation_vault = liquidation_vault.with_currency(&new_vault_id.currencies); - new_liquidation_vault.issued += old_vault_id.wrapped(1000); - new_liquidation_vault.to_be_issued -= old_vault_id.wrapped(1000); - - old_vault.to_be_redeemed -= old_vault_id.wrapped(1000); - old_vault.issued -= old_vault_id.wrapped(1000); - - old_vault.griefing_collateral -= replace.griefing_collateral(); - *old_vault.free_balance.get_mut(&DEFAULT_GRIEFING_CURRENCY).unwrap() += replace.griefing_collateral(); - }) - ); - }); -} - -#[test] -fn integration_test_replace_execute_replace_both_vaults_liquidated() { - test_with(|old_vault_id, new_vault_id| { - let replace_tokens = old_vault_id.wrapped(1000); - let (replace, replace_id) = setup_replace(&old_vault_id, &new_vault_id, replace_tokens); - - let old = CoreVaultData::vault(old_vault_id.clone()); - - liquidate_vault(&old_vault_id); - liquidate_vault(&new_vault_id); - - let pre_execution_state = ParachainTwoVaultState::get(&old_vault_id, &new_vault_id); - - assert_ok!(execute_replace(replace_id)); - - let collateral_for_replace = - calculate_replace_collateral(&old, replace.amount(), old_vault_id.collateral_currency()); - - assert_eq!( - ParachainTwoVaultState::get(&old_vault_id, &new_vault_id), - pre_execution_state.with_changes(|old_vault, _new_vault, liquidation_vault| { - let old_liquidation_vault = liquidation_vault.with_currency(&old_vault_id.currencies); - old_liquidation_vault.to_be_redeemed -= old_vault_id.wrapped(1000); - old_liquidation_vault.issued -= old_vault_id.wrapped(1000); - - let new_liquidation_vault = liquidation_vault.with_currency(&new_vault_id.currencies); - new_liquidation_vault.to_be_issued -= old_vault_id.wrapped(1000); - new_liquidation_vault.issued += old_vault_id.wrapped(1000); - - old_vault.to_be_redeemed -= old_vault_id.wrapped(1000); - old_vault.liquidated_collateral -= collateral_for_replace; - old_vault.backing_collateral += collateral_for_replace; // TODO: probably should be free - *old_vault.free_balance.get_mut(&DEFAULT_GRIEFING_CURRENCY).unwrap() += replace.griefing_collateral(); - old_vault.griefing_collateral -= replace.griefing_collateral(); - }) - ); - }); -} - -#[test] -fn integration_test_replace_execute_replace_with_cancelled() { - test_with(|old_vault_id, new_vault_id| { - let issued_tokens = old_vault_id.wrapped(1000); - let (replace, replace_id) = setup_replace(&old_vault_id, &new_vault_id, issued_tokens); - - let before = ParachainTwoVaultState::get(&old_vault_id, &new_vault_id); - cancel_replace(replace_id); - assert_ok!(execute_replace(replace_id)); - - assert_eq!( - ParachainTwoVaultState::get(&old_vault_id, &new_vault_id), - before.with_changes(|old_vault, new_vault, _| { - new_vault.to_be_issued -= issued_tokens; - new_vault.issued += issued_tokens; - old_vault.to_be_redeemed -= issued_tokens; - old_vault.issued -= issued_tokens; - - old_vault.griefing_collateral -= replace.griefing_collateral(); - *new_vault.free_balance.get_mut(&DEFAULT_GRIEFING_CURRENCY).unwrap() += replace.griefing_collateral(); - }) - ); - }); -} - -#[test] -fn integration_test_replace_execute_replace_with_additional_and_cancelled() { - test_with(|old_vault_id, new_vault_id| { - let issued_tokens = old_vault_id.wrapped(1000); - let collateral = old_vault_id.collateral(100000); - let (replace, replace_id) = - setup_replace_with_collateral(&old_vault_id, &new_vault_id, issued_tokens, collateral); - - let before = ParachainTwoVaultState::get(&old_vault_id, &new_vault_id); - cancel_replace(replace_id); - assert_ok!(execute_replace(replace_id)); - - assert_eq!( - ParachainTwoVaultState::get(&old_vault_id, &new_vault_id), - before.with_changes(|old_vault, new_vault, _| { - new_vault.to_be_issued -= issued_tokens; - new_vault.issued += issued_tokens; - old_vault.to_be_redeemed -= issued_tokens; - old_vault.issued -= issued_tokens; - - // griefing collateral is slashed - old_vault.griefing_collateral -= replace.griefing_collateral(); - *new_vault.free_balance.get_mut(&DEFAULT_GRIEFING_CURRENCY).unwrap() += replace.griefing_collateral(); - - // backing collateral is returned - new_vault.backing_collateral -= replace.collateral().unwrap(); - *new_vault - .free_balance - .get_mut(&new_vault_id.collateral_currency()) - .unwrap() += replace.collateral().unwrap(); - }) - ); - }); -} - -#[test] -fn integration_test_replace_cancel_replace_success() { - test_with(|old_vault_id, new_vault_id| { - let (replace, replace_id) = setup_replace(&old_vault_id, &new_vault_id, old_vault_id.wrapped(1000)); - - let pre_cancellation_state = ParachainTwoVaultState::get(&old_vault_id, &new_vault_id); - - cancel_replace(replace_id); - - assert_eq!( - ParachainTwoVaultState::get(&old_vault_id, &new_vault_id), - pre_cancellation_state.with_changes(|old_vault, new_vault, _| { - new_vault.to_be_issued -= old_vault_id.wrapped(1000); - new_vault.backing_collateral -= replace.collateral().unwrap(); - *new_vault - .free_balance - .get_mut(&new_vault_id.collateral_currency()) - .unwrap() += replace.collateral().unwrap(); - *new_vault.free_balance.get_mut(&DEFAULT_GRIEFING_CURRENCY).unwrap() += replace.griefing_collateral(); - - old_vault.to_be_redeemed -= old_vault_id.wrapped(1000); - - old_vault.griefing_collateral -= replace.griefing_collateral(); - }) - ); - }); -} - -#[test] -fn integration_test_replace_cancel_replace_old_vault_liquidated() { - test_with(|old_vault_id, new_vault_id| { - let (replace, replace_id) = setup_replace(&old_vault_id, &new_vault_id, old_vault_id.wrapped(1000)); - - let old = CoreVaultData::vault(old_vault_id.clone()); - - liquidate_vault(&old_vault_id); - - let pre_cancellation_state = ParachainTwoVaultState::get(&old_vault_id, &new_vault_id); - - cancel_replace(replace_id); - - let collateral_for_replace = - calculate_replace_collateral(&old, replace.amount(), old_vault_id.collateral_currency()); - - assert_eq!( - ParachainTwoVaultState::get(&old_vault_id, &new_vault_id), - pre_cancellation_state.with_changes(|old_vault, new_vault, liquidation_vault| { - let liquidation_vault = liquidation_vault.with_currency(&old_vault_id.currencies); - - old_vault.to_be_redeemed -= old_vault_id.wrapped(1000); - old_vault.griefing_collateral -= replace.griefing_collateral(); - old_vault.liquidated_collateral -= collateral_for_replace; - - new_vault.to_be_issued -= old_vault_id.wrapped(1000); - new_vault.backing_collateral -= replace.collateral().unwrap(); - *new_vault - .free_balance - .get_mut(&new_vault_id.collateral_currency()) - .unwrap() += replace.collateral().unwrap(); - *new_vault.free_balance.get_mut(&DEFAULT_GRIEFING_CURRENCY).unwrap() += replace.griefing_collateral(); - - liquidation_vault.to_be_redeemed -= old_vault_id.wrapped(1000); - liquidation_vault.collateral += collateral_for_replace; - }) - ); - }); -} - -#[test] -fn integration_test_replace_cancel_replace_new_vault_liquidated() { - test_with(|old_vault_id, new_vault_id| { - let (replace, replace_id) = setup_replace(&old_vault_id, &new_vault_id, old_vault_id.wrapped(1000)); - - liquidate_vault(&new_vault_id); - - let pre_cancellation_state = ParachainTwoVaultState::get(&old_vault_id, &new_vault_id); - - cancel_replace(replace_id); - - assert_eq!( - ParachainTwoVaultState::get(&old_vault_id, &new_vault_id), - pre_cancellation_state.with_changes(|old_vault, new_vault, liquidation_vault| { - old_vault.to_be_redeemed -= old_vault_id.wrapped(1000); - old_vault.griefing_collateral -= replace.griefing_collateral(); - - *new_vault.free_balance.get_mut(&DEFAULT_GRIEFING_CURRENCY).unwrap() += replace.griefing_collateral(); - - let new_liquidation_vault = liquidation_vault.with_currency(&new_vault_id.currencies); - new_liquidation_vault.to_be_issued -= old_vault_id.wrapped(1000); - }) - ); - }); -} - -#[test] -fn integration_test_replace_cancel_replace_both_vaults_liquidated() { - test_with(|old_vault_id, new_vault_id| { - let (replace, replace_id) = setup_replace(&old_vault_id, &new_vault_id, old_vault_id.wrapped(1000)); - - let old = CoreVaultData::vault(old_vault_id.clone()); - - liquidate_vault(&old_vault_id); - liquidate_vault(&new_vault_id); - - let pre_cancellation_state = ParachainTwoVaultState::get(&old_vault_id, &new_vault_id); - - cancel_replace(replace_id); - - let collateral_for_replace = - calculate_replace_collateral(&old, replace.amount(), old_vault_id.collateral_currency()); - - assert_eq!( - ParachainTwoVaultState::get(&old_vault_id, &new_vault_id), - pre_cancellation_state.with_changes(|old_vault, new_vault, liquidation_vault| { - old_vault.to_be_redeemed -= old_vault_id.wrapped(1000); - old_vault.griefing_collateral -= replace.griefing_collateral(); - old_vault.liquidated_collateral -= collateral_for_replace; - - *new_vault.free_balance.get_mut(&DEFAULT_GRIEFING_CURRENCY).unwrap() += replace.griefing_collateral(); - - let old_liquidation_vault = liquidation_vault.with_currency(&old_vault_id.currencies); - old_liquidation_vault.to_be_redeemed -= old_vault_id.wrapped(1000); - old_liquidation_vault.collateral += collateral_for_replace; - - let new_liquidation_vault = liquidation_vault.with_currency(&new_vault_id.currencies); - new_liquidation_vault.to_be_issued -= old_vault_id.wrapped(1000); - }) - ); - }); -} - -#[test] -fn integration_test_replace_vault_with_different_currency_succeeds() { - test_without_initialization(|currency_id| { - for currency_id in iter_collateral_currencies().filter(|c| !c.is_lend_token()) { - assert_ok!(OraclePallet::_set_exchange_rate(currency_id, FixedU128::one())); - } - set_default_thresholds(); - SecurityPallet::set_active_block_number(1); - - let other_currency = if let Token(DOT) = currency_id { - Token(KSM) - } else { - Token(DOT) - }; - - let old_vault_id = vault_id_of(OLD_VAULT, currency_id); - let new_vault_id = vault_id_of(NEW_VAULT, other_currency); - - // Mint lendTokens so that force-setting vault state doesn't fail - activate_lending_and_mint(Token(DOT), LendToken(1)); - CoreVaultData::force_to(&old_vault_id, default_vault_state(&old_vault_id)); - CoreVaultData::force_to(&new_vault_id, default_vault_state(&new_vault_id)); - - let (replace, replace_id) = setup_replace(&old_vault_id, &new_vault_id, old_vault_id.wrapped(1000)); - - let pre_execute_state = ParachainTwoVaultState::get(&old_vault_id, &new_vault_id); - - assert_ok!(execute_replace(replace_id)); - - assert_eq!( - ParachainTwoVaultState::get(&old_vault_id, &new_vault_id), - pre_execute_state.with_changes(|old_vault, new_vault, _| { - new_vault.to_be_issued -= old_vault_id.wrapped(1000); - new_vault.issued += old_vault_id.wrapped(1000); - old_vault.to_be_redeemed -= old_vault_id.wrapped(1000); - old_vault.issued -= old_vault_id.wrapped(1000); - - old_vault.griefing_collateral -= replace.griefing_collateral(); - *old_vault.free_balance.get_mut(&DEFAULT_GRIEFING_CURRENCY).unwrap() += replace.griefing_collateral(); - }) - ); - }); -} - -mod oracle_down { - use super::{assert_eq, *}; - - #[test] - fn no_oracle_execute_replace_succeeds() { - test_with(|old_vault_id, new_vault_id| { - let (_, replace_id) = setup_replace(&old_vault_id, &new_vault_id, old_vault_id.wrapped(1000)); - - OraclePallet::expire_all(); - - assert_ok!(execute_replace(replace_id)); - }); - } - - #[test] - fn no_oracle_accept_replace_fails() { - test_with(|old_vault_id, new_vault_id| { - OraclePallet::expire_all(); - - assert_noop!( - RuntimeCall::Replace(ReplaceCall::accept_replace { - currency_pair: new_vault_id.currencies.clone(), - old_vault: old_vault_id.clone(), - amount_btc: 1000000, - collateral: DEFAULT_GRIEFING_COLLATERAL.amount(), - btc_address: Default::default(), - }) - .dispatch(origin_of(new_vault_id.account_id.clone())), - OracleError::MissingExchangeRate - ); - }); - } - - #[test] - fn no_oracle_request_replace_fails() { - test_with(|old_vault_id, _new_vault_id| { - let amount = DEFAULT_VAULT_ISSUED - DEFAULT_VAULT_TO_BE_REDEEMED - DEFAULT_VAULT_TO_BE_REPLACED; - OraclePallet::expire_all(); - assert_noop!( - RuntimeCall::Replace(ReplaceCall::request_replace { - currency_pair: old_vault_id.currencies.clone(), - amount: amount.amount(), - }) - .dispatch(origin_of(old_vault_id.account_id.clone())), - OracleError::MissingExchangeRate - ); - }) - } - - #[test] - fn no_oracle_cancel_replace_fails() { - test_with(|old_vault_id, new_vault_id| { - let issued_tokens = old_vault_id.wrapped(1000); - let (_, replace_id) = setup_replace(&old_vault_id, &new_vault_id, issued_tokens); - - OraclePallet::expire_all(); - - mine_blocks(2); - SecurityPallet::set_active_block_number(30); - assert_noop!( - RuntimeCall::Replace(ReplaceCall::cancel_replace { replace_id: replace_id }) - .dispatch(origin_of(account_of(NEW_VAULT))), - OracleError::MissingExchangeRate - ); - }) - } - - #[test] - fn no_oracle_execute_cancelled_replace_fails() { - test_with(|old_vault_id, new_vault_id| { - let issued_tokens = old_vault_id.wrapped(1000); - let (_, replace_id) = setup_replace(&old_vault_id, &new_vault_id, issued_tokens); - - cancel_replace(replace_id); - OraclePallet::expire_all(); - assert_err!(execute_replace(replace_id), OracleError::MissingExchangeRate); - }) - } -} diff --git a/parachain/runtime/runtime-tests/src/parachain/vault_registry.rs b/parachain/runtime/runtime-tests/src/parachain/vault_registry.rs index e8cdc6fbc0..3ca02d6e76 100644 --- a/parachain/runtime/runtime-tests/src/parachain/vault_registry.rs +++ b/parachain/runtime/runtime-tests/src/parachain/vault_registry.rs @@ -306,7 +306,6 @@ mod withdraw_collateral_test { fn integration_test_vault_registry_undercollateralization_liquidation() { test_with(|vault_id| { let currency_id = vault_id.collateral_currency(); - let vault_data = default_vault_state(&vault_id); liquidate_vault(&vault_id); assert_eq!( @@ -324,19 +323,12 @@ fn integration_test_vault_registry_undercollateralization_liquidation() { liquidation_vault.issued = vault_id.wrapped(DEFAULT_VAULT_ISSUED.amount()); liquidation_vault.to_be_redeemed = vault_id.wrapped(DEFAULT_VAULT_TO_BE_REDEEMED.amount()); - vault.griefing_collateral -= DEFAULT_VAULT_REPLACE_COLLATERAL; - vault.replace_collateral -= DEFAULT_VAULT_REPLACE_COLLATERAL; - vault.to_be_replaced = vault_id.wrapped(0); vault.issued = vault_id.wrapped(0); vault.to_be_issued = vault_id.wrapped(0); vault.backing_collateral = Amount::new(0, currency_id); vault.liquidated_collateral = default_vault_backing_collateral(currency_id) - liquidation_vault.collateral; vault.status = VaultStatus::Liquidated; - *vault - .free_balance - .get_mut(&vault_data.replace_collateral.currency()) - .unwrap() += vault_data.replace_collateral; }) ); }); @@ -415,8 +407,6 @@ fn integration_test_vault_registry_liquidation_recovery_fails() { fn default_liquidation_recovery_vault(vault_id: &VaultId) -> CoreVaultData { let mut vault_data = default_vault_state(&vault_id); vault_data.to_be_redeemed = vault_id.wrapped(0); - vault_data.to_be_replaced = vault_id.wrapped(0); - vault_data.replace_collateral = vault_data.replace_collateral.with_amount(|_| 0); vault_data } diff --git a/parachain/runtime/runtime-tests/src/setup.rs b/parachain/runtime/runtime-tests/src/setup.rs index 018643e590..0c9a2ca90b 100644 --- a/parachain/runtime/runtime-tests/src/setup.rs +++ b/parachain/runtime/runtime-tests/src/setup.rs @@ -155,13 +155,6 @@ impl ExtBuilder { .assimilate_storage(&mut storage) .unwrap(); - replace::GenesisConfig:: { - replace_period: 10, - replace_btc_dust_value: 2, - } - .assimilate_storage(&mut storage) - .unwrap(); - fee::GenesisConfig:: { issue_fee: FixedU128::checked_from_rational(15, 10000).unwrap(), // 0.15% issue_griefing_collateral: FixedU128::checked_from_rational(5, 100000).unwrap(), // 0.005% diff --git a/parachain/runtime/runtime-tests/src/utils.rs b/parachain/runtime/runtime-tests/src/utils.rs index de80c7b33c..1c96dcbead 100644 --- a/parachain/runtime/runtime-tests/src/utils.rs +++ b/parachain/runtime/runtime-tests/src/utils.rs @@ -26,7 +26,6 @@ pub use loans_utils::activate_lending_and_mint; pub use oracle::OracleKey; pub use redeem::{types::RedeemRequestExt, RedeemRequest}; use redeem_utils::USER_BTC_ADDRESS; -pub use replace::{types::ReplaceRequestExt, ReplaceRequest}; pub use reward::RewardsApi; pub use sp_arithmetic::{FixedI128, FixedPointNumber, FixedU128}; pub use sp_core::{H160, H256, U256}; @@ -39,7 +38,6 @@ pub mod issue_utils; pub mod loans_utils; pub mod nomination_utils; pub mod redeem_utils; -pub mod replace_utils; pub mod reward_utils; pub use itertools::Itertools; @@ -136,11 +134,6 @@ pub type RedeemPallet = redeem::Pallet; pub type RedeemError = redeem::Error; pub type RedeemEvent = redeem::Event; -pub type ReplaceCall = replace::Call; -pub type ReplaceEvent = replace::Event; -pub type ReplaceError = replace::Error; -pub type ReplacePallet = replace::Pallet; - pub type SecurityError = security::Error; pub type SecurityPallet = security::Pallet; pub type SecurityCall = security::Call; @@ -244,9 +237,6 @@ pub fn default_vault_state(vault_id: &VaultId) -> CoreVaultData { to_be_issued: vault_id.wrapped(DEFAULT_VAULT_TO_BE_ISSUED.amount()), issued: vault_id.wrapped(DEFAULT_VAULT_ISSUED.amount()), to_be_redeemed: vault_id.wrapped(DEFAULT_VAULT_TO_BE_REDEEMED.amount()), - to_be_replaced: vault_id.wrapped(DEFAULT_VAULT_TO_BE_REPLACED.amount()), - griefing_collateral: DEFAULT_VAULT_GRIEFING_COLLATERAL, - replace_collateral: DEFAULT_VAULT_REPLACE_COLLATERAL, backing_collateral: default_vault_backing_collateral(vault_id.collateral_currency()), free_balance: iter_all_currencies() .map(|x| (x, default_vault_free_balance(x))) @@ -300,6 +290,7 @@ pub fn default_redeem_request( btc_address: USER_BTC_ADDRESS, btc_height, status: RedeemRequestStatus::Pending, + issue_id: None, } } @@ -523,12 +514,9 @@ pub struct CoreVaultData { pub issued: Amount, pub to_be_redeemed: Amount, pub backing_collateral: Amount, - pub griefing_collateral: Amount, pub liquidated_collateral: Amount, // note: we use BTreeMap such that the debug print output is sorted, for easier diffing pub free_balance: BTreeMap>, - pub to_be_replaced: Amount, - pub replace_collateral: Amount, pub status: VaultStatus, } @@ -538,9 +526,6 @@ impl CoreVaultData { to_be_issued: vault_id.wrapped(0), issued: vault_id.wrapped(0), to_be_redeemed: vault_id.wrapped(0), - to_be_replaced: vault_id.wrapped(0), - griefing_collateral: griefing(0), - replace_collateral: griefing(0), backing_collateral: Amount::new(0, vault_id.collateral_currency()), free_balance: iter_all_currencies().map(|x| (x, Amount::new(0, x))).collect(), liquidated_collateral: Amount::new(0, vault_id.collateral_currency()), @@ -554,16 +539,9 @@ impl CoreVaultData { to_be_issued: Amount::new(vault.to_be_issued_tokens, vault_id.wrapped_currency()), issued: Amount::new(vault.issued_tokens, vault_id.wrapped_currency()), to_be_redeemed: Amount::new(vault.to_be_redeemed_tokens, vault_id.wrapped_currency()), - to_be_replaced: Amount::new(vault.to_be_replaced_tokens, vault_id.wrapped_currency()), backing_collateral: CurrencySource::::Collateral(vault_id.clone()) .current_balance(vault_id.currencies.collateral) .unwrap(), - griefing_collateral: CurrencySource::::ActiveReplaceCollateral(vault_id.clone()) - .current_balance(::GetGriefingCollateralCurrencyId::get()) - .unwrap() - + CurrencySource::::AvailableReplaceCollateral(vault_id.clone()) - .current_balance(vault_id.currencies.collateral) - .unwrap(), liquidated_collateral: Amount::new(vault.liquidated_collateral, vault_id.currencies.collateral), free_balance: iter_all_currencies() .map(|currency_id| { @@ -575,10 +553,6 @@ impl CoreVaultData { ) }) .collect(), - replace_collateral: Amount::new( - vault.replace_collateral, - ::GetGriefingCollateralCurrencyId::get(), - ), status: vault.status, } } @@ -600,17 +574,10 @@ impl CoreVaultData { } pub fn force_to(vault_id: &VaultId, state: CoreVaultData) { - VaultRegistryPallet::collateral_integrity_check(); - // check that all have same currency assert_eq!(vault_id.wrapped_currency(), state.to_be_issued.currency()); assert_eq!(vault_id.wrapped_currency(), state.issued.currency()); assert_eq!(vault_id.wrapped_currency(), state.to_be_redeemed.currency()); - assert_eq!(vault_id.wrapped_currency(), state.to_be_replaced.currency()); - - // replace collateral is part of griefing collateral, so it needs to smaller or equal - assert!(state.griefing_collateral >= state.replace_collateral); - assert!(state.to_be_replaced + state.to_be_redeemed <= state.issued); // register vault if not yet registered if VaultRegistryPallet::get_vault_from_id(vault_id).is_err() { @@ -623,7 +590,6 @@ impl CoreVaultData { .unwrap() .id .collateral_currency(); - VaultRegistryPallet::collateral_integrity_check(); // temporarily give vault a lot of backing collateral so we can set issued & to-be-issued to whatever we want VaultRegistryPallet::transfer_funds( @@ -632,7 +598,6 @@ impl CoreVaultData { &Amount::new(FUND_LIMIT_CEILING / 10, currency_id), ) .unwrap(); - VaultRegistryPallet::collateral_integrity_check(); let current = CoreVaultData::vault(vault_id.clone()); @@ -641,12 +606,10 @@ impl CoreVaultData { &vault_id, ¤t.to_be_issued )); - VaultRegistryPallet::collateral_integrity_check(); assert_ok!(VaultRegistryPallet::decrease_to_be_redeemed_tokens( &vault_id, ¤t.to_be_redeemed )); - VaultRegistryPallet::collateral_integrity_check(); assert_ok!(VaultRegistryPallet::try_increase_to_be_redeemed_tokens( &vault_id, ¤t.issued @@ -658,10 +621,6 @@ impl CoreVaultData { ¤t.issued, )); VaultRegistryPallet::collateral_integrity_check(); - assert_ok!(VaultRegistryPallet::decrease_to_be_replaced_tokens( - &vault_id, - ¤t.to_be_replaced, - )); VaultRegistryPallet::collateral_integrity_check(); // set to-be-issued @@ -685,10 +644,6 @@ impl CoreVaultData { )); // set to-be-replaced: VaultRegistryPallet::collateral_integrity_check(); - assert_ok!(VaultRegistryPallet::try_increase_to_be_replaced_tokens( - &vault_id, - &state.to_be_replaced, - )); // clear all balances for currency_id in iter_all_currencies() { @@ -713,24 +668,6 @@ impl CoreVaultData { .unwrap(); } - VaultRegistryPallet::transfer_funds( - CurrencySource::ActiveReplaceCollateral(vault_id.clone()), - CurrencySource::FreeBalance(account_of(FAUCET)), - &CurrencySource::::ActiveReplaceCollateral(vault_id.clone()) - .current_balance(::GetGriefingCollateralCurrencyId::get()) - .unwrap(), - ) - .unwrap(); - - VaultRegistryPallet::transfer_funds( - CurrencySource::AvailableReplaceCollateral(vault_id.clone()), - CurrencySource::FreeBalance(account_of(FAUCET)), - &CurrencySource::::AvailableReplaceCollateral(vault_id.clone()) - .current_balance(::GetGriefingCollateralCurrencyId::get()) - .unwrap(), - ) - .unwrap(); - // vault's backing collateral was temporarily increased - reset to 0 VaultRegistryPallet::transfer_funds( CurrencySource::Collateral(vault_id.clone()), @@ -748,19 +685,6 @@ impl CoreVaultData { &state.backing_collateral, ) .unwrap(); - VaultRegistryPallet::transfer_funds( - CurrencySource::FreeBalance(account_of(FAUCET)), - CurrencySource::AvailableReplaceCollateral(vault_id.clone()), - &state.replace_collateral, - ) - .unwrap(); - - VaultRegistryPallet::transfer_funds( - CurrencySource::FreeBalance(account_of(FAUCET)), - CurrencySource::ActiveReplaceCollateral(vault_id.clone()), - &(state.griefing_collateral - state.replace_collateral), - ) - .unwrap(); VaultRegistryPallet::collateral_integrity_check(); @@ -976,14 +900,6 @@ pub fn liquidate_vault(vault_id: &VaultId) { set_collateral_exchange_rate(vault_id, FixedU128::checked_from_integer(10_000_000_000u128).unwrap()); assert_ok!(VaultRegistryPallet::liquidate_vault(&vault_id)); set_collateral_exchange_rate(vault_id, FixedU128::checked_from_integer(1u128).unwrap()); - - assert_eq!( - CurrencySource::::AvailableReplaceCollateral(vault_id.clone()) - .current_balance(DEFAULT_GRIEFING_CURRENCY) - .unwrap() - .amount(), - 0 - ); } pub fn set_default_thresholds() { diff --git a/parachain/runtime/runtime-tests/src/utils/replace_utils.rs b/parachain/runtime/runtime-tests/src/utils/replace_utils.rs deleted file mode 100644 index 4bc7c207cf..0000000000 --- a/parachain/runtime/runtime-tests/src/utils/replace_utils.rs +++ /dev/null @@ -1,90 +0,0 @@ -use crate::setup::*; -use currency::Amount; - -pub fn request_replace(old_vault_id: &VaultId, amount: Amount) -> Amount { - assert_ok!(RuntimeCall::Replace(ReplaceCall::request_replace { - currency_pair: old_vault_id.currencies.clone(), - amount: amount.amount(), - }) - .dispatch(origin_of(old_vault_id.account_id.clone()))); - griefing(assert_request_replace_event()) -} - -pub fn setup_replace( - old_vault_id: &VaultId, - new_vault_id: &VaultId, - issued_tokens: Amount, -) -> (ReplaceRequest, H256) { - setup_replace_with_collateral(old_vault_id, new_vault_id, issued_tokens, old_vault_id.collateral(0)) -} - -pub fn setup_replace_with_collateral( - old_vault_id: &VaultId, - new_vault_id: &VaultId, - issued_tokens: Amount, - collateral: Amount, -) -> (ReplaceRequest, H256) { - let new_vault_btc_address = BtcAddress::P2PKH(H160([2; 20])); - - request_replace(old_vault_id, issued_tokens); - - let (id, request) = accept_replace( - &old_vault_id, - &new_vault_id, - issued_tokens, - collateral, - new_vault_btc_address, - ) - .unwrap(); - (request, id) -} - -pub fn assert_request_replace_event() -> Balance { - SystemPallet::events() - .iter() - .rev() - .find_map(|record| match record.event { - RuntimeEvent::Replace(ReplaceEvent::RequestReplace { - griefing_collateral, .. - }) => Some(griefing_collateral), - _ => None, - }) - .unwrap() -} - -pub fn assert_accept_replace_event() -> H256 { - SystemPallet::events() - .iter() - .rev() - .find_map(|record| match record.event { - RuntimeEvent::Replace(ReplaceEvent::AcceptReplace { replace_id, .. }) => Some(replace_id), - _ => None, - }) - .unwrap() -} - -pub fn accept_replace( - old_vault_id: &VaultId, - new_vault_id: &VaultId, - amount_btc: Amount, - collateral: Amount, - btc_address: BtcAddress, -) -> Result<(H256, ReplaceRequest), sp_runtime::DispatchError> { - // assert_replace_request_event(); - - RuntimeCall::Replace(ReplaceCall::accept_replace { - currency_pair: new_vault_id.currencies.clone(), - old_vault: old_vault_id.clone(), - amount_btc: amount_btc.amount(), - collateral: collateral.amount(), - btc_address: btc_address, - }) - .dispatch(origin_of(new_vault_id.account_id.clone())) - .map_err(|err| err.error)?; - - VaultRegistryPallet::collateral_integrity_check(); - - let replace_id = assert_accept_replace_event(); - let replace = ReplacePallet::get_open_replace_request(&replace_id).unwrap(); - Ok((replace_id, replace)) -} diff --git a/parachain/src/chain_spec/interlay.rs b/parachain/src/chain_spec/interlay.rs index 827bf39191..4777a7e3db 100644 --- a/parachain/src/chain_spec/interlay.rs +++ b/parachain/src/chain_spec/interlay.rs @@ -229,10 +229,6 @@ pub fn interlay_genesis( redeem_period: interlay_runtime::DAYS * 2, redeem_btc_dust_value: DEFAULT_DUST_VALUE, }, - replace: interlay_runtime::ReplaceConfig { - replace_period: interlay_runtime::DAYS * 2, - replace_btc_dust_value: DEFAULT_DUST_VALUE, - }, vault_registry: interlay_runtime::VaultRegistryConfig { minimum_collateral_vault: vec![(Token(DOT), 30 * DOT.one())], punishment_delay: interlay_runtime::DAYS, diff --git a/parachain/src/chain_spec/kintsugi.rs b/parachain/src/chain_spec/kintsugi.rs index a77c2ee6ab..5d7275ad3f 100644 --- a/parachain/src/chain_spec/kintsugi.rs +++ b/parachain/src/chain_spec/kintsugi.rs @@ -17,6 +17,8 @@ pub struct KintsugiDevGenesisExt { pub(crate) enable_instant_seal: bool, /// The flag to enable EVM contract creation. pub(crate) enable_create: bool, + /// The flag to enable wasm contracts. + pub(crate) enable_contracts: bool, } impl sp_runtime::BuildStorage for KintsugiDevGenesisExt { @@ -24,6 +26,7 @@ impl sp_runtime::BuildStorage for KintsugiDevGenesisExt { sp_state_machine::BasicExternalities::execute_with_storage(storage, || { kintsugi_runtime::EnableManualSeal::set(&self.enable_instant_seal); kintsugi_runtime::evm::EnableCreate::set(&self.enable_create); + kintsugi_runtime::contracts::EnableContracts::set(&self.enable_contracts); }); self.genesis_config.assimilate_storage(storage) } @@ -73,6 +76,7 @@ pub fn kintsugi_dev_config(enable_instant_seal: bool) -> KintsugiDevChainSpec { ), enable_instant_seal, enable_create: true, + enable_contracts: true, }, Vec::new(), None, @@ -233,10 +237,6 @@ pub fn kintsugi_genesis( redeem_period: kintsugi_runtime::DAYS * 2, redeem_btc_dust_value: DEFAULT_DUST_VALUE, }, - replace: kintsugi_runtime::ReplaceConfig { - replace_period: kintsugi_runtime::DAYS * 2, - replace_btc_dust_value: DEFAULT_DUST_VALUE, - }, vault_registry: kintsugi_runtime::VaultRegistryConfig { minimum_collateral_vault: vec![(Token(KINT), 55 * KINT.one()), (Token(KSM), 3 * KSM.one())], punishment_delay: kintsugi_runtime::DAYS, diff --git a/parachain/src/chain_spec/testnet_kintsugi.rs b/parachain/src/chain_spec/testnet_kintsugi.rs index 7ec7628e1a..a3ef51ea94 100644 --- a/parachain/src/chain_spec/testnet_kintsugi.rs +++ b/parachain/src/chain_spec/testnet_kintsugi.rs @@ -105,6 +105,7 @@ pub fn development_config(id: ParaId, enable_instant_seal: bool) -> KintsugiDevC ), enable_instant_seal, enable_create: true, + enable_contracts: true, }, Vec::new(), None, diff --git a/parachain/src/eth.rs b/parachain/src/eth.rs index 6bf4ab9d4e..e80159bd39 100644 --- a/parachain/src/eth.rs +++ b/parachain/src/eth.rs @@ -1,5 +1,4 @@ use crate::service::{FullBackend, FullClient}; -use cumulus_client_consensus_common::ParachainBlockImportMarker; pub use fc_consensus::FrontierBlockImport; use fc_rpc::{EthTask, OverrideHandle}; pub use fc_rpc_core::types::{FeeHistoryCache, FeeHistoryCacheLimit, FilterPool}; @@ -7,14 +6,11 @@ use fp_rpc::EthereumRuntimeRPCApi; use futures::{future, prelude::*}; use primitives::Block; use sc_client_api::{BlockchainEvents, StateBackendFor}; -use sc_consensus::{BlockCheckParams, BlockImport as BlockImportT, BlockImportParams, ImportResult}; use sc_executor::NativeExecutionDispatch; use sc_network_sync::SyncingService; use sc_service::{error::Error as ServiceError, BasePath, Configuration, TaskManager}; use sc_transaction_pool::{ChainApi, Pool}; use sp_api::{ConstructRuntimeApi, ProvideRuntimeApi}; -use sp_block_builder::BlockBuilder as BlockBuilderApi; -use sp_consensus::Error as ConsensusError; use sp_runtime::traits::{BlakeTwo256, Block as BlockT}; use std::{ collections::BTreeMap, @@ -200,7 +196,7 @@ pub async fn spawn_frontier_tasks( overrides.clone(), Arc::new(b), 3, - 0, + 0, // TODO: update when deployed fc_mapping_sync::SyncStrategy::Normal, sync, pubsub_notification_sinks, @@ -248,48 +244,6 @@ pub async fn spawn_frontier_tasks( ); } -#[derive(Clone)] -pub struct BlockImport, C>(FrontierBlockImport); - -impl BlockImport -where - B: BlockT, - I: BlockImportT>, - I::Error: Into, - C: ProvideRuntimeApi, - C::Api: BlockBuilderApi + EthereumRuntimeRPCApi, -{ - pub fn new(inner: I, client: Arc) -> Self { - Self(FrontierBlockImport::new(inner, client)) - } -} - -#[async_trait::async_trait] -impl BlockImportT for BlockImport -where - B: BlockT, - I: BlockImportT> + Send + Sync, - I::Error: Into, - C: ProvideRuntimeApi + Send + Sync, - C::Api: BlockBuilderApi + EthereumRuntimeRPCApi, -{ - type Error = ConsensusError; - type Transaction = sp_api::TransactionFor; - - async fn check_block(&mut self, block: BlockCheckParams) -> Result { - self.0.check_block(block).await - } - - async fn import_block( - &mut self, - block: BlockImportParams, - ) -> Result { - self.0.import_block(block).await - } -} - -impl, C> ParachainBlockImportMarker for BlockImport {} - pub fn new_eth_deps( client: Arc, transaction_pool: Arc

, diff --git a/parachain/src/service.rs b/parachain/src/service.rs index 76719ed7de..f13d7137ba 100644 --- a/parachain/src/service.rs +++ b/parachain/src/service.rs @@ -15,7 +15,7 @@ use polkadot_service::CollatorPair; use primitives::*; use sc_client_api::{HeaderBackend, StateBackendFor}; use sc_consensus::{ImportQueue, LongestChain}; -use sc_executor::NativeElseWasmExecutor; +use sc_executor::{HeapAllocStrategy, NativeElseWasmExecutor, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY}; use sc_network::NetworkBlock; use sc_network_sync::SyncingService; use sc_service::{Configuration, PartialComponents, RpcHandlers, TFullBackend, TFullClient, TaskManager}; @@ -33,8 +33,8 @@ use substrate_prometheus_endpoint::Registry; // Frontier imports use crate::eth::{ - new_eth_deps, new_frontier_partial, open_frontier_backend, spawn_frontier_tasks, BlockImport as EthBlockImport, - EthCompatRuntimeApiCollection, EthConfiguration, FrontierBackend, FrontierPartialComponents, + new_eth_deps, new_frontier_partial, open_frontier_backend, spawn_frontier_tasks, EthCompatRuntimeApiCollection, + EthConfiguration, FrontierBackend, FrontierPartialComponents, }; macro_rules! new_runtime_executor { @@ -111,11 +111,6 @@ pub trait RuntimeApiCollection: AccountId, H256, redeem::RedeemRequest, - > + replace_rpc_runtime_api::ReplaceApi< - Block, - AccountId, - H256, - replace::ReplaceRequest, > + reward_rpc_runtime_api::RewardApi< Block, AccountId, @@ -159,11 +154,6 @@ where AccountId, H256, redeem::RedeemRequest, - > + replace_rpc_runtime_api::ReplaceApi< - Block, - AccountId, - H256, - replace::ReplaceRequest, > + reward_rpc_runtime_api::RewardApi< Block, AccountId, @@ -189,6 +179,12 @@ type MaybeFullSelectChain = Option>; type ParachainBlockImport = TParachainBlockImport>, FullBackend>; +// 0x9af9a64e6e4da8e3073901c3ff0cc4c3aad9563786d89daf6ad820b6e14a0b8b +const KINTSUGI_GENESIS_HASH: H256 = H256([ + 154, 249, 166, 78, 110, 77, 168, 227, 7, 57, 1, 195, 255, 12, 196, 195, 170, 217, 86, 55, 134, 216, 157, 175, 106, + 216, 32, 182, 225, 74, 11, 139, +]); + fn import_slot_duration(client: &C) -> SlotDuration where C: sc_client_api::backend::AuxStore @@ -197,18 +193,19 @@ where + sp_api::CallApiAt, C::Api: sp_consensus_aura::AuraApi, { - match client.runtime_version_at(client.usage_info().chain.best_hash) { - Ok(x) if x.spec_name.starts_with("kintsugi") && client.usage_info().chain.best_number < 1983993 => { - // the kintsugi runtime was misconfigured at genesis to use a slot duration of 6s - // which stalled collators when we upgraded to polkadot-v0.9.16 and subsequently - // broke mainnet when we introduced the aura timestamp hook, collators should only - // switch when syncing after the (failed) 1.20.0 upgrade - SlotDuration::from_millis(6000) - } + if client.usage_info().chain.genesis_hash == KINTSUGI_GENESIS_HASH + && client.usage_info().chain.best_number < 1983993 + { + // the kintsugi runtime was misconfigured at genesis to use a slot duration of 6s + // which stalled collators when we upgraded to polkadot-v0.9.16 and subsequently + // broke mainnet when we introduced the aura timestamp hook, collators should only + // switch when syncing after the (failed) 1.20.0 upgrade + SlotDuration::from_millis(6000) + } else { // this is pallet_timestamp::MinimumPeriod * 2 at the current height // on kintsugi we increased MinimumPeriod from 3_000 to 6_000 at 16_593 // but the interlay runtime has always used 6_000 - _ => sc_consensus_aura::slot_duration(&*client).unwrap(), + sc_consensus_aura::slot_duration(&*client).unwrap() } } @@ -254,11 +251,20 @@ where }) .transpose()?; - let executor = NativeElseWasmExecutor::::new( - config.wasm_method, - config.default_heap_pages, - config.max_runtime_instances, - config.runtime_cache_size, + let heap_pages = config + .default_heap_pages + .map_or(DEFAULT_HEAP_ALLOC_STRATEGY, |h| HeapAllocStrategy::Static { + extra_pages: h as _, + }); + + let executor = NativeElseWasmExecutor::::new_with_wasm_executor( + WasmExecutor::builder() + .with_execution_method(config.wasm_method) + .with_onchain_heap_alloc_strategy(heap_pages) + .with_offchain_heap_alloc_strategy(heap_pages) + .with_max_runtime_instances(config.max_runtime_instances) + .with_runtime_cache_size(config.runtime_cache_size) + .build(), ); let (client, backend, keystore_container, task_manager) = sc_service::new_full_parts::( @@ -297,7 +303,7 @@ where let import_queue = if instant_seal { // instant sealing sc_consensus_manual_seal::import_queue( - Box::new(EthBlockImport::new(client.clone(), client.clone())), + Box::new(client.clone()), &task_manager.spawn_essential_handle(), registry, ) @@ -306,10 +312,7 @@ where cumulus_client_consensus_aura::import_queue::( cumulus_client_consensus_aura::ImportQueueParams { - block_import: EthBlockImport::new( - ParachainBlockImport::new(client.clone(), backend.clone()), - client.clone(), - ), + block_import: ParachainBlockImport::new(client.clone(), backend.clone()), client: client.clone(), create_inherent_data_providers: move |_parent: sp_core::H256, _| async move { let timestamp = sp_timestamp::InherentDataProvider::from_system_time(); @@ -382,7 +385,7 @@ where CT: fp_rpc::ConvertTransaction<::Extrinsic> + Clone + Default + Send + Sync + 'static, BIC: FnOnce( Arc>, - EthBlockImport, FullClient>, + ParachainBlockImport, Option<&Registry>, Option, &TaskManager, @@ -528,10 +531,7 @@ where if validator { let parachain_consensus = build_consensus( client.clone(), - EthBlockImport::new( - ParachainBlockImport::new(client.clone(), backend.clone()), - client.clone(), - ), + ParachainBlockImport::new(client.clone(), backend.clone()), prometheus_registry.as_ref(), telemetry.as_ref().map(|t| t.handle()), &task_manager, @@ -744,7 +744,7 @@ where let client_for_cidp = client.clone(); let authorship_future = sc_consensus_manual_seal::run_manual_seal(sc_consensus_manual_seal::ManualSealParams { - block_import: EthBlockImport::new(client.clone(), client.clone()), + block_import: client.clone(), env: proposer_factory, client: client.clone(), pool: transaction_pool.clone(), diff --git a/primitives/src/lib.rs b/primitives/src/lib.rs index 293e2e10ad..0616c92f4f 100644 --- a/primitives/src/lib.rs +++ b/primitives/src/lib.rs @@ -84,6 +84,25 @@ pub struct VaultCurrencyPair { pub wrapped: CurrencyId, } +#[derive(Encode, Decode, Clone, PartialEq, Eq, Debug, PartialOrd, Ord, TypeInfo, MaxEncodedLen)] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize, std::hash::Hash))] +pub enum AccountOrVault { + Account(AccountId), + Vault(VaultId), +} +impl AccountOrVault { + pub fn get_account(&self) -> &AccountId { + match self { + AccountOrVault::Account(account_id) => account_id, + AccountOrVault::Vault(vault_id) => &vault_id.account_id, + } + } + + pub fn is_vault_account(&self) -> bool { + matches!(self, AccountOrVault::Vault(_)) + } +} + #[derive(Encode, Decode, Clone, PartialEq, Eq, Debug, PartialOrd, Ord, TypeInfo, MaxEncodedLen)] #[cfg_attr(feature = "std", derive(Serialize, Deserialize, std::hash::Hash))] pub struct VaultId { @@ -174,7 +193,7 @@ pub mod issue { /// the number of tokens that will be transferred to the fee pool pub fee: Balance, /// the account issuing tokens - pub requester: AccountId, + pub requester: AccountOrVault, /// the vault's Bitcoin deposit address pub btc_address: BtcAddress, /// the vault's Bitcoin public key (when this request was made) @@ -226,6 +245,8 @@ pub mod redeem { Reimbursed(bool), /// user received compensation, but is retrying the redeem with another vault Retried, + /// the redeem replace request is cancelled + Cancelled, } impl Default for RedeemRequestStatus { @@ -277,6 +298,14 @@ pub mod redeem { pub btc_height: u32, /// the status of this redeem request pub status: RedeemRequestStatus, + /// the issue id + pub issue_id: Option, + } + + impl RedeemRequest { + pub fn is_redeem_a_replace_request(&self) -> bool { + self.issue_id.is_some() + } } } diff --git a/rpc/Cargo.toml b/rpc/Cargo.toml index f09ee2ea4d..d675ee7dab 100644 --- a/rpc/Cargo.toml +++ b/rpc/Cargo.toml @@ -14,7 +14,6 @@ oracle-rpc = { path = "../crates/oracle/rpc" } vault-registry-rpc = { path = "../crates/vault-registry/rpc" } issue-rpc = { path = "../crates/issue/rpc" } redeem-rpc = { path = "../crates/redeem/rpc" } -replace-rpc = { path = "../crates/replace/rpc" } escrow-rpc = { path = "../crates/escrow/rpc" } reward-rpc = { path = "../crates/reward/rpc" } loans-rpc = { path = "../crates/loans/rpc" } diff --git a/rpc/src/lib.rs b/rpc/src/lib.rs index 764a7f69e8..edadbbe95c 100644 --- a/rpc/src/lib.rs +++ b/rpc/src/lib.rs @@ -4,8 +4,8 @@ //! capabilities that are specific to this project's runtime configuration. use primitives::{ - issue::IssueRequest, redeem::RedeemRequest, replace::ReplaceRequest, AccountId, Balance, Block, BlockNumber, - CurrencyId, H256Le, Hash, Nonce, StablePoolId, VaultId, + issue::IssueRequest, redeem::RedeemRequest, AccountId, Balance, Block, BlockNumber, CurrencyId, H256Le, Hash, + Nonce, StablePoolId, VaultId, }; use sc_consensus_manual_seal::rpc::{EngineCommand, ManualSeal, ManualSealApiServer}; pub use sc_rpc_api::DenyUnsafe; @@ -91,12 +91,6 @@ where H256, RedeemRequest, >, - C::Api: replace_rpc::ReplaceRuntimeApi< - Block, - AccountId, - H256, - ReplaceRequest, - >, C::Api: escrow_rpc::EscrowRuntimeApi, C::Api: reward_rpc::RewardRuntimeApi< Block, @@ -124,7 +118,6 @@ where use oracle_rpc::{Oracle, OracleApiServer}; use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer}; use redeem_rpc::{Redeem, RedeemApiServer}; - use replace_rpc::{Replace, ReplaceApiServer}; use reward_rpc::{Reward, RewardApiServer}; use substrate_frame_rpc_system::{System, SystemApiServer}; use vault_registry_rpc::{VaultRegistry, VaultRegistryApiServer}; @@ -172,8 +165,6 @@ where module.merge(Redeem::new(client.clone()).into_rpc())?; - module.merge(Replace::new(client.clone()).into_rpc())?; - module.merge(Loans::new(client.clone()).into_rpc())?; module.merge(DexGeneral::new(client.clone()).into_rpc())?; diff --git a/scripts/benchmark.sh b/scripts/benchmark.sh index 536b50b074..397089c959 100644 --- a/scripts/benchmark.sh +++ b/scripts/benchmark.sh @@ -22,9 +22,11 @@ while getopts ":r:p:" opt; do done if [ -z "${pallet}" ]; then - pallet="*" + pallet='*' fi +path=${runtime%-*} + cargo run \ --bin interbtc-parachain \ --features runtime-benchmarks \ @@ -38,5 +40,5 @@ cargo run \ --wasm-execution=compiled \ --steps 50 \ --repeat 10 \ - --output "parachain/runtime/${runtime}/src/weights/" \ + --output "parachain/runtime/${path}/src/weights/" \ --template .deploy/runtime-weight-template.hbs From b217ece486847c0f65be51dd4aa309b4c96d3aa3 Mon Sep 17 00:00:00 2001 From: nakul1010 Date: Tue, 15 Aug 2023 19:15:41 +0530 Subject: [PATCH 2/6] fix: test cases --- crates/redeem/src/lib.rs | 20 +- crates/redeem/src/tests.rs | 8 +- .../runtime/runtime-tests/src/parachain.rs | 1 + .../runtime-tests/src/parachain/replace.rs | 953 ++++++++++++++++++ 4 files changed, 974 insertions(+), 8 deletions(-) create mode 100644 parachain/runtime/runtime-tests/src/parachain/replace.rs diff --git a/crates/redeem/src/lib.rs b/crates/redeem/src/lib.rs index 93c24f9573..887212c2e5 100644 --- a/crates/redeem/src/lib.rs +++ b/crates/redeem/src/lib.rs @@ -172,6 +172,10 @@ pub mod pallet { AmountBelowDustAmount, /// Invalid Cancel request. InvalidCancelRequest, + /// Cannot replace self. + ReplaceSelfNotAllowed, + /// Vault cannot replace different currency. + InvalidWrappedCurrency, } /// The time difference in number of blocks between a redeem request is created and required completion time by a @@ -541,6 +545,16 @@ impl Pallet { let old_vault = AccountOrVault::Vault(old_vault_id.clone()); let new_vault = AccountOrVault::Vault(new_vault_id.clone()); + // probably this check is not strictly required, but it's better to give an + // explicit error rather than insufficient balance + ensure!( + old_vault_id.wrapped_currency() == new_vault_id.wrapped_currency(), + Error::::InvalidWrappedCurrency + ); + + // don't allow vaults to replace themselves + ensure!(old_vault != new_vault, Error::::ReplaceSelfNotAllowed); + // Calculate requestable tokens for old vault let max_requestable_tokens: Amount = ext::vault_registry::requestable_to_be_replaced_tokens::(&old_vault_id)?; @@ -589,12 +603,12 @@ impl Pallet { ensure!(!btc_address.is_zero(), btc_relay::Error::::InvalidBtcHash); // todo: currently allowed to redeem from one currency to the other for free - decide if this is desirable - let fee_wrapped = if redeemer.get_account().clone() == vault_id.account_id { + let mut fee_wrapped = if redeemer.get_account().clone() == vault_id.account_id { Amount::zero(vault_id.wrapped_currency()) } else { ext::fee::get_redeem_fee::(&amount_wrapped)? }; - let inclusion_fee = Self::get_current_inclusion_fee(vault_id.wrapped_currency())?; + let mut inclusion_fee = Self::get_current_inclusion_fee(vault_id.wrapped_currency())?; let vault_to_be_burned_tokens = amount_wrapped.checked_sub(&fee_wrapped)?; @@ -634,6 +648,8 @@ impl Pallet { }; let to_be_received_btc = if redeemer.is_vault_account() { + fee_wrapped = Amount::zero(vault_id.wrapped_currency()); + inclusion_fee = Amount::zero(vault_id.wrapped_currency()); amount_wrapped.amount() } else { user_to_be_received_btc.amount() diff --git a/crates/redeem/src/tests.rs b/crates/redeem/src/tests.rs index 45596376b8..5971da5588 100644 --- a/crates/redeem/src/tests.rs +++ b/crates/redeem/src/tests.rs @@ -803,9 +803,7 @@ mod redeem_replace_tests { premium: 0, vault_id: OLD_VAULT, btc_address, - transfer_fee: Redeem::get_current_inclusion_fee(DEFAULT_WRAPPED_CURRENCY) - .unwrap() - .amount() + transfer_fee: 0 }); }) } @@ -828,9 +826,7 @@ mod redeem_replace_tests { vault_id: OLD_VAULT, amount: 10, fee: 0, - transfer_fee: Redeem::get_current_inclusion_fee(DEFAULT_WRAPPED_CURRENCY) - .unwrap() - .amount(), + transfer_fee: 0, }); assert_err!( diff --git a/parachain/runtime/runtime-tests/src/parachain.rs b/parachain/runtime/runtime-tests/src/parachain.rs index bd810607a6..cff8f8b063 100644 --- a/parachain/runtime/runtime-tests/src/parachain.rs +++ b/parachain/runtime/runtime-tests/src/parachain.rs @@ -12,4 +12,5 @@ mod loans; mod multisig; mod nomination; mod redeem; +mod replace; mod vault_registry; diff --git a/parachain/runtime/runtime-tests/src/parachain/replace.rs b/parachain/runtime/runtime-tests/src/parachain/replace.rs new file mode 100644 index 0000000000..7a87eb5336 --- /dev/null +++ b/parachain/runtime/runtime-tests/src/parachain/replace.rs @@ -0,0 +1,953 @@ +use crate::{ + setup::{assert_eq, issue_utils::assert_issue_request_event, redeem_utils::assert_redeem_request_event, *}, + utils::loans_utils::activate_lending_and_mint, +}; +use currency::Amount; +use issue::DefaultIssueRequest; +use redeem::DefaultRedeemRequest; +use sp_core::H256; + +type IssueCall = issue::Call; + +pub type VaultRegistryError = vault_registry::Error; + +const USER: [u8; 32] = ALICE; +const OLD_VAULT: [u8; 32] = BOB; +const NEW_VAULT: [u8; 32] = CAROL; + +fn test_with(execute: impl Fn(VaultId, VaultId) -> R) { + let test_with = |old_vault_currency, new_vault_currency, wrapped_currency, extra_vault_currency| { + ExtBuilder::build().execute_with(|| { + for currency_id in iter_collateral_currencies().filter(|c| !c.is_lend_token()) { + assert_ok!(OraclePallet::_set_exchange_rate(currency_id, FixedU128::one())); + } + if wrapped_currency != DEFAULT_WRAPPED_CURRENCY { + assert_ok!(OraclePallet::_set_exchange_rate(wrapped_currency, FixedU128::one())); + } + activate_lending_and_mint(Token(DOT), LendToken(1)); + set_default_thresholds(); + UserData::force_to(USER, default_user_state()); + let old_vault_id = VaultId::new(account_of(OLD_VAULT), old_vault_currency, wrapped_currency); + let new_vault_id = VaultId::new(account_of(NEW_VAULT), new_vault_currency, wrapped_currency); + CoreVaultData::force_to(&old_vault_id, default_vault_state(&old_vault_id)); + CoreVaultData::force_to(&new_vault_id, default_vault_state(&new_vault_id)); + LiquidationVaultData::force_to(default_liquidation_vault_state(&old_vault_id.currencies)); + + if let Some(other_currency) = extra_vault_currency { + assert_ok!(OraclePallet::_set_exchange_rate(other_currency, FixedU128::one())); + // check that having other vault with the same account id does not influence tests + let other_old_vault_id = VaultId::new( + old_vault_id.account_id.clone(), + other_currency, + old_vault_id.wrapped_currency(), + ); + CoreVaultData::force_to(&other_old_vault_id, default_vault_state(&other_old_vault_id)); + let other_new_vault_id = VaultId::new( + new_vault_id.account_id.clone(), + other_currency, + new_vault_id.wrapped_currency(), + ); + CoreVaultData::force_to(&other_new_vault_id, default_vault_state(&other_new_vault_id)); + } + VaultRegistryPallet::collateral_integrity_check(); + + execute(old_vault_id, new_vault_id) + }) + }; + test_with(Token(DOT), Token(KSM), Token(KBTC), None); + test_with(Token(DOT), Token(DOT), Token(IBTC), None); + test_with(Token(DOT), Token(DOT), Token(IBTC), Some(Token(KSM))); + test_with(Token(DOT), Token(KSM), Token(IBTC), None); + test_with(Token(KSM), Token(DOT), Token(IBTC), None); + test_with(ForeignAsset(1), Token(DOT), Token(IBTC), None); + test_with(Token(KSM), ForeignAsset(1), Token(IBTC), None); + test_with(LendToken(1), ForeignAsset(1), Token(IBTC), None); + test_with(Token(KSM), LendToken(1), Token(IBTC), None); +} + +fn test_without_initialization(execute: impl Fn(CurrencyId) -> R) { + ExtBuilder::build().execute_with(|| execute(Token(DOT))); + ExtBuilder::build().execute_with(|| execute(Token(KSM))); +} + +// pub fn withdraw_replace(old_vault_id: &VaultId, amount: Amount) -> DispatchResultWithPostInfo { +// VaultRegistryPallet::collateral_integrity_check(); +// +// RuntimeCall::Replace(ReplaceCall::withdraw_replace { +// currency_pair: old_vault_id.currencies.clone(), +// amount: amount.amount(), +// }) +// .dispatch(origin_of(old_vault_id.account_id.clone())) +// } + +// pub fn assert_replace_request_event() { +// let events = SystemPallet::events(); +// let ids = events.iter().filter_map(|r| match r.event { +// RuntimeEvent::Replace(ReplaceEvent::RequestReplace { .. }) => Some(()), +// _ => None, +// }); +// assert_eq!(ids.count(), 1); +// } + +#[cfg(test)] +mod request_replace_tests { + use super::{assert_eq, *}; + use crate::{setup::issue_utils::assert_issue_request_event, utils::redeem_utils::assert_redeem_request_event}; + + fn assert_state_after_accept_replace_correct( + old_vault_id: &VaultId, + new_vault_id: &VaultId, + issue: &IssueRequest, + amount: Amount, + ) { + assert_eq!( + ParachainTwoVaultState::get(&old_vault_id, &new_vault_id), + ParachainTwoVaultState::get_default(&old_vault_id, &new_vault_id).with_changes( + |old_vault, new_vault, _| { + *old_vault.free_balance.get_mut(&issue.griefing_currency).unwrap() -= + Amount::new(issue.griefing_collateral, issue.griefing_currency); + + old_vault.to_be_redeemed += amount; + new_vault.to_be_issued += amount; + } + ) + ); + } + + #[test] + fn integration_test_replace_accept_replace_at_capacity_succeeds() { + test_with(|old_vault_id, new_vault_id| { + let accept_amount = new_vault_id.wrapped(DEFAULT_VAULT_TO_BE_REPLACED.amount()); + assert_ok!(RuntimeCall::Redeem(RedeemCall::request_replace { + currency_pair: old_vault_id.currencies.clone(), + amount: accept_amount.amount(), + new_vault_id: new_vault_id.clone(), + griefing_currency: DEFAULT_GRIEFING_CURRENCY + }) + .dispatch(origin_of(old_vault_id.account_id.clone()))); + + let redeem_id = assert_redeem_request_event(); + let redeem = RedeemPallet::get_open_redeem_request_from_id(&redeem_id).unwrap(); + + assert_eq!(redeem.amount_btc, accept_amount.amount()); + assert_eq!(redeem.issue_id.is_some(), true); + + let issue_id = assert_issue_request_event(); + let issue = IssuePallet::get_issue_request_from_id(&issue_id).unwrap(); + + assert_eq!(issue.griefing_collateral(), griefing(2)); + assert_state_after_accept_replace_correct(&old_vault_id, &new_vault_id, &issue, accept_amount); + }); + } + + #[test] + fn integration_test_replace_accept_replace_below_capacity_succeeds() { + test_with(|old_vault_id, new_vault_id| { + // accept only 25% + + let accept_amount = DEFAULT_VAULT_TO_BE_REPLACED / 4; + let accept_amount = old_vault_id.wrapped(accept_amount.amount()); + + assert_ok!(RuntimeCall::Redeem(RedeemCall::request_replace { + currency_pair: old_vault_id.currencies.clone(), + amount: accept_amount.amount(), + new_vault_id: new_vault_id.clone(), + griefing_currency: DEFAULT_GRIEFING_CURRENCY + }) + .dispatch(origin_of(old_vault_id.account_id.clone()))); + + let redeem_id = assert_redeem_request_event(); + let redeem = RedeemPallet::get_open_redeem_request_from_id(&redeem_id).unwrap(); + + assert_eq!(redeem.amount_btc, accept_amount.amount()); + assert_eq!(redeem.issue_id.is_some(), true); + + let issue_id = assert_issue_request_event(); + let issue = IssuePallet::get_issue_request_from_id(&issue_id).unwrap(); + + assert_eq!(issue.griefing_collateral(), griefing(1)); + assert_state_after_accept_replace_correct(&old_vault_id, &new_vault_id, &issue, accept_amount); + }); + } + + #[test] + fn integration_test_replace_accept_replace_above_capacity_succeeds() { + test_with(|old_vault_id, new_vault_id| { + // try to accept 400% + + let accept_amount = DEFAULT_VAULT_TO_BE_REPLACED * 4; + let accept_amount = old_vault_id.wrapped(accept_amount.amount()); + + assert_ok!(RuntimeCall::Redeem(RedeemCall::request_replace { + currency_pair: old_vault_id.currencies.clone(), + amount: accept_amount.amount(), + new_vault_id: new_vault_id.clone(), + griefing_currency: DEFAULT_GRIEFING_CURRENCY + }) + .dispatch(origin_of(old_vault_id.account_id.clone()))); + + let redeem_id = assert_redeem_request_event(); + let redeem = RedeemPallet::get_open_redeem_request_from_id(&redeem_id).unwrap(); + + assert_eq!(redeem.amount_btc, accept_amount.amount() / 2); + assert_eq!(redeem.issue_id.is_some(), true); + + let issue_id = assert_issue_request_event(); + let issue = IssuePallet::get_issue_request_from_id(&issue_id).unwrap(); + + assert_eq!(issue.griefing_collateral(), griefing(4)); + assert_state_after_accept_replace_correct( + &old_vault_id, + &new_vault_id, + &issue, + Amount::new(accept_amount.amount() / 2, old_vault_id.currencies.wrapped), + ); + }); + } + + #[test] + fn integration_test_replace_accept_replace_by_vault_that_does_not_accept_issues_succeeds() { + test_with(|old_vault_id, new_vault_id| { + assert_ok!(RuntimeCall::VaultRegistry(VaultRegistryCall::accept_new_issues { + currency_pair: new_vault_id.currencies.clone(), + accept_new_issues: false + }) + .dispatch(origin_of(new_vault_id.account_id.clone()))); + + assert_noop!( + RuntimeCall::Redeem(RedeemCall::request_replace { + currency_pair: old_vault_id.currencies.clone(), + amount: 1000, + new_vault_id: new_vault_id.clone(), + griefing_currency: DEFAULT_GRIEFING_CURRENCY + }) + .dispatch(origin_of(old_vault_id.account_id.clone())), + IssueError::VaultNotAcceptingNewIssues + ); + }); + } + + #[test] + fn integration_test_replace_accept_replace_below_dust_fails() { + test_with(|old_vault_id, new_vault_id| { + // if the new_vault _asks_ for an amount below below DUST, it gets rejected + + assert_noop!( + RuntimeCall::Redeem(RedeemCall::request_replace { + currency_pair: old_vault_id.currencies.clone(), + amount: 1, + new_vault_id: new_vault_id.clone(), + griefing_currency: DEFAULT_GRIEFING_CURRENCY + }) + .dispatch(origin_of(old_vault_id.account_id.clone())), + IssueError::AmountBelowDustAmount + ); + }); + } + + #[test] + fn integration_test_replace_accept_replace_self_fails() { + test_with(|old_vault_id, _new_vault_id| { + assert_noop!( + RuntimeCall::Redeem(RedeemCall::request_replace { + currency_pair: old_vault_id.currencies.clone(), + amount: 10_000, + new_vault_id: old_vault_id.clone(), + griefing_currency: DEFAULT_GRIEFING_CURRENCY + }) + .dispatch(origin_of(old_vault_id.account_id.clone())), + RedeemError::ReplaceSelfNotAllowed + ); + }); + } + + #[test] + fn integration_test_replace_other_wrapped_currency_fails() { + test_with(|old_vault_id, new_vault_id| { + let other_currency = if let Token(IBTC) = old_vault_id.wrapped_currency() { + Token(KBTC) + } else { + Token(IBTC) + }; + assert_ok!(OraclePallet::_set_exchange_rate(other_currency, FixedU128::one())); + + let new_vault_id = VaultId::new( + account_of(NEW_VAULT), + new_vault_id.collateral_currency(), + other_currency, + ); + CoreVaultData::force_to(&new_vault_id, default_vault_state(&new_vault_id)); + + //Fixme: The code works without this check, ideally shouldn't have worked? + assert_noop!( + RuntimeCall::Redeem(RedeemCall::request_replace { + currency_pair: old_vault_id.currencies.clone(), + amount: 10000, + new_vault_id: new_vault_id.clone(), + griefing_currency: DEFAULT_GRIEFING_CURRENCY + }) + .dispatch(origin_of(old_vault_id.account_id.clone())), + RedeemError::InvalidWrappedCurrency + ); + }) + } +} + +mod expiry_test { + use super::{assert_eq, *}; + use crate::{setup::redeem_utils::assert_redeem_request_event, utils::issue_utils::assert_issue_request_event}; + + /// test replace created by accept + fn test_with(initial_period: u32, execute: impl Fn((H256, H256))) { + let amount_btc = wrapped(5_000); + super::test_with(|old_vault_id, new_vault_id| { + set_replace_period(initial_period); + assert_ok!(RuntimeCall::Redeem(RedeemCall::request_replace { + currency_pair: old_vault_id.currencies.clone(), + amount: amount_btc.amount(), + new_vault_id: new_vault_id.clone(), + griefing_currency: DEFAULT_GRIEFING_CURRENCY + }) + .dispatch(origin_of(old_vault_id.account_id.clone()))); + let redeem_id = assert_redeem_request_event(); + let issue_id = assert_issue_request_event(); + + execute((redeem_id, issue_id)); + }); + } + + fn set_replace_period(period: u32) { + assert_ok!(RuntimeCall::Redeem(RedeemCall::set_redeem_period { period }).dispatch(root())); + } + + fn cancel_replace(redeem_id: H256) -> DispatchResultWithPostInfo { + RuntimeCall::Redeem(RedeemCall::cancel_redeem { + redeem_id: redeem_id, + reimburse: true, + }) + .dispatch(origin_of(account_of(NEW_VAULT))) + } + + #[test] + fn integration_test_replace_expiry_only_parachain_blocks_expired() { + test_with(1000, |(redeem_id, _issue_id)| { + mine_blocks(1); + SecurityPallet::set_active_block_number(1500); + + assert_noop!(cancel_replace(redeem_id), RedeemError::TimeNotExpired); + assert_ok!(execute_replace(redeem_id)); + }); + } + + #[test] + fn integration_test_replace_expiry_only_bitcoin_blocks_expired() { + test_with(1000, |(redeem_id, _issue_id)| { + mine_blocks(15); + SecurityPallet::set_active_block_number(500); + + assert_noop!(cancel_replace(redeem_id), RedeemError::TimeNotExpired); + assert_ok!(execute_replace(redeem_id)); + }); + } + + #[test] + fn integration_test_replace_expiry_no_period_change_pre_expiry() { + test_with(1000, |(redeem_id, _issue_id)| { + mine_blocks(7); + SecurityPallet::set_active_block_number(750); + + assert_noop!(cancel_replace(redeem_id), RedeemError::TimeNotExpired); + assert_ok!(execute_replace(redeem_id)); + }); + } + + #[test] + fn integration_test_replace_expiry_no_period_change_post_expiry() { + // can still execute after expiry + test_with(1000, |(redeem_id, _issue_id)| { + mine_blocks(100); + SecurityPallet::set_active_block_number(1100); + + assert_ok!(execute_replace(redeem_id)); + }); + + // but new-vault can also cancel.. whoever is first wins + test_with(1000, |(redeem_id, _issue_id)| { + mine_blocks(100); + SecurityPallet::set_active_block_number(1100); + + assert_ok!(cancel_replace(redeem_id)); + }); + } + + #[test] + fn integration_test_replace_expiry_with_period_decrease() { + test_with(2000, |(redeem_id, _issue_id)| { + mine_blocks(15); + SecurityPallet::set_active_block_number(1100); + set_replace_period(1000); + + // request still uses period = 200, so cancel fails and execute succeeds + assert_err!(cancel_replace(redeem_id), RedeemError::TimeNotExpired); + assert_ok!(execute_replace(redeem_id)); + }); + } + + #[test] + fn integration_test_replace_expiry_with_period_increase() { + test_with(1000, |(redeem_id, _issue_id)| { + mine_blocks(15); + SecurityPallet::set_active_block_number(1100); + set_replace_period(2000); + + // request uses period = 200, so execute succeeds and cancel fails + assert_err!(cancel_replace(redeem_id), RedeemError::TimeNotExpired); + assert_ok!(execute_replace(redeem_id)); + }); + } +} + +mod execute_replace_payment_limits { + use super::{assert_eq, *}; + use crate::utils::redeem_utils::assert_redeem_request_event; + + #[test] + fn integration_test_execute_replace_with_exact_amount_succeeds() { + test_with(|old_vault_id, new_vault_id| { + let accept_amount = old_vault_id.wrapped(1000000); + + assert_ok!(RuntimeCall::Redeem(RedeemCall::request_replace { + currency_pair: old_vault_id.currencies.clone(), + amount: accept_amount.amount(), + new_vault_id: new_vault_id.clone(), + griefing_currency: DEFAULT_GRIEFING_CURRENCY + }) + .dispatch(origin_of(old_vault_id.account_id.clone()))); + let redeem_id = assert_redeem_request_event(); + + let replace = RedeemPallet::get_open_redeem_request_from_id(&redeem_id).unwrap(); + + assert_ok!(execute_replace_with_amount( + redeem_id, + Amount::new(replace.amount_btc, replace.vault.currencies.wrapped) + )); + }); + } + + #[test] + fn integration_test_execute_replace_with_overpayment_fails() { + test_with(|old_vault_id, new_vault_id| { + let accept_amount = old_vault_id.wrapped(1000000); + + assert_ok!(RuntimeCall::Redeem(RedeemCall::request_replace { + currency_pair: old_vault_id.currencies.clone(), + amount: accept_amount.amount(), + new_vault_id: new_vault_id.clone(), + griefing_currency: DEFAULT_GRIEFING_CURRENCY + }) + .dispatch(origin_of(old_vault_id.account_id.clone()))); + + let redeem_id = assert_redeem_request_event(); + + let replace = RedeemPallet::get_open_redeem_request_from_id(&redeem_id).unwrap(); + + assert_err!( + execute_replace_with_amount( + redeem_id, + Amount::new(replace.amount_btc, replace.vault.currencies.wrapped).with_amount(|x| x + 1) + ), + BTCRelayError::InvalidPaymentAmount + ); + }); + } + #[test] + fn integration_test_execute_replace_with_underpayment_fails() { + test_with(|old_vault_id, new_vault_id| { + let accept_amount = old_vault_id.wrapped(1000000); + + assert_ok!(RuntimeCall::Redeem(RedeemCall::request_replace { + currency_pair: old_vault_id.currencies.clone(), + amount: accept_amount.amount(), + new_vault_id: new_vault_id.clone(), + griefing_currency: DEFAULT_GRIEFING_CURRENCY + }) + .dispatch(origin_of(old_vault_id.account_id.clone()))); + + let redeem_id = assert_redeem_request_event(); + + let replace = RedeemPallet::get_open_redeem_request_from_id(&redeem_id).unwrap(); + + assert_err!( + execute_replace_with_amount( + redeem_id, + Amount::new(replace.amount_btc, replace.vault.currencies.wrapped).with_amount(|x| x - 1) + ), + BTCRelayError::InvalidPaymentAmount + ); + }); + } +} + +fn setup_replace( + accept_amount: Amount, + old_vault_id: &VaultId, + new_vault_id: &VaultId, +) -> (H256, DefaultRedeemRequest, H256, DefaultIssueRequest) { + assert_ok!(RuntimeCall::Redeem(RedeemCall::request_replace { + currency_pair: old_vault_id.currencies.clone(), + amount: accept_amount.amount(), + new_vault_id: new_vault_id.clone(), + griefing_currency: DEFAULT_GRIEFING_CURRENCY + }) + .dispatch(origin_of(old_vault_id.account_id.clone()))); + let redeem_id = assert_redeem_request_event(); + let redeem = RedeemPallet::get_open_redeem_request_from_id(&redeem_id).unwrap(); + + let issue_id = assert_issue_request_event(); + let issue = IssuePallet::get_issue_request_from_id(&issue_id).unwrap(); + + (redeem_id, redeem, issue_id, issue) +} + +#[test] +fn integration_test_replace_cancel_replace() { + test_with(|old_vault_id, new_vault_id| { + let accept_amount = new_vault_id.wrapped(10000); + let (redeem_id, _, _, _) = setup_replace(accept_amount, &old_vault_id, &new_vault_id); + // set block height + // new_vault cancels replacement + mine_blocks(2); + SecurityPallet::set_active_block_number(30); + assert_ok!(RuntimeCall::Redeem(RedeemCall::cancel_redeem { + redeem_id: redeem_id, + reimburse: true, + }) + .dispatch(origin_of(new_vault_id.account_id.clone()))); + }); +} + +// liquidation tests + +fn execute_replace(redeem_id: H256) -> DispatchResultWithPostInfo { + let replace = RedeemPallet::get_open_redeem_request_from_id(&redeem_id)?; + execute_replace_with_amount( + redeem_id, + Amount::new(replace.amount_btc, replace.vault.currencies.wrapped), + ) +} + +fn execute_replace_with_amount(redeem_id: H256, amount: Amount) -> DispatchResultWithPostInfo { + let replace = RedeemPallet::get_open_redeem_request_from_id(&redeem_id).unwrap(); + + // send the btc from the old_vault to the new_vault + let (_tx_id, _tx_block_height, transaction) = generate_transaction_and_mine( + Default::default(), + vec![], + vec![(replace.btc_address, amount)], + vec![redeem_id], + ); + + SecurityPallet::set_active_block_number(SecurityPallet::active_block_number() + CONFIRMATIONS); + + RuntimeCall::Redeem(RedeemCall::execute_redeem { + redeem_id, + unchecked_transaction: transaction, + }) + .dispatch(origin_of(account_of(OLD_VAULT))) +} + +fn cancel_replace(redeem_id: H256) { + // set block height + mine_blocks(2); + SecurityPallet::set_active_block_number(30); + assert_ok!(RuntimeCall::Redeem(RedeemCall::cancel_redeem { + redeem_id: redeem_id, + reimburse: true, + }) + .dispatch(origin_of(account_of(NEW_VAULT)))); +} + +#[test] +fn integration_test_replace_execute_replace_success() { + test_with(|old_vault_id, new_vault_id| { + let accept_amount = new_vault_id.wrapped(10000); + + let (redeem_id, _redeem, _issue_id, issue) = setup_replace(accept_amount, &old_vault_id, &new_vault_id); + + let pre_execute_state = ParachainTwoVaultState::get(&old_vault_id, &new_vault_id); + + assert_ok!(execute_replace(redeem_id)); + assert_eq!( + ParachainTwoVaultState::get(&old_vault_id, &new_vault_id), + pre_execute_state.with_changes(|old_vault, new_vault, _| { + old_vault.issued -= accept_amount; + old_vault.to_be_redeemed -= accept_amount; + *old_vault.free_balance.get_mut(&DEFAULT_GRIEFING_CURRENCY).unwrap() += issue.griefing_collateral(); + + new_vault.issued += accept_amount; + new_vault.to_be_issued -= accept_amount; + }) + ); + }); +} + +fn calculate_replace_collateral( + vault_data: &CoreVaultData, + replace_amount: Amount, + currency_id: CurrencyId, +) -> Amount { + Amount::new( + (vault_data.backing_collateral.amount() * replace_amount.amount()) + / (vault_data.issued + vault_data.to_be_issued).amount(), + currency_id, + ) +} + +#[test] +fn integration_test_replace_execute_replace_old_vault_liquidated() { + test_with(|old_vault_id, new_vault_id| { + let accept_amount = new_vault_id.wrapped(10000); + + let (redeem_id, redeem, _issue_id, issue) = setup_replace(accept_amount, &old_vault_id, &new_vault_id); + + let old = CoreVaultData::vault(old_vault_id.clone()); + + liquidate_vault(&old_vault_id); + + let pre_execution_state = ParachainTwoVaultState::get(&old_vault_id, &new_vault_id); + + assert_ok!(execute_replace(redeem_id)); + + let collateral_for_replace = + calculate_replace_collateral(&old, redeem.amount_btc(), old_vault_id.collateral_currency()); + + assert_eq!( + ParachainTwoVaultState::get(&old_vault_id, &new_vault_id), + pre_execution_state.with_changes(|old_vault, new_vault, liquidation_vault| { + let liquidation_vault = liquidation_vault.with_currency(&old_vault_id.currencies); + + liquidation_vault.issued -= accept_amount; + liquidation_vault.to_be_redeemed -= accept_amount; + + new_vault.to_be_issued -= accept_amount; + new_vault.issued += accept_amount; + + old_vault.to_be_redeemed -= accept_amount; + old_vault.liquidated_collateral -= collateral_for_replace; + *old_vault.free_balance.get_mut(&DEFAULT_GRIEFING_CURRENCY).unwrap() += issue.griefing_collateral(); + *old_vault + .free_balance + .get_mut(&old_vault_id.collateral_currency()) + .unwrap() += collateral_for_replace; + }) + ); + }); +} + +#[test] +fn integration_test_replace_execute_replace_new_vault_liquidated() { + test_with(|old_vault_id, new_vault_id| { + let accept_amount = new_vault_id.wrapped(10000); + + let (redeem_id, _redeem, _issue_id, issue) = setup_replace(accept_amount, &old_vault_id, &new_vault_id); + + liquidate_vault(&new_vault_id); + + let pre_execution_state = ParachainTwoVaultState::get(&old_vault_id, &new_vault_id); + + assert_ok!(execute_replace(redeem_id)); + + assert_eq!( + ParachainTwoVaultState::get(&old_vault_id, &new_vault_id), + pre_execution_state.with_changes(|old_vault, _new_vault, liquidation_vault| { + let liquidation_vault = liquidation_vault.with_currency(&new_vault_id.currencies); + + liquidation_vault.issued += accept_amount; + liquidation_vault.to_be_issued -= accept_amount; + + old_vault.to_be_redeemed -= accept_amount; + old_vault.issued -= accept_amount; + *old_vault.free_balance.get_mut(&DEFAULT_GRIEFING_CURRENCY).unwrap() += issue.griefing_collateral(); + }) + ); + }); +} + +#[test] +fn integration_test_replace_execute_replace_both_vaults_liquidated() { + test_with(|old_vault_id, new_vault_id| { + let accept_amount = new_vault_id.wrapped(10000); + + let (redeem_id, redeem, _issue_id, issue) = setup_replace(accept_amount, &old_vault_id, &new_vault_id); + + let old = CoreVaultData::vault(old_vault_id.clone()); + + liquidate_vault(&old_vault_id); + liquidate_vault(&new_vault_id); + + let pre_execution_state = ParachainTwoVaultState::get(&old_vault_id, &new_vault_id); + + assert_ok!(execute_replace(redeem_id)); + + let collateral_for_replace = + calculate_replace_collateral(&old, redeem.amount_btc(), old_vault_id.collateral_currency()); + + assert_eq!( + ParachainTwoVaultState::get(&old_vault_id, &new_vault_id), + pre_execution_state.with_changes(|old_vault, _new_vault, liquidation_vault| { + let old_liquidation_vault = liquidation_vault.with_currency(&old_vault_id.currencies); + old_liquidation_vault.to_be_redeemed -= accept_amount; + old_liquidation_vault.issued -= accept_amount; + + let new_liquidation_vault = liquidation_vault.with_currency(&new_vault_id.currencies); + new_liquidation_vault.to_be_issued -= accept_amount; + new_liquidation_vault.issued += accept_amount; + + old_vault.to_be_redeemed -= accept_amount; + old_vault.liquidated_collateral -= collateral_for_replace; + *old_vault.free_balance.get_mut(&DEFAULT_GRIEFING_CURRENCY).unwrap() += issue.griefing_collateral(); + *old_vault + .free_balance + .get_mut(&old_vault_id.collateral_currency()) + .unwrap() += collateral_for_replace; + }) + ); + }); +} + +#[test] +fn integration_test_replace_execute_replace_with_cancelled() { + test_with(|old_vault_id, new_vault_id| { + let accept_amount = new_vault_id.wrapped(10000); + let (redeem_id, _redeem, _issue_id, _issue) = setup_replace(accept_amount, &old_vault_id, &new_vault_id); + cancel_replace(redeem_id); + assert_err!(execute_replace(redeem_id), RedeemError::RedeemCancelled); + }); +} + +#[test] +fn integration_test_replace_cancel_replace_success() { + test_with(|old_vault_id, new_vault_id| { + let accept_amount = new_vault_id.wrapped(10000); + let (redeem_id, _redeem, _issue_id, issue) = setup_replace(accept_amount, &old_vault_id, &new_vault_id); + let pre_cancellation_state = ParachainTwoVaultState::get(&old_vault_id, &new_vault_id); + cancel_replace(redeem_id); + + assert_eq!( + ParachainTwoVaultState::get(&old_vault_id, &new_vault_id), + pre_cancellation_state.with_changes(|old_vault, new_vault, _| { + new_vault.to_be_issued -= accept_amount; + *new_vault.free_balance.get_mut(&DEFAULT_GRIEFING_CURRENCY).unwrap() += issue.griefing_collateral(); + + old_vault.to_be_redeemed -= accept_amount; + }) + ); + }); +} + +#[test] +fn integration_test_replace_cancel_replace_old_vault_liquidated() { + test_with(|old_vault_id, new_vault_id| { + let accept_amount = new_vault_id.wrapped(10000); + let (redeem_id, redeem, _issue_id, issue) = setup_replace(accept_amount, &old_vault_id, &new_vault_id); + + let old = CoreVaultData::vault(old_vault_id.clone()); + + liquidate_vault(&old_vault_id); + + let pre_cancellation_state = ParachainTwoVaultState::get(&old_vault_id, &new_vault_id); + + cancel_replace(redeem_id); + + let collateral_for_replace = + calculate_replace_collateral(&old, redeem.amount_btc(), old_vault_id.collateral_currency()); + + assert_eq!( + ParachainTwoVaultState::get(&old_vault_id, &new_vault_id), + pre_cancellation_state.with_changes(|old_vault, new_vault, liquidation_vault| { + let liquidation_vault = liquidation_vault.with_currency(&old_vault_id.currencies); + + old_vault.to_be_redeemed -= accept_amount; + old_vault.liquidated_collateral -= collateral_for_replace; + + new_vault.to_be_issued -= accept_amount; + *new_vault.free_balance.get_mut(&DEFAULT_GRIEFING_CURRENCY).unwrap() += issue.griefing_collateral(); + + liquidation_vault.to_be_redeemed -= accept_amount; + liquidation_vault.collateral += collateral_for_replace; + }) + ); + }); +} + +#[test] +fn integration_test_replace_cancel_replace_new_vault_liquidated() { + test_with(|old_vault_id, new_vault_id| { + let accept_amount = new_vault_id.wrapped(10000); + let (redeem_id, _redeem, _issue_id, issue) = setup_replace(accept_amount, &old_vault_id, &new_vault_id); + + liquidate_vault(&new_vault_id); + + let pre_cancellation_state = ParachainTwoVaultState::get(&old_vault_id, &new_vault_id); + + cancel_replace(redeem_id); + + assert_eq!( + ParachainTwoVaultState::get(&old_vault_id, &new_vault_id), + pre_cancellation_state.with_changes(|old_vault, new_vault, liquidation_vault| { + old_vault.to_be_redeemed -= accept_amount; + + *new_vault.free_balance.get_mut(&DEFAULT_GRIEFING_CURRENCY).unwrap() += issue.griefing_collateral(); + + let new_liquidation_vault = liquidation_vault.with_currency(&new_vault_id.currencies); + new_liquidation_vault.to_be_issued -= accept_amount; + }) + ); + }); +} + +#[test] +fn integration_test_replace_cancel_replace_both_vaults_liquidated() { + test_with(|old_vault_id, new_vault_id| { + let accept_amount = new_vault_id.wrapped(10000); + let (redeem_id, redeem, _issue_id, issue) = setup_replace(accept_amount, &old_vault_id, &new_vault_id); + + let old = CoreVaultData::vault(old_vault_id.clone()); + + liquidate_vault(&old_vault_id); + liquidate_vault(&new_vault_id); + + let pre_cancellation_state = ParachainTwoVaultState::get(&old_vault_id, &new_vault_id); + + cancel_replace(redeem_id); + + let collateral_for_replace = + calculate_replace_collateral(&old, redeem.amount_btc(), old_vault_id.collateral_currency()); + + assert_eq!( + ParachainTwoVaultState::get(&old_vault_id, &new_vault_id), + pre_cancellation_state.with_changes(|old_vault, new_vault, liquidation_vault| { + old_vault.to_be_redeemed -= accept_amount; + old_vault.liquidated_collateral -= collateral_for_replace; + + *new_vault.free_balance.get_mut(&DEFAULT_GRIEFING_CURRENCY).unwrap() += issue.griefing_collateral(); + + let old_liquidation_vault = liquidation_vault.with_currency(&old_vault_id.currencies); + old_liquidation_vault.to_be_redeemed -= accept_amount; + old_liquidation_vault.collateral += collateral_for_replace; + + let new_liquidation_vault = liquidation_vault.with_currency(&new_vault_id.currencies); + new_liquidation_vault.to_be_issued -= accept_amount; + }) + ); + }); +} + +#[test] +fn integration_test_replace_vault_with_different_currency_succeeds() { + test_without_initialization(|currency_id| { + for currency_id in iter_collateral_currencies().filter(|c| !c.is_lend_token()) { + assert_ok!(OraclePallet::_set_exchange_rate(currency_id, FixedU128::one())); + } + set_default_thresholds(); + SecurityPallet::set_active_block_number(1); + + let other_currency = if let Token(DOT) = currency_id { + Token(KSM) + } else { + Token(DOT) + }; + + let old_vault_id = vault_id_of(OLD_VAULT, currency_id); + let new_vault_id = vault_id_of(NEW_VAULT, other_currency); + + // Mint lendTokens so that force-setting vault state doesn't fail + activate_lending_and_mint(Token(DOT), LendToken(1)); + CoreVaultData::force_to(&old_vault_id, default_vault_state(&old_vault_id)); + CoreVaultData::force_to(&new_vault_id, default_vault_state(&new_vault_id)); + + let accept_amount = new_vault_id.wrapped(10000); + let (redeem_id, _redeem, _issue_id, issue) = setup_replace(accept_amount, &old_vault_id, &new_vault_id); + + let pre_execute_state = ParachainTwoVaultState::get(&old_vault_id, &new_vault_id); + + assert_ok!(execute_replace(redeem_id)); + + assert_eq!( + ParachainTwoVaultState::get(&old_vault_id, &new_vault_id), + pre_execute_state.with_changes(|old_vault, new_vault, _| { + new_vault.to_be_issued -= accept_amount; + new_vault.issued += accept_amount; + old_vault.to_be_redeemed -= accept_amount; + old_vault.issued -= accept_amount; + + *old_vault.free_balance.get_mut(&DEFAULT_GRIEFING_CURRENCY).unwrap() += issue.griefing_collateral(); + }) + ); + }); +} + +mod oracle_down { + use super::{assert_eq, *}; + + #[test] + fn no_oracle_execute_replace_succeeds() { + test_with(|old_vault_id, new_vault_id| { + let accept_amount = new_vault_id.wrapped(10000); + let (redeem_id, _redeem, _issue_id, _issue) = setup_replace(accept_amount, &old_vault_id, &new_vault_id); + + OraclePallet::expire_all(); + + assert_ok!(execute_replace(redeem_id)); + }); + } + + #[test] + fn no_oracle_request_replace_fails() { + test_with(|old_vault_id, new_vault_id| { + let amount = DEFAULT_VAULT_ISSUED - DEFAULT_VAULT_TO_BE_REDEEMED - DEFAULT_VAULT_TO_BE_REPLACED; + OraclePallet::expire_all(); + + assert_noop!( + RuntimeCall::Redeem(RedeemCall::request_replace { + currency_pair: old_vault_id.currencies.clone(), + amount: amount.amount(), + new_vault_id: new_vault_id.clone(), + griefing_currency: DEFAULT_GRIEFING_CURRENCY + }) + .dispatch(origin_of(old_vault_id.account_id.clone())), + OracleError::MissingExchangeRate + ); + }) + } + + #[test] + fn no_oracle_cancel_replace_succeeds() { + test_with(|old_vault_id, new_vault_id| { + let accept_amount = new_vault_id.wrapped(10000); + let (redeem_id, _redeem, _issue_id, _issue) = setup_replace(accept_amount, &old_vault_id, &new_vault_id); + + OraclePallet::expire_all(); + + mine_blocks(2); + SecurityPallet::set_active_block_number(30); + + assert_ok!(RuntimeCall::Redeem(RedeemCall::cancel_redeem { + redeem_id: redeem_id, + reimburse: true, + }) + .dispatch(origin_of(account_of(NEW_VAULT)))); + }) + } + + #[test] + fn no_oracle_execute_cancelled_replace_succeeds() { + test_with(|old_vault_id, new_vault_id| { + let accept_amount = new_vault_id.wrapped(10000); + let (redeem_id, _redeem, _issue_id, _issue) = setup_replace(accept_amount, &old_vault_id, &new_vault_id); + + OraclePallet::expire_all(); + assert_ok!(execute_replace(redeem_id)); + }) + } +} From 033392bee1010c3ea4aa09973a257ededfb302d3 Mon Sep 17 00:00:00 2001 From: nakul1010 Date: Fri, 1 Sep 2023 10:48:12 +0530 Subject: [PATCH 3/6] fix: test cases, simply branch for request_redeem, removed unused imports --- .github/ISSUE_TEMPLATE/roadmap.md | 49 + .github/workflows/benchmark.yml | 103 -- .github/workflows/projects.yml | 8 + Cargo.lock | 1052 +++++++++-------- crates/bitcoin/Cargo.toml | 3 + crates/bitcoin/src/compat.rs | 119 ++ crates/bitcoin/src/lib.rs | 3 + crates/bitcoin/src/parser.rs | 116 +- crates/bitcoin/src/script.rs | 19 + crates/issue/src/benchmarking.rs | 56 +- crates/issue/src/default_weights.rs | 469 ++++---- crates/issue/src/lib.rs | 145 ++- crates/issue/src/migration.rs | 126 +- crates/issue/src/tests.rs | 25 +- crates/issue/src/types.rs | 4 +- crates/redeem/src/benchmarking.rs | 83 +- crates/redeem/src/default_weights.rs | 540 ++++++--- crates/redeem/src/ext.rs | 30 +- crates/redeem/src/lib.rs | 301 ++--- crates/redeem/src/tests.rs | 16 +- crates/redeem/src/types.rs | 130 +- crates/vault-registry/src/lib.rs | 50 +- crates/vault-registry/src/tests.rs | 7 +- crates/vault-registry/src/types.rs | 130 +- parachain/runtime/interlay/src/lib.rs | 3 +- .../runtime/interlay/src/weights/issue.rs | 227 ++-- .../runtime/interlay/src/weights/redeem.rs | 229 ++-- parachain/runtime/kintsugi/src/lib.rs | 3 +- .../runtime/kintsugi/src/weights/issue.rs | 231 ++-- .../runtime/kintsugi/src/weights/redeem.rs | 230 ++-- .../runtime-tests/src/parachain/redeem.rs | 4 +- .../runtime-tests/src/parachain/replace.rs | 302 +++-- .../runtime-tests/src/utils/redeem_utils.rs | 21 + primitives/src/lib.rs | 10 +- 34 files changed, 2980 insertions(+), 1864 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/roadmap.md delete mode 100644 .github/workflows/benchmark.yml create mode 100644 crates/bitcoin/src/compat.rs diff --git a/.github/ISSUE_TEMPLATE/roadmap.md b/.github/ISSUE_TEMPLATE/roadmap.md new file mode 100644 index 0000000000..b55df6d288 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/roadmap.md @@ -0,0 +1,49 @@ +--- +name: Roadmap +about: Add a new item to the roadmap +title: '' +labels: 'roadmap' +assignees: '' + +--- + +# Abstract + +[ADD HERE] + +A 2-3 sentence description of the proposal. + +# Motivation + +[ADD HERE] + +Provide a motivation for including this proposal. + +# Specification + +[ADD HERE] + +Provide a high-level, functional specification. The specification should be focussed on what the proposal is trying to achieve. + +## [OPTIONAL]Extensions + +[OPTIONAL][ADD HERE] + +### [OPTIONAL][TITLE] + +[OPTIONAL][ADD HERE] + +# Reference Implementation + +[OPTIONAL][ADD HERE] + +Provide a reference implementation, proof of concept, or basic pseudo-code for a better grounds to discuss the suggested implementation. The reference implementation focusses on the how. + +# Security Considerations + +[ADD HERE] + +Provide reasoning around security implications: + +- The proposal itself +- The propsals implications to the existing system diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index 02ef88c48e..0000000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,103 +0,0 @@ -# Original source: https://github.com/AcalaNetwork/Acala/blob/master/.github/workflows/benchmark.yml - -name: Benchmark -on: - issue_comment: - types: [created] -permissions: - pull-requests: write - contents: write -jobs: - benchmark: - name: Benchmark - if: ${{ github.event.issue.pull_request && startsWith(github.event.comment.body, '/benchmark') }} - runs-on: [self-hosted, linux] - steps: - - uses: actions/github-script@v6 - name: Get PR branch - id: issue - with: - script: | - const pr = context.payload.issue.number - const data = await github.rest.pulls.get({ - owner: context.repo.owner, - repo: context.repo.repo, - pull_number: pr - }) - return { - ref: data.data.head.ref, - sha: data.data.head.sha, - } - - uses: actions/checkout@v3 - with: - submodules: recursive - ref: ${{ fromJson(steps.issue.outputs.result).sha }} - - uses: actions/github-script@v6 - name: Prepare command - id: command - with: - result-encoding: string - # /benchmark CHAIN_NAME [PALLET_NAME] - script: | - const [cmd, ...args] = context.payload.comment.body.split(" ") - const [runtime, pallet] = args - return `bash ./scripts/benchmark.sh -r ${runtime ?? ""} -p ${pallet ?? ""}` - - uses: actions/github-script@v6 - name: Post comment - id: comment - with: - script: | - const data = await github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: ` - **Request**: \`${context.payload.comment.body}\` - **Command**: \`${{steps.command.outputs.result}}\` - - Running... - ` - }) - return data.data.id - - name: Set variables - run: | - echo "TOOLCHAIN=$(rustup show active-toolchain | cut -d " " -f1)" >> $GITHUB_ENV - - name: Install toolchain - uses: dtolnay/rust-toolchain@master - with: - toolchain: ${{ env.TOOLCHAIN }} - components: rustfmt - target: wasm32-unknown-unknown - - name: Run benchmarks - run: ${{steps.command.outputs.result}} > ${{runner.temp}}/out.txt - - name: Commit new weights - run: | - git config user.email "contact@interlay.io" - git config user.name "Interlay Bot" - git add . - git commit -m '${{github.event.comment.body}}' --allow-empty - git push origin HEAD:${{ fromJson(steps.issue.outputs.result).ref }} - - uses: actions/github-script@v6 - name: Update comment - with: - script: | - const fs = require('fs') - const id = `${{steps.comment.outputs.result}}` - const body = fs.readFileSync('${{runner.temp}}/out.txt').toString() - github.rest.issues.updateComment({ - comment_id: id, - owner: context.repo.owner, - repo: context.repo.repo, - body: ` - **Request**: \`${context.payload.comment.body}\` - **Command**: \`${{steps.command.outputs.result}}\` - -

- Results - - \`\`\` - ${body.trim()} - \`\`\` -
- ` - }) diff --git a/.github/workflows/projects.yml b/.github/workflows/projects.yml index 79ef63c9b4..af4deb91e2 100644 --- a/.github/workflows/projects.yml +++ b/.github/workflows/projects.yml @@ -14,3 +14,11 @@ jobs: with: project-url: https://github.com/orgs/interlay/projects/3 github-token: ${{ secrets.PROJECTS }} + label: roadmap + label-operator: NOT + - uses: actions/add-to-project@v0.5.0 + with: + project-url: https://github.com/orgs/interlay/projects/4 + github-token: ${{ secrets.PROJECTS }} + label: roadmap + label-operator: OR diff --git a/Cargo.lock b/Cargo.lock index 60c064526d..0a232f29b7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -23,11 +23,11 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.19.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ - "gimli 0.27.3", + "gimli 0.28.0", ] [[package]] @@ -172,18 +172,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "0.7.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" -dependencies = [ - "memchr", -] - -[[package]] -name = "aho-corasick" -version = "1.0.2" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" +checksum = "6748e8def348ed4d14996fa801f4122cd763fff530258cdc03f64b25f89d3a5a" dependencies = [ "memchr", ] @@ -287,9 +278,9 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" +checksum = "c677ab05e09154296dd37acecd46420c17b9713e8366facafa8fc0885167cf4c" dependencies = [ "anstyle", "windows-sys 0.48.0", @@ -297,9 +288,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.71" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] name = "approx" @@ -359,7 +350,7 @@ dependencies = [ "num-traits", "rusticata-macros", "thiserror", - "time 0.3.22", + "time 0.3.27", ] [[package]] @@ -375,7 +366,7 @@ dependencies = [ "num-traits", "rusticata-macros", "thiserror", - "time 0.3.22", + "time 0.3.27", ] [[package]] @@ -427,9 +418,9 @@ checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" [[package]] name = "async-channel" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf46fee83e5ccffc220104713af3292ff9bc7c64c7de289f66dae8e38d826833" +checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" dependencies = [ "concurrent-queue", "event-listener", @@ -450,7 +441,7 @@ dependencies = [ "log", "parking", "polling", - "rustix 0.37.20", + "rustix 0.37.23", "slab", "socket2 0.4.9", "waker-fn", @@ -458,9 +449,9 @@ dependencies = [ [[package]] name = "async-lock" -version = "2.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa24f727524730b077666307f2734b4a1a1c57acb79193127dcc8914d5242dd7" +checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" dependencies = [ "event-listener", ] @@ -473,31 +464,31 @@ checksum = "0e97ce7de6cf12de5d7226c73f5ba9811622f4db3a5b91b55c53e987e5f91cba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.29", ] [[package]] name = "async-trait" -version = "0.1.68" +version = "0.1.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" +checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.29", ] [[package]] name = "asynchronous-codec" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06a0daa378f5fd10634e44b0a29b2a87b890657658e072a30d6f26e57ddee182" +checksum = "4057f2c32adbb2fc158e22fb38433c8e9bbf76b75a4732c7c0cbaf695fb65568" dependencies = [ "bytes", "futures-sink", "futures-util", "memchr", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.12", ] [[package]] @@ -555,16 +546,16 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.67" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ - "addr2line 0.19.0", + "addr2line 0.21.0", "cc", "cfg-if", "libc", - "miniz_oxide 0.6.2", - "object 0.30.4", + "miniz_oxide", + "object 0.32.0", "rustc-demangle", ] @@ -610,6 +601,12 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" +[[package]] +name = "bech32" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" + [[package]] name = "beef" version = "0.5.2" @@ -643,7 +640,7 @@ version = "0.64.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4243e6031260db77ede97ad86c27e501d646a27ab57b59a574f725d98ab1fb4" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cexpr", "clang-sys", "lazy_static", @@ -672,11 +669,26 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +[[package]] +name = "bitcoin" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e99ff7289b20a7385f66a0feda78af2fc119d28fb56aea8886a9cd0a4abdd75" +dependencies = [ + "bech32", + "bitcoin-private", + "bitcoin_hashes 0.12.0", + "core2 0.3.3", + "hex_lit", + "secp256k1 0.27.0", +] + [[package]] name = "bitcoin" version = "1.2.0" dependencies = [ - "bitcoin_hashes", + "bitcoin 0.30.1", + "bitcoin_hashes 0.7.6", "frame-support", "hex", "impl-serde 0.3.2", @@ -690,18 +702,40 @@ dependencies = [ "spin 0.7.1", ] +[[package]] +name = "bitcoin-private" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73290177011694f38ec25e165d0387ab7ea749a4b81cd4c80dae5988229f7a57" + [[package]] name = "bitcoin_hashes" version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b375d62f341cef9cd9e77793ec8f1db3fc9ce2e4d57e982c8fe697a2c16af3b6" +[[package]] +name = "bitcoin_hashes" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d7066118b13d4b20b23645932dfb3a81ce7e29f95726c2036fa33cd7b092501" +dependencies = [ + "bitcoin-private", + "core2 0.3.3", +] + [[package]] name = "bitflags" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" + [[package]] name = "bitvec" version = "1.0.1" @@ -731,7 +765,7 @@ checksum = "3c2f0dc9a68c6317d884f97cc36cf5a3d20ba14ce404227df55e1af708ab04bc" dependencies = [ "arrayref", "arrayvec 0.7.4", - "constant_time_eq", + "constant_time_eq 0.2.6", ] [[package]] @@ -742,20 +776,20 @@ checksum = "6637f448b9e61dfadbdcbae9a885fadee1f3eaffb1f8d3c1965d3ade8bdfd44f" dependencies = [ "arrayref", "arrayvec 0.7.4", - "constant_time_eq", + "constant_time_eq 0.2.6", ] [[package]] name = "blake3" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "729b71f35bd3fa1a4c86b85d32c8b9069ea7fe14f7a53cfabb65f62d4265b888" +checksum = "199c42ab6972d92c9f8995f086273d25c42fc0f7b2a1fcefba465c1352d25ba5" dependencies = [ "arrayref", "arrayvec 0.7.4", "cc", "cfg-if", - "constant_time_eq", + "constant_time_eq 0.3.0", "digest 0.10.7", ] @@ -843,9 +877,9 @@ checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" [[package]] name = "bstr" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a246e68bb43f6cd9db24bea052a53e40405417c5fb372e3d1a8a7f770a564ef5" +checksum = "6798148dccfbff0fae41c7574d2fa8f1ef3492fba0face179de5d8d447d67b05" dependencies = [ "memchr", "serde", @@ -861,7 +895,7 @@ checksum = "bd769563b4ea2953e2825c9e6b7470a5f55f67e0be00030bf3e390a2a6071f64" name = "btc-relay" version = "1.2.0" dependencies = [ - "bitcoin", + "bitcoin 1.2.0", "frame-benchmarking", "frame-support", "frame-system", @@ -959,18 +993,18 @@ dependencies = [ [[package]] name = "camino" -version = "1.1.4" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c530edf18f37068ac2d977409ed5cd50d53d73bc653c7647b48eb78976ac9ae2" +checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" dependencies = [ "serde", ] [[package]] name = "cargo-platform" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27" +checksum = "2cfa25e60aea747ec7e1124f238816749faa93759c6ff5b31f1ccdda137f4479" dependencies = [ "serde", ] @@ -983,7 +1017,7 @@ checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" dependencies = [ "camino", "cargo-platform", - "semver 1.0.17", + "semver 1.0.18", "serde", "serde_json", "thiserror", @@ -991,11 +1025,12 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.79" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ "jobserver", + "libc", ] [[package]] @@ -1085,7 +1120,7 @@ version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6ed9c8b2d17acb8110c46f1da5bf4a696d745e1474a16db0cd2b49cd0249bf2" dependencies = [ - "core2", + "core2 0.4.0", "multibase", "multihash 0.16.3", "serde", @@ -1142,9 +1177,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.3.9" +version = "4.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bba77a07e4489fb41bd90e8d4201c3eb246b3c2c9ea2ba0bddd6c1d1df87db7d" +checksum = "03aef18ddf7d879c15ce20f04826ef8418101c7e528014c3eeea13321047dca3" dependencies = [ "clap_builder", "clap_derive", @@ -1153,27 +1188,26 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.3.9" +version = "4.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c9b4a88bb4bc35d3d6f65a21b0f0bafe9c894fa00978de242c555ec28bea1c0" +checksum = "f8ce6fffb678c9b80a70b6b6de0aad31df727623a70fd9a842c30cd573e2fa98" dependencies = [ "anstream", "anstyle", - "bitflags", "clap_lex", "strsim", ] [[package]] name = "clap_derive" -version = "4.3.2" +version = "4.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8cd2b2a819ad6eec39e8f1d6b53001af1e5469f8c177579cdaeb313115b825f" +checksum = "54a9bb5758fc5dfe728d1019941681eccaf0cf8a4189b692a0ee2f2ecf90a050" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.29", ] [[package]] @@ -1208,7 +1242,7 @@ version = "0.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -1300,9 +1334,9 @@ dependencies = [ [[package]] name = "const-oid" -version = "0.9.2" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "520fbf3c07483f94e3e3ca9d0cfd913d7718ef2483d2cfd91c0d9e91474ab913" +checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" [[package]] name = "constant_time_eq" @@ -1310,6 +1344,12 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21a53c0a4d288377e7415b53dcfc3c04da5cdc2cc95c8d5ac178b58f0b861ad6" +[[package]] +name = "constant_time_eq" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" + [[package]] name = "convert_case" version = "0.4.0" @@ -1332,6 +1372,15 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +[[package]] +name = "core2" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "239fa3ae9b63c2dc74bd3fa852d4792b8b305ae64eeede946265b6af62f1fff3" +dependencies = [ + "memchr", +] + [[package]] name = "core2" version = "0.4.0" @@ -1362,9 +1411,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03e69e28e9f7f77debdedbaafa2866e1de9ba56df55a8bd7cfc724c25a09987c" +checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" dependencies = [ "libc", ] @@ -1900,7 +1949,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.29", ] [[package]] @@ -2185,23 +2234,36 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "4.0.0-rc.1" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d4ba9852b42210c7538b75484f9daa0655e9a3ac04f693747bb0f02cf3cfe16" +checksum = "f711ade317dd348950a9910f81c5947e3d8907ebd2b83f76203ff1807e6a2bc2" dependencies = [ "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", "fiat-crypto", - "packed_simd_2", "platforms 3.0.2", + "rustc_version", "subtle", "zeroize", ] +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.29", +] + [[package]] name = "cxx" -version = "1.0.97" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e88abab2f5abbe4c56e8f1fb431b784d710b709888f35755a160e62e33fe38e8" +checksum = "28403c86fc49e3401fdf45499ba37fad6493d9329449d6449d7f0e10f4654d28" dependencies = [ "cc", "cxxbridge-flags", @@ -2211,9 +2273,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.97" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c0c11acd0e63bae27dcd2afced407063312771212b7a823b4fd72d633be30fb" +checksum = "78da94fef01786dc3e0c76eafcd187abcaa9972c78e05ff4041e24fdf059c285" dependencies = [ "cc", "codespan-reporting", @@ -2221,24 +2283,24 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.22", + "syn 2.0.29", ] [[package]] name = "cxxbridge-flags" -version = "1.0.97" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d3816ed957c008ccd4728485511e3d9aaf7db419aa321e3d2c5a2f3411e36c8" +checksum = "e2a6f5e1dfb4b34292ad4ea1facbfdaa1824705b231610087b00b17008641809" [[package]] name = "cxxbridge-macro" -version = "1.0.97" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26acccf6f445af85ea056362561a24ef56cdc15fcc685f03aec50b9c702cb6d" +checksum = "50c49547d73ba8dcfd4ad7325d64c6d5391ff4224d498fc39a6f3f49825a530d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.29", ] [[package]] @@ -2337,9 +2399,9 @@ dependencies = [ [[package]] name = "der" -version = "0.7.6" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56acb310e15652100da43d130af8d97b509e95af61aab1c5a7939ef24337ee17" +checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" dependencies = [ "const-oid", "zeroize", @@ -2373,6 +2435,12 @@ dependencies = [ "rusticata-macros", ] +[[package]] +name = "deranged" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" + [[package]] name = "derivative" version = "2.2.0" @@ -2646,7 +2714,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.29", ] [[package]] @@ -2669,9 +2737,9 @@ checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" [[package]] name = "dtoa" -version = "1.0.6" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65d09067bfacaa79114679b279d7f5885b53295b1e2cfb4e79c8e4bd3d633169" +checksum = "dcbb2bf8e87535c23f7a8a321e364ce21462d0ff10cb6407820e8e96dfff6653" [[package]] name = "dyn-clonable" @@ -2696,9 +2764,9 @@ dependencies = [ [[package]] name = "dyn-clone" -version = "1.0.11" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b0cf012f1230e43cd00ebb729c6bb58707ecfa8ad08b52ef3a4ccd2697fc30" +checksum = "bbfc4744c1b8f2a09adc0e55242f60b1af195d88596bd8700be74418c056c555" [[package]] name = "ecdsa" @@ -2714,11 +2782,11 @@ dependencies = [ [[package]] name = "ecdsa" -version = "0.16.7" +version = "0.16.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0997c976637b606099b9985693efa3581e84e41f5c11ba5255f88711058ad428" +checksum = "a4b1e0c257a9e9f25f90ff76d7a68360ed497ee519c8e428d1825ef0000799d4" dependencies = [ - "der 0.7.6", + "der 0.7.8", "digest 0.10.7", "elliptic-curve 0.13.5", "rfc6979 0.4.0", @@ -2765,9 +2833,9 @@ dependencies = [ [[package]] name = "either" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" dependencies = [ "serde", ] @@ -2808,7 +2876,7 @@ dependencies = [ "group 0.13.0", "pkcs8 0.10.2", "rand_core 0.6.4", - "sec1 0.7.2", + "sec1 0.7.3", "subtle", "zeroize", ] @@ -2848,18 +2916,18 @@ checksum = "5e9a1f9f7d83e59740248a6e14ecf93929ade55027844dfcea78beafccc15745" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.29", ] [[package]] name = "enumn" -version = "0.1.8" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48016319042fb7c87b78d2993084a831793a897a5cd1a2a67cab9d1eeb4b7d76" +checksum = "b893c4eb2dc092c811165f84dc7447fae16fb66521717968c34c509b39b1a5c5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.29", ] [[package]] @@ -2896,15 +2964,15 @@ checksum = "e48c92028aaa870e83d51c64e5d4e0b6981b360c522198c23959f219a4e1b15b" [[package]] name = "equivalent" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88bffebc5d80432c9b140ee17875ff173a8ab62faad5b257da912bd2f6c1c0a1" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +checksum = "6b30f669a7961ef1631673d2766cc92f52d64f7ef354d4fe0ddfd30ed52f0f4f" dependencies = [ "errno-dragonfly", "libc", @@ -3130,7 +3198,7 @@ dependencies = [ "fs-err", "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.29", ] [[package]] @@ -3178,6 +3246,12 @@ dependencies = [ "instant", ] +[[package]] +name = "fastrand" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" + [[package]] name = "fatality" version = "0.0.6" @@ -3206,7 +3280,7 @@ dependencies = [ [[package]] name = "fc-consensus" version = "2.0.0-dev" -source = "git+https://github.com/paritytech//frontier?branch=polkadot-v0.9.42#1a718546085be20ce381b70e1f9e4c8b4d4b1f03" +source = "git+https://github.com/paritytech//frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" dependencies = [ "async-trait", "fp-consensus", @@ -3222,7 +3296,7 @@ dependencies = [ [[package]] name = "fc-db" version = "2.0.0-dev" -source = "git+https://github.com/paritytech//frontier?branch=polkadot-v0.9.42#1a718546085be20ce381b70e1f9e4c8b4d4b1f03" +source = "git+https://github.com/paritytech//frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" dependencies = [ "async-trait", "ethereum", @@ -3252,7 +3326,7 @@ dependencies = [ [[package]] name = "fc-mapping-sync" version = "2.0.0-dev" -source = "git+https://github.com/paritytech//frontier?branch=polkadot-v0.9.42#1a718546085be20ce381b70e1f9e4c8b4d4b1f03" +source = "git+https://github.com/paritytech//frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" dependencies = [ "fc-db", "fc-storage", @@ -3275,7 +3349,7 @@ dependencies = [ [[package]] name = "fc-rpc" version = "2.0.0-dev" -source = "git+https://github.com/paritytech//frontier?branch=polkadot-v0.9.42#1a718546085be20ce381b70e1f9e4c8b4d4b1f03" +source = "git+https://github.com/paritytech//frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" dependencies = [ "ethereum", "ethereum-types", @@ -3325,7 +3399,7 @@ dependencies = [ [[package]] name = "fc-rpc-core" version = "1.1.0-dev" -source = "git+https://github.com/paritytech//frontier?branch=polkadot-v0.9.42#1a718546085be20ce381b70e1f9e4c8b4d4b1f03" +source = "git+https://github.com/paritytech//frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" dependencies = [ "ethereum", "ethereum-types", @@ -3338,7 +3412,7 @@ dependencies = [ [[package]] name = "fc-storage" version = "1.0.0-dev" -source = "git+https://github.com/paritytech//frontier?branch=polkadot-v0.9.42#1a718546085be20ce381b70e1f9e4c8b4d4b1f03" +source = "git+https://github.com/paritytech//frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" dependencies = [ "ethereum", "ethereum-types", @@ -3428,13 +3502,13 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.21" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cbc844cecaee9d4443931972e1289c8ff485cb4cc2767cb03ca139ed6885153" +checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.2.16", + "redox_syscall 0.3.5", "windows-sys 0.48.0", ] @@ -3484,13 +3558,13 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.26" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" +checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" dependencies = [ "crc32fast", "libz-sys", - "miniz_oxide 0.7.1", + "miniz_oxide", ] [[package]] @@ -3555,7 +3629,7 @@ dependencies = [ [[package]] name = "fp-account" version = "1.0.0-dev" -source = "git+https://github.com/paritytech//frontier?branch=polkadot-v0.9.42#1a718546085be20ce381b70e1f9e4c8b4d4b1f03" +source = "git+https://github.com/paritytech//frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" dependencies = [ "hex", "impl-serde 0.4.0", @@ -3574,7 +3648,7 @@ dependencies = [ [[package]] name = "fp-consensus" version = "2.0.0-dev" -source = "git+https://github.com/paritytech//frontier?branch=polkadot-v0.9.42#1a718546085be20ce381b70e1f9e4c8b4d4b1f03" +source = "git+https://github.com/paritytech//frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" dependencies = [ "ethereum", "parity-scale-codec", @@ -3586,7 +3660,7 @@ dependencies = [ [[package]] name = "fp-ethereum" version = "1.0.0-dev" -source = "git+https://github.com/paritytech//frontier?branch=polkadot-v0.9.42#1a718546085be20ce381b70e1f9e4c8b4d4b1f03" +source = "git+https://github.com/paritytech//frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" dependencies = [ "ethereum", "ethereum-types", @@ -3600,7 +3674,7 @@ dependencies = [ [[package]] name = "fp-evm" version = "3.0.0-dev" -source = "git+https://github.com/paritytech//frontier?branch=polkadot-v0.9.42#1a718546085be20ce381b70e1f9e4c8b4d4b1f03" +source = "git+https://github.com/paritytech//frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" dependencies = [ "evm", "frame-support", @@ -3615,7 +3689,7 @@ dependencies = [ [[package]] name = "fp-rpc" version = "3.0.0-dev" -source = "git+https://github.com/paritytech//frontier?branch=polkadot-v0.9.42#1a718546085be20ce381b70e1f9e4c8b4d4b1f03" +source = "git+https://github.com/paritytech//frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" dependencies = [ "ethereum", "ethereum-types", @@ -3632,7 +3706,7 @@ dependencies = [ [[package]] name = "fp-self-contained" version = "1.0.0-dev" -source = "git+https://github.com/paritytech//frontier?branch=polkadot-v0.9.42#1a718546085be20ce381b70e1f9e4c8b4d4b1f03" +source = "git+https://github.com/paritytech//frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" dependencies = [ "frame-support", "parity-scale-codec", @@ -3644,7 +3718,7 @@ dependencies = [ [[package]] name = "fp-storage" version = "2.0.0" -source = "git+https://github.com/paritytech//frontier?branch=polkadot-v0.9.42#1a718546085be20ce381b70e1f9e4c8b4d4b1f03" +source = "git+https://github.com/paritytech//frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" dependencies = [ "parity-scale-codec", "serde", @@ -3736,7 +3810,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.29", ] [[package]] @@ -3810,7 +3884,7 @@ name = "frame-support" version = "4.0.0-dev" source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ - "bitflags", + "bitflags 1.3.2", "environmental", "frame-metadata", "frame-support-procedural", @@ -3851,7 +3925,7 @@ dependencies = [ "proc-macro-warning", "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.29", ] [[package]] @@ -3863,7 +3937,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.29", ] [[package]] @@ -3873,7 +3947,7 @@ source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#f dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.29", ] [[package]] @@ -3948,11 +4022,11 @@ dependencies = [ [[package]] name = "fs4" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7672706608ecb74ab2e055c68327ffc25ae4cac1e12349204fd5fb0f3487cce2" +checksum = "2eeb4ed9e12f43b7fa0baae3f9cdda28352770132ef2e09a23760c29cae8bd47" dependencies = [ - "rustix 0.37.20", + "rustix 0.38.8", "windows-sys 0.48.0", ] @@ -4034,12 +4108,12 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" dependencies = [ - "fastrand", + "fastrand 1.9.0", "futures-core", "futures-io", "memchr", "parking", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.12", "waker-fn", ] @@ -4051,7 +4125,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.29", ] [[package]] @@ -4096,7 +4170,7 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.12", "pin-utils", "slab", ] @@ -4195,9 +4269,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.27.3" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" [[package]] name = "glob" @@ -4207,11 +4281,11 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "globset" -version = "0.4.10" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "029d74589adefde59de1a0c4f4732695c32805624aec7b68d91503d4dba79afc" +checksum = "759c97c1e17c55525b57192c06a267cda0ac5210b222d6b82189a2338fa1c13d" dependencies = [ - "aho-corasick 0.7.20", + "aho-corasick", "bstr", "fnv", "log", @@ -4242,9 +4316,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.20" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" +checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" dependencies = [ "bytes", "fnv", @@ -4351,18 +4425,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" -dependencies = [ - "libc", -] - -[[package]] -name = "hermit-abi" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" +checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" [[package]] name = "hex" @@ -4401,6 +4466,12 @@ dependencies = [ "proc-macro-hack", ] +[[package]] +name = "hex_lit" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3011d1213f159867b13cfd6ac92d2cd5f1345762c63be3554e84092d85a50bbd" + [[package]] name = "hkdf" version = "0.12.3" @@ -4480,14 +4551,14 @@ checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" dependencies = [ "bytes", "http", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.12", ] [[package]] name = "http-range-header" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bfe8eed0a9285ef776bb792479ea3834e8b94e13d615c2f66d03dd50a435a29" +checksum = "add0ab9360ddbd88cfeb3bd9574a1d85cfdfa14db10b3e21d3700dbc4328758f" [[package]] name = "httparse" @@ -4497,9 +4568,9 @@ checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "humantime" @@ -4523,7 +4594,7 @@ dependencies = [ "httparse", "httpdate", "itoa", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.12", "socket2 0.4.9", "tokio", "tower-service", @@ -4702,9 +4773,9 @@ checksum = "8e04e2fd2b8188ea827b32ef11de88377086d690286ab35747ef7f9bf3ccb590" [[package]] name = "indicatif" -version = "0.17.5" +version = "0.17.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ff8cc23a7393a397ed1d7f56e6365cba772aba9f9912ab968b03043c395d057" +checksum = "0b297dc40733f23a0e52728a58fa9489a5b7638a324932de16b41adc3ef80730" dependencies = [ "console", "instant", @@ -4751,7 +4822,7 @@ name = "interbtc-parachain" version = "1.2.0" dependencies = [ "async-trait", - "bitcoin", + "bitcoin 1.2.0", "btc-relay-rpc-runtime-api", "clap", "cumulus-client-cli", @@ -4851,7 +4922,7 @@ dependencies = [ name = "interbtc-primitives" version = "1.2.0" dependencies = [ - "bitcoin", + "bitcoin 1.2.0", "bstringify", "parity-scale-codec", "primitive-types", @@ -4928,7 +4999,7 @@ name = "interlay-runtime-parachain" version = "1.2.0" dependencies = [ "annuity", - "bitcoin", + "bitcoin 1.2.0", "btc-relay", "btc-relay-rpc-runtime-api", "clients-info", @@ -5048,7 +5119,7 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "hermit-abi 0.3.1", + "hermit-abi 0.3.2", "libc", "windows-sys 0.48.0", ] @@ -5079,13 +5150,12 @@ checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" [[package]] name = "is-terminal" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" +checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ - "hermit-abi 0.3.1", - "io-lifetimes", - "rustix 0.37.20", + "hermit-abi 0.3.2", + "rustix 0.38.8", "windows-sys 0.48.0", ] @@ -5093,7 +5163,7 @@ dependencies = [ name = "issue" version = "1.2.0" dependencies = [ - "bitcoin", + "bitcoin 1.2.0", "btc-relay", "currency", "fee", @@ -5156,9 +5226,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.6" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "jobserver" @@ -5329,7 +5399,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc" dependencies = [ "cfg-if", - "ecdsa 0.16.7", + "ecdsa 0.16.8", "elliptic-curve 0.13.5", "once_cell", "sha2 0.10.7", @@ -5349,7 +5419,7 @@ name = "kintsugi-runtime-parachain" version = "1.2.0" dependencies = [ "annuity", - "bitcoin", + "bitcoin 1.2.0", "btc-relay", "btc-relay-rpc-runtime-api", "clients-info", @@ -5639,12 +5709,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "libm" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" - [[package]] name = "libm" version = "0.2.7" @@ -6228,9 +6292,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.9" +version = "1.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ee889ecc9568871456d42f603d6a0ce59ff328d291063a45cbdf0036baf6db" +checksum = "d97137b25e321a73eef1418d1d5d2eda4d77e12813f8e6dead84bc52c5870a7b" dependencies = [ "cc", "pkg-config", @@ -6239,9 +6303,9 @@ dependencies = [ [[package]] name = "link-cplusplus" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5" +checksum = "9d240c6f7e1ba3a28b0249f774e6a9dd0175054b52dfbb61b16eb8505c3785c9" dependencies = [ "cc", ] @@ -6263,9 +6327,9 @@ dependencies = [ [[package]] name = "linregress" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "475015a7f8f017edb28d2e69813be23500ad4b32cfe3421c4148efc97324ee52" +checksum = "4de0b5f52a9f84544d268f5fabb71b38962d6aa3c6600b8bcd27d44ccf9c9c45" dependencies = [ "nalgebra", ] @@ -6282,6 +6346,12 @@ version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" +[[package]] +name = "linux-raw-sys" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" + [[package]] name = "loans" version = "1.9.3" @@ -6351,9 +6421,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.19" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "lru" @@ -6429,7 +6499,7 @@ version = "0.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f099785f7595cc4b4553a174ce30dd7589ef93391ff414dbb67f62392b9e0ce1" dependencies = [ - "regex-automata", + "regex-automata 0.1.10", ] [[package]] @@ -6469,7 +6539,7 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffc89ccdc6e10d6907450f753537ebc5c5d3460d2e4e62ea74bd571db62c0f9e" dependencies = [ - "rustix 0.37.20", + "rustix 0.37.23", ] [[package]] @@ -6543,15 +6613,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" -[[package]] -name = "miniz_oxide" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" -dependencies = [ - "adler", -] - [[package]] name = "miniz_oxide" version = "0.7.1" @@ -6735,7 +6796,7 @@ dependencies = [ "blake2b_simd", "blake2s_simd", "blake3", - "core2", + "core2 0.4.0", "digest 0.10.7", "multihash-derive", "sha2 0.10.7", @@ -6749,7 +6810,7 @@ version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835d6ff01d610179fbce3de1694d007e500bf33a7f29689838941d6bf783ae40" dependencies = [ - "core2", + "core2 0.4.0", "multihash-derive", "unsigned-varint", ] @@ -6790,9 +6851,9 @@ dependencies = [ [[package]] name = "nalgebra" -version = "0.32.2" +version = "0.32.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d68d47bba83f9e2006d117a9a33af1524e655516b8919caac694427a6fb1e511" +checksum = "307ed9b18cc2423f29e83f84fd23a8e73628727990181f18641a8b5dc2ab1caa" dependencies = [ "approx", "matrixmultiply", @@ -6806,9 +6867,9 @@ dependencies = [ [[package]] name = "nalgebra-macros" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d232c68884c0c99810a5a4d333ef7e47689cfd0edc85efc9e54e1e6bf5212766" +checksum = "91761aed67d03ad966ef783ae962ef9bbaca728d2dd7ceb7939ec110fffad998" dependencies = [ "proc-macro2", "quote", @@ -6867,7 +6928,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9ea4302b9759a7a88242299225ea3688e63c85ea136371bb6cf94fd674efaab" dependencies = [ "anyhow", - "bitflags", + "bitflags 1.3.2", "byteorder", "libc", "netlink-packet-core", @@ -6920,7 +6981,7 @@ version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cfg-if", "libc", "memoffset 0.6.5", @@ -6995,9 +7056,9 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" dependencies = [ "autocfg 1.1.0", "num-integer", @@ -7006,9 +7067,9 @@ dependencies = [ [[package]] name = "num-complex" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e0d21255c828d6f128a1e41534206671e8c3ea0c62f32291e808dc82cff17d" +checksum = "1ba157ca0885411de85d6ca030ba7e2a83a28636056c7c699b07c8b6f7383214" dependencies = [ "num-traits", ] @@ -7058,21 +7119,21 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" dependencies = [ "autocfg 1.1.0", - "libm 0.2.7", + "libm", ] [[package]] name = "num_cpus" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.2.6", + "hermit-abi 0.3.2", "libc", ] @@ -7094,7 +7155,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.29", ] [[package]] @@ -7117,9 +7178,9 @@ dependencies = [ [[package]] name = "object" -version = "0.30.4" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03b4680b86d9cfafba8fc491dc9b6df26b68cf40e9e6cd73909194759a63c385" +checksum = "77ac5bbd07aea88c60a577a1ce218075ffd59208b2d7ca97adf9bfc5aeb21ebe" dependencies = [ "memchr", ] @@ -7162,11 +7223,11 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "openssl" -version = "0.10.55" +version = "0.10.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "345df152bc43501c5eb9e4654ff05f794effb78d4efe3d53abc158baddc0703d" +checksum = "729b745ad4a5575dd06a3e1af1414bd330ee561c01b3899eb584baeaa8def17e" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cfg-if", "foreign-types", "libc", @@ -7183,7 +7244,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.29", ] [[package]] @@ -7194,9 +7255,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.90" +version = "0.9.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374533b0e45f3a7ced10fcaeccca020e66656bc03dac384f852e4e5a7a8104a6" +checksum = "866b5f16f90776b9bb8dc1e1802ac6f0513de3a7a7465867bfbc563dc737faac" dependencies = [ "cc", "libc", @@ -7489,16 +7550,6 @@ dependencies = [ "sha2 0.10.7", ] -[[package]] -name = "packed_simd_2" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1914cd452d8fccd6f9db48147b29fd4ae05bea9dc5d9ad578509f72415de282" -dependencies = [ - "cfg-if", - "libm 0.1.4", -] - [[package]] name = "pallet-aura" version = "4.0.0-dev" @@ -7607,7 +7658,7 @@ dependencies = [ [[package]] name = "pallet-base-fee" version = "1.0.0" -source = "git+https://github.com/paritytech//frontier?branch=polkadot-v0.9.42#1a718546085be20ce381b70e1f9e4c8b4d4b1f03" +source = "git+https://github.com/paritytech//frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" dependencies = [ "fp-evm", "frame-support", @@ -7720,7 +7771,7 @@ name = "pallet-contracts" version = "4.0.0-dev" source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ - "bitflags", + "bitflags 1.3.2", "environmental", "frame-benchmarking", "frame-support", @@ -7749,7 +7800,7 @@ name = "pallet-contracts-primitives" version = "7.0.0" source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ - "bitflags", + "bitflags 1.3.2", "parity-scale-codec", "scale-info", "sp-runtime", @@ -7764,7 +7815,7 @@ source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#f dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.29", ] [[package]] @@ -7859,7 +7910,7 @@ dependencies = [ [[package]] name = "pallet-ethereum" version = "4.0.0-dev" -source = "git+https://github.com/paritytech//frontier?branch=polkadot-v0.9.42#1a718546085be20ce381b70e1f9e4c8b4d4b1f03" +source = "git+https://github.com/paritytech//frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" dependencies = [ "ethereum", "ethereum-types", @@ -7882,7 +7933,7 @@ dependencies = [ [[package]] name = "pallet-evm" version = "6.0.0-dev" -source = "git+https://github.com/paritytech//frontier?branch=polkadot-v0.9.42#1a718546085be20ce381b70e1f9e4c8b4d4b1f03" +source = "git+https://github.com/paritytech//frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" dependencies = [ "environmental", "evm", @@ -7907,7 +7958,7 @@ dependencies = [ [[package]] name = "pallet-evm-chain-id" version = "1.0.0-dev" -source = "git+https://github.com/paritytech//frontier?branch=polkadot-v0.9.42#1a718546085be20ce381b70e1f9e4c8b4d4b1f03" +source = "git+https://github.com/paritytech//frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" dependencies = [ "frame-support", "frame-system", @@ -7918,7 +7969,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-dispatch" version = "2.0.0-dev" -source = "git+https://github.com/paritytech//frontier?branch=polkadot-v0.9.42#1a718546085be20ce381b70e1f9e4c8b4d4b1f03" +source = "git+https://github.com/paritytech//frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" dependencies = [ "fp-evm", "frame-support", @@ -7928,7 +7979,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-modexp" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#1a718546085be20ce381b70e1f9e4c8b4d4b1f03" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" dependencies = [ "fp-evm", "num", @@ -7937,7 +7988,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-sha3fips" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#1a718546085be20ce381b70e1f9e4c8b4d4b1f03" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" dependencies = [ "fp-evm", "tiny-keccak", @@ -7946,7 +7997,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-simple" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#1a718546085be20ce381b70e1f9e4c8b4d4b1f03" +source = "git+https://github.com/paritytech/frontier?branch=polkadot-v0.9.42#2499d18c936edbcb7fcb711827db7abb9b4f4da4" dependencies = [ "fp-evm", "ripemd", @@ -8385,7 +8436,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.29", ] [[package]] @@ -8638,7 +8689,7 @@ name = "parachain-tests" version = "1.2.0" dependencies = [ "annuity", - "bitcoin", + "bitcoin 1.2.0", "btc-relay", "btc-relay-rpc-runtime-api", "clients-info", @@ -8764,9 +8815,9 @@ dependencies = [ [[package]] name = "parity-db" -version = "0.4.8" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4890dcb9556136a4ec2b0c51fa4a08c8b733b829506af8fff2e853f3a065985b" +checksum = "78f19d20a0d2cc52327a88d131fa1c4ea81ea4a04714aedcfeca2dd410049cf8" dependencies = [ "blake2", "crc32fast", @@ -8784,9 +8835,9 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.6.1" +version = "3.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2287753623c76f953acd29d15d8100bcab84d29db78fb6f352adb3c53e83b967" +checksum = "dd8e946cc0cc711189c0b0249fb8b599cbeeab9784d83c415719368bb8d4ac64" dependencies = [ "arrayvec 0.7.4", "bitvec", @@ -8799,9 +8850,9 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.6.1" +version = "3.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b6937b5e67bfba3351b87b040d48352a2fcb6ad72f81855412ce97b45c8f110" +checksum = "2a296c3079b5fefbc499e1de58dc26c09b1b9a5952d26694ee89f04a43ebbb3e" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -8872,14 +8923,14 @@ dependencies = [ "libc", "redox_syscall 0.3.5", "smallvec", - "windows-targets 0.48.0", + "windows-targets 0.48.5", ] [[package]] name = "paste" -version = "1.0.12" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] name = "pbkdf2" @@ -8931,9 +8982,9 @@ checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pest" -version = "2.7.0" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f73935e4d55e2abf7f130186537b19e7a4abc886a0252380b59248af473a3fc9" +checksum = "1acb4a4365a13f749a93f1a094a7805e5cfa0955373a9de860d962eaa3a5fe5a" dependencies = [ "thiserror", "ucd-trie", @@ -8941,9 +8992,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.0" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aef623c9bbfa0eedf5a0efba11a5ee83209c326653ca31ff019bec3a95bfff2b" +checksum = "666d00490d4ac815001da55838c500eafb0320019bbaa44444137c48b443a853" dependencies = [ "pest", "pest_generator", @@ -8951,22 +9002,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.0" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3e8cba4ec22bada7fc55ffe51e2deb6a0e0db2d0b7ab0b103acc80d2510c190" +checksum = "68ca01446f50dbda87c1786af8770d535423fa8a53aec03b8f4e3d7eb10e0929" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.29", ] [[package]] name = "pest_meta" -version = "2.7.0" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01f71cb40bd8bb94232df14b946909e14660e33fc05db3e50ae2a82d7ea0ca0" +checksum = "56af0a30af74d0445c0bf6d9d051c979b516a1a5af790d251daee76005420a48" dependencies = [ "once_cell", "pest", @@ -8975,32 +9026,32 @@ dependencies = [ [[package]] name = "petgraph" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" +checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap 1.9.3", + "indexmap 2.0.0", ] [[package]] name = "pin-project" -version = "1.1.0" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c95a7476719eab1e366eaf73d0260af3021184f18177925b07f54b30089ceead" +checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.0" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39407670928234ebc5e6e580247dd567ad73a3578460c5990f9503df207e8f07" +checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.29", ] [[package]] @@ -9011,9 +9062,9 @@ checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "12cc1b0bf1727a77a54b6654e7b5f1af8604923edc8b81885f8ec92f9e3f0a05" [[package]] name = "pin-utils" @@ -9037,7 +9088,7 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ - "der 0.7.6", + "der 0.7.8", "spki 0.7.2", ] @@ -10050,7 +10101,7 @@ name = "polkadot-runtime-parachains" version = "0.9.42" source = "git+https://github.com/paritytech//polkadot?branch=release-v0.9.42#6f991987c0b4cbbd7d4badc9ef08d83da5fefbfd" dependencies = [ - "bitflags", + "bitflags 1.3.2", "bitvec", "derive_more", "frame-benchmarking", @@ -10237,12 +10288,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" dependencies = [ "autocfg 1.1.0", - "bitflags", + "bitflags 1.3.2", "cfg-if", "concurrent-queue", "libc", "log", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.12", "windows-sys 0.48.0", ] @@ -10283,9 +10334,9 @@ dependencies = [ [[package]] name = "portable-atomic" -version = "1.3.3" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "767eb9f07d4a5ebcb39bbf2d452058a93c011373abf6832e24194a1c3f004794" +checksum = "f32154ba0af3a075eefa1eda8bb414ee928f62303a54ea85b8d6638ff1a6ee9e" [[package]] name = "ppv-lite86" @@ -10423,14 +10474,14 @@ checksum = "0e99670bafb56b9a106419397343bdbc8b8742c3cc449fec6345f86173f47cd4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.29", ] [[package]] name = "proc-macro2" -version = "1.0.63" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b368fba921b0dce7e60f5e04ec15e565b3303972b42bcfde1d0713b881959eb" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] @@ -10479,7 +10530,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e35c06b98bf36aba164cc17cb25f7e232f5c4aeea73baa14b8a9f0d92dbfa65" dependencies = [ "bit-set", - "bitflags", + "bitflags 1.3.2", "byteorder", "lazy_static", "num-traits", @@ -10596,9 +10647,9 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67c10f662eee9c94ddd7135043e544f3c82fa839a1e7b865911331961b53186c" +checksum = "f31999cfc7927c4e212e60fd50934ab40e8e8bfd2d493d6095d2d306bc0764d9" dependencies = [ "bytes", "rand 0.8.5", @@ -10614,9 +10665,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.28" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -10858,7 +10909,7 @@ checksum = "6413f3de1edee53342e6138e75b56d32e7bc6e332b3bd62d497b1929d4cfbcdd" dependencies = [ "pem", "ring", - "time 0.3.22", + "time 0.3.27", "x509-parser 0.13.2", "yasna", ] @@ -10871,7 +10922,7 @@ checksum = "ffbe84efe2f38dea12e9bfc1f65377fdf03e53a18cb3b995faedf7934c7e785b" dependencies = [ "pem", "ring", - "time 0.3.22", + "time 0.3.27", "yasna", ] @@ -10888,7 +10939,7 @@ dependencies = [ name = "redeem" version = "1.2.0" dependencies = [ - "bitcoin", + "bitcoin 1.2.0", "btc-relay", "currency", "fee", @@ -10946,7 +10997,7 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -10955,7 +11006,7 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -10984,22 +11035,22 @@ dependencies = [ [[package]] name = "ref-cast" -version = "1.0.16" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43faa91b1c8b36841ee70e97188a869d37ae21759da6846d4be66de5bf7b12c" +checksum = "acde58d073e9c79da00f2b5b84eed919c8326832648a5b109b3fce1bb1175280" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.16" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d2275aab483050ab2a7364c1a46604865ee7d6906684e08db0f090acf74f9e7" +checksum = "7f7473c2cfcf90008193dd0e3e16599455cb601a9fce322b5bb55de799664925" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.29", ] [[package]] @@ -11016,13 +11067,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.8.4" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f" +checksum = "81bc1d4caf89fac26a70747fe603c130093b53c773888797a6329091246d651a" dependencies = [ - "aho-corasick 1.0.2", + "aho-corasick", "memchr", - "regex-syntax 0.7.2", + "regex-automata 0.3.6", + "regex-syntax 0.7.4", ] [[package]] @@ -11034,6 +11086,17 @@ dependencies = [ "regex-syntax 0.6.29", ] +[[package]] +name = "regex-automata" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed1ceff11a1dddaee50c9dc8e4938bd106e9d89ae372f192311e7da498e3b69" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.7.4", +] + [[package]] name = "regex-syntax" version = "0.6.29" @@ -11042,9 +11105,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" +checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" [[package]] name = "region" @@ -11052,7 +11115,7 @@ version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76e189c2369884dce920945e2ddf79b3dff49e071a167dd1817fa9c4c00d512e" dependencies = [ - "bitflags", + "bitflags 1.3.2", "libc", "mach", "winapi", @@ -11425,7 +11488,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.17", + "semver 1.0.18", ] [[package]] @@ -11439,11 +11502,11 @@ dependencies = [ [[package]] name = "rustix" -version = "0.36.14" +version = "0.36.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14e4d67015953998ad0eb82887a0eb0129e18a7e2f3b7b0f6c422fddcd503d62" +checksum = "c37f1bd5ef1b5422177b7646cba67430579cfe2ace80f284fee876bca52ad941" dependencies = [ - "bitflags", + "bitflags 1.3.2", "errno", "io-lifetimes", "libc", @@ -11453,11 +11516,11 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.20" +version = "0.37.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b96e891d04aa506a6d1f318d2771bcb1c7dfda84e126660ace067c9b474bb2c0" +checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" dependencies = [ - "bitflags", + "bitflags 1.3.2", "errno", "io-lifetimes", "libc", @@ -11465,6 +11528,19 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "rustix" +version = "0.38.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ed4fa021d81c8392ce04db050a3da9a60299050b7ae1cf482d862b54a7218f" +dependencies = [ + "bitflags 2.4.0", + "errno", + "libc", + "linux-raw-sys 0.4.5", + "windows-sys 0.48.0", +] + [[package]] name = "rustls" version = "0.19.1" @@ -11513,9 +11589,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.12" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] name = "rusty-fork" @@ -11542,15 +11618,15 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.13" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "safe_arch" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62a7484307bd40f8f7ccbacccac730108f2cae119a3b11c74485b48aa9ea650f" +checksum = "f398075ce1e6a179b46f51bd88d0598b92b00d3551f1a2d4ac49e771b56ac354" dependencies = [ "bytemuck", ] @@ -11668,7 +11744,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.29", ] [[package]] @@ -12119,7 +12195,7 @@ dependencies = [ "libc", "log", "once_cell", - "rustix 0.36.14", + "rustix 0.36.15", "sc-allocator", "sc-executor-common", "sp-runtime-interface", @@ -12230,7 +12306,7 @@ source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#f dependencies = [ "array-bytes 4.2.0", "async-trait", - "bitflags", + "bitflags 1.3.2", "bytes", "futures", "futures-timer", @@ -12678,7 +12754,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.29", ] [[package]] @@ -12802,9 +12878,9 @@ dependencies = [ [[package]] name = "scale-info" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad560913365790f17cbf12479491169f01b9d46d29cfc7422bf8c64bdc61b731" +checksum = "35c0a159d0c45c12b20c5a844feb1fe4bea86e28f17b92a5f0c42193634d3782" dependencies = [ "bitvec", "cfg-if", @@ -12816,9 +12892,9 @@ dependencies = [ [[package]] name = "scale-info-derive" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19df9bd9ace6cc2fe19387c96ce677e823e07d017ceed253e7bb3d1d1bd9c73b" +checksum = "912e55f6d20e0e80d63733872b40e1227c0bce1e1ab81ba67d696339bfd7fd29" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -12828,11 +12904,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.21" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" +checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" dependencies = [ - "windows-sys 0.42.0", + "windows-sys 0.48.0", ] [[package]] @@ -12866,15 +12942,15 @@ dependencies = [ [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "scratch" -version = "1.0.5" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1" +checksum = "a3cf7c11c38cb994f3d40e8a8cde3bbd1f72a435e4c49e85d6553d8312306152" [[package]] name = "sct" @@ -12924,12 +13000,12 @@ dependencies = [ [[package]] name = "sec1" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0aec48e813d6b90b15f0b8948af3c63483992dee44c03e9930b3eebdabe046e" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ "base16ct 0.2.0", - "der 0.7.6", + "der 0.7.8", "generic-array 0.14.7", "pkcs8 0.10.2", "subtle", @@ -12954,6 +13030,16 @@ dependencies = [ "secp256k1-sys 0.6.1", ] +[[package]] +name = "secp256k1" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25996b82292a7a57ed3508f052cfff8640d38d32018784acd714758b43da9c8f" +dependencies = [ + "bitcoin_hashes 0.12.0", + "secp256k1-sys 0.8.1", +] + [[package]] name = "secp256k1-sys" version = "0.4.0" @@ -12971,6 +13057,15 @@ dependencies = [ "cc", ] +[[package]] +name = "secp256k1-sys" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70a129b9e9efbfb223753b9163c4ab3b13cff7fd9c7f010fbac25ab4099fa07e" +dependencies = [ + "cc", +] + [[package]] name = "secrecy" version = "0.8.0" @@ -13000,11 +13095,11 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.9.1" +version = "2.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fc758eb7bffce5b308734e9b0c1468893cae9ff70ebf13e7090be8dcbcc83a8" +checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" dependencies = [ - "bitflags", + "bitflags 1.3.2", "core-foundation", "core-foundation-sys", "libc", @@ -13013,9 +13108,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.9.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f51d0c0d83bec45f16480d0ce0058397a69e48fcdc52d1dc8855fb68acbd31a7" +checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" dependencies = [ "core-foundation-sys", "libc", @@ -13032,9 +13127,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" +checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" dependencies = [ "serde", ] @@ -13047,29 +13142,29 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.164" +version = "1.0.185" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8c8cf938e98f769bc164923b06dce91cea1751522f46f8466461af04c9027d" +checksum = "be9b6f69f1dfd54c3b568ffa45c310d6973a5e5148fd40cf515acaf38cf5bc31" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.164" +version = "1.0.185" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68" +checksum = "dc59dfdcbad1437773485e0367fea4b090a2e0a16d9ffc46af47764536a298ec" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.29", ] [[package]] name = "serde_json" -version = "1.0.99" +version = "1.0.105" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46266871c240a00b8f503b877622fe33430b3c7d963bdc0f2adc511e54a1eae3" +checksum = "693151e1ac27563d6dbcec9dee9fbd5da8539b20fa14ad3752b2e6d363ace360" dependencies = [ "itoa", "ryu", @@ -13214,15 +13309,15 @@ dependencies = [ [[package]] name = "siphasher" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" [[package]] name = "slab" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg 1.1.0", ] @@ -13256,9 +13351,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" [[package]] name = "snap" @@ -13268,14 +13363,14 @@ checksum = "5e9f0ab6ef7eb7353d9119c170a436d1bf248eea575ac42d19d12f4e34130831" [[package]] name = "snow" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ccba027ba85743e09d15c03296797cad56395089b832b48b5a5217880f57733" +checksum = "0c9d1425eb528a21de2755c75af4c9b5d57f50a0d4c3b7f1828a4cd03f8ba155" dependencies = [ "aes-gcm 0.9.4", "blake2", "chacha20poly1305", - "curve25519-dalek 4.0.0-rc.1", + "curve25519-dalek 4.0.0", "rand_core 0.6.4", "ring", "rustc_version", @@ -13351,7 +13446,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.29", ] [[package]] @@ -13533,7 +13628,7 @@ version = "7.0.0" source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "array-bytes 4.2.0", - "bitflags", + "bitflags 1.3.2", "blake2", "bounded-collections", "bs58", @@ -13593,7 +13688,7 @@ dependencies = [ "proc-macro2", "quote", "sp-core-hashing", - "syn 2.0.22", + "syn 2.0.29", ] [[package]] @@ -13621,7 +13716,7 @@ source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#f dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.29", ] [[package]] @@ -13707,7 +13802,7 @@ version = "4.1.0-dev" source = "git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.42#ff24c60ac7d9f87727ecdd0ded9a80c56e4f4b65" dependencies = [ "thiserror", - "zstd 0.12.3+zstd.1.5.2", + "zstd 0.12.4", ] [[package]] @@ -13832,7 +13927,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.29", ] [[package]] @@ -14000,7 +14095,7 @@ dependencies = [ "parity-scale-codec", "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.29", ] [[package]] @@ -14081,7 +14176,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" dependencies = [ "base64ct", - "der 0.7.6", + "der 0.7.8", ] [[package]] @@ -14207,9 +14302,9 @@ dependencies = [ [[package]] name = "ss58-registry" -version = "1.40.0" +version = "1.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb47a8ad42e5fc72d5b1eb104a5546937eaf39843499948bb666d6e93c62423b" +checksum = "5e6915280e2d0db8911e5032a5c275571af6bdded2916abd691a659be25d3439" dependencies = [ "Inflector", "num-format", @@ -14274,7 +14369,7 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a2a1c578e98c1c16fc3b8ec1328f7659a500737d7a0c6d625e73e830ff9c1f6" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cfg_aliases", "libc", "parking_lot 0.11.2", @@ -14452,7 +14547,7 @@ dependencies = [ "sp-maybe-compressed-blob", "strum", "tempfile", - "toml 0.7.5", + "toml 0.7.6", "walkdir", "wasm-opt", ] @@ -14506,9 +14601,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.22" +version = "2.0.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2efbeae7acf4eabd6bcdcbd11c92f45231ddda7539edc7806bd1a04a03b24616" +checksum = "c324c494eba9d92503e6f1ef2e6df781e78f6a7705a0202d9801b198807d518a" dependencies = [ "proc-macro2", "quote", @@ -14533,7 +14628,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" dependencies = [ - "bitflags", + "bitflags 1.3.2", "core-foundation", "system-configuration-sys", ] @@ -14556,21 +14651,20 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "target-lexicon" -version = "0.12.8" +version = "0.12.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1c7f239eb94671427157bd93b3694320f3668d4e1eff08c7285366fd777fac" +checksum = "9d0e916b1148c8e263850e1ebcbd046f333e0683c724876bb0da63ea4373dc8a" [[package]] name = "tempfile" -version = "3.6.0" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6" +checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" dependencies = [ - "autocfg 1.1.0", "cfg-if", - "fastrand", + "fastrand 2.0.0", "redox_syscall 0.3.5", - "rustix 0.37.20", + "rustix 0.38.8", "windows-sys 0.48.0", ] @@ -14591,22 +14685,22 @@ checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" [[package]] name = "thiserror" -version = "1.0.40" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +checksum = "97a802ec30afc17eee47b2855fc72e0c4cd62be9b4efe6591edde0ec5bd68d8f" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.40" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +checksum = "6bb623b56e39ab7dcd4b1b98bb6c8f8d907ed255b18de254088016b27a8ee19b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.29", ] [[package]] @@ -14649,9 +14743,9 @@ dependencies = [ [[package]] name = "tikv-jemalloc-ctl" -version = "0.5.0" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e37706572f4b151dff7a0146e040804e9c26fe3a3118591112f05cf12a4216c1" +checksum = "619bfed27d807b54f7f776b9430d4f8060e66ee138a28632ca898584d462c31c" dependencies = [ "libc", "paste", @@ -14660,9 +14754,9 @@ dependencies = [ [[package]] name = "tikv-jemalloc-sys" -version = "0.5.3+5.3.0-patched" +version = "0.5.4+5.3.0-patched" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a678df20055b43e57ef8cddde41cdfda9a3c1a060b67f4c5836dfb1d78543ba8" +checksum = "9402443cb8fd499b6f327e40565234ff34dbda27460c5b47db0db77443dd85d1" dependencies = [ "cc", "libc", @@ -14681,10 +14775,11 @@ dependencies = [ [[package]] name = "time" -version = "0.3.22" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea9e1b3cf1243ae005d9e74085d4d542f3125458f3a81af210d901dcd7411efd" +checksum = "0bb39ee79a6d8de55f48f2293a830e040392f1c5f16e336bdd1788cd0aadce07" dependencies = [ + "deranged", "itoa", "serde", "time-core", @@ -14699,9 +14794,9 @@ checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" [[package]] name = "time-macros" -version = "0.2.9" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "372950940a5f07bf38dbe211d7283c9e6d7327df53794992d293e534c733d09b" +checksum = "733d258752e9303d392b94b75230d07b0b9c489350c69b851fc6c065fde3e8f9" dependencies = [ "time-core", ] @@ -14761,20 +14856,19 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.29.0" +version = "1.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374442f06ee49c3a28a8fc9f01a2596fed7559c6b99b31279c3261778e77d84f" +checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" dependencies = [ - "autocfg 1.1.0", "backtrace", "bytes", "libc", "mio", "num_cpus", "parking_lot 0.12.1", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.12", "signal-hook-registry", - "socket2 0.4.9", + "socket2 0.5.3", "tokio-macros", "windows-sys 0.48.0", ] @@ -14787,7 +14881,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.29", ] [[package]] @@ -14808,7 +14902,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" dependencies = [ "futures-core", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.12", "tokio", "tokio-util", ] @@ -14823,7 +14917,7 @@ dependencies = [ "futures-core", "futures-io", "futures-sink", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.12", "tokio", "tracing", ] @@ -14839,9 +14933,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.7.5" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ebafdf5ad1220cb59e7d17cf4d2c72015297b75b19a10472f99b89225089240" +checksum = "c17e963a819c331dcacd7ab957d80bc2b9a9c1e71c804826d2f283dd65306542" dependencies = [ "serde", "serde_spanned", @@ -14860,9 +14954,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.19.11" +version = "0.19.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266f016b7f039eec8a1a80dfe6156b633d208b9fccca5e4db1d6775b0c4e34a7" +checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" dependencies = [ "indexmap 2.0.0", "serde", @@ -14888,14 +14982,14 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f873044bf02dd1e8239e9c1293ea39dad76dc594ec16185d0a1bf31d8dc8d858" dependencies = [ - "bitflags", + "bitflags 1.3.2", "bytes", "futures-core", "futures-util", "http", "http-body", "http-range-header", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.12", "tower-layer", "tower-service", ] @@ -14920,7 +15014,7 @@ checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ "cfg-if", "log", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.12", "tracing-attributes", "tracing-core", ] @@ -14933,7 +15027,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.29", ] [[package]] @@ -14976,7 +15070,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.29", ] [[package]] @@ -15161,7 +15255,7 @@ dependencies = [ "sp-version", "sp-weights", "substrate-rpc-client", - "zstd 0.12.3+zstd.1.5.2", + "zstd 0.12.4", ] [[package]] @@ -15227,9 +15321,9 @@ checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" [[package]] name = "ucd-trie" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" +checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" [[package]] name = "uint" @@ -15257,9 +15351,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" +checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" [[package]] name = "unicode-normalization" @@ -15351,9 +15445,9 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "uuid" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d023da39d1fde5a8a3fe1f3e01ca9632ada0a63e9797de55a879d6e2236277be" +checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" dependencies = [ "getrandom 0.2.10", ] @@ -15368,7 +15462,7 @@ checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" name = "vault-registry" version = "1.2.0" dependencies = [ - "bitcoin", + "bitcoin 1.2.0", "currency", "fee", "fixed-hash 0.7.0", @@ -15534,7 +15628,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.29", "wasm-bindgen-shared", ] @@ -15568,7 +15662,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.29", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -15698,7 +15792,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57d20cb3c59b788653d99541c646c561c9dd26506f25c0cebfe810659c54c6d7" dependencies = [ "downcast-rs", - "libm 0.2.7", + "libm", "memory_units", "num-rational", "num-traits", @@ -15712,7 +15806,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624e6333e861ef49095d2d678b76ebf30b06bf37effca845be7e5b87c90071b7" dependencies = [ "downcast-rs", - "libm 0.2.7", + "libm", "num-traits", "paste", ] @@ -15785,7 +15879,7 @@ dependencies = [ "directories-next", "file-per-thread-logger", "log", - "rustix 0.36.14", + "rustix 0.36.15", "serde", "sha2 0.10.7", "toml 0.5.11", @@ -15865,7 +15959,7 @@ checksum = "eed41cbcbf74ce3ff6f1d07d1b707888166dc408d1a880f651268f4f7c9194b2" dependencies = [ "object 0.29.0", "once_cell", - "rustix 0.36.14", + "rustix 0.36.15", ] [[package]] @@ -15896,7 +15990,7 @@ dependencies = [ "memoffset 0.6.5", "paste", "rand 0.8.5", - "rustix 0.36.14", + "rustix 0.36.15", "wasmtime-asm-macros", "wasmtime-environ", "wasmtime-jit-debug", @@ -15980,7 +16074,7 @@ dependencies = [ "sha2 0.10.7", "stun", "thiserror", - "time 0.3.22", + "time 0.3.27", "tokio", "turn", "url", @@ -16012,9 +16106,9 @@ dependencies = [ [[package]] name = "webrtc-dtls" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942be5bd85f072c3128396f6e5a9bfb93ca8c1939ded735d177b7bcba9a13d05" +checksum = "c4a00f4242f2db33307347bd5be53263c52a0331c96c14292118c9a6bb48d267" dependencies = [ "aes 0.6.0", "aes-gcm 0.10.2", @@ -16029,12 +16123,11 @@ dependencies = [ "hkdf", "hmac 0.12.1", "log", - "oid-registry 0.6.1", "p256", "p384", "rand 0.8.5", "rand_core 0.6.4", - "rcgen 0.9.3", + "rcgen 0.10.0", "ring", "rustls 0.19.1", "sec1 0.3.0", @@ -16047,7 +16140,7 @@ dependencies = [ "tokio", "webpki 0.21.4", "webrtc-util", - "x25519-dalek 2.0.0-pre.1", + "x25519-dalek 2.0.0", "x509-parser 0.13.2", ] @@ -16149,7 +16242,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93f1db1727772c05cf7a2cfece52c3aca8045ca1e176cd517d323489aa3c6d87" dependencies = [ "async-trait", - "bitflags", + "bitflags 1.3.2", "bytes", "cc", "ipnet", @@ -16282,9 +16375,9 @@ dependencies = [ [[package]] name = "wide" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40018623e2dba2602a9790faba8d33f2ebdebf4b86561b83928db735f8784728" +checksum = "aa469ffa65ef7e0ba0f164183697b89b854253fd31aeb92358b7b6155177d62f" dependencies = [ "bytemuck", "safe_arch", @@ -16346,7 +16439,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "windows-targets 0.48.0", + "windows-targets 0.48.5", ] [[package]] @@ -16379,7 +16472,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.0", + "windows-targets 0.48.5", ] [[package]] @@ -16399,17 +16492,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] @@ -16420,9 +16513,9 @@ checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_msvc" @@ -16438,9 +16531,9 @@ checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_i686_gnu" @@ -16456,9 +16549,9 @@ checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_msvc" @@ -16474,9 +16567,9 @@ checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_x86_64_gnu" @@ -16492,9 +16585,9 @@ checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnullvm" @@ -16504,9 +16597,9 @@ checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_msvc" @@ -16522,15 +16615,15 @@ checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winnow" -version = "0.4.7" +version = "0.5.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca0ace3845f0d96209f0375e6d367e3eb87eb65d27d445bdc9f1843a26f39448" +checksum = "d09770118a7eb1ccaf4a594a221334119a44a814fcb0d31c5b85e83e97227a97" dependencies = [ "memchr", ] @@ -16567,12 +16660,13 @@ dependencies = [ [[package]] name = "x25519-dalek" -version = "2.0.0-pre.1" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5da623d8af10a62342bcbbb230e33e58a63255a58012f8653c578e54bab48df" +checksum = "fb66477291e7e8d2b0ff1bcb900bf29489a9692816d79874bea351e7a8b6de96" dependencies = [ - "curve25519-dalek 3.2.0", + "curve25519-dalek 4.0.0", "rand_core 0.6.4", + "serde", "zeroize", ] @@ -16592,7 +16686,7 @@ dependencies = [ "ring", "rusticata-macros", "thiserror", - "time 0.3.22", + "time 0.3.27", ] [[package]] @@ -16610,7 +16704,7 @@ dependencies = [ "oid-registry 0.6.1", "rusticata-macros", "thiserror", - "time 0.3.22", + "time 0.3.27", ] [[package]] @@ -16704,7 +16798,7 @@ dependencies = [ "Inflector", "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.29", ] [[package]] @@ -16744,7 +16838,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd" dependencies = [ - "time 0.3.22", + "time 0.3.27", ] [[package]] @@ -16764,7 +16858,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.29", ] [[package]] @@ -16778,11 +16872,11 @@ dependencies = [ [[package]] name = "zstd" -version = "0.12.3+zstd.1.5.2" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76eea132fb024e0e13fd9c2f5d5d595d8a967aa72382ac2f9d39fcc95afd0806" +checksum = "1a27595e173641171fc74a1232b7b1c7a7cb6e18222c11e9dfb9888fa424c53c" dependencies = [ - "zstd-safe 6.0.5+zstd.1.5.4", + "zstd-safe 6.0.6", ] [[package]] @@ -16797,9 +16891,9 @@ dependencies = [ [[package]] name = "zstd-safe" -version = "6.0.5+zstd.1.5.4" +version = "6.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d56d9e60b4b1758206c238a10165fbcae3ca37b01744e394c463463f6529d23b" +checksum = "ee98ffd0b48ee95e6c5168188e44a54550b1564d9d530ee21d5f0eaed1069581" dependencies = [ "libc", "zstd-sys", diff --git a/crates/bitcoin/Cargo.toml b/crates/bitcoin/Cargo.toml index da310e6bc8..24ead977cc 100644 --- a/crates/bitcoin/Cargo.toml +++ b/crates/bitcoin/Cargo.toml @@ -15,6 +15,7 @@ spin = { version = "0.7.1", default-features = false } primitive-types = { version = "0.12.1", default-features = false, features = ["codec", "scale-info"] } bitcoin_hashes = { version = "0.7.3", default-features = false } secp256k1 = { package = "secp256k1", git = "https://github.com/rust-bitcoin/rust-secp256k1", rev = "8e61874", default-features = false } +rust-bitcoin = { package = "bitcoin", version = "0.30.1", default-features = false, features = ["no-std"], optional = true } [dev-dependencies] mocktopus = "0.8.0" @@ -33,9 +34,11 @@ std = [ "primitive-types/std", "primitive-types/serde", "secp256k1/std", + "rust-bitcoin?/std" ] parser = [] runtime-benchmarks = [] +bitcoin-types-compat = ["rust-bitcoin", "parser"] [[example]] name = "parse-transaction" diff --git a/crates/bitcoin/src/compat.rs b/crates/bitcoin/src/compat.rs new file mode 100644 index 0000000000..940229e3f5 --- /dev/null +++ b/crates/bitcoin/src/compat.rs @@ -0,0 +1,119 @@ +//! Provides conversions between rust-bitcoin and interbtc types. +//! Please note that these operations involve (unbounded) re-encoding +//! and decoding so may be expensive to use. + +use crate::{formatter::TryFormat, parser::Parsable}; +use rust_bitcoin::consensus::{Decodable, Encodable}; + +pub use rust_bitcoin; + +#[cfg(not(feature = "std"))] +use alloc::vec::Vec; + +#[derive(Debug)] +pub enum ConversionError { + ParsingError, + FormattingError, +} + +/// Macro to implement type conversion from interbtc types to rust-bitcoin, using consensus encoding +macro_rules! impl_bitcoin_conversion { + ($a:path, $b:path) => { + impl TryFrom<$a> for $b { + type Error = ConversionError; + fn try_from(value: $a) -> Result { + let mut bytes = Vec::::new(); + value + .try_format(&mut bytes) + .map_err(|_| ConversionError::FormattingError)?; + let result = Self::consensus_decode_from_finite_reader(&mut &bytes[..]) + .map_err(|_| ConversionError::ParsingError)?; + Ok(result) + } + } + }; +} + +/// Macro to implement type conversion to interbtc types from rust-bitcoin, using consensus encoding +macro_rules! impl_interbtc_conversion { + ($a:path, $b:path) => { + impl TryFrom<$b> for $a { + type Error = ConversionError; + fn try_from(value: $b) -> Result { + let mut data: Vec = Vec::new(); + value + .consensus_encode(&mut data) + .map_err(|_| ConversionError::FormattingError)?; + let result = Self::parse(&data, 0).map_err(|_| ConversionError::ParsingError)?; + Ok(result.0) + } + } + }; +} + +macro_rules! impl_bidirectional_conversions { + ($a:path, $b:path) => { + impl_bitcoin_conversion!($a, $b); + impl_interbtc_conversion!($a, $b); + }; +} + +// NOTE: rust_bitcoin::Script exists but we can't convert to that because it's unsized +impl_bitcoin_conversion!(crate::Script, rust_bitcoin::ScriptBuf); + +// Transaction conversions +impl_bidirectional_conversions!(crate::types::Transaction, rust_bitcoin::Transaction); + +// Payload -> Address +impl TryFrom for crate::Address { + type Error = ConversionError; + fn try_from(value: rust_bitcoin::address::Payload) -> Result { + let bitcoin_script = value.script_pubkey(); + let bitcoin_script_bytes = bitcoin_script.to_bytes(); + let interlay_script = crate::Script::from(bitcoin_script_bytes); + crate::Address::from_script_pub_key(&interlay_script).map_err(|_| ConversionError::ParsingError) + } +} + +// Address -> Payload +impl TryFrom for rust_bitcoin::address::Payload { + type Error = ConversionError; + fn try_from(value: crate::Address) -> Result { + let interlay_script = value.to_script_pub_key(); + let bitcoin_script = rust_bitcoin::blockdata::script::Script::from_bytes(interlay_script.as_bytes()); + rust_bitcoin::address::Payload::from_script(&bitcoin_script).map_err(|_| ConversionError::ParsingError) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::parser::parse_transaction; + + #[test] + fn test_transaction_compat() { + // txid eb3db053cd139147f2fd676cf59a491fd5aebc54bddfde829704585b659126fc + let raw_tx = "0100000000010120e6fb8f0e2cfb8667a140a92d045d5db7c1b56635790bc907c3e71d43720a150e00000017160014641e441c2ba32dd7cf05afde7922144dd106b09bffffffff019dbd54000000000017a914bd847a4912984cf6152547feca51c1b9c2bcbe2787024830450221008f00033064c26cfca4dc98e5dba800b18729c3441dca37b49358ae0df9be7fad02202a81085318466ea66ef390d5dab6737e44a05f7f2e747932ebba917e0098f37d012102c109fc47335c3a2e206d462ad52590b1842aa9d6e0eb9c683c896fa8723590b400000000"; + let tx_bytes = hex::decode(&raw_tx).unwrap(); + let interlay_transaction = parse_transaction(&tx_bytes).unwrap(); + + let rust_bitcoin_transaction: rust_bitcoin::Transaction = interlay_transaction.clone().try_into().unwrap(); + + // check that the rust-bitcoin type encodes to the same bytes + let mut re_encoded_bytes: Vec = Vec::new(); + rust_bitcoin_transaction + .consensus_encode(&mut re_encoded_bytes) + .unwrap(); + assert_eq!(tx_bytes, re_encoded_bytes); + + // check that the conversion back works + assert_eq!(interlay_transaction, rust_bitcoin_transaction.try_into().unwrap()); + } + + #[test] + fn test_address_compat() { + let interbtc_address = crate::Address::P2WPKHv0(primitive_types::H160([1; 20])); + let rust_bitcoin_address: rust_bitcoin::address::Payload = interbtc_address.clone().try_into().unwrap(); + assert_eq!(interbtc_address, rust_bitcoin_address.try_into().unwrap()); + } +} diff --git a/crates/bitcoin/src/lib.rs b/crates/bitcoin/src/lib.rs index 90115bcd7d..e0b8a3b79a 100644 --- a/crates/bitcoin/src/lib.rs +++ b/crates/bitcoin/src/lib.rs @@ -45,6 +45,9 @@ pub mod formatter; #[cfg(any(feature = "parser", test))] pub mod parser; +#[cfg(feature = "bitcoin-types-compat")] +pub mod compat; + pub mod utils; pub mod pow; diff --git a/crates/bitcoin/src/parser.rs b/crates/bitcoin/src/parser.rs index f57345eda2..4fd031e8c0 100644 --- a/crates/bitcoin/src/parser.rs +++ b/crates/bitcoin/src/parser.rs @@ -110,6 +110,68 @@ impl Parsable for Vec { } } +impl Parsable for Transaction { + fn parse(raw_bytes: &[u8], position: usize) -> Result<(Transaction, usize), Error> { + let slice = raw_bytes.get(position..).ok_or(Error::EndOfFile)?; + let mut parser = BytesParser::new(slice); + let version: i32 = parser.parse()?; + + // fail if incorrect version: we only support version 1 and 2 + if version != 1 && version != 2 { + return Err(Error::MalformedTransaction); + } + + let allow_witness = (version & SERIALIZE_TRANSACTION_NO_WITNESS) == 0; + + // TODO: bound maximum? + let mut inputs: Vec = parser.parse_with(version)?; + + let mut flags: u8 = 0; + if inputs.is_empty() && allow_witness { + flags = parser.parse()?; + inputs = parser.parse_with(version)?; + } + + // TODO: bound maximum? + let outputs: Vec = parser.parse()?; + + if (flags & 1) != 0 && allow_witness { + flags ^= 1; + for input in &mut inputs { + input.with_witness(parser.parse()?); + } + + if inputs.iter().all(|input| input.witness.is_empty()) { + // A transaction with a set witness-flag must actually include witnesses in the transaction. + // see https://github.com/bitcoin/bitcoin/blob/be4171679b8eab8205e04ff86140329bd67878a0/src/primitives/transaction.h#L214-L217 + return Err(Error::MalformedTransaction); + } + } + + // https://en.bitcoin.it/wiki/NLockTime + let locktime_or_blockheight: u32 = parser.parse()?; + let lock_at = if locktime_or_blockheight < LOCKTIME_THRESHOLD { + LockTime::BlockHeight(locktime_or_blockheight) + } else { + LockTime::Time(locktime_or_blockheight) + }; + + if flags != 0 { + return Err(Error::MalformedTransaction); + } + + Ok(( + Transaction { + version, + inputs, + outputs, + lock_at, + }, + parser.position, + )) + } +} + impl ParsableMeta for TransactionInput { fn parse_with(raw_bytes: &[u8], position: usize, version: i32) -> Result<(TransactionInput, usize), Error> { let slice = raw_bytes.get(position..).ok_or(Error::EndOfFile)?; @@ -270,59 +332,7 @@ pub fn parse_compact_uint(varint: &[u8]) -> Result<(u64, usize), Error> { /// /// * `raw_transaction` - the raw bytes of the transaction pub fn parse_transaction(raw_transaction: &[u8]) -> Result { - let mut parser = BytesParser::new(raw_transaction); - let version: i32 = parser.parse()?; - - // fail if incorrect version: we only support version 1 and 2 - if version != 1 && version != 2 { - return Err(Error::MalformedTransaction); - } - - let allow_witness = (version & SERIALIZE_TRANSACTION_NO_WITNESS) == 0; - - // TODO: bound maximum? - let mut inputs: Vec = parser.parse_with(version)?; - - let mut flags: u8 = 0; - if inputs.is_empty() && allow_witness { - flags = parser.parse()?; - inputs = parser.parse_with(version)?; - } - - // TODO: bound maximum? - let outputs: Vec = parser.parse()?; - - if (flags & 1) != 0 && allow_witness { - flags ^= 1; - for input in &mut inputs { - input.with_witness(parser.parse()?); - } - - if inputs.iter().all(|input| input.witness.is_empty()) { - // A transaction with a set witness-flag must actually include witnesses in the transaction. - // see https://github.com/bitcoin/bitcoin/blob/be4171679b8eab8205e04ff86140329bd67878a0/src/primitives/transaction.h#L214-L217 - return Err(Error::MalformedTransaction); - } - } - - // https://en.bitcoin.it/wiki/NLockTime - let locktime_or_blockheight: u32 = parser.parse()?; - let lock_at = if locktime_or_blockheight < LOCKTIME_THRESHOLD { - LockTime::BlockHeight(locktime_or_blockheight) - } else { - LockTime::Time(locktime_or_blockheight) - }; - - if flags != 0 { - return Err(Error::MalformedTransaction); - } - - Ok(Transaction { - version, - inputs, - outputs, - lock_at, - }) + Transaction::parse(raw_transaction, 0).map(|(tx, _len)| tx) } /// Parses a transaction input diff --git a/crates/bitcoin/src/script.rs b/crates/bitcoin/src/script.rs index 6fc9510323..6e1d3adb08 100644 --- a/crates/bitcoin/src/script.rs +++ b/crates/bitcoin/src/script.rs @@ -42,6 +42,15 @@ impl Script { } } + // If the most significant byte is >= 0x80 and the value is positive, push a + // new zero-byte to make the significant byte < 0x80 again. + // See https://github.com/bitcoin/bitcoin/blob/b565485c24c0feacae559a7f6f7b83d7516ca58d/src/script/script.h#L360-L373 + if let Some(x) = height_bytes.last() { + if (x & 0x80) != 0 { + height_bytes.push(0); + } + } + // note: formatting the height_bytes vec automatically prepends the length of the vec, so no need // to append it manually script.append(height_bytes); @@ -147,6 +156,16 @@ impl std::convert::TryFrom<&str> for Script { #[test] fn test_script_height() { assert_eq!(Script::height(7).bytes, vec![1, 7]); + // 2^7 boundary + assert_eq!(Script::height(127).bytes, vec![1, 127]); + assert_eq!(Script::height(128).bytes, vec![2, 128, 0]); + // 2^8 boundary + assert_eq!(Script::height(255).bytes, vec![2, 0xff, 0x00]); assert_eq!(Script::height(256).bytes, vec![2, 0x00, 0x01]); + // 2^15 boundary + assert_eq!(Script::height(32767).bytes, vec![2, 0xff, 0x7f]); + assert_eq!(Script::height(32768).bytes, vec![3, 0x00, 0x80, 0x00]); + // 2^16 boundary + assert_eq!(Script::height(65535).bytes, vec![3, 0xff, 0xff, 0x00]); assert_eq!(Script::height(65536).bytes, vec![3, 0x00, 0x00, 0x01]); } diff --git a/crates/issue/src/benchmarking.rs b/crates/issue/src/benchmarking.rs index db7c0cdd4f..21101b317a 100644 --- a/crates/issue/src/benchmarking.rs +++ b/crates/issue/src/benchmarking.rs @@ -27,16 +27,16 @@ fn mint_collateral(account_id: &T::AccountId, amount: BalanceO deposit_tokens::(get_native_currency_id::(), account_id, amount); } -fn get_vault_id() -> DefaultVaultId { +fn get_vault_id(name: &'static str) -> DefaultVaultId { VaultId::new( - account("Vault", 0, 0), + account(name, 0, 0), get_collateral_currency_id::(), get_wrapped_currency_id::(), ) } fn setup_chain() { - let dummy_vault = get_vault_id::(); + let dummy_vault = get_vault_id::("Vault"); Oracle::::_set_exchange_rate( get_native_currency_id::(), // for griefing collateral @@ -114,9 +114,11 @@ fn setup_issue( vin: u32, vout: u32, tx_size: u32, + setup_as_replace: bool, ) -> ChainState { let origin: T::AccountId = account("Origin", 0, 0); - let vault_id = get_vault_id::(); + let new_vault_id = get_vault_id::("Vault"); + let old_vault_id = get_vault_id::("OldVault"); let relayer_id: T::AccountId = account("Relayer", 0, 0); mint_collateral::(&origin, (1u32 << 31).into()); @@ -128,8 +130,12 @@ fn setup_issue( let issue_id = H256::zero(); let issue_request = IssueRequest { - requester: AccountOrVault::Account(origin.clone()), - vault: vault_id.clone(), + requester: if setup_as_replace { + AccountOrVault::Vault(old_vault_id.clone()) + } else { + AccountOrVault::Account(origin.clone()) + }, + vault: new_vault_id.clone(), btc_address: vault_btc_address, amount: value.amount(), btc_height: Default::default(), @@ -159,11 +165,14 @@ fn setup_issue( let transaction = BtcRelay::::initialize_and_store_max(relayer_id.clone(), hashes, vin, outputs, tx_size as usize); - register_vault::(vault_id.clone()); + register_vault::(new_vault_id.clone()); + register_vault::(old_vault_id.clone()); + + VaultRegistry::::try_increase_to_be_issued_tokens(&new_vault_id, &value).unwrap(); + VaultRegistry::::try_increase_to_be_issued_tokens(&old_vault_id, &value).unwrap(); - VaultRegistry::::try_increase_to_be_issued_tokens(&vault_id, &value).unwrap(); - let secure_id = Security::::get_secure_id(&vault_id.account_id); - VaultRegistry::::register_deposit_address(&vault_id, secure_id).unwrap(); + let secure_id = Security::::get_secure_id(&new_vault_id.account_id); + VaultRegistry::::register_deposit_address(&new_vault_id, secure_id).unwrap(); ChainState { issue_id, @@ -180,7 +189,7 @@ pub mod benchmarks { fn request_issue() { let origin: T::AccountId = account("Origin", 0, 0); let amount = Issue::::issue_btc_dust_value(get_wrapped_currency_id::()).amount() + 1000u32.into(); - let vault_id = get_vault_id::(); + let vault_id = get_vault_id::("Vault"); let relayer_id: T::AccountId = account("Relayer", 0, 0); mint_collateral::(&origin, (1u32 << 31).into()); @@ -216,7 +225,7 @@ pub mod benchmarks { #[benchmark] fn execute_issue_exact(h: Linear<2, 10>, i: Linear<1, 10>, o: Linear<1, 10>, b: Linear<770, 2_048>) { let origin: T::AccountId = account("Origin", 0, 0); - let issue_data = setup_issue::(PaymentType::Exact, h, i, o, b); + let issue_data = setup_issue::(PaymentType::Exact, h, i, o, b, false); #[extrinsic_call] execute_issue(RawOrigin::Signed(origin), issue_data.issue_id, issue_data.transaction); @@ -225,7 +234,7 @@ pub mod benchmarks { #[benchmark] fn execute_issue_overpayment(h: Linear<2, 10>, i: Linear<1, 10>, o: Linear<1, 10>, b: Linear<770, 2_048>) { let origin: T::AccountId = account("Origin", 0, 0); - let issue_data = setup_issue::(PaymentType::Overpayment, h, i, o, b); + let issue_data = setup_issue::(PaymentType::Overpayment, h, i, o, b, false); #[extrinsic_call] execute_issue(RawOrigin::Signed(origin), issue_data.issue_id, issue_data.transaction); @@ -234,7 +243,7 @@ pub mod benchmarks { #[benchmark] fn execute_issue_underpayment(h: Linear<2, 10>, i: Linear<1, 10>, o: Linear<1, 10>, b: Linear<770, 2_048>) { let origin: T::AccountId = account("Origin", 0, 0); - let issue_data = setup_issue::(PaymentType::Underpayment, h, i, o, b); + let issue_data = setup_issue::(PaymentType::Underpayment, h, i, o, b, false); #[extrinsic_call] execute_issue(RawOrigin::Signed(origin), issue_data.issue_id, issue_data.transaction); @@ -243,7 +252,7 @@ pub mod benchmarks { #[benchmark] fn execute_expired_issue_exact(h: Linear<2, 10>, i: Linear<1, 10>, o: Linear<1, 10>, b: Linear<770, 2_048>) { let origin: T::AccountId = account("Origin", 0, 0); - let issue_data = setup_issue::(PaymentType::Exact, h, i, o, b); + let issue_data = setup_issue::(PaymentType::Exact, h, i, o, b, false); expire_issue::(&issue_data); #[extrinsic_call] @@ -253,7 +262,7 @@ pub mod benchmarks { #[benchmark] fn execute_expired_issue_overpayment(h: Linear<2, 10>, i: Linear<1, 10>, o: Linear<1, 10>, b: Linear<770, 2_048>) { let origin: T::AccountId = account("Origin", 0, 0); - let issue_data = setup_issue::(PaymentType::Overpayment, h, i, o, b); + let issue_data = setup_issue::(PaymentType::Overpayment, h, i, o, b, false); expire_issue::(&issue_data); #[extrinsic_call] @@ -263,7 +272,7 @@ pub mod benchmarks { #[benchmark] fn execute_expired_issue_underpayment(h: Linear<2, 10>, i: Linear<1, 10>, o: Linear<1, 10>, b: Linear<770, 2_048>) { let origin: T::AccountId = account("Origin", 0, 0); - let issue_data = setup_issue::(PaymentType::Underpayment, h, i, o, b); + let issue_data = setup_issue::(PaymentType::Underpayment, h, i, o, b, false); expire_issue::(&issue_data); #[extrinsic_call] @@ -274,7 +283,18 @@ pub mod benchmarks { fn cancel_issue() { let origin: T::AccountId = account("Origin", 0, 0); - let issue_data = setup_issue::(PaymentType::Exact, 2, 2, 2, 770); + let issue_data = setup_issue::(PaymentType::Exact, 2, 2, 2, 770, false); + expire_issue::(&issue_data); + + #[extrinsic_call] + cancel_issue(RawOrigin::Signed(origin), issue_data.issue_id); + } + + #[benchmark] + fn cancel_issue_for_replace() { + let origin: T::AccountId = account("Origin", 0, 0); + + let issue_data = setup_issue::(PaymentType::Exact, 2, 2, 2, 770, true); expire_issue::(&issue_data); #[extrinsic_call] diff --git a/crates/issue/src/default_weights.rs b/crates/issue/src/default_weights.rs index 54ef62854f..fb590f3517 100644 --- a/crates/issue/src/default_weights.rs +++ b/crates/issue/src/default_weights.rs @@ -2,31 +2,32 @@ //! Autogenerated weights for issue //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-03, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-29, STEPS: `2`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `enterprise`, CPU: `Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz` +//! HOSTNAME: `Nakuls-MacBook-Pro.local`, CPU: `` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 // Executed Command: -// target/release/interbtc-parachain +// ./target/release/interbtc-parachain // benchmark // pallet // --pallet // issue // --extrinsic // * -// --chain -// kintsugi-dev // --execution=wasm // --wasm-execution=compiled // --steps -// 50 +// 2 // --repeat -// 20 -// --output -// crates/issue/src/default_weights.rs +// 1 // --template -// .deploy/default-weight-template.hbs +// .deploy/runtime-weight-template.hbs +// --chain +// kintsugi-dev +// --output +// generated_weight_kintsugi.rs + #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -46,11 +47,13 @@ pub trait WeightInfo { fn execute_expired_issue_underpayment(h: u32, i: u32, o: u32, b: u32, ) -> Weight; fn cancel_issue() -> Weight; fn set_issue_period() -> Weight; + fn cancel_issue_for_replace() -> Weight; } /// Weights for issue using the Substrate node and recommended hardware. pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { + /// Storage: BTCRelay StartBlockHeight (r:1 w:0) /// Proof: BTCRelay StartBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: BTCRelay StableBitcoinConfirmations (r:1 w:0) @@ -58,15 +61,15 @@ impl WeightInfo for SubstrateWeight { /// Storage: BTCRelay BestBlockHeight (r:1 w:0) /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: Oracle Aggregate (r:2 w:0) /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) /// Storage: Fee IssueGriefingCollateral (r:1 w:0) /// Proof: Fee IssueGriefingCollateral (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:1 w:1) /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: Fee IssueFee (r:1 w:0) + /// Proof: Fee IssueFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: Issue IssueBtcDustValue (r:1 w:0) /// Proof: Issue IssueBtcDustValue (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) @@ -75,8 +78,6 @@ impl WeightInfo for SubstrateWeight { /// Proof: VaultStaking Nonce (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) /// Storage: VaultStaking TotalCurrentStake (r:1 w:0) /// Proof: VaultStaking TotalCurrentStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: Fee IssueFee (r:1 w:0) - /// Proof: Fee IssueFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: Security Nonce (r:1 w:1) /// Proof: Security Nonce (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) /// Storage: System ParentHash (r:1 w:0) @@ -88,18 +89,18 @@ impl WeightInfo for SubstrateWeight { /// Storage: Issue IssuePeriod (r:1 w:0) /// Proof: Issue IssuePeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: Issue IssueRequests (r:0 w:1) - /// Proof: Issue IssueRequests (max_values: None, max_size: Some(261), added: 2736, mode: MaxEncodedLen) - fn request_issue() -> Weight { + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) + fn request_issue () -> Weight { // Proof Size summary in bytes: - // Measured: `3572` - // Estimated: `26156` - // Minimum execution time: 450_294_000 picoseconds. - Weight::from_parts(452_439_000, 26156) - .saturating_add(T::DbWeight::get().reads(19_u64)) + // Measured: `2690` + // Estimated: `6028` + // Minimum execution time: 38_621_000_000 picoseconds. + Weight::from_parts(38_621_000_000, 6028) + .saturating_add(T::DbWeight::get().reads(18_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } /// Storage: Issue IssueRequests (r:1 w:1) - /// Proof: Issue IssueRequests (max_values: None, max_size: Some(261), added: 2736, mode: MaxEncodedLen) + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) /// Storage: BTCRelay DisableInclusionCheck (r:1 w:0) /// Proof: BTCRelay DisableInclusionCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: BTCRelay BestBlockHeight (r:1 w:0) @@ -115,7 +116,7 @@ impl WeightInfo for SubstrateWeight { /// Storage: BTCRelay StableParachainConfirmations (r:1 w:0) /// Proof: BTCRelay StableParachainConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:1 w:1) /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) /// Storage: Tokens TotalIssuance (r:1 w:1) @@ -126,25 +127,21 @@ impl WeightInfo for SubstrateWeight { /// The range of component `i` is `[1, 10]`. /// The range of component `o` is `[1, 10]`. /// The range of component `b` is `[770, 2048]`. - fn execute_issue_exact(h: u32, i: u32, o: u32, b: u32, ) -> Weight { + fn execute_issue_exact (_h: u32, i: u32, o: u32, _b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `3435` - // Estimated: `20840` - // Minimum execution time: 142_775_000 picoseconds. - Weight::from_parts(117_261_202, 20840) - // Standard Error: 45_583 - .saturating_add(Weight::from_parts(1_682_032, 0).saturating_mul(h.into())) - // Standard Error: 41_054 - .saturating_add(Weight::from_parts(684_847, 0).saturating_mul(i.into())) - // Standard Error: 41_054 - .saturating_add(Weight::from_parts(287_609, 0).saturating_mul(o.into())) - // Standard Error: 308 - .saturating_add(Weight::from_parts(7_184, 0).saturating_mul(b.into())) + // Measured: `2448` + // Estimated: `3760` + // Minimum execution time: 206_000_000 picoseconds. + Weight::from_parts(261_839_397, 3760) + // Standard Error: 96_225 + .saturating_add(Weight::from_parts(277_777, 0).saturating_mul(i.into())) + // Standard Error: 96_225 + .saturating_add(Weight::from_parts(166_666, 0).saturating_mul(o.into())) .saturating_add(T::DbWeight::get().reads(12_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } /// Storage: Issue IssueRequests (r:1 w:1) - /// Proof: Issue IssueRequests (max_values: None, max_size: Some(261), added: 2736, mode: MaxEncodedLen) + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) /// Storage: BTCRelay DisableInclusionCheck (r:1 w:0) /// Proof: BTCRelay DisableInclusionCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: BTCRelay BestBlockHeight (r:1 w:0) @@ -160,11 +157,9 @@ impl WeightInfo for SubstrateWeight { /// Storage: BTCRelay StableParachainConfirmations (r:1 w:0) /// Proof: BTCRelay StableParachainConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: Oracle Aggregate (r:1 w:0) /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) /// Storage: VaultStaking Nonce (r:1 w:0) @@ -183,21 +178,23 @@ impl WeightInfo for SubstrateWeight { /// The range of component `i` is `[1, 10]`. /// The range of component `o` is `[1, 10]`. /// The range of component `b` is `[770, 2048]`. - fn execute_issue_overpayment(h: u32, _i: u32, _o: u32, b: u32, ) -> Weight { + fn execute_issue_overpayment (_h: u32, i: u32, o: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `4257` - // Estimated: `32025` - // Minimum execution time: 212_556_000 picoseconds. - Weight::from_parts(219_428_668, 32025) - // Standard Error: 58_266 - .saturating_add(Weight::from_parts(901_425, 0).saturating_mul(h.into())) - // Standard Error: 394 - .saturating_add(Weight::from_parts(5_933, 0).saturating_mul(b.into())) - .saturating_add(T::DbWeight::get().reads(18_u64)) + // Measured: `3335` + // Estimated: `3760` + // Minimum execution time: 307_000_000 picoseconds. + Weight::from_parts(277_172_143, 3760) + // Standard Error: 1_347_150 + .saturating_add(Weight::from_parts(777_777, 0).saturating_mul(i.into())) + // Standard Error: 1_347_150 + .saturating_add(Weight::from_parts(1_000_000, 0).saturating_mul(o.into())) + // Standard Error: 9_486 + .saturating_add(Weight::from_parts(15_649, 0).saturating_mul(b.into())) + .saturating_add(T::DbWeight::get().reads(17_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } /// Storage: Issue IssueRequests (r:1 w:1) - /// Proof: Issue IssueRequests (max_values: None, max_size: Some(261), added: 2736, mode: MaxEncodedLen) + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) /// Storage: BTCRelay DisableInclusionCheck (r:1 w:0) /// Proof: BTCRelay DisableInclusionCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: BTCRelay BestBlockHeight (r:1 w:0) @@ -213,7 +210,7 @@ impl WeightInfo for SubstrateWeight { /// Storage: BTCRelay StableParachainConfirmations (r:1 w:0) /// Proof: BTCRelay StableParachainConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: Fee IssueFee (r:1 w:0) /// Proof: Fee IssueFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:1 w:1) @@ -226,23 +223,23 @@ impl WeightInfo for SubstrateWeight { /// The range of component `i` is `[1, 10]`. /// The range of component `o` is `[1, 10]`. /// The range of component `b` is `[770, 2048]`. - fn execute_issue_underpayment(h: u32, i: u32, _o: u32, b: u32, ) -> Weight { + fn execute_issue_underpayment (h: u32, i: u32, _o: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `3688` - // Estimated: `21351` - // Minimum execution time: 161_721_000 picoseconds. - Weight::from_parts(157_484_537, 21351) - // Standard Error: 51_664 - .saturating_add(Weight::from_parts(1_573_495, 0).saturating_mul(h.into())) - // Standard Error: 46_531 - .saturating_add(Weight::from_parts(703_443, 0).saturating_mul(i.into())) - // Standard Error: 349 - .saturating_add(Weight::from_parts(3_376, 0).saturating_mul(b.into())) + // Measured: `2747` + // Estimated: `3760` + // Minimum execution time: 214_000_000 picoseconds. + Weight::from_parts(184_539_123, 3760) + // Standard Error: 1_732_050 + .saturating_add(Weight::from_parts(4_250_000, 0).saturating_mul(h.into())) + // Standard Error: 1_539_600 + .saturating_add(Weight::from_parts(1_555_555, 0).saturating_mul(i.into())) + // Standard Error: 10_842 + .saturating_add(Weight::from_parts(8_607, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(13_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } /// Storage: Issue IssueRequests (r:1 w:1) - /// Proof: Issue IssueRequests (max_values: None, max_size: Some(261), added: 2736, mode: MaxEncodedLen) + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) /// Storage: BTCRelay DisableInclusionCheck (r:1 w:0) /// Proof: BTCRelay DisableInclusionCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: BTCRelay BestBlockHeight (r:1 w:0) @@ -258,7 +255,7 @@ impl WeightInfo for SubstrateWeight { /// Storage: BTCRelay StableParachainConfirmations (r:1 w:0) /// Proof: BTCRelay StableParachainConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:1 w:1) /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) /// Storage: Tokens TotalIssuance (r:1 w:1) @@ -269,21 +266,25 @@ impl WeightInfo for SubstrateWeight { /// The range of component `i` is `[1, 10]`. /// The range of component `o` is `[1, 10]`. /// The range of component `b` is `[770, 2048]`. - fn execute_expired_issue_exact(h: u32, _i: u32, _o: u32, b: u32, ) -> Weight { + fn execute_expired_issue_exact (h: u32, i: u32, o: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `4358 + o * (8 ±0)` - // Estimated: `20840` - // Minimum execution time: 146_945_000 picoseconds. - Weight::from_parts(131_685_627, 20840) - // Standard Error: 120_641 - .saturating_add(Weight::from_parts(3_687_159, 0).saturating_mul(h.into())) - // Standard Error: 816 - .saturating_add(Weight::from_parts(15_185, 0).saturating_mul(b.into())) + // Measured: `3536` + // Estimated: `3760` + // Minimum execution time: 194_000_000 picoseconds. + Weight::from_parts(163_253_716, 3760) + // Standard Error: 974_278 + .saturating_add(Weight::from_parts(3_562_500, 0).saturating_mul(h.into())) + // Standard Error: 866_025 + .saturating_add(Weight::from_parts(611_111, 0).saturating_mul(i.into())) + // Standard Error: 866_025 + .saturating_add(Weight::from_parts(388_888, 0).saturating_mul(o.into())) + // Standard Error: 6_098 + .saturating_add(Weight::from_parts(6_651, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(12_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } /// Storage: Issue IssueRequests (r:1 w:1) - /// Proof: Issue IssueRequests (max_values: None, max_size: Some(261), added: 2736, mode: MaxEncodedLen) + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) /// Storage: BTCRelay DisableInclusionCheck (r:1 w:0) /// Proof: BTCRelay DisableInclusionCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: BTCRelay BestBlockHeight (r:1 w:0) @@ -299,11 +300,9 @@ impl WeightInfo for SubstrateWeight { /// Storage: BTCRelay StableParachainConfirmations (r:1 w:0) /// Proof: BTCRelay StableParachainConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: Oracle Aggregate (r:1 w:0) /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) /// Storage: VaultStaking Nonce (r:1 w:0) @@ -322,25 +321,23 @@ impl WeightInfo for SubstrateWeight { /// The range of component `i` is `[1, 10]`. /// The range of component `o` is `[1, 10]`. /// The range of component `b` is `[770, 2048]`. - fn execute_expired_issue_overpayment(h: u32, i: u32, o: u32, b: u32, ) -> Weight { + fn execute_expired_issue_overpayment (h: u32, i: u32, o: u32, _b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `5026 + i * (9 ±0)` - // Estimated: `32025` - // Minimum execution time: 219_548_000 picoseconds. - Weight::from_parts(188_635_084, 32025) - // Standard Error: 145_768 - .saturating_add(Weight::from_parts(2_393_121, 0).saturating_mul(h.into())) - // Standard Error: 131_286 - .saturating_add(Weight::from_parts(2_072_816, 0).saturating_mul(i.into())) - // Standard Error: 131_286 - .saturating_add(Weight::from_parts(81_139, 0).saturating_mul(o.into())) - // Standard Error: 986 - .saturating_add(Weight::from_parts(10_300, 0).saturating_mul(b.into())) - .saturating_add(T::DbWeight::get().reads(18_u64)) + // Measured: `4141 + h * (21 ±0) + i * (3 ±0) + o * (3 ±0)` + // Estimated: `3760` + // Minimum execution time: 322_000_000 picoseconds. + Weight::from_parts(316_622_652, 3760) + // Standard Error: 108_253 + .saturating_add(Weight::from_parts(937_500, 0).saturating_mul(h.into())) + // Standard Error: 96_225 + .saturating_add(Weight::from_parts(1_055_555, 0).saturating_mul(i.into())) + // Standard Error: 96_225 + .saturating_add(Weight::from_parts(55_555, 0).saturating_mul(o.into())) + .saturating_add(T::DbWeight::get().reads(17_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } /// Storage: Issue IssueRequests (r:1 w:1) - /// Proof: Issue IssueRequests (max_values: None, max_size: Some(261), added: 2736, mode: MaxEncodedLen) + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) /// Storage: BTCRelay DisableInclusionCheck (r:1 w:0) /// Proof: BTCRelay DisableInclusionCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: BTCRelay BestBlockHeight (r:1 w:0) @@ -356,7 +353,7 @@ impl WeightInfo for SubstrateWeight { /// Storage: BTCRelay StableParachainConfirmations (r:1 w:0) /// Proof: BTCRelay StableParachainConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: Fee IssueFee (r:1 w:0) /// Proof: Fee IssueFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:1 w:1) @@ -369,19 +366,23 @@ impl WeightInfo for SubstrateWeight { /// The range of component `i` is `[1, 10]`. /// The range of component `o` is `[1, 10]`. /// The range of component `b` is `[770, 2048]`. - fn execute_expired_issue_underpayment(_h: u32, _i: u32, _o: u32, b: u32, ) -> Weight { + fn execute_expired_issue_underpayment (h: u32, i: u32, _o: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `4495 + h * (9 ±0) + i * (13 ±0)` - // Estimated: `21351` - // Minimum execution time: 173_639_000 picoseconds. - Weight::from_parts(195_976_912, 21351) - // Standard Error: 849 - .saturating_add(Weight::from_parts(13_647, 0).saturating_mul(b.into())) + // Measured: `3990` + // Estimated: `3760` + // Minimum execution time: 231_000_000 picoseconds. + Weight::from_parts(177_273_669, 3760) + // Standard Error: 108_253 + .saturating_add(Weight::from_parts(5_437_500, 0).saturating_mul(h.into())) + // Standard Error: 96_225 + .saturating_add(Weight::from_parts(1_277_777, 0).saturating_mul(i.into())) + // Standard Error: 677 + .saturating_add(Weight::from_parts(16_040, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(13_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } /// Storage: Issue IssueRequests (r:1 w:1) - /// Proof: Issue IssueRequests (max_values: None, max_size: Some(261), added: 2736, mode: MaxEncodedLen) + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) /// Storage: Issue IssuePeriod (r:1 w:0) /// Proof: Issue IssuePeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: Security ActiveBlockCount (r:1 w:0) @@ -389,30 +390,48 @@ impl WeightInfo for SubstrateWeight { /// Storage: BTCRelay BestBlockHeight (r:1 w:0) /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) - fn cancel_issue() -> Weight { + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) + fn cancel_issue () -> Weight { // Proof Size summary in bytes: - // Measured: `2583` - // Estimated: `6968` - // Minimum execution time: 78_715_000 picoseconds. - Weight::from_parts(83_016_000, 6968) + // Measured: `1505` + // Estimated: `3760` + // Minimum execution time: 89_000_000 picoseconds. + Weight::from_parts(89_000_000, 3760) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } - /// Storage: Issue IssuePeriod (r:0 w:1) + /// Storage: Issue IssueRequests (r:1 w:1) + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) + /// Storage: Issue IssuePeriod (r:1 w:0) /// Proof: Issue IssuePeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - fn set_issue_period() -> Weight { + /// Storage: Security ActiveBlockCount (r:1 w:0) + /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: BTCRelay BestBlockHeight (r:1 w:0) + /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + fn cancel_issue_for_replace () -> Weight { // Proof Size summary in bytes: // Measured: `1027` + // Estimated: `3760` + // Minimum execution time: 66_000_000 picoseconds. + Weight::from_parts(66_000_000, 3760) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: Issue IssuePeriod (r:0 w:1) + /// Proof: Issue IssuePeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + fn set_issue_period () -> Weight { + // Proof Size summary in bytes: + // Measured: `0` // Estimated: `0` - // Minimum execution time: 21_853_000 picoseconds. - Weight::from_parts(22_510_000, 0) + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(17_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } } // For backwards compatibility and tests impl WeightInfo for () { + /// Storage: BTCRelay StartBlockHeight (r:1 w:0) /// Proof: BTCRelay StartBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: BTCRelay StableBitcoinConfirmations (r:1 w:0) @@ -420,15 +439,15 @@ impl WeightInfo for () { /// Storage: BTCRelay BestBlockHeight (r:1 w:0) /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: Oracle Aggregate (r:2 w:0) /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) /// Storage: Fee IssueGriefingCollateral (r:1 w:0) /// Proof: Fee IssueGriefingCollateral (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:1 w:1) /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: Fee IssueFee (r:1 w:0) + /// Proof: Fee IssueFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: Issue IssueBtcDustValue (r:1 w:0) /// Proof: Issue IssueBtcDustValue (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) @@ -437,8 +456,6 @@ impl WeightInfo for () { /// Proof: VaultStaking Nonce (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) /// Storage: VaultStaking TotalCurrentStake (r:1 w:0) /// Proof: VaultStaking TotalCurrentStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: Fee IssueFee (r:1 w:0) - /// Proof: Fee IssueFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: Security Nonce (r:1 w:1) /// Proof: Security Nonce (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) /// Storage: System ParentHash (r:1 w:0) @@ -450,18 +467,19 @@ impl WeightInfo for () { /// Storage: Issue IssuePeriod (r:1 w:0) /// Proof: Issue IssuePeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: Issue IssueRequests (r:0 w:1) - /// Proof: Issue IssueRequests (max_values: None, max_size: Some(261), added: 2736, mode: MaxEncodedLen) - fn request_issue() -> Weight { + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) + fn request_issue () -> Weight { // Proof Size summary in bytes: - // Measured: `3572` - // Estimated: `26156` - // Minimum execution time: 450_294_000 picoseconds. - Weight::from_parts(452_439_000, 26156) - .saturating_add(RocksDbWeight::get().reads(19_u64)) + // Measured: `2690` + // Estimated: `6028` + // Minimum execution time: 38_621_000_000 picoseconds. + Weight::from_parts(38_621_000_000, 6028) + .saturating_add(RocksDbWeight::get().reads(18_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } + /// Storage: Issue IssueRequests (r:1 w:1) - /// Proof: Issue IssueRequests (max_values: None, max_size: Some(261), added: 2736, mode: MaxEncodedLen) + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) /// Storage: BTCRelay DisableInclusionCheck (r:1 w:0) /// Proof: BTCRelay DisableInclusionCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: BTCRelay BestBlockHeight (r:1 w:0) @@ -477,7 +495,7 @@ impl WeightInfo for () { /// Storage: BTCRelay StableParachainConfirmations (r:1 w:0) /// Proof: BTCRelay StableParachainConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:1 w:1) /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) /// Storage: Tokens TotalIssuance (r:1 w:1) @@ -488,25 +506,21 @@ impl WeightInfo for () { /// The range of component `i` is `[1, 10]`. /// The range of component `o` is `[1, 10]`. /// The range of component `b` is `[770, 2048]`. - fn execute_issue_exact(h: u32, i: u32, o: u32, b: u32, ) -> Weight { + fn execute_issue_exact (_h: u32, i: u32, o: u32, _b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `3435` - // Estimated: `20840` - // Minimum execution time: 142_775_000 picoseconds. - Weight::from_parts(117_261_202, 20840) - // Standard Error: 45_583 - .saturating_add(Weight::from_parts(1_682_032, 0).saturating_mul(h.into())) - // Standard Error: 41_054 - .saturating_add(Weight::from_parts(684_847, 0).saturating_mul(i.into())) - // Standard Error: 41_054 - .saturating_add(Weight::from_parts(287_609, 0).saturating_mul(o.into())) - // Standard Error: 308 - .saturating_add(Weight::from_parts(7_184, 0).saturating_mul(b.into())) + // Measured: `2448` + // Estimated: `3760` + // Minimum execution time: 206_000_000 picoseconds. + Weight::from_parts(261_839_397, 3760) + // Standard Error: 96_225 + .saturating_add(Weight::from_parts(277_777, 0).saturating_mul(i.into())) + // Standard Error: 96_225 + .saturating_add(Weight::from_parts(166_666, 0).saturating_mul(o.into())) .saturating_add(RocksDbWeight::get().reads(12_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } /// Storage: Issue IssueRequests (r:1 w:1) - /// Proof: Issue IssueRequests (max_values: None, max_size: Some(261), added: 2736, mode: MaxEncodedLen) + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) /// Storage: BTCRelay DisableInclusionCheck (r:1 w:0) /// Proof: BTCRelay DisableInclusionCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: BTCRelay BestBlockHeight (r:1 w:0) @@ -522,11 +536,9 @@ impl WeightInfo for () { /// Storage: BTCRelay StableParachainConfirmations (r:1 w:0) /// Proof: BTCRelay StableParachainConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: Oracle Aggregate (r:1 w:0) /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) /// Storage: VaultStaking Nonce (r:1 w:0) @@ -545,21 +557,23 @@ impl WeightInfo for () { /// The range of component `i` is `[1, 10]`. /// The range of component `o` is `[1, 10]`. /// The range of component `b` is `[770, 2048]`. - fn execute_issue_overpayment(h: u32, _i: u32, _o: u32, b: u32, ) -> Weight { + fn execute_issue_overpayment (_h: u32, i: u32, o: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `4257` - // Estimated: `32025` - // Minimum execution time: 212_556_000 picoseconds. - Weight::from_parts(219_428_668, 32025) - // Standard Error: 58_266 - .saturating_add(Weight::from_parts(901_425, 0).saturating_mul(h.into())) - // Standard Error: 394 - .saturating_add(Weight::from_parts(5_933, 0).saturating_mul(b.into())) - .saturating_add(RocksDbWeight::get().reads(18_u64)) + // Measured: `3335` + // Estimated: `3760` + // Minimum execution time: 307_000_000 picoseconds. + Weight::from_parts(277_172_143, 3760) + // Standard Error: 1_347_150 + .saturating_add(Weight::from_parts(777_777, 0).saturating_mul(i.into())) + // Standard Error: 1_347_150 + .saturating_add(Weight::from_parts(1_000_000, 0).saturating_mul(o.into())) + // Standard Error: 9_486 + .saturating_add(Weight::from_parts(15_649, 0).saturating_mul(b.into())) + .saturating_add(RocksDbWeight::get().reads(17_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } /// Storage: Issue IssueRequests (r:1 w:1) - /// Proof: Issue IssueRequests (max_values: None, max_size: Some(261), added: 2736, mode: MaxEncodedLen) + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) /// Storage: BTCRelay DisableInclusionCheck (r:1 w:0) /// Proof: BTCRelay DisableInclusionCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: BTCRelay BestBlockHeight (r:1 w:0) @@ -575,7 +589,7 @@ impl WeightInfo for () { /// Storage: BTCRelay StableParachainConfirmations (r:1 w:0) /// Proof: BTCRelay StableParachainConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: Fee IssueFee (r:1 w:0) /// Proof: Fee IssueFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:1 w:1) @@ -588,23 +602,23 @@ impl WeightInfo for () { /// The range of component `i` is `[1, 10]`. /// The range of component `o` is `[1, 10]`. /// The range of component `b` is `[770, 2048]`. - fn execute_issue_underpayment(h: u32, i: u32, _o: u32, b: u32, ) -> Weight { + fn execute_issue_underpayment (h: u32, i: u32, _o: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `3688` - // Estimated: `21351` - // Minimum execution time: 161_721_000 picoseconds. - Weight::from_parts(157_484_537, 21351) - // Standard Error: 51_664 - .saturating_add(Weight::from_parts(1_573_495, 0).saturating_mul(h.into())) - // Standard Error: 46_531 - .saturating_add(Weight::from_parts(703_443, 0).saturating_mul(i.into())) - // Standard Error: 349 - .saturating_add(Weight::from_parts(3_376, 0).saturating_mul(b.into())) + // Measured: `2747` + // Estimated: `3760` + // Minimum execution time: 214_000_000 picoseconds. + Weight::from_parts(184_539_123, 3760) + // Standard Error: 1_732_050 + .saturating_add(Weight::from_parts(4_250_000, 0).saturating_mul(h.into())) + // Standard Error: 1_539_600 + .saturating_add(Weight::from_parts(1_555_555, 0).saturating_mul(i.into())) + // Standard Error: 10_842 + .saturating_add(Weight::from_parts(8_607, 0).saturating_mul(b.into())) .saturating_add(RocksDbWeight::get().reads(13_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } /// Storage: Issue IssueRequests (r:1 w:1) - /// Proof: Issue IssueRequests (max_values: None, max_size: Some(261), added: 2736, mode: MaxEncodedLen) + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) /// Storage: BTCRelay DisableInclusionCheck (r:1 w:0) /// Proof: BTCRelay DisableInclusionCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: BTCRelay BestBlockHeight (r:1 w:0) @@ -620,7 +634,7 @@ impl WeightInfo for () { /// Storage: BTCRelay StableParachainConfirmations (r:1 w:0) /// Proof: BTCRelay StableParachainConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:1 w:1) /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) /// Storage: Tokens TotalIssuance (r:1 w:1) @@ -631,21 +645,25 @@ impl WeightInfo for () { /// The range of component `i` is `[1, 10]`. /// The range of component `o` is `[1, 10]`. /// The range of component `b` is `[770, 2048]`. - fn execute_expired_issue_exact(h: u32, _i: u32, _o: u32, b: u32, ) -> Weight { + fn execute_expired_issue_exact (h: u32, i: u32, o: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `4358 + o * (8 ±0)` - // Estimated: `20840` - // Minimum execution time: 146_945_000 picoseconds. - Weight::from_parts(131_685_627, 20840) - // Standard Error: 120_641 - .saturating_add(Weight::from_parts(3_687_159, 0).saturating_mul(h.into())) - // Standard Error: 816 - .saturating_add(Weight::from_parts(15_185, 0).saturating_mul(b.into())) + // Measured: `3536` + // Estimated: `3760` + // Minimum execution time: 194_000_000 picoseconds. + Weight::from_parts(163_253_716, 3760) + // Standard Error: 974_278 + .saturating_add(Weight::from_parts(3_562_500, 0).saturating_mul(h.into())) + // Standard Error: 866_025 + .saturating_add(Weight::from_parts(611_111, 0).saturating_mul(i.into())) + // Standard Error: 866_025 + .saturating_add(Weight::from_parts(388_888, 0).saturating_mul(o.into())) + // Standard Error: 6_098 + .saturating_add(Weight::from_parts(6_651, 0).saturating_mul(b.into())) .saturating_add(RocksDbWeight::get().reads(12_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } /// Storage: Issue IssueRequests (r:1 w:1) - /// Proof: Issue IssueRequests (max_values: None, max_size: Some(261), added: 2736, mode: MaxEncodedLen) + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) /// Storage: BTCRelay DisableInclusionCheck (r:1 w:0) /// Proof: BTCRelay DisableInclusionCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: BTCRelay BestBlockHeight (r:1 w:0) @@ -661,11 +679,9 @@ impl WeightInfo for () { /// Storage: BTCRelay StableParachainConfirmations (r:1 w:0) /// Proof: BTCRelay StableParachainConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: Oracle Aggregate (r:1 w:0) /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) /// Storage: VaultStaking Nonce (r:1 w:0) @@ -684,25 +700,23 @@ impl WeightInfo for () { /// The range of component `i` is `[1, 10]`. /// The range of component `o` is `[1, 10]`. /// The range of component `b` is `[770, 2048]`. - fn execute_expired_issue_overpayment(h: u32, i: u32, o: u32, b: u32, ) -> Weight { + fn execute_expired_issue_overpayment (h: u32, i: u32, o: u32, _b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `5026 + i * (9 ±0)` - // Estimated: `32025` - // Minimum execution time: 219_548_000 picoseconds. - Weight::from_parts(188_635_084, 32025) - // Standard Error: 145_768 - .saturating_add(Weight::from_parts(2_393_121, 0).saturating_mul(h.into())) - // Standard Error: 131_286 - .saturating_add(Weight::from_parts(2_072_816, 0).saturating_mul(i.into())) - // Standard Error: 131_286 - .saturating_add(Weight::from_parts(81_139, 0).saturating_mul(o.into())) - // Standard Error: 986 - .saturating_add(Weight::from_parts(10_300, 0).saturating_mul(b.into())) - .saturating_add(RocksDbWeight::get().reads(18_u64)) + // Measured: `4141 + h * (21 ±0) + i * (3 ±0) + o * (3 ±0)` + // Estimated: `3760` + // Minimum execution time: 322_000_000 picoseconds. + Weight::from_parts(316_622_652, 3760) + // Standard Error: 108_253 + .saturating_add(Weight::from_parts(937_500, 0).saturating_mul(h.into())) + // Standard Error: 96_225 + .saturating_add(Weight::from_parts(1_055_555, 0).saturating_mul(i.into())) + // Standard Error: 96_225 + .saturating_add(Weight::from_parts(55_555, 0).saturating_mul(o.into())) + .saturating_add(RocksDbWeight::get().reads(17_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } /// Storage: Issue IssueRequests (r:1 w:1) - /// Proof: Issue IssueRequests (max_values: None, max_size: Some(261), added: 2736, mode: MaxEncodedLen) + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) /// Storage: BTCRelay DisableInclusionCheck (r:1 w:0) /// Proof: BTCRelay DisableInclusionCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: BTCRelay BestBlockHeight (r:1 w:0) @@ -718,7 +732,7 @@ impl WeightInfo for () { /// Storage: BTCRelay StableParachainConfirmations (r:1 w:0) /// Proof: BTCRelay StableParachainConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: Fee IssueFee (r:1 w:0) /// Proof: Fee IssueFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:1 w:1) @@ -731,19 +745,23 @@ impl WeightInfo for () { /// The range of component `i` is `[1, 10]`. /// The range of component `o` is `[1, 10]`. /// The range of component `b` is `[770, 2048]`. - fn execute_expired_issue_underpayment(_h: u32, _i: u32, _o: u32, b: u32, ) -> Weight { + fn execute_expired_issue_underpayment (h: u32, i: u32, _o: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `4495 + h * (9 ±0) + i * (13 ±0)` - // Estimated: `21351` - // Minimum execution time: 173_639_000 picoseconds. - Weight::from_parts(195_976_912, 21351) - // Standard Error: 849 - .saturating_add(Weight::from_parts(13_647, 0).saturating_mul(b.into())) + // Measured: `3990` + // Estimated: `3760` + // Minimum execution time: 231_000_000 picoseconds. + Weight::from_parts(177_273_669, 3760) + // Standard Error: 108_253 + .saturating_add(Weight::from_parts(5_437_500, 0).saturating_mul(h.into())) + // Standard Error: 96_225 + .saturating_add(Weight::from_parts(1_277_777, 0).saturating_mul(i.into())) + // Standard Error: 677 + .saturating_add(Weight::from_parts(16_040, 0).saturating_mul(b.into())) .saturating_add(RocksDbWeight::get().reads(13_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } /// Storage: Issue IssueRequests (r:1 w:1) - /// Proof: Issue IssueRequests (max_values: None, max_size: Some(261), added: 2736, mode: MaxEncodedLen) + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) /// Storage: Issue IssuePeriod (r:1 w:0) /// Proof: Issue IssuePeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: Security ActiveBlockCount (r:1 w:0) @@ -751,24 +769,41 @@ impl WeightInfo for () { /// Storage: BTCRelay BestBlockHeight (r:1 w:0) /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) - fn cancel_issue() -> Weight { + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) + fn cancel_issue () -> Weight { // Proof Size summary in bytes: - // Measured: `2583` - // Estimated: `6968` - // Minimum execution time: 78_715_000 picoseconds. - Weight::from_parts(83_016_000, 6968) + // Measured: `1505` + // Estimated: `3760` + // Minimum execution time: 89_000_000 picoseconds. + Weight::from_parts(89_000_000, 3760) .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } - /// Storage: Issue IssuePeriod (r:0 w:1) + /// Storage: Issue IssueRequests (r:1 w:1) + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) + /// Storage: Issue IssuePeriod (r:1 w:0) /// Proof: Issue IssuePeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - fn set_issue_period() -> Weight { + /// Storage: Security ActiveBlockCount (r:1 w:0) + /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: BTCRelay BestBlockHeight (r:1 w:0) + /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + fn cancel_issue_for_replace () -> Weight { // Proof Size summary in bytes: // Measured: `1027` + // Estimated: `3760` + // Minimum execution time: 66_000_000 picoseconds. + Weight::from_parts(66_000_000, 3760) + .saturating_add(RocksDbWeight::get().reads(4_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } + /// Storage: Issue IssuePeriod (r:0 w:1) + /// Proof: Issue IssuePeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + fn set_issue_period () -> Weight { + // Proof Size summary in bytes: + // Measured: `0` // Estimated: `0` - // Minimum execution time: 21_853_000 picoseconds. - Weight::from_parts(22_510_000, 0) + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(17_000_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } -} +} \ No newline at end of file diff --git a/crates/issue/src/lib.rs b/crates/issue/src/lib.rs index 6f597baf59..9aecf202d8 100644 --- a/crates/issue/src/lib.rs +++ b/crates/issue/src/lib.rs @@ -32,7 +32,7 @@ pub mod types; pub use crate::types::{DefaultIssueRequest, IssueRequest, IssueRequestStatus}; use crate::types::{BalanceOf, DefaultVaultId, Version}; -use bitcoin::{merkle::PartialTransactionProof, types::FullTransactionProof, Address}; +use bitcoin::{merkle::PartialTransactionProof, types::FullTransactionProof}; use btc_relay::{BtcAddress, BtcPublicKey}; use currency::Amount; use frame_support::{dispatch::DispatchError, ensure, pallet_prelude::Weight, traits::Get, transactional, PalletId}; @@ -76,7 +76,6 @@ pub mod pallet { use super::*; use frame_support::pallet_prelude::*; use frame_system::pallet_prelude::*; - use primitives::AccountOrVault; /// ## Configuration /// The pallet's configuration trait. @@ -183,7 +182,7 @@ pub mod pallet { Version::V4 } - /// Build storage at V1 (requires default 0). + /// Build storage at V5 (requires default 4). #[pallet::storage] #[pallet::getter(fn storage_version)] pub(super) type StorageVersion = StorageValue<_, Version, ValueQuery, DefaultForStorageVersion>; @@ -194,6 +193,13 @@ pub mod pallet { pub issue_btc_dust_value: BalanceOf, } + #[pallet::hooks] + impl Hooks> for Pallet { + fn on_runtime_upgrade() -> Weight { + migration::v5::migrate_v4_to_v5::() + } + } + #[cfg(feature = "std")] impl Default for GenesisConfig { fn default() -> Self { @@ -270,7 +276,10 @@ pub mod pallet { /// * `origin` - sender of the transaction /// * `issue_id` - identifier of issue request as output from request_issue #[pallet::call_index(2)] - #[pallet::weight(::WeightInfo::cancel_issue())] + #[pallet::weight( + ::WeightInfo::cancel_issue() + .max(::WeightInfo::cancel_issue_for_replace()) + )] #[transactional] pub fn cancel_issue(origin: OriginFor, issue_id: H256) -> DispatchResultWithPostInfo { let requester = ensure_signed(origin)?; @@ -305,37 +314,8 @@ impl Pallet { T::TreasuryPalletId::get().into_account_truncating() } - // Function to cancel an issue request and slash collateral - pub fn cancel_issue_request_and_slash_collateral(issue_id: &H256) -> Result, DispatchError> { - // Get the issue request using the provided issue_id - let issue = Self::get_issue_request_from_id(issue_id)?; - - // Retrieve the amount of griefing collateral from the issue - let griefing_collateral = issue.griefing_collateral(); - - // Transfer griefing collateral from the requester's account to the vault's account - ext::vault_registry::transfer_funds::( - CurrencySource::UserGriefing(issue.requester.get_account().clone()), - CurrencySource::FreeBalance(issue.vault.account_id), - &griefing_collateral, - )?; - - // Set the status of the issue request to 'Cancelled' - Self::set_issue_status(issue_id.clone(), IssueRequestStatus::Cancelled); - - // Emit an event to indicate the cancellation of the issue request - Self::deposit_event(Event::CancelIssue { - issue_id: issue_id.clone(), - requester: issue.requester.get_account().clone(), - griefing_collateral: griefing_collateral.amount(), - }); - - // Return the amount of griefing collateral that was slashed - Ok(griefing_collateral.amount()) - } - // Function to retrieve the vault ID associated with a given issue ID - pub fn get_vault_from_id_from_issue_id(issue_id: &H256) -> Result, DispatchError> { + pub fn get_vault_from_issue_id(issue_id: &H256) -> Result, DispatchError> { // Retrieve the issue request using the provided issue_id let issue_request = Self::get_issue_request_from_id(issue_id)?; @@ -348,18 +328,8 @@ impl Pallet { // Retrieve the issue request using the provided issue_id let issue = Self::get_issue_request_from_id(&issue_id)?; - // Calculate the total amount including both issue amount and fee - let total = issue.amount().checked_add(&issue.fee())?; - // Decrease the to-be-issued tokens and increase the issued tokens for the new vault - ext::vault_registry::issue_tokens::(&issue.vault, &total)?; - - // Distribute rewards based on the issue fee - ext::fee::distribute_rewards::(&issue.fee())?; - - // Release the locked griefing collateral to the requester's account - let griefing_collateral: Amount = issue.griefing_collateral(); - griefing_collateral.unlock_on(&issue.requester.get_account())?; + ext::vault_registry::issue_tokens::(&issue.vault, &issue.amount())?; // Set the issue status to 'Completed' Self::set_issue_status(issue_id, IssueRequestStatus::Completed); @@ -373,7 +343,7 @@ impl Pallet { amount_requested: BalanceOf, vault_id: DefaultVaultId, griefing_currency: CurrencyId, - ) -> Result<(H256, Address), DispatchError> { + ) -> Result<(H256, BtcAddress), DispatchError> { let amount_requested = Amount::new(amount_requested, vault_id.wrapped_currency()); ensure!( @@ -392,10 +362,28 @@ impl Pallet { // Check that the vault is currently not banned ext::vault_registry::ensure_not_banned::(&vault_id)?; - // calculate griefing collateral based on the total amount of tokens to be issued - let amount_collateral = amount_requested.convert_to(griefing_currency)?; - let griefing_collateral = ext::fee::get_issue_griefing_collateral::(&amount_collateral)?; - griefing_collateral.lock_on(requester.get_account())?; + // check if it's a replace request + let (griefing_collateral, fee, amount_user) = if requester.is_vault_account() { + ( + // for replace request griefing collateral remains as zero + Amount::zero(griefing_currency), + // for replace request fee remains as zero + Amount::zero(vault_id.wrapped_currency()), + // for replace amount given to old_vault should be equal to specified amount + amount_requested.clone(), + ) + } else { + // calculate griefing collateral based on the total amount of tokens to be issued + let amount_collateral = amount_requested.convert_to(griefing_currency)?; + let griefing_collateral = ext::fee::get_issue_griefing_collateral::(&amount_collateral)?; + griefing_collateral.lock_on(requester.get_account())?; + + let fee = ext::fee::get_issue_fee::(&amount_requested)?; + // calculate the amount of tokens that will be transferred to the user upon execution + let amount_user = amount_requested.checked_sub(&fee)?; + + (griefing_collateral, fee, amount_user) + }; // only continue if the payment is above the dust value ensure!( @@ -405,10 +393,6 @@ impl Pallet { ext::vault_registry::try_increase_to_be_issued_tokens::(&vault_id, &amount_requested)?; - let fee = ext::fee::get_issue_fee::(&amount_requested)?; - // calculate the amount of tokens that will be transferred to the user upon execution - let amount_user = amount_requested.checked_sub(&fee)?; - let issue_id = ext::security::get_secure_id::(&requester.get_account()); let btc_address = ext::vault_registry::register_deposit_address::(&vault_id, issue_id)?; let btc_public_key = ext::vault_registry::get_bitcoin_public_key::(&vault_id.account_id)?; @@ -537,12 +521,22 @@ impl Pallet { } /// Cancels CBA issuance if time has expired and slashes collateral. - fn _cancel_issue(requester: T::AccountId, issue_id: H256) -> Result<(), DispatchError> { + pub fn _cancel_issue(requester: T::AccountId, issue_id: H256) -> Result<(), DispatchError> { let issue = Self::get_pending_issue(&issue_id)?; let issue_period = Self::issue_period().max(issue.period); - let to_be_slashed_collateral = - if ext::btc_relay::has_request_expired::(issue.opentime, issue.btc_height, issue_period)? { + let is_replace_request = issue.requester.is_vault_account(); + + let issue_expired = ext::btc_relay::has_request_expired::(issue.opentime, issue.btc_height, issue_period)?; + + // its a replace issue call if requester is vault + let slashed_collateral = if is_replace_request { + // only cancel replace request if issue is expired + ensure!(issue_expired, Error::::TimeNotExpired); + // for replace request griefing collateral is set as zero + issue.griefing_collateral() + } else { + let to_be_slashed_collateral = if issue_expired { // anyone can cancel the issue request once expired issue.griefing_collateral() } else if issue.requester.get_account() == &requester { @@ -576,30 +570,35 @@ impl Pallet { return Err(Error::::TimeNotExpired.into()); }; - if ext::vault_registry::is_vault_liquidated::(&issue.vault)? { - // return slashed griefing collateral if the vault is liquidated - to_be_slashed_collateral.unlock_on(issue.requester.get_account())?; - } else { - // otherwise give slashed griefing collateral to the treasury - // since the vault may have purposely blocked minting - ext::vault_registry::transfer_funds::( - CurrencySource::UserGriefing(issue.requester.get_account().clone()), - CurrencySource::FreeBalance(Self::treasury_account_id()), - &to_be_slashed_collateral, - )?; - } + if ext::vault_registry::is_vault_liquidated::(&issue.vault)? { + // return slashed griefing collateral if the vault is liquidated + to_be_slashed_collateral.unlock_on(issue.requester.get_account())?; + } else { + // otherwise give slashed griefing collateral to the treasury + // since the vault may have purposely blocked minting + ext::vault_registry::transfer_funds::( + CurrencySource::UserGriefing(issue.requester.get_account().clone()), + CurrencySource::FreeBalance(Self::treasury_account_id()), + &to_be_slashed_collateral, + )?; + } - // decrease to-be-issued tokens - let full_amount = issue.amount().checked_add(&issue.fee())?; - ext::vault_registry::decrease_to_be_issued_tokens::(&issue.vault, &full_amount)?; + // decrease to-be-issued tokens + let full_amount = issue.amount().checked_add(&issue.fee())?; + ext::vault_registry::decrease_to_be_issued_tokens::(&issue.vault, &full_amount)?; + to_be_slashed_collateral + }; + + // Set the status of the issue request to 'Cancelled' Self::set_issue_status(issue_id, IssueRequestStatus::Cancelled); Self::deposit_event(Event::CancelIssue { issue_id, requester, - griefing_collateral: to_be_slashed_collateral.amount(), + griefing_collateral: slashed_collateral.amount(), }); + Ok(()) } diff --git a/crates/issue/src/migration.rs b/crates/issue/src/migration.rs index e95f8ffc7b..07906b2e4e 100644 --- a/crates/issue/src/migration.rs +++ b/crates/issue/src/migration.rs @@ -1,9 +1,10 @@ use super::*; use frame_support::{pallet_prelude::*, traits::OnRuntimeUpgrade}; +#[cfg(feature = "std")] use sp_core::H256; /// The log target. -const TARGET: &'static str = "runtime::issue::migration::v1"; +const TARGET: &'static str = "runtime::issue::migration::v5"; /// The original data layout of the democracy pallet without a specific version number. mod v0 { @@ -115,6 +116,86 @@ pub mod v1 { } } +mod v4 { + use super::*; + + #[frame_support::storage_alias] + pub(super) type IssueRequests = + StorageMap, Blake2_128Concat, H256, DefaultIssueRequest, OptionQuery>; + + #[derive(Encode, Decode, Clone, PartialEq, TypeInfo, MaxEncodedLen)] + pub struct IssueRequest { + /// the vault associated with this issue request + pub vault: primitives::VaultId, + /// the *active* block height when this request was opened + pub opentime: BlockNumber, + /// the issue period when this request was opened + pub period: BlockNumber, + /// the collateral held for spam prevention + pub griefing_collateral: Balance, + /// The currency used for the griefing collateral + pub griefing_currency: CurrencyId, + /// the number of tokens that will be transferred to the user (as such, this does not include the fee) + pub amount: Balance, + /// the number of tokens that will be transferred to the fee pool + pub fee: Balance, + /// the account issuing tokens + pub requester: AccountId, + /// the vault's Bitcoin deposit address + pub btc_address: BtcAddress, + /// the vault's Bitcoin public key (when this request was made) + pub btc_public_key: BtcPublicKey, + /// the highest recorded height in the BTC-Relay (at time of opening) + pub btc_height: u32, + /// the status of this issue request + pub status: IssueRequestStatus, + } + + pub type DefaultIssueRequest = IssueRequest< + ::AccountId, + ::BlockNumber, + BalanceOf, + CurrencyId, + >; +} + +pub mod v5 { + use super::*; + + pub fn migrate_v4_to_v5() -> Weight { + let mut weight = T::DbWeight::get().reads(1); + + if !matches!(crate::StorageVersion::::get(), Version::V4) { + return T::DbWeight::get().reads(1); // already upgraded; don't run migration + } + + IssueRequests::::translate(|key, old: v4::DefaultIssueRequest| { + weight.saturating_accrue(T::DbWeight::get().reads_writes(1, 1)); + log::info!(target: TARGET, "migrating issue #{:?}", &key); + + Some(DefaultIssueRequest:: { + vault: old.vault, + opentime: old.opentime, + period: old.period, + griefing_collateral: old.griefing_collateral, + amount: old.amount, + fee: old.fee, + requester: AccountOrVault::Account(old.requester), + btc_address: old.btc_address, + btc_public_key: old.btc_public_key, + btc_height: old.btc_height, + status: old.status, + griefing_currency: T::GetGriefingCollateralCurrencyId::get(), + }) + }); + + // update version + StorageVersion::new(5).put::>(); + + weight.saturating_add(T::DbWeight::get().reads_writes(0, 1)) + } +} + #[cfg(test)] mod test { use super::*; @@ -123,6 +204,49 @@ mod test { types::*, }; + #[test] + fn migrating_from_v4_to_v5() { + run_test(|| { + assert_eq!(crate::StorageVersion::::get(), Version::V4); + + let old = v4::DefaultIssueRequest:: { + requester: 123, + vault: DefaultVaultId::::new(123, Token(DOT), Token(IBTC)), + btc_address: BtcAddress::random(), + amount: 123, + btc_height: 234, + btc_public_key: Default::default(), + fee: 456, + griefing_collateral: 567, + opentime: 12334, + period: 12313, + status: Default::default(), + griefing_currency: ::GetGriefingCollateralCurrencyId::get(), + }; + let key = H256::zero(); + v4::IssueRequests::::insert(key, old.clone()); + + v5::migrate_v4_to_v5::(); + + assert_eq!(StorageVersion::get::>(), 5); + + let new = crate::IssueRequests::::get(key).unwrap(); + + assert!(old.requester == new.requester.get_account().clone()); + assert!(old.vault == new.vault); + assert!(old.btc_address == new.btc_address); + assert!(old.amount == new.amount); + assert!(old.btc_height == new.btc_height); + assert!(old.btc_public_key == new.btc_public_key); + assert!(old.fee == new.fee); + assert!(old.griefing_collateral == new.griefing_collateral); + assert!(old.opentime == new.opentime); + assert!(old.period == new.period); + assert!(old.status == new.status); + assert!(new.griefing_currency == ::GetGriefingCollateralCurrencyId::get()); + }); + } + #[allow(deprecated)] #[test] fn migration_works() { diff --git a/crates/issue/src/tests.rs b/crates/issue/src/tests.rs index 276a7e9a6a..7db077e0c0 100644 --- a/crates/issue/src/tests.rs +++ b/crates/issue/src/tests.rs @@ -425,7 +425,7 @@ fn execute_issue_fails_for_replace_request() { } #[test] -fn complete_issue_request_for_replace() { +fn fail_to_cancel_completed_replace_issue_request() { run_test(|| { let issue_id = setup_execute(3, 1, 1, 3, AccountOrVault::Vault(OLD_VAULT)); assert_ok!(Issue::_complete_vault_issue(issue_id)); @@ -438,15 +438,15 @@ fn complete_issue_request_for_replace() { } #[test] -fn cancel_issue_for_replace() { +fn cancel_replace_issue_request() { run_test(|| { let griefing_collateral = 10; let issue_id = setup_execute(3, 1, griefing_collateral, 3, AccountOrVault::Vault(OLD_VAULT)); - assert_eq!( - Issue::cancel_issue_request_and_slash_collateral(&issue_id), - Ok(griefing_collateral) - ); + ext::btc_relay::has_request_expired::.mock_safe(move |_, _, _| MockResult::Return(Ok(true))); + ext::vault_registry::decrease_to_be_issued_tokens::.mock_safe(move |_, _| MockResult::Return(Ok(()))); + + assert_ok!(Issue::_cancel_issue(USER, issue_id)); assert_eq!( Issue::issue_requests(&issue_id).unwrap().status, @@ -455,9 +455,18 @@ fn cancel_issue_for_replace() { let request_issue_event = TestEvent::Issue(Event::CancelIssue { issue_id, - requester: OLD_VAULT.account_id, - griefing_collateral, + requester: USER, + griefing_collateral: 0, }); assert!(System::events().iter().any(|a| a.event == request_issue_event)); }); } + +#[test] +fn cancel_replace_issue_when_request_not_expired() { + run_test(|| { + let griefing_collateral = 10; + let issue_id = setup_execute(3, 1, griefing_collateral, 3, AccountOrVault::Vault(OLD_VAULT)); + assert_noop!(cancel_issue(USER, &issue_id), TestError::TimeNotExpired); + }); +} diff --git a/crates/issue/src/types.rs b/crates/issue/src/types.rs index d1d1cadb2c..34f7b152bf 100644 --- a/crates/issue/src/types.rs +++ b/crates/issue/src/types.rs @@ -8,7 +8,7 @@ use vault_registry::types::CurrencyId; use crate::Config; /// Storage version. -#[derive(Encode, Decode, Eq, PartialEq, TypeInfo, MaxEncodedLen)] +#[derive(Debug, Encode, Decode, Eq, PartialEq, TypeInfo, MaxEncodedLen)] pub enum Version { /// Initial version. V0, @@ -20,6 +20,8 @@ pub enum Version { V3, /// Removed refund V4, + /// Updated `IssueRequest`, `requester` field to accept vault account + V5, } pub(crate) type BalanceOf = ::Balance; diff --git a/crates/redeem/src/benchmarking.rs b/crates/redeem/src/benchmarking.rs index 19fa82eb81..8cefb5f284 100644 --- a/crates/redeem/src/benchmarking.rs +++ b/crates/redeem/src/benchmarking.rs @@ -221,12 +221,19 @@ fn setup_replace( old_vault_id: &DefaultVaultId, new_vault_id: &DefaultVaultId, to_be_replaced: Amount, + expire_redeem_request: bool, ) -> (H256, BalanceOf) where <::Balance as TryInto>::Error: Debug, { let value: Amount = Amount::new(2u32.into(), get_wrapped_currency_id::()); + let btc_address = if expire_redeem_request { + Default::default() + } else { + BtcAddress::dummy() + }; + //set up redeem let redeem_id = H256::zero(); let mut redeem_request = test_request::(&old_vault_id); @@ -234,6 +241,8 @@ where redeem_request.opentime = Security::::active_block_number(); redeem_request.issue_id = Some(H256::zero()); redeem_request.amount_btc = value.amount(); + redeem_request.btc_address = btc_address; + Redeem::::insert_redeem_request(&redeem_id, &redeem_request); VaultRegistry::::try_increase_to_be_redeemed_tokens(&old_vault_id, &to_be_replaced).unwrap(); @@ -242,17 +251,19 @@ where mint_and_reserve_wrapped::(&redeem_request.redeemer, redeem_request.amount_btc); // expire redeem request - initialize_and_mine_blocks_until_expiry::(&redeem_request); - Security::::set_active_block_number( - Security::::active_block_number() + Redeem::::redeem_period() + 100u32.into(), - ); + if expire_redeem_request { + initialize_and_mine_blocks_until_expiry::(&redeem_request); + Security::::set_active_block_number( + Security::::active_block_number() + Redeem::::redeem_period() + 100u32.into(), + ); + } // set up issue let issue_id = H256::zero(); let issue_request = IssueRequest { - requester: AccountOrVault::Account(old_vault_id.account_id.clone()), + requester: AccountOrVault::Vault(old_vault_id.clone()), vault: new_vault_id.clone(), - btc_address: Default::default(), + btc_address, amount: value.amount(), btc_height: Default::default(), btc_public_key: Default::default(), @@ -268,8 +279,6 @@ where VaultRegistry::::try_increase_to_be_issued_tokens(&new_vault_id, &value).unwrap(); - Redeem::::insert_request(&redeem_id, &issue_id); - (redeem_id, redeem_request.amount_btc) } @@ -492,7 +501,7 @@ pub mod benchmarks { .. } = setup_chain::(); - let (redeem_id, amount_btc) = setup_replace::(&old_vault_id, &new_vault_id, to_be_replaced); + let (redeem_id, amount_btc) = setup_replace::(&old_vault_id, &new_vault_id, to_be_replaced, true); let vault_id = activate_lending_and_get_vault_id::(); @@ -601,6 +610,62 @@ pub mod benchmarks { ); } + #[benchmark] + pub fn execute_replace(h: Linear<2, 10>, i: Linear<1, 10>, o: Linear<2, 3>, b: Linear<541, 2_048>) { + let ChainState { + old_vault_id, + to_be_replaced, + new_vault_id, + .. + } = setup_chain::(); + + let (redeem_id, amount_btc) = setup_replace::(&old_vault_id, &new_vault_id, to_be_replaced, false); + + let vault_id = activate_lending_and_get_vault_id::(); + + initialize_oracle::(); + + register_public_key::(vault_id.clone()); + VaultRegistry::::insert_vault( + &vault_id, + Vault { + id: vault_id.clone(), + issued_tokens: amount_btc, + to_be_redeemed_tokens: amount_btc, + ..Vault::new(vault_id.clone()) + }, + ); + + mint_collateral::(&vault_id.account_id, 1000u32.into()); + assert_ok!(VaultRegistry::::try_deposit_collateral(&vault_id, &collateral(1000))); + + assert_ok!(Oracle::::_set_exchange_rate( + get_collateral_currency_id::(), + UnsignedFixedPoint::::one() + )); + + let relayer_id: T::AccountId = account("Relayer", 0, 0); + + // we always need these outputs for redeem + let mut outputs = vec![ + TransactionOutput::payment(amount_btc.try_into().unwrap(), &BtcAddress::dummy()), + TransactionOutput::op_return(0, H256::zero().as_bytes()), + ]; + + // add return-to-self output + if o == 3 { + outputs.push(TransactionOutput::payment( + 2u32.into(), + &BtcAddress::P2PKH(sp_core::H160::zero()), + )); + } + + let transaction = BtcRelay::::initialize_and_store_max(relayer_id.clone(), h, i, outputs, b as usize); + + #[extrinsic_call] + execute_redeem(RawOrigin::Signed(vault_id.account_id.clone()), redeem_id, transaction); + } + impl_benchmark_test_suite!( Redeem, crate::mock::ExtBuilder::build_with(Default::default()), diff --git a/crates/redeem/src/default_weights.rs b/crates/redeem/src/default_weights.rs index 8079f3e54b..d150040f37 100644 --- a/crates/redeem/src/default_weights.rs +++ b/crates/redeem/src/default_weights.rs @@ -2,31 +2,31 @@ //! Autogenerated weights for redeem //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-12, STEPS: `100`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-29, STEPS: `2`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `interlay-hetzner-01`, CPU: `AMD EPYC 7502P 32-Core Processor` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-testnet-latest"), DB CACHE: 1024 +//! HOSTNAME: `Nakuls-MacBook-Pro.local`, CPU: `` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 // Executed Command: -// target/release/interbtc-parachain +// ./target/release/interbtc-parachain // benchmark // pallet -// --chain -// kintsugi-testnet-latest -// --execution=wasm -// --wasm-execution=compiled // --pallet // redeem // --extrinsic // * +// --execution=wasm +// --wasm-execution=compiled // --steps -// 100 +// 2 // --repeat -// 10 -// --output -// ./crates/redeem/src/default_weights.rs +// 1 // --template -// .deploy/default-weight-template.hbs +// .deploy/runtime-weight-template.hbs +// --chain +// kintsugi-dev +// --output +// generated_weight_kintsugi.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -40,8 +40,10 @@ pub trait WeightInfo { fn request_redeem() -> Weight; fn liquidation_redeem() -> Weight; fn execute_redeem(h: u32, i: u32, o: u32, b: u32, ) -> Weight; + fn execute_replace(h: u32, i: u32, o: u32, b: u32, ) -> Weight; fn cancel_redeem_reimburse() -> Weight; fn cancel_redeem_retry() -> Weight; + fn cancel_replace() -> Weight; fn set_redeem_period() -> Weight; fn self_redeem() -> Weight; fn request_replace() -> Weight; @@ -50,8 +52,9 @@ pub trait WeightInfo { /// Weights for redeem using the Substrate node and recommended hardware. pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) + + /// Storage: VaultRegistry Vaults (r:1 w:1) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:2 w:1) /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) /// Storage: Fee RedeemFee (r:1 w:0) @@ -60,8 +63,6 @@ impl WeightInfo for SubstrateWeight { /// Proof: Redeem RedeemTransactionSize (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: Oracle Aggregate (r:2 w:0) /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) - /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) /// Storage: Redeem RedeemBtcDustValue (r:1 w:0) /// Proof: Redeem RedeemBtcDustValue (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: Security Nonce (r:1 w:1) @@ -103,14 +104,14 @@ impl WeightInfo for SubstrateWeight { /// Storage: BTCRelay BestBlockHeight (r:1 w:0) /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: Redeem RedeemRequests (r:0 w:1) - /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(245), added: 2720, mode: MaxEncodedLen) - fn request_redeem() -> Weight { + /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(278), added: 2753, mode: MaxEncodedLen) + fn request_redeem () -> Weight { // Proof Size summary in bytes: - // Measured: `4672` - // Estimated: `47658` - // Minimum execution time: 311_664_000 picoseconds. - Weight::from_parts(315_792_000, 47658) - .saturating_add(T::DbWeight::get().reads(29_u64)) + // Measured: `3161` + // Estimated: `6260` + // Minimum execution time: 270_000_000 picoseconds. + Weight::from_parts(270_000_000, 6260) + .saturating_add(T::DbWeight::get().reads(28_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } /// Storage: Tokens Accounts (r:3 w:3) @@ -137,17 +138,17 @@ impl WeightInfo for SubstrateWeight { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) /// Storage: Loans AccountDeposits (r:1 w:0) /// Proof: Loans AccountDeposits (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) - fn liquidation_redeem() -> Weight { + fn liquidation_redeem () -> Weight { // Proof Size summary in bytes: - // Measured: `3861` - // Estimated: `40975` - // Minimum execution time: 279_078_000 picoseconds. - Weight::from_parts(282_886_000, 40975) + // Measured: `2193` + // Estimated: `8760` + // Minimum execution time: 257_000_000 picoseconds. + Weight::from_parts(257_000_000, 8760) .saturating_add(T::DbWeight::get().reads(16_u64)) .saturating_add(T::DbWeight::get().writes(11_u64)) } /// Storage: Redeem RedeemRequests (r:1 w:1) - /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(245), added: 2720, mode: MaxEncodedLen) + /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(278), added: 2753, mode: MaxEncodedLen) /// Storage: BTCRelay DisableInclusionCheck (r:1 w:0) /// Proof: BTCRelay DisableInclusionCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: BTCRelay BestBlockHeight (r:1 w:0) @@ -167,32 +168,28 @@ impl WeightInfo for SubstrateWeight { /// Storage: Tokens TotalIssuance (r:1 w:1) /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// The range of component `h` is `[2, 10]`. /// The range of component `i` is `[1, 10]`. /// The range of component `o` is `[2, 3]`. /// The range of component `b` is `[541, 2048]`. - fn execute_redeem(h: u32, i: u32, o: u32, b: u32, ) -> Weight { + fn execute_redeem (h: u32, _i: u32, o: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `3463` - // Estimated: `18221` - // Minimum execution time: 180_491_000 picoseconds. - Weight::from_parts(156_971_337, 18221) - // Standard Error: 18_912 - .saturating_add(Weight::from_parts(1_667_781, 0).saturating_mul(h.into())) - // Standard Error: 17_010 - .saturating_add(Weight::from_parts(730_184, 0).saturating_mul(i.into())) - // Standard Error: 102_447 - .saturating_add(Weight::from_parts(810_488, 0).saturating_mul(o.into())) - // Standard Error: 103 - .saturating_add(Weight::from_parts(5_905, 0).saturating_mul(b.into())) + // Measured: `2268 + o * (1 ±0)` + // Estimated: `3743` + // Minimum execution time: 176_000_000 picoseconds. + Weight::from_parts(151_584_172, 3743) + // Standard Error: 108_253 + .saturating_add(Weight::from_parts(2_562_500, 0).saturating_mul(h.into())) + // Standard Error: 866_025 + .saturating_add(Weight::from_parts(500_000, 0).saturating_mul(o.into())) + // Standard Error: 574 + .saturating_add(Weight::from_parts(8_958, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(11_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: Redeem RedeemRequests (r:1 w:1) - /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(245), added: 2720, mode: MaxEncodedLen) + /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(278), added: 2753, mode: MaxEncodedLen) /// Storage: Redeem RedeemPeriod (r:1 w:0) /// Proof: Redeem RedeemPeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: Security ActiveBlockCount (r:1 w:0) @@ -200,7 +197,7 @@ impl WeightInfo for SubstrateWeight { /// Storage: BTCRelay BestBlockHeight (r:1 w:0) /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: Loans UnderlyingAssetId (r:1 w:0) /// Proof: Loans UnderlyingAssetId (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) /// Storage: Oracle Aggregate (r:1 w:0) @@ -262,11 +259,11 @@ impl WeightInfo for SubstrateWeight { /// Storage: VaultRewards TotalStake (r:1 w:1) /// Proof: VaultRewards TotalStake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) /// Storage: VaultRewards RewardCurrencies (r:1 w:0) - /// Proof: VaultRewards RewardCurrencies (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) + /// Proof: VaultRewards RewardCurrencies (max_values: None, max_size: Some(50), added: 2525, mode: MaxEncodedLen) /// Storage: VaultCapacity TotalStake (r:1 w:1) /// Proof: VaultCapacity TotalStake (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) /// Storage: VaultCapacity RewardCurrencies (r:1 w:0) - /// Proof: VaultCapacity RewardCurrencies (max_values: None, max_size: Some(127), added: 2602, mode: MaxEncodedLen) + /// Proof: VaultCapacity RewardCurrencies (max_values: None, max_size: Some(39), added: 2514, mode: MaxEncodedLen) /// Storage: Loans RewardSupplyState (r:1 w:1) /// Proof: Loans RewardSupplyState (max_values: None, max_size: Some(47), added: 2522, mode: MaxEncodedLen) /// Storage: Loans RewardSupplySpeed (r:1 w:0) @@ -279,19 +276,17 @@ impl WeightInfo for SubstrateWeight { /// Proof: Loans AccountDeposits (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) /// Storage: VaultRegistry PunishmentDelay (r:1 w:0) /// Proof: VaultRegistry PunishmentDelay (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - fn cancel_redeem_reimburse() -> Weight { + fn cancel_redeem_reimburse () -> Weight { // Proof Size summary in bytes: - // Measured: `7166` - // Estimated: `135176` - // Minimum execution time: 798_478_000 picoseconds. - Weight::from_parts(808_188_000, 135176) - .saturating_add(T::DbWeight::get().reads(60_u64)) + // Measured: `5403` + // Estimated: `11350` + // Minimum execution time: 782_000_000 picoseconds. + Weight::from_parts(782_000_000, 11350) + .saturating_add(T::DbWeight::get().reads(59_u64)) .saturating_add(T::DbWeight::get().writes(29_u64)) } - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: Redeem RedeemRequests (r:1 w:1) - /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(245), added: 2720, mode: MaxEncodedLen) + /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(278), added: 2753, mode: MaxEncodedLen) /// Storage: Redeem RedeemPeriod (r:1 w:0) /// Proof: Redeem RedeemPeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: Security ActiveBlockCount (r:1 w:0) @@ -299,7 +294,7 @@ impl WeightInfo for SubstrateWeight { /// Storage: BTCRelay BestBlockHeight (r:1 w:0) /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: Loans UnderlyingAssetId (r:1 w:0) /// Proof: Loans UnderlyingAssetId (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) /// Storage: Oracle Aggregate (r:1 w:0) @@ -361,11 +356,11 @@ impl WeightInfo for SubstrateWeight { /// Storage: VaultRewards TotalStake (r:1 w:1) /// Proof: VaultRewards TotalStake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) /// Storage: VaultRewards RewardCurrencies (r:1 w:0) - /// Proof: VaultRewards RewardCurrencies (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) + /// Proof: VaultRewards RewardCurrencies (max_values: None, max_size: Some(50), added: 2525, mode: MaxEncodedLen) /// Storage: VaultCapacity TotalStake (r:1 w:1) /// Proof: VaultCapacity TotalStake (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) /// Storage: VaultCapacity RewardCurrencies (r:1 w:0) - /// Proof: VaultCapacity RewardCurrencies (max_values: None, max_size: Some(127), added: 2602, mode: MaxEncodedLen) + /// Proof: VaultCapacity RewardCurrencies (max_values: None, max_size: Some(39), added: 2514, mode: MaxEncodedLen) /// Storage: Loans RewardSupplyState (r:1 w:1) /// Proof: Loans RewardSupplyState (max_values: None, max_size: Some(47), added: 2522, mode: MaxEncodedLen) /// Storage: Loans RewardSupplySpeed (r:1 w:0) @@ -378,64 +373,117 @@ impl WeightInfo for SubstrateWeight { /// Proof: Loans AccountDeposits (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) /// Storage: VaultRegistry PunishmentDelay (r:1 w:0) /// Proof: VaultRegistry PunishmentDelay (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - fn cancel_redeem_retry() -> Weight { + fn cancel_redeem_retry () -> Weight { // Proof Size summary in bytes: - // Measured: `7166` - // Estimated: `132666` - // Minimum execution time: 729_751_000 picoseconds. - Weight::from_parts(738_648_000, 132666) - .saturating_add(T::DbWeight::get().reads(59_u64)) + // Measured: `5403` + // Estimated: `11350` + // Minimum execution time: 706_000_000 picoseconds. + Weight::from_parts(706_000_000, 11350) + .saturating_add(T::DbWeight::get().reads(58_u64)) .saturating_add(T::DbWeight::get().writes(28_u64)) } + /// Storage: Redeem RedeemRequests (r:1 w:1) + /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(278), added: 2753, mode: MaxEncodedLen) + /// Storage: Redeem RedeemPeriod (r:1 w:0) + /// Proof: Redeem RedeemPeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: Security ActiveBlockCount (r:1 w:0) + /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: BTCRelay BestBlockHeight (r:1 w:0) + /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: Issue IssueRequests (r:1 w:1) + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) + /// Storage: Issue IssuePeriod (r:1 w:0) + /// Proof: Issue IssuePeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: VaultRegistry Vaults (r:2 w:2) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) + /// Storage: Oracle Aggregate (r:1 w:0) + /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) + /// Storage: Fee PunishmentFee (r:1 w:0) + /// Proof: Fee PunishmentFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// Storage: VaultStaking Nonce (r:1 w:0) + /// Proof: VaultStaking Nonce (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) + /// Storage: VaultStaking TotalCurrentStake (r:1 w:0) + /// Proof: VaultStaking TotalCurrentStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) + /// Storage: VaultRegistry TotalUserVaultCollateral (r:1 w:1) + /// Proof: VaultRegistry TotalUserVaultCollateral (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) + /// Storage: VaultCapacity Stake (r:1 w:0) + /// Proof: VaultCapacity Stake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: VaultCapacity RewardPerToken (r:2 w:0) + /// Proof: VaultCapacity RewardPerToken (max_values: None, max_size: Some(59), added: 2534, mode: MaxEncodedLen) + /// Storage: VaultCapacity RewardTally (r:2 w:2) + /// Proof: VaultCapacity RewardTally (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) + /// Storage: VaultCapacity TotalRewards (r:2 w:2) + /// Proof: VaultCapacity TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: VaultRewards Stake (r:1 w:0) + /// Proof: VaultRewards Stake (max_values: None, max_size: Some(97), added: 2572, mode: MaxEncodedLen) + /// Storage: VaultRewards RewardPerToken (r:2 w:0) + /// Proof: VaultRewards RewardPerToken (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) + /// Storage: VaultRewards RewardTally (r:2 w:2) + /// Proof: VaultRewards RewardTally (max_values: None, max_size: Some(124), added: 2599, mode: MaxEncodedLen) + /// Storage: VaultRewards TotalRewards (r:2 w:2) + /// Proof: VaultRewards TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Fee Commission (r:1 w:0) + /// Proof: Fee Commission (max_values: None, max_size: Some(86), added: 2561, mode: MaxEncodedLen) + /// Storage: VaultStaking RewardPerToken (r:2 w:2) + /// Proof: VaultStaking RewardPerToken (max_values: None, max_size: Some(117), added: 2592, mode: MaxEncodedLen) + /// Storage: VaultStaking TotalStake (r:1 w:0) + /// Proof: VaultStaking TotalStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) + /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) + /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) + /// Storage: VaultRewards TotalStake (r:1 w:0) + /// Proof: VaultRewards TotalStake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + fn cancel_replace () -> Weight { + // Proof Size summary in bytes: + // Measured: `4404` + // Estimated: `6364` + // Minimum execution time: 394_000_000 picoseconds. + Weight::from_parts(394_000_000, 6364) + .saturating_add(T::DbWeight::get().reads(33_u64)) + .saturating_add(T::DbWeight::get().writes(15_u64)) + } /// Storage: Redeem RedeemPeriod (r:0 w:1) /// Proof: Redeem RedeemPeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - fn set_redeem_period() -> Weight { + fn set_redeem_period () -> Weight { // Proof Size summary in bytes: - // Measured: `1025` + // Measured: `0` // Estimated: `0` - // Minimum execution time: 28_527_000 picoseconds. - Weight::from_parts(29_970_000, 0) + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(17_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:1 w:1) /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) /// Storage: Tokens TotalIssuance (r:1 w:1) /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - fn self_redeem() -> Weight { + fn self_redeem () -> Weight { // Proof Size summary in bytes: - // Measured: `2449` - // Estimated: `7835` - // Minimum execution time: 147_756_000 picoseconds. - Weight::from_parts(149_109_000, 7835) + // Measured: `1399` + // Estimated: `3677` + // Minimum execution time: 116_000_000 picoseconds. + Weight::from_parts(116_000_000, 3677) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } - /// Storage: VaultRegistry Vaults (r:2 w:2) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: BTCRelay StartBlockHeight (r:1 w:0) /// Proof: BTCRelay StartBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: BTCRelay StableBitcoinConfirmations (r:1 w:0) /// Proof: BTCRelay StableBitcoinConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: BTCRelay BestBlockHeight (r:1 w:0) /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Oracle Aggregate (r:3 w:0) - /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) - /// Storage: Fee IssueGriefingCollateral (r:1 w:0) - /// Proof: Fee IssueGriefingCollateral (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:1 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: VaultRegistry Vaults (r:2 w:2) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: Issue IssueBtcDustValue (r:1 w:0) /// Proof: Issue IssueBtcDustValue (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) + /// Storage: Oracle Aggregate (r:1 w:0) + /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) /// Storage: VaultStaking Nonce (r:2 w:0) /// Proof: VaultStaking Nonce (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) /// Storage: VaultStaking TotalCurrentStake (r:2 w:0) /// Proof: VaultStaking TotalCurrentStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: Fee IssueFee (r:1 w:0) - /// Proof: Fee IssueFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: Security Nonce (r:1 w:1) /// Proof: Security Nonce (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) /// Storage: System ParentHash (r:1 w:0) @@ -448,8 +496,6 @@ impl WeightInfo for SubstrateWeight { /// Proof: Issue IssuePeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: Fee RedeemFee (r:1 w:0) /// Proof: Fee RedeemFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Redeem RedeemTransactionSize (r:1 w:0) - /// Proof: Redeem RedeemTransactionSize (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: Redeem RedeemBtcDustValue (r:1 w:0) /// Proof: Redeem RedeemBtcDustValue (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: VaultRegistry PremiumRedeemThreshold (r:1 w:0) @@ -460,23 +506,63 @@ impl WeightInfo for SubstrateWeight { /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) /// Storage: Redeem RedeemRequests (r:0 w:1) /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(278), added: 2753, mode: MaxEncodedLen) - /// Storage: Redeem Requests (r:0 w:1) - /// Proof: Redeem Requests (max_values: None, max_size: Some(80), added: 2555, mode: MaxEncodedLen) - fn request_replace() -> Weight { + fn request_replace () -> Weight { // Proof Size summary in bytes: - // Measured: `3277` - // Estimated: `8547` - // Minimum execution time: 39_015_000_000 picoseconds. - Weight::from_parts(39_015_000_000, 8547) - .saturating_add(T::DbWeight::get().reads(27_u64)) - .saturating_add(T::DbWeight::get().writes(7_u64)) + // Measured: `2735` + // Estimated: `6364` + // Minimum execution time: 38_446_000_000 picoseconds. + Weight::from_parts(38_446_000_000, 6364) + .saturating_add(T::DbWeight::get().reads(21_u64)) + .saturating_add(T::DbWeight::get().writes(5_u64)) + } + /// Storage: Redeem RedeemRequests (r:1 w:1) + /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(278), added: 2753, mode: MaxEncodedLen) + /// Storage: BTCRelay DisableInclusionCheck (r:1 w:0) + /// Proof: BTCRelay DisableInclusionCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) + /// Storage: BTCRelay BestBlockHeight (r:1 w:0) + /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: BTCRelay Chains (r:1 w:0) + /// Proof: BTCRelay Chains (max_values: None, max_size: Some(24), added: 2499, mode: MaxEncodedLen) + /// Storage: BTCRelay BlockHeaders (r:1 w:0) + /// Proof: BTCRelay BlockHeaders (max_values: None, max_size: Some(200), added: 2675, mode: MaxEncodedLen) + /// Storage: BTCRelay StableBitcoinConfirmations (r:1 w:0) + /// Proof: BTCRelay StableBitcoinConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: Security ActiveBlockCount (r:1 w:0) + /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: BTCRelay StableParachainConfirmations (r:1 w:0) + /// Proof: BTCRelay StableParachainConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: VaultRegistry Vaults (r:2 w:2) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) + /// Storage: Issue IssueRequests (r:1 w:1) + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) + /// The range of component `h` is `[2, 10]`. + /// The range of component `i` is `[1, 10]`. + /// The range of component `o` is `[2, 3]`. + /// The range of component `b` is `[541, 2048]`. + fn execute_replace (h: u32, i: u32, o: u32, b: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `2310` + // Estimated: `6364` + // Minimum execution time: 178_000_000 picoseconds. + Weight::from_parts(108_702_702, 6364) + // Standard Error: 433_012 + .saturating_add(Weight::from_parts(3_875_000, 0).saturating_mul(h.into())) + // Standard Error: 384_900 + .saturating_add(Weight::from_parts(1_444_444, 0).saturating_mul(i.into())) + // Standard Error: 3_464_101 + .saturating_add(Weight::from_parts(8_000_000, 0).saturating_mul(o.into())) + // Standard Error: 2_298 + .saturating_add(Weight::from_parts(11_280, 0).saturating_mul(b.into())) + .saturating_add(T::DbWeight::get().reads(11_u64)) + .saturating_add(T::DbWeight::get().writes(4_u64)) } } // For backwards compatibility and tests impl WeightInfo for () { - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) + + /// Storage: VaultRegistry Vaults (r:1 w:1) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:2 w:1) /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) /// Storage: Fee RedeemFee (r:1 w:0) @@ -485,8 +571,6 @@ impl WeightInfo for () { /// Proof: Redeem RedeemTransactionSize (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: Oracle Aggregate (r:2 w:0) /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) - /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) /// Storage: Redeem RedeemBtcDustValue (r:1 w:0) /// Proof: Redeem RedeemBtcDustValue (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: Security Nonce (r:1 w:1) @@ -528,14 +612,14 @@ impl WeightInfo for () { /// Storage: BTCRelay BestBlockHeight (r:1 w:0) /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: Redeem RedeemRequests (r:0 w:1) - /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(245), added: 2720, mode: MaxEncodedLen) - fn request_redeem() -> Weight { + /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(278), added: 2753, mode: MaxEncodedLen) + fn request_redeem () -> Weight { // Proof Size summary in bytes: - // Measured: `4672` - // Estimated: `47658` - // Minimum execution time: 311_664_000 picoseconds. - Weight::from_parts(315_792_000, 47658) - .saturating_add(RocksDbWeight::get().reads(29_u64)) + // Measured: `3161` + // Estimated: `6260` + // Minimum execution time: 270_000_000 picoseconds. + Weight::from_parts(270_000_000, 6260) + .saturating_add(RocksDbWeight::get().reads(28_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } /// Storage: Tokens Accounts (r:3 w:3) @@ -562,17 +646,17 @@ impl WeightInfo for () { /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) /// Storage: Loans AccountDeposits (r:1 w:0) /// Proof: Loans AccountDeposits (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) - fn liquidation_redeem() -> Weight { + fn liquidation_redeem () -> Weight { // Proof Size summary in bytes: - // Measured: `3861` - // Estimated: `40975` - // Minimum execution time: 279_078_000 picoseconds. - Weight::from_parts(282_886_000, 40975) + // Measured: `2193` + // Estimated: `8760` + // Minimum execution time: 257_000_000 picoseconds. + Weight::from_parts(257_000_000, 8760) .saturating_add(RocksDbWeight::get().reads(16_u64)) .saturating_add(RocksDbWeight::get().writes(11_u64)) } /// Storage: Redeem RedeemRequests (r:1 w:1) - /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(245), added: 2720, mode: MaxEncodedLen) + /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(278), added: 2753, mode: MaxEncodedLen) /// Storage: BTCRelay DisableInclusionCheck (r:1 w:0) /// Proof: BTCRelay DisableInclusionCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: BTCRelay BestBlockHeight (r:1 w:0) @@ -592,32 +676,28 @@ impl WeightInfo for () { /// Storage: Tokens TotalIssuance (r:1 w:1) /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// The range of component `h` is `[2, 10]`. /// The range of component `i` is `[1, 10]`. /// The range of component `o` is `[2, 3]`. /// The range of component `b` is `[541, 2048]`. - fn execute_redeem(h: u32, i: u32, o: u32, b: u32, ) -> Weight { + fn execute_redeem (h: u32, _i: u32, o: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `3463` - // Estimated: `18221` - // Minimum execution time: 180_491_000 picoseconds. - Weight::from_parts(156_971_337, 18221) - // Standard Error: 18_912 - .saturating_add(Weight::from_parts(1_667_781, 0).saturating_mul(h.into())) - // Standard Error: 17_010 - .saturating_add(Weight::from_parts(730_184, 0).saturating_mul(i.into())) - // Standard Error: 102_447 - .saturating_add(Weight::from_parts(810_488, 0).saturating_mul(o.into())) - // Standard Error: 103 - .saturating_add(Weight::from_parts(5_905, 0).saturating_mul(b.into())) + // Measured: `2268 + o * (1 ±0)` + // Estimated: `3743` + // Minimum execution time: 176_000_000 picoseconds. + Weight::from_parts(151_584_172, 3743) + // Standard Error: 108_253 + .saturating_add(Weight::from_parts(2_562_500, 0).saturating_mul(h.into())) + // Standard Error: 866_025 + .saturating_add(Weight::from_parts(500_000, 0).saturating_mul(o.into())) + // Standard Error: 574 + .saturating_add(Weight::from_parts(8_958, 0).saturating_mul(b.into())) .saturating_add(RocksDbWeight::get().reads(11_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: Redeem RedeemRequests (r:1 w:1) - /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(245), added: 2720, mode: MaxEncodedLen) + /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(278), added: 2753, mode: MaxEncodedLen) /// Storage: Redeem RedeemPeriod (r:1 w:0) /// Proof: Redeem RedeemPeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: Security ActiveBlockCount (r:1 w:0) @@ -625,7 +705,7 @@ impl WeightInfo for () { /// Storage: BTCRelay BestBlockHeight (r:1 w:0) /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: Loans UnderlyingAssetId (r:1 w:0) /// Proof: Loans UnderlyingAssetId (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) /// Storage: Oracle Aggregate (r:1 w:0) @@ -687,11 +767,11 @@ impl WeightInfo for () { /// Storage: VaultRewards TotalStake (r:1 w:1) /// Proof: VaultRewards TotalStake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) /// Storage: VaultRewards RewardCurrencies (r:1 w:0) - /// Proof: VaultRewards RewardCurrencies (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) + /// Proof: VaultRewards RewardCurrencies (max_values: None, max_size: Some(50), added: 2525, mode: MaxEncodedLen) /// Storage: VaultCapacity TotalStake (r:1 w:1) /// Proof: VaultCapacity TotalStake (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) /// Storage: VaultCapacity RewardCurrencies (r:1 w:0) - /// Proof: VaultCapacity RewardCurrencies (max_values: None, max_size: Some(127), added: 2602, mode: MaxEncodedLen) + /// Proof: VaultCapacity RewardCurrencies (max_values: None, max_size: Some(39), added: 2514, mode: MaxEncodedLen) /// Storage: Loans RewardSupplyState (r:1 w:1) /// Proof: Loans RewardSupplyState (max_values: None, max_size: Some(47), added: 2522, mode: MaxEncodedLen) /// Storage: Loans RewardSupplySpeed (r:1 w:0) @@ -704,19 +784,17 @@ impl WeightInfo for () { /// Proof: Loans AccountDeposits (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) /// Storage: VaultRegistry PunishmentDelay (r:1 w:0) /// Proof: VaultRegistry PunishmentDelay (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - fn cancel_redeem_reimburse() -> Weight { + fn cancel_redeem_reimburse () -> Weight { // Proof Size summary in bytes: - // Measured: `7166` - // Estimated: `135176` - // Minimum execution time: 798_478_000 picoseconds. - Weight::from_parts(808_188_000, 135176) - .saturating_add(RocksDbWeight::get().reads(60_u64)) + // Measured: `5403` + // Estimated: `11350` + // Minimum execution time: 782_000_000 picoseconds. + Weight::from_parts(782_000_000, 11350) + .saturating_add(RocksDbWeight::get().reads(59_u64)) .saturating_add(RocksDbWeight::get().writes(29_u64)) } - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof: Security ParachainStatus (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: Redeem RedeemRequests (r:1 w:1) - /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(245), added: 2720, mode: MaxEncodedLen) + /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(278), added: 2753, mode: MaxEncodedLen) /// Storage: Redeem RedeemPeriod (r:1 w:0) /// Proof: Redeem RedeemPeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: Security ActiveBlockCount (r:1 w:0) @@ -724,7 +802,7 @@ impl WeightInfo for () { /// Storage: BTCRelay BestBlockHeight (r:1 w:0) /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: Loans UnderlyingAssetId (r:1 w:0) /// Proof: Loans UnderlyingAssetId (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) /// Storage: Oracle Aggregate (r:1 w:0) @@ -786,11 +864,11 @@ impl WeightInfo for () { /// Storage: VaultRewards TotalStake (r:1 w:1) /// Proof: VaultRewards TotalStake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) /// Storage: VaultRewards RewardCurrencies (r:1 w:0) - /// Proof: VaultRewards RewardCurrencies (max_values: None, max_size: Some(138), added: 2613, mode: MaxEncodedLen) + /// Proof: VaultRewards RewardCurrencies (max_values: None, max_size: Some(50), added: 2525, mode: MaxEncodedLen) /// Storage: VaultCapacity TotalStake (r:1 w:1) /// Proof: VaultCapacity TotalStake (max_values: None, max_size: Some(32), added: 2507, mode: MaxEncodedLen) /// Storage: VaultCapacity RewardCurrencies (r:1 w:0) - /// Proof: VaultCapacity RewardCurrencies (max_values: None, max_size: Some(127), added: 2602, mode: MaxEncodedLen) + /// Proof: VaultCapacity RewardCurrencies (max_values: None, max_size: Some(39), added: 2514, mode: MaxEncodedLen) /// Storage: Loans RewardSupplyState (r:1 w:1) /// Proof: Loans RewardSupplyState (max_values: None, max_size: Some(47), added: 2522, mode: MaxEncodedLen) /// Storage: Loans RewardSupplySpeed (r:1 w:0) @@ -803,64 +881,117 @@ impl WeightInfo for () { /// Proof: Loans AccountDeposits (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) /// Storage: VaultRegistry PunishmentDelay (r:1 w:0) /// Proof: VaultRegistry PunishmentDelay (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - fn cancel_redeem_retry() -> Weight { + fn cancel_redeem_retry () -> Weight { // Proof Size summary in bytes: - // Measured: `7166` - // Estimated: `132666` - // Minimum execution time: 729_751_000 picoseconds. - Weight::from_parts(738_648_000, 132666) - .saturating_add(RocksDbWeight::get().reads(59_u64)) + // Measured: `5403` + // Estimated: `11350` + // Minimum execution time: 706_000_000 picoseconds. + Weight::from_parts(706_000_000, 11350) + .saturating_add(RocksDbWeight::get().reads(58_u64)) .saturating_add(RocksDbWeight::get().writes(28_u64)) } + /// Storage: Redeem RedeemRequests (r:1 w:1) + /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(278), added: 2753, mode: MaxEncodedLen) + /// Storage: Redeem RedeemPeriod (r:1 w:0) + /// Proof: Redeem RedeemPeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: Security ActiveBlockCount (r:1 w:0) + /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: BTCRelay BestBlockHeight (r:1 w:0) + /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: Issue IssueRequests (r:1 w:1) + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) + /// Storage: Issue IssuePeriod (r:1 w:0) + /// Proof: Issue IssuePeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: VaultRegistry Vaults (r:2 w:2) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) + /// Storage: Oracle Aggregate (r:1 w:0) + /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) + /// Storage: Fee PunishmentFee (r:1 w:0) + /// Proof: Fee PunishmentFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// Storage: VaultStaking Nonce (r:1 w:0) + /// Proof: VaultStaking Nonce (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) + /// Storage: VaultStaking TotalCurrentStake (r:1 w:0) + /// Proof: VaultStaking TotalCurrentStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) + /// Storage: VaultRegistry TotalUserVaultCollateral (r:1 w:1) + /// Proof: VaultRegistry TotalUserVaultCollateral (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) + /// Storage: VaultCapacity Stake (r:1 w:0) + /// Proof: VaultCapacity Stake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: VaultCapacity RewardPerToken (r:2 w:0) + /// Proof: VaultCapacity RewardPerToken (max_values: None, max_size: Some(59), added: 2534, mode: MaxEncodedLen) + /// Storage: VaultCapacity RewardTally (r:2 w:2) + /// Proof: VaultCapacity RewardTally (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) + /// Storage: VaultCapacity TotalRewards (r:2 w:2) + /// Proof: VaultCapacity TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: VaultRewards Stake (r:1 w:0) + /// Proof: VaultRewards Stake (max_values: None, max_size: Some(97), added: 2572, mode: MaxEncodedLen) + /// Storage: VaultRewards RewardPerToken (r:2 w:0) + /// Proof: VaultRewards RewardPerToken (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) + /// Storage: VaultRewards RewardTally (r:2 w:2) + /// Proof: VaultRewards RewardTally (max_values: None, max_size: Some(124), added: 2599, mode: MaxEncodedLen) + /// Storage: VaultRewards TotalRewards (r:2 w:2) + /// Proof: VaultRewards TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Fee Commission (r:1 w:0) + /// Proof: Fee Commission (max_values: None, max_size: Some(86), added: 2561, mode: MaxEncodedLen) + /// Storage: VaultStaking RewardPerToken (r:2 w:2) + /// Proof: VaultStaking RewardPerToken (max_values: None, max_size: Some(117), added: 2592, mode: MaxEncodedLen) + /// Storage: VaultStaking TotalStake (r:1 w:0) + /// Proof: VaultStaking TotalStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) + /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) + /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) + /// Storage: VaultRewards TotalStake (r:1 w:0) + /// Proof: VaultRewards TotalStake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + fn cancel_replace () -> Weight { + // Proof Size summary in bytes: + // Measured: `4404` + // Estimated: `6364` + // Minimum execution time: 394_000_000 picoseconds. + Weight::from_parts(394_000_000, 6364) + .saturating_add(RocksDbWeight::get().reads(33_u64)) + .saturating_add(RocksDbWeight::get().writes(15_u64)) + } /// Storage: Redeem RedeemPeriod (r:0 w:1) /// Proof: Redeem RedeemPeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - fn set_redeem_period() -> Weight { + fn set_redeem_period () -> Weight { // Proof Size summary in bytes: - // Measured: `1025` + // Measured: `0` // Estimated: `0` - // Minimum execution time: 28_527_000 picoseconds. - Weight::from_parts(29_970_000, 0) + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(17_000_000, 0) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:1 w:1) /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) /// Storage: Tokens TotalIssuance (r:1 w:1) /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - fn self_redeem() -> Weight { + fn self_redeem () -> Weight { // Proof Size summary in bytes: - // Measured: `2449` - // Estimated: `7835` - // Minimum execution time: 147_756_000 picoseconds. - Weight::from_parts(149_109_000, 7835) + // Measured: `1399` + // Estimated: `3677` + // Minimum execution time: 116_000_000 picoseconds. + Weight::from_parts(116_000_000, 3677) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } - /// Storage: VaultRegistry Vaults (r:2 w:2) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: BTCRelay StartBlockHeight (r:1 w:0) /// Proof: BTCRelay StartBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: BTCRelay StableBitcoinConfirmations (r:1 w:0) /// Proof: BTCRelay StableBitcoinConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: BTCRelay BestBlockHeight (r:1 w:0) /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Oracle Aggregate (r:3 w:0) - /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) - /// Storage: Fee IssueGriefingCollateral (r:1 w:0) - /// Proof: Fee IssueGriefingCollateral (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:1 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: VaultRegistry Vaults (r:2 w:2) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: Issue IssueBtcDustValue (r:1 w:0) /// Proof: Issue IssueBtcDustValue (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) + /// Storage: Oracle Aggregate (r:1 w:0) + /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) /// Storage: VaultStaking Nonce (r:2 w:0) /// Proof: VaultStaking Nonce (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) /// Storage: VaultStaking TotalCurrentStake (r:2 w:0) /// Proof: VaultStaking TotalCurrentStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: Fee IssueFee (r:1 w:0) - /// Proof: Fee IssueFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: Security Nonce (r:1 w:1) /// Proof: Security Nonce (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) /// Storage: System ParentHash (r:1 w:0) @@ -873,8 +1004,6 @@ impl WeightInfo for () { /// Proof: Issue IssuePeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: Fee RedeemFee (r:1 w:0) /// Proof: Fee RedeemFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Redeem RedeemTransactionSize (r:1 w:0) - /// Proof: Redeem RedeemTransactionSize (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: Redeem RedeemBtcDustValue (r:1 w:0) /// Proof: Redeem RedeemBtcDustValue (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: VaultRegistry PremiumRedeemThreshold (r:1 w:0) @@ -885,15 +1014,54 @@ impl WeightInfo for () { /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) /// Storage: Redeem RedeemRequests (r:0 w:1) /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(278), added: 2753, mode: MaxEncodedLen) - /// Storage: Redeem Requests (r:0 w:1) - /// Proof: Redeem Requests (max_values: None, max_size: Some(80), added: 2555, mode: MaxEncodedLen) - fn request_replace() -> Weight { + fn request_replace () -> Weight { // Proof Size summary in bytes: - // Measured: `3277` - // Estimated: `8547` - // Minimum execution time: 39_015_000_000 picoseconds. - Weight::from_parts(39_015_000_000, 8547) - .saturating_add(RocksDbWeight::get().reads(27_u64)) - .saturating_add(RocksDbWeight::get().writes(7_u64)) + // Measured: `2735` + // Estimated: `6364` + // Minimum execution time: 38_446_000_000 picoseconds. + Weight::from_parts(38_446_000_000, 6364) + .saturating_add(RocksDbWeight::get().reads(21_u64)) + .saturating_add(RocksDbWeight::get().writes(5_u64)) } -} + /// Storage: Redeem RedeemRequests (r:1 w:1) + /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(278), added: 2753, mode: MaxEncodedLen) + /// Storage: BTCRelay DisableInclusionCheck (r:1 w:0) + /// Proof: BTCRelay DisableInclusionCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) + /// Storage: BTCRelay BestBlockHeight (r:1 w:0) + /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: BTCRelay Chains (r:1 w:0) + /// Proof: BTCRelay Chains (max_values: None, max_size: Some(24), added: 2499, mode: MaxEncodedLen) + /// Storage: BTCRelay BlockHeaders (r:1 w:0) + /// Proof: BTCRelay BlockHeaders (max_values: None, max_size: Some(200), added: 2675, mode: MaxEncodedLen) + /// Storage: BTCRelay StableBitcoinConfirmations (r:1 w:0) + /// Proof: BTCRelay StableBitcoinConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: Security ActiveBlockCount (r:1 w:0) + /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: BTCRelay StableParachainConfirmations (r:1 w:0) + /// Proof: BTCRelay StableParachainConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: VaultRegistry Vaults (r:2 w:2) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) + /// Storage: Issue IssueRequests (r:1 w:1) + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) + /// The range of component `h` is `[2, 10]`. + /// The range of component `i` is `[1, 10]`. + /// The range of component `o` is `[2, 3]`. + /// The range of component `b` is `[541, 2048]`. + fn execute_replace (h: u32, i: u32, o: u32, b: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `2310` + // Estimated: `6364` + // Minimum execution time: 178_000_000 picoseconds. + Weight::from_parts(108_702_702, 6364) + // Standard Error: 433_012 + .saturating_add(Weight::from_parts(3_875_000, 0).saturating_mul(h.into())) + // Standard Error: 384_900 + .saturating_add(Weight::from_parts(1_444_444, 0).saturating_mul(i.into())) + // Standard Error: 3_464_101 + .saturating_add(Weight::from_parts(8_000_000, 0).saturating_mul(o.into())) + // Standard Error: 2_298 + .saturating_add(Weight::from_parts(11_280, 0).saturating_mul(b.into())) + .saturating_add(RocksDbWeight::get().reads(11_u64)) + .saturating_add(RocksDbWeight::get().writes(4_u64)) + } +} \ No newline at end of file diff --git a/crates/redeem/src/ext.rs b/crates/redeem/src/ext.rs index e7ad363ca0..ba51790e80 100644 --- a/crates/redeem/src/ext.rs +++ b/crates/redeem/src/ext.rs @@ -43,18 +43,20 @@ pub(crate) mod vault_registry { use frame_support::dispatch::{DispatchError, DispatchResult}; use vault_registry::types::{CurrencyId, CurrencySource, DefaultVault}; + pub fn is_vault_fully_replacing( + vault_id: &DefaultVaultId, + to_redeem_tokens: &Amount, + ) -> Result { + >::is_vault_fully_replacing(vault_id, to_redeem_tokens) + } + pub fn cancel_replace_tokens( old_vault_id: &DefaultVaultId, new_vault_id: &DefaultVaultId, - tokens: &Amount, + redeem_tokens: &Amount, + issue_tokens: &Amount, ) -> DispatchResult { - >::cancel_replace_tokens(old_vault_id, new_vault_id, tokens) - } - - pub fn requestable_to_be_replaced_tokens( - vault_id: &DefaultVaultId, - ) -> Result, DispatchError> { - >::requestable_to_be_replaced_tokens(vault_id) + >::cancel_replace_tokens(old_vault_id, new_vault_id, redeem_tokens, issue_tokens) } pub fn get_liquidated_collateral( @@ -256,15 +258,11 @@ pub(crate) mod issue { >::_complete_vault_issue(issue_id) } - pub fn get_vault_from_id_from_issue_id( - issue_id: &H256, - ) -> Result, DispatchError> { - >::get_vault_from_id_from_issue_id(issue_id) + pub fn get_vault_from_issue_id(issue_id: &H256) -> Result, DispatchError> { + >::get_vault_from_issue_id(issue_id) } - pub fn cancel_issue_request_and_slash_collateral( - issue_id: &H256, - ) -> Result, DispatchError> { - >::cancel_issue_request_and_slash_collateral(issue_id) + pub fn cancel_issue(issue_id: H256, redeemer: T::AccountId) -> Result<(), DispatchError> { + >::_cancel_issue(redeemer, issue_id) } } diff --git a/crates/redeem/src/lib.rs b/crates/redeem/src/lib.rs index 887212c2e5..8df47296a6 100644 --- a/crates/redeem/src/lib.rs +++ b/crates/redeem/src/lib.rs @@ -53,6 +53,21 @@ use vault_registry::{ pub use pallet::*; use primitives::{AccountOrVault, VaultId}; +fn calculate_weight( + merkle_proof_hashes: u32, + inputs_len: u32, + outputs_len: u32, + tx_encoded_len: u32, +) -> Weight { + ::WeightInfo::execute_redeem(merkle_proof_hashes, inputs_len, outputs_len, tx_encoded_len) + .saturating_add(::WeightInfo::execute_redeem( + merkle_proof_hashes, + inputs_len, + outputs_len, + tx_encoded_len, + )) +} + /// Complexity: /// - `O(H + I + O + B)` where: /// - `H` is the number of hashes in the merkle tree @@ -60,18 +75,21 @@ use primitives::{AccountOrVault, VaultId}; /// - `O` is the number of transaction outputs /// - `B` is `transaction` size in bytes (length-fee-bounded) fn weight_for_execute_redeem(proof: &FullTransactionProof) -> Weight { - ::WeightInfo::execute_redeem( + let execute_redeem_weight = calculate_weight::( + proof.user_tx_proof.merkle_proof.hashes.len() as u32, // H + proof.user_tx_proof.transaction.inputs.len() as u32, // I + proof.user_tx_proof.transaction.outputs.len() as u32, // O + proof.user_tx_proof.tx_encoded_len, + ); + + let execute_replace_weight = calculate_weight::( proof.user_tx_proof.merkle_proof.hashes.len() as u32, // H proof.user_tx_proof.transaction.inputs.len() as u32, // I proof.user_tx_proof.transaction.outputs.len() as u32, // O proof.user_tx_proof.tx_encoded_len, - ) - .saturating_add(::WeightInfo::execute_redeem( - proof.coinbase_proof.merkle_proof.hashes.len() as u32, // H - proof.coinbase_proof.transaction.inputs.len() as u32, // I - proof.coinbase_proof.transaction.outputs.len() as u32, // O - proof.coinbase_proof.tx_encoded_len, - )) + ); + + execute_redeem_weight.max(execute_replace_weight) } #[frame_support::pallet] @@ -79,7 +97,6 @@ pub mod pallet { use super::*; use frame_support::pallet_prelude::*; use frame_system::pallet_prelude::*; - use primitives::{AccountOrVault, VaultId}; use vault_registry::types::DefaultVaultCurrencyPair; /// ## Configuration @@ -132,8 +149,8 @@ pub mod pallet { issue_id: H256, old_vault: DefaultVaultId, new_vault: DefaultVaultId, - slashed_amount: BalanceOf, status: RedeemRequestStatus, + punishment_fee: BalanceOf, }, MintTokensForReimbursedRedeem { redeem_id: H256, @@ -176,6 +193,8 @@ pub mod pallet { ReplaceSelfNotAllowed, /// Vault cannot replace different currency. InvalidWrappedCurrency, + /// The issue id is not found for replace request + IsseeIdNotFoundForReplaceRequest, } /// The time difference in number of blocks between a redeem request is created and required completion time by a @@ -198,11 +217,6 @@ pub mod pallet { #[pallet::getter(fn redeem_btc_dust_value)] pub(super) type RedeemBtcDustValue = StorageValue<_, BalanceOf, ValueQuery>; - /// This mapping provides an access from a unique hash redeemId to a issueId hash - #[pallet::storage] - #[pallet::getter(fn redeem_issue_requests)] - pub(super) type Requests = StorageMap<_, Blake2_128Concat, H256, H256, OptionQuery>; - /// the expected size in bytes of the redeem bitcoin transfer #[pallet::storage] #[pallet::getter(fn redeem_transaction_size)] @@ -246,7 +260,11 @@ pub mod pallet { } #[pallet::hooks] - impl Hooks for Pallet {} + impl Hooks for Pallet { + fn on_runtime_upgrade() -> frame_support::weights::Weight { + crate::types::v1::migrate_v0_to_v1::() + } + } #[pallet::pallet] pub struct Pallet(_); @@ -341,7 +359,14 @@ pub mod pallet { /// and slash the Vault, or wishes to keep the tokens (and retry /// Redeem with another Vault) #[pallet::call_index(3)] - #[pallet::weight(if *reimburse { ::WeightInfo::cancel_redeem_reimburse() } else { ::WeightInfo::cancel_redeem_retry() })] + #[pallet::weight( + ::WeightInfo::cancel_replace() + .max(if *reimburse { + ::WeightInfo::cancel_redeem_reimburse() + } else { + ::WeightInfo::cancel_redeem_retry() + }) + )] #[transactional] pub fn cancel_redeem(origin: OriginFor, redeem_id: H256, reimburse: bool) -> DispatchResultWithPostInfo { let redeemer = ensure_signed(origin)?; @@ -555,25 +580,12 @@ impl Pallet { // don't allow vaults to replace themselves ensure!(old_vault != new_vault, Error::::ReplaceSelfNotAllowed); - // Calculate requestable tokens for old vault - let max_requestable_tokens: Amount = - ext::vault_registry::requestable_to_be_replaced_tokens::(&old_vault_id)?; - let requestable_tokens = amount.min(max_requestable_tokens.amount()); - // Initiate issue call - let (issue_id, btc_address) = ext::issue::request_vault_issue::( - old_vault.clone(), - requestable_tokens, - new_vault_id.clone(), - griefing_currency, - )?; + let (issue_id, btc_address) = + ext::issue::request_vault_issue::(old_vault, amount, new_vault_id, griefing_currency)?; // Initiate redeem call - let redeem_id = - Self::_request_redeem(new_vault, requestable_tokens, btc_address, old_vault_id, Some(issue_id))?; - - // Store the request IDs - Self::insert_request(&redeem_id, &issue_id); + Self::_request_redeem(new_vault, amount, btc_address, old_vault_id, Some(issue_id))?; Ok(()) } @@ -586,54 +598,69 @@ impl Pallet { issue_id: Option, ) -> Result { let amount_wrapped = Amount::new(amount_wrapped, vault_id.wrapped_currency()); + let is_replace_request = redeemer.is_vault_account(); + + // We saw a user lose bitcoin when they forgot to enter the address in the polkadot-js ui. + // Make sure this can't happen again. + ensure!(!btc_address.is_zero(), btc_relay::Error::::InvalidBtcHash); - // if redeemer is vault then it's a replace request, skip wrapped tokens balance check for - // it - if !redeemer.is_vault_account() { + ext::vault_registry::ensure_not_banned::(&vault_id)?; + + let (fee_wrapped, inclusion_fee, user_to_be_received_btc) = if is_replace_request { + // If vault if completely replacing the collateral then don't charge fees + let fee_wrapped = if ext::vault_registry::is_vault_fully_replacing::(&vault_id, &amount_wrapped)? { + Amount::zero(vault_id.wrapped_currency()) + } else { + ext::fee::get_redeem_fee::(&amount_wrapped)? + }; + + ( + fee_wrapped, + // the inclusion fee is paid by old vault itself hence we can set it as zero + Amount::zero(vault_id.wrapped_currency()), + // the new vault (redeemer) should receive the whole amount without deduction of fees + // as fee handling is done by old vault itself + amount_wrapped.clone(), + ) + } else { let redeemer_balance = ext::treasury::get_balance::(&redeemer.get_account(), vault_id.wrapped_currency()); ensure!( amount_wrapped.le(&redeemer_balance)?, - Error::::AmountExceedsUserBalance + Error::::AmountExceedsUserBalance, ); - } - // We saw a user lose bitcoin when they forgot to enter the address in the polkadot-js ui. - // Make sure this can't happen again. - ensure!(!btc_address.is_zero(), btc_relay::Error::::InvalidBtcHash); + let fee_wrapped = if redeemer.get_account().clone() == vault_id.account_id { + Amount::zero(vault_id.wrapped_currency()) + } else { + ext::fee::get_redeem_fee::(&amount_wrapped)? + }; - // todo: currently allowed to redeem from one currency to the other for free - decide if this is desirable - let mut fee_wrapped = if redeemer.get_account().clone() == vault_id.account_id { - Amount::zero(vault_id.wrapped_currency()) - } else { - ext::fee::get_redeem_fee::(&amount_wrapped)? - }; - let mut inclusion_fee = Self::get_current_inclusion_fee(vault_id.wrapped_currency())?; + let inclusion_fee = Self::get_current_inclusion_fee(vault_id.wrapped_currency())?; - let vault_to_be_burned_tokens = amount_wrapped.checked_sub(&fee_wrapped)?; + let vault_to_be_burned_tokens = amount_wrapped.checked_sub(&fee_wrapped)?; - // this can overflow for small requested values. As such return AmountBelowDustAmount when this happens - let user_to_be_received_btc = vault_to_be_burned_tokens - .checked_sub(&inclusion_fee) - .map_err(|_| Error::::AmountBelowDustAmount)?; + let user_to_be_received_btc = vault_to_be_burned_tokens + .checked_sub(&inclusion_fee) + .map_err(|_| Error::::AmountBelowDustAmount)?; - ext::vault_registry::ensure_not_banned::(&vault_id)?; + amount_wrapped.lock_on(redeemer.get_account())?; + + (fee_wrapped, inclusion_fee, user_to_be_received_btc) + }; // only allow requests of amount above above the minimum ensure!( - // this is the amount the vault will send (minus fee) + // this is the amount the vault will send user_to_be_received_btc.ge(&Self::get_dust_value(vault_id.wrapped_currency()))?, Error::::AmountBelowDustAmount ); - if redeemer.is_vault_account() { - // increased the to_be_redeem tokens by amount_wrapped since a request replace - ext::vault_registry::try_increase_to_be_redeemed_tokens::(&vault_id, &amount_wrapped)?; - } else { - // vault will get rid of the btc + btc_inclusion_fee - ext::vault_registry::try_increase_to_be_redeemed_tokens::(&vault_id, &vault_to_be_burned_tokens)?; - amount_wrapped.lock_on(redeemer.get_account())?; - } + // increased the to_be_redeem tokens by amount_wrapped - fee_wrapped + ext::vault_registry::try_increase_to_be_redeemed_tokens::( + &vault_id, + &amount_wrapped.checked_sub(&fee_wrapped)?, + )?; let redeem_id = ext::security::get_secure_id::(redeemer.get_account()); @@ -647,14 +674,6 @@ impl Pallet { Amount::zero(currency_id) }; - let to_be_received_btc = if redeemer.is_vault_account() { - fee_wrapped = Amount::zero(vault_id.wrapped_currency()); - inclusion_fee = Amount::zero(vault_id.wrapped_currency()); - amount_wrapped.amount() - } else { - user_to_be_received_btc.amount() - }; - Self::insert_redeem_request( &redeem_id, &RedeemRequest { @@ -662,7 +681,7 @@ impl Pallet { opentime: ext::security::active_block_number::(), fee: fee_wrapped.amount(), transfer_fee_btc: inclusion_fee.amount(), - amount_btc: to_be_received_btc, + amount_btc: user_to_be_received_btc.amount(), premium: premium_collateral.amount(), period: Self::redeem_period(), redeemer: redeemer.get_account().clone(), @@ -676,7 +695,7 @@ impl Pallet { Self::deposit_event(Event::::RequestRedeem { redeem_id, redeemer: redeemer.get_account().clone(), - amount: to_be_received_btc, + amount: user_to_be_received_btc.amount(), fee: fee_wrapped.amount(), premium: premium_collateral.amount(), vault_id, @@ -724,20 +743,20 @@ impl Pallet { redeem_id, )?; - if redeem.is_redeem_a_replace_request() { - //redeem tokens for old vault - ext::vault_registry::redeem_tokens::( - &redeem.vault, - &redeem.amount_btc(), - &redeem.premium()?, - &redeem.redeemer, - )?; + // if redeem has issue_id its a replace request + let (fee, redeem_amount) = if let Some(issue_id) = redeem.issue_id { + let replace_fee = redeem.fee(); - // get issue_id from redeem_id - let issue_id = >::get(redeem_id).ok_or(Error::::RedeemIdNotFound)?; + //redeem tokens for old vault + let redeem_tokens = redeem.amount_btc().checked_sub(&replace_fee)?; // complete_vault_issue increases issued_tokens & decreases to_be_issued for new vault ext::issue::complete_vault_issue::(issue_id)?; + + // mint wrapped fees + replace_fee.mint_to(&ext::fee::fee_pool_account_id::())?; + + (replace_fee, redeem_tokens) } else { // burn amount (without parachain fee, but including transfer fee) let burn_amount = redeem.amount_btc().checked_add(&redeem.transfer_fee_btc())?; @@ -747,11 +766,13 @@ impl Pallet { let fee = redeem.fee(); fee.unlock_on(&redeem.redeemer)?; fee.transfer(&redeem.redeemer, &ext::fee::fee_pool_account_id::())?; - ext::fee::distribute_rewards::(&fee)?; + (fee, burn_amount) + }; - //redeem tokens for vault - ext::vault_registry::redeem_tokens::(&redeem.vault, &burn_amount, &redeem.premium()?, &redeem.redeemer)?; - } + ext::fee::distribute_rewards::(&fee)?; + + //redeem tokens for vault + ext::vault_registry::redeem_tokens::(&redeem.vault, &redeem_amount, &redeem.premium()?, &redeem.redeemer)?; Self::set_redeem_status(redeem_id, RedeemRequestStatus::Completed); Self::deposit_event(Event::::ExecuteRedeem { @@ -765,20 +786,14 @@ impl Pallet { Ok(()) } - fn _cancel_redeem_request(redeemer: T::AccountId, redeem_id: H256, reimburse: bool) -> DispatchResult { - let redeem = Self::get_open_redeem_request_from_id(&redeem_id)?; + fn _cancel_redeem_request( + redeem: DefaultRedeemRequest, + redeemer: T::AccountId, + redeem_id: H256, + reimburse: bool, + ) -> DispatchResult { ensure!(redeemer == redeem.redeemer, Error::::UnauthorizedRedeemer); - // only cancellable after the request has expired - ensure!( - ext::btc_relay::has_request_expired::( - redeem.opentime, - redeem.btc_height, - Self::redeem_period().max(redeem.period) - )?, - Error::::TimeNotExpired - ); - let vault = ext::vault_registry::get_vault_from_id::(&redeem.vault)?; let vault_to_be_redeemed_tokens = Amount::new(vault.to_be_redeemed_tokens, redeem.vault.wrapped_currency()); let vault_id = redeem.vault.clone(); @@ -875,30 +890,40 @@ impl Pallet { Ok(()) } - // Cancels a redeem request, replaces it with a new issue request, adjusts vault balances, and - // updates the system state. - fn _cancel_replace_request(redeem_id: H256, issue_id: H256) -> DispatchResult { - let redeem = Self::get_open_redeem_request_from_id(&redeem_id)?; + // Cancels a replace request + fn _cancel_replace_request( + redeem: DefaultRedeemRequest, + redeem_id: H256, + issue_id: H256, + redeemer: T::AccountId, + ) -> DispatchResult { + let old_vault_id = redeem.vault.clone(); + let new_vault_id = ext::issue::get_vault_from_issue_id::(&issue_id)?; - // only cancellable after the request has expired - ensure!( - ext::btc_relay::has_request_expired::( - redeem.opentime, - redeem.btc_height, - Self::redeem_period().max(redeem.period) - )?, - Error::::TimeNotExpired - ); + // cancel issue request + ext::issue::cancel_issue::(issue_id, redeemer)?; - let old_vault_id = &redeem.vault; - let new_vault_id = ext::issue::get_vault_from_id_from_issue_id::(&issue_id)?; + let redeem_tokens = redeem.amount_btc().checked_sub(&redeem.fee())?; // decrease old-vault's to-be-redeemed tokens, and // decrease new-vault's to-be-issued tokens - ext::vault_registry::cancel_replace_tokens::(&old_vault_id, &new_vault_id, &redeem.amount_btc())?; + ext::vault_registry::cancel_replace_tokens::( + &old_vault_id, + &new_vault_id, + &redeem_tokens, + &redeem.amount_btc(), + )?; + + let amount_wrapped_in_collateral = redeem.amount_btc().convert_to(old_vault_id.collateral_currency())?; - // cancel issue request and slash collateral - let slashed_amount = ext::issue::cancel_issue_request_and_slash_collateral::(&issue_id)?; + // calculate the punishment fee (e.g. 10%) + let punishment_fee = ext::fee::get_punishment_fee::(&amount_wrapped_in_collateral)?; + + ext::vault_registry::transfer_funds_saturated::( + CurrencySource::Collateral(old_vault_id.clone()), + CurrencySource::FreeBalance(new_vault_id.account_id.clone()), + &punishment_fee, + )?; // Set the status of the redeem request to "Cancelled" Self::set_redeem_status(redeem_id, RedeemRequestStatus::Cancelled); @@ -907,27 +932,35 @@ impl Pallet { Self::deposit_event(Event::::CancelReplace { redeem_id, issue_id, - old_vault: old_vault_id.clone(), - new_vault: new_vault_id.clone(), - slashed_amount, + old_vault: old_vault_id, + new_vault: new_vault_id, status: RedeemRequestStatus::Cancelled, + punishment_fee: punishment_fee.amount(), }); Ok(()) } fn _cancel_redeem(redeemer: T::AccountId, redeem_id: H256, reimburse: bool) -> DispatchResult { - // Retrieve the request associated with the redeem_id - let request = >::get(redeem_id); + // Retrieve the redeem request associated with the redeem_id + let redeem = Self::get_open_redeem_request_from_id(&redeem_id)?; - if request.is_none() { - // If there's no associated request, cancel the redeem request - Self::_cancel_redeem_request(redeemer, redeem_id, reimburse) + // only cancellable after the request has expired + ensure!( + ext::btc_relay::has_request_expired::( + redeem.opentime, + redeem.btc_height, + Self::redeem_period().max(redeem.period) + )?, + Error::::TimeNotExpired + ); + + if let Some(issue_id) = redeem.issue_id { + // Cancel the replace request using the redeem request, redeem_id and issue_id + Self::_cancel_replace_request(redeem, redeem_id, issue_id, redeemer) } else { - // If there's an associated request, retrieve its issue_id - let issue_id = request.ok_or(Error::::InvalidCancelRequest)?; - // Cancel the replace request using the redeem_id and issue_id - Self::_cancel_replace_request(redeem_id, issue_id) + // If there's no associated issue_id, cancel the redeem request + Self::_cancel_redeem_request(redeem, redeemer, redeem_id, reimburse) } } @@ -957,16 +990,6 @@ impl Pallet { Ok(()) } - /// Insert a new request replace. - /// - /// # Arguments - /// - /// * `key` - 256-bit identifier of the redeem request - /// * `value` - 256-bit identifier of the issue request - fn insert_request(key: &H256, value: &H256) { - >::insert(key, value); - } - /// Insert a new redeem request into state. /// /// # Arguments diff --git a/crates/redeem/src/tests.rs b/crates/redeem/src/tests.rs index 5971da5588..5692be2f35 100644 --- a/crates/redeem/src/tests.rs +++ b/crates/redeem/src/tests.rs @@ -53,6 +53,8 @@ fn default_vault() -> DefaultVault { #[test] fn test_request_redeem_fails_with_amount_exceeds_user_balance() { run_test(|| { + ext::vault_registry::ensure_not_banned::.mock_safe(move |_vault_id| MockResult::Return(Ok(()))); + let amount = Amount::::new(2, ::GetWrappedCurrencyId::get()); amount.mint_to(&USER).unwrap(); let amount = 10_000_000; @@ -567,6 +569,7 @@ fn test_cancel_redeem_fails_with_time_not_expired() { #[test] fn test_cancel_redeem_fails_with_unauthorized_caller() { run_test(|| { + ext::btc_relay::has_request_expired::.mock_safe(|_, _, _| MockResult::Return(Ok(true))); Security::::set_active_block_number(20); Redeem::get_open_redeem_request_from_id.mock_safe(|_| { @@ -734,14 +737,13 @@ mod redeem_replace_tests { fn setup_mocks() { ext::vault_registry::ensure_not_banned::.mock_safe(|_| MockResult::Return(Ok(()))); - ext::vault_registry::requestable_to_be_replaced_tokens:: - .mock_safe(move |_| MockResult::Return(Ok(wrapped(1000000)))); ext::vault_registry::transfer_funds::.mock_safe(|_, _, _| MockResult::Return(Ok(()))); ext::vault_registry::try_increase_to_be_redeemed_tokens:: .mock_safe(move |_vault_id, _amount| MockResult::Return(Ok(()))); ext::security::get_secure_id::.mock_safe(move |_| MockResult::Return(H256([0; 32]))); ext::vault_registry::is_vault_below_premium_threshold:: .mock_safe(move |_vault_id| MockResult::Return(Ok(false))); + ext::vault_registry::is_vault_fully_replacing::.mock_safe(move |_, _| MockResult::Return(Ok(false))); } fn setup_execute_redeem() { @@ -754,9 +756,11 @@ mod redeem_replace_tests { ext::btc_relay::verify_and_validate_op_return_transaction:: .mock_safe(|_, _, _, _| MockResult::Return(Ok(()))); ext::btc_relay::has_request_expired::.mock_safe(|_, _, _| MockResult::Return(Ok(true))); - ext::issue::get_vault_from_id_from_issue_id::.mock_safe(|_| MockResult::Return(Ok(NEW_VAULT))); - ext::vault_registry::cancel_replace_tokens::.mock_safe(|_, _, _| MockResult::Return(Ok(()))); - ext::issue::cancel_issue_request_and_slash_collateral::.mock_safe(|_| MockResult::Return(Ok(1))); + ext::issue::get_vault_from_issue_id::.mock_safe(|_| MockResult::Return(Ok(NEW_VAULT))); + ext::vault_registry::cancel_replace_tokens::.mock_safe(|_, _, _, _| MockResult::Return(Ok(()))); + ext::vault_registry::transfer_funds_saturated:: + .mock_safe(move |_, _, amount| MockResult::Return(Ok(amount.clone()))); + ext::issue::cancel_issue::.mock_safe(|_, _| MockResult::Return(Ok(()))); let amount = 10; assert_ok!(Redeem::request_replace( @@ -850,8 +854,8 @@ mod redeem_replace_tests { issue_id: H256([1; 32]), old_vault: OLD_VAULT, new_vault: NEW_VAULT, - slashed_amount: 1, status: RedeemRequestStatus::Cancelled, + punishment_fee: 1, }); assert_err!( diff --git a/crates/redeem/src/types.rs b/crates/redeem/src/types.rs index c14ddc4c6a..f3d473d52c 100644 --- a/crates/redeem/src/types.rs +++ b/crates/redeem/src/types.rs @@ -4,15 +4,93 @@ use scale_info::TypeInfo; use sp_runtime::DispatchError; use vault_registry::types::CurrencyId; -use crate::Config; +use crate::{Config, Pallet}; +use btc_relay::BtcAddress; use codec::{Decode, Encode, MaxEncodedLen}; use currency::Amount; +use frame_support::{pallet_prelude::OptionQuery, traits::Get, Blake2_128Concat}; +use sp_core::H256; /// Storage version. -#[derive(Encode, Decode, Eq, PartialEq, TypeInfo, MaxEncodedLen)] +#[derive(Debug, Encode, Decode, Eq, PartialEq, TypeInfo, MaxEncodedLen)] pub enum Version { /// Initial version. V0, + /// Added `issue_id` to `RedeemRequest` + V1, +} + +mod v0 { + use super::*; + + pub type DefaultRedeemRequest = RedeemRequest< + ::AccountId, + ::BlockNumber, + BalanceOf, + CurrencyId, + >; + + #[derive(Encode, Decode, Clone, PartialEq, TypeInfo, MaxEncodedLen)] + pub struct RedeemRequest { + /// the vault associated with this redeem request + pub vault: VaultId, + /// the *active* block height when this request was opened + pub opentime: BlockNumber, + /// the redeem period when this request was opened + pub period: BlockNumber, + /// total redeem fees - taken from request amount + pub fee: Balance, + /// amount the vault should spend on the bitcoin inclusion fee - taken from request amount + pub transfer_fee_btc: Balance, + /// total amount of BTC for the vault to send + pub amount_btc: Balance, + /// premium redeem amount in collateral + pub premium: Balance, + /// the account redeeming tokens (for BTC) + pub redeemer: AccountId, + /// the user's Bitcoin address for payment verification + pub btc_address: BtcAddress, + /// the highest recorded height in the BTC-Relay (at time of opening) + pub btc_height: u32, + /// the status of this redeem request + pub status: RedeemRequestStatus, + } + + #[frame_support::storage_alias] + pub(super) type RedeemRequests = + StorageMap, Blake2_128Concat, H256, DefaultRedeemRequest, OptionQuery>; +} + +pub mod v1 { + use super::*; + + pub fn migrate_v0_to_v1() -> frame_support::weights::Weight { + if !matches!(crate::StorageVersion::::get(), Version::V0) { + return T::DbWeight::get().reads(1); // already upgraded; don't run migration + } + // update vault struct to remove replace pallet fields + crate::RedeemRequests::::translate(|_key, old: v0::DefaultRedeemRequest| { + Some(crate::DefaultRedeemRequest:: { + vault: old.vault, + opentime: old.opentime, + period: old.period, + fee: old.fee, + transfer_fee_btc: old.transfer_fee_btc, + amount_btc: old.amount_btc, + premium: old.premium, + redeemer: old.redeemer, + btc_address: old.btc_address, + btc_height: old.btc_height, + status: old.status, + issue_id: None, + }) + }); + + // update version + crate::StorageVersion::::put(Version::V1); + + T::DbWeight::get().reads_writes(0, 1) + } } pub(crate) type BalanceOf = ::Balance; @@ -47,3 +125,51 @@ impl RedeemRequestExt for RedeemRequest::get(), Version::V0); + + let old = v0::DefaultRedeemRequest:: { + vault: DefaultVaultId::::new(123, Token(DOT), Token(IBTC)), + opentime: 1, + period: 12313, + fee: 456, + transfer_fee_btc: 1, + amount_btc: 100, + premium: 0, + redeemer: USER, + btc_address: BtcAddress::random(), + btc_height: 0, + status: RedeemRequestStatus::Reimbursed(false), + }; + let key = H256::zero(); + v0::RedeemRequests::::insert(key, old.clone()); + + v1::migrate_v0_to_v1::(); + + assert_eq!(crate::StorageVersion::::get(), Version::V1); + + let new = crate::RedeemRequests::::get(key).unwrap(); + + assert!(old.vault == new.vault); + assert!(old.opentime == new.opentime); + assert!(old.period == new.period); + assert!(old.fee == new.fee); + assert!(old.transfer_fee_btc == new.transfer_fee_btc); + assert!(old.amount_btc == new.amount_btc); + assert!(old.premium == new.premium); + assert!(old.redeemer == new.redeemer); + assert!(old.btc_address == new.btc_address); + assert!(old.btc_height == new.btc_height); + assert!(old.status == new.status); + assert_eq!(new.issue_id.is_none(), true); + }); + } +} diff --git a/crates/vault-registry/src/lib.rs b/crates/vault-registry/src/lib.rs index b8ee2e79b0..0dfd43a2ae 100644 --- a/crates/vault-registry/src/lib.rs +++ b/crates/vault-registry/src/lib.rs @@ -111,7 +111,7 @@ pub mod pallet { } fn on_runtime_upgrade() -> frame_support::weights::Weight { - crate::types::v1::migrate_v1_to_v6::() + types::v7::migrate_v6_to_v7::() } } @@ -976,14 +976,6 @@ impl Pallet { Ok(btc_address) } - /// returns the amount of tokens that a vault can request to be replaced on top of the - /// current to-be-replaced tokens - pub fn requestable_to_be_replaced_tokens(vault_id: &DefaultVaultId) -> Result, DispatchError> { - let vault = Self::get_active_rich_vault_from_id(&vault_id)?; - - vault.issued_tokens().checked_sub(&vault.to_be_redeemed_tokens()) - } - /// Decreases the amount of tokens to be issued in the next issue request from the /// vault, or from the liquidation vault if the vault is liquidated /// @@ -1050,6 +1042,37 @@ impl Pallet { Ok(()) } + /// Checks if redeeming a certain amount of tokens from a vault would fully replace the vault's locked tokens. + /// + /// # Arguments + /// * `vault_id` - the id of the vault to check + /// * `to_redeem_tokens` - the amount of tokens to be redeemed + /// + /// # Errors + /// * `VaultNotFound` - if no vault exists for the given `vault_id` + /// * `InsufficientTokensCommitted` - if the amount of to-be-redeemed tokens is too low + /// + /// # Returns + /// `Ok(true)` if redeeming the specified `to_redeem_tokens` would fully replace the vault's locked tokens. + /// `Ok(false)` otherwise. + pub fn is_vault_fully_replacing( + vault_id: &DefaultVaultId, + to_redeem_tokens: &Amount, + ) -> Result { + let vault = Self::get_active_rich_vault_from_id(&vault_id)?; + let max_redeemable = vault.issued_tokens().checked_sub(&vault.to_be_redeemed_tokens())?; + ensure!( + max_redeemable.ge(&to_redeem_tokens)?, + Error::::InsufficientTokensCommitted + ); + + if to_redeem_tokens == &max_redeemable { + Ok(true) + } else { + Ok(false) + } + } + /// Subtracts an amount tokens from the to-be-redeemed tokens balance of a vault. /// /// # Arguments @@ -1279,7 +1302,8 @@ impl Pallet { pub fn cancel_replace_tokens( old_vault_id: &DefaultVaultId, new_vault_id: &DefaultVaultId, - tokens: &Amount, + redeem_tokens: &Amount, + issue_tokens: &Amount, ) -> DispatchResult { let mut old_vault = Self::get_rich_vault_from_id(&old_vault_id)?; let mut new_vault = Self::get_rich_vault_from_id(&new_vault_id)?; @@ -1287,7 +1311,7 @@ impl Pallet { if old_vault.data.is_liquidated() { let to_be_transferred = Self::calculate_collateral( &old_vault.liquidated_collateral(), - tokens, + redeem_tokens, &old_vault.to_be_redeemed_tokens(), )?; old_vault.decrease_liquidated_collateral(&to_be_transferred)?; @@ -1300,8 +1324,8 @@ impl Pallet { )?; } - old_vault.cancel_redeem_tokens(tokens)?; - new_vault.cancel_issue_tokens(tokens)?; + old_vault.cancel_redeem_tokens(redeem_tokens)?; + new_vault.cancel_issue_tokens(issue_tokens)?; Ok(()) } diff --git a/crates/vault-registry/src/tests.rs b/crates/vault-registry/src/tests.rs index 7e1ed457f1..0b0ef06c64 100644 --- a/crates/vault-registry/src/tests.rs +++ b/crates/vault-registry/src/tests.rs @@ -608,7 +608,12 @@ fn cancel_replace_tokens_succeeds() { assert_ok!(VaultRegistry::try_increase_to_be_redeemed_tokens(&old_id, &wrapped(50))); assert_ok!(VaultRegistry::try_increase_to_be_issued_tokens(&new_id, &wrapped(50))); - assert_ok!(VaultRegistry::cancel_replace_tokens(&old_id, &new_id, &wrapped(50))); + assert_ok!(VaultRegistry::cancel_replace_tokens( + &old_id, + &new_id, + &wrapped(50), + &wrapped(50) + )); let old_vault = VaultRegistry::get_active_rich_vault_from_id(&old_id).unwrap(); let new_vault = VaultRegistry::get_active_rich_vault_from_id(&new_id).unwrap(); diff --git a/crates/vault-registry/src/types.rs b/crates/vault-registry/src/types.rs index 9a32a828be..22a66aa7eb 100644 --- a/crates/vault-registry/src/types.rs +++ b/crates/vault-registry/src/types.rs @@ -5,6 +5,7 @@ use frame_support::{ dispatch::{DispatchError, DispatchResult}, ensure, traits::Get, + Blake2_128Concat, }; pub use primitives::{VaultCurrencyPair, VaultId}; use scale_info::TypeInfo; @@ -20,7 +21,7 @@ use mocktopus::macros::mockable; pub use bitcoin::{Address as BtcAddress, PublicKey as BtcPublicKey}; /// Storage version. -#[derive(Encode, Decode, Eq, PartialEq, TypeInfo, MaxEncodedLen)] +#[derive(Debug, Encode, Decode, Eq, PartialEq, TypeInfo, MaxEncodedLen)] pub enum Version { /// Initial version. V0, @@ -36,6 +37,10 @@ pub enum Version { V5, /// Removed wallet V6, + /// Removed replace pallet fields + /// Following fields have been removed from vault + /// `to_be_replaced_tokens`, `replace_collateral` and `active_replace_collateral` + V7, } #[derive(Debug, PartialEq)] @@ -92,18 +97,80 @@ pub type DefaultVaultId = VaultId<::AccountId, Cur pub type DefaultVaultCurrencyPair = VaultCurrencyPair>; -pub mod v1 { +mod v6 { + use super::*; + pub type DefaultVault = Vault< + ::AccountId, + ::BlockNumber, + BalanceOf, + CurrencyId, + UnsignedFixedPoint, + >; + + #[derive(Encode, Decode, Clone, PartialEq, Eq, TypeInfo, MaxEncodedLen)] + #[cfg_attr(feature = "std", derive(Debug))] + pub struct Vault { + /// Account identifier of the Vault + pub id: VaultId, + /// Current status of the vault + pub status: VaultStatus, + /// Block height until which this Vault is banned from being used for + /// Issue, Redeem (except during automatic liquidation) and Replace. + pub banned_until: Option, + /// Custom secure collateral threshold + pub secure_collateral_threshold: Option, + /// Number of tokens pending issue + pub to_be_issued_tokens: Balance, + /// Number of issued tokens + pub issued_tokens: Balance, + /// Number of tokens pending redeem + pub to_be_redeemed_tokens: Balance, + /// Number of tokens that have been requested for a replace through + /// `request_replace`, but that have not been accepted yet by a new_vault. + pub to_be_replaced_tokens: Balance, + /// Amount of collateral that is available as griefing collateral to vaults accepting + /// a replace request. It is to be payed out if the old_vault fails to call execute_replace. + pub replace_collateral: Balance, + /// Amount of collateral locked for accepted replace requests. + pub active_replace_collateral: Balance, + /// Amount of collateral that is locked for remaining to_be_redeemed + /// tokens upon liquidation. + pub liquidated_collateral: Balance, + } + + #[frame_support::storage_alias] + pub(super) type Vaults = StorageMap, Blake2_128Concat, DefaultVaultId, DefaultVault>; +} +pub mod v7 { use super::*; - pub fn migrate_v1_to_v6() -> frame_support::weights::Weight { - // kintsugi is on V6 but interlay is still on V1 - if !matches!(crate::StorageVersion::::get(), Version::V1) { + pub fn migrate_v6_to_v7() -> frame_support::weights::Weight { + let mut weight = T::DbWeight::get().reads(1); + + // kintsugi is on V6 but interlay is also on V6 + if !matches!(crate::StorageVersion::::get(), Version::V6) { log::info!("Not running vault storage migration"); - return T::DbWeight::get().reads(1); // already upgraded; don't run migration + return weight; // already upgraded; don't run migration } - // nothing to do other than update version - crate::StorageVersion::::put(Version::V6); - T::DbWeight::get().reads_writes(0, 1) + + // update vault struct to remove replace pallet fields + crate::Vaults::::translate(|_key, old: v6::DefaultVault| { + weight.saturating_accrue(T::DbWeight::get().reads_writes(1, 1)); + Some(crate::DefaultVault:: { + id: old.id, + status: old.status, + banned_until: old.banned_until, + secure_collateral_threshold: old.secure_collateral_threshold, + to_be_issued_tokens: old.to_be_issued_tokens, + issued_tokens: old.issued_tokens, + to_be_redeemed_tokens: old.to_be_redeemed_tokens, + liquidated_collateral: old.liquidated_collateral, + }) + }); + + // update version + crate::StorageVersion::::put(Version::V7); + weight.saturating_add(T::DbWeight::get().reads_writes(0, 1)) } } @@ -735,3 +802,48 @@ impl From> for RichSystemVault { RichSystemVault { data: vault } } } + +#[cfg(test)] +mod test { + use super::*; + use crate::mock::{Test as T, *}; + + #[test] + fn migrating_from_v6_to_v7() { + run_test(|| { + crate::StorageVersion::::put(Version::V6); + + let old = v6::DefaultVault:: { + id: DefaultVaultId::::new(123, Token(DOT), Token(IBTC)), + status: VaultStatus::Active(true), + banned_until: None, + secure_collateral_threshold: Default::default(), + to_be_issued_tokens: 0u32.into(), + issued_tokens: 0u32.into(), + to_be_redeemed_tokens: 0u32.into(), + to_be_replaced_tokens: 0u32.into(), + replace_collateral: 0u32.into(), + active_replace_collateral: 0u32.into(), + liquidated_collateral: 0u32.into(), + }; + let key = DefaultVaultId::::new(123, Token(DOT), Token(IBTC)); + + v6::Vaults::::insert(key.clone(), old.clone()); + + v7::migrate_v6_to_v7::(); + + assert_eq!(crate::StorageVersion::::get(), Version::V7); + + let new = crate::Vaults::::get(key).unwrap(); + + assert!(old.id == new.id); + assert!(old.status == new.status); + assert!(old.banned_until == new.banned_until); + assert!(old.secure_collateral_threshold == new.secure_collateral_threshold); + assert!(old.to_be_issued_tokens == new.to_be_issued_tokens); + assert!(old.issued_tokens == new.issued_tokens); + assert!(old.to_be_redeemed_tokens == new.to_be_redeemed_tokens); + assert!(old.liquidated_collateral == new.liquidated_collateral); + }); + } +} diff --git a/parachain/runtime/interlay/src/lib.rs b/parachain/runtime/interlay/src/lib.rs index a4fb9ba639..4d275ad8ca 100644 --- a/parachain/runtime/interlay/src/lib.rs +++ b/parachain/runtime/interlay/src/lib.rs @@ -1245,7 +1245,8 @@ construct_runtime! { Oracle: oracle::{Pallet, Call, Config, Storage, Event} = 62, Issue: issue::{Pallet, Call, Config, Storage, Event} = 63, Redeem: redeem::{Pallet, Call, Config, Storage, Event} = 64, - Fee: fee::{Pallet, Call, Config, Storage} = 65, + // Replace: 65 + Fee: fee::{Pallet, Call, Config, Storage} = 66, // Refund: 67 Nomination: nomination::{Pallet, Call, Config, Storage, Event} = 68, ClientsInfo: clients_info::{Pallet, Call, Storage, Event} = 69, diff --git a/parachain/runtime/interlay/src/weights/issue.rs b/parachain/runtime/interlay/src/weights/issue.rs index fa72cf8d1c..cf0c067d1d 100644 --- a/parachain/runtime/interlay/src/weights/issue.rs +++ b/parachain/runtime/interlay/src/weights/issue.rs @@ -2,31 +2,31 @@ //! Autogenerated weights for issue //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-29, STEPS: `2`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `interlay-rust-runner-2mz2v-jrrg4`, CPU: `AMD EPYC 7502P 32-Core Processor` +//! HOSTNAME: `Nakuls-MacBook-Pro.local`, CPU: `` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 // Executed Command: -// target/release/interbtc-parachain +// ./target/release/interbtc-parachain // benchmark // pallet // --pallet -// * +// issue // --extrinsic // * -// --chain -// interlay-dev // --execution=wasm // --wasm-execution=compiled // --steps -// 50 +// 2 // --repeat -// 10 -// --output -// parachain/runtime/interlay/src/weights/ +// 1 // --template // .deploy/runtime-weight-template.hbs +// --chain +// interlay-dev +// --output +// generated_weight_interlay.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -47,13 +47,15 @@ impl issue::WeightInfo for WeightInfo { /// Storage: BTCRelay BestBlockHeight (r:1 w:0) /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: Oracle Aggregate (r:2 w:0) /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) /// Storage: Fee IssueGriefingCollateral (r:1 w:0) /// Proof: Fee IssueGriefingCollateral (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:1 w:1) /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: Fee IssueFee (r:1 w:0) + /// Proof: Fee IssueFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: Issue IssueBtcDustValue (r:1 w:0) /// Proof: Issue IssueBtcDustValue (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) @@ -62,8 +64,6 @@ impl issue::WeightInfo for WeightInfo { /// Proof: VaultStaking Nonce (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) /// Storage: VaultStaking TotalCurrentStake (r:1 w:0) /// Proof: VaultStaking TotalCurrentStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: Fee IssueFee (r:1 w:0) - /// Proof: Fee IssueFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: Security Nonce (r:1 w:1) /// Proof: Security Nonce (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) /// Storage: System ParentHash (r:1 w:0) @@ -75,18 +75,18 @@ impl issue::WeightInfo for WeightInfo { /// Storage: Issue IssuePeriod (r:1 w:0) /// Proof: Issue IssuePeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: Issue IssueRequests (r:0 w:1) - /// Proof: Issue IssueRequests (max_values: None, max_size: Some(272), added: 2747, mode: MaxEncodedLen) + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) fn request_issue () -> Weight { // Proof Size summary in bytes: - // Measured: `2681` + // Measured: `2633` // Estimated: `6028` - // Minimum execution time: 556_004_000 picoseconds. - Weight::from_parts(558_989_000, 6028) + // Minimum execution time: 39_089_000_000 picoseconds. + Weight::from_parts(39_089_000_000, 6028) .saturating_add(T::DbWeight::get().reads(18_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } /// Storage: Issue IssueRequests (r:1 w:1) - /// Proof: Issue IssueRequests (max_values: None, max_size: Some(272), added: 2747, mode: MaxEncodedLen) + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) /// Storage: BTCRelay DisableInclusionCheck (r:1 w:0) /// Proof: BTCRelay DisableInclusionCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: BTCRelay BestBlockHeight (r:1 w:0) @@ -102,7 +102,7 @@ impl issue::WeightInfo for WeightInfo { /// Storage: BTCRelay StableParachainConfirmations (r:1 w:0) /// Proof: BTCRelay StableParachainConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:1 w:1) /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) /// Storage: Tokens TotalIssuance (r:1 w:1) @@ -113,23 +113,25 @@ impl issue::WeightInfo for WeightInfo { /// The range of component `i` is `[1, 10]`. /// The range of component `o` is `[1, 10]`. /// The range of component `b` is `[770, 2048]`. - fn execute_issue_exact (h: u32, i: u32, _o: u32, b: u32, ) -> Weight { + fn execute_issue_exact (h: u32, i: u32, o: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `2434` - // Estimated: `3737` - // Minimum execution time: 195_191_000 picoseconds. - Weight::from_parts(33_956_966, 3737) - // Standard Error: 810_295 - .saturating_add(Weight::from_parts(10_187_551, 0).saturating_mul(h.into())) - // Standard Error: 730_159 - .saturating_add(Weight::from_parts(7_188_076, 0).saturating_mul(i.into())) - // Standard Error: 5_239 - .saturating_add(Weight::from_parts(34_842, 0).saturating_mul(b.into())) + // Measured: `2428` + // Estimated: `3760` + // Minimum execution time: 193_000_000 picoseconds. + Weight::from_parts(160_513_301, 3760) + // Standard Error: 0 + .saturating_add(Weight::from_parts(1_500_000, 0).saturating_mul(h.into())) + // Standard Error: 0 + .saturating_add(Weight::from_parts(1_333_333, 0).saturating_mul(i.into())) + // Standard Error: 0 + .saturating_add(Weight::from_parts(333_333, 0).saturating_mul(o.into())) + // Standard Error: 0 + .saturating_add(Weight::from_parts(6_259, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(12_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } /// Storage: Issue IssueRequests (r:1 w:1) - /// Proof: Issue IssueRequests (max_values: None, max_size: Some(272), added: 2747, mode: MaxEncodedLen) + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) /// Storage: BTCRelay DisableInclusionCheck (r:1 w:0) /// Proof: BTCRelay DisableInclusionCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: BTCRelay BestBlockHeight (r:1 w:0) @@ -145,7 +147,7 @@ impl issue::WeightInfo for WeightInfo { /// Storage: BTCRelay StableParachainConfirmations (r:1 w:0) /// Proof: BTCRelay StableParachainConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) /// Storage: Oracle Aggregate (r:1 w:0) @@ -166,19 +168,25 @@ impl issue::WeightInfo for WeightInfo { /// The range of component `i` is `[1, 10]`. /// The range of component `o` is `[1, 10]`. /// The range of component `b` is `[770, 2048]`. - fn execute_issue_overpayment (h: u32, _i: u32, _o: u32, _b: u32, ) -> Weight { + fn execute_issue_overpayment (h: u32, i: u32, o: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `3248` - // Estimated: `3737` - // Minimum execution time: 313_197_000 picoseconds. - Weight::from_parts(676_783_389, 3737) - // Standard Error: 967_719 - .saturating_add(Weight::from_parts(1_294_288, 0).saturating_mul(h.into())) + // Measured: `3278` + // Estimated: `3760` + // Minimum execution time: 305_000_000 picoseconds. + Weight::from_parts(260_494_913, 3760) + // Standard Error: 216_506 + .saturating_add(Weight::from_parts(2_125_000, 0).saturating_mul(h.into())) + // Standard Error: 192_450 + .saturating_add(Weight::from_parts(555_555, 0).saturating_mul(i.into())) + // Standard Error: 192_450 + .saturating_add(Weight::from_parts(444_444, 0).saturating_mul(o.into())) + // Standard Error: 1_355 + .saturating_add(Weight::from_parts(17_214, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(17_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } /// Storage: Issue IssueRequests (r:1 w:1) - /// Proof: Issue IssueRequests (max_values: None, max_size: Some(272), added: 2747, mode: MaxEncodedLen) + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) /// Storage: BTCRelay DisableInclusionCheck (r:1 w:0) /// Proof: BTCRelay DisableInclusionCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: BTCRelay BestBlockHeight (r:1 w:0) @@ -194,7 +202,7 @@ impl issue::WeightInfo for WeightInfo { /// Storage: BTCRelay StableParachainConfirmations (r:1 w:0) /// Proof: BTCRelay StableParachainConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: Fee IssueFee (r:1 w:0) /// Proof: Fee IssueFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:1 w:1) @@ -207,23 +215,23 @@ impl issue::WeightInfo for WeightInfo { /// The range of component `i` is `[1, 10]`. /// The range of component `o` is `[1, 10]`. /// The range of component `b` is `[770, 2048]`. - fn execute_issue_underpayment (h: u32, _i: u32, o: u32, b: u32, ) -> Weight { + fn execute_issue_underpayment (h: u32, i: u32, o: u32, _b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `2739` - // Estimated: `3737` - // Minimum execution time: 231_854_000 picoseconds. - Weight::from_parts(253_010_791, 3737) - // Standard Error: 189_488 - .saturating_add(Weight::from_parts(3_800_800, 0).saturating_mul(h.into())) - // Standard Error: 170_748 - .saturating_add(Weight::from_parts(167_716, 0).saturating_mul(o.into())) - // Standard Error: 1_225 - .saturating_add(Weight::from_parts(6_220, 0).saturating_mul(b.into())) + // Measured: `2727` + // Estimated: `3760` + // Minimum execution time: 220_000_000 picoseconds. + Weight::from_parts(220_934_076, 3760) + // Standard Error: 1_840_303 + .saturating_add(Weight::from_parts(3_437_500, 0).saturating_mul(h.into())) + // Standard Error: 1_635_825 + .saturating_add(Weight::from_parts(611_111, 0).saturating_mul(i.into())) + // Standard Error: 1_635_825 + .saturating_add(Weight::from_parts(611_111, 0).saturating_mul(o.into())) .saturating_add(T::DbWeight::get().reads(13_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } /// Storage: Issue IssueRequests (r:1 w:1) - /// Proof: Issue IssueRequests (max_values: None, max_size: Some(272), added: 2747, mode: MaxEncodedLen) + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) /// Storage: BTCRelay DisableInclusionCheck (r:1 w:0) /// Proof: BTCRelay DisableInclusionCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: BTCRelay BestBlockHeight (r:1 w:0) @@ -239,7 +247,7 @@ impl issue::WeightInfo for WeightInfo { /// Storage: BTCRelay StableParachainConfirmations (r:1 w:0) /// Proof: BTCRelay StableParachainConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:1 w:1) /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) /// Storage: Tokens TotalIssuance (r:1 w:1) @@ -250,25 +258,21 @@ impl issue::WeightInfo for WeightInfo { /// The range of component `i` is `[1, 10]`. /// The range of component `o` is `[1, 10]`. /// The range of component `b` is `[770, 2048]`. - fn execute_expired_issue_exact (h: u32, i: u32, o: u32, b: u32, ) -> Weight { + fn execute_expired_issue_exact (h: u32, _i: u32, _o: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `3363` - // Estimated: `3737` - // Minimum execution time: 201_924_000 picoseconds. - Weight::from_parts(139_929_561, 3737) - // Standard Error: 194_156 - .saturating_add(Weight::from_parts(3_652_125, 0).saturating_mul(h.into())) - // Standard Error: 174_955 - .saturating_add(Weight::from_parts(1_547_829, 0).saturating_mul(i.into())) - // Standard Error: 174_955 - .saturating_add(Weight::from_parts(1_815_584, 0).saturating_mul(o.into())) - // Standard Error: 1_255 - .saturating_add(Weight::from_parts(16_572, 0).saturating_mul(b.into())) + // Measured: `3287` + // Estimated: `3760` + // Minimum execution time: 193_000_000 picoseconds. + Weight::from_parts(223_547_730, 3760) + // Standard Error: 649_519 + .saturating_add(Weight::from_parts(4_000_000, 0).saturating_mul(h.into())) + // Standard Error: 4_065 + .saturating_add(Weight::from_parts(9_389, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(12_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } /// Storage: Issue IssueRequests (r:1 w:1) - /// Proof: Issue IssueRequests (max_values: None, max_size: Some(272), added: 2747, mode: MaxEncodedLen) + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) /// Storage: BTCRelay DisableInclusionCheck (r:1 w:0) /// Proof: BTCRelay DisableInclusionCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: BTCRelay BestBlockHeight (r:1 w:0) @@ -284,7 +288,7 @@ impl issue::WeightInfo for WeightInfo { /// Storage: BTCRelay StableParachainConfirmations (r:1 w:0) /// Proof: BTCRelay StableParachainConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) /// Storage: Oracle Aggregate (r:1 w:0) @@ -305,25 +309,23 @@ impl issue::WeightInfo for WeightInfo { /// The range of component `i` is `[1, 10]`. /// The range of component `o` is `[1, 10]`. /// The range of component `b` is `[770, 2048]`. - fn execute_expired_issue_overpayment (h: u32, i: u32, o: u32, b: u32, ) -> Weight { + fn execute_expired_issue_overpayment (h: u32, i: u32, _o: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `3947 + h * (1 ±0) + i * (1 ±0)` - // Estimated: `3737` - // Minimum execution time: 319_510_000 picoseconds. - Weight::from_parts(297_484_836, 3737) - // Standard Error: 93_915 - .saturating_add(Weight::from_parts(3_775_028, 0).saturating_mul(h.into())) - // Standard Error: 84_627 - .saturating_add(Weight::from_parts(1_330_041, 0).saturating_mul(i.into())) - // Standard Error: 84_627 - .saturating_add(Weight::from_parts(179_165, 0).saturating_mul(o.into())) - // Standard Error: 607 - .saturating_add(Weight::from_parts(2_628, 0).saturating_mul(b.into())) + // Measured: `4018 + h * (9 ±0) + i * (4 ±0)` + // Estimated: `3760` + // Minimum execution time: 314_000_000 picoseconds. + Weight::from_parts(269_041_862, 3760) + // Standard Error: 3_031_088 + .saturating_add(Weight::from_parts(2_875_000, 0).saturating_mul(h.into())) + // Standard Error: 2_694_301 + .saturating_add(Weight::from_parts(1_555_555, 0).saturating_mul(i.into())) + // Standard Error: 18_973 + .saturating_add(Weight::from_parts(16_431, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(17_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } /// Storage: Issue IssueRequests (r:1 w:1) - /// Proof: Issue IssueRequests (max_values: None, max_size: Some(272), added: 2747, mode: MaxEncodedLen) + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) /// Storage: BTCRelay DisableInclusionCheck (r:1 w:0) /// Proof: BTCRelay DisableInclusionCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: BTCRelay BestBlockHeight (r:1 w:0) @@ -339,7 +341,7 @@ impl issue::WeightInfo for WeightInfo { /// Storage: BTCRelay StableParachainConfirmations (r:1 w:0) /// Proof: BTCRelay StableParachainConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: Fee IssueFee (r:1 w:0) /// Proof: Fee IssueFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:1 w:1) @@ -352,23 +354,25 @@ impl issue::WeightInfo for WeightInfo { /// The range of component `i` is `[1, 10]`. /// The range of component `o` is `[1, 10]`. /// The range of component `b` is `[770, 2048]`. - fn execute_expired_issue_underpayment (h: u32, i: u32, _o: u32, b: u32, ) -> Weight { + fn execute_expired_issue_underpayment (h: u32, i: u32, o: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `3653` - // Estimated: `3737` - // Minimum execution time: 241_423_000 picoseconds. - Weight::from_parts(228_353_888, 3737) - // Standard Error: 69_658 - .saturating_add(Weight::from_parts(3_202_457, 0).saturating_mul(h.into())) - // Standard Error: 62_769 - .saturating_add(Weight::from_parts(689_283, 0).saturating_mul(i.into())) - // Standard Error: 450 - .saturating_add(Weight::from_parts(3_239, 0).saturating_mul(b.into())) + // Measured: `4257` + // Estimated: `3760` + // Minimum execution time: 225_000_000 picoseconds. + Weight::from_parts(169_911_776, 3760) + // Standard Error: 108_253 + .saturating_add(Weight::from_parts(4_312_500, 0).saturating_mul(h.into())) + // Standard Error: 96_225 + .saturating_add(Weight::from_parts(2_166_666, 0).saturating_mul(i.into())) + // Standard Error: 96_225 + .saturating_add(Weight::from_parts(1_277_777, 0).saturating_mul(o.into())) + // Standard Error: 677 + .saturating_add(Weight::from_parts(5_868, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(13_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } /// Storage: Issue IssueRequests (r:1 w:1) - /// Proof: Issue IssueRequests (max_values: None, max_size: Some(272), added: 2747, mode: MaxEncodedLen) + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) /// Storage: Issue IssuePeriod (r:1 w:0) /// Proof: Issue IssuePeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: Security ActiveBlockCount (r:1 w:0) @@ -376,24 +380,41 @@ impl issue::WeightInfo for WeightInfo { /// Storage: BTCRelay BestBlockHeight (r:1 w:0) /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) fn cancel_issue () -> Weight { // Proof Size summary in bytes: - // Measured: `1495` - // Estimated: `3737` - // Minimum execution time: 89_729_000 picoseconds. - Weight::from_parts(90_551_000, 3737) + // Measured: `1485` + // Estimated: `3760` + // Minimum execution time: 90_000_000 picoseconds. + Weight::from_parts(90_000_000, 3760) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } + /// Storage: Issue IssueRequests (r:1 w:1) + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) + /// Storage: Issue IssuePeriod (r:1 w:0) + /// Proof: Issue IssuePeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: Security ActiveBlockCount (r:1 w:0) + /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: BTCRelay BestBlockHeight (r:1 w:0) + /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + fn cancel_issue_for_replace () -> Weight { + // Proof Size summary in bytes: + // Measured: `1007` + // Estimated: `3760` + // Minimum execution time: 63_000_000 picoseconds. + Weight::from_parts(63_000_000, 3760) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } /// Storage: Issue IssuePeriod (r:0 w:1) /// Proof: Issue IssuePeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) fn set_issue_period () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 17_425_000 picoseconds. - Weight::from_parts(17_906_000, 0) + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(17_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } } \ No newline at end of file diff --git a/parachain/runtime/interlay/src/weights/redeem.rs b/parachain/runtime/interlay/src/weights/redeem.rs index 296c5bdfa6..967effd348 100644 --- a/parachain/runtime/interlay/src/weights/redeem.rs +++ b/parachain/runtime/interlay/src/weights/redeem.rs @@ -2,31 +2,31 @@ //! Autogenerated weights for redeem //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-29, STEPS: `2`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `interlay-rust-runner-2mz2v-jrrg4`, CPU: `AMD EPYC 7502P 32-Core Processor` +//! HOSTNAME: `Nakuls-MacBook-Pro.local`, CPU: `` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("interlay-dev"), DB CACHE: 1024 // Executed Command: -// target/release/interbtc-parachain +// ./target/release/interbtc-parachain // benchmark // pallet // --pallet -// * +// redeem // --extrinsic // * -// --chain -// interlay-dev // --execution=wasm // --wasm-execution=compiled // --steps -// 50 +// 2 // --repeat -// 10 -// --output -// parachain/runtime/interlay/src/weights/ +// 1 // --template // .deploy/runtime-weight-template.hbs +// --chain +// interlay-dev +// --output +// generated_weight_interlay.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -40,6 +40,8 @@ pub struct WeightInfo(PhantomData); impl redeem::WeightInfo for WeightInfo { + /// Storage: VaultRegistry Vaults (r:1 w:1) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:2 w:1) /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) /// Storage: Fee RedeemFee (r:1 w:0) @@ -48,8 +50,6 @@ impl redeem::WeightInfo for WeightInfo { /// Proof: Redeem RedeemTransactionSize (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: Oracle Aggregate (r:2 w:0) /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) - /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) /// Storage: Redeem RedeemBtcDustValue (r:1 w:0) /// Proof: Redeem RedeemBtcDustValue (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: Security Nonce (r:1 w:1) @@ -91,13 +91,13 @@ impl redeem::WeightInfo for WeightInfo { /// Storage: BTCRelay BestBlockHeight (r:1 w:0) /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: Redeem RedeemRequests (r:0 w:1) - /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(245), added: 2720, mode: MaxEncodedLen) + /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(278), added: 2753, mode: MaxEncodedLen) fn request_redeem () -> Weight { // Proof Size summary in bytes: - // Measured: `3155` + // Measured: `3107` // Estimated: `6260` - // Minimum execution time: 310_652_000 picoseconds. - Weight::from_parts(313_168_000, 6260) + // Minimum execution time: 307_000_000 picoseconds. + Weight::from_parts(307_000_000, 6260) .saturating_add(T::DbWeight::get().reads(28_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -129,13 +129,13 @@ impl redeem::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `2173` // Estimated: `8760` - // Minimum execution time: 283_197_000 picoseconds. - Weight::from_parts(284_509_000, 8760) + // Minimum execution time: 292_000_000 picoseconds. + Weight::from_parts(292_000_000, 8760) .saturating_add(T::DbWeight::get().reads(16_u64)) .saturating_add(T::DbWeight::get().writes(11_u64)) } /// Storage: Redeem RedeemRequests (r:1 w:1) - /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(245), added: 2720, mode: MaxEncodedLen) + /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(278), added: 2753, mode: MaxEncodedLen) /// Storage: BTCRelay DisableInclusionCheck (r:1 w:0) /// Proof: BTCRelay DisableInclusionCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: BTCRelay BestBlockHeight (r:1 w:0) @@ -155,30 +155,30 @@ impl redeem::WeightInfo for WeightInfo { /// Storage: Tokens TotalIssuance (r:1 w:1) /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// The range of component `h` is `[2, 10]`. /// The range of component `i` is `[1, 10]`. /// The range of component `o` is `[2, 3]`. /// The range of component `b` is `[541, 2048]`. fn execute_redeem (h: u32, i: u32, o: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `2295 + o * (1 ±0)` - // Estimated: `3725` - // Minimum execution time: 183_618_000 picoseconds. - Weight::from_parts(155_534_743, 3725) - // Standard Error: 117_935 - .saturating_add(Weight::from_parts(3_687_939, 0).saturating_mul(h.into())) - // Standard Error: 106_320 - .saturating_add(Weight::from_parts(952_959, 0).saturating_mul(i.into())) - // Standard Error: 644_527 - .saturating_add(Weight::from_parts(862_990, 0).saturating_mul(o.into())) - // Standard Error: 649 - .saturating_add(Weight::from_parts(4_928, 0).saturating_mul(b.into())) + // Measured: `2248 + o * (1 ±0)` + // Estimated: `3743` + // Minimum execution time: 182_000_000 picoseconds. + Weight::from_parts(136_635_488, 3743) + // Standard Error: 108_253 + .saturating_add(Weight::from_parts(562_500, 0).saturating_mul(h.into())) + // Standard Error: 96_225 + .saturating_add(Weight::from_parts(1_611_111, 0).saturating_mul(i.into())) + // Standard Error: 866_025 + .saturating_add(Weight::from_parts(7_500_000, 0).saturating_mul(o.into())) + // Standard Error: 574 + .saturating_add(Weight::from_parts(7_631, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(11_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } /// Storage: Redeem RedeemRequests (r:1 w:1) - /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(245), added: 2720, mode: MaxEncodedLen) + /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(278), added: 2753, mode: MaxEncodedLen) /// Storage: Redeem RedeemPeriod (r:1 w:0) /// Proof: Redeem RedeemPeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: Security ActiveBlockCount (r:1 w:0) @@ -186,7 +186,7 @@ impl redeem::WeightInfo for WeightInfo { /// Storage: BTCRelay BestBlockHeight (r:1 w:0) /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: Loans UnderlyingAssetId (r:1 w:0) /// Proof: Loans UnderlyingAssetId (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) /// Storage: Oracle Aggregate (r:1 w:0) @@ -267,15 +267,15 @@ impl redeem::WeightInfo for WeightInfo { /// Proof: VaultRegistry PunishmentDelay (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) fn cancel_redeem_reimburse () -> Weight { // Proof Size summary in bytes: - // Measured: `5396` + // Measured: `5349` // Estimated: `11350` - // Minimum execution time: 847_787_000 picoseconds. - Weight::from_parts(851_295_000, 11350) + // Minimum execution time: 753_000_000 picoseconds. + Weight::from_parts(753_000_000, 11350) .saturating_add(T::DbWeight::get().reads(59_u64)) .saturating_add(T::DbWeight::get().writes(29_u64)) } /// Storage: Redeem RedeemRequests (r:1 w:1) - /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(245), added: 2720, mode: MaxEncodedLen) + /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(278), added: 2753, mode: MaxEncodedLen) /// Storage: Redeem RedeemPeriod (r:1 w:0) /// Proof: Redeem RedeemPeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: Security ActiveBlockCount (r:1 w:0) @@ -283,7 +283,7 @@ impl redeem::WeightInfo for WeightInfo { /// Storage: BTCRelay BestBlockHeight (r:1 w:0) /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: Loans UnderlyingAssetId (r:1 w:0) /// Proof: Loans UnderlyingAssetId (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) /// Storage: Oracle Aggregate (r:1 w:0) @@ -364,63 +364,115 @@ impl redeem::WeightInfo for WeightInfo { /// Proof: VaultRegistry PunishmentDelay (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) fn cancel_redeem_retry () -> Weight { // Proof Size summary in bytes: - // Measured: `5396` + // Measured: `5349` // Estimated: `11350` - // Minimum execution time: 775_122_000 picoseconds. - Weight::from_parts(783_890_000, 11350) + // Minimum execution time: 724_000_000 picoseconds. + Weight::from_parts(724_000_000, 11350) .saturating_add(T::DbWeight::get().reads(58_u64)) .saturating_add(T::DbWeight::get().writes(28_u64)) } + /// Storage: Redeem RedeemRequests (r:1 w:1) + /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(278), added: 2753, mode: MaxEncodedLen) + /// Storage: Redeem RedeemPeriod (r:1 w:0) + /// Proof: Redeem RedeemPeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: Security ActiveBlockCount (r:1 w:0) + /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: BTCRelay BestBlockHeight (r:1 w:0) + /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: Issue IssueRequests (r:1 w:1) + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) + /// Storage: Issue IssuePeriod (r:1 w:0) + /// Proof: Issue IssuePeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: VaultRegistry Vaults (r:2 w:2) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) + /// Storage: Oracle Aggregate (r:1 w:0) + /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) + /// Storage: Fee PunishmentFee (r:1 w:0) + /// Proof: Fee PunishmentFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// Storage: VaultStaking Nonce (r:1 w:0) + /// Proof: VaultStaking Nonce (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) + /// Storage: VaultStaking TotalCurrentStake (r:1 w:0) + /// Proof: VaultStaking TotalCurrentStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) + /// Storage: VaultRegistry TotalUserVaultCollateral (r:1 w:1) + /// Proof: VaultRegistry TotalUserVaultCollateral (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) + /// Storage: VaultCapacity Stake (r:1 w:0) + /// Proof: VaultCapacity Stake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: VaultCapacity RewardPerToken (r:2 w:0) + /// Proof: VaultCapacity RewardPerToken (max_values: None, max_size: Some(59), added: 2534, mode: MaxEncodedLen) + /// Storage: VaultCapacity RewardTally (r:2 w:2) + /// Proof: VaultCapacity RewardTally (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) + /// Storage: VaultCapacity TotalRewards (r:2 w:2) + /// Proof: VaultCapacity TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: VaultRewards Stake (r:1 w:0) + /// Proof: VaultRewards Stake (max_values: None, max_size: Some(97), added: 2572, mode: MaxEncodedLen) + /// Storage: VaultRewards RewardPerToken (r:2 w:0) + /// Proof: VaultRewards RewardPerToken (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) + /// Storage: VaultRewards RewardTally (r:2 w:2) + /// Proof: VaultRewards RewardTally (max_values: None, max_size: Some(124), added: 2599, mode: MaxEncodedLen) + /// Storage: VaultRewards TotalRewards (r:2 w:2) + /// Proof: VaultRewards TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Fee Commission (r:1 w:0) + /// Proof: Fee Commission (max_values: None, max_size: Some(86), added: 2561, mode: MaxEncodedLen) + /// Storage: VaultStaking RewardPerToken (r:2 w:2) + /// Proof: VaultStaking RewardPerToken (max_values: None, max_size: Some(117), added: 2592, mode: MaxEncodedLen) + /// Storage: VaultStaking TotalStake (r:1 w:0) + /// Proof: VaultStaking TotalStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) + /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) + /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) + /// Storage: VaultRewards TotalStake (r:1 w:0) + /// Proof: VaultRewards TotalStake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + fn cancel_replace () -> Weight { + // Proof Size summary in bytes: + // Measured: `4412` + // Estimated: `6364` + // Minimum execution time: 397_000_000 picoseconds. + Weight::from_parts(397_000_000, 6364) + .saturating_add(T::DbWeight::get().reads(33_u64)) + .saturating_add(T::DbWeight::get().writes(15_u64)) + } /// Storage: Redeem RedeemPeriod (r:0 w:1) /// Proof: Redeem RedeemPeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) fn set_redeem_period () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 18_136_000 picoseconds. - Weight::from_parts(18_727_000, 0) + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(17_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:1 w:1) /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) /// Storage: Tokens TotalIssuance (r:1 w:1) /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) fn self_redeem () -> Weight { // Proof Size summary in bytes: - // Measured: `1427` - // Estimated: `3725` - // Minimum execution time: 149_329_000 picoseconds. - Weight::from_parts(152_415_000, 3725) + // Measured: `1379` + // Estimated: `3677` + // Minimum execution time: 111_000_000 picoseconds. + Weight::from_parts(111_000_000, 3677) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } - - /// Storage: VaultRegistry Vaults (r:2 w:2) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: BTCRelay StartBlockHeight (r:1 w:0) /// Proof: BTCRelay StartBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: BTCRelay StableBitcoinConfirmations (r:1 w:0) /// Proof: BTCRelay StableBitcoinConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: BTCRelay BestBlockHeight (r:1 w:0) /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Oracle Aggregate (r:3 w:0) - /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) - /// Storage: Fee IssueGriefingCollateral (r:1 w:0) - /// Proof: Fee IssueGriefingCollateral (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:1 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: VaultRegistry Vaults (r:2 w:2) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: Issue IssueBtcDustValue (r:1 w:0) /// Proof: Issue IssueBtcDustValue (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) + /// Storage: Oracle Aggregate (r:1 w:0) + /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) /// Storage: VaultStaking Nonce (r:2 w:0) /// Proof: VaultStaking Nonce (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) /// Storage: VaultStaking TotalCurrentStake (r:2 w:0) /// Proof: VaultStaking TotalCurrentStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: Fee IssueFee (r:1 w:0) - /// Proof: Fee IssueFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: Security Nonce (r:1 w:1) /// Proof: Security Nonce (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) /// Storage: System ParentHash (r:1 w:0) @@ -433,8 +485,6 @@ impl redeem::WeightInfo for WeightInfo { /// Proof: Issue IssuePeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: Fee RedeemFee (r:1 w:0) /// Proof: Fee RedeemFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Redeem RedeemTransactionSize (r:1 w:0) - /// Proof: Redeem RedeemTransactionSize (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: Redeem RedeemBtcDustValue (r:1 w:0) /// Proof: Redeem RedeemBtcDustValue (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: VaultRegistry PremiumRedeemThreshold (r:1 w:0) @@ -445,15 +495,52 @@ impl redeem::WeightInfo for WeightInfo { /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) /// Storage: Redeem RedeemRequests (r:0 w:1) /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(278), added: 2753, mode: MaxEncodedLen) - /// Storage: Redeem Requests (r:0 w:1) - /// Proof: Redeem Requests (max_values: None, max_size: Some(80), added: 2555, mode: MaxEncodedLen) - fn request_replace() -> Weight { + fn request_replace () -> Weight { // Proof Size summary in bytes: - // Measured: `3277` - // Estimated: `8547` - // Minimum execution time: 39_015_000_000 picoseconds. - Weight::from_parts(39_015_000_000, 8547) - .saturating_add(T::DbWeight::get().reads(27_u64)) - .saturating_add(T::DbWeight::get().writes(7_u64)) + // Measured: `2641` + // Estimated: `6364` + // Minimum execution time: 39_118_000_000 picoseconds. + Weight::from_parts(39_118_000_000, 6364) + .saturating_add(T::DbWeight::get().reads(21_u64)) + .saturating_add(T::DbWeight::get().writes(5_u64)) + } + /// Storage: Redeem RedeemRequests (r:1 w:1) + /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(278), added: 2753, mode: MaxEncodedLen) + /// Storage: BTCRelay DisableInclusionCheck (r:1 w:0) + /// Proof: BTCRelay DisableInclusionCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) + /// Storage: BTCRelay BestBlockHeight (r:1 w:0) + /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: BTCRelay Chains (r:1 w:0) + /// Proof: BTCRelay Chains (max_values: None, max_size: Some(24), added: 2499, mode: MaxEncodedLen) + /// Storage: BTCRelay BlockHeaders (r:1 w:0) + /// Proof: BTCRelay BlockHeaders (max_values: None, max_size: Some(200), added: 2675, mode: MaxEncodedLen) + /// Storage: BTCRelay StableBitcoinConfirmations (r:1 w:0) + /// Proof: BTCRelay StableBitcoinConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: Security ActiveBlockCount (r:1 w:0) + /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: BTCRelay StableParachainConfirmations (r:1 w:0) + /// Proof: BTCRelay StableParachainConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: VaultRegistry Vaults (r:2 w:2) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) + /// Storage: Issue IssueRequests (r:1 w:1) + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) + /// The range of component `h` is `[2, 10]`. + /// The range of component `i` is `[1, 10]`. + /// The range of component `o` is `[2, 3]`. + /// The range of component `b` is `[541, 2048]`. + fn execute_replace (h: u32, i: u32, _o: u32, b: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `2286` + // Estimated: `6364` + // Minimum execution time: 172_000_000 picoseconds. + Weight::from_parts(166_279_897, 6364) + // Standard Error: 216_506 + .saturating_add(Weight::from_parts(3_125_000, 0).saturating_mul(h.into())) + // Standard Error: 192_450 + .saturating_add(Weight::from_parts(111_111, 0).saturating_mul(i.into())) + // Standard Error: 1_149 + .saturating_add(Weight::from_parts(663, 0).saturating_mul(b.into())) + .saturating_add(T::DbWeight::get().reads(11_u64)) + .saturating_add(T::DbWeight::get().writes(4_u64)) } } \ No newline at end of file diff --git a/parachain/runtime/kintsugi/src/lib.rs b/parachain/runtime/kintsugi/src/lib.rs index 2f835f2dee..f2df4a8d7d 100644 --- a/parachain/runtime/kintsugi/src/lib.rs +++ b/parachain/runtime/kintsugi/src/lib.rs @@ -1247,7 +1247,8 @@ construct_runtime! { Oracle: oracle::{Pallet, Call, Config, Storage, Event} = 62, Issue: issue::{Pallet, Call, Config, Storage, Event} = 63, Redeem: redeem::{Pallet, Call, Config, Storage, Event} = 64, - Fee: fee::{Pallet, Call, Config, Storage} = 65, + // Replace: 65 + Fee: fee::{Pallet, Call, Config, Storage} = 66, // Refund: 67 Nomination: nomination::{Pallet, Call, Config, Storage, Event} = 68, ClientsInfo: clients_info::{Pallet, Call, Storage, Event} = 69, diff --git a/parachain/runtime/kintsugi/src/weights/issue.rs b/parachain/runtime/kintsugi/src/weights/issue.rs index 10f28c57a2..eeeded9f67 100644 --- a/parachain/runtime/kintsugi/src/weights/issue.rs +++ b/parachain/runtime/kintsugi/src/weights/issue.rs @@ -2,31 +2,31 @@ //! Autogenerated weights for issue //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-29, STEPS: `2`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `interlay-rust-runner-2mz2v-kcxvd`, CPU: `AMD EPYC 7502P 32-Core Processor` +//! HOSTNAME: `Nakuls-MacBook-Pro.local`, CPU: `` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 // Executed Command: -// target/release/interbtc-parachain +// ./target/release/interbtc-parachain // benchmark // pallet // --pallet -// * +// issue // --extrinsic // * -// --chain -// kintsugi-dev // --execution=wasm // --wasm-execution=compiled // --steps -// 50 +// 2 // --repeat -// 10 -// --output -// parachain/runtime/kintsugi/src/weights/ +// 1 // --template // .deploy/runtime-weight-template.hbs +// --chain +// kintsugi-dev +// --output +// generated_weight_kintsugi.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -47,13 +47,15 @@ impl issue::WeightInfo for WeightInfo { /// Storage: BTCRelay BestBlockHeight (r:1 w:0) /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: Oracle Aggregate (r:2 w:0) /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) /// Storage: Fee IssueGriefingCollateral (r:1 w:0) /// Proof: Fee IssueGriefingCollateral (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:1 w:1) /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: Fee IssueFee (r:1 w:0) + /// Proof: Fee IssueFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: Issue IssueBtcDustValue (r:1 w:0) /// Proof: Issue IssueBtcDustValue (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) @@ -62,8 +64,6 @@ impl issue::WeightInfo for WeightInfo { /// Proof: VaultStaking Nonce (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) /// Storage: VaultStaking TotalCurrentStake (r:1 w:0) /// Proof: VaultStaking TotalCurrentStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: Fee IssueFee (r:1 w:0) - /// Proof: Fee IssueFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: Security Nonce (r:1 w:1) /// Proof: Security Nonce (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) /// Storage: System ParentHash (r:1 w:0) @@ -75,18 +75,18 @@ impl issue::WeightInfo for WeightInfo { /// Storage: Issue IssuePeriod (r:1 w:0) /// Proof: Issue IssuePeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: Issue IssueRequests (r:0 w:1) - /// Proof: Issue IssueRequests (max_values: None, max_size: Some(272), added: 2747, mode: MaxEncodedLen) + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) fn request_issue () -> Weight { // Proof Size summary in bytes: - // Measured: `2718` + // Measured: `2690` // Estimated: `6028` - // Minimum execution time: 558_298_000 picoseconds. - Weight::from_parts(565_393_000, 6028) + // Minimum execution time: 38_621_000_000 picoseconds. + Weight::from_parts(38_621_000_000, 6028) .saturating_add(T::DbWeight::get().reads(18_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } /// Storage: Issue IssueRequests (r:1 w:1) - /// Proof: Issue IssueRequests (max_values: None, max_size: Some(272), added: 2747, mode: MaxEncodedLen) + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) /// Storage: BTCRelay DisableInclusionCheck (r:1 w:0) /// Proof: BTCRelay DisableInclusionCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: BTCRelay BestBlockHeight (r:1 w:0) @@ -102,7 +102,7 @@ impl issue::WeightInfo for WeightInfo { /// Storage: BTCRelay StableParachainConfirmations (r:1 w:0) /// Proof: BTCRelay StableParachainConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:1 w:1) /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) /// Storage: Tokens TotalIssuance (r:1 w:1) @@ -113,25 +113,21 @@ impl issue::WeightInfo for WeightInfo { /// The range of component `i` is `[1, 10]`. /// The range of component `o` is `[1, 10]`. /// The range of component `b` is `[770, 2048]`. - fn execute_issue_exact (h: u32, i: u32, o: u32, b: u32, ) -> Weight { + fn execute_issue_exact (_h: u32, i: u32, o: u32, _b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `2434` - // Estimated: `3737` - // Minimum execution time: 198_538_000 picoseconds. - Weight::from_parts(171_478_384, 3737) - // Standard Error: 67_279 - .saturating_add(Weight::from_parts(3_496_696, 0).saturating_mul(h.into())) - // Standard Error: 60_626 - .saturating_add(Weight::from_parts(794_967, 0).saturating_mul(i.into())) - // Standard Error: 60_626 - .saturating_add(Weight::from_parts(420_219, 0).saturating_mul(o.into())) - // Standard Error: 435 - .saturating_add(Weight::from_parts(5_157, 0).saturating_mul(b.into())) + // Measured: `2448` + // Estimated: `3760` + // Minimum execution time: 206_000_000 picoseconds. + Weight::from_parts(261_839_397, 3760) + // Standard Error: 96_225 + .saturating_add(Weight::from_parts(277_777, 0).saturating_mul(i.into())) + // Standard Error: 96_225 + .saturating_add(Weight::from_parts(166_666, 0).saturating_mul(o.into())) .saturating_add(T::DbWeight::get().reads(12_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } /// Storage: Issue IssueRequests (r:1 w:1) - /// Proof: Issue IssueRequests (max_values: None, max_size: Some(272), added: 2747, mode: MaxEncodedLen) + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) /// Storage: BTCRelay DisableInclusionCheck (r:1 w:0) /// Proof: BTCRelay DisableInclusionCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: BTCRelay BestBlockHeight (r:1 w:0) @@ -147,7 +143,7 @@ impl issue::WeightInfo for WeightInfo { /// Storage: BTCRelay StableParachainConfirmations (r:1 w:0) /// Proof: BTCRelay StableParachainConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) /// Storage: Oracle Aggregate (r:1 w:0) @@ -168,25 +164,23 @@ impl issue::WeightInfo for WeightInfo { /// The range of component `i` is `[1, 10]`. /// The range of component `o` is `[1, 10]`. /// The range of component `b` is `[770, 2048]`. - fn execute_issue_overpayment (h: u32, i: u32, o: u32, b: u32, ) -> Weight { + fn execute_issue_overpayment (_h: u32, i: u32, o: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `3285` - // Estimated: `3737` - // Minimum execution time: 316_013_000 picoseconds. - Weight::from_parts(296_206_373, 3737) - // Standard Error: 170_956 - .saturating_add(Weight::from_parts(3_648_998, 0).saturating_mul(h.into())) - // Standard Error: 154_049 - .saturating_add(Weight::from_parts(965_687, 0).saturating_mul(i.into())) - // Standard Error: 154_049 - .saturating_add(Weight::from_parts(440_368, 0).saturating_mul(o.into())) - // Standard Error: 1_105 - .saturating_add(Weight::from_parts(1_242, 0).saturating_mul(b.into())) + // Measured: `3335` + // Estimated: `3760` + // Minimum execution time: 307_000_000 picoseconds. + Weight::from_parts(277_172_143, 3760) + // Standard Error: 1_347_150 + .saturating_add(Weight::from_parts(777_777, 0).saturating_mul(i.into())) + // Standard Error: 1_347_150 + .saturating_add(Weight::from_parts(1_000_000, 0).saturating_mul(o.into())) + // Standard Error: 9_486 + .saturating_add(Weight::from_parts(15_649, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(17_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } /// Storage: Issue IssueRequests (r:1 w:1) - /// Proof: Issue IssueRequests (max_values: None, max_size: Some(272), added: 2747, mode: MaxEncodedLen) + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) /// Storage: BTCRelay DisableInclusionCheck (r:1 w:0) /// Proof: BTCRelay DisableInclusionCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: BTCRelay BestBlockHeight (r:1 w:0) @@ -202,7 +196,7 @@ impl issue::WeightInfo for WeightInfo { /// Storage: BTCRelay StableParachainConfirmations (r:1 w:0) /// Proof: BTCRelay StableParachainConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: Fee IssueFee (r:1 w:0) /// Proof: Fee IssueFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:1 w:1) @@ -215,23 +209,23 @@ impl issue::WeightInfo for WeightInfo { /// The range of component `i` is `[1, 10]`. /// The range of component `o` is `[1, 10]`. /// The range of component `b` is `[770, 2048]`. - fn execute_issue_underpayment (h: u32, i: u32, o: u32, _b: u32, ) -> Weight { + fn execute_issue_underpayment (h: u32, i: u32, _o: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `2739` - // Estimated: `3737` - // Minimum execution time: 236_814_000 picoseconds. - Weight::from_parts(218_087_002, 3737) - // Standard Error: 143_849 - .saturating_add(Weight::from_parts(3_739_468, 0).saturating_mul(h.into())) - // Standard Error: 129_622 - .saturating_add(Weight::from_parts(1_289_008, 0).saturating_mul(i.into())) - // Standard Error: 129_622 - .saturating_add(Weight::from_parts(452_541, 0).saturating_mul(o.into())) + // Measured: `2747` + // Estimated: `3760` + // Minimum execution time: 214_000_000 picoseconds. + Weight::from_parts(184_539_123, 3760) + // Standard Error: 1_732_050 + .saturating_add(Weight::from_parts(4_250_000, 0).saturating_mul(h.into())) + // Standard Error: 1_539_600 + .saturating_add(Weight::from_parts(1_555_555, 0).saturating_mul(i.into())) + // Standard Error: 10_842 + .saturating_add(Weight::from_parts(8_607, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(13_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } /// Storage: Issue IssueRequests (r:1 w:1) - /// Proof: Issue IssueRequests (max_values: None, max_size: Some(272), added: 2747, mode: MaxEncodedLen) + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) /// Storage: BTCRelay DisableInclusionCheck (r:1 w:0) /// Proof: BTCRelay DisableInclusionCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: BTCRelay BestBlockHeight (r:1 w:0) @@ -247,7 +241,7 @@ impl issue::WeightInfo for WeightInfo { /// Storage: BTCRelay StableParachainConfirmations (r:1 w:0) /// Proof: BTCRelay StableParachainConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:1 w:1) /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) /// Storage: Tokens TotalIssuance (r:1 w:1) @@ -260,23 +254,23 @@ impl issue::WeightInfo for WeightInfo { /// The range of component `b` is `[770, 2048]`. fn execute_expired_issue_exact (h: u32, i: u32, o: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `3567` - // Estimated: `3737` - // Minimum execution time: 206_463_000 picoseconds. - Weight::from_parts(179_023_981, 3737) - // Standard Error: 118_695 - .saturating_add(Weight::from_parts(3_632_454, 0).saturating_mul(h.into())) - // Standard Error: 106_956 - .saturating_add(Weight::from_parts(825_036, 0).saturating_mul(i.into())) - // Standard Error: 106_956 - .saturating_add(Weight::from_parts(185_589, 0).saturating_mul(o.into())) - // Standard Error: 767 - .saturating_add(Weight::from_parts(6_936, 0).saturating_mul(b.into())) + // Measured: `3536` + // Estimated: `3760` + // Minimum execution time: 194_000_000 picoseconds. + Weight::from_parts(163_253_716, 3760) + // Standard Error: 974_278 + .saturating_add(Weight::from_parts(3_562_500, 0).saturating_mul(h.into())) + // Standard Error: 866_025 + .saturating_add(Weight::from_parts(611_111, 0).saturating_mul(i.into())) + // Standard Error: 866_025 + .saturating_add(Weight::from_parts(388_888, 0).saturating_mul(o.into())) + // Standard Error: 6_098 + .saturating_add(Weight::from_parts(6_651, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(12_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } /// Storage: Issue IssueRequests (r:1 w:1) - /// Proof: Issue IssueRequests (max_values: None, max_size: Some(272), added: 2747, mode: MaxEncodedLen) + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) /// Storage: BTCRelay DisableInclusionCheck (r:1 w:0) /// Proof: BTCRelay DisableInclusionCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: BTCRelay BestBlockHeight (r:1 w:0) @@ -292,7 +286,7 @@ impl issue::WeightInfo for WeightInfo { /// Storage: BTCRelay StableParachainConfirmations (r:1 w:0) /// Proof: BTCRelay StableParachainConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) /// Storage: Oracle Aggregate (r:1 w:0) @@ -313,25 +307,23 @@ impl issue::WeightInfo for WeightInfo { /// The range of component `i` is `[1, 10]`. /// The range of component `o` is `[1, 10]`. /// The range of component `b` is `[770, 2048]`. - fn execute_expired_issue_overpayment (h: u32, i: u32, o: u32, b: u32, ) -> Weight { + fn execute_expired_issue_overpayment (h: u32, i: u32, o: u32, _b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `4039 + h * (17 ±0) + i * (2 ±0)` - // Estimated: `3737` - // Minimum execution time: 326_534_000 picoseconds. - Weight::from_parts(312_629_634, 3737) - // Standard Error: 118_522 - .saturating_add(Weight::from_parts(3_380_960, 0).saturating_mul(h.into())) - // Standard Error: 106_800 - .saturating_add(Weight::from_parts(561_891, 0).saturating_mul(i.into())) - // Standard Error: 106_800 - .saturating_add(Weight::from_parts(164_257, 0).saturating_mul(o.into())) - // Standard Error: 766 - .saturating_add(Weight::from_parts(3_419, 0).saturating_mul(b.into())) + // Measured: `4141 + h * (21 ±0) + i * (3 ±0) + o * (3 ±0)` + // Estimated: `3760` + // Minimum execution time: 322_000_000 picoseconds. + Weight::from_parts(316_622_652, 3760) + // Standard Error: 108_253 + .saturating_add(Weight::from_parts(937_500, 0).saturating_mul(h.into())) + // Standard Error: 96_225 + .saturating_add(Weight::from_parts(1_055_555, 0).saturating_mul(i.into())) + // Standard Error: 96_225 + .saturating_add(Weight::from_parts(55_555, 0).saturating_mul(o.into())) .saturating_add(T::DbWeight::get().reads(17_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } /// Storage: Issue IssueRequests (r:1 w:1) - /// Proof: Issue IssueRequests (max_values: None, max_size: Some(272), added: 2747, mode: MaxEncodedLen) + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) /// Storage: BTCRelay DisableInclusionCheck (r:1 w:0) /// Proof: BTCRelay DisableInclusionCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: BTCRelay BestBlockHeight (r:1 w:0) @@ -347,7 +339,7 @@ impl issue::WeightInfo for WeightInfo { /// Storage: BTCRelay StableParachainConfirmations (r:1 w:0) /// Proof: BTCRelay StableParachainConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: Fee IssueFee (r:1 w:0) /// Proof: Fee IssueFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:1 w:1) @@ -360,25 +352,23 @@ impl issue::WeightInfo for WeightInfo { /// The range of component `i` is `[1, 10]`. /// The range of component `o` is `[1, 10]`. /// The range of component `b` is `[770, 2048]`. - fn execute_expired_issue_underpayment (h: u32, i: u32, o: u32, b: u32, ) -> Weight { + fn execute_expired_issue_underpayment (h: u32, i: u32, _o: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `3633 + o * (11 ±0)` - // Estimated: `3737` - // Minimum execution time: 245_292_000 picoseconds. - Weight::from_parts(218_248_263, 3737) - // Standard Error: 75_656 - .saturating_add(Weight::from_parts(3_638_323, 0).saturating_mul(h.into())) - // Standard Error: 68_174 - .saturating_add(Weight::from_parts(1_189_484, 0).saturating_mul(i.into())) - // Standard Error: 68_174 - .saturating_add(Weight::from_parts(378_537, 0).saturating_mul(o.into())) - // Standard Error: 489 - .saturating_add(Weight::from_parts(4_279, 0).saturating_mul(b.into())) + // Measured: `3990` + // Estimated: `3760` + // Minimum execution time: 231_000_000 picoseconds. + Weight::from_parts(177_273_669, 3760) + // Standard Error: 108_253 + .saturating_add(Weight::from_parts(5_437_500, 0).saturating_mul(h.into())) + // Standard Error: 96_225 + .saturating_add(Weight::from_parts(1_277_777, 0).saturating_mul(i.into())) + // Standard Error: 677 + .saturating_add(Weight::from_parts(16_040, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(13_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } /// Storage: Issue IssueRequests (r:1 w:1) - /// Proof: Issue IssueRequests (max_values: None, max_size: Some(272), added: 2747, mode: MaxEncodedLen) + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) /// Storage: Issue IssuePeriod (r:1 w:0) /// Proof: Issue IssuePeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: Security ActiveBlockCount (r:1 w:0) @@ -386,24 +376,41 @@ impl issue::WeightInfo for WeightInfo { /// Storage: BTCRelay BestBlockHeight (r:1 w:0) /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) fn cancel_issue () -> Weight { // Proof Size summary in bytes: - // Measured: `1495` - // Estimated: `3737` - // Minimum execution time: 91_653_000 picoseconds. - Weight::from_parts(93_397_000, 3737) + // Measured: `1505` + // Estimated: `3760` + // Minimum execution time: 89_000_000 picoseconds. + Weight::from_parts(89_000_000, 3760) .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } + /// Storage: Issue IssueRequests (r:1 w:1) + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) + /// Storage: Issue IssuePeriod (r:1 w:0) + /// Proof: Issue IssuePeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: Security ActiveBlockCount (r:1 w:0) + /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: BTCRelay BestBlockHeight (r:1 w:0) + /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + fn cancel_issue_for_replace () -> Weight { + // Proof Size summary in bytes: + // Measured: `1027` + // Estimated: `3760` + // Minimum execution time: 66_000_000 picoseconds. + Weight::from_parts(66_000_000, 3760) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } /// Storage: Issue IssuePeriod (r:0 w:1) /// Proof: Issue IssuePeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) fn set_issue_period () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 18_417_000 picoseconds. - Weight::from_parts(18_597_000, 0) + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(17_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } } \ No newline at end of file diff --git a/parachain/runtime/kintsugi/src/weights/redeem.rs b/parachain/runtime/kintsugi/src/weights/redeem.rs index 44a280e029..dfe0a5d757 100644 --- a/parachain/runtime/kintsugi/src/weights/redeem.rs +++ b/parachain/runtime/kintsugi/src/weights/redeem.rs @@ -2,31 +2,31 @@ //! Autogenerated weights for redeem //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-08-07, STEPS: `50`, REPEAT: `10`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-29, STEPS: `2`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `interlay-rust-runner-2mz2v-kcxvd`, CPU: `AMD EPYC 7502P 32-Core Processor` +//! HOSTNAME: `Nakuls-MacBook-Pro.local`, CPU: `` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kintsugi-dev"), DB CACHE: 1024 // Executed Command: -// target/release/interbtc-parachain +// ./target/release/interbtc-parachain // benchmark // pallet // --pallet -// * +// redeem // --extrinsic // * -// --chain -// kintsugi-dev // --execution=wasm // --wasm-execution=compiled // --steps -// 50 +// 2 // --repeat -// 10 -// --output -// parachain/runtime/kintsugi/src/weights/ +// 1 // --template // .deploy/runtime-weight-template.hbs +// --chain +// kintsugi-dev +// --output +// generated_weight_kintsugi.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -40,6 +40,8 @@ pub struct WeightInfo(PhantomData); impl redeem::WeightInfo for WeightInfo { + /// Storage: VaultRegistry Vaults (r:1 w:1) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:2 w:1) /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) /// Storage: Fee RedeemFee (r:1 w:0) @@ -48,8 +50,6 @@ impl redeem::WeightInfo for WeightInfo { /// Proof: Redeem RedeemTransactionSize (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: Oracle Aggregate (r:2 w:0) /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) - /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) /// Storage: Redeem RedeemBtcDustValue (r:1 w:0) /// Proof: Redeem RedeemBtcDustValue (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: Security Nonce (r:1 w:1) @@ -91,13 +91,13 @@ impl redeem::WeightInfo for WeightInfo { /// Storage: BTCRelay BestBlockHeight (r:1 w:0) /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: Redeem RedeemRequests (r:0 w:1) - /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(245), added: 2720, mode: MaxEncodedLen) + /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(278), added: 2753, mode: MaxEncodedLen) fn request_redeem () -> Weight { // Proof Size summary in bytes: - // Measured: `3189` + // Measured: `3161` // Estimated: `6260` - // Minimum execution time: 311_614_000 picoseconds. - Weight::from_parts(319_349_000, 6260) + // Minimum execution time: 270_000_000 picoseconds. + Weight::from_parts(270_000_000, 6260) .saturating_add(T::DbWeight::get().reads(28_u64)) .saturating_add(T::DbWeight::get().writes(5_u64)) } @@ -127,15 +127,15 @@ impl redeem::WeightInfo for WeightInfo { /// Proof: Loans AccountDeposits (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) fn liquidation_redeem () -> Weight { // Proof Size summary in bytes: - // Measured: `2173` + // Measured: `2193` // Estimated: `8760` - // Minimum execution time: 287_687_000 picoseconds. - Weight::from_parts(292_145_000, 8760) + // Minimum execution time: 257_000_000 picoseconds. + Weight::from_parts(257_000_000, 8760) .saturating_add(T::DbWeight::get().reads(16_u64)) .saturating_add(T::DbWeight::get().writes(11_u64)) } /// Storage: Redeem RedeemRequests (r:1 w:1) - /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(245), added: 2720, mode: MaxEncodedLen) + /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(278), added: 2753, mode: MaxEncodedLen) /// Storage: BTCRelay DisableInclusionCheck (r:1 w:0) /// Proof: BTCRelay DisableInclusionCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: BTCRelay BestBlockHeight (r:1 w:0) @@ -155,30 +155,28 @@ impl redeem::WeightInfo for WeightInfo { /// Storage: Tokens TotalIssuance (r:1 w:1) /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// The range of component `h` is `[2, 10]`. /// The range of component `i` is `[1, 10]`. /// The range of component `o` is `[2, 3]`. /// The range of component `b` is `[541, 2048]`. - fn execute_redeem (h: u32, i: u32, o: u32, b: u32, ) -> Weight { + fn execute_redeem (h: u32, _i: u32, o: u32, b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `2295 + o * (1 ±0)` - // Estimated: `3725` - // Minimum execution time: 184_800_000 picoseconds. - Weight::from_parts(149_034_719, 3725) - // Standard Error: 137_585 - .saturating_add(Weight::from_parts(3_833_551, 0).saturating_mul(h.into())) - // Standard Error: 124_035 - .saturating_add(Weight::from_parts(1_176_171, 0).saturating_mul(i.into())) - // Standard Error: 751_913 - .saturating_add(Weight::from_parts(1_964_806, 0).saturating_mul(o.into())) - // Standard Error: 757 - .saturating_add(Weight::from_parts(5_490, 0).saturating_mul(b.into())) + // Measured: `2268 + o * (1 ±0)` + // Estimated: `3743` + // Minimum execution time: 176_000_000 picoseconds. + Weight::from_parts(151_584_172, 3743) + // Standard Error: 108_253 + .saturating_add(Weight::from_parts(2_562_500, 0).saturating_mul(h.into())) + // Standard Error: 866_025 + .saturating_add(Weight::from_parts(500_000, 0).saturating_mul(o.into())) + // Standard Error: 574 + .saturating_add(Weight::from_parts(8_958, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(11_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } /// Storage: Redeem RedeemRequests (r:1 w:1) - /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(245), added: 2720, mode: MaxEncodedLen) + /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(278), added: 2753, mode: MaxEncodedLen) /// Storage: Redeem RedeemPeriod (r:1 w:0) /// Proof: Redeem RedeemPeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: Security ActiveBlockCount (r:1 w:0) @@ -186,7 +184,7 @@ impl redeem::WeightInfo for WeightInfo { /// Storage: BTCRelay BestBlockHeight (r:1 w:0) /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: Loans UnderlyingAssetId (r:1 w:0) /// Proof: Loans UnderlyingAssetId (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) /// Storage: Oracle Aggregate (r:1 w:0) @@ -267,15 +265,15 @@ impl redeem::WeightInfo for WeightInfo { /// Proof: VaultRegistry PunishmentDelay (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) fn cancel_redeem_reimburse () -> Weight { // Proof Size summary in bytes: - // Measured: `5430` + // Measured: `5403` // Estimated: `11350` - // Minimum execution time: 850_042_000 picoseconds. - Weight::from_parts(865_223_000, 11350) + // Minimum execution time: 782_000_000 picoseconds. + Weight::from_parts(782_000_000, 11350) .saturating_add(T::DbWeight::get().reads(59_u64)) .saturating_add(T::DbWeight::get().writes(29_u64)) } /// Storage: Redeem RedeemRequests (r:1 w:1) - /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(245), added: 2720, mode: MaxEncodedLen) + /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(278), added: 2753, mode: MaxEncodedLen) /// Storage: Redeem RedeemPeriod (r:1 w:0) /// Proof: Redeem RedeemPeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: Security ActiveBlockCount (r:1 w:0) @@ -283,7 +281,7 @@ impl redeem::WeightInfo for WeightInfo { /// Storage: BTCRelay BestBlockHeight (r:1 w:0) /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: Loans UnderlyingAssetId (r:1 w:0) /// Proof: Loans UnderlyingAssetId (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) /// Storage: Oracle Aggregate (r:1 w:0) @@ -364,62 +362,115 @@ impl redeem::WeightInfo for WeightInfo { /// Proof: VaultRegistry PunishmentDelay (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) fn cancel_redeem_retry () -> Weight { // Proof Size summary in bytes: - // Measured: `5430` + // Measured: `5403` // Estimated: `11350` - // Minimum execution time: 773_779_000 picoseconds. - Weight::from_parts(789_120_000, 11350) + // Minimum execution time: 706_000_000 picoseconds. + Weight::from_parts(706_000_000, 11350) .saturating_add(T::DbWeight::get().reads(58_u64)) .saturating_add(T::DbWeight::get().writes(28_u64)) } + /// Storage: Redeem RedeemRequests (r:1 w:1) + /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(278), added: 2753, mode: MaxEncodedLen) + /// Storage: Redeem RedeemPeriod (r:1 w:0) + /// Proof: Redeem RedeemPeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: Security ActiveBlockCount (r:1 w:0) + /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: BTCRelay BestBlockHeight (r:1 w:0) + /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: Issue IssueRequests (r:1 w:1) + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) + /// Storage: Issue IssuePeriod (r:1 w:0) + /// Proof: Issue IssuePeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: VaultRegistry Vaults (r:2 w:2) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) + /// Storage: Oracle Aggregate (r:1 w:0) + /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) + /// Storage: Fee PunishmentFee (r:1 w:0) + /// Proof: Fee PunishmentFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// Storage: VaultStaking Nonce (r:1 w:0) + /// Proof: VaultStaking Nonce (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) + /// Storage: VaultStaking TotalCurrentStake (r:1 w:0) + /// Proof: VaultStaking TotalCurrentStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) + /// Storage: VaultRegistry TotalUserVaultCollateral (r:1 w:1) + /// Proof: VaultRegistry TotalUserVaultCollateral (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) + /// Storage: VaultCapacity Stake (r:1 w:0) + /// Proof: VaultCapacity Stake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: VaultCapacity RewardPerToken (r:2 w:0) + /// Proof: VaultCapacity RewardPerToken (max_values: None, max_size: Some(59), added: 2534, mode: MaxEncodedLen) + /// Storage: VaultCapacity RewardTally (r:2 w:2) + /// Proof: VaultCapacity RewardTally (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) + /// Storage: VaultCapacity TotalRewards (r:2 w:2) + /// Proof: VaultCapacity TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: VaultRewards Stake (r:1 w:0) + /// Proof: VaultRewards Stake (max_values: None, max_size: Some(97), added: 2572, mode: MaxEncodedLen) + /// Storage: VaultRewards RewardPerToken (r:2 w:0) + /// Proof: VaultRewards RewardPerToken (max_values: None, max_size: Some(70), added: 2545, mode: MaxEncodedLen) + /// Storage: VaultRewards RewardTally (r:2 w:2) + /// Proof: VaultRewards RewardTally (max_values: None, max_size: Some(124), added: 2599, mode: MaxEncodedLen) + /// Storage: VaultRewards TotalRewards (r:2 w:2) + /// Proof: VaultRewards TotalRewards (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Fee Commission (r:1 w:0) + /// Proof: Fee Commission (max_values: None, max_size: Some(86), added: 2561, mode: MaxEncodedLen) + /// Storage: VaultStaking RewardPerToken (r:2 w:2) + /// Proof: VaultStaking RewardPerToken (max_values: None, max_size: Some(117), added: 2592, mode: MaxEncodedLen) + /// Storage: VaultStaking TotalStake (r:1 w:0) + /// Proof: VaultStaking TotalStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) + /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) + /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) + /// Storage: VaultRewards TotalStake (r:1 w:0) + /// Proof: VaultRewards TotalStake (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + fn cancel_replace () -> Weight { + // Proof Size summary in bytes: + // Measured: `4404` + // Estimated: `6364` + // Minimum execution time: 394_000_000 picoseconds. + Weight::from_parts(394_000_000, 6364) + .saturating_add(T::DbWeight::get().reads(33_u64)) + .saturating_add(T::DbWeight::get().writes(15_u64)) + } /// Storage: Redeem RedeemPeriod (r:0 w:1) /// Proof: Redeem RedeemPeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) fn set_redeem_period () -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 18_106_000 picoseconds. - Weight::from_parts(18_667_000, 0) + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(17_000_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: VaultRegistry Vaults (r:1 w:1) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(260), added: 2735, mode: MaxEncodedLen) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:1 w:1) /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) /// Storage: Tokens TotalIssuance (r:1 w:1) /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) fn self_redeem () -> Weight { // Proof Size summary in bytes: - // Measured: `1427` - // Estimated: `3725` - // Minimum execution time: 150_121_000 picoseconds. - Weight::from_parts(151_013_000, 3725) + // Measured: `1399` + // Estimated: `3677` + // Minimum execution time: 116_000_000 picoseconds. + Weight::from_parts(116_000_000, 3677) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } - /// Storage: VaultRegistry Vaults (r:2 w:2) - /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: BTCRelay StartBlockHeight (r:1 w:0) /// Proof: BTCRelay StartBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: BTCRelay StableBitcoinConfirmations (r:1 w:0) /// Proof: BTCRelay StableBitcoinConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: BTCRelay BestBlockHeight (r:1 w:0) /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Oracle Aggregate (r:3 w:0) - /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) - /// Storage: Fee IssueGriefingCollateral (r:1 w:0) - /// Proof: Fee IssueGriefingCollateral (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:1 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) + /// Storage: VaultRegistry Vaults (r:2 w:2) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) /// Storage: Issue IssueBtcDustValue (r:1 w:0) /// Proof: Issue IssueBtcDustValue (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: VaultRegistry SecureCollateralThreshold (r:1 w:0) /// Proof: VaultRegistry SecureCollateralThreshold (max_values: None, max_size: Some(54), added: 2529, mode: MaxEncodedLen) + /// Storage: Oracle Aggregate (r:1 w:0) + /// Proof: Oracle Aggregate (max_values: None, max_size: Some(44), added: 2519, mode: MaxEncodedLen) /// Storage: VaultStaking Nonce (r:2 w:0) /// Proof: VaultStaking Nonce (max_values: None, max_size: Some(74), added: 2549, mode: MaxEncodedLen) /// Storage: VaultStaking TotalCurrentStake (r:2 w:0) /// Proof: VaultStaking TotalCurrentStake (max_values: None, max_size: Some(106), added: 2581, mode: MaxEncodedLen) - /// Storage: Fee IssueFee (r:1 w:0) - /// Proof: Fee IssueFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: Security Nonce (r:1 w:1) /// Proof: Security Nonce (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) /// Storage: System ParentHash (r:1 w:0) @@ -432,8 +483,6 @@ impl redeem::WeightInfo for WeightInfo { /// Proof: Issue IssuePeriod (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: Fee RedeemFee (r:1 w:0) /// Proof: Fee RedeemFee (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Redeem RedeemTransactionSize (r:1 w:0) - /// Proof: Redeem RedeemTransactionSize (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: Redeem RedeemBtcDustValue (r:1 w:0) /// Proof: Redeem RedeemBtcDustValue (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: VaultRegistry PremiumRedeemThreshold (r:1 w:0) @@ -444,15 +493,54 @@ impl redeem::WeightInfo for WeightInfo { /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) /// Storage: Redeem RedeemRequests (r:0 w:1) /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(278), added: 2753, mode: MaxEncodedLen) - /// Storage: Redeem Requests (r:0 w:1) - /// Proof: Redeem Requests (max_values: None, max_size: Some(80), added: 2555, mode: MaxEncodedLen) fn request_replace () -> Weight { // Proof Size summary in bytes: - // Measured: `3371` - // Estimated: `8547` - // Minimum execution time: 38_952_000_000 picoseconds. - Weight::from_parts(38_952_000_000, 8547) - .saturating_add(T::DbWeight::get().reads(27_u64)) - .saturating_add(T::DbWeight::get().writes(7_u64)) + // Measured: `2735` + // Estimated: `6364` + // Minimum execution time: 38_446_000_000 picoseconds. + Weight::from_parts(38_446_000_000, 6364) + .saturating_add(T::DbWeight::get().reads(21_u64)) + .saturating_add(T::DbWeight::get().writes(5_u64)) + } + /// Storage: Redeem RedeemRequests (r:1 w:1) + /// Proof: Redeem RedeemRequests (max_values: None, max_size: Some(278), added: 2753, mode: MaxEncodedLen) + /// Storage: BTCRelay DisableInclusionCheck (r:1 w:0) + /// Proof: BTCRelay DisableInclusionCheck (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) + /// Storage: BTCRelay BestBlockHeight (r:1 w:0) + /// Proof: BTCRelay BestBlockHeight (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: BTCRelay Chains (r:1 w:0) + /// Proof: BTCRelay Chains (max_values: None, max_size: Some(24), added: 2499, mode: MaxEncodedLen) + /// Storage: BTCRelay BlockHeaders (r:1 w:0) + /// Proof: BTCRelay BlockHeaders (max_values: None, max_size: Some(200), added: 2675, mode: MaxEncodedLen) + /// Storage: BTCRelay StableBitcoinConfirmations (r:1 w:0) + /// Proof: BTCRelay StableBitcoinConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: Security ActiveBlockCount (r:1 w:0) + /// Proof: Security ActiveBlockCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: BTCRelay StableParachainConfirmations (r:1 w:0) + /// Proof: BTCRelay StableParachainConfirmations (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: VaultRegistry Vaults (r:2 w:2) + /// Proof: VaultRegistry Vaults (max_values: None, max_size: Some(212), added: 2687, mode: MaxEncodedLen) + /// Storage: Issue IssueRequests (r:1 w:1) + /// Proof: Issue IssueRequests (max_values: None, max_size: Some(295), added: 2770, mode: MaxEncodedLen) + /// The range of component `h` is `[2, 10]`. + /// The range of component `i` is `[1, 10]`. + /// The range of component `o` is `[2, 3]`. + /// The range of component `b` is `[541, 2048]`. + fn execute_replace (h: u32, i: u32, o: u32, b: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `2310` + // Estimated: `6364` + // Minimum execution time: 178_000_000 picoseconds. + Weight::from_parts(108_702_702, 6364) + // Standard Error: 433_012 + .saturating_add(Weight::from_parts(3_875_000, 0).saturating_mul(h.into())) + // Standard Error: 384_900 + .saturating_add(Weight::from_parts(1_444_444, 0).saturating_mul(i.into())) + // Standard Error: 3_464_101 + .saturating_add(Weight::from_parts(8_000_000, 0).saturating_mul(o.into())) + // Standard Error: 2_298 + .saturating_add(Weight::from_parts(11_280, 0).saturating_mul(b.into())) + .saturating_add(T::DbWeight::get().reads(11_u64)) + .saturating_add(T::DbWeight::get().writes(4_u64)) } } \ No newline at end of file diff --git a/parachain/runtime/runtime-tests/src/parachain/redeem.rs b/parachain/runtime/runtime-tests/src/parachain/redeem.rs index 76f227de2e..624c8c98fc 100644 --- a/parachain/runtime/runtime-tests/src/parachain/redeem.rs +++ b/parachain/runtime/runtime-tests/src/parachain/redeem.rs @@ -597,7 +597,7 @@ mod spec_based_tests { set_redeem_period(2000); let redeem_id = request_redeem(&vault_id); SecurityPallet::set_active_block_number(1100); - mine_blocks(12); + mine_blocks(100); set_redeem_period(1000); // request still uses period = 200, so cancel fails and execute succeeds @@ -628,7 +628,7 @@ mod spec_based_tests { test_with(|vault_id| { set_redeem_period(1000); let redeem_id = request_redeem(&vault_id); - mine_blocks(12); + mine_blocks(100); SecurityPallet::set_active_block_number(1100); assert_noop!( RuntimeCall::Redeem(RedeemCall::cancel_redeem { diff --git a/parachain/runtime/runtime-tests/src/parachain/replace.rs b/parachain/runtime/runtime-tests/src/parachain/replace.rs index 7a87eb5336..35cb425b4f 100644 --- a/parachain/runtime/runtime-tests/src/parachain/replace.rs +++ b/parachain/runtime/runtime-tests/src/parachain/replace.rs @@ -1,6 +1,6 @@ use crate::{ setup::{assert_eq, issue_utils::assert_issue_request_event, redeem_utils::assert_redeem_request_event, *}, - utils::loans_utils::activate_lending_and_mint, + utils::{loans_utils::activate_lending_and_mint, redeem_utils::get_punishment_fee}, }; use currency::Amount; use issue::DefaultIssueRequest; @@ -70,35 +70,16 @@ fn test_without_initialization(execute: impl Fn(CurrencyId) -> R) { ExtBuilder::build().execute_with(|| execute(Token(KSM))); } -// pub fn withdraw_replace(old_vault_id: &VaultId, amount: Amount) -> DispatchResultWithPostInfo { -// VaultRegistryPallet::collateral_integrity_check(); -// -// RuntimeCall::Replace(ReplaceCall::withdraw_replace { -// currency_pair: old_vault_id.currencies.clone(), -// amount: amount.amount(), -// }) -// .dispatch(origin_of(old_vault_id.account_id.clone())) -// } - -// pub fn assert_replace_request_event() { -// let events = SystemPallet::events(); -// let ids = events.iter().filter_map(|r| match r.event { -// RuntimeEvent::Replace(ReplaceEvent::RequestReplace { .. }) => Some(()), -// _ => None, -// }); -// assert_eq!(ids.count(), 1); -// } - #[cfg(test)] mod request_replace_tests { use super::{assert_eq, *}; use crate::{setup::issue_utils::assert_issue_request_event, utils::redeem_utils::assert_redeem_request_event}; - fn assert_state_after_accept_replace_correct( + fn assert_state_after_request_replace_correct( old_vault_id: &VaultId, new_vault_id: &VaultId, issue: &IssueRequest, - amount: Amount, + redeem: &RedeemRequest, ) { assert_eq!( ParachainTwoVaultState::get(&old_vault_id, &new_vault_id), @@ -107,20 +88,20 @@ mod request_replace_tests { *old_vault.free_balance.get_mut(&issue.griefing_currency).unwrap() -= Amount::new(issue.griefing_collateral, issue.griefing_currency); - old_vault.to_be_redeemed += amount; - new_vault.to_be_issued += amount; + old_vault.to_be_redeemed += redeem.amount_btc() - redeem.fee(); + new_vault.to_be_issued += redeem.amount_btc(); } ) ); } #[test] - fn integration_test_replace_accept_replace_at_capacity_succeeds() { + fn integration_test_replace_request_replace_at_capacity_succeeds() { test_with(|old_vault_id, new_vault_id| { - let accept_amount = new_vault_id.wrapped(DEFAULT_VAULT_TO_BE_REPLACED.amount()); + let replace_amount = new_vault_id.wrapped(DEFAULT_VAULT_TO_BE_REPLACED.amount()); assert_ok!(RuntimeCall::Redeem(RedeemCall::request_replace { currency_pair: old_vault_id.currencies.clone(), - amount: accept_amount.amount(), + amount: replace_amount.amount(), new_vault_id: new_vault_id.clone(), griefing_currency: DEFAULT_GRIEFING_CURRENCY }) @@ -129,28 +110,28 @@ mod request_replace_tests { let redeem_id = assert_redeem_request_event(); let redeem = RedeemPallet::get_open_redeem_request_from_id(&redeem_id).unwrap(); - assert_eq!(redeem.amount_btc, accept_amount.amount()); + assert_eq!(redeem.amount_btc, replace_amount.amount()); assert_eq!(redeem.issue_id.is_some(), true); let issue_id = assert_issue_request_event(); let issue = IssuePallet::get_issue_request_from_id(&issue_id).unwrap(); - assert_eq!(issue.griefing_collateral(), griefing(2)); - assert_state_after_accept_replace_correct(&old_vault_id, &new_vault_id, &issue, accept_amount); + assert_eq!(issue.griefing_collateral(), griefing(0)); + assert_state_after_request_replace_correct(&old_vault_id, &new_vault_id, &issue, &redeem); }); } #[test] - fn integration_test_replace_accept_replace_below_capacity_succeeds() { + fn integration_test_replace_request_replace_below_capacity_succeeds() { test_with(|old_vault_id, new_vault_id| { // accept only 25% - let accept_amount = DEFAULT_VAULT_TO_BE_REPLACED / 4; - let accept_amount = old_vault_id.wrapped(accept_amount.amount()); + let replace_amount = DEFAULT_VAULT_TO_BE_REPLACED / 4; + let replace_amount = old_vault_id.wrapped(replace_amount.amount()); assert_ok!(RuntimeCall::Redeem(RedeemCall::request_replace { currency_pair: old_vault_id.currencies.clone(), - amount: accept_amount.amount(), + amount: replace_amount.amount(), new_vault_id: new_vault_id.clone(), griefing_currency: DEFAULT_GRIEFING_CURRENCY }) @@ -159,54 +140,40 @@ mod request_replace_tests { let redeem_id = assert_redeem_request_event(); let redeem = RedeemPallet::get_open_redeem_request_from_id(&redeem_id).unwrap(); - assert_eq!(redeem.amount_btc, accept_amount.amount()); + assert_eq!(redeem.amount_btc, replace_amount.amount()); assert_eq!(redeem.issue_id.is_some(), true); let issue_id = assert_issue_request_event(); let issue = IssuePallet::get_issue_request_from_id(&issue_id).unwrap(); - assert_eq!(issue.griefing_collateral(), griefing(1)); - assert_state_after_accept_replace_correct(&old_vault_id, &new_vault_id, &issue, accept_amount); + assert_eq!(issue.griefing_collateral(), griefing(0)); + assert_state_after_request_replace_correct(&old_vault_id, &new_vault_id, &issue, &redeem); }); } #[test] - fn integration_test_replace_accept_replace_above_capacity_succeeds() { + fn integration_test_request_replace_above_capacity_fails() { test_with(|old_vault_id, new_vault_id| { // try to accept 400% - let accept_amount = DEFAULT_VAULT_TO_BE_REPLACED * 4; - let accept_amount = old_vault_id.wrapped(accept_amount.amount()); - - assert_ok!(RuntimeCall::Redeem(RedeemCall::request_replace { - currency_pair: old_vault_id.currencies.clone(), - amount: accept_amount.amount(), - new_vault_id: new_vault_id.clone(), - griefing_currency: DEFAULT_GRIEFING_CURRENCY - }) - .dispatch(origin_of(old_vault_id.account_id.clone()))); - - let redeem_id = assert_redeem_request_event(); - let redeem = RedeemPallet::get_open_redeem_request_from_id(&redeem_id).unwrap(); - - assert_eq!(redeem.amount_btc, accept_amount.amount() / 2); - assert_eq!(redeem.issue_id.is_some(), true); - - let issue_id = assert_issue_request_event(); - let issue = IssuePallet::get_issue_request_from_id(&issue_id).unwrap(); + let replace_amount = DEFAULT_VAULT_TO_BE_REPLACED * 4; + let replace_amount = old_vault_id.wrapped(replace_amount.amount()); - assert_eq!(issue.griefing_collateral(), griefing(4)); - assert_state_after_accept_replace_correct( - &old_vault_id, - &new_vault_id, - &issue, - Amount::new(accept_amount.amount() / 2, old_vault_id.currencies.wrapped), + assert_err!( + RuntimeCall::Redeem(RedeemCall::request_replace { + currency_pair: old_vault_id.currencies.clone(), + amount: replace_amount.amount(), + new_vault_id: new_vault_id.clone(), + griefing_currency: DEFAULT_GRIEFING_CURRENCY + }) + .dispatch(origin_of(old_vault_id.account_id.clone())), + VaultRegistryError::InsufficientTokensCommitted ); }); } #[test] - fn integration_test_replace_accept_replace_by_vault_that_does_not_accept_issues_succeeds() { + fn integration_test_replace_request_replace_by_vault_that_does_not_accept_issues_succeeds() { test_with(|old_vault_id, new_vault_id| { assert_ok!(RuntimeCall::VaultRegistry(VaultRegistryCall::accept_new_issues { currency_pair: new_vault_id.currencies.clone(), @@ -228,7 +195,7 @@ mod request_replace_tests { } #[test] - fn integration_test_replace_accept_replace_below_dust_fails() { + fn integration_test_replace_request_replace_below_dust_fails() { test_with(|old_vault_id, new_vault_id| { // if the new_vault _asks_ for an amount below below DUST, it gets rejected @@ -246,7 +213,7 @@ mod request_replace_tests { } #[test] - fn integration_test_replace_accept_replace_self_fails() { + fn integration_test_replace_request_replace_self_fails() { test_with(|old_vault_id, _new_vault_id| { assert_noop!( RuntimeCall::Redeem(RedeemCall::request_replace { @@ -278,7 +245,6 @@ mod request_replace_tests { ); CoreVaultData::force_to(&new_vault_id, default_vault_state(&new_vault_id)); - //Fixme: The code works without this check, ideally shouldn't have worked? assert_noop!( RuntimeCall::Redeem(RedeemCall::request_replace { currency_pair: old_vault_id.currencies.clone(), @@ -414,11 +380,11 @@ mod execute_replace_payment_limits { #[test] fn integration_test_execute_replace_with_exact_amount_succeeds() { test_with(|old_vault_id, new_vault_id| { - let accept_amount = old_vault_id.wrapped(1000000); + let replace_amount = old_vault_id.wrapped(10000); assert_ok!(RuntimeCall::Redeem(RedeemCall::request_replace { currency_pair: old_vault_id.currencies.clone(), - amount: accept_amount.amount(), + amount: replace_amount.amount(), new_vault_id: new_vault_id.clone(), griefing_currency: DEFAULT_GRIEFING_CURRENCY }) @@ -437,11 +403,11 @@ mod execute_replace_payment_limits { #[test] fn integration_test_execute_replace_with_overpayment_fails() { test_with(|old_vault_id, new_vault_id| { - let accept_amount = old_vault_id.wrapped(1000000); + let replace_amount = old_vault_id.wrapped(10000); assert_ok!(RuntimeCall::Redeem(RedeemCall::request_replace { currency_pair: old_vault_id.currencies.clone(), - amount: accept_amount.amount(), + amount: replace_amount.amount(), new_vault_id: new_vault_id.clone(), griefing_currency: DEFAULT_GRIEFING_CURRENCY }) @@ -463,11 +429,11 @@ mod execute_replace_payment_limits { #[test] fn integration_test_execute_replace_with_underpayment_fails() { test_with(|old_vault_id, new_vault_id| { - let accept_amount = old_vault_id.wrapped(1000000); + let replace_amount = old_vault_id.wrapped(10000); assert_ok!(RuntimeCall::Redeem(RedeemCall::request_replace { currency_pair: old_vault_id.currencies.clone(), - amount: accept_amount.amount(), + amount: replace_amount.amount(), new_vault_id: new_vault_id.clone(), griefing_currency: DEFAULT_GRIEFING_CURRENCY }) @@ -489,13 +455,13 @@ mod execute_replace_payment_limits { } fn setup_replace( - accept_amount: Amount, + replace_amount: Amount, old_vault_id: &VaultId, new_vault_id: &VaultId, ) -> (H256, DefaultRedeemRequest, H256, DefaultIssueRequest) { assert_ok!(RuntimeCall::Redeem(RedeemCall::request_replace { currency_pair: old_vault_id.currencies.clone(), - amount: accept_amount.amount(), + amount: replace_amount.amount(), new_vault_id: new_vault_id.clone(), griefing_currency: DEFAULT_GRIEFING_CURRENCY }) @@ -512,8 +478,8 @@ fn setup_replace( #[test] fn integration_test_replace_cancel_replace() { test_with(|old_vault_id, new_vault_id| { - let accept_amount = new_vault_id.wrapped(10000); - let (redeem_id, _, _, _) = setup_replace(accept_amount, &old_vault_id, &new_vault_id); + let replace_amount = new_vault_id.wrapped(10000); + let (redeem_id, _, _, _) = setup_replace(replace_amount, &old_vault_id, &new_vault_id); // set block height // new_vault cancels replacement mine_blocks(2); @@ -570,9 +536,9 @@ fn cancel_replace(redeem_id: H256) { #[test] fn integration_test_replace_execute_replace_success() { test_with(|old_vault_id, new_vault_id| { - let accept_amount = new_vault_id.wrapped(10000); + let replace_amount = new_vault_id.wrapped(10000); - let (redeem_id, _redeem, _issue_id, issue) = setup_replace(accept_amount, &old_vault_id, &new_vault_id); + let (redeem_id, redeem, _issue_id, _issue) = setup_replace(replace_amount, &old_vault_id, &new_vault_id); let pre_execute_state = ParachainTwoVaultState::get(&old_vault_id, &new_vault_id); @@ -580,12 +546,11 @@ fn integration_test_replace_execute_replace_success() { assert_eq!( ParachainTwoVaultState::get(&old_vault_id, &new_vault_id), pre_execute_state.with_changes(|old_vault, new_vault, _| { - old_vault.issued -= accept_amount; - old_vault.to_be_redeemed -= accept_amount; - *old_vault.free_balance.get_mut(&DEFAULT_GRIEFING_CURRENCY).unwrap() += issue.griefing_collateral(); + old_vault.issued -= replace_amount - redeem.fee; + old_vault.to_be_redeemed -= replace_amount - redeem.fee; - new_vault.issued += accept_amount; - new_vault.to_be_issued -= accept_amount; + new_vault.issued += replace_amount; + new_vault.to_be_issued -= replace_amount; }) ); }); @@ -606,9 +571,9 @@ fn calculate_replace_collateral( #[test] fn integration_test_replace_execute_replace_old_vault_liquidated() { test_with(|old_vault_id, new_vault_id| { - let accept_amount = new_vault_id.wrapped(10000); + let replace_amount = new_vault_id.wrapped(10000); - let (redeem_id, redeem, _issue_id, issue) = setup_replace(accept_amount, &old_vault_id, &new_vault_id); + let (redeem_id, redeem, _issue_id, _issue) = setup_replace(replace_amount, &old_vault_id, &new_vault_id); let old = CoreVaultData::vault(old_vault_id.clone()); @@ -618,23 +583,25 @@ fn integration_test_replace_execute_replace_old_vault_liquidated() { assert_ok!(execute_replace(redeem_id)); - let collateral_for_replace = - calculate_replace_collateral(&old, redeem.amount_btc(), old_vault_id.collateral_currency()); + let collateral_for_replace = calculate_replace_collateral( + &old, + redeem.amount_btc().checked_sub(&redeem.fee()).unwrap(), + old_vault_id.collateral_currency(), + ); assert_eq!( ParachainTwoVaultState::get(&old_vault_id, &new_vault_id), pre_execution_state.with_changes(|old_vault, new_vault, liquidation_vault| { let liquidation_vault = liquidation_vault.with_currency(&old_vault_id.currencies); - liquidation_vault.issued -= accept_amount; - liquidation_vault.to_be_redeemed -= accept_amount; + liquidation_vault.issued -= replace_amount - redeem.fee; + liquidation_vault.to_be_redeemed -= replace_amount - redeem.fee; - new_vault.to_be_issued -= accept_amount; - new_vault.issued += accept_amount; + new_vault.to_be_issued -= replace_amount; + new_vault.issued += replace_amount; - old_vault.to_be_redeemed -= accept_amount; + old_vault.to_be_redeemed -= replace_amount - redeem.fee; old_vault.liquidated_collateral -= collateral_for_replace; - *old_vault.free_balance.get_mut(&DEFAULT_GRIEFING_CURRENCY).unwrap() += issue.griefing_collateral(); *old_vault .free_balance .get_mut(&old_vault_id.collateral_currency()) @@ -647,9 +614,9 @@ fn integration_test_replace_execute_replace_old_vault_liquidated() { #[test] fn integration_test_replace_execute_replace_new_vault_liquidated() { test_with(|old_vault_id, new_vault_id| { - let accept_amount = new_vault_id.wrapped(10000); + let replace_amount = new_vault_id.wrapped(10000); - let (redeem_id, _redeem, _issue_id, issue) = setup_replace(accept_amount, &old_vault_id, &new_vault_id); + let (redeem_id, redeem, _issue_id, _issue) = setup_replace(replace_amount, &old_vault_id, &new_vault_id); liquidate_vault(&new_vault_id); @@ -662,12 +629,11 @@ fn integration_test_replace_execute_replace_new_vault_liquidated() { pre_execution_state.with_changes(|old_vault, _new_vault, liquidation_vault| { let liquidation_vault = liquidation_vault.with_currency(&new_vault_id.currencies); - liquidation_vault.issued += accept_amount; - liquidation_vault.to_be_issued -= accept_amount; + liquidation_vault.issued += replace_amount; + liquidation_vault.to_be_issued -= replace_amount; - old_vault.to_be_redeemed -= accept_amount; - old_vault.issued -= accept_amount; - *old_vault.free_balance.get_mut(&DEFAULT_GRIEFING_CURRENCY).unwrap() += issue.griefing_collateral(); + old_vault.to_be_redeemed -= replace_amount - redeem.fee; + old_vault.issued -= replace_amount - redeem.fee; }) ); }); @@ -676,9 +642,9 @@ fn integration_test_replace_execute_replace_new_vault_liquidated() { #[test] fn integration_test_replace_execute_replace_both_vaults_liquidated() { test_with(|old_vault_id, new_vault_id| { - let accept_amount = new_vault_id.wrapped(10000); + let replace_amount = new_vault_id.wrapped(10000); - let (redeem_id, redeem, _issue_id, issue) = setup_replace(accept_amount, &old_vault_id, &new_vault_id); + let (redeem_id, redeem, _issue_id, _issue) = setup_replace(replace_amount, &old_vault_id, &new_vault_id); let old = CoreVaultData::vault(old_vault_id.clone()); @@ -689,23 +655,25 @@ fn integration_test_replace_execute_replace_both_vaults_liquidated() { assert_ok!(execute_replace(redeem_id)); - let collateral_for_replace = - calculate_replace_collateral(&old, redeem.amount_btc(), old_vault_id.collateral_currency()); + let collateral_for_replace = calculate_replace_collateral( + &old, + redeem.amount_btc().checked_sub(&redeem.fee()).unwrap(), + old_vault_id.collateral_currency(), + ); assert_eq!( ParachainTwoVaultState::get(&old_vault_id, &new_vault_id), pre_execution_state.with_changes(|old_vault, _new_vault, liquidation_vault| { let old_liquidation_vault = liquidation_vault.with_currency(&old_vault_id.currencies); - old_liquidation_vault.to_be_redeemed -= accept_amount; - old_liquidation_vault.issued -= accept_amount; + old_liquidation_vault.to_be_redeemed -= replace_amount - redeem.fee; + old_liquidation_vault.issued -= replace_amount - redeem.fee; let new_liquidation_vault = liquidation_vault.with_currency(&new_vault_id.currencies); - new_liquidation_vault.to_be_issued -= accept_amount; - new_liquidation_vault.issued += accept_amount; + new_liquidation_vault.to_be_issued -= replace_amount; + new_liquidation_vault.issued += replace_amount; - old_vault.to_be_redeemed -= accept_amount; + old_vault.to_be_redeemed -= replace_amount - redeem.fee; old_vault.liquidated_collateral -= collateral_for_replace; - *old_vault.free_balance.get_mut(&DEFAULT_GRIEFING_CURRENCY).unwrap() += issue.griefing_collateral(); *old_vault .free_balance .get_mut(&old_vault_id.collateral_currency()) @@ -718,8 +686,8 @@ fn integration_test_replace_execute_replace_both_vaults_liquidated() { #[test] fn integration_test_replace_execute_replace_with_cancelled() { test_with(|old_vault_id, new_vault_id| { - let accept_amount = new_vault_id.wrapped(10000); - let (redeem_id, _redeem, _issue_id, _issue) = setup_replace(accept_amount, &old_vault_id, &new_vault_id); + let replace_amount = new_vault_id.wrapped(10000); + let (redeem_id, _redeem, _issue_id, _issue) = setup_replace(replace_amount, &old_vault_id, &new_vault_id); cancel_replace(redeem_id); assert_err!(execute_replace(redeem_id), RedeemError::RedeemCancelled); }); @@ -728,18 +696,20 @@ fn integration_test_replace_execute_replace_with_cancelled() { #[test] fn integration_test_replace_cancel_replace_success() { test_with(|old_vault_id, new_vault_id| { - let accept_amount = new_vault_id.wrapped(10000); - let (redeem_id, _redeem, _issue_id, issue) = setup_replace(accept_amount, &old_vault_id, &new_vault_id); + let replace_amount = new_vault_id.wrapped(10000); + let (redeem_id, redeem, _issue_id, _issue) = setup_replace(replace_amount, &old_vault_id, &new_vault_id); let pre_cancellation_state = ParachainTwoVaultState::get(&old_vault_id, &new_vault_id); cancel_replace(redeem_id); + let punishment_fee = get_punishment_fee(); assert_eq!( ParachainTwoVaultState::get(&old_vault_id, &new_vault_id), pre_cancellation_state.with_changes(|old_vault, new_vault, _| { - new_vault.to_be_issued -= accept_amount; - *new_vault.free_balance.get_mut(&DEFAULT_GRIEFING_CURRENCY).unwrap() += issue.griefing_collateral(); + new_vault.to_be_issued -= replace_amount; + old_vault.backing_collateral -= punishment_fee; + *new_vault.free_balance.get_mut(&punishment_fee.currency()).unwrap() += punishment_fee; - old_vault.to_be_redeemed -= accept_amount; + old_vault.to_be_redeemed -= replace_amount - redeem.fee; }) ); }); @@ -748,8 +718,8 @@ fn integration_test_replace_cancel_replace_success() { #[test] fn integration_test_replace_cancel_replace_old_vault_liquidated() { test_with(|old_vault_id, new_vault_id| { - let accept_amount = new_vault_id.wrapped(10000); - let (redeem_id, redeem, _issue_id, issue) = setup_replace(accept_amount, &old_vault_id, &new_vault_id); + let replace_amount = new_vault_id.wrapped(10000); + let (redeem_id, redeem, _issue_id, _issue) = setup_replace(replace_amount, &old_vault_id, &new_vault_id); let old = CoreVaultData::vault(old_vault_id.clone()); @@ -759,21 +729,23 @@ fn integration_test_replace_cancel_replace_old_vault_liquidated() { cancel_replace(redeem_id); - let collateral_for_replace = - calculate_replace_collateral(&old, redeem.amount_btc(), old_vault_id.collateral_currency()); + let collateral_for_replace = calculate_replace_collateral( + &old, + redeem.amount_btc().checked_sub(&redeem.fee()).unwrap(), + old_vault_id.collateral_currency(), + ); assert_eq!( ParachainTwoVaultState::get(&old_vault_id, &new_vault_id), pre_cancellation_state.with_changes(|old_vault, new_vault, liquidation_vault| { - let liquidation_vault = liquidation_vault.with_currency(&old_vault_id.currencies); - - old_vault.to_be_redeemed -= accept_amount; + old_vault.to_be_redeemed -= replace_amount - redeem.fee; old_vault.liquidated_collateral -= collateral_for_replace; - new_vault.to_be_issued -= accept_amount; - *new_vault.free_balance.get_mut(&DEFAULT_GRIEFING_CURRENCY).unwrap() += issue.griefing_collateral(); + new_vault.to_be_issued -= replace_amount; + + let liquidation_vault = liquidation_vault.with_currency(&old_vault_id.currencies); - liquidation_vault.to_be_redeemed -= accept_amount; + liquidation_vault.to_be_redeemed -= replace_amount - redeem.fee; liquidation_vault.collateral += collateral_for_replace; }) ); @@ -783,24 +755,24 @@ fn integration_test_replace_cancel_replace_old_vault_liquidated() { #[test] fn integration_test_replace_cancel_replace_new_vault_liquidated() { test_with(|old_vault_id, new_vault_id| { - let accept_amount = new_vault_id.wrapped(10000); - let (redeem_id, _redeem, _issue_id, issue) = setup_replace(accept_amount, &old_vault_id, &new_vault_id); + let replace_amount = new_vault_id.wrapped(10000); + let (redeem_id, redeem, _issue_id, _issue) = setup_replace(replace_amount, &old_vault_id, &new_vault_id); liquidate_vault(&new_vault_id); let pre_cancellation_state = ParachainTwoVaultState::get(&old_vault_id, &new_vault_id); cancel_replace(redeem_id); - + let punishment_fee = get_punishment_fee(); assert_eq!( ParachainTwoVaultState::get(&old_vault_id, &new_vault_id), pre_cancellation_state.with_changes(|old_vault, new_vault, liquidation_vault| { - old_vault.to_be_redeemed -= accept_amount; - - *new_vault.free_balance.get_mut(&DEFAULT_GRIEFING_CURRENCY).unwrap() += issue.griefing_collateral(); + old_vault.to_be_redeemed -= replace_amount - redeem.fee; + old_vault.backing_collateral -= punishment_fee; + *new_vault.free_balance.get_mut(&punishment_fee.currency()).unwrap() += punishment_fee; let new_liquidation_vault = liquidation_vault.with_currency(&new_vault_id.currencies); - new_liquidation_vault.to_be_issued -= accept_amount; + new_liquidation_vault.to_be_issued -= replace_amount; }) ); }); @@ -809,8 +781,8 @@ fn integration_test_replace_cancel_replace_new_vault_liquidated() { #[test] fn integration_test_replace_cancel_replace_both_vaults_liquidated() { test_with(|old_vault_id, new_vault_id| { - let accept_amount = new_vault_id.wrapped(10000); - let (redeem_id, redeem, _issue_id, issue) = setup_replace(accept_amount, &old_vault_id, &new_vault_id); + let replace_amount = new_vault_id.wrapped(10000); + let (redeem_id, redeem, _issue_id, issue) = setup_replace(replace_amount, &old_vault_id, &new_vault_id); let old = CoreVaultData::vault(old_vault_id.clone()); @@ -821,23 +793,28 @@ fn integration_test_replace_cancel_replace_both_vaults_liquidated() { cancel_replace(redeem_id); - let collateral_for_replace = - calculate_replace_collateral(&old, redeem.amount_btc(), old_vault_id.collateral_currency()); + let collateral_for_replace = calculate_replace_collateral( + &old, + redeem.amount_btc().checked_sub(&redeem.fee()).unwrap(), + old_vault_id.collateral_currency(), + ); assert_eq!( ParachainTwoVaultState::get(&old_vault_id, &new_vault_id), pre_cancellation_state.with_changes(|old_vault, new_vault, liquidation_vault| { - old_vault.to_be_redeemed -= accept_amount; + old_vault.to_be_redeemed -= replace_amount - redeem.fee; old_vault.liquidated_collateral -= collateral_for_replace; *new_vault.free_balance.get_mut(&DEFAULT_GRIEFING_CURRENCY).unwrap() += issue.griefing_collateral(); let old_liquidation_vault = liquidation_vault.with_currency(&old_vault_id.currencies); - old_liquidation_vault.to_be_redeemed -= accept_amount; + old_liquidation_vault.to_be_redeemed -= replace_amount; old_liquidation_vault.collateral += collateral_for_replace; let new_liquidation_vault = liquidation_vault.with_currency(&new_vault_id.currencies); - new_liquidation_vault.to_be_issued -= accept_amount; + new_liquidation_vault.to_be_issued -= replace_amount; + let new_liquidation_vault = liquidation_vault.with_currency(&old_vault_id.currencies); + new_liquidation_vault.to_be_redeemed += redeem.fee(); //KBTC }) ); }); @@ -866,8 +843,8 @@ fn integration_test_replace_vault_with_different_currency_succeeds() { CoreVaultData::force_to(&old_vault_id, default_vault_state(&old_vault_id)); CoreVaultData::force_to(&new_vault_id, default_vault_state(&new_vault_id)); - let accept_amount = new_vault_id.wrapped(10000); - let (redeem_id, _redeem, _issue_id, issue) = setup_replace(accept_amount, &old_vault_id, &new_vault_id); + let replace_amount = new_vault_id.wrapped(10000); + let (redeem_id, redeem, _issue_id, _issue) = setup_replace(replace_amount, &old_vault_id, &new_vault_id); let pre_execute_state = ParachainTwoVaultState::get(&old_vault_id, &new_vault_id); @@ -876,12 +853,10 @@ fn integration_test_replace_vault_with_different_currency_succeeds() { assert_eq!( ParachainTwoVaultState::get(&old_vault_id, &new_vault_id), pre_execute_state.with_changes(|old_vault, new_vault, _| { - new_vault.to_be_issued -= accept_amount; - new_vault.issued += accept_amount; - old_vault.to_be_redeemed -= accept_amount; - old_vault.issued -= accept_amount; - - *old_vault.free_balance.get_mut(&DEFAULT_GRIEFING_CURRENCY).unwrap() += issue.griefing_collateral(); + new_vault.to_be_issued -= replace_amount; + new_vault.issued += replace_amount; + old_vault.to_be_redeemed -= replace_amount - redeem.fee; + old_vault.issued -= replace_amount - redeem.fee; }) ); }); @@ -893,8 +868,8 @@ mod oracle_down { #[test] fn no_oracle_execute_replace_succeeds() { test_with(|old_vault_id, new_vault_id| { - let accept_amount = new_vault_id.wrapped(10000); - let (redeem_id, _redeem, _issue_id, _issue) = setup_replace(accept_amount, &old_vault_id, &new_vault_id); + let replace_amount = new_vault_id.wrapped(10000); + let (redeem_id, _redeem, _issue_id, _issue) = setup_replace(replace_amount, &old_vault_id, &new_vault_id); OraclePallet::expire_all(); @@ -922,29 +897,32 @@ mod oracle_down { } #[test] - fn no_oracle_cancel_replace_succeeds() { + fn no_oracle_cancel_replace_fails() { test_with(|old_vault_id, new_vault_id| { - let accept_amount = new_vault_id.wrapped(10000); - let (redeem_id, _redeem, _issue_id, _issue) = setup_replace(accept_amount, &old_vault_id, &new_vault_id); + let replace_amount = new_vault_id.wrapped(10000); + let (redeem_id, _redeem, _issue_id, _issue) = setup_replace(replace_amount, &old_vault_id, &new_vault_id); OraclePallet::expire_all(); mine_blocks(2); SecurityPallet::set_active_block_number(30); - assert_ok!(RuntimeCall::Redeem(RedeemCall::cancel_redeem { - redeem_id: redeem_id, - reimburse: true, - }) - .dispatch(origin_of(account_of(NEW_VAULT)))); + assert_noop!( + RuntimeCall::Redeem(RedeemCall::cancel_redeem { + redeem_id: redeem_id, + reimburse: true, + }) + .dispatch(origin_of(account_of(NEW_VAULT))), + OracleError::MissingExchangeRate + ); }) } #[test] fn no_oracle_execute_cancelled_replace_succeeds() { test_with(|old_vault_id, new_vault_id| { - let accept_amount = new_vault_id.wrapped(10000); - let (redeem_id, _redeem, _issue_id, _issue) = setup_replace(accept_amount, &old_vault_id, &new_vault_id); + let replace_amount = new_vault_id.wrapped(10000); + let (redeem_id, _redeem, _issue_id, _issue) = setup_replace(replace_amount, &old_vault_id, &new_vault_id); OraclePallet::expire_all(); assert_ok!(execute_replace(redeem_id)); diff --git a/parachain/runtime/runtime-tests/src/utils/redeem_utils.rs b/parachain/runtime/runtime-tests/src/utils/redeem_utils.rs index fbb266c8fb..297e9dbe06 100644 --- a/parachain/runtime/runtime-tests/src/utils/redeem_utils.rs +++ b/parachain/runtime/runtime-tests/src/utils/redeem_utils.rs @@ -154,6 +154,27 @@ pub fn assert_redeem_request_event() -> H256 { ids.last().unwrap().clone() } +// returns punishment_fee that vault has paid for cancel replace +pub fn get_punishment_fee() -> Amount { + let events = SystemPallet::events(); + let ids = events + .iter() + .filter_map(|r| match r.event { + RuntimeEvent::Redeem(RedeemEvent::CancelReplace { + ref old_vault, + punishment_fee, + .. + }) => { + let fee = Amount::new(punishment_fee, old_vault.collateral_currency()); + Some(fee) + } + _ => None, + }) + .collect::>(); + assert!(ids.len() >= 1); + ids.last().unwrap().clone() +} + /// returns (fee, amount) pub fn assert_self_redeem_event() -> (Amount, Amount) { let events = SystemPallet::events(); diff --git a/primitives/src/lib.rs b/primitives/src/lib.rs index 0616c92f4f..82b303abf9 100644 --- a/primitives/src/lib.rs +++ b/primitives/src/lib.rs @@ -91,6 +91,7 @@ pub enum AccountOrVault { Vault(VaultId), } impl AccountOrVault { + // Method to retrieve the account associated with an `AccountOrVault` instance pub fn get_account(&self) -> &AccountId { match self { AccountOrVault::Account(account_id) => account_id, @@ -98,6 +99,7 @@ impl AccountOrVault { } } + // Method to check if the enum variant is `Vault` pub fn is_vault_account(&self) -> bool { matches!(self, AccountOrVault::Vault(_)) } @@ -298,15 +300,9 @@ pub mod redeem { pub btc_height: u32, /// the status of this redeem request pub status: RedeemRequestStatus, - /// the issue id + /// the issue id associated with replace request pub issue_id: Option, } - - impl RedeemRequest { - pub fn is_redeem_a_replace_request(&self) -> bool { - self.issue_id.is_some() - } - } } pub mod replace { From 601788859062ae570feaac1835f3f189c6af215b Mon Sep 17 00:00:00 2001 From: nakul1010 Date: Fri, 1 Sep 2023 11:30:16 +0530 Subject: [PATCH 4/6] fix: removed unused feature gate --- crates/issue/src/migration.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/crates/issue/src/migration.rs b/crates/issue/src/migration.rs index 07906b2e4e..2f0dfd430c 100644 --- a/crates/issue/src/migration.rs +++ b/crates/issue/src/migration.rs @@ -1,6 +1,5 @@ use super::*; use frame_support::{pallet_prelude::*, traits::OnRuntimeUpgrade}; -#[cfg(feature = "std")] use sp_core::H256; /// The log target. From 9ac38f7fcba0c6dace5876fd58c6b8662274f47d Mon Sep 17 00:00:00 2001 From: nakul1010 Date: Fri, 1 Sep 2023 11:35:45 +0530 Subject: [PATCH 5/6] fix: set mine blocks to issue period --- parachain/runtime/runtime-tests/src/parachain/issue.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/parachain/runtime/runtime-tests/src/parachain/issue.rs b/parachain/runtime/runtime-tests/src/parachain/issue.rs index f08afa49af..bdcf33c04c 100644 --- a/parachain/runtime/runtime-tests/src/parachain/issue.rs +++ b/parachain/runtime/runtime-tests/src/parachain/issue.rs @@ -1159,9 +1159,9 @@ mod oracle_down { fn no_oracle_cancel_issue_succeeds() { test_with_initialized_vault(|vault_id| { assert_ok!(RuntimeCall::Issue(IssueCall::set_issue_period { period: 1000 }).dispatch(root())); - let (issue_id, _) = request_issue(&vault_id, vault_id.wrapped(4_000)); + let (issue_id, issue) = request_issue(&vault_id, vault_id.wrapped(4_000)); SecurityPallet::set_active_block_number(1100); - mine_blocks(100); + mine_blocks(issue.period); OraclePallet::expire_all(); assert_ok!(RuntimeCall::Issue(IssueCall::cancel_issue { issue_id: issue_id }) .dispatch(origin_of(account_of(VAULT)))); @@ -1197,9 +1197,9 @@ mod oracle_down { fn no_oracle_execute_cancelled_issue_fails() { test_with_initialized_vault(|vault_id| { assert_ok!(RuntimeCall::Issue(IssueCall::set_issue_period { period: 1000 }).dispatch(root())); - let (issue_id, _) = request_issue(&vault_id, vault_id.wrapped(4_000)); + let (issue_id, issue) = request_issue(&vault_id, vault_id.wrapped(4_000)); SecurityPallet::set_active_block_number(1100); - mine_blocks(100); + mine_blocks(issue.period); assert_ok!(RuntimeCall::Issue(IssueCall::cancel_issue { issue_id: issue_id }) .dispatch(origin_of(account_of(VAULT)))); From b4c7e8401332d08b1a212647456f867325f4df34 Mon Sep 17 00:00:00 2001 From: nakul1010 Date: Fri, 1 Sep 2023 11:44:39 +0530 Subject: [PATCH 6/6] fix: update mine blocks --- parachain/runtime/runtime-tests/src/parachain/issue.rs | 8 ++++---- parachain/runtime/runtime-tests/src/parachain/redeem.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/parachain/runtime/runtime-tests/src/parachain/issue.rs b/parachain/runtime/runtime-tests/src/parachain/issue.rs index bdcf33c04c..f08afa49af 100644 --- a/parachain/runtime/runtime-tests/src/parachain/issue.rs +++ b/parachain/runtime/runtime-tests/src/parachain/issue.rs @@ -1159,9 +1159,9 @@ mod oracle_down { fn no_oracle_cancel_issue_succeeds() { test_with_initialized_vault(|vault_id| { assert_ok!(RuntimeCall::Issue(IssueCall::set_issue_period { period: 1000 }).dispatch(root())); - let (issue_id, issue) = request_issue(&vault_id, vault_id.wrapped(4_000)); + let (issue_id, _) = request_issue(&vault_id, vault_id.wrapped(4_000)); SecurityPallet::set_active_block_number(1100); - mine_blocks(issue.period); + mine_blocks(100); OraclePallet::expire_all(); assert_ok!(RuntimeCall::Issue(IssueCall::cancel_issue { issue_id: issue_id }) .dispatch(origin_of(account_of(VAULT)))); @@ -1197,9 +1197,9 @@ mod oracle_down { fn no_oracle_execute_cancelled_issue_fails() { test_with_initialized_vault(|vault_id| { assert_ok!(RuntimeCall::Issue(IssueCall::set_issue_period { period: 1000 }).dispatch(root())); - let (issue_id, issue) = request_issue(&vault_id, vault_id.wrapped(4_000)); + let (issue_id, _) = request_issue(&vault_id, vault_id.wrapped(4_000)); SecurityPallet::set_active_block_number(1100); - mine_blocks(issue.period); + mine_blocks(100); assert_ok!(RuntimeCall::Issue(IssueCall::cancel_issue { issue_id: issue_id }) .dispatch(origin_of(account_of(VAULT)))); diff --git a/parachain/runtime/runtime-tests/src/parachain/redeem.rs b/parachain/runtime/runtime-tests/src/parachain/redeem.rs index 624c8c98fc..7fe7a1af7f 100644 --- a/parachain/runtime/runtime-tests/src/parachain/redeem.rs +++ b/parachain/runtime/runtime-tests/src/parachain/redeem.rs @@ -597,7 +597,7 @@ mod spec_based_tests { set_redeem_period(2000); let redeem_id = request_redeem(&vault_id); SecurityPallet::set_active_block_number(1100); - mine_blocks(100); + mine_blocks(12); set_redeem_period(1000); // request still uses period = 200, so cancel fails and execute succeeds