From 6a31c89648a6399209783393dea6a58d019f026d Mon Sep 17 00:00:00 2001 From: SunTiebing <87381708+SunTiebing@users.noreply.github.com> Date: Thu, 23 Jan 2025 21:54:05 +0800 Subject: [PATCH] Bifrost v0.16.2 (#1585) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Bifrost v0.16.2 * Fix buy back (#1586) * Bifrost v0.16.1 * Modify the commission amount to be calculated based on the corresponding vToken quantity. * fix clippy * fix clippy * change div to checked_div method * fix: 🐛 buy-back * refactor: 💡 rm bb-bnc from buy-back pallet --------- Co-authored-by: SunTiebing <1045060705@qq.com> Co-authored-by: SunTiebing <87381708+SunTiebing@users.noreply.github.com> * Fix and migrated benchmarking of lend-market from v1 to v2. (#1587) * v1, clippy failed * bug free;v1;comments to be removed. * Fix and migrated benchmarking of lend-market from v1 to v2. * Opt/srtool release (#1584) * [skip ci](srtool): optimize runtime build workflow - Add automatic trigger for rc version tags (v*.*.*.rc*) - Flatten artifact directory structure - Add runtime info to Slack notification - Remove redundant subwasm artifacts - Improve workflow reusability for release process Co-authored-by: Ares * [skip ci]: fix release srtool file * [skip ci] fix release file name * [skip ci](srtool): optimize runtime build workflow - Add automatic trigger for rc version tags (v*.*.*.rc*) - Flatten artifact directory structure - Add runtime info to Slack notification - Remove redundant subwasm artifacts - Improve workflow reusability for release process Co-authored-by: Ares * adjust vBNC can be used as a flexible fee on the Polkadot side (#1588) * build(deps): bump quote from 1.0.35 to 1.0.38 (#1578) Bumps [quote](https://github.com/dtolnay/quote) from 1.0.35 to 1.0.38. - [Release notes](https://github.com/dtolnay/quote/releases) - [Commits](https://github.com/dtolnay/quote/compare/1.0.35...1.0.38) --- updated-dependencies: - dependency-name: quote dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): bump serde from 1.0.216 to 1.0.217 (#1581) Bumps [serde](https://github.com/serde-rs/serde) from 1.0.216 to 1.0.217. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.216...v1.0.217) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): bump ethereum from 0.14.0 to 0.15.0 (#1336) Bumps [ethereum](https://github.com/rust-blockchain/ethereum) from 0.14.0 to 0.15.0. - [Commits](https://github.com/rust-blockchain/ethereum/commits) --- updated-dependencies: - dependency-name: ethereum dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): bump prettyplease from 0.1.25 to 0.2.25 (#1589) Bumps [prettyplease](https://github.com/dtolnay/prettyplease) from 0.1.25 to 0.2.25. - [Release notes](https://github.com/dtolnay/prettyplease/releases) - [Commits](https://github.com/dtolnay/prettyplease/compare/0.1.25...0.2.25) --- updated-dependencies: - dependency-name: prettyplease dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix bb bnc (#1591) * refactor: 💡 rename fn * fix: 🐛 set_incentive * Adjust min gas fee (#1592) * remove unused libraries and update Cargo.toml (#1601) * Feat/integrated hyperbridge (#1594) * Bifrost v0.16.0 * Migrated benchmarking of cross-in-out from v1 to v2. (#1519) * Migrated benchmarking of stable-pool from v1 to v2. (#1520) * Migrated benchmarking of flexible-fee from v1 to v2. (#1523) * [skip ci]: update bifrost-polkadot chain spec for evm (#1526) Co-authored-by: arescui * Set the number of active collators to 4 (#1529) * init channel commission cleared_commission (#1527) * init channel commission cleared_commission * normalize format * fix clippy * system-staking auto payout (#1528) * upgrade v0.16.0 to stable2407 * Refactor farming gauge (#1509) * Bifrost v0.15.0 * Migrated benchmarking of asset-registry from v1 to v2. (#1486) * Feat/ban vbnc transfer (#1487) * Bifrost v0.14.0 * Feat/optimize salp (#1433) * Backup salp pallet * remove unused BancorHandler * remove unused Call of SALP * remove extra fee of bifrost_salp::Call::contribute in runtime * adjust test and benchmarking * remove unused interface type of SALP * fix clippy * Optimised calculation of evm fee (#1434) * Optimised calculation of evm fee * Update gas_fee_price to weth_price * Moved PalletId and AccountId to primitives. (#1437) * Bifrost v0.13.0 * Remove getter in buy-back. (#1354) * Bifrost v0.12.0 * remove old migrations * Fix vtokenVoting.removeDelegatorVote (#1288) * add PollClass type * add the calss parameter to the remove_delegator_vote method * Add metadata hash (#1299) * feat: 🎸 add buy-back * Bifrost v0.10.001 * feat: 🎸 benchmark * SLPx mint support commission id (#1261) * Add vtoken exchange rate rpc (#1260) * fix: 🐛 add event (#1263) * add update_currency_metadata function (#1259) * add update_currency_metadata function * fix: 🐛 correct update_currency_metadata weight * add the use of Vec (#1264) * Add vtoken exchange rate rpc * add the use of Vec * Upgrade to Polkadot-SDK v1.7.0 (#1262) * Bifrost v0.10.0 * fix: 🐛 clippy * Fix chain spec (#1243) * Upgrade to polkadot-v1.7.0 --------- Co-authored-by: SunTiebing <1045060705@qq.com> Co-authored-by: Edwin Wang * Fix compile * feat: 🎸 add metadata-hash-extension (#1265) * feat: 🎸 add metadata-hash-extension * Fix compile (#1266) * Fix/fix vtoken voting unlock (#1267) * update the exchange rate of vtokenminting of vtokenvoting test * Resolve the frozen anomaly when unlocking * Revert "feat: 🎸 add metadata-hash-extension (#1265)" (#1268) This reverts commit 489fc9c6adeae44d23edf449e74fde3d6aa40bc3. * rename the version number to 0.11.0 * Slp supports XCMv4 and reconstruct integration tests (#1272) * Fix compile * Reconstruct integration tests and slp supports XCMv4 * Fix slp construct_xcm_message * Feat/slpx mint add commission (#1273) * SLPx mint support commission id * remove the channel_id parameter from the mint method * add mint_with_channel_id method * perform data migration for OrderQueue storage * slpx: set the default value of channel_id to 0 * resolve conflicts * change the location of the old data structure during storage migration * Feat/add vtoken exchange rate rpc (#1274) * Add vtoken exchange rate rpc * add the use of Vec * supplement the RPC logic && fix bugs * adjust the RPC exchange rate precision to three decimal places * fix clippy * fix bug: storage migration anomaly (#1276) * SLPx mint support commission id * remove the channel_id parameter from the mint method * add mint_with_channel_id method * perform data migration for OrderQueue storage * slpx: set the default value of channel_id to 0 * resolve conflicts * change the location of the old data structure during storage migration * fix bug: storage migration anomaly * Slp removes refund (#1275) * Slp removes refund * Fix clippy * Feat/add vtoken exchange rate rpc (#1277) * Add vtoken exchange rate rpc * add the use of Vec * supplement the RPC logic && fix bugs * adjust the RPC exchange rate precision to three decimal places * fix clippy * supplement omissions: adjust the RPC exchange rate precision to three decimal places * Remove dmp queue (#1279) * fix: 🐛 CheckMetadataHash to false * fix: 🐛 update sp-api * refactor: 💡 fmt * fix: 🐛 add metadata-hash * fix: 🐛 add feature metadata-hash * fix: 🐛 rm metadata-hash feature --------- Co-authored-by: SunTiebing <1045060705@qq.com> Co-authored-by: SunTiebing <87381708+SunTiebing@users.noreply.github.com> Co-authored-by: NingBo Wang <2536935847@qq.com> Co-authored-by: Edwin Wang * refactor: 💡 update MaxTurnout and whitelisted_caller track (#1304) * Allow to receive and send Ethereum assets (#1305) * feat: 🎸 add buy-back * Bifrost v0.10.001 * feat: 🎸 benchmark * SLPx mint support commission id (#1261) * Add vtoken exchange rate rpc (#1260) * fix: 🐛 add event (#1263) * add update_currency_metadata function (#1259) * add update_currency_metadata function * fix: 🐛 correct update_currency_metadata weight * add the use of Vec (#1264) * Add vtoken exchange rate rpc * add the use of Vec * Upgrade to Polkadot-SDK v1.7.0 (#1262) * Bifrost v0.10.0 * fix: 🐛 clippy * Fix chain spec (#1243) * Upgrade to polkadot-v1.7.0 --------- Co-authored-by: SunTiebing <1045060705@qq.com> Co-authored-by: Edwin Wang * feat: 🎸 add metadata-hash-extension (#1265) * Fix compile (#1266) * Fix/fix vtoken voting unlock (#1267) * update the exchange rate of vtokenminting of vtokenvoting test * Resolve the frozen anomaly when unlocking * Revert "feat: 🎸 add metadata-hash-extension (#1265)" (#1268) This reverts commit 489fc9c6adeae44d23edf449e74fde3d6aa40bc3. * rename the version number to 0.11.0 * Slp supports XCMv4 and reconstruct integration tests (#1272) * Fix compile * Reconstruct integration tests and slp supports XCMv4 * Fix slp construct_xcm_message * Feat/slpx mint add commission (#1273) * SLPx mint support commission id * remove the channel_id parameter from the mint method * add mint_with_channel_id method * perform data migration for OrderQueue storage * slpx: set the default value of channel_id to 0 * resolve conflicts * change the location of the old data structure during storage migration * Feat/add vtoken exchange rate rpc (#1274) * Add vtoken exchange rate rpc * add the use of Vec * supplement the RPC logic && fix bugs * adjust the RPC exchange rate precision to three decimal places * fix clippy * fix bug: storage migration anomaly (#1276) * SLPx mint support commission id * remove the channel_id parameter from the mint method * add mint_with_channel_id method * perform data migration for OrderQueue storage * slpx: set the default value of channel_id to 0 * resolve conflicts * change the location of the old data structure during storage migration * fix bug: storage migration anomaly * Slp removes refund (#1275) * Slp removes refund * Fix clippy * Allow to receive and send Ethereum assets * Add constants --------- Co-authored-by: yooml Co-authored-by: SunTiebing <1045060705@qq.com> Co-authored-by: SunTiebing <87381708+SunTiebing@users.noreply.github.com> Co-authored-by: Edwin Wang * Disable supplement_fee_reserve (#1306) * Remove call_switchgear and add tx_pause (#1308) * Remove call_switchgear and add tx_pause * Fix clippy * Optimize flexible fee (#1307) * Optimize flexible fee * Fix bug * Fix bug * Add PalletId * Add error handle * feat: 🎸 add market-bond * fix: 🐛 test-all * fix: 🐛 try-runtime * Add the channel_id field to the Minted event * Upgrade to polkadot-v1.13.0 (#1312) * Upgrade to polkadot-v1.13.0 * remove the warning * Fix dep issues * Upgrade to polkadot-v1.13.0 * supplement and upgrade the code * Upgrade the new parts from v0.12.0 * Fix dep issues * format Cargo.toml * Modify the AddOrigin type of the fellowship in bifrost-polkadot * Cancel the cross-in-out migration. * fix clippy --------- Co-authored-by: hqwangningbo <2536935847@qq.com> * Use github dependencies (#1314) * Fix flexible_fee TransferTo (#1315) * Fix generate_genesis_state (#1317) * Optimize oracle (#1318) * refactor: 💡 optimize orml-oracle * fix: 🐛 MinimumTimestampInterval * style: 💄 rename to MaximumValueInterval * Add some tests for ve-minting * Add some tests for ve-minting * Integrate evm (#1319) * Update dep * Ingrate EVM * Fix deps * Add precompiles.rs * Remove pallet-hotfix-sufficients * Add pallet-evm-accounts * Evm precompiles * EVM integration * Fix compile * Fix rpc * Fix `encode_evm_address` and `decode_evm_address` * Fix evm precompile multicurrency * Implementing Erc20Mapping using xc-20 standard * Compatible with BNC Decimal * Increase min_gas_price * feat: enable dev mode with manual seal & fix pending block problem * Add copyright and fix some bugs * Change native token to WETH * Support evm flexible fee * Add inner_swap_exact_assets_for_assets to evm withdraw fee * Remove swap * EVM migration from bifrost kusama to bifrost polkadot * Fix erc20 precompile * Use OraclePrice * Fix some errors * feat: add prices genesis config & optimize dev mode code * Fix conflicts * Fix some errors * Fix clippy * Format Cargo.toml * Remove unused code * Fix clippy * Fix some errors * Fix erc20 precompile --------- Co-authored-by: Edwin Wang Co-authored-by: Damian.lu * Fix try-runtime (#1323) * Fix manual seal * Fix manual seal (#1324) * fix: 🐛 fellowship collective data (#1325) * fix: add parachain mock inherent data provider * Fix ethereum transfer fee (#1328) * Add evm genesis migration (#1338) * Bifrost v0.12.0 (#1286) * Bifrost v0.12.0 * remove old migrations * Fix vtokenVoting.removeDelegatorVote (#1288) * add PollClass type * add the calss parameter to the remove_delegator_vote method * Add metadata hash (#1299) * feat: 🎸 add buy-back * Bifrost v0.10.001 * feat: 🎸 benchmark * SLPx mint support commission id (#1261) * Add vtoken exchange rate rpc (#1260) * fix: 🐛 add event (#1263) * add update_currency_metadata function (#1259) * add update_currency_metadata function * fix: 🐛 correct update_currency_metadata weight * add the use of Vec (#1264) * Add vtoken exchange rate rpc * add the use of Vec * Upgrade to Polkadot-SDK v1.7.0 (#1262) * Bifrost v0.10.0 * fix: 🐛 clippy * Fix chain spec (#1243) * Upgrade to polkadot-v1.7.0 --------- Co-authored-by: SunTiebing <1045060705@qq.com> Co-authored-by: Edwin Wang * Fix compile * feat: 🎸 add metadata-hash-extension (#1265) * feat: 🎸 add metadata-hash-extension * Fix compile (#1266) * Fix/fix vtoken voting unlock (#1267) * update the exchange rate of vtokenminting of vtokenvoting test * Resolve the frozen anomaly when unlocking * Revert "feat: 🎸 add metadata-hash-extension (#1265)" (#1268) This reverts commit 489fc9c6adeae44d23edf449e74fde3d6aa40bc3. * rename the version number to 0.11.0 * Slp supports XCMv4 and reconstruct integration tests (#1272) * Fix compile * Reconstruct integration tests and slp supports XCMv4 * Fix slp construct_xcm_message * Feat/slpx mint add commission (#1273) * SLPx mint support commission id * remove the channel_id parameter from the mint method * add mint_with_channel_id method * perform data migration for OrderQueue storage * slpx: set the default value of channel_id to 0 * resolve conflicts * change the location of the old data structure during storage migration * Feat/add vtoken exchange rate rpc (#1274) * Add vtoken exchange rate rpc * add the use of Vec * supplement the RPC logic && fix bugs * adjust the RPC exchange rate precision to three decimal places * fix clippy * fix bug: storage migration anomaly (#1276) * SLPx mint support commission id * remove the channel_id parameter from the mint method * add mint_with_channel_id method * perform data migration for OrderQueue storage * slpx: set the default value of channel_id to 0 * resolve conflicts * change the location of the old data structure during storage migration * fix bug: storage migration anomaly * Slp removes refund (#1275) * Slp removes refund * Fix clippy * Feat/add vtoken exchange rate rpc (#1277) * Add vtoken exchange rate rpc * add the use of Vec * supplement the RPC logic && fix bugs * adjust the RPC exchange rate precision to three decimal places * fix clippy * supplement omissions: adjust the RPC exchange rate precision to three decimal places * Remove dmp queue (#1279) * fix: 🐛 CheckMetadataHash to false * fix: 🐛 update sp-api * refactor: 💡 fmt * fix: 🐛 add metadata-hash * fix: 🐛 add feature metadata-hash * fix: 🐛 rm metadata-hash feature --------- Co-authored-by: SunTiebing <1045060705@qq.com> Co-authored-by: SunTiebing <87381708+SunTiebing@users.noreply.github.com> Co-authored-by: NingBo Wang <2536935847@qq.com> Co-authored-by: Edwin Wang * refactor: 💡 update MaxTurnout and whitelisted_caller track (#1304) * Allow to receive and send Ethereum assets (#1305) * feat: 🎸 add buy-back * Bifrost v0.10.001 * feat: 🎸 benchmark * SLPx mint support commission id (#1261) * Add vtoken exchange rate rpc (#1260) * fix: 🐛 add event (#1263) * add update_currency_metadata function (#1259) * add update_currency_metadata function * fix: 🐛 correct update_currency_metadata weight * add the use of Vec (#1264) * Add vtoken exchange rate rpc * add the use of Vec * Upgrade to Polkadot-SDK v1.7.0 (#1262) * Bifrost v0.10.0 * fix: 🐛 clippy * Fix chain spec (#1243) * Upgrade to polkadot-v1.7.0 --------- Co-authored-by: SunTiebing <1045060705@qq.com> Co-authored-by: Edwin Wang * feat: 🎸 add metadata-hash-extension (#1265) * Fix compile (#1266) * Fix/fix vtoken voting unlock (#1267) * update the exchange rate of vtokenminting of vtokenvoting test * Resolve the frozen anomaly when unlocking * Revert "feat: 🎸 add metadata-hash-extension (#1265)" (#1268) This reverts commit 489fc9c6adeae44d23edf449e74fde3d6aa40bc3. * rename the version number to 0.11.0 * Slp supports XCMv4 and reconstruct integration tests (#1272) * Fix compile * Reconstruct integration tests and slp supports XCMv4 * Fix slp construct_xcm_message * Feat/slpx mint add commission (#1273) * SLPx mint support commission id * remove the channel_id parameter from the mint method * add mint_with_channel_id method * perform data migration for OrderQueue storage * slpx: set the default value of channel_id to 0 * resolve conflicts * change the location of the old data structure during storage migration * Feat/add vtoken exchange rate rpc (#1274) * Add vtoken exchange rate rpc * add the use of Vec * supplement the RPC logic && fix bugs * adjust the RPC exchange rate precision to three decimal places * fix clippy * fix bug: storage migration anomaly (#1276) * SLPx mint support commission id * remove the channel_id parameter from the mint method * add mint_with_channel_id method * perform data migration for OrderQueue storage * slpx: set the default value of channel_id to 0 * resolve conflicts * change the location of the old data structure during storage migration * fix bug: storage migration anomaly * Slp removes refund (#1275) * Slp removes refund * Fix clippy * Allow to receive and send Ethereum assets * Add constants --------- Co-authored-by: yooml Co-authored-by: SunTiebing <1045060705@qq.com> Co-authored-by: SunTiebing <87381708+SunTiebing@users.noreply.github.com> Co-authored-by: Edwin Wang * Disable supplement_fee_reserve (#1306) * Remove call_switchgear and add tx_pause (#1308) * Remove call_switchgear and add tx_pause * Fix clippy * Optimize flexible fee (#1307) * Optimize flexible fee * Fix bug * Fix bug * Add PalletId * Add error handle * feat: 🎸 add market-bond * fix: 🐛 test-all * fix: 🐛 try-runtime * Add the channel_id field to the Minted event * Upgrade to polkadot-v1.13.0 (#1312) * Upgrade to polkadot-v1.13.0 * remove the warning * Fix dep issues * Upgrade to polkadot-v1.13.0 * supplement and upgrade the code * Upgrade the new parts from v0.12.0 * Fix dep issues * format Cargo.toml * Modify the AddOrigin type of the fellowship in bifrost-polkadot * Cancel the cross-in-out migration. * fix clippy --------- Co-authored-by: hqwangningbo <2536935847@qq.com> * Use github dependencies (#1314) * Fix flexible_fee TransferTo (#1315) * Fix generate_genesis_state (#1317) * Optimize oracle (#1318) * refactor: 💡 optimize orml-oracle * fix: 🐛 MinimumTimestampInterval * style: 💄 rename to MaximumValueInterval * Add some tests for ve-minting * Add some tests for ve-minting * Integrate evm (#1319) * Update dep * Ingrate EVM * Fix deps * Add precompiles.rs * Remove pallet-hotfix-sufficients * Add pallet-evm-accounts * Evm precompiles * EVM integration * Fix compile * Fix rpc * Fix `encode_evm_address` and `decode_evm_address` * Fix evm precompile multicurrency * Implementing Erc20Mapping using xc-20 standard * Compatible with BNC Decimal * Increase min_gas_price * feat: enable dev mode with manual seal & fix pending block problem * Add copyright and fix some bugs * Change native token to WETH * Support evm flexible fee * Add inner_swap_exact_assets_for_assets to evm withdraw fee * Remove swap * EVM migration from bifrost kusama to bifrost polkadot * Fix erc20 precompile * Use OraclePrice * Fix some errors * feat: add prices genesis config & optimize dev mode code * Fix conflicts * Fix some errors * Fix clippy * Format Cargo.toml * Remove unused code * Fix clippy * Fix some errors * Fix erc20 precompile --------- Co-authored-by: Edwin Wang Co-authored-by: Damian.lu * Fix try-runtime (#1323) * Fix manual seal * Fix manual seal (#1324) * fix: 🐛 fellowship collective data (#1325) * fix: add parachain mock inherent data provider * Fix ethereum transfer fee (#1328) --------- Co-authored-by: Edwin Wang Co-authored-by: yooml Co-authored-by: NingBo Wang <2536935847@qq.com> Co-authored-by: Gemma Co-authored-by: Damian.lu * Add evm genesis storage * [skip ci] Add evmSince --------- Co-authored-by: SunTiebing <87381708+SunTiebing@users.noreply.github.com> Co-authored-by: Edwin Wang Co-authored-by: yooml Co-authored-by: Gemma Co-authored-by: Damian.lu * Bump version to 0.12.1 * Update Cargo.lock * Fix migration (#1341) * Bifrost v0.12.0 (#1286) * Bifrost v0.12.0 * remove old migrations * Fix vtokenVoting.removeDelegatorVote (#1288) * add PollClass type * add the calss parameter to the remove_delegator_vote method * Add metadata hash (#1299) * feat: 🎸 add buy-back * Bifrost v0.10.001 * feat: 🎸 benchmark * SLPx mint support commission id (#1261) * Add vtoken exchange rate rpc (#1260) * fix: 🐛 add event (#1263) * add update_currency_metadata function (#1259) * add update_currency_metadata function * fix: 🐛 correct update_currency_metadata weight * add the use of Vec (#1264) * Add vtoken exchange rate rpc * add the use of Vec * Upgrade to Polkadot-SDK v1.7.0 (#1262) * Bifrost v0.10.0 * fix: 🐛 clippy * Fix chain spec (#1243) * Upgrade to polkadot-v1.7.0 --------- Co-authored-by: SunTiebing <1045060705@qq.com> Co-authored-by: Edwin Wang * Fix compile * feat: 🎸 add metadata-hash-extension (#1265) * feat: 🎸 add metadata-hash-extension * Fix compile (#1266) * Fix/fix vtoken voting unlock (#1267) * update the exchange rate of vtokenminting of vtokenvoting test * Resolve the frozen anomaly when unlocking * Revert "feat: 🎸 add metadata-hash-extension (#1265)" (#1268) This reverts commit 489fc9c6adeae44d23edf449e74fde3d6aa40bc3. * rename the version number to 0.11.0 * Slp supports XCMv4 and reconstruct integration tests (#1272) * Fix compile * Reconstruct integration tests and slp supports XCMv4 * Fix slp construct_xcm_message * Feat/slpx mint add commission (#1273) * SLPx mint support commission id * remove the channel_id parameter from the mint method * add mint_with_channel_id method * perform data migration for OrderQueue storage * slpx: set the default value of channel_id to 0 * resolve conflicts * change the location of the old data structure during storage migration * Feat/add vtoken exchange rate rpc (#1274) * Add vtoken exchange rate rpc * add the use of Vec * supplement the RPC logic && fix bugs * adjust the RPC exchange rate precision to three decimal places * fix clippy * fix bug: storage migration anomaly (#1276) * SLPx mint support commission id * remove the channel_id parameter from the mint method * add mint_with_channel_id method * perform data migration for OrderQueue storage * slpx: set the default value of channel_id to 0 * resolve conflicts * change the location of the old data structure during storage migration * fix bug: storage migration anomaly * Slp removes refund (#1275) * Slp removes refund * Fix clippy * Feat/add vtoken exchange rate rpc (#1277) * Add vtoken exchange rate rpc * add the use of Vec * supplement the RPC logic && fix bugs * adjust the RPC exchange rate precision to three decimal places * fix clippy * supplement omissions: adjust the RPC exchange rate precision to three decimal places * Remove dmp queue (#1279) * fix: 🐛 CheckMetadataHash to false * fix: 🐛 update sp-api * refactor: 💡 fmt * fix: 🐛 add metadata-hash * fix: 🐛 add feature metadata-hash * fix: 🐛 rm metadata-hash feature --------- Co-authored-by: SunTiebing <1045060705@qq.com> Co-authored-by: SunTiebing <87381708+SunTiebing@users.noreply.github.com> Co-authored-by: NingBo Wang <2536935847@qq.com> Co-authored-by: Edwin Wang * refactor: 💡 update MaxTurnout and whitelisted_caller track (#1304) * Allow to receive and send Ethereum assets (#1305) * feat: 🎸 add buy-back * Bifrost v0.10.001 * feat: 🎸 benchmark * SLPx mint support commission id (#1261) * Add vtoken exchange rate rpc (#1260) * fix: 🐛 add event (#1263) * add update_currency_metadata function (#1259) * add update_currency_metadata function * fix: 🐛 correct update_currency_metadata weight * add the use of Vec (#1264) * Add vtoken exchange rate rpc * add the use of Vec * Upgrade to Polkadot-SDK v1.7.0 (#1262) * Bifrost v0.10.0 * fix: 🐛 clippy * Fix chain spec (#1243) * Upgrade to polkadot-v1.7.0 --------- Co-authored-by: SunTiebing <1045060705@qq.com> Co-authored-by: Edwin Wang * feat: 🎸 add metadata-hash-extension (#1265) * Fix compile (#1266) * Fix/fix vtoken voting unlock (#1267) * update the exchange rate of vtokenminting of vtokenvoting test * Resolve the frozen anomaly when unlocking * Revert "feat: 🎸 add metadata-hash-extension (#1265)" (#1268) This reverts commit 489fc9c6adeae44d23edf449e74fde3d6aa40bc3. * rename the version number to 0.11.0 * Slp supports XCMv4 and reconstruct integration tests (#1272) * Fix compile * Reconstruct integration tests and slp supports XCMv4 * Fix slp construct_xcm_message * Feat/slpx mint add commission (#1273) * SLPx mint support commission id * remove the channel_id parameter from the mint method * add mint_with_channel_id method * perform data migration for OrderQueue storage * slpx: set the default value of channel_id to 0 * resolve conflicts * change the location of the old data structure during storage migration * Feat/add vtoken exchange rate rpc (#1274) * Add vtoken exchange rate rpc * add the use of Vec * supplement the RPC logic && fix bugs * adjust the RPC exchange rate precision to three decimal places * fix clippy * fix bug: storage migration anomaly (#1276) * SLPx mint support commission id * remove the channel_id parameter from the mint method * add mint_with_channel_id method * perform data migration for OrderQueue storage * slpx: set the default value of channel_id to 0 * resolve conflicts * change the location of the old data structure during storage migration * fix bug: storage migration anomaly * Slp removes refund (#1275) * Slp removes refund * Fix clippy * Allow to receive and send Ethereum assets * Add constants --------- Co-authored-by: yooml Co-authored-by: SunTiebing <1045060705@qq.com> Co-authored-by: SunTiebing <87381708+SunTiebing@users.noreply.github.com> Co-authored-by: Edwin Wang * Disable supplement_fee_reserve (#1306) * Remove call_switchgear and add tx_pause (#1308) * Remove call_switchgear and add tx_pause * Fix clippy * Optimize flexible fee (#1307) * Optimize flexible fee * Fix bug * Fix bug * Add PalletId * Add error handle * feat: 🎸 add market-bond * fix: 🐛 test-all * fix: 🐛 try-runtime * Add the channel_id field to the Minted event * Upgrade to polkadot-v1.13.0 (#1312) * Upgrade to polkadot-v1.13.0 * remove the warning * Fix dep issues * Upgrade to polkadot-v1.13.0 * supplement and upgrade the code * Upgrade the new parts from v0.12.0 * Fix dep issues * format Cargo.toml * Modify the AddOrigin type of the fellowship in bifrost-polkadot * Cancel the cross-in-out migration. * fix clippy --------- Co-authored-by: hqwangningbo <2536935847@qq.com> * Use github dependencies (#1314) * Fix flexible_fee TransferTo (#1315) * Fix generate_genesis_state (#1317) * Optimize oracle (#1318) * refactor: 💡 optimize orml-oracle * fix: 🐛 MinimumTimestampInterval * style: 💄 rename to MaximumValueInterval * Add some tests for ve-minting * Add some tests for ve-minting * Integrate evm (#1319) * Update dep * Ingrate EVM * Fix deps * Add precompiles.rs * Remove pallet-hotfix-sufficients * Add pallet-evm-accounts * Evm precompiles * EVM integration * Fix compile * Fix rpc * Fix `encode_evm_address` and `decode_evm_address` * Fix evm precompile multicurrency * Implementing Erc20Mapping using xc-20 standard * Compatible with BNC Decimal * Increase min_gas_price * feat: enable dev mode with manual seal & fix pending block problem * Add copyright and fix some bugs * Change native token to WETH * Support evm flexible fee * Add inner_swap_exact_assets_for_assets to evm withdraw fee * Remove swap * EVM migration from bifrost kusama to bifrost polkadot * Fix erc20 precompile * Use OraclePrice * Fix some errors * feat: add prices genesis config & optimize dev mode code * Fix conflicts * Fix some errors * Fix clippy * Format Cargo.toml * Remove unused code * Fix clippy * Fix some errors * Fix erc20 precompile --------- Co-authored-by: Edwin Wang Co-authored-by: Damian.lu * Fix try-runtime (#1323) * Fix manual seal * Fix manual seal (#1324) * fix: 🐛 fellowship collective data (#1325) * fix: add parachain mock inherent data provider * Fix ethereum transfer fee (#1328) --------- Co-authored-by: Edwin Wang Co-authored-by: yooml Co-authored-by: NingBo Wang <2536935847@qq.com> Co-authored-by: Gemma Co-authored-by: Damian.lu * Add evm genesis storage * [skip ci] Add evmSince * Fix migration * Fix migration * Remove unused code --------- Co-authored-by: SunTiebing <87381708+SunTiebing@users.noreply.github.com> Co-authored-by: Edwin Wang Co-authored-by: yooml Co-authored-by: Gemma Co-authored-by: Damian.lu * Remove getter in buy-back --------- Co-authored-by: SunTiebing <1045060705@qq.com> Co-authored-by: SunTiebing <87381708+SunTiebing@users.noreply.github.com> Co-authored-by: Edwin Wang Co-authored-by: yooml Co-authored-by: NingBo Wang <2536935847@qq.com> Co-authored-by: Damian.lu * Remove getters in xcm-interface (#1352) * Remove getters in salp. (#1351) * Remove getter in evm-accounts (#1350) * Remove getters in slp (#1353) * Remove getters in slpx (#1360) * Remove getters in vstoken-conversion. (#1362) * Remove getters in vtoken-minting. (#1363) * Remove getter in system-maker. (#1364) * Remove getter in fee-share (#1365) * Remove getters in prices (#1367) * Remove getters in lend-market (#1366) * Remove getters in ve-minting (#1368) * Optimize clippy (#1369) * Deprecated unused pallets (#1383) * Review format (#1386) * style: 💄 format * style: 💄 check-all * fix: 🐛 bench * Update buy back (#1387) * style: 💄 format * style: 💄 check-all * fix: 🐛 bench * feat: 🎸 add destruction_ratio * fix: 🐛 benchmark * EVM flexible fee logic optimization (#1370) * EVM flexible fee logic optimization * Add comments * Add support for handling different currency precisions & included error handling. * Adjust the gas_fee parameter in the get_balance_in_currency method to an exact value * fix clippy * add test code of flexiable-fee pallet * Update fee share (#1395) * feat: 🎸 add usd_cumulation * feat: 🎸 bench * fix: 🐛 fmt * docs: ✏️ add note * Feat/change evm address convert rule (#1396) * Change EVM Address convert rule * Change EVM Address convert rule * Remove the unused function:is_evm_account & rename truncated_account_id function to convert_account_id * fix clippy * refactor: 💡 move to TechAdmin (#1398) * refactor: 💡 transfer to BuyBackAccount (#1399) * Fix mint_with_channel_id weights (#1400) * Recoverd imgs of banner and logo (#1401) * feat: 🎸 add fn set_swap_out_min (#1389) * feat: 🎸 add fn set_swap_out_min * fix: 🐛 fmt * fix: 🐛 fmt * fix: 🐛 error * feat: 🎸 add bais * fix: 🐛 add test * fix: 🐛 rename field bias * Optimize the `channel-commission` code. (#1390) * Optimize the `channel-commission` code. * Replace the insert method with the mutate method * Added a result check for the clear_prefix method * Supplement the test code of `channel-commission`. * Handling Error cases in hooks. * Optimize the handling of the `check_removed_all` method. * Remove getters in cross-in-out (#1402) * Removed getters in channel-commission. (#1404) * Removed getters in flexible-fee. (#1405) * Removed getters in channel-commission. * Removed getters in flexible-fee. * Removed getters in parachain-staking. (#1406) * Removed getters in channel-commission. * Removed getters in flexible-fee. * Removed getterd in parachain-staking. * Update buy back (#1407) * fix: 🐛 add field last_buyback_cycle for accurate judgment * style: 💄 fmt * Update ve minting (#1408) * refactor: 💡 transfer to BuyBackAccount * feat: 🎸 add auto notify_reward * Removed getters in stable-asset and system-staking. (#1409) * Removed getters in channel-commission. * Removed getters in flexible-fee. * Removed getterd in parachain-staking. * Removed getters in stable-asset. * Removed getters in stable-asset. * Removed getters in token-issuer. (#1410) * Removed getters in channel-commission. * Removed getters in flexible-fee. * Removed getterd in parachain-staking. * Removed getters in stable-asset. * Removed getters in stable-asset. * Removed getters in token-issuer. --------- Co-authored-by: Edwin * Moved PrarachainId to primitives. (#1394) * Moved PrarachainId to primitives * updated * bug fixed * Moved parachain ids to primitives. * bug fixed * Fixed error. * Removed getters in vsbond-auction. (#1412) * Fix evm TransferEvmFees (#1411) * Add slp v2 (#1397) * Add slp v2 * Add slp v2 weights * Optimize slp v2 * Optimize slp v2 * Remove operator * Feat/vbnc convert (#1413) * Add vbnc-convert pallet * add weights.rs of vbnc-convert pallet * update token id of VBNC_P * update weight of vbnc-convert pallet * Supplement the comments of `vbnc-convert`. * update VBNCConvert index in Runtime enum * Optimize vbnc-convert pallet pallet. * Updated (#1416) * Add more slp v2 docs (#1419) * Optimize xcm config (#1417) * Optimize xcm config * Fix moonbeam chain id * Update fee share (#1418) * refactor: 💡 for review * fix: 🐛 mv storage * fix: 🐛 bench * refactor: 💡 fmt --------- Co-authored-by: Edwin * Moved PalletId and AccountId to primitives * Optimize slp v2 (#1423) * Optimize slp v2 * Optimize weights * fix: 🐛 redefine system pool id (#1421) * fix: 🐛 redefine system pool id * fix: 🐛 auto_notify_reward * refactor: 💡 rename to bb-bnc * style: 💄 clippy * fix: 🐛 rename error * refactor: 💡 rm BbBNCPalletId * fix: 🐛 UserFarmingPool bound limit * Moved CurrencyId to primitives. * Updated to the latest version. * change VBNC_P_TOKEN_ID to 5 (#1425) * updated * update * updated * updated --------- Co-authored-by: SunTiebing <1045060705@qq.com> Co-authored-by: SunTiebing <87381708+SunTiebing@users.noreply.github.com> Co-authored-by: Edwin Wang Co-authored-by: yooml Co-authored-by: NingBo Wang <2536935847@qq.com> Co-authored-by: Damian.lu * Optimize xcm interface (#1439) * Optimize xcm-interface pallet * Add weights * Add weights * Add weights * Optimize xcm-interface pallet * remove unnecessary call method of cross-in-out (#1440) && optimize cross-in-out pallet * Update bb bnc (#1436) * refactor: 💡 for review * docs: ✏️ add docs * fix: 🐛 docs * fix: 🐛 add event && addr rename * Optimize slpx pallet (#1444) * Moved palletId in runtime to primitives (#1443) * Optimize asset registry (#1445) * optimize asset-registry & remove unused call * backup asset-registry pallet * Removed getters in farming (#1446) * Removed getters in vesting. (#1447) * Removed getters in vesting * updated * updated * Feat/vtoken voting vbnc (#1442) * Bifrost v0.12.0 * remove old migrations * Fix vtokenVoting.removeDelegatorVote (#1288) * add PollClass type * add the calss parameter to the remove_delegator_vote method * Add metadata hash (#1299) * feat: 🎸 add buy-back * Bifrost v0.10.001 * feat: 🎸 benchmark * SLPx mint support commission id (#1261) * Add vtoken exchange rate rpc (#1260) * fix: 🐛 add event (#1263) * add update_currency_metadata function (#1259) * add update_currency_metadata function * fix: 🐛 correct update_currency_metadata weight * add the use of Vec (#1264) * Add vtoken exchange rate rpc * add the use of Vec * Upgrade to Polkadot-SDK v1.7.0 (#1262) * Bifrost v0.10.0 * fix: 🐛 clippy * Fix chain spec (#1243) * Upgrade to polkadot-v1.7.0 --------- Co-authored-by: SunTiebing <1045060705@qq.com> Co-authored-by: Edwin Wang * Fix compile * feat: 🎸 add metadata-hash-extension (#1265) * feat: 🎸 add metadata-hash-extension * Fix compile (#1266) * Fix/fix vtoken voting unlock (#1267) * update the exchange rate of vtokenminting of vtokenvoting test * Resolve the frozen anomaly when unlocking * Revert "feat: 🎸 add metadata-hash-extension (#1265)" (#1268) This reverts commit 489fc9c6adeae44d23edf449e74fde3d6aa40bc3. * rename the version number to 0.11.0 * Slp supports XCMv4 and reconstruct integration tests (#1272) * Fix compile * Reconstruct integration tests and slp supports XCMv4 * Fix slp construct_xcm_message * Feat/slpx mint add commission (#1273) * SLPx mint support commission id * remove the channel_id parameter from the mint method * add mint_with_channel_id method * perform data migration for OrderQueue storage * slpx: set the default value of channel_id to 0 * resolve conflicts * change the location of the old data structure during storage migration * Feat/add vtoken exchange rate rpc (#1274) * Add vtoken exchange rate rpc * add the use of Vec * supplement the RPC logic && fix bugs * adjust the RPC exchange rate precision to three decimal places * fix clippy * fix bug: storage migration anomaly (#1276) * SLPx mint support commission id * remove the channel_id parameter from the mint method * add mint_with_channel_id method * perform data migration for OrderQueue storage * slpx: set the default value of channel_id to 0 * resolve conflicts * change the location of the old data structure during storage migration * fix bug: storage migration anomaly * Slp removes refund (#1275) * Slp removes refund * Fix clippy * Feat/add vtoken exchange rate rpc (#1277) * Add vtoken exchange rate rpc * add the use of Vec * supplement the RPC logic && fix bugs * adjust the RPC exchange rate precision to three decimal places * fix clippy * supplement omissions: adjust the RPC exchange rate precision to three decimal places * Remove dmp queue (#1279) * fix: 🐛 CheckMetadataHash to false * fix: 🐛 update sp-api * refactor: 💡 fmt * fix: 🐛 add metadata-hash * fix: 🐛 add feature metadata-hash * fix: 🐛 rm metadata-hash feature --------- Co-authored-by: SunTiebing <1045060705@qq.com> Co-authored-by: SunTiebing <87381708+SunTiebing@users.noreply.github.com> Co-authored-by: NingBo Wang <2536935847@qq.com> Co-authored-by: Edwin Wang * refactor: 💡 update MaxTurnout and whitelisted_caller track (#1304) * Allow to receive and send Ethereum assets (#1305) * feat: 🎸 add buy-back * Bifrost v0.10.001 * feat: 🎸 benchmark * SLPx mint support commission id (#1261) * Add vtoken exchange rate rpc (#1260) * fix: 🐛 add event (#1263) * add update_currency_metadata function (#1259) * add update_currency_metadata function * fix: 🐛 correct update_currency_metadata weight * add the use of Vec (#1264) * Add vtoken exchange rate rpc * add the use of Vec * Upgrade to Polkadot-SDK v1.7.0 (#1262) * Bifrost v0.10.0 * fix: 🐛 clippy * Fix chain spec (#1243) * Upgrade to polkadot-v1.7.0 --------- Co-authored-by: SunTiebing <1045060705@qq.com> Co-authored-by: Edwin Wang * feat: 🎸 add metadata-hash-extension (#1265) * Fix compile (#1266) * Fix/fix vtoken voting unlock (#1267) * update the exchange rate of vtokenminting of vtokenvoting test * Resolve the frozen anomaly when unlocking * Revert "feat: 🎸 add metadata-hash-extension (#1265)" (#1268) This reverts commit 489fc9c6adeae44d23edf449e74fde3d6aa40bc3. * rename the version number to 0.11.0 * Slp supports XCMv4 and reconstruct integration tests (#1272) * Fix compile * Reconstruct integration tests and slp supports XCMv4 * Fix slp construct_xcm_message * Feat/slpx mint add commission (#1273) * SLPx mint support commission id * remove the channel_id parameter from the mint method * add mint_with_channel_id method * perform data migration for OrderQueue storage * slpx: set the default value of channel_id to 0 * resolve conflicts * change the location of the old data structure during storage migration * Feat/add vtoken exchange rate rpc (#1274) * Add vtoken exchange rate rpc * add the use of Vec * supplement the RPC logic && fix bugs * adjust the RPC exchange rate precision to three decimal places * fix clippy * fix bug: storage migration anomaly (#1276) * SLPx mint support commission id * remove the channel_id parameter from the mint method * add mint_with_channel_id method * perform data migration for OrderQueue storage * slpx: set the default value of channel_id to 0 * resolve conflicts * change the location of the old data structure during storage migration * fix bug: storage migration anomaly * Slp removes refund (#1275) * Slp removes refund * Fix clippy * Allow to receive and send Ethereum assets * Add constants --------- Co-authored-by: yooml Co-authored-by: SunTiebing <1045060705@qq.com> Co-authored-by: SunTiebing <87381708+SunTiebing@users.noreply.github.com> Co-authored-by: Edwin Wang * Disable supplement_fee_reserve (#1306) * Remove call_switchgear and add tx_pause (#1308) * Remove call_switchgear and add tx_pause * Fix clippy * Optimize flexible fee (#1307) * Optimize flexible fee * Fix bug * Fix bug * Add PalletId * Add error handle * feat: 🎸 add market-bond * fix: 🐛 test-all * fix: 🐛 try-runtime * Add the channel_id field to the Minted event * Upgrade to polkadot-v1.13.0 (#1312) * Upgrade to polkadot-v1.13.0 * remove the warning * Fix dep issues * Upgrade to polkadot-v1.13.0 * supplement and upgrade the code * Upgrade the new parts from v0.12.0 * Fix dep issues * format Cargo.toml * Modify the AddOrigin type of the fellowship in bifrost-polkadot * Cancel the cross-in-out migration. * fix clippy --------- Co-authored-by: hqwangningbo <2536935847@qq.com> * Use github dependencies (#1314) * Fix flexible_fee TransferTo (#1315) * Refactor code structure: extract the vote operation from the relaychain. * Refactor code structure: extract the remove_vote operation from the relaychain. * Move the XCM-related methods into the relaychain_agent. * Move the call.rs into the relaychain_agent. * vtokenvoting functionality supports vBNC * Bifrost v0.13.0 * Remove getter in buy-back. (#1354) * Bifrost v0.12.0 * remove old migrations * Fix vtokenVoting.removeDelegatorVote (#1288) * add PollClass type * add the calss parameter to the remove_delegator_vote method * Add metadata hash (#1299) * feat: 🎸 add buy-back * Bifrost v0.10.001 * feat: 🎸 benchmark * SLPx mint support commission id (#1261) * Add vtoken exchange rate rpc (#1260) * fix: 🐛 add event (#1263) * add update_currency_metadata function (#1259) * add update_currency_metadata function * fix: 🐛 correct update_currency_metadata weight * add the use of Vec (#1264) * Add vtoken exchange rate rpc * add the use of Vec * Upgrade to Polkadot-SDK v1.7.0 (#1262) * Bifrost v0.10.0 * fix: 🐛 clippy * Fix chain spec (#1243) * Upgrade to polkadot-v1.7.0 --------- Co-authored-by: SunTiebing <1045060705@qq.com> Co-authored-by: Edwin Wang * Fix compile * feat: 🎸 add metadata-hash-extension (#1265) * feat: 🎸 add metadata-hash-extension * Fix compile (#1266) * Fix/fix vtoken voting unlock (#1267) * update the exchange rate of vtokenminting of vtokenvoting test * Resolve the frozen anomaly when unlocking * Revert "feat: 🎸 add metadata-hash-extension (#1265)" (#1268) This reverts commit 489fc9c6adeae44d23edf449e74fde3d6aa40bc3. * rename the version number to 0.11.0 * Slp supports XCMv4 and reconstruct integration tests (#1272) * Fix compile * Reconstruct integration tests and slp supports XCMv4 * Fix slp construct_xcm_message * Feat/slpx mint add commission (#1273) * SLPx mint support commission id * remove the channel_id parameter from the mint method * add mint_with_channel_id method * perform data migration for OrderQueue storage * slpx: set the default value of channel_id to 0 * resolve conflicts * change the location of the old data structure during storage migration * Feat/add vtoken exchange rate rpc (#1274) * Add vtoken exchange rate rpc * add the use of Vec * supplement the RPC logic && fix bugs * adjust the RPC exchange rate precision to three decimal places * fix clippy * fix bug: storage migration anomaly (#1276) * SLPx mint support commission id * remove the channel_id parameter from the mint method * add mint_with_channel_id method * perform data migration for OrderQueue storage * slpx: set the default value of channel_id to 0 * resolve conflicts * change the location of the old data structure during storage migration * fix bug: storage migration anomaly * Slp removes refund (#1275) * Slp removes refund * Fix clippy * Feat/add vtoken exchange rate rpc (#1277) * Add vtoken exchange rate rpc * add the use of Vec * supplement the RPC logic && fix bugs * adjust the RPC exchange rate precision to three decimal places * fix clippy * supplement omissions: adjust the RPC exchange rate precision to three decimal places * Remove dmp queue (#1279) * fix: 🐛 CheckMetadataHash to false * fix: 🐛 update sp-api * refactor: 💡 fmt * fix: 🐛 add metadata-hash * fix: 🐛 add feature metadata-hash * fix: 🐛 rm metadata-hash feature --------- Co-authored-by: SunTiebing <1045060705@qq.com> Co-authored-by: SunTiebing <87381708+SunTiebing@users.noreply.github.com> Co-authored-by: NingBo Wang <2536935847@qq.com> Co-authored-by: Edwin Wang * refactor: 💡 update MaxTurnout and whitelisted_caller track (#1304) * Allow to receive and send Ethereum assets (#1305) * feat: 🎸 add buy-back * Bifrost v0.10.001 * feat: 🎸 benchmark * SLPx mint support commission id (#1261) * Add vtoken exchange rate rpc (#1260) * fix: 🐛 add event (#1263) * add update_currency_metadata function (#1259) * add update_currency_metadata function * fix: 🐛 correct update_currency_metadata weight * add the use of Vec (#1264) * Add vtoken exchange rate rpc * add the use of Vec * Upgrade to Polkadot-SDK v1.7.0 (#1262) * Bifrost v0.10.0 * fix: 🐛 clippy * Fix chain spec (#1243) * Upgrade to polkadot-v1.7.0 --------- Co-authored-by: SunTiebing <1045060705@qq.com> Co-authored-by: Edwin Wang * feat: 🎸 add metadata-hash-extension (#1265) * Fix compile (#1266) * Fix/fix vtoken voting unlock (#1267) * update the exchange rate of vtokenminting of vtokenvoting test * Resolve the frozen anomaly when unlocking * Revert "feat: 🎸 add metadata-hash-extension (#1265)" (#1268) This reverts commit 489fc9c6adeae44d23edf449e74fde3d6aa40bc3. * rename the version number to 0.11.0 * Slp supports XCMv4 and reconstruct integration tests (#1272) * Fix compile * Reconstruct integration tests and slp supports XCMv4 * Fix slp construct_xcm_message * Feat/slpx mint add commission (#1273) * SLPx mint support commission id * remove the channel_id parameter from the mint method * add mint_with_channel_id method * perform data migration for OrderQueue storage * slpx: set the default value of channel_id to 0 * resolve conflicts * change the location of the old data structure during storage migration * Feat/add vtoken exchange rate rpc (#1274) * Add vtoken exchange rate rpc * add the use of Vec * supplement the RPC logic && fix bugs * adjust the RPC exchange rate precision to three decimal places * fix clippy * fix bug: storage migration anomaly (#1276) * SLPx mint support commission id * remove the channel_id parameter from the mint method * add mint_with_channel_id method * perform data migration for OrderQueue storage * slpx: set the default value of channel_id to 0 * resolve conflicts * change the location of the old data structure during storage migration * fix bug: storage migration anomaly * Slp removes refund (#1275) * Slp removes refund * Fix clippy * Allow to receive and send Ethereum assets * Add constants --------- Co-authored-by: yooml Co-authored-by: SunTiebing <1045060705@qq.com> Co-authored-by: SunTiebing <87381708+SunTiebing@users.noreply.github.com> Co-authored-by: Edwin Wang * Disable supplement_fee_reserve (#1306) * Remove call_switchgear and add tx_pause (#1308) * Remove call_switchgear and add tx_pause * Fix clippy * Optimize flexible fee (#1307) * Optimize flexible fee * Fix bug * Fix bug * Add PalletId * Add error handle * feat: 🎸 add market-bond * fix: 🐛 test-all * fix: 🐛 try-runtime * Add the channel_id field to the Minted event * Upgrade to polkadot-v1.13.0 (#1312) * Upgrade to polkadot-v1.13.0 * remove the warning * Fix dep issues * Upgrade to polkadot-v1.13.0 * supplement and upgrade the code * Upgrade the new parts from v0.12.0 * Fix dep issues * format Cargo.toml * Modify the AddOrigin type of the fellowship in bifrost-polkadot * Cancel the cross-in-out migration. * fix clippy --------- Co-authored-by: hqwangningbo <2536935847@qq.com> * Use github dependencies (#1314) * Fix flexible_fee TransferTo (#1315) * Fix generate_genesis_state (#1317) * Optimize oracle (#1318) * refactor: 💡 optimize orml-oracle * fix: 🐛 MinimumTimestampInterval * style: 💄 rename to MaximumValueInterval * Add some tests for ve-minting * Add some tests for ve-minting * Integrate evm (#1319) * Update dep * Ingrate EVM * Fix deps * Add precompiles.rs * Remove pallet-hotfix-sufficients * Add pallet-evm-accounts * Evm precompiles * EVM integration * Fix compile * Fix rpc * Fix `encode_evm_address` and `decode_evm_address` * Fix evm precompile multicurrency * Implementing Erc20Mapping using xc-20 standard * Compatible with BNC Decimal * Increase min_gas_price * feat: enable dev mode with manual seal & fix pending block problem * Add copyright and fix some bugs * Change native token to WETH * Support evm flexible fee * Add inner_swap_exact_assets_for_assets to evm withdraw fee * Remove swap * EVM migration from bifrost kusama to bifrost polkadot * Fix erc20 precompile * Use OraclePrice * Fix some errors * feat: add prices genesis config & optimize dev mode code * Fix conflicts * Fix some errors * Fix clippy * Format Cargo.toml * Remove unused code * Fix clippy * Fix some errors * Fix erc20 precompile --------- Co-authored-by: Edwin Wang Co-authored-by: Damian.lu * Fix try-runtime (#1323) * Fix manual seal * Fix manual seal (#1324) * fix: 🐛 fellowship collective data (#1325) * fix: add parachain mock inherent data provider * Fix ethereum transfer fee (#1328) * Add evm genesis migration (#1338) * Bifrost v0.12.0 (#1286) * Bifrost v0.12.0 * remove old migrations * Fix vtokenVoting.removeDelegatorVote (#1288) * add PollClass type * add the calss parameter to the remove_delegator_vote method * Add metadata hash (#1299) * feat: 🎸 add buy-back * Bifrost v0.10.001 * feat: 🎸 benchmark * SLPx mint support commission id (#1261) * Add vtoken exchange rate rpc (#1260) * fix: 🐛 add event (#1263) * add update_currency_metadata function (#1259) * add update_currency_metadata function * fix: 🐛 correct update_currency_metadata weight * add the use of Vec (#1264) * Add vtoken exchange rate rpc * add the use of Vec * Upgrade to Polkadot-SDK v1.7.0 (#1262) * Bifrost v0.10.0 * fix: 🐛 clippy * Fix chain spec (#1243) * Upgrade to polkadot-v1.7.0 --------- Co-authored-by: SunTiebing <1045060705@qq.com> Co-authored-by: Edwin Wang * Fix compile * feat: 🎸 add metadata-hash-extension (#1265) * feat: 🎸 add metadata-hash-extension * Fix compile (#1266) * Fix/fix vtoken voting unlock (#1267) * update the exchange rate of vtokenminting of vtokenvoting test * Resolve the frozen anomaly when unlocking * Revert "feat: 🎸 add metadata-hash-extension (#1265)" (#1268) This reverts commit 489fc9c6adeae44d23edf449e74fde3d6aa40bc3. * rename the version number to 0.11.0 * Slp supports XCMv4 and reconstruct integration tests (#1272) * Fix compile * Reconstruct integration tests and slp supports XCMv4 * Fix slp construct_xcm_message * Feat/slpx mint add commission (#1273) * SLPx mint support commission id * remove the channel_id parameter from the mint method * add mint_with_channel_id method * perform data migration for OrderQueue storage * slpx: set the default value of channel_id to 0 * resolve conflicts * change the location of the old data structure during storage migration * Feat/add vtoken exchange rate rpc (#1274) * Add vtoken exchange rate rpc * add the use of Vec * supplement the RPC logic && fix bugs * adjust the RPC exchange rate precision to three decimal places * fix clippy * fix bug: storage migration anomaly (#1276) * SLPx mint support commission id * remove the channel_id parameter from the mint method * add mint_with_channel_id method * perform data migration for OrderQueue storage * slpx: set the default value of channel_id to 0 * resolve conflicts * change the location of the old data structure during storage migration * fix bug: storage migration anomaly * Slp removes refund (#1275) * Slp removes refund * Fix clippy * Feat/add vtoken exchange rate rpc (#1277) * Add vtoken exchange rate rpc * add the use of Vec * supplement the RPC logic && fix bugs * adjust the RPC exchange rate precision to three decimal places * fix clippy * supplement omissions: adjust the RPC exchange rate precision to three decimal places * Remove dmp queue (#1279) * fix: 🐛 CheckMetadataHash to false * fix: 🐛 update sp-api * refactor: 💡 fmt * fix: 🐛 add metadata-hash * fix: 🐛 add feature metadata-hash * fix: 🐛 rm metadata-hash feature --------- Co-authored-by: SunTiebing <1045060705@qq.com> Co-authored-by: SunTiebing <87381708+SunTiebing@users.noreply.github.com> Co-authored-by: NingBo Wang <2536935847@qq.com> Co-authored-by: Edwin Wang * refactor: 💡 update MaxTurnout and whitelisted_caller track (#1304) * Allow to receive and send Ethereum assets (#1305) * feat: 🎸 add buy-back * Bifrost v0.10.001 * feat: 🎸 benchmark * SLPx mint support commission id (#1261) * Add vtoken exchange rate rpc (#1260) * fix: 🐛 add event (#1263) * add update_currency_metadata function (#1259) * add update_currency_metadata function * fix: 🐛 correct update_currency_metadata weight * add the use of Vec (#1264) * Add vtoken exchange rate rpc * add the use of Vec * Upgrade to Polkadot-SDK v1.7.0 (#1262) * Bifrost v0.10.0 * fix: 🐛 clippy * Fix chain spec (#1243) * Upgrade to polkadot-v1.7.0 --------- Co-authored-by: SunTiebing <1045060705@qq.com> Co-authored-by: Edwin Wang * feat: 🎸 add metadata-hash-extension (#1265) * Fix compile (#1266) * Fix/fix vtoken voting unlock (#1267) * update the exchange rate of vtokenminting of vtokenvoting test * Resolve the frozen anomaly when unlocking * Revert "feat: 🎸 add metadata-hash-extension (#1265)" (#1268) This reverts commit 489fc9c6adeae44d23edf449e74fde3d6aa40bc3. * rename the version number to 0.11.0 * Slp supports XCMv4 and reconstruct integration tests (#1272) * Fix compile * Reconstruct integration tests and slp supports XCMv4 * Fix slp construct_xcm_message * Feat/slpx mint add commission (#1273) * SLPx mint support commission id * remove the channel_id parameter from the mint method * add mint_with_channel_id method * perform data migration for OrderQueue storage * slpx: set the default value of channel_id to 0 * resolve conflicts * change the location of the old data structure during storage migration * Feat/add vtoken exchange rate rpc (#1274) * Add vtoken exchange rate rpc * add the use of Vec * supplement the RPC logic && fix bugs * adjust the RPC exchange rate precision to three decimal places * fix clippy * fix bug: storage migration anomaly (#1276) * SLPx mint support commission id * remove the channel_id parameter from the mint method * add mint_with_channel_id method * perform data migration for OrderQueue storage * slpx: set the default value of channel_id to 0 * resolve conflicts * change the location of the old data structure during storage migration * fix bug: storage migration anomaly * Slp removes refund (#1275) * Slp removes refund * Fix clippy * Allow to receive and send Ethereum assets * Add constants --------- Co-authored-by: yooml Co-authored-by: SunTiebing <1045060705@qq.com> Co-authored-by: SunTiebing <87381708+SunTiebing@users.noreply.github.com> Co-authored-by: Edwin Wang * Disable supplement_fee_reserve (#1306) * Remove call_switchgear and add tx_pause (#1308) * Remove call_switchgear and add tx_pause * Fix clippy * Optimize flexible fee (#1307) * Optimize flexible fee * Fix bug * Fix bug * Add PalletId * Add error handle * feat: 🎸 add market-bond * fix: 🐛 test-all * fix: 🐛 try-runtime * Add the channel_id field to the Minted event * Upgrade to polkadot-v1.13.0 (#1312) * Upgrade to polkadot-v1.13.0 * remove the warning * Fix dep issues * Upgrade to polkadot-v1.13.0 * supplement and upgrade the code * Upgrade the new parts from v0.12.0 * Fix dep issues * format Cargo.toml * Modify the AddOrigin type of the fellowship in bifrost-polkadot * Cancel the cross-in-out migration. * fix clippy --------- Co-authored-by: hqwangningbo <2536935847@qq.com> * Use github dependencies (#1314) * Fix flexible_fee TransferTo (#1315) * Fix generate_genesis_state (#1317) * Optimize oracle (#1318) * refactor: 💡 optimize orml-oracle * fix: 🐛 MinimumTimestampInterval * style: 💄 rename to MaximumValueInterval * Add some tests for ve-minting * Add some tests for ve-minting * Integrate evm (#1319) * Update dep * Ingrate EVM * Fix deps * Add precompiles.rs * Remove pallet-hotfix-sufficients * Add pallet-evm-accounts * Evm precompiles * EVM integration * Fix compile * Fix rpc * Fix `encode_evm_address` and `decode_evm_address` * Fix evm precompile multicurrency * Implementing Erc20Mapping using xc-20 standard * Compatible with BNC Decimal * Increase min_gas_price * feat: enable dev mode with manual seal & fix pending block problem * Add copyright and fix some bugs * Change native token to WETH * Support evm flexible fee * Add inner_swap_exact_assets_for_assets to evm withdraw fee * Remove swap * EVM migration from bifrost kusama to bifrost polkadot * Fix erc20 precompile * Use OraclePrice * Fix some errors * feat: add prices genesis config & optimize dev mode code * Fix conflicts * Fix some errors * Fix clippy * Format Cargo.toml * Remove unused code * Fix clippy * Fix some errors * Fix erc20 precompile --------- Co-authored-by: Edwin Wang Co-authored-by: Damian.lu * Fix try-runtime (#1323) * Fix manual seal * Fix manual seal (#1324) * fix: 🐛 fellowship collective data (#1325) * fix: add parachain mock inherent data provider * Fix ethereum transfer fee (#1328) --------- Co-authored-by: Edwin Wang Co-authored-by: yooml Co-authored-by: NingBo Wang <2536935847@qq.com> Co-authored-by: Gemma Co-authored-by: Damian.lu * Add evm genesis storage * [skip ci] Add evmSince --------- Co-authored-by: SunTiebing <87381708+SunTiebing@users.noreply.github.com> Co-authored-by: Edwin Wang Co-authored-by: yooml Co-authored-by: Gemma Co-authored-by: Damian.lu * Bump version to 0.12.1 * Update Cargo.lock * Fix migration (#1341) * Bifrost v0.12.0 (#1286) * Bifrost v0.12.0 * remove old migrations * Fix vtokenVoting.removeDelegatorVote (#1288) * add PollClass type * add the calss parameter to the remove_delegator_vote method * Add metadata hash (#1299) * feat: 🎸 add buy-back * Bifrost v0.10.001 * feat: 🎸 benchmark * SLPx mint support commission id (#1261) * Add vtoken exchange rate rpc (#1260) * fix: 🐛 add event (#1263) * add update_currency_metadata function (#1259) * add update_currency_metadata function * fix: 🐛 correct update_currency_metadata weight * add the use of Vec (#1264) * Add vtoken exchange rate rpc * add the use of Vec * Upgrade to Polkadot-SDK v1.7.0 (#1262) * Bifrost v0.10.0 * fix: 🐛 clippy * Fix chain spec (#1243) * Upgrade to polkadot-v1.7.0 --------- Co-authored-by: SunTiebing <1045060705@qq.com> Co-authored-by: Edwin Wang * Fix compile * feat: 🎸 add metadata-hash-extension (#1265) * feat: 🎸 add metadata-hash-extension * Fix compile (#1266) * Fix/fix vtoken voting unlock (#1267) * update the exchange rate of vtokenminting of vtokenvoting test * Resolve the frozen anomaly when unlocking * Revert "feat: 🎸 add metadata-hash-extension (#1265)" (#1268) This reverts commit 489fc9c6adeae44d23edf449e74fde3d6aa40bc3. * rename the version number to 0.11.0 * Slp supports XCMv4 and reconstruct integration tests (#1272) * Fix compile * Reconstruct integration tests and slp supports XCMv4 * Fix slp construct_xcm_message * Feat/slpx mint add commission (#1273) * SLPx mint support commission id * remove the channel_id parameter from the mint method * add mint_with_channel_id method * perform data migration for OrderQueue storage * slpx: set the default value of channel_id to 0 * resolve conflicts * change the location of the old data structure during storage migration * Feat/add vtoken exchange rate rpc (#1274) * Add vtoken exchange rate rpc * add the use of Vec * supplement the RPC logic && fix bugs * adjust the RPC exchange rate precision to three decimal places * fix clippy * fix bug: storage migration anomaly (#1276) * SLPx mint support commission id * remove the channel_id parameter from the mint method * add mint_with_channel_id method * perform data migration for OrderQueue storage * slpx: set the default value of channel_id to 0 * resolve conflicts * change the location of the old data structure during storage migration * fix bug: storage migration anomaly * Slp removes refund (#1275) * Slp removes refund * Fix clippy * Feat/add vtoken exchange rate rpc (#1277) * Add vtoken exchange rate rpc * add the use of Vec * supplement the RPC logic && fix bugs * adjust the RPC exchange rate precision to three decimal places * fix clippy * supplement omissions: adjust the RPC exchange rate precision to three decimal places * Remove dmp queue (#1279) * fix: 🐛 CheckMetadataHash to false * fix: 🐛 update sp-api * refactor: 💡 fmt * fix: 🐛 add metadata-hash * fix: 🐛 add feature metadata-hash * fix: 🐛 rm metadata-hash feature --------- Co-authored-by: SunTiebing <1045060705@qq.com> Co-authored-by: SunTiebing <87381708+SunTiebing@users.noreply.github.com> Co-authored-by: NingBo Wang <2536935847@qq.com> Co-authored-by: Edwin Wang * refactor: 💡 update MaxTurnout and whitelisted_caller track (#1304) * Allow to receive and send Ethereum assets (#1305) * feat: 🎸 add buy-back * Bifrost v0.10.001 * feat: 🎸 benchmark * SLPx mint support commission id (#1261) * Add vtoken exchange rate rpc (#1260) * fix: 🐛 add event (#1263) * add update_currency_metadata function (#1259) * add update_currency_metadata function * fix: 🐛 correct update_currency_metadata weight * add the use of Vec (#1264) * Add vtoken exchange rate rpc * add the use of Vec * Upgrade to Polkadot-SDK v1.7.0 (#1262)… * Fix fexiable fee token selection logic (#1604) * Flexiable Fee token selection logic fix----EVM * Optimize the code for better performance and readability. * Add a 10% buffer to account for potential inaccuracies in fee estimation. * update cargo.lock (#1606) * Fix evm fee selection (#1608) * fix 10% buffer computational logic * Correct gas fee parameter * Fix bb bnc (#1610) * refactor: 💡 rename fn * fix: 🐛 set_incentive * fix: 🐛 withdraw_markup_inner * fix: 🐛 rwi as constant * fix: 🐛 benchmark * style: 💄 clippy * Fix and migrated benchmarking of vesting. (#1609) * add WithUniqueTopic wrapper to xcm router (#1602) * Hyperbridge adjust (#1615) * adjust AssetAdmin to TechAdminOrCouncil * fix redeeming erc20 assets * roll back adjust AssetAdmin --------- Signed-off-by: dependabot[bot] Co-authored-by: yooml Co-authored-by: MJLNSN <96321798+MJLNSN@users.noreply.github.com> Co-authored-by: 战神西红柿 <34213033+TomatoAres@users.noreply.github.com> Co-authored-by: Ares Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: NingBo Wang <2536935847@qq.com> Co-authored-by: arescui Co-authored-by: Edwin Co-authored-by: Damian.lu Co-authored-by: TomatoAres Co-authored-by: Xueying Wang --- .github/workflows/release.yml | 24 +- .github/workflows/srtool.yml | 83 +- Cargo.lock | 4576 ++++++++++------- Cargo.toml | 38 +- node/cli/Cargo.toml | 4 +- node/cli/src/command.rs | 4 +- node/rpc/Cargo.toml | 3 + node/rpc/src/lib.rs | 23 +- node/service/Cargo.toml | 2 + node/service/src/collator_polkadot.rs | 19 +- node/service/src/dev.rs | 2 + node/service/src/lib.rs | 13 +- pallets/asset-registry/src/lib.rs | 23 +- pallets/bb-bnc/src/benchmarking.rs | 13 +- pallets/bb-bnc/src/lib.rs | 205 +- pallets/bb-bnc/src/tests.rs | 49 + pallets/bb-bnc/src/traits.rs | 5 +- pallets/buy-back/src/lib.rs | 22 +- pallets/buy-back/src/mock.rs | 1 - pallets/buy-back/src/tests.rs | 49 +- pallets/flexible-fee/src/benchmarking.rs | 4 +- .../src/impls/account_fee_currency.rs | 7 +- pallets/flexible-fee/src/lib.rs | 55 +- .../src/{mock.rs => mocks/kusama_mock.rs} | 11 +- .../src/{ => mocks}/mock_price.rs | 0 pallets/flexible-fee/src/mocks/mod.rs | 22 + .../flexible-fee/src/mocks/polkadot_mock.rs | 453 ++ .../src/{tests.rs => tests/common_tests.rs} | 73 +- pallets/flexible-fee/src/tests/mod.rs | 20 + .../src/tests/polkadot_specical_tests.rs | 44 + pallets/ismp/Cargo.toml | 47 + pallets/ismp/src/lib.rs | 273 + pallets/lend-market/src/benchmarking.rs | 697 ++- pallets/lend-market/src/mock.rs | 33 + pallets/lend-market/src/weights.rs | 1644 ++---- pallets/salp/src/lib.rs | 5 +- pallets/stable-pool/src/lib.rs | 4 +- pallets/token-gateway/Cargo.toml | 58 + pallets/token-gateway/README.md | 86 + pallets/token-gateway/primitives/Cargo.toml | 51 + pallets/token-gateway/primitives/README.md | 7 + pallets/token-gateway/primitives/src/lib.rs | 91 + pallets/token-gateway/src/impls.rs | 111 + pallets/token-gateway/src/lib.rs | 741 +++ pallets/token-gateway/src/types.rs | 85 + pallets/vesting/src/benchmarking.rs | 244 +- pallets/vesting/src/mock.rs | 5 + pallets/vesting/src/weights.rs | 483 +- primitives/src/currency.rs | 1 + primitives/src/lib.rs | 9 + primitives/src/traits.rs | 19 +- runtime/bifrost-kusama/src/lib.rs | 7 +- .../bifrost-kusama/src/weights/lend_market.rs | 570 ++ runtime/bifrost-kusama/src/weights/mod.rs | 1 + runtime/bifrost-kusama/src/xcm_config.rs | 8 +- runtime/bifrost-paseo/Cargo.toml | 475 ++ runtime/bifrost-paseo/build.rs | 31 + runtime/bifrost-paseo/src/constants.rs | 126 + .../src/evm/accounts_conversion.rs | 55 + runtime/bifrost-paseo/src/evm/evm_fee.rs | 172 + runtime/bifrost-paseo/src/evm/mod.rs | 152 + runtime/bifrost-paseo/src/evm/permit.rs | 213 + .../src/evm/precompiles/costs.rs | 51 + .../src/evm/precompiles/erc20_mapping.rs | 80 + .../src/evm/precompiles/handle.rs | 482 ++ .../bifrost-paseo/src/evm/precompiles/mod.rs | 238 + .../src/evm/precompiles/multicurrency.rs | 244 + .../src/evm/precompiles/substrate.rs | 43 + .../evm/precompiles/tests/erc20_mapping.rs | 160 + .../src/evm/precompiles/tests/mod.rs | 19 + runtime/bifrost-paseo/src/evm/runner.rs | 328 ++ .../src/governance/fellowship.rs | 365 ++ runtime/bifrost-paseo/src/governance/mod.rs | 41 + .../bifrost-paseo/src/governance/origins.rs | 185 + .../bifrost-paseo/src/governance/referenda.rs | 85 + .../bifrost-paseo/src/governance/tracks.rs | 228 + runtime/bifrost-paseo/src/hyperbridge.rs | 122 + runtime/bifrost-paseo/src/lib.rs | 2786 ++++++++++ runtime/bifrost-paseo/src/migration.rs | 465 ++ runtime/bifrost-paseo/src/weights/bb_bnc.rs | 552 ++ .../src/weights/bifrost_asset_registry.rs | 126 + .../src/weights/bifrost_buy_back.rs | 130 + .../src/weights/bifrost_channel_commission.rs | 175 + .../src/weights/bifrost_clouds_convert.rs | 46 + .../src/weights/bifrost_cross_in_out.rs | 153 + .../src/weights/bifrost_currencies.rs | 90 + .../src/weights/bifrost_farming.rs | 359 ++ .../src/weights/bifrost_fee_share.rs | 144 + .../src/weights/bifrost_flexible_fee.rs | 77 + .../bifrost-paseo/src/weights/bifrost_salp.rs | 348 ++ .../bifrost-paseo/src/weights/bifrost_slp.rs | 801 +++ .../src/weights/bifrost_slp_v2.rs | 351 ++ .../bifrost-paseo/src/weights/bifrost_slpx.rs | 153 + .../src/weights/bifrost_stable_pool.rs | 247 + .../src/weights/bifrost_system_staking.rs | 140 + .../src/weights/bifrost_vesting.rs | 233 + .../src/weights/bifrost_vstoken_conversion.rs | 136 + .../src/weights/bifrost_vtoken_minting.rs | 326 ++ .../src/weights/bifrost_vtoken_voting.rs | 272 + .../src/weights/bifrost_xcm_interface.rs | 78 + .../bifrost-paseo/src/weights/lend_market.rs | 570 ++ runtime/bifrost-paseo/src/weights/mod.rs | 47 + .../bifrost-paseo/src/weights/orml_oracle.rs | 45 + .../bifrost-paseo/src/weights/orml_tokens.rs | 93 + .../bifrost-paseo/src/weights/pallet_xcm.rs | 400 ++ runtime/bifrost-paseo/src/xcm_config.rs | 501 ++ runtime/bifrost-polkadot/Cargo.toml | 29 +- runtime/bifrost-polkadot/src/evm/runner.rs | 14 +- runtime/bifrost-polkadot/src/hyperbridge.rs | 115 + runtime/bifrost-polkadot/src/lib.rs | 93 +- runtime/bifrost-polkadot/src/migration.rs | 17 + .../src/weights/lend_market.rs | 570 ++ runtime/bifrost-polkadot/src/weights/mod.rs | 1 + runtime/bifrost-polkadot/src/xcm_config.rs | 6 +- 114 files changed, 21872 insertions(+), 3839 deletions(-) rename pallets/flexible-fee/src/{mock.rs => mocks/kusama_mock.rs} (98%) rename pallets/flexible-fee/src/{ => mocks}/mock_price.rs (100%) create mode 100644 pallets/flexible-fee/src/mocks/mod.rs create mode 100644 pallets/flexible-fee/src/mocks/polkadot_mock.rs rename pallets/flexible-fee/src/{tests.rs => tests/common_tests.rs} (93%) create mode 100644 pallets/flexible-fee/src/tests/mod.rs create mode 100644 pallets/flexible-fee/src/tests/polkadot_specical_tests.rs create mode 100644 pallets/ismp/Cargo.toml create mode 100644 pallets/ismp/src/lib.rs create mode 100644 pallets/token-gateway/Cargo.toml create mode 100644 pallets/token-gateway/README.md create mode 100644 pallets/token-gateway/primitives/Cargo.toml create mode 100644 pallets/token-gateway/primitives/README.md create mode 100644 pallets/token-gateway/primitives/src/lib.rs create mode 100644 pallets/token-gateway/src/impls.rs create mode 100644 pallets/token-gateway/src/lib.rs create mode 100644 pallets/token-gateway/src/types.rs create mode 100644 runtime/bifrost-kusama/src/weights/lend_market.rs create mode 100644 runtime/bifrost-paseo/Cargo.toml create mode 100644 runtime/bifrost-paseo/build.rs create mode 100644 runtime/bifrost-paseo/src/constants.rs create mode 100644 runtime/bifrost-paseo/src/evm/accounts_conversion.rs create mode 100644 runtime/bifrost-paseo/src/evm/evm_fee.rs create mode 100644 runtime/bifrost-paseo/src/evm/mod.rs create mode 100644 runtime/bifrost-paseo/src/evm/permit.rs create mode 100644 runtime/bifrost-paseo/src/evm/precompiles/costs.rs create mode 100644 runtime/bifrost-paseo/src/evm/precompiles/erc20_mapping.rs create mode 100644 runtime/bifrost-paseo/src/evm/precompiles/handle.rs create mode 100644 runtime/bifrost-paseo/src/evm/precompiles/mod.rs create mode 100644 runtime/bifrost-paseo/src/evm/precompiles/multicurrency.rs create mode 100644 runtime/bifrost-paseo/src/evm/precompiles/substrate.rs create mode 100644 runtime/bifrost-paseo/src/evm/precompiles/tests/erc20_mapping.rs create mode 100644 runtime/bifrost-paseo/src/evm/precompiles/tests/mod.rs create mode 100644 runtime/bifrost-paseo/src/evm/runner.rs create mode 100644 runtime/bifrost-paseo/src/governance/fellowship.rs create mode 100644 runtime/bifrost-paseo/src/governance/mod.rs create mode 100644 runtime/bifrost-paseo/src/governance/origins.rs create mode 100644 runtime/bifrost-paseo/src/governance/referenda.rs create mode 100644 runtime/bifrost-paseo/src/governance/tracks.rs create mode 100644 runtime/bifrost-paseo/src/hyperbridge.rs create mode 100644 runtime/bifrost-paseo/src/lib.rs create mode 100644 runtime/bifrost-paseo/src/migration.rs create mode 100644 runtime/bifrost-paseo/src/weights/bb_bnc.rs create mode 100644 runtime/bifrost-paseo/src/weights/bifrost_asset_registry.rs create mode 100644 runtime/bifrost-paseo/src/weights/bifrost_buy_back.rs create mode 100644 runtime/bifrost-paseo/src/weights/bifrost_channel_commission.rs create mode 100644 runtime/bifrost-paseo/src/weights/bifrost_clouds_convert.rs create mode 100644 runtime/bifrost-paseo/src/weights/bifrost_cross_in_out.rs create mode 100644 runtime/bifrost-paseo/src/weights/bifrost_currencies.rs create mode 100644 runtime/bifrost-paseo/src/weights/bifrost_farming.rs create mode 100644 runtime/bifrost-paseo/src/weights/bifrost_fee_share.rs create mode 100644 runtime/bifrost-paseo/src/weights/bifrost_flexible_fee.rs create mode 100644 runtime/bifrost-paseo/src/weights/bifrost_salp.rs create mode 100644 runtime/bifrost-paseo/src/weights/bifrost_slp.rs create mode 100644 runtime/bifrost-paseo/src/weights/bifrost_slp_v2.rs create mode 100644 runtime/bifrost-paseo/src/weights/bifrost_slpx.rs create mode 100644 runtime/bifrost-paseo/src/weights/bifrost_stable_pool.rs create mode 100644 runtime/bifrost-paseo/src/weights/bifrost_system_staking.rs create mode 100644 runtime/bifrost-paseo/src/weights/bifrost_vesting.rs create mode 100644 runtime/bifrost-paseo/src/weights/bifrost_vstoken_conversion.rs create mode 100644 runtime/bifrost-paseo/src/weights/bifrost_vtoken_minting.rs create mode 100644 runtime/bifrost-paseo/src/weights/bifrost_vtoken_voting.rs create mode 100644 runtime/bifrost-paseo/src/weights/bifrost_xcm_interface.rs create mode 100644 runtime/bifrost-paseo/src/weights/lend_market.rs create mode 100644 runtime/bifrost-paseo/src/weights/mod.rs create mode 100644 runtime/bifrost-paseo/src/weights/orml_oracle.rs create mode 100644 runtime/bifrost-paseo/src/weights/orml_tokens.rs create mode 100644 runtime/bifrost-paseo/src/weights/pallet_xcm.rs create mode 100644 runtime/bifrost-paseo/src/xcm_config.rs create mode 100644 runtime/bifrost-polkadot/src/hyperbridge.rs create mode 100644 runtime/bifrost-polkadot/src/weights/lend_market.rs diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0568bf570a..fa4fe8890f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,6 +12,8 @@ on: jobs: srtool: uses: ./.github/workflows/srtool.yml + secrets: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} release: name: Create Release needs: srtool @@ -27,16 +29,16 @@ jobs: target: wasm32-unknown-unknown toolchain: 1.81.0 - - name: Download kusama strool result + - name: Download kusama srtool result uses: actions/download-artifact@v4 with: - name: bifrost-kusama-runtime + name: bifrost-kusama-runtime-${{ github.ref_name }} path: ${{ github.workspace }}/artifacts - - name: Download polkadot strool result + - name: Download polkadot srtool result uses: actions/download-artifact@v4 with: - name: bifrost-polkadot-runtime + name: bifrost-polkadot-runtime-${{ github.ref_name }} path: ${{ github.workspace }}/artifacts - name: Build bifrost @@ -46,8 +48,8 @@ jobs: make production-release mkdir -p ${{ github.workspace }}/artifacts mv ${{ github.workspace }}/target/production/bifrost ${{ github.workspace }}/artifacts/ - mv ${{ github.workspace }}/artifacts/runtime/bifrost-kusama/target/srtool/production/wbuild/bifrost-kusama-runtime/bifrost_kusama_runtime.compact.compressed.wasm ${{ github.workspace }}/artifacts/ - mv ${{ github.workspace }}/artifacts/runtime/bifrost-polkadot/target/srtool/production/wbuild/bifrost-polkadot-runtime/bifrost_polkadot_runtime.compact.compressed.wasm ${{ github.workspace }}/artifacts/ + + ls -a ${{ github.workspace }}/artifacts pushd ${{ github.workspace }}/artifacts sha256sum bifrost | tee bifrost.sha256 shasum -c bifrost.sha256 @@ -67,12 +69,12 @@ jobs: Low: This is a low priority release and you may upgrade at your convenience." >> ${{ github.workspace }}-CHANGELOG.txt echo "## Bifrost Kusama Runtime" >> ${{ github.workspace }}-CHANGELOG.txt echo '```' >> ${{ github.workspace }}-CHANGELOG.txt - subwasm info ${{ github.workspace }}/artifacts/bifrost_kusama_runtime.compact.compressed.wasm >> ${{ github.workspace }}-CHANGELOG.txt + subwasm info ${{ github.workspace }}/artifacts/bifrost-kusama_runtime.compact.compressed.wasm >> ${{ github.workspace }}-CHANGELOG.txt echo '```' >> ${{ github.workspace }}-CHANGELOG.txt echo ' ' >> ${{ github.workspace }}-CHANGELOG.txt echo "## Bifrost Polkadot Runtime" >> ${{ github.workspace }}-CHANGELOG.txt echo '```' >> ${{ github.workspace }}-CHANGELOG.txt - subwasm info ${{ github.workspace }}/artifacts/bifrost_polkadot_runtime.compact.compressed.wasm >> ${{ github.workspace }}-CHANGELOG.txt + subwasm info ${{ github.workspace }}/artifacts/bifrost-polkadot_runtime.compact.compressed.wasm >> ${{ github.workspace }}-CHANGELOG.txt echo '```' >> ${{ github.workspace }}-CHANGELOG.txt - name: Create Release @@ -87,8 +89,8 @@ jobs: files: | ${{ github.workspace }}/artifacts/bifrost ${{ github.workspace }}/artifacts/bifrost.sha256 - ${{ github.workspace }}/artifacts/bifrost_kusama_runtime.compact.compressed.wasm - ${{ github.workspace }}/artifacts/bifrost_polkadot_runtime.compact.compressed.wasm + ${{ github.workspace }}/artifacts/bifrost-kusama_runtime.compact.compressed.wasm + ${{ github.workspace }}/artifacts/bifrost-polkadot_runtime.compact.compressed.wasm - uses: 8398a7/action-slack@v3 if: always() @@ -96,4 +98,4 @@ jobs: status: ${{ job.status }} fields: repo,author,eventName,workflow,ref,commit env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_INCOMING_WEBHOOK_URL }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/srtool.yml b/.github/workflows/srtool.yml index 2cdcacfa8d..4c07a238fe 100644 --- a/.github/workflows/srtool.yml +++ b/.github/workflows/srtool.yml @@ -6,22 +6,29 @@ env: on: workflow_dispatch: workflow_call: + secrets: + SLACK_WEBHOOK_URL: + required: true + push: + tags: + - 'v[0-9]+\.[0-9]+\.[0-9]+-rc[0-9]+' jobs: build: - name: Build ${{ matrix.chain }} ${{ github.event.inputs.ref }} + name: Build ${{ matrix.chain }} ${{ github.event.inputs.ref || github.ref_name }} strategy: fail-fast: false matrix: chain: ["bifrost-kusama", "bifrost-polkadot"] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: "📥 Checkout" + uses: actions/checkout@v4 with: - ref: ${{ github.event.inputs.ref }} - fetch-depth: 0 + ref: ${{ github.event.inputs.ref || github.ref }} + fetch-depth: 1 - - name: Srtool build + - name: "🏗️ Build Runtime" id: srtool_build uses: chevdor/srtool-actions@v0.8.0 env: @@ -30,45 +37,63 @@ jobs: profile: production chain: ${{ matrix.chain }} runtime_dir: runtime/${{ matrix.chain }} - - name: Summary + + - name: "🔍 Summary" run: | echo '${{ steps.srtool_build.outputs.json }}' | jq > ${{ matrix.chain }}-srtool-digest.json cat ${{ matrix.chain }}-srtool-digest.json echo "Runtime location: ${{ steps.srtool_build.outputs.wasm }}" + cp ${{ steps.srtool_build.outputs.wasm_compressed }} ./${{ matrix.chain }}_runtime.compact.compressed.wasm - # it takes a while to build the runtime, so let's save the artifact as soon as we have it - - name: Archive Artifacts for ${{ matrix.chain }} - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.chain }}-runtime - path: | - ${{ steps.srtool_build.outputs.wasm }} - ${{ steps.srtool_build.outputs.wasm_compressed }} - ${{ matrix.chain }}-srtool-digest.json - - # We now get extra information thanks to subwasm, - name: Install subwasm ${{ env.SUBWASM_VERSION }} run: | wget https://github.com/chevdor/subwasm/releases/download/v${{ env.SUBWASM_VERSION }}/subwasm_linux_amd64_v${{ env.SUBWASM_VERSION }}.deb sudo dpkg -i subwasm_linux_amd64_v${{ env.SUBWASM_VERSION }}.deb subwasm --version - - name: Show Runtime information + + - name: "🔍 Get Runtime information" + id: runtime_info run: | + echo "compressed_info<> $GITHUB_OUTPUT + subwasm info ${{ steps.srtool_build.outputs.wasm_compressed }} >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT subwasm info ${{ steps.srtool_build.outputs.wasm }} subwasm info ${{ steps.srtool_build.outputs.wasm_compressed }} - subwasm --json info ${{ steps.srtool_build.outputs.wasm }} > ${{ matrix.chain }}-info.json - subwasm --json info ${{ steps.srtool_build.outputs.wasm_compressed }} > ${{ matrix.chain }}-info_compressed.json - - name: Extract the metadata - run: | subwasm meta ${{ steps.srtool_build.outputs.wasm }} - subwasm --json meta ${{ steps.srtool_build.outputs.wasm }} > ${{ matrix.chain }}-metadata.json + subwasm info ${{ steps.srtool_build.outputs.wasm }} > runtime_info.txt + subwasm info ${{ steps.srtool_build.outputs.wasm_compressed }} >> runtime_info.txt - - name: Archive Subwasm results + - name: Archive Artifacts for ${{ matrix.chain }} + id: upload_artifacts uses: actions/upload-artifact@v4 with: - name: ${{ matrix.chain }}-runtime-${{ github.sha }} + name: ${{ matrix.chain }}-runtime-${{ github.event.inputs.ref || github.ref_name }} path: | - ${{ matrix.chain }}-info.json - ${{ matrix.chain }}-info_compressed.json - ${{ matrix.chain }}-metadata.json - ${{ matrix.chain }}-diff.txt + ${{ matrix.chain }}_runtime.compact.compressed.wasm + ${{ matrix.chain }}-srtool-digest.json + runtime_info.txt + + - uses: 8398a7/action-slack@v3 + name: "Send Slack Notification" + if: success() + with: + status: custom + fields: workflow,job,commit,repo,ref,author,took + custom_payload: | + { + "attachments": [{ + "color": "good", + "text": ":rocket: New runtime build for ${{ matrix.chain }} (${{ github.event.inputs.ref || github.ref_name }})\nDownload artifacts: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/${{ steps.upload_artifacts.outputs.artifact-id }}" + }] + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + + - name: Debug Trigger + run: | + echo "github.ref: ${{ github.ref }}" + echo "github.ref_name: ${{ github.ref_name }}" + echo "github.event_name: ${{ github.event_name }}" + echo "github.action: ${{ github.action }}" + + diff --git a/Cargo.lock b/Cargo.lock index 157b60a7bb..8c700ef87a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -23,18 +23,18 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.21.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ - "gimli 0.28.0", + "gimli 0.31.1", ] [[package]] -name = "adler" -version = "1.0.2" +name = "adler2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "aead" @@ -48,9 +48,9 @@ dependencies = [ [[package]] name = "aes" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" dependencies = [ "cfg-if", "cipher 0.4.4", @@ -68,7 +68,7 @@ dependencies = [ "cipher 0.4.4", "ctr", "ghash", - "subtle 2.5.0", + "subtle 2.6.1", ] [[package]] @@ -86,18 +86,108 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.0.4" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6748e8def348ed4d14996fa801f4122cd763fff530258cdc03f64b25f89d3a5a" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] [[package]] name = "allocator-api2" -version = "0.2.16" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[package]] +name = "alloy-primitives" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccb3ead547f4532bc8af961649942f0b9c16ee9226e26caa3f38420651cc0bf4" +dependencies = [ + "alloy-rlp", + "bytes", + "cfg-if", + "const-hex", + "derive_more 0.99.18", + "hex-literal 0.4.1", + "itoa", + "k256", + "keccak-asm", + "proptest", + "rand", + "ruint", + "serde", + "tiny-keccak", +] + +[[package]] +name = "alloy-rlp" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" +checksum = "f542548a609dca89fcd72b3b9f355928cf844d4363c5eed9c5273a3dd225e097" +dependencies = [ + "arrayvec 0.7.6", + "bytes", +] + +[[package]] +name = "alloy-sol-macro" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b40397ddcdcc266f59f959770f601ce1280e699a91fc1862f29cef91707cd09" +dependencies = [ + "alloy-sol-macro-expander", + "alloy-sol-macro-input", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "alloy-sol-macro-expander" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "867a5469d61480fea08c7333ffeca52d5b621f5ca2e44f271b117ec1fc9a0525" +dependencies = [ + "alloy-sol-macro-input", + "const-hex", + "heck 0.5.0", + "indexmap 2.7.0", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.96", + "syn-solidity", + "tiny-keccak", +] + +[[package]] +name = "alloy-sol-macro-input" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e482dc33a32b6fadbc0f599adea520bd3aaa585c141a80b404d0a3e3fa72528" +dependencies = [ + "const-hex", + "dunce", + "heck 0.5.0", + "proc-macro2", + "quote", + "syn 2.0.96", + "syn-solidity", +] + +[[package]] +name = "alloy-sol-types" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a91ca40fa20793ae9c3841b83e74569d1cc9af29a2f5237314fd3452d51e38c7" +dependencies = [ + "alloy-primitives", + "alloy-sol-macro", + "const-hex", +] [[package]] name = "always-assert" @@ -131,15 +221,16 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.11" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" +checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", + "is_terminal_polyfill", "utf8parse", ] @@ -151,37 +242,37 @@ checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" [[package]] name = "anstyle-parse" -version = "0.2.1" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" +checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.0" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.1" +version = "3.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" +checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" dependencies = [ "anstyle", - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] name = "anyhow" -version = "1.0.81" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" +checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" [[package]] name = "approx" @@ -203,7 +294,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -213,8 +304,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb00293ba84f51ce3bd026bd0de55899c4e68f0a39a5728cebae3a73ffdc0a4f" dependencies = [ "ark-ec", - "ark-ff", - "ark-std", + "ark-ff 0.4.2", + "ark-std 0.4.0", ] [[package]] @@ -224,9 +315,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c775f0d12169cba7aae4caeb547bb6a50781c7449a8aa53793827c9ec4abf488" dependencies = [ "ark-ec", - "ark-ff", - "ark-serialize", - "ark-std", + "ark-ff 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", ] [[package]] @@ -235,10 +326,10 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" dependencies = [ - "ark-ff", + "ark-ff 0.4.2", "ark-poly", - "ark-serialize", - "ark-std", + "ark-serialize 0.4.2", + "ark-std 0.4.0", "derivative", "hashbrown 0.13.2", "itertools 0.10.5", @@ -246,26 +337,54 @@ dependencies = [ "zeroize", ] +[[package]] +name = "ark-ff" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b3235cc41ee7a12aaaf2c575a2ad7b46713a8a50bda2fc3b003a04845c05dd6" +dependencies = [ + "ark-ff-asm 0.3.0", + "ark-ff-macros 0.3.0", + "ark-serialize 0.3.0", + "ark-std 0.3.0", + "derivative", + "num-bigint", + "num-traits", + "paste", + "rustc_version 0.3.3", + "zeroize", +] + [[package]] name = "ark-ff" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" dependencies = [ - "ark-ff-asm", - "ark-ff-macros", - "ark-serialize", - "ark-std", + "ark-ff-asm 0.4.2", + "ark-ff-macros 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", "derivative", "digest 0.10.7", "itertools 0.10.5", "num-bigint", "num-traits", "paste", - "rustc_version", + "rustc_version 0.4.1", "zeroize", ] +[[package]] +name = "ark-ff-asm" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db02d390bf6643fb404d3d22d31aee1c4bc4459600aef9113833d17e786c6e44" +dependencies = [ + "quote", + "syn 1.0.109", +] + [[package]] name = "ark-ff-asm" version = "0.4.2" @@ -276,6 +395,18 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ark-ff-macros" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fd794a08ccb318058009eefdf15bcaaaaf6f8161eb3345f907222bac38b20" +dependencies = [ + "num-bigint", + "num-traits", + "quote", + "syn 1.0.109", +] + [[package]] name = "ark-ff-macros" version = "0.4.2" @@ -295,13 +426,23 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" dependencies = [ - "ark-ff", - "ark-serialize", - "ark-std", + "ark-ff 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", "derivative", "hashbrown 0.13.2", ] +[[package]] +name = "ark-serialize" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6c2b318ee6e10f8c2853e73a83adc0ccb88995aa978d8a3408d492ab2ee671" +dependencies = [ + "ark-std 0.3.0", + "digest 0.9.0", +] + [[package]] name = "ark-serialize" version = "0.4.2" @@ -309,7 +450,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" dependencies = [ "ark-serialize-derive", - "ark-std", + "ark-std 0.4.0", "digest 0.10.7", "num-bigint", ] @@ -325,6 +466,16 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ark-std" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1df2c09229cbc5a028b1d70e00fdb2acee28b1055dfb5ca73eea49c5a25c4e7c" +dependencies = [ + "num-traits", + "rand", +] + [[package]] name = "ark-std" version = "0.4.0" @@ -337,15 +488,15 @@ dependencies = [ [[package]] name = "array-bytes" -version = "6.2.2" +version = "6.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f840fb7195bcfc5e17ea40c26e5ce6d5b9ce5d584466e17703209657e459ae0" +checksum = "5d5dde061bd34119e902bbb2d9b90c5692635cf59fb91d582c2b68043f1b8293" [[package]] name = "arrayref" -version = "0.3.7" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" [[package]] name = "arrayvec" @@ -358,9 +509,9 @@ dependencies = [ [[package]] name = "arrayvec" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "asn1-rs" @@ -374,23 +525,23 @@ dependencies = [ "nom", "num-traits", "rusticata-macros", - "thiserror", + "thiserror 1.0.69", "time", ] [[package]] name = "asn1-rs" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ad1373757efa0f70ec53939aabc7152e1591cb485208052993070ac8d2429d" +checksum = "5493c3bedbacf7fd7382c6346bbd66687d12bbaad3a89a2d2c303ee6cf20b048" dependencies = [ - "asn1-rs-derive 0.5.0", + "asn1-rs-derive 0.5.1", "asn1-rs-impl 0.2.0", "displaydoc", "nom", "num-traits", "rusticata-macros", - "thiserror", + "thiserror 1.0.69", "time", ] @@ -408,13 +559,13 @@ dependencies = [ [[package]] name = "asn1-rs-derive" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7378575ff571966e99a744addeff0bff98b8ada0dedf1956d59e634db95eaac1" +checksum = "965c2d33e53cb6b267e148a4cb0760bc01f4904c1cd4bb4002a085bb016d1490" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", "synstructure 0.13.1", ] @@ -437,7 +588,7 @@ checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -457,17 +608,28 @@ dependencies = [ "futures-core", ] +[[package]] +name = "async-channel" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" +dependencies = [ + "concurrent-queue", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + [[package]] name = "async-executor" -version = "1.5.1" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fa3dc5f2a8564f07759c008b9109dc0d39de92a88d5588b8a5036d286383afb" +checksum = "30ca9a001c1e8ba5149f91a74362376cc6bc5b919d92d988668657bd570bdcec" dependencies = [ - "async-lock 2.8.0", "async-task", "concurrent-queue", - "fastrand 1.9.0", - "futures-lite 1.13.0", + "fastrand 2.3.0", + "futures-lite 2.6.0", "slab", ] @@ -497,29 +659,29 @@ dependencies = [ "log", "parking", "polling 2.8.0", - "rustix 0.37.23", + "rustix 0.37.28", "slab", - "socket2 0.4.9", + "socket2 0.4.10", "waker-fn", ] [[package]] name = "async-io" -version = "2.3.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6baa8f0178795da0e71bc42c9e5d13261aac7ee549853162e66a241ba17964" +checksum = "43a2b323ccce0a1d90b449fd71f2a06ca7faa7c54c2751f06c9bd851fc061059" dependencies = [ "async-lock 3.4.0", "cfg-if", "concurrent-queue", "futures-io", - "futures-lite 2.3.0", + "futures-lite 2.6.0", "parking", - "polling 3.4.0", - "rustix 0.38.21", + "polling 3.7.4", + "rustix 0.38.43", "slab", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -537,56 +699,72 @@ version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" dependencies = [ - "event-listener 5.2.0", + "event-listener 5.4.0", "event-listener-strategy", "pin-project-lite", ] [[package]] name = "async-net" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4051e67316bc7eff608fe723df5d32ed639946adcd69e07df41fd42a7b411f1f" +checksum = "0434b1ed18ce1cf5769b8ac540e33f01fa9471058b5e89da9e06f3c882a8c12f" dependencies = [ "async-io 1.13.0", - "autocfg", "blocking", "futures-lite 1.13.0", ] [[package]] name = "async-process" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a9d28b1d97e08915212e2e45310d47854eafa69600756fc735fb788f75199c9" +checksum = "ea6438ba0a08d81529c69b36700fa2f95837bfe3e776ab39cde9c14d9149da88" dependencies = [ "async-io 1.13.0", "async-lock 2.8.0", - "autocfg", + "async-signal", "blocking", "cfg-if", - "event-listener 2.5.3", + "event-listener 3.1.0", "futures-lite 1.13.0", - "rustix 0.37.23", - "signal-hook", + "rustix 0.38.43", "windows-sys 0.48.0", ] +[[package]] +name = "async-signal" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "637e00349800c0bdf8bfc21ebbc0b6524abea702b0da4168ac00d070d0c0b9f3" +dependencies = [ + "async-io 2.4.0", + "async-lock 3.4.0", + "atomic-waker", + "cfg-if", + "futures-core", + "futures-io", + "rustix 0.38.43", + "signal-hook-registry", + "slab", + "windows-sys 0.59.0", +] + [[package]] name = "async-task" -version = "4.4.0" +version = "4.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc7ab41815b3c653ccd2978ec3255c81349336702dfdf62ee6f7069b12a3aae" +checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" [[package]] name = "async-trait" -version = "0.1.83" +version = "0.1.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" +checksum = "3f934833b4b7233644e5848f235df3f57ed8c80f1528a26c3dfa13d2147fa056" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -619,9 +797,9 @@ checksum = "a8ab6b55fe97976e46f91ddbed8d147d966475dc29b2032757ba47e02376fbc3" [[package]] name = "atomic-waker" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1181e1e0d1fce796a03db1ae795d67167da795f9cf4a39c37589e85ef57f26d3" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "attohttpc" @@ -629,42 +807,41 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d9a9bf8b79a749ee0b911b91b671cc2b6c670bdbc7e3dfd537576ddc94bb2a2" dependencies = [ - "http 0.2.9", + "http 0.2.12", "log", "url", ] [[package]] name = "auto_impl" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fee3da8ef1276b0bee5dd1c7258010d8fffd31801447323115a25560e1327b89" +checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ - "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.96", ] [[package]] name = "autocfg" -version = "1.1.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ - "addr2line 0.21.0", - "cc", + "addr2line 0.24.2", "cfg-if", "libc", "miniz_oxide", - "object 0.32.2", + "object 0.36.7", "rustc-demangle", + "windows-targets 0.52.6", ] [[package]] @@ -687,9 +864,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.2" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64" @@ -853,7 +1030,7 @@ dependencies = [ [[package]] name = "bifrost-cli" -version = "0.16.1" +version = "0.16.2" dependencies = [ "bifrost-primitives", "bifrost-service", @@ -1123,38 +1300,216 @@ dependencies = [ "orml-xtokens", "pallet-assets", "pallet-balances", - "pallet-conviction-voting", - "pallet-message-queue", - "pallet-referenda", - "pallet-staking", - "pallet-xcm", - "parachains-common", + "pallet-conviction-voting", + "pallet-message-queue", + "pallet-referenda", + "pallet-staking", + "pallet-xcm", + "parachains-common", + "parity-scale-codec", + "polkadot-core-primitives", + "polkadot-parachain-primitives", + "polkadot-runtime-common", + "polkadot-runtime-parachains", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-staking", + "sp-std", + "staging-parachain-info", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", + "xcm-emulator", + "xcm-simulator", +] + +[[package]] +name = "bifrost-ismp" +version = "0.8.0" +dependencies = [ + "anyhow", + "frame-support", + "frame-system", + "ismp", + "pallet-balances", + "pallet-ismp", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-runtime", +] + +[[package]] +name = "bifrost-kusama-runtime" +version = "0.8.0" +dependencies = [ + "bifrost-asset-registry", + "bifrost-channel-commission", + "bifrost-cross-in-out", + "bifrost-currencies", + "bifrost-farming", + "bifrost-farming-rpc-runtime-api", + "bifrost-fee-share", + "bifrost-flexible-fee", + "bifrost-flexible-fee-rpc-runtime-api", + "bifrost-parachain-staking", + "bifrost-primitives", + "bifrost-runtime-common", + "bifrost-salp", + "bifrost-salp-rpc-runtime-api", + "bifrost-slp", + "bifrost-slpx", + "bifrost-stable-asset", + "bifrost-stable-pool", + "bifrost-stable-pool-rpc-runtime-api", + "bifrost-system-staking", + "bifrost-token-issuer", + "bifrost-vbnc-convert", + "bifrost-vesting", + "bifrost-vstoken-conversion", + "bifrost-vtoken-minting", + "bifrost-vtoken-minting-rpc-runtime-api", + "bifrost-vtoken-voting", + "bifrost-xcm-interface", + "cumulus-pallet-aura-ext", + "cumulus-pallet-parachain-system", + "cumulus-pallet-xcm", + "cumulus-pallet-xcmp-queue", + "cumulus-primitives-aura", + "cumulus-primitives-core", + "cumulus-primitives-timestamp", + "cumulus-primitives-utility", + "frame-benchmarking", + "frame-executive", + "frame-metadata-hash-extension", + "frame-support", + "frame-system", + "frame-system-benchmarking", + "frame-system-rpc-runtime-api", + "frame-try-runtime", + "hex-literal 0.4.1", + "lend-market", + "lend-market-rpc-runtime-api", + "leverage-staking", + "log", + "merkle-distributor", + "orml-oracle", + "orml-tokens", + "orml-traits", + "orml-unknown-tokens", + "orml-xcm", + "orml-xcm-support", + "orml-xtokens", + "pallet-asset-rate", + "pallet-aura", + "pallet-authorship", + "pallet-balances", + "pallet-bounties", + "pallet-collective", + "pallet-conviction-voting", + "pallet-democracy", + "pallet-elections-phragmen", + "pallet-identity", + "pallet-indices", + "pallet-membership", + "pallet-message-queue", + "pallet-multisig", + "pallet-preimage", + "pallet-prices", + "pallet-proxy", + "pallet-ranked-collective", + "pallet-referenda", + "pallet-scheduler", + "pallet-session", + "pallet-staking", + "pallet-timestamp", + "pallet-tips", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "pallet-treasury", + "pallet-tx-pause", + "pallet-utility", + "pallet-whitelist", + "pallet-xcm", + "parachains-common", + "parity-scale-codec", + "polkadot-parachain-primitives", + "polkadot-primitives", + "polkadot-runtime-common", + "scale-info", + "serde", + "serde_json", + "smallvec", + "sp-api", + "sp-arithmetic", + "sp-block-builder", + "sp-consensus-aura", + "sp-core", + "sp-debug-derive", + "sp-genesis-builder", + "sp-inherents", + "sp-io", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-staking", + "sp-std", + "sp-transaction-pool", + "sp-version", + "staging-parachain-info", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", + "static_assertions", + "strum 0.26.3", + "strum_macros 0.26.4", + "substrate-wasm-builder", + "xcm-runtime-apis", + "zenlink-protocol", + "zenlink-protocol-runtime-api", + "zenlink-stable-amm", + "zenlink-stable-amm-runtime-api", + "zenlink-swap-router", +] + +[[package]] +name = "bifrost-parachain-staking" +version = "3.0.1" +dependencies = [ + "bifrost-primitives", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-authorship", + "pallet-balances", + "pallet-session", "parity-scale-codec", - "polkadot-core-primitives", - "polkadot-parachain-primitives", - "polkadot-runtime-common", - "polkadot-runtime-parachains", "scale-info", "serde", + "similar-asserts", "sp-core", "sp-io", "sp-runtime", "sp-staking", "sp-std", - "staging-parachain-info", - "staging-xcm", - "staging-xcm-builder", - "staging-xcm-executor", - "xcm-emulator", - "xcm-simulator", + "substrate-fixed", ] [[package]] -name = "bifrost-kusama-runtime" +name = "bifrost-paseo-runtime" version = "0.8.0" dependencies = [ + "anyhow", + "bb-bnc", + "bb-bnc-rpc-runtime-api", "bifrost-asset-registry", + "bifrost-buy-back", "bifrost-channel-commission", + "bifrost-clouds-convert", "bifrost-cross-in-out", "bifrost-currencies", "bifrost-farming", @@ -1162,19 +1517,19 @@ dependencies = [ "bifrost-fee-share", "bifrost-flexible-fee", "bifrost-flexible-fee-rpc-runtime-api", + "bifrost-ismp", "bifrost-parachain-staking", "bifrost-primitives", "bifrost-runtime-common", "bifrost-salp", "bifrost-salp-rpc-runtime-api", "bifrost-slp", + "bifrost-slp-v2", "bifrost-slpx", "bifrost-stable-asset", "bifrost-stable-pool", "bifrost-stable-pool-rpc-runtime-api", "bifrost-system-staking", - "bifrost-token-issuer", - "bifrost-vbnc-convert", "bifrost-vesting", "bifrost-vstoken-conversion", "bifrost-vtoken-minting", @@ -1189,6 +1544,12 @@ dependencies = [ "cumulus-primitives-core", "cumulus-primitives-timestamp", "cumulus-primitives-utility", + "ethabi", + "evm", + "fp-account", + "fp-evm", + "fp-rpc", + "fp-self-contained", "frame-benchmarking", "frame-executive", "frame-metadata-hash-extension", @@ -1198,11 +1559,16 @@ dependencies = [ "frame-system-rpc-runtime-api", "frame-try-runtime", "hex-literal 0.4.1", + "ismp", + "ismp-parachain", + "ismp-parachain-runtime-api", "lend-market", "lend-market-rpc-runtime-api", "leverage-staking", "log", "merkle-distributor", + "module-evm-utility-macro", + "num_enum", "orml-oracle", "orml-tokens", "orml-traits", @@ -1214,13 +1580,30 @@ dependencies = [ "pallet-aura", "pallet-authorship", "pallet-balances", + "pallet-base-fee", "pallet-bounties", "pallet-collective", "pallet-conviction-voting", "pallet-democracy", + "pallet-dynamic-fee", "pallet-elections-phragmen", + "pallet-ethereum", + "pallet-evm", + "pallet-evm-accounts", + "pallet-evm-accounts-rpc-runtime-api", + "pallet-evm-chain-id", + "pallet-evm-precompile-blake2", + "pallet-evm-precompile-bn128", + "pallet-evm-precompile-call-permit", + "pallet-evm-precompile-dispatch", + "pallet-evm-precompile-modexp", + "pallet-evm-precompile-sha3fips", + "pallet-evm-precompile-simple", + "pallet-hyperbridge", "pallet-identity", "pallet-indices", + "pallet-ismp", + "pallet-ismp-runtime-api", "pallet-membership", "pallet-message-queue", "pallet-multisig", @@ -1232,8 +1615,11 @@ dependencies = [ "pallet-scheduler", "pallet-session", "pallet-staking", + "pallet-sudo", "pallet-timestamp", "pallet-tips", + "pallet-token-gateway", + "pallet-traits", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", "pallet-treasury", @@ -1246,6 +1632,7 @@ dependencies = [ "polkadot-parachain-primitives", "polkadot-primitives", "polkadot-runtime-common", + "primitive-types", "scale-info", "serde", "serde_json", @@ -1255,10 +1642,10 @@ dependencies = [ "sp-block-builder", "sp-consensus-aura", "sp-core", - "sp-debug-derive", "sp-genesis-builder", "sp-inherents", "sp-io", + "sp-mmr-primitives", "sp-offchain", "sp-runtime", "sp-session", @@ -1277,39 +1664,13 @@ dependencies = [ "xcm-runtime-apis", "zenlink-protocol", "zenlink-protocol-runtime-api", - "zenlink-stable-amm", - "zenlink-stable-amm-runtime-api", - "zenlink-swap-router", -] - -[[package]] -name = "bifrost-parachain-staking" -version = "3.0.1" -dependencies = [ - "bifrost-primitives", - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "pallet-authorship", - "pallet-balances", - "pallet-session", - "parity-scale-codec", - "scale-info", - "serde", - "similar-asserts", - "sp-core", - "sp-io", - "sp-runtime", - "sp-staking", - "sp-std", - "substrate-fixed", ] [[package]] name = "bifrost-polkadot-runtime" version = "0.8.0" dependencies = [ + "anyhow", "bb-bnc", "bb-bnc-rpc-runtime-api", "bifrost-asset-registry", @@ -1364,6 +1725,9 @@ dependencies = [ "frame-system-rpc-runtime-api", "frame-try-runtime", "hex-literal 0.4.1", + "ismp", + "ismp-parachain", + "ismp-parachain-runtime-api", "lend-market", "lend-market-rpc-runtime-api", "leverage-staking", @@ -1401,8 +1765,11 @@ dependencies = [ "pallet-evm-precompile-modexp", "pallet-evm-precompile-sha3fips", "pallet-evm-precompile-simple", + "pallet-hyperbridge", "pallet-identity", "pallet-indices", + "pallet-ismp", + "pallet-ismp-runtime-api", "pallet-membership", "pallet-message-queue", "pallet-multisig", @@ -1416,6 +1783,7 @@ dependencies = [ "pallet-staking", "pallet-timestamp", "pallet-tips", + "pallet-token-gateway", "pallet-traits", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", @@ -1443,6 +1811,7 @@ dependencies = [ "sp-genesis-builder", "sp-inherents", "sp-io", + "sp-mmr-primitives", "sp-offchain", "sp-runtime", "sp-session", @@ -1517,6 +1886,8 @@ dependencies = [ "jsonrpsee", "lend-market-rpc", "lend-market-rpc-runtime-api", + "pallet-ismp-rpc", + "pallet-ismp-runtime-api", "pallet-transaction-payment-rpc", "sc-client-api", "sc-consensus", @@ -1708,6 +2079,7 @@ dependencies = [ "frame-system-rpc-runtime-api", "futures 0.3.31", "hex-literal 0.4.1", + "ismp-parachain-inherent", "jsonrpsee", "log", "pallet-transaction-payment-rpc", @@ -1849,7 +2221,7 @@ dependencies = [ "cumulus-pallet-xcm", "cumulus-primitives-core", "ethabi", - "ethereum 0.14.0", + "ethereum", "frame-benchmarking", "frame-support", "frame-system", @@ -2194,9 +2566,9 @@ dependencies = [ [[package]] name = "binary-merkle-tree" version = "15.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ - "hash-db 0.16.0", + "hash-db", "log", ] @@ -2221,35 +2593,44 @@ dependencies = [ "lazy_static", "lazycell", "peeking_take_while", - "prettyplease 0.2.25", + "prettyplease 0.2.29", "proc-macro2", "quote", "regex", "rustc-hash", "shlex", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "bip39" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f2635620bf0b9d4576eb7bb9a38a55df78bd1205d26fa994b25911a69f212f" +checksum = "33415e24172c1b7d6066f6d999545375ab8e1d95421d6784bdfff9496f292387" dependencies = [ - "bitcoin_hashes 0.11.0", + "bitcoin_hashes", ] [[package]] -name = "bitcoin-internals" -version = "0.2.0" +name = "bit-set" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9425c3bf7089c983facbae04de54513cce73b41c7f9ff8c845b54e7bc64ebbfb" +checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +dependencies = [ + "bit-vec", +] [[package]] -name = "bitcoin_hashes" -version = "0.11.0" +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + +[[package]] +name = "bitcoin-internals" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90064b8dee6815a6470d60bad07bbbaee885c0e12d04177138fa3291a01b7bc4" +checksum = "9425c3bf7089c983facbae04de54513cce73b41c7f9ff8c845b54e7bc64ebbfb" [[package]] name = "bitcoin_hashes" @@ -2269,9 +2650,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "1be3f42a67d6d345ecd59f675f3f012d6974981560836e938c22b424b85ce1be" [[package]] name = "bitvec" @@ -2319,37 +2700,37 @@ dependencies = [ [[package]] name = "blake2b_simd" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c2f0dc9a68c6317d884f97cc36cf5a3d20ba14ce404227df55e1af708ab04bc" +checksum = "23285ad32269793932e830392f2fe2f83e26488fd3ec778883a93c8323735780" dependencies = [ "arrayref", - "arrayvec 0.7.4", - "constant_time_eq 0.2.6", + "arrayvec 0.7.6", + "constant_time_eq 0.3.1", ] [[package]] name = "blake2s_simd" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6637f448b9e61dfadbdcbae9a885fadee1f3eaffb1f8d3c1965d3ade8bdfd44f" +checksum = "94230421e395b9920d23df13ea5d77a20e1725331f90fbbf6df6040b33f756ae" dependencies = [ "arrayref", - "arrayvec 0.7.4", - "constant_time_eq 0.2.6", + "arrayvec 0.7.6", + "constant_time_eq 0.3.1", ] [[package]] name = "blake3" -version = "1.5.0" +version = "1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0231f06152bf547e9c2b5194f247cd97aacf6dcd8b15d8e5ec0663f64580da87" +checksum = "b8ee0c1824c4dea5b5f81736aff91bae041d2c07ee1192bec91054e10e3e601e" dependencies = [ "arrayref", - "arrayvec 0.7.4", + "arrayvec 0.7.6", "cc", "cfg-if", - "constant_time_eq 0.3.0", + "constant_time_eq 0.3.1", ] [[package]] @@ -2372,24 +2753,22 @@ dependencies = [ [[package]] name = "blocking" -version = "1.3.1" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77231a1c8f801696fc0123ec6150ce92cffb8e164a02afb9c8ddee0e9b65ad65" +checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" dependencies = [ - "async-channel", - "async-lock 2.8.0", + "async-channel 2.3.1", "async-task", - "atomic-waker", - "fastrand 1.9.0", - "futures-lite 1.13.0", - "log", + "futures-io", + "futures-lite 2.6.0", + "piper", ] [[package]] name = "bounded-collections" -version = "0.2.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32385ecb91a31bddaf908e8dcf4a15aef1bcd3913cc03ebfad02ff6d568abc1" +checksum = "3d077619e9c237a5d1875166f5e8033e8f6bff0c96f8caf81e1c2d7738c431bf" dependencies = [ "log", "parity-scale-codec", @@ -2403,13 +2782,13 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68534a48cbf63a4b1323c433cf21238c9ec23711e0df13b08c33e5c2082663ce" dependencies = [ - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "bp-xcm-bridge-hub-router" version = "0.14.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "parity-scale-codec", "scale-info", @@ -2425,21 +2804,21 @@ checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" [[package]] name = "bs58" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5353f36341f7451062466f0b755b96ac3a9547e4d7f6b70d603fc721a7d7896" +checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" dependencies = [ "tinyvec", ] [[package]] name = "bstr" -version = "1.6.0" +version = "1.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6798148dccfbff0fae41c7574d2fa8f1ef3492fba0face179de5d8d447d67b05" +checksum = "531a9155a481e2ee699d4f98f43c0ca4ff8ee1bfd55c31e9e98fb29d2b176fe0" dependencies = [ "memchr", - "regex-automata 0.3.6", + "regex-automata 0.4.9", "serde", ] @@ -2460,9 +2839,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.13.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "byte-slice-cast" @@ -2478,21 +2857,21 @@ checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" [[package]] name = "bytemuck" -version = "1.13.1" +version = "1.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17febce684fd15d89027105661fec94afb475cb995fbc59d2865198446ba2eea" +checksum = "ef657dfab802224e671f5818e9a4935f9b1957ed18e58292690cc39e7a4092a3" [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.6.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" +checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" [[package]] name = "bzip2-sys" @@ -2517,18 +2896,18 @@ dependencies = [ [[package]] name = "camino" -version = "1.1.6" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" dependencies = [ "serde", ] [[package]] name = "cargo-platform" -version = "0.1.3" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cfa25e60aea747ec7e1124f238816749faa93759c6ff5b31f1ccdda137f4479" +checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" dependencies = [ "serde", ] @@ -2541,10 +2920,10 @@ checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" dependencies = [ "camino", "cargo-platform", - "semver 1.0.18", + "semver 1.0.24", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -2555,12 +2934,13 @@ checksum = "fd6c0e7b807d60291f42f33f58480c0bfafe28ed08286446f45e463728cf9c1c" [[package]] name = "cc" -version = "1.0.83" +version = "1.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +checksum = "c8293772165d9345bdaaa39b45b2109591e63fe5e6fbc23c6ff930a048aa310b" dependencies = [ "jobserver", "libc", + "shlex", ] [[package]] @@ -2580,9 +2960,9 @@ dependencies = [ [[package]] name = "cfg-expr" -version = "0.15.5" +version = "0.15.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03915af431787e6ffdcc74c645077518c6b6e01f80b761e0fbbfa288536311b3" +checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" dependencies = [ "smallvec", ] @@ -2635,16 +3015,16 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.31" +version = "0.4.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" +checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", "wasm-bindgen", - "windows-targets 0.48.5", + "windows-targets 0.52.6", ] [[package]] @@ -2695,9 +3075,9 @@ dependencies = [ [[package]] name = "clang-sys" -version = "1.6.1" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" dependencies = [ "glob", "libc", @@ -2706,9 +3086,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.22" +version = "4.5.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69371e34337c4c984bbe322360c2547210bf632eb2814bbe78a6e87a2935bd2b" +checksum = "a8eb5e908ef3a6efbe1ed62520fb7287959888c88485abe072543190ecc66783" dependencies = [ "clap_builder", "clap_derive", @@ -2716,9 +3096,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.22" +version = "4.5.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e24c1b4099818523236a8ca881d2b45db98dadfb4625cf6608c12069fcbbde1" +checksum = "96b01801b5fc6a0a232407abc821660c9c6d25a1cafc0d4f85f29fb8d9afc121" dependencies = [ "anstream", "anstyle", @@ -2729,31 +3109,30 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.18" +version = "4.5.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" +checksum = "54b755194d6389280185988721fffba69495eed5ee9feeee9a599b53db80318c" dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "clap_lex" -version = "0.7.0" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" +checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" [[package]] name = "coarsetime" -version = "0.1.23" +version = "0.1.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a90d114103adbc625300f346d4d09dfb4ab1c4a8df6868435dd903392ecf4354" +checksum = "4252bf230cb600c19826a575b31c8c9c84c6f11acfab6dfcad2e941b10b6f8e2" dependencies = [ "libc", - "once_cell", - "wasi", + "wasix", "wasm-bindgen", ] @@ -2764,20 +3143,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" dependencies = [ "termcolor", - "unicode-width", + "unicode-width 0.1.14", ] [[package]] name = "colorchoice" -version = "1.0.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "combine" -version = "4.6.6" +version = "4.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" dependencies = [ "bytes", "memchr", @@ -2785,13 +3164,13 @@ dependencies = [ [[package]] name = "comfy-table" -version = "7.1.0" +version = "7.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c64043d6c7b7a4c58e39e7efccfdea7b93d885a795d0c054a69dbbf4dd52686" +checksum = "24f165e7b643266ea80cb858aed492ad9280e3e05ce24d4a99d7d7b889b6a4d9" dependencies = [ - "strum 0.25.0", - "strum_macros 0.25.3", - "unicode-width", + "strum 0.26.3", + "strum_macros 0.26.4", + "unicode-width 0.2.0", ] [[package]] @@ -2802,51 +3181,62 @@ checksum = "2382f75942f4b3be3690fe4f86365e9c853c1587d6ee58212cebf6e2a9ccd101" [[package]] name = "concurrent-queue" -version = "2.2.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62ec6771ecfa0762d24683ee5a32ad78487a3d3afdc0fb8cae19d2c5deb50b7c" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" dependencies = [ "crossbeam-utils", ] [[package]] name = "console" -version = "0.15.8" +version = "0.15.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" +checksum = "ea3c6ecd8059b57859df5c69830340ed3c41d30e3da0c1cbed90a96ac853041b" dependencies = [ "encode_unicode", - "lazy_static", "libc", - "unicode-width", - "windows-sys 0.52.0", + "once_cell", + "unicode-width 0.2.0", + "windows-sys 0.59.0", +] + +[[package]] +name = "const-hex" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b0485bab839b018a8f1723fc5391819fea5f8f0f32288ef8a735fd096b6160c" +dependencies = [ + "cfg-if", + "cpufeatures", + "hex", + "proptest", + "serde", ] [[package]] name = "const-oid" -version = "0.9.5" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "const-random" -version = "0.1.15" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368a7a772ead6ce7e1de82bfb04c485f3db8ec744f72925af5735e29a22cc18e" +checksum = "87e00182fe74b066627d63b85fd550ac2998d4b0bd86bfed477a0ae4c7c71359" dependencies = [ "const-random-macro", - "proc-macro-hack", ] [[package]] name = "const-random-macro" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d7d6ab3c3a2282db210df5f02c4dab6e0a7057af0fb7ebd4070f30fe05c0ddb" +checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" dependencies = [ "getrandom", "once_cell", - "proc-macro-hack", "tiny-keccak", ] @@ -2858,21 +3248,15 @@ checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" [[package]] name = "constant_time_eq" -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" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" +checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" [[package]] name = "constcat" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f272d0c4cf831b4fa80ee529c7707f76585986e910e1fbce1d7921970bc1a241" +checksum = "cd7e35aee659887cbfb97aaf227ac12cad1a9d7c71e55ff3376839ed4e282d08" [[package]] name = "convert_case" @@ -2892,9 +3276,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "core2" @@ -2926,9 +3310,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.9" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" dependencies = [ "libc", ] @@ -3033,9 +3417,9 @@ dependencies = [ [[package]] name = "crc" -version = "3.2.0" +version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2b432c56615136f8dba245fed7ec3d5518c500a31108661067e61e72fe7e6bc" +checksum = "69e6e4d7b33a94f0991c26729976b10ebde1d34c3ee82408fb536164fa10d636" dependencies = [ "crc-catalog", ] @@ -3048,55 +3432,46 @@ checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" [[package]] name = "crc32fast" -version = "1.3.2" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", ] [[package]] name = "crossbeam-deque" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" dependencies = [ - "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.15" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "autocfg", - "cfg-if", "crossbeam-utils", - "memoffset 0.9.0", - "scopeguard", ] [[package]] name = "crossbeam-queue" -version = "0.3.8" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1cfb3ea8a53f37c40dea2c7bedcbd88bdfae54f5e2175d6ecaff1c988353add" +checksum = "0f58bbc28f91df819d0aa2a2c00cd19754769c2fad90579b3592b1c9ba7a3115" dependencies = [ - "cfg-if", "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if", -] +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crunchy" @@ -3106,13 +3481,13 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "crypto-bigint" -version = "0.5.2" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4c2f4e1afd912bc40bfd6fed5d9dc1f288e0ba01bfcc835cc5bc3eb13efe15" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array 0.14.7", "rand_core", - "subtle 2.5.0", + "subtle 2.6.1", "zeroize", ] @@ -3144,7 +3519,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" dependencies = [ "generic-array 0.14.7", - "subtle 2.5.0", + "subtle 2.6.1", ] [[package]] @@ -3159,7 +3534,7 @@ dependencies = [ [[package]] name = "cumulus-client-cli" version = "0.17.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "clap", "parity-scale-codec", @@ -3176,7 +3551,7 @@ dependencies = [ [[package]] name = "cumulus-client-collator" version = "0.17.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "cumulus-client-consensus-common", "cumulus-client-network", @@ -3199,7 +3574,7 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-aura" version = "0.17.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "async-trait", "cumulus-client-collator", @@ -3244,7 +3619,7 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-common" version = "0.17.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "async-trait", "cumulus-client-pov-recovery", @@ -3274,7 +3649,7 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-proposer" version = "0.15.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "anyhow", "async-trait", @@ -3283,13 +3658,13 @@ dependencies = [ "sp-inherents", "sp-runtime", "sp-state-machine", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "cumulus-client-network" version = "0.17.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "async-trait", "cumulus-relay-chain-interface", @@ -3315,7 +3690,7 @@ dependencies = [ [[package]] name = "cumulus-client-parachain-inherent" version = "0.11.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -3337,7 +3712,7 @@ dependencies = [ [[package]] name = "cumulus-client-pov-recovery" version = "0.17.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -3362,8 +3737,8 @@ dependencies = [ [[package]] name = "cumulus-client-service" -version = "0.17.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +version = "0.18.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "cumulus-client-cli", "cumulus-client-collator", @@ -3400,7 +3775,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-aura-ext" version = "0.16.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "cumulus-pallet-parachain-system", "frame-support", @@ -3417,7 +3792,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-parachain-system" version = "0.16.2" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "bytes", "cumulus-pallet-parachain-system-proc-macro", @@ -3453,18 +3828,18 @@ dependencies = [ [[package]] name = "cumulus-pallet-parachain-system-proc-macro" version = "0.6.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "cumulus-pallet-xcm" version = "0.16.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -3479,7 +3854,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-xcmp-queue" version = "0.16.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "bounded-collections", "bp-xcm-bridge-hub-router", @@ -3504,7 +3879,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-aura" version = "0.15.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "parity-scale-codec", "polkadot-core-primitives", @@ -3517,7 +3892,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-core" version = "0.15.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "parity-scale-codec", "polkadot-core-primitives", @@ -3533,7 +3908,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-parachain-inherent" version = "0.15.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -3549,7 +3924,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-proof-size-hostfunction" version = "0.10.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "sp-externalities", "sp-runtime-interface", @@ -3559,7 +3934,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-timestamp" version = "0.15.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "cumulus-primitives-core", "sp-inherents", @@ -3569,7 +3944,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-utility" version = "0.16.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -3587,8 +3962,8 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-inprocess-interface" -version = "0.17.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +version = "0.18.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -3612,7 +3987,7 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-interface" version = "0.17.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -3625,13 +4000,13 @@ dependencies = [ "sp-blockchain", "sp-state-machine", "sp-version", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "cumulus-relay-chain-minimal-node" -version = "0.17.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +version = "0.18.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "array-bytes", "async-trait", @@ -3666,7 +4041,7 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-rpc-interface" version = "0.17.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -3695,7 +4070,7 @@ dependencies = [ "sp-state-machine", "sp-storage", "sp-version", - "thiserror", + "thiserror 1.0.69", "tokio", "tokio-util", "tracing", @@ -3705,7 +4080,7 @@ dependencies = [ [[package]] name = "cumulus-test-relay-sproof-builder" version = "0.15.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "cumulus-primitives-core", "parity-scale-codec", @@ -3726,20 +4101,20 @@ dependencies = [ "curve25519-dalek-derive", "digest 0.10.7", "fiat-crypto", - "rustc_version", - "subtle 2.5.0", + "rustc_version 0.4.1", + "subtle 2.6.1", "zeroize", ] [[package]] name = "curve25519-dalek-derive" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -3757,72 +4132,87 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.106" +version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28403c86fc49e3401fdf45499ba37fad6493d9329449d6449d7f0e10f4654d28" +checksum = "ad7c7515609502d316ab9a24f67dc045132d93bfd3f00713389e90d9898bf30d" dependencies = [ "cc", + "cxxbridge-cmd", "cxxbridge-flags", "cxxbridge-macro", + "foldhash", "link-cplusplus", ] [[package]] name = "cxx-build" -version = "1.0.106" +version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78da94fef01786dc3e0c76eafcd187abcaa9972c78e05ff4041e24fdf059c285" +checksum = "8bfd16fca6fd420aebbd80d643c201ee4692114a0de208b790b9cd02ceae65fb" dependencies = [ "cc", "codespan-reporting", - "once_cell", "proc-macro2", "quote", "scratch", - "syn 2.0.90", + "syn 2.0.96", +] + +[[package]] +name = "cxxbridge-cmd" +version = "1.0.136" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c33fd49f5d956a1b7ee5f7a9768d58580c6752838d92e39d0d56439efdedc35" +dependencies = [ + "clap", + "codespan-reporting", + "proc-macro2", + "quote", + "syn 2.0.96", ] [[package]] name = "cxxbridge-flags" -version = "1.0.106" +version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2a6f5e1dfb4b34292ad4ea1facbfdaa1824705b231610087b00b17008641809" +checksum = "be0f1077278fac36299cce8446effd19fe93a95eedb10d39265f3bf67b3036c9" [[package]] name = "cxxbridge-macro" -version = "1.0.106" +version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50c49547d73ba8dcfd4ad7325d64c6d5391ff4224d498fc39a6f3f49825a530d" +checksum = "3da7e4d6e74af6b79031d264b2f13c3ea70af1978083741c41ffce9308f1f24f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "rustversion", + "syn 2.0.96", ] [[package]] name = "dashmap" -version = "5.5.1" +version = "5.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edd72493923899c6f10c641bdbdeddc7183d6396641d99c1a0d1597f37f92e28" +checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ "cfg-if", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "lock_api", "once_cell", - "parking_lot_core 0.9.8", + "parking_lot_core 0.9.10", ] [[package]] name = "data-encoding" -version = "2.4.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" +checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" [[package]] name = "data-encoding-macro" -version = "0.1.13" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c904b33cc60130e1aeea4956ab803d08a3f4a0ca82d64ed757afac3891f2bb99" +checksum = "f1559b6cba622276d6d63706db152618eeb15b89b3e4041446b05876e352e639" dependencies = [ "data-encoding", "data-encoding-macro-internal", @@ -3830,9 +4220,9 @@ dependencies = [ [[package]] name = "data-encoding-macro-internal" -version = "0.1.11" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fdf3fce3ce863539ec1d7fd1b6dcc3c645663376b43ed376bbf887733e4f772" +checksum = "332d754c0af53bc87c108fed664d121ecf59207ec4196041f04d6ab9002ad33f" dependencies = [ "data-encoding", "syn 1.0.109", @@ -3840,9 +4230,9 @@ dependencies = [ [[package]] name = "der" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ "const-oid", "zeroize", @@ -3868,7 +4258,7 @@ version = "9.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5cd0a5c643689626bec213c4d8bd4d96acc8ffdb4ad4bb6bc16abf27d5f4b553" dependencies = [ - "asn1-rs 0.6.1", + "asn1-rs 0.6.2", "displaydoc", "nom", "num-bigint", @@ -3904,7 +4294,7 @@ checksum = "d65d7ce8132b7c0e54497a4d9a55a1c2a0912a0d786cf894472ba818fba45762" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -3916,8 +4306,8 @@ dependencies = [ "convert_case", "proc-macro2", "quote", - "rustc_version", - "syn 2.0.90", + "rustc_version 0.4.1", + "syn 2.0.96", ] [[package]] @@ -3937,7 +4327,8 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", + "unicode-xid", ] [[package]] @@ -3973,7 +4364,7 @@ dependencies = [ "block-buffer 0.10.4", "const-oid", "crypto-common", - "subtle 2.5.0", + "subtle 2.6.1", ] [[package]] @@ -4020,29 +4411,29 @@ dependencies = [ [[package]] name = "displaydoc" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "docify" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a2f138ad521dc4a2ced1a4576148a6a610b4c5923933b062a263130a6802ce" +checksum = "a772b62b1837c8f060432ddcc10b17aae1453ef17617a99bc07789252d2a5896" dependencies = [ "docify_macros", ] [[package]] name = "docify_macros" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a081e51fb188742f5a7a1164ad752121abcb22874b21e2c3b0dd040c515fdad" +checksum = "60e6be249b0a462a14784a99b19bf35a667bb5e09de611738bb7362fa4c95ff7" dependencies = [ "common-path", "derive-syn-parse", @@ -4050,9 +4441,9 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.90", + "syn 2.0.96", "termcolor", - "toml 0.8.8", + "toml 0.8.19", "walkdir", ] @@ -4070,9 +4461,9 @@ checksum = "1435fa1053d8b2fbbe9be7e97eca7f33d37b28409959813daefc1446a14247f1" [[package]] name = "downcast-rs" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" +checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" [[package]] name = "dtoa" @@ -4080,6 +4471,12 @@ version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcbb2bf8e87535c23f7a8a321e364ce21462d0ff10cb6407820e8e96dfff6653" +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + [[package]] name = "dyn-clonable" version = "0.9.0" @@ -4103,15 +4500,15 @@ dependencies = [ [[package]] name = "dyn-clone" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "545b22097d44f8a9581187cdf93de7a71e4722bf51200cfaba810865b49a495d" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" [[package]] name = "ecdsa" -version = "0.16.8" +version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4b1e0c257a9e9f25f90ff76d7a68360ed497ee519c8e428d1825ef0000799d4" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ "der", "digest 0.10.7", @@ -4124,9 +4521,9 @@ dependencies = [ [[package]] name = "ed25519" -version = "2.2.2" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60f6d271ca33075c88028be6f04d502853d63a5ece419d269c15315d4fc1cf1d" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" dependencies = [ "pkcs8", "signature", @@ -4143,7 +4540,7 @@ dependencies = [ "rand_core", "serde", "sha2 0.10.8", - "subtle 2.5.0", + "subtle 2.6.1", "zeroize", ] @@ -4155,7 +4552,7 @@ checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" dependencies = [ "curve25519-dalek", "ed25519", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "hex", "rand_core", "sha2 0.10.8", @@ -4164,9 +4561,9 @@ dependencies = [ [[package]] name = "either" -version = "1.9.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" dependencies = [ "serde", ] @@ -4187,15 +4584,15 @@ dependencies = [ "rand_core", "sec1", "serdect", - "subtle 2.5.0", + "subtle 2.6.1", "zeroize", ] [[package]] name = "encode_unicode" -version = "0.3.6" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" +checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" [[package]] name = "enum-as-inner" @@ -4211,45 +4608,45 @@ dependencies = [ [[package]] name = "enum-as-inner" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ffccbb6966c05b32ef8fbac435df276c4ae4d3dc55a8cd0eb9745e6c12f546a" +checksum = "a1e6a265c649f3f5979b601d26f1d05ada116434c87741c9493cb56218f76cbc" dependencies = [ - "heck 0.4.1", + "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "enumflags2" -version = "0.7.7" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c041f5090df68b32bcd905365fd51769c8b9d553fe87fde0b683534f10c01bd2" +checksum = "d232db7f5956f3f14313dc2f87985c58bd2c695ce124c8cdd984e08e15ac133d" dependencies = [ "enumflags2_derive", ] [[package]] name = "enumflags2_derive" -version = "0.7.7" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e9a1f9f7d83e59740248a6e14ecf93929ade55027844dfcea78beafccc15745" +checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "enumn" -version = "0.1.12" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2ad8cef1d801a4686bfd8919f0b30eac4c8e48968c437a6405ded4fb5272d2b" +checksum = "2f9ed6b3789237c8a0c1c505af1c7eb2c560df6186f01b098c3a1064ea532f38" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -4279,23 +4676,12 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b30f669a7961ef1631673d2766cc92f52d64f7ef354d4fe0ddfd30ed52f0f4f" -dependencies = [ - "errno-dragonfly", - "libc", - "windows-sys 0.48.0", -] - -[[package]] -name = "errno-dragonfly" -version = "0.1.2" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ - "cc", "libc", + "windows-sys 0.59.0", ] [[package]] @@ -4319,27 +4705,9 @@ dependencies = [ "fixed-hash", "impl-codec", "impl-rlp", - "impl-serde", - "scale-info", - "tiny-keccak", -] - -[[package]] -name = "ethereum" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a89fb87a9e103f71b903b80b670200b54cc67a07578f070681f1fffb7396fb7" -dependencies = [ - "bytes", - "ethereum-types", - "hash-db 0.15.2", - "hash256-std-hasher", - "parity-scale-codec", - "rlp", + "impl-serde", "scale-info", - "serde", - "sha3", - "triehash", + "tiny-keccak", ] [[package]] @@ -4350,7 +4718,7 @@ checksum = "2e04d24d20b8ff2235cffbf242d5092de3aa45f77c5270ddbfadd2778ca13fea" dependencies = [ "bytes", "ethereum-types", - "hash-db 0.16.0", + "hash-db", "hash256-std-hasher", "parity-scale-codec", "rlp", @@ -4384,9 +4752,20 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "event-listener" -version = "5.2.0" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d93877bcde0eb80ca09131a08d23f0a5c18a620b01db137dba666d18cd9b30c2" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener" +version = "5.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b5fb89194fa3cad959b833185b3063ba881dbfc7030680b314250779fb4cc91" +checksum = "3492acde4c3fc54c845eaab3eed8bd00c7a7d881f78bfc801e43a93dec1331ae" dependencies = [ "concurrent-queue", "parking", @@ -4395,11 +4774,11 @@ dependencies = [ [[package]] name = "event-listener-strategy" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" +checksum = "3c3e4e0dd3673c1139bf041f3008816d9cf2946bbfac2945c09e523b8d7b05b2" dependencies = [ - "event-listener 5.2.0", + "event-listener 5.4.0", "pin-project-lite", ] @@ -4411,7 +4790,7 @@ checksum = "767f43e9630cc36cf8ff2777cbb0121b055f0d1fd6eaaa13b46a1808f0d0e7e9" dependencies = [ "auto_impl", "environmental", - "ethereum 0.15.0", + "ethereum", "evm-core", "evm-gasometer", "evm-runtime", @@ -4479,10 +4858,10 @@ dependencies = [ "blake2 0.10.6", "file-guard", "fs-err", - "prettyplease 0.2.25", + "prettyplease 0.2.29", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -4514,9 +4893,31 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.1.0" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" + +[[package]] +name = "fastrlp" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139834ddba373bbdd213dffe02c8d110508dcf1726c2be27e8d1f7d7e1856418" +dependencies = [ + "arrayvec 0.7.6", + "auto_impl", + "bytes", +] + +[[package]] +name = "fastrlp" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +checksum = "ce8dba4714ef14b8274c371879b175aa55b16b30f269663f19d576f380018dc4" +dependencies = [ + "arrayvec 0.7.6", + "auto_impl", + "bytes", +] [[package]] name = "fatality" @@ -4525,7 +4926,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec6f82451ff7f0568c6181287189126d492b5654e30a788add08027b6363d019" dependencies = [ "fatality-proc-macro", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -4535,11 +4936,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eb42427514b063d97ce21d5199f36c0c307d981434a6be32582bc79fe5bd2303" dependencies = [ "expander", - "indexmap 2.2.3", - "proc-macro-crate 3.1.0", + "indexmap 2.7.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -4567,7 +4968,7 @@ dependencies = [ "sp-block-builder", "sp-consensus", "sp-runtime", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -4576,7 +4977,7 @@ version = "2.0.0-dev" source = "git+https://github.com/bifrost-io/frontier?branch=release-polkadot-stable2407#81ebdfa2d6b75e2ef85311ffda6a8f1fe56e3834" dependencies = [ "async-trait", - "ethereum 0.15.0", + "ethereum", "fc-api", "fc-storage", "fp-consensus", @@ -4628,7 +5029,7 @@ name = "fc-rpc" version = "2.0.0-dev" source = "git+https://github.com/bifrost-io/frontier?branch=release-polkadot-stable2407#81ebdfa2d6b75e2ef85311ffda6a8f1fe56e3834" dependencies = [ - "ethereum 0.15.0", + "ethereum", "ethereum-types", "evm", "fc-api", @@ -4673,7 +5074,7 @@ dependencies = [ "sp-storage", "sp-timestamp", "substrate-prometheus-endpoint", - "thiserror", + "thiserror 1.0.69", "tokio", ] @@ -4682,7 +5083,7 @@ name = "fc-rpc-core" version = "1.1.0-dev" source = "git+https://github.com/bifrost-io/frontier?branch=release-polkadot-stable2407#81ebdfa2d6b75e2ef85311ffda6a8f1fe56e3834" dependencies = [ - "ethereum 0.15.0", + "ethereum", "ethereum-types", "jsonrpsee", "rlp", @@ -4697,7 +5098,7 @@ name = "fc-storage" version = "1.0.0-dev" source = "git+https://github.com/bifrost-io/frontier?branch=release-polkadot-stable2407#81ebdfa2d6b75e2ef85311ffda6a8f1fe56e3834" dependencies = [ - "ethereum 0.15.0", + "ethereum", "ethereum-types", "fp-rpc", "fp-storage", @@ -4716,7 +5117,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e182f7dbc2ef73d9ef67351c5fbbea084729c48362d3ce9dd44c28e32e277fe5" dependencies = [ "libc", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -4726,14 +5127,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ "rand_core", - "subtle 2.5.0", + "subtle 2.6.1", ] [[package]] name = "fiat-crypto" -version = "0.2.5" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27573eac26f4dd11e2b1916c3fe1baa56407c83c71a773a8ba17ec0bca03b6b7" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" [[package]] name = "file-guard" @@ -4757,14 +5158,14 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.22" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.3.5", - "windows-sys 0.48.0", + "libredox", + "windows-sys 0.59.0", ] [[package]] @@ -4828,6 +5229,12 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foldhash" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0d2fde1f7b3d48b8395d5f2de76c18a528bd6a9cdde438df747bfcba3e05d6f" + [[package]] name = "foreign-types" version = "0.3.2" @@ -4846,7 +5253,7 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "fork-tree" version = "13.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "parity-scale-codec", ] @@ -4860,6 +5267,17 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "fortuples" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87630a8087e9cac4b7edfb6ee5e250ddca9112b57b6b17d8f5107375a3a8eace" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "forwarded-header-value" version = "0.1.1" @@ -4867,7 +5285,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8835f84f38484cc86f110a805655697908257fb9a7af005234060891557198e9" dependencies = [ "nonempty", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -4894,7 +5312,7 @@ name = "fp-consensus" version = "2.0.0-dev" source = "git+https://github.com/bifrost-io/frontier?branch=release-polkadot-stable2407#81ebdfa2d6b75e2ef85311ffda6a8f1fe56e3834" dependencies = [ - "ethereum 0.15.0", + "ethereum", "parity-scale-codec", "sp-core", "sp-runtime", @@ -4915,7 +5333,7 @@ name = "fp-ethereum" version = "1.0.0-dev" source = "git+https://github.com/bifrost-io/frontier?branch=release-polkadot-stable2407#81ebdfa2d6b75e2ef85311ffda6a8f1fe56e3834" dependencies = [ - "ethereum 0.15.0", + "ethereum", "ethereum-types", "fp-evm", "frame-support", @@ -4942,7 +5360,7 @@ name = "fp-rpc" version = "3.0.0-dev" source = "git+https://github.com/bifrost-io/frontier?branch=release-polkadot-stable2407#81ebdfa2d6b75e2ef85311ffda6a8f1fe56e3834" dependencies = [ - "ethereum 0.15.0", + "ethereum", "ethereum-types", "fp-evm", "parity-scale-codec", @@ -4983,7 +5401,7 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "frame-benchmarking" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-support", "frame-support-procedural", @@ -5007,7 +5425,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "42.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "Inflector", "array-bytes", @@ -5050,25 +5468,25 @@ dependencies = [ "sp-storage", "sp-trie", "sp-wasm-interface", - "thiserror", + "thiserror 1.0.69", "thousands", ] [[package]] name = "frame-election-provider-solution-type" version = "14.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "frame-election-provider-support" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -5084,7 +5502,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "aquamarine", "frame-support", @@ -5114,7 +5532,7 @@ dependencies = [ [[package]] name = "frame-metadata-hash-extension" version = "0.5.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "array-bytes", "docify", @@ -5129,7 +5547,7 @@ dependencies = [ [[package]] name = "frame-support" version = "37.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "aquamarine", "array-bytes", @@ -5170,7 +5588,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "30.0.4" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "Inflector", "cfg-expr", @@ -5179,39 +5597,39 @@ dependencies = [ "frame-support-procedural-tools", "itertools 0.11.0", "macro_magic", - "proc-macro-warning 1.0.0", + "proc-macro-warning 1.0.2", "proc-macro2", "quote", "sp-crypto-hashing", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "frame-support-procedural-tools" version = "13.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-support-procedural-tools-derive", - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "frame-support-procedural-tools-derive" version = "12.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "frame-system" version = "37.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "cfg-if", "docify", @@ -5231,7 +5649,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-benchmarking", "frame-support", @@ -5245,7 +5663,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "34.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "docify", "parity-scale-codec", @@ -5255,7 +5673,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.43.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-support", "parity-scale-codec", @@ -5265,9 +5683,12 @@ dependencies = [ [[package]] name = "fs-err" -version = "2.9.0" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0845fa252299212f0389d64ba26f34fa32cfe41588355f21ed507c59a0f64541" +checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41" +dependencies = [ + "autocfg", +] [[package]] name = "fs2" @@ -5285,7 +5706,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29f9df8a11882c4e3335eb2d18a0137c505d9ca927470b0cac9c6f0ae07d28f7" dependencies = [ - "rustix 0.38.21", + "rustix 0.38.43", "windows-sys 0.48.0", ] @@ -5388,11 +5809,14 @@ dependencies = [ [[package]] name = "futures-lite" -version = "2.3.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" +checksum = "f5edaec856126859abb19ed65f39e90fea3a9574b9707f13539acf4abf7eb532" dependencies = [ + "fastrand 2.3.0", "futures-core", + "futures-io", + "parking", "pin-project-lite", ] @@ -5404,7 +5828,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -5414,7 +5838,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35bd3cf68c183738046838e300353e4716c674dc5e56890de4826801a6622a28" dependencies = [ "futures-io", - "rustls 0.21.7", + "rustls 0.21.12", ] [[package]] @@ -5499,9 +5923,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.10" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "js-sys", @@ -5522,11 +5946,11 @@ dependencies = [ [[package]] name = "ghash" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d930750de5717d2dd0b8c0d42c076c0e884c81a73e6cab859bbd2339c71e3e40" +checksum = "f0d8a4362ccb29cb0b265253fb0a2728f592895ee6854fd9bc13f2ffda266ff1" dependencies = [ - "opaque-debug 0.3.0", + "opaque-debug 0.3.1", "polyval", ] @@ -5543,19 +5967,25 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" dependencies = [ "fallible-iterator 0.3.0", "stable_deref_trait", ] +[[package]] +name = "gimli" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" + [[package]] name = "glob" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" [[package]] name = "gloo-net" @@ -5567,12 +5997,12 @@ dependencies = [ "futures-core", "futures-sink", "gloo-utils", - "http 0.2.9", + "http 0.2.12", "js-sys", "pin-project", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", @@ -5605,9 +6035,9 @@ dependencies = [ [[package]] name = "governor" -version = "0.6.0" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "821239e5672ff23e2a7060901fa622950bbd80b649cdaadd78d1c1767ed14eb4" +checksum = "68a7f542ee6b35af73b06abc0dad1c1bae89964e4e253bc4b587b91c9637867b" dependencies = [ "cfg-if", "dashmap", @@ -5616,9 +6046,11 @@ dependencies = [ "no-std-compat", "nonzero_ext", "parking_lot 0.12.3", + "portable-atomic", "quanta", "rand", "smallvec", + "spinning_top", ] [[package]] @@ -5629,7 +6061,7 @@ checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", "rand_core", - "subtle 2.5.0", + "subtle 2.6.1", ] [[package]] @@ -5643,8 +6075,8 @@ dependencies = [ "futures-core", "futures-sink", "futures-util", - "http 0.2.9", - "indexmap 2.2.3", + "http 0.2.12", + "indexmap 2.7.0", "slab", "tokio", "tokio-util", @@ -5653,17 +6085,17 @@ dependencies = [ [[package]] name = "h2" -version = "0.4.5" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa82e28a107a8cc405f0839610bdc9b15f1e25ec7d696aa5cf173edbcb1486ab" +checksum = "ccae279728d634d083c00f6099cb58f01cc99c145b84b8be2f6c74618d79922e" dependencies = [ "atomic-waker", "bytes", "fnv", "futures-core", "futures-sink", - "http 1.1.0", - "indexmap 2.2.3", + "http 1.2.0", + "indexmap 2.7.0", "slab", "tokio", "tokio-util", @@ -5672,24 +6104,18 @@ dependencies = [ [[package]] name = "handlebars" -version = "5.1.0" +version = "5.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab283476b99e66691dee3f1640fea91487a8d81f50fb5ecc75538f8f8879a1e4" +checksum = "d08485b96a0e6393e9e4d1b8d48cf74ad6c063cd905eb33f42c1ce3f0377539b" dependencies = [ "log", "pest", "pest_derive", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", ] -[[package]] -name = "hash-db" -version = "0.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d23bd4e7b5eda0d0f3a307e8b381fdc8ba9000f26fbe912250c0a4cc3956364a" - [[package]] name = "hash-db" version = "0.16.0" @@ -5722,22 +6148,33 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", "allocator-api2", "serde", ] +[[package]] +name = "hashbrown" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", +] + [[package]] name = "hashlink" version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" dependencies = [ - "hashbrown 0.14.3", + "hashbrown 0.14.5", ] [[package]] @@ -5757,9 +6194,15 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" -version = "0.3.2" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + +[[package]] +name = "hermit-abi" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" [[package]] name = "hex" @@ -5769,9 +6212,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hex-conservative" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ed443af458ccb6d81c1e7e661545f94d3176752fb1df2f543b902a1e0f51e2" +checksum = "212ab92002354b4819390025006c897e8140934349e8635c9b077f47b4dcbd20" [[package]] name = "hex-literal" @@ -5787,9 +6230,9 @@ checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "hkdf" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" dependencies = [ "hmac 0.12.1", ] @@ -5824,6 +6267,15 @@ dependencies = [ "hmac 0.8.1", ] +[[package]] +name = "home" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" +dependencies = [ + "windows-sys 0.59.0", +] + [[package]] name = "hostname" version = "0.3.1" @@ -5837,9 +6289,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.9" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" dependencies = [ "bytes", "fnv", @@ -5848,9 +6300,9 @@ dependencies = [ [[package]] name = "http" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" dependencies = [ "bytes", "fnv", @@ -5859,23 +6311,23 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", - "http 0.2.9", + "http 0.2.12", "pin-project-lite", ] [[package]] name = "http-body" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", - "http 1.1.0", + "http 1.2.0", ] [[package]] @@ -5886,16 +6338,16 @@ checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ "bytes", "futures-util", - "http 1.1.0", - "http-body 1.0.0", + "http 1.2.0", + "http-body 1.0.1", "pin-project-lite", ] [[package]] name = "httparse" -version = "1.8.0" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" [[package]] name = "httpdate" @@ -5911,22 +6363,22 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.29" +version = "0.14.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f361cde2f109281a220d4307746cdfd5ee3f410da58a70377762396775634b33" +checksum = "41dfc780fdec9373c01bae43289ea34c972e40ee3c9f6b3c8801a35f35586ce7" dependencies = [ "bytes", "futures-channel", "futures-core", "futures-util", "h2 0.3.26", - "http 0.2.9", - "http-body 0.4.5", + "http 0.2.12", + "http-body 0.4.6", "httparse", "httpdate", "itoa", "pin-project-lite", - "socket2 0.5.7", + "socket2 0.5.8", "tokio", "tower-service", "tracing", @@ -5935,16 +6387,16 @@ dependencies = [ [[package]] name = "hyper" -version = "1.3.1" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" +checksum = "256fb8d4bd6413123cc9d91832d78325c48ff41677595be797d90f42969beae0" dependencies = [ "bytes", "futures-channel", "futures-util", - "h2 0.4.5", - "http 1.1.0", - "http-body 1.0.0", + "h2 0.4.7", + "http 1.2.0", + "http-body 1.0.1", "httparse", "httpdate", "itoa", @@ -5961,10 +6413,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", - "http 0.2.9", - "hyper 0.14.29", + "http 0.2.12", + "hyper 0.14.32", "log", - "rustls 0.21.7", + "rustls 0.21.12", "rustls-native-certs 0.6.3", "tokio", "tokio-rustls 0.24.1", @@ -5972,54 +6424,53 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.27.2" +version = "0.27.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" +checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2" dependencies = [ "futures-util", - "http 1.1.0", - "hyper 1.3.1", + "http 1.2.0", + "hyper 1.5.2", "hyper-util", "log", - "rustls 0.23.10", + "rustls 0.23.21", "rustls-pki-types", "tokio", - "tokio-rustls 0.26.0", + "tokio-rustls 0.26.1", "tower-service", ] [[package]] name = "hyper-util" -version = "0.1.5" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b875924a60b96e5d7b9ae7b066540b1dd1cbd90d1828f54c92e02a283351c56" +checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" dependencies = [ "bytes", "futures-channel", "futures-util", - "http 1.1.0", - "http-body 1.0.0", - "hyper 1.3.1", + "http 1.2.0", + "http-body 1.0.1", + "hyper 1.5.2", "pin-project-lite", - "socket2 0.5.7", + "socket2 0.5.8", "tokio", - "tower", "tower-service", "tracing", ] [[package]] name = "iana-time-zone" -version = "0.1.57" +version = "0.1.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows 0.48.0", + "windows-core 0.52.0", ] [[package]] @@ -6031,6 +6482,124 @@ dependencies = [ "cc", ] +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + [[package]] name = "idna" version = "0.2.3" @@ -6054,12 +6623,23 @@ dependencies = [ [[package]] name = "idna" -version = "0.5.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", ] [[package]] @@ -6074,21 +6654,25 @@ dependencies = [ [[package]] name = "if-watch" -version = "3.2.0" +version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6b0422c86d7ce0e97169cc42e04ae643caf278874a7a3c87b8150a220dc7e1e" +checksum = "cdf9d64cfcf380606e64f9a0bcf493616b65331199f984151a6fa11a7b3cde38" dependencies = [ - "async-io 2.3.3", + "async-io 2.4.0", "core-foundation", "fnv", "futures 0.3.31", "if-addrs", "ipnet", "log", + "netlink-packet-core", + "netlink-packet-route", + "netlink-proto", + "netlink-sys", "rtnetlink", "system-configuration", "tokio", - "windows 0.51.1", + "windows", ] [[package]] @@ -6101,8 +6685,8 @@ dependencies = [ "attohttpc", "bytes", "futures 0.3.31", - "http 0.2.9", - "hyper 0.14.29", + "http 0.2.12", + "hyper 0.14.32", "log", "rand", "tokio", @@ -6139,29 +6723,29 @@ dependencies = [ [[package]] name = "impl-trait-for-tuples" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" +checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.96", ] [[package]] name = "include_dir" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18762faeff7122e89e0857b02f7ce6fcc0d101d5e9ad2ad7846cc01d61b7f19e" +checksum = "923d117408f1e49d914f1a379a309cffe4f18c05cf4e3d12e613a15fc81bd0dd" dependencies = [ "include_dir_macros", ] [[package]] name = "include_dir_macros" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b139284b5cf57ecfa712bcc66950bb635b31aff41c188e8a4cfc758eca374a3f" +checksum = "7cab85a7ed0bd5f0e76d93846e0147172bed2e2d3f859bcc33a8d9699cad1a75" dependencies = [ "proc-macro2", "quote", @@ -6180,12 +6764,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.3" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.15.2", ] [[package]] @@ -6205,9 +6789,9 @@ dependencies = [ [[package]] name = "instant" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ "cfg-if", ] @@ -6233,7 +6817,7 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.9", "libc", "windows-sys 0.48.0", ] @@ -6250,36 +6834,114 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ - "socket2 0.5.7", + "socket2 0.5.8", "widestring", "windows-sys 0.48.0", "winreg", ] [[package]] -name = "ipnet" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" - -[[package]] -name = "is-terminal" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +name = "ipnet" +version = "2.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" + +[[package]] +name = "is-terminal" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" +dependencies = [ + "hermit-abi 0.4.0", + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "is_executable" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4a1b5bad6f9072935961dfbf1cced2f3d129963d091b6f69f007fe04e758ae2" +dependencies = [ + "winapi", +] + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + +[[package]] +name = "ismp" +version = "0.2.2" +source = "git+https://github.com/polytope-labs/hyperbridge?branch=polkadot-stable2407#672bd1d27e1ef7cfe168dfccc2edc1754403dc50" +dependencies = [ + "anyhow", + "derive_more 1.0.0", + "displaydoc", + "hex", + "parity-scale-codec", + "primitive-types", + "scale-info", + "serde", + "serde-hex-utils", + "thiserror 2.0.11", +] + +[[package]] +name = "ismp-parachain" +version = "1.15.3" +source = "git+https://github.com/polytope-labs/hyperbridge?branch=polkadot-stable2407#672bd1d27e1ef7cfe168dfccc2edc1754403dc50" +dependencies = [ + "cumulus-pallet-parachain-system", + "cumulus-primitives-core", + "frame-support", + "frame-system", + "hex-literal 0.4.1", + "ismp", + "log", + "pallet-ismp", + "parity-scale-codec", + "primitive-types", + "scale-info", + "serde", + "sp-consensus-aura", + "sp-inherents", + "sp-io", + "sp-runtime", + "sp-trie", + "substrate-state-machine", +] + +[[package]] +name = "ismp-parachain-inherent" +version = "1.15.3" +source = "git+https://github.com/polytope-labs/hyperbridge?branch=polkadot-stable2407#672bd1d27e1ef7cfe168dfccc2edc1754403dc50" dependencies = [ - "hermit-abi", - "rustix 0.38.21", - "windows-sys 0.48.0", + "anyhow", + "async-trait", + "cumulus-primitives-core", + "cumulus-relay-chain-interface", + "ismp", + "ismp-parachain", + "ismp-parachain-runtime-api", + "log", + "pallet-ismp-runtime-api", + "parity-scale-codec", + "sp-api", + "sp-blockchain", + "sp-inherents", + "sp-runtime", ] [[package]] -name = "is_executable" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa9acdc6d67b75e626ad644734e8bc6df893d9cd2a834129065d3dd6158ea9c8" +name = "ismp-parachain-runtime-api" +version = "1.15.1" +source = "git+https://github.com/polytope-labs/hyperbridge?branch=polkadot-stable2407#672bd1d27e1ef7cfe168dfccc2edc1754403dc50" dependencies = [ - "winapi", + "cumulus-pallet-parachain-system", + "sp-api", ] [[package]] @@ -6300,11 +6962,20 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "jni" @@ -6316,7 +6987,7 @@ dependencies = [ "combine", "jni-sys", "log", - "thiserror", + "thiserror 1.0.69", "walkdir", ] @@ -6328,19 +6999,20 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] name = "jobserver" -version = "0.1.26" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" dependencies = [ + "once_cell", "wasm-bindgen", ] @@ -6372,16 +7044,16 @@ dependencies = [ "futures-channel", "futures-util", "gloo-net", - "http 1.1.0", + "http 1.2.0", "jsonrpsee-core", "pin-project", - "rustls 0.23.10", + "rustls 0.23.21", "rustls-pki-types", "rustls-platform-verifier", - "soketto 0.8.0", - "thiserror", + "soketto 0.8.1", + "thiserror 1.0.69", "tokio", - "tokio-rustls 0.26.0", + "tokio-rustls 0.26.1", "tokio-util", "tracing", "url", @@ -6399,8 +7071,8 @@ dependencies = [ "bytes", "futures-timer", "futures-util", - "http 1.1.0", - "http-body 1.0.0", + "http 1.2.0", + "http-body 1.0.1", "http-body-util", "jsonrpsee-types", "parking_lot 0.12.3", @@ -6409,7 +7081,7 @@ dependencies = [ "rustc-hash", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "tokio", "tokio-stream", "tracing", @@ -6424,17 +7096,17 @@ checksum = "2d90064e04fb9d7282b1c71044ea94d0bbc6eff5621c66f1a0bce9e9de7cf3ac" dependencies = [ "async-trait", "base64 0.22.1", - "http-body 1.0.0", - "hyper 1.3.1", - "hyper-rustls 0.27.2", + "http-body 1.0.1", + "hyper 1.5.2", + "hyper-rustls 0.27.5", "hyper-util", "jsonrpsee-core", "jsonrpsee-types", - "rustls 0.23.10", + "rustls 0.23.21", "rustls-platform-verifier", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "tokio", "tower", "tracing", @@ -6448,10 +7120,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7895f186d5921065d96e16bd795e5ca89ac8356ec423fafc6e3d7cf8ec11aee4" dependencies = [ "heck 0.5.0", - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -6462,10 +7134,10 @@ checksum = "654afab2e92e5d88ebd8a39d6074483f3f2bfdf91c5ac57fe285e7127cdd4f51" dependencies = [ "anyhow", "futures-util", - "http 1.1.0", - "http-body 1.0.0", + "http 1.2.0", + "http-body 1.0.1", "http-body-util", - "hyper 1.3.1", + "hyper 1.5.2", "hyper-util", "jsonrpsee-core", "jsonrpsee-types", @@ -6473,8 +7145,8 @@ dependencies = [ "route-recognizer", "serde", "serde_json", - "soketto 0.8.0", - "thiserror", + "soketto 0.8.1", + "thiserror 1.0.69", "tokio", "tokio-stream", "tokio-util", @@ -6489,10 +7161,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9c465fbe385238e861fdc4d1c85e04ada6c1fd246161d26385c1b311724d2af" dependencies = [ "beef", - "http 1.1.0", + "http 1.2.0", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -6512,7 +7184,7 @@ version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c28759775f5cb2f1ea9667672d3fe2b0e701d1f4b7b67954e60afe7fd058b5e" dependencies = [ - "http 1.1.0", + "http 1.2.0", "jsonrpsee-client-transport", "jsonrpsee-core", "jsonrpsee-types", @@ -6521,9 +7193,9 @@ dependencies = [ [[package]] name = "k256" -version = "0.13.3" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" +checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" dependencies = [ "cfg-if", "ecdsa", @@ -6535,13 +7207,23 @@ dependencies = [ [[package]] name = "keccak" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" dependencies = [ "cpufeatures", ] +[[package]] +name = "keccak-asm" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "505d1856a39b200489082f90d897c3f07c455563880bc5952e38eabf731c83b6" +dependencies = [ + "digest 0.10.7", + "sha3-asm", +] + [[package]] name = "keystream" version = "1.0.0" @@ -6583,22 +7265,22 @@ dependencies = [ [[package]] name = "landlock" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1530c5b973eeed4ac216af7e24baf5737645a6272e361f1fb95710678b67d9cc" +checksum = "9baa9eeb6e315942429397e617a190f4fdc696ef1ee0342939d641029cbb4ea7" dependencies = [ "enumflags2", "libc", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" dependencies = [ - "spin 0.5.2", + "spin 0.9.8", ] [[package]] @@ -6703,25 +7385,25 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.167" +version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d6582e104315a817dff97f75133544b2e094ee22447d2acf4a74e189ba06fc" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] name = "libloading" -version = "0.7.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" dependencies = [ "cfg-if", - "winapi", + "windows-targets 0.52.6", ] [[package]] name = "libm" -version = "0.2.8" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" [[package]] name = "libp2p" @@ -6754,10 +7436,10 @@ dependencies = [ "libp2p-wasm-ext", "libp2p-websocket", "libp2p-yamux", - "multiaddr 0.18.1", + "multiaddr 0.18.2", "pin-project", "rw-stream-sink", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -6797,8 +7479,8 @@ dependencies = [ "instant", "libp2p-identity", "log", - "multiaddr 0.18.1", - "multihash 0.19.1", + "multiaddr 0.18.2", + "multihash 0.19.3", "multistream-select", "once_cell", "parking_lot 0.12.3", @@ -6807,7 +7489,7 @@ dependencies = [ "rand", "rw-stream-sink", "smallvec", - "thiserror", + "thiserror 1.0.69", "unsigned-varint 0.7.2", "void", ] @@ -6843,28 +7525,28 @@ dependencies = [ "libp2p-identity", "libp2p-swarm", "log", - "lru 0.12.3", + "lru 0.12.5", "quick-protobuf", "quick-protobuf-codec", "smallvec", - "thiserror", + "thiserror 1.0.69", "void", ] [[package]] name = "libp2p-identity" -version = "0.2.8" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "999ec70441b2fb35355076726a6bc466c932e9bdc66f6a11c6c0aa17c7ab9be0" +checksum = "257b5621d159b32282eac446bed6670c39c7dc68a200a992d8f056afa0066f6d" dependencies = [ - "bs58 0.5.0", + "bs58 0.5.1", "ed25519-dalek", "hkdf", - "multihash 0.19.1", + "multihash 0.19.3", "quick-protobuf", "rand", "sha2 0.10.8", - "thiserror", + "thiserror 1.0.69", "tracing", "zeroize", ] @@ -6875,7 +7557,7 @@ version = "0.44.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16ea178dabba6dde6ffc260a8e0452ccdc8f79becf544946692fff9d412fc29d" dependencies = [ - "arrayvec 0.7.4", + "arrayvec 0.7.6", "asynchronous-codec", "bytes", "either", @@ -6892,7 +7574,7 @@ dependencies = [ "rand", "sha2 0.10.8", "smallvec", - "thiserror", + "thiserror 1.0.69", "uint", "unsigned-varint 0.7.2", "void", @@ -6913,7 +7595,7 @@ dependencies = [ "log", "rand", "smallvec", - "socket2 0.5.7", + "socket2 0.5.8", "tokio", "trust-dns-proto 0.22.0", "void", @@ -6948,15 +7630,15 @@ dependencies = [ "libp2p-core", "libp2p-identity", "log", - "multiaddr 0.18.1", - "multihash 0.19.1", + "multiaddr 0.18.2", + "multihash 0.19.3", "once_cell", "quick-protobuf", "rand", "sha2 0.10.8", "snow", "static_assertions", - "thiserror", + "thiserror 1.0.69", "x25519-dalek", "zeroize", ] @@ -6997,9 +7679,9 @@ dependencies = [ "quinn 0.10.2", "rand", "ring 0.16.20", - "rustls 0.21.7", - "socket2 0.5.7", - "thiserror", + "rustls 0.21.12", + "socket2 0.5.8", + "thiserror 1.0.69", "tokio", ] @@ -7054,7 +7736,7 @@ dependencies = [ "proc-macro-warning 0.4.2", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -7070,7 +7752,7 @@ dependencies = [ "libp2p-core", "libp2p-identity", "log", - "socket2 0.5.7", + "socket2 0.5.8", "tokio", ] @@ -7086,9 +7768,9 @@ dependencies = [ "libp2p-identity", "rcgen", "ring 0.16.20", - "rustls 0.21.7", - "rustls-webpki 0.101.4", - "thiserror", + "rustls 0.21.12", + "rustls-webpki 0.101.7", + "thiserror 1.0.69", "x509-parser 0.15.1", "yasna", ] @@ -7138,10 +7820,10 @@ dependencies = [ "parking_lot 0.12.3", "pin-project-lite", "rw-stream-sink", - "soketto 0.8.0", - "thiserror", + "soketto 0.8.1", + "thiserror 1.0.69", "url", - "webpki-roots 0.25.2", + "webpki-roots 0.25.4", ] [[package]] @@ -7153,10 +7835,21 @@ dependencies = [ "futures 0.3.31", "libp2p-core", "log", - "thiserror", + "thiserror 1.0.69", "yamux", ] +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.7.0", + "libc", + "redox_syscall 0.5.8", +] + [[package]] name = "librocksdb-sys" version = "0.11.0+8.1.1" @@ -7199,7 +7892,7 @@ checksum = "5be9b9bb642d8522a44d533eab56c16c738301965504753b03ad1de3425d5451" dependencies = [ "crunchy", "digest 0.9.0", - "subtle 2.5.0", + "subtle 2.6.1", ] [[package]] @@ -7233,9 +7926,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.12" +version = "1.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d97137b25e321a73eef1418d1d5d2eda4d77e12813f8e6dead84bc52c5870a7b" +checksum = "df9b68e50e6e0b26f672573834882eb57759f6db9b3be2ea3c35c91188bb4eaa" dependencies = [ "cc", "pkg-config", @@ -7259,18 +7952,18 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linked_hash_set" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47186c6da4d81ca383c7c47c1bfc80f4b95f4720514d860a5407aaf4233f9588" +checksum = "bae85b5be22d9843c80e5fc80e9b64c8a3b1f98f867c709956eca3efff4e92e2" dependencies = [ "linked-hash-map", ] [[package]] name = "linregress" -version = "0.5.2" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4de0b5f52a9f84544d268f5fabb71b38962d6aa3c6600b8bcd27d44ccf9c9c45" +checksum = "a9eda9dcf4f2a99787827661f312ac3219292549c2ee992bf9a6248ffb066bf7" dependencies = [ "nalgebra", ] @@ -7289,9 +7982,9 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.10" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] name = "lioness" @@ -7305,6 +7998,12 @@ dependencies = [ "keystream", ] +[[package]] +name = "litemap" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" + [[package]] name = "litep2p" version = "0.6.2" @@ -7319,7 +8018,7 @@ dependencies = [ "futures 0.3.31", "futures-timer", "hex-literal 0.4.1", - "indexmap 2.2.3", + "indexmap 2.7.0", "libc", "mockall 0.12.1", "multiaddr 0.17.1", @@ -7340,10 +8039,10 @@ dependencies = [ "simple-dns", "smallvec", "snow", - "socket2 0.5.7", + "socket2 0.5.8", "static_assertions", "str0m", - "thiserror", + "thiserror 1.0.69", "tokio", "tokio-stream", "tokio-tungstenite", @@ -7362,9 +8061,9 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.4.10" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -7378,17 +8077,17 @@ checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "lru" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eedb2bdbad7e0634f83989bf596f497b070130daaa398ab22d84c39e266deec5" +checksum = "a4a83fb7698b3643a0e34f9ae6f2e8f0178c0fd42f8b59d493aa271ff3a5bf21" [[package]] name = "lru" -version = "0.12.3" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" +checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" dependencies = [ - "hashbrown 0.14.3", + "hashbrown 0.15.2", ] [[package]] @@ -7402,19 +8101,18 @@ dependencies = [ [[package]] name = "lz4" -version = "1.24.0" +version = "1.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e9e2dd86df36ce760a60f6ff6ad526f7ba1f14ba0356f8254fb6905e6494df1" +checksum = "a20b523e860d03443e98350ceaac5e71c6ba89aea7d960769ec3ce37f4de5af4" dependencies = [ - "libc", "lz4-sys", ] [[package]] name = "lz4-sys" -version = "1.9.4" +version = "1.11.1+lz4-1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d27b317e207b10f69f5e75494119e391a96f48861ae870d1da6edac98ca900" +checksum = "6bd8c0d6c6ed0cd30b3652886bb8711dc4bb01d637a68105a3d5158039b418e6" dependencies = [ "cc", "libc", @@ -7429,15 +8127,6 @@ dependencies = [ "libc", ] -[[package]] -name = "mach2" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" -dependencies = [ - "libc", -] - [[package]] name = "macro_magic" version = "0.5.1" @@ -7447,7 +8136,7 @@ dependencies = [ "macro_magic_core", "macro_magic_macros", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -7461,7 +8150,7 @@ dependencies = [ "macro_magic_core_macros", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -7472,7 +8161,7 @@ checksum = "b02abfe41815b5bd98dbd4260173db2c116dda171dc0fe7838cb206333b83308" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -7483,7 +8172,7 @@ checksum = "73ea28ee64b88876bf45277ed9a5817c1817df061a74f2b988971a12570e5869" dependencies = [ "macro_magic_core", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -7509,9 +8198,9 @@ checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" [[package]] name = "matrixmultiply" -version = "0.3.7" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "090126dc04f95dc0d1c1c91f61bdd474b3930ca064c1edc8a849da2c6cbe1e77" +checksum = "9380b911e3e96d10c1f415da0876389aaf1b56759054eeb0de7df940c456ba1a" dependencies = [ "autocfg", "rawpointer", @@ -7525,11 +8214,11 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memfd" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffc89ccdc6e10d6907450f753537ebc5c5d3460d2e4e62ea74bd571db62c0f9e" +checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" dependencies = [ - "rustix 0.37.23", + "rustix 0.38.43", ] [[package]] @@ -7543,9 +8232,9 @@ dependencies = [ [[package]] name = "memmap2" -version = "0.9.3" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45fd3a57831bf88bc63f8cebc0cf956116276e97fef3966103e96416209f7c92" +checksum = "fd3f7eed9d3848f8b98834af67102b720745c4ec028fcd0aa0239277e7de374f" dependencies = [ "libc", ] @@ -7559,22 +8248,13 @@ dependencies = [ "autocfg", ] -[[package]] -name = "memoffset" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" -dependencies = [ - "autocfg", -] - [[package]] name = "memory-db" version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "808b50db46293432a45e63bc15ea51e0ab4c0a1647b8eb114e31a3e698dd6fbe" dependencies = [ - "hash-db 0.16.0", + "hash-db", ] [[package]] @@ -7641,11 +8321,11 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "4ffbe83022cedc1d264172192511ae958937694cd57ce297164951b8b3568394" dependencies = [ - "adler", + "adler2", ] [[package]] @@ -7666,7 +8346,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "daa3eb39495d8e2e2947a1d862852c90cc6a4a8845f8b41c8829cb9fcc047f4a" dependencies = [ "arrayref", - "arrayvec 0.7.4", + "arrayvec 0.7.6", "bitflags 1.3.2", "blake2 0.10.6", "c2-chacha", @@ -7679,15 +8359,15 @@ dependencies = [ "rand", "rand_chacha", "rand_distr", - "subtle 2.5.0", - "thiserror", + "subtle 2.6.1", + "thiserror 1.0.69", "zeroize", ] [[package]] name = "mmr-gadget" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "futures 0.3.31", "log", @@ -7706,7 +8386,7 @@ dependencies = [ [[package]] name = "mmr-rpc" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -7744,7 +8424,7 @@ dependencies = [ "fragile", "lazy_static", "mockall_derive 0.12.1", - "predicates 3.0.3", + "predicates 3.1.3", "predicates-tree", ] @@ -7769,14 +8449,14 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "module-evm-utility" version = "2.21.0" dependencies = [ - "ethereum 0.14.0", + "ethereum", "sha3", "sp-std", ] @@ -7788,7 +8468,7 @@ dependencies = [ "module-evm-utility", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -7812,20 +8492,20 @@ dependencies = [ [[package]] name = "multiaddr" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b852bc02a2da5feed68cd14fa50d0774b92790a5bdbfa932a813926c8472070" +checksum = "fe6351f60b488e04c1d21bc69e56b89cb3f5e8f5d22557d6e8031bdfd79b6961" dependencies = [ "arrayref", "byteorder", "data-encoding", "libp2p-identity", "multibase", - "multihash 0.19.1", + "multihash 0.19.3", "percent-encoding", "serde", "static_assertions", - "unsigned-varint 0.7.2", + "unsigned-varint 0.8.0", "url", ] @@ -7876,21 +8556,21 @@ dependencies = [ [[package]] name = "multihash" -version = "0.19.1" +version = "0.19.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "076d548d76a0e2a0d4ab471d0b1c36c577786dfc4471242035d97a12a735c492" +checksum = "6b430e7953c29dd6a09afc29ff0bb69c6e306329ee6794700aee27b76a1aea8d" dependencies = [ "core2", - "unsigned-varint 0.7.2", + "unsigned-varint 0.8.0", ] [[package]] name = "multihash-derive" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc076939022111618a5026d3be019fd8b366e76314538ff9a1b59ffbcbf98bcd" +checksum = "1d6d4752e6230d8ef7adf7bd5d8c4b1f6561c1014c5ba9a37445ccefe18aa1db" dependencies = [ - "proc-macro-crate 1.3.1", + "proc-macro-crate 1.1.3", "proc-macro-error", "proc-macro2", "quote", @@ -7904,6 +8584,12 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" +[[package]] +name = "multimap" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03" + [[package]] name = "multistream-select" version = "0.13.0" @@ -7920,13 +8606,12 @@ dependencies = [ [[package]] name = "nalgebra" -version = "0.32.3" +version = "0.33.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "307ed9b18cc2423f29e83f84fd23a8e73628727990181f18641a8b5dc2ab1caa" +checksum = "26aecdf64b707efd1310e3544d709c5c0ac61c13756046aaaba41be5c4f66a3b" dependencies = [ "approx", "matrixmultiply", - "nalgebra-macros", "num-complex", "num-rational", "num-traits", @@ -7934,17 +8619,6 @@ dependencies = [ "typenum", ] -[[package]] -name = "nalgebra-macros" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91761aed67d03ad966ef783ae962ef9bbaca728d2dd7ceb7939ec110fffad998" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "names" version = "0.14.0" @@ -7982,21 +8656,20 @@ dependencies = [ [[package]] name = "netlink-packet-core" -version = "0.4.2" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "345b8ab5bd4e71a2986663e88c56856699d060e78e152e6e9d7966fcd5491297" +checksum = "72724faf704479d67b388da142b186f916188505e7e0b26719019c525882eda4" dependencies = [ "anyhow", "byteorder", - "libc", "netlink-packet-utils", ] [[package]] name = "netlink-packet-route" -version = "0.12.0" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9ea4302b9759a7a88242299225ea3688e63c85ea136371bb6cf94fd674efaab" +checksum = "053998cea5a306971f88580d0829e90f270f940befd7cf928da179d4187a5a66" dependencies = [ "anyhow", "bitflags 1.3.2", @@ -8015,29 +8688,29 @@ dependencies = [ "anyhow", "byteorder", "paste", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "netlink-proto" -version = "0.10.0" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65b4b14489ab424703c092062176d52ba55485a89c076b4f9db05092b7223aa6" +checksum = "86b33524dc0968bfad349684447bfce6db937a9ac3332a1fe60c0c5a5ce63f21" dependencies = [ "bytes", "futures 0.3.31", "log", "netlink-packet-core", "netlink-sys", - "thiserror", + "thiserror 1.0.69", "tokio", ] [[package]] name = "netlink-sys" -version = "0.8.5" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6471bf08e7ac0135876a9581bf3217ef0333c191c128d34878079f42ee150411" +checksum = "16c903aa70590cb93691bf97a767c8d1d6122d2cc9070433deb3bbf36ce8bd23" dependencies = [ "bytes", "futures 0.3.31", @@ -8048,21 +8721,21 @@ dependencies = [ [[package]] name = "network-interface" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae72fd9dbd7f55dda80c00d66acc3b2130436fcba9ea89118fc508eaae48dfb0" +checksum = "a4a43439bf756eed340bdf8feba761e2d50c7d47175d87545cd5cbe4a137c4d1" dependencies = [ "cc", "libc", - "thiserror", + "thiserror 1.0.69", "winapi", ] [[package]] name = "nix" -version = "0.24.3" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" +checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" dependencies = [ "bitflags 1.3.2", "cfg-if", @@ -8075,7 +8748,7 @@ version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "cfg-if", "cfg_aliases", "libc", @@ -8188,7 +8861,7 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" dependencies = [ - "arrayvec 0.7.4", + "arrayvec 0.7.6", "itoa", ] @@ -8239,7 +8912,7 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.9", "libc", ] @@ -8258,10 +8931,10 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -8285,6 +8958,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "object" +version = "0.36.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" +dependencies = [ + "memchr", +] + [[package]] name = "oid-registry" version = "0.6.1" @@ -8296,18 +8978,18 @@ dependencies = [ [[package]] name = "oid-registry" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c958dd45046245b9c3c2547369bb634eb461670b2e7e0de552905801a648d1d" +checksum = "a8d8034d9489cdaf79228eb9f6a3b8d7bb32ba00d6645ebd48eef4077ceb5bd9" dependencies = [ - "asn1-rs 0.6.1", + "asn1-rs 0.6.2", ] [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "opaque-debug" @@ -8317,17 +8999,17 @@ checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" [[package]] name = "opaque-debug" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] name = "openssl" -version = "0.10.64" +version = "0.10.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" +checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "cfg-if", "foreign-types", "libc", @@ -8344,7 +9026,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -8355,18 +9037,18 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-src" -version = "300.2.3+3.2.1" +version = "300.4.1+3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cff92b6f71555b61bb9315f7c64da3ca43d87531622120fea0195fc761b4843" +checksum = "faa4eac4138c62414b5622d1b31c5c304f34b406b013c079c2bbc652fdd6678c" dependencies = [ "cc", ] [[package]] name = "openssl-sys" -version = "0.9.102" +version = "0.9.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" +checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" dependencies = [ "cc", "libc", @@ -8394,7 +9076,7 @@ dependencies = [ "orchestra-proc-macro", "pin-project", "prioritized-metered-channel", - "thiserror", + "thiserror 1.0.69", "tracing", ] @@ -8405,10 +9087,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7b1d40dd8f367db3c65bec8d3dd47d4a604ee8874480738f93191bddab4e0e0" dependencies = [ "expander", - "indexmap 2.2.3", + "indexmap 2.7.0", "itertools 0.11.0", "petgraph", - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", "syn 1.0.109", @@ -8568,7 +9250,7 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "pallet-asset-conversion" version = "19.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-benchmarking", "frame-support", @@ -8586,7 +9268,7 @@ dependencies = [ [[package]] name = "pallet-asset-rate" version = "16.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-benchmarking", "frame-support", @@ -8600,7 +9282,7 @@ dependencies = [ [[package]] name = "pallet-asset-tx-payment" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-benchmarking", "frame-support", @@ -8617,7 +9299,7 @@ dependencies = [ [[package]] name = "pallet-assets" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-benchmarking", "frame-support", @@ -8633,7 +9315,7 @@ dependencies = [ [[package]] name = "pallet-aura" version = "36.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-support", "frame-system", @@ -8649,7 +9331,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-support", "frame-system", @@ -8664,7 +9346,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-support", "frame-system", @@ -8677,7 +9359,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-benchmarking", "frame-support", @@ -8700,7 +9382,7 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "36.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "aquamarine", "docify", @@ -8721,7 +9403,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "docify", "frame-benchmarking", @@ -8750,7 +9432,7 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-support", "frame-system", @@ -8769,7 +9451,7 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "array-bytes", "binary-merkle-tree", @@ -8793,7 +9475,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "36.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-benchmarking", "frame-support", @@ -8810,7 +9492,7 @@ dependencies = [ [[package]] name = "pallet-broker" version = "0.16.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "bitvec", "frame-benchmarking", @@ -8828,7 +9510,7 @@ dependencies = [ [[package]] name = "pallet-child-bounties" version = "36.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-benchmarking", "frame-support", @@ -8846,7 +9528,7 @@ dependencies = [ [[package]] name = "pallet-collator-selection" version = "18.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-benchmarking", "frame-support", @@ -8865,7 +9547,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-benchmarking", "frame-support", @@ -8881,7 +9563,7 @@ dependencies = [ [[package]] name = "pallet-conviction-voting" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "assert_matches", "frame-benchmarking", @@ -8897,7 +9579,7 @@ dependencies = [ [[package]] name = "pallet-delegated-staking" version = "4.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-support", "frame-system", @@ -8910,7 +9592,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-benchmarking", "frame-support", @@ -8942,7 +9624,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "36.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -8964,7 +9646,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-support-benchmarking" version = "36.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -8977,7 +9659,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-benchmarking", "frame-support", @@ -8997,7 +9679,7 @@ name = "pallet-ethereum" version = "4.0.0-dev" source = "git+https://github.com/bifrost-io/frontier?branch=release-polkadot-stable2407#81ebdfa2d6b75e2ef85311ffda6a8f1fe56e3834" dependencies = [ - "ethereum 0.15.0", + "ethereum", "ethereum-types", "evm", "fp-consensus", @@ -9026,7 +9708,7 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "hash-db 0.16.0", + "hash-db", "hex-literal 0.4.1", "impl-trait-for-tuples", "log", @@ -9165,7 +9847,7 @@ dependencies = [ [[package]] name = "pallet-fast-unstake" version = "36.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "docify", "frame-benchmarking", @@ -9183,7 +9865,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-benchmarking", "frame-support", @@ -9202,10 +9884,26 @@ dependencies = [ "sp-staking", ] +[[package]] +name = "pallet-hyperbridge" +version = "1.15.3" +source = "git+https://github.com/polytope-labs/hyperbridge?branch=polkadot-stable2407#672bd1d27e1ef7cfe168dfccc2edc1754403dc50" +dependencies = [ + "anyhow", + "frame-support", + "frame-system", + "ismp", + "pallet-ismp", + "parity-scale-codec", + "primitive-types", + "scale-info", + "sp-std", +] + [[package]] name = "pallet-identity" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "enumflags2", "frame-benchmarking", @@ -9221,7 +9919,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "36.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-benchmarking", "frame-support", @@ -9240,7 +9938,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-benchmarking", "frame-support", @@ -9253,10 +9951,77 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "pallet-ismp" +version = "1.15.3" +source = "git+https://github.com/polytope-labs/hyperbridge?branch=polkadot-stable2407#672bd1d27e1ef7cfe168dfccc2edc1754403dc50" +dependencies = [ + "anyhow", + "fortuples", + "frame-benchmarking", + "frame-support", + "frame-system", + "ismp", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-api", + "sp-core", + "sp-io", + "sp-mmr-primitives", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-ismp-rpc" +version = "1.15.3" +source = "git+https://github.com/polytope-labs/hyperbridge?branch=polkadot-stable2407#672bd1d27e1ef7cfe168dfccc2edc1754403dc50" +dependencies = [ + "anyhow", + "frame-system", + "hash-db", + "hex", + "hex-literal 0.4.1", + "ismp", + "jsonrpsee", + "pallet-ismp", + "pallet-ismp-runtime-api", + "parity-scale-codec", + "sc-client-api", + "sc-rpc", + "serde", + "serde_json", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-mmr-primitives", + "sp-runtime", + "sp-storage", + "sp-trie", + "tower", + "trie-db", +] + +[[package]] +name = "pallet-ismp-runtime-api" +version = "1.15.3" +source = "git+https://github.com/polytope-labs/hyperbridge?branch=polkadot-stable2407#672bd1d27e1ef7cfe168dfccc2edc1754403dc50" +dependencies = [ + "ismp", + "pallet-ismp", + "parity-scale-codec", + "primitive-types", + "serde", + "sp-api", + "sp-mmr-primitives", +] + [[package]] name = "pallet-membership" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-benchmarking", "frame-support", @@ -9272,7 +10037,7 @@ dependencies = [ [[package]] name = "pallet-message-queue" version = "40.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "environmental", "frame-benchmarking", @@ -9291,7 +10056,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-benchmarking", "frame-support", @@ -9308,7 +10073,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-benchmarking", "frame-support", @@ -9323,7 +10088,7 @@ dependencies = [ [[package]] name = "pallet-nis" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-benchmarking", "frame-support", @@ -9337,8 +10102,8 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" -version = "34.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +version = "36.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-support", "frame-system", @@ -9355,8 +10120,8 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-benchmarking" -version = "35.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +version = "37.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -9375,8 +10140,8 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-runtime-api" -version = "32.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +version = "34.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "pallet-nomination-pools", "parity-scale-codec", @@ -9386,7 +10151,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "36.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-support", "frame-system", @@ -9402,7 +10167,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -9425,7 +10190,7 @@ dependencies = [ [[package]] name = "pallet-parameters" version = "0.8.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "docify", "frame-benchmarking", @@ -9442,7 +10207,7 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-benchmarking", "frame-support", @@ -9485,7 +10250,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-benchmarking", "frame-support", @@ -9499,7 +10264,7 @@ dependencies = [ [[package]] name = "pallet-ranked-collective" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-benchmarking", "frame-support", @@ -9517,7 +10282,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-benchmarking", "frame-support", @@ -9531,7 +10296,7 @@ dependencies = [ [[package]] name = "pallet-referenda" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "assert_matches", "frame-benchmarking", @@ -9549,7 +10314,7 @@ dependencies = [ [[package]] name = "pallet-root-testing" version = "13.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-support", "frame-system", @@ -9563,7 +10328,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "docify", "frame-benchmarking", @@ -9580,7 +10345,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-support", "frame-system", @@ -9601,7 +10366,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-benchmarking", "frame-support", @@ -9617,7 +10382,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-benchmarking", "frame-support", @@ -9634,7 +10399,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -9656,18 +10421,18 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "12.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "pallet-staking-reward-fn" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "log", "sp-arithmetic", @@ -9676,7 +10441,7 @@ dependencies = [ [[package]] name = "pallet-staking-runtime-api" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "parity-scale-codec", "sp-api", @@ -9686,7 +10451,7 @@ dependencies = [ [[package]] name = "pallet-state-trie-migration" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-benchmarking", "frame-support", @@ -9702,7 +10467,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "docify", "frame-benchmarking", @@ -9717,7 +10482,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "36.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "docify", "frame-benchmarking", @@ -9736,7 +10501,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "36.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-benchmarking", "frame-support", @@ -9751,6 +10516,30 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "pallet-token-gateway" +version = "1.15.1" +dependencies = [ + "alloy-primitives", + "alloy-sol-macro", + "alloy-sol-types", + "anyhow", + "bifrost-primitives", + "frame-support", + "frame-system", + "ismp", + "log", + "pallet-hyperbridge", + "pallet-ismp", + "parity-scale-codec", + "primitive-types", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "token-gateway-primitives", +] + [[package]] name = "pallet-traits" version = "0.8.0" @@ -9776,8 +10565,8 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" -version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +version = "37.0.1" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-support", "frame-system", @@ -9792,7 +10581,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -9808,7 +10597,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -9820,7 +10609,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "36.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "docify", "frame-benchmarking", @@ -9838,7 +10627,7 @@ dependencies = [ [[package]] name = "pallet-tx-pause" version = "18.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "docify", "frame-benchmarking", @@ -9855,7 +10644,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "37.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-benchmarking", "frame-support", @@ -9870,7 +10659,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-benchmarking", "frame-support", @@ -9884,7 +10673,7 @@ dependencies = [ [[package]] name = "pallet-whitelist" version = "36.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-benchmarking", "frame-support", @@ -9898,7 +10687,7 @@ dependencies = [ [[package]] name = "pallet-xcm" version = "16.0.2" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "bounded-collections", "frame-benchmarking", @@ -9922,7 +10711,7 @@ dependencies = [ [[package]] name = "pallet-xcm-benchmarks" version = "16.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-benchmarking", "frame-support", @@ -9940,7 +10729,7 @@ dependencies = [ [[package]] name = "parachains-common" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "cumulus-primitives-core", "cumulus-primitives-utility", @@ -9973,7 +10762,7 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e69bf016dc406eff7d53a7d3f7cf1c2e72c82b9088aac1118591e36dd2cd3e9" dependencies = [ - "bitcoin_hashes 0.13.0", + "bitcoin_hashes", "rand", "rand_core", "serde", @@ -10007,7 +10796,7 @@ version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" dependencies = [ - "arrayvec 0.7.4", + "arrayvec 0.7.6", "bitvec", "byte-slice-cast", "bytes", @@ -10022,7 +10811,7 @@ version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", "syn 1.0.109", @@ -10036,9 +10825,9 @@ checksum = "e1ad0aff30c1da14b1254fcb2af73e1fa9a28670e584a626f53a369d0e157304" [[package]] name = "parking" -version = "2.1.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" [[package]] name = "parking_lot" @@ -10058,7 +10847,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", - "parking_lot_core 0.9.8", + "parking_lot_core 0.9.10", ] [[package]] @@ -10077,15 +10866,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.8" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.3.5", + "redox_syscall 0.5.8", "smallvec", - "windows-targets 0.48.5", + "windows-targets 0.52.6", ] [[package]] @@ -10102,7 +10891,7 @@ checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166" dependencies = [ "base64ct", "rand_core", - "subtle 2.5.0", + "subtle 2.6.1", ] [[package]] @@ -10144,19 +10933,20 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.2" +version = "2.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1acb4a4365a13f749a93f1a094a7805e5cfa0955373a9de860d962eaa3a5fe5a" +checksum = "8b7cafe60d6cf8e62e1b9b2ea516a089c008945bb5a275416789e7db0bc199dc" dependencies = [ - "thiserror", + "memchr", + "thiserror 2.0.11", "ucd-trie", ] [[package]] name = "pest_derive" -version = "2.7.2" +version = "2.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "666d00490d4ac815001da55838c500eafb0320019bbaa44444137c48b443a853" +checksum = "816518421cfc6887a0d62bf441b6ffb4536fcc926395a69e1a85852d4363f57e" dependencies = [ "pest", "pest_generator", @@ -10164,22 +10954,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.2" +version = "2.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68ca01446f50dbda87c1786af8770d535423fa8a53aec03b8f4e3d7eb10e0929" +checksum = "7d1396fd3a870fc7838768d171b4616d5c91f6cc25e377b673d714567d99377b" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "pest_meta" -version = "2.7.2" +version = "2.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56af0a30af74d0445c0bf6d9d051c979b516a1a5af790d251daee76005420a48" +checksum = "e1e58089ea25d717bfd31fb534e4f3afcc2cc569c70de3e239778991ea3b7dea" dependencies = [ "once_cell", "pest", @@ -10188,39 +10978,39 @@ dependencies = [ [[package]] name = "petgraph" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 2.2.3", + "indexmap 2.7.0", ] [[package]] name = "pin-project" -version = "1.1.3" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" +checksum = "1e2ec53ad785f4d35dac0adea7f7dc6f1bb277ad84a680c7afefeae05d1f5916" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.3" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" +checksum = "d56a66c0c55993aa927429d0f8a0abfd74f084e4d9c192cffed01e418d83eefb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "pin-project-lite" -version = "0.2.14" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "pin-utils" @@ -10228,6 +11018,17 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "piper" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066" +dependencies = [ + "atomic-waker", + "fastrand 2.3.0", + "futures-io", +] + [[package]] name = "pkcs8" version = "0.10.2" @@ -10240,14 +11041,14 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.27" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "polkadot-approval-distribution" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "bitvec", "futures 0.3.31", @@ -10267,7 +11068,7 @@ dependencies = [ [[package]] name = "polkadot-availability-bitfield-distribution" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "always-assert", "futures 0.3.31", @@ -10283,7 +11084,7 @@ dependencies = [ [[package]] name = "polkadot-availability-distribution" version = "17.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "derive_more 0.99.18", "fatality", @@ -10300,14 +11101,14 @@ dependencies = [ "schnellru", "sp-core", "sp-keystore", - "thiserror", + "thiserror 1.0.69", "tracing-gum", ] [[package]] name = "polkadot-availability-recovery" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "async-trait", "fatality", @@ -10322,7 +11123,7 @@ dependencies = [ "rand", "sc-network", "schnellru", - "thiserror", + "thiserror 1.0.69", "tokio", "tracing-gum", ] @@ -10339,8 +11140,8 @@ dependencies = [ [[package]] name = "polkadot-cli" -version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +version = "18.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "cfg-if", "clap", @@ -10362,13 +11163,13 @@ dependencies = [ "sp-maybe-compressed-blob", "sp-runtime", "substrate-build-script-utils", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "polkadot-collator-protocol" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "bitvec", "fatality", @@ -10382,7 +11183,7 @@ dependencies = [ "sp-core", "sp-keystore", "sp-runtime", - "thiserror", + "thiserror 1.0.69", "tokio-util", "tracing-gum", ] @@ -10390,7 +11191,7 @@ dependencies = [ [[package]] name = "polkadot-core-primitives" version = "15.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "parity-scale-codec", "scale-info", @@ -10401,13 +11202,13 @@ dependencies = [ [[package]] name = "polkadot-dispute-distribution" version = "17.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "derive_more 0.99.18", "fatality", "futures 0.3.31", "futures-timer", - "indexmap 2.2.3", + "indexmap 2.7.0", "parity-scale-codec", "polkadot-erasure-coding", "polkadot-node-network-protocol", @@ -10419,14 +11220,14 @@ dependencies = [ "schnellru", "sp-application-crypto", "sp-keystore", - "thiserror", + "thiserror 1.0.69", "tracing-gum", ] [[package]] name = "polkadot-erasure-coding" version = "15.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "parity-scale-codec", "polkadot-node-primitives", @@ -10434,13 +11235,13 @@ dependencies = [ "reed-solomon-novelpoly", "sp-core", "sp-trie", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "polkadot-gossip-support" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "futures 0.3.31", "futures-timer", @@ -10462,7 +11263,7 @@ dependencies = [ [[package]] name = "polkadot-network-bridge" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "always-assert", "async-trait", @@ -10478,14 +11279,14 @@ dependencies = [ "polkadot-primitives", "sc-network", "sp-consensus", - "thiserror", + "thiserror 1.0.69", "tracing-gum", ] [[package]] name = "polkadot-node-collation-generation" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "futures 0.3.31", "parity-scale-codec", @@ -10496,14 +11297,14 @@ dependencies = [ "polkadot-primitives", "sp-core", "sp-maybe-compressed-blob", - "thiserror", + "thiserror 1.0.69", "tracing-gum", ] [[package]] name = "polkadot-node-core-approval-voting" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "bitvec", "derive_more 0.99.18", @@ -10529,14 +11330,14 @@ dependencies = [ "sp-consensus", "sp-consensus-slots", "sp-runtime", - "thiserror", + "thiserror 1.0.69", "tracing-gum", ] [[package]] name = "polkadot-node-core-av-store" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "bitvec", "futures 0.3.31", @@ -10551,14 +11352,14 @@ dependencies = [ "polkadot-overseer", "polkadot-primitives", "sp-consensus", - "thiserror", + "thiserror 1.0.69", "tracing-gum", ] [[package]] name = "polkadot-node-core-backing" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "bitvec", "fatality", @@ -10571,21 +11372,21 @@ dependencies = [ "polkadot-statement-table", "schnellru", "sp-keystore", - "thiserror", + "thiserror 1.0.69", "tracing-gum", ] [[package]] name = "polkadot-node-core-bitfield-signing" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "futures 0.3.31", "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", "sp-keystore", - "thiserror", + "thiserror 1.0.69", "tracing-gum", "wasm-timer", ] @@ -10593,7 +11394,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-candidate-validation" version = "17.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "async-trait", "futures 0.3.31", @@ -10616,7 +11417,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-api" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "futures 0.3.31", "polkadot-node-metrics", @@ -10630,7 +11431,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-selection" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "futures 0.3.31", "futures-timer", @@ -10640,14 +11441,14 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", - "thiserror", + "thiserror 1.0.69", "tracing-gum", ] [[package]] name = "polkadot-node-core-dispute-coordinator" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "fatality", "futures 0.3.31", @@ -10659,14 +11460,14 @@ dependencies = [ "polkadot-primitives", "sc-keystore", "schnellru", - "thiserror", + "thiserror 1.0.69", "tracing-gum", ] [[package]] name = "polkadot-node-core-parachains-inherent" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "async-trait", "futures 0.3.31", @@ -10676,28 +11477,28 @@ dependencies = [ "polkadot-primitives", "sp-blockchain", "sp-inherents", - "thiserror", + "thiserror 1.0.69", "tracing-gum", ] [[package]] name = "polkadot-node-core-prospective-parachains" -version = "16.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +version = "16.1.1" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "fatality", "futures 0.3.31", "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", - "thiserror", + "thiserror 1.0.69", "tracing-gum", ] [[package]] name = "polkadot-node-core-provisioner" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "bitvec", "fatality", @@ -10708,14 +11509,14 @@ dependencies = [ "polkadot-node-subsystem-util", "polkadot-primitives", "schnellru", - "thiserror", + "thiserror 1.0.69", "tracing-gum", ] [[package]] name = "polkadot-node-core-pvf" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "always-assert", "array-bytes", @@ -10736,7 +11537,7 @@ dependencies = [ "slotmap", "sp-core", "tempfile", - "thiserror", + "thiserror 1.0.69", "tokio", "tracing-gum", ] @@ -10744,7 +11545,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-checker" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "futures 0.3.31", "polkadot-node-primitives", @@ -10753,14 +11554,14 @@ dependencies = [ "polkadot-overseer", "polkadot-primitives", "sp-keystore", - "thiserror", + "thiserror 1.0.69", "tracing-gum", ] [[package]] name = "polkadot-node-core-pvf-common" version = "15.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "cpu-time", "futures 0.3.31", @@ -10779,14 +11580,14 @@ dependencies = [ "sp-externalities", "sp-io", "sp-tracing", - "thiserror", + "thiserror 1.0.69", "tracing-gum", ] [[package]] name = "polkadot-node-core-runtime-api" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "futures 0.3.31", "polkadot-node-metrics", @@ -10801,7 +11602,7 @@ dependencies = [ [[package]] name = "polkadot-node-jaeger" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "lazy_static", "log", @@ -10813,16 +11614,16 @@ dependencies = [ "sc-network", "sc-network-types", "sp-core", - "thiserror", + "thiserror 1.0.69", "tokio", ] [[package]] name = "polkadot-node-metrics" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ - "bs58 0.5.0", + "bs58 0.5.1", "futures 0.3.31", "futures-timer", "log", @@ -10839,9 +11640,9 @@ dependencies = [ [[package]] name = "polkadot-node-network-protocol" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ - "async-channel", + "async-channel 1.9.0", "async-trait", "bitvec", "derive_more 0.99.18", @@ -10858,14 +11659,14 @@ dependencies = [ "sc-network-types", "sp-runtime", "strum 0.26.3", - "thiserror", + "thiserror 1.0.69", "tracing-gum", ] [[package]] name = "polkadot-node-primitives" version = "15.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "bitvec", "bounded-vec", @@ -10881,14 +11682,14 @@ dependencies = [ "sp-keystore", "sp-maybe-compressed-blob", "sp-runtime", - "thiserror", + "thiserror 1.0.69", "zstd 0.12.4", ] [[package]] name = "polkadot-node-subsystem" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "polkadot-node-jaeger", "polkadot-node-subsystem-types", @@ -10898,7 +11699,7 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-types" version = "17.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "async-trait", "bitvec", @@ -10922,13 +11723,13 @@ dependencies = [ "sp-consensus-babe", "sp-runtime", "substrate-prometheus-endpoint", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "polkadot-node-subsystem-util" version = "17.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "async-trait", "derive_more 0.99.18", @@ -10957,14 +11758,14 @@ dependencies = [ "sp-application-crypto", "sp-core", "sp-keystore", - "thiserror", + "thiserror 1.0.69", "tracing-gum", ] [[package]] name = "polkadot-overseer" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "async-trait", "futures 0.3.31", @@ -10986,7 +11787,7 @@ dependencies = [ [[package]] name = "polkadot-parachain-primitives" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "bounded-collections", "derive_more 0.99.18", @@ -11002,7 +11803,7 @@ dependencies = [ [[package]] name = "polkadot-primitives" version = "15.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "bitvec", "hex-literal 0.4.1", @@ -11028,7 +11829,7 @@ dependencies = [ [[package]] name = "polkadot-rpc" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "jsonrpsee", "mmr-rpc", @@ -11063,7 +11864,7 @@ dependencies = [ [[package]] name = "polkadot-runtime-common" version = "16.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "bitvec", "frame-benchmarking", @@ -11113,9 +11914,9 @@ dependencies = [ [[package]] name = "polkadot-runtime-metrics" version = "16.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ - "bs58 0.5.0", + "bs58 0.5.1", "frame-benchmarking", "parity-scale-codec", "polkadot-primitives", @@ -11124,8 +11925,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-parachains" -version = "16.0.2" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +version = "16.0.3" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "bitflags 1.3.2", "bitvec", @@ -11171,8 +11972,8 @@ dependencies = [ [[package]] name = "polkadot-service" -version = "17.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +version = "18.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "async-trait", "frame-benchmarking", @@ -11281,7 +12082,7 @@ dependencies = [ "sp-weights", "staging-xcm", "substrate-prometheus-endpoint", - "thiserror", + "thiserror 1.0.69", "tracing-gum", "westend-runtime", "xcm-runtime-apis", @@ -11290,14 +12091,14 @@ dependencies = [ [[package]] name = "polkadot-statement-distribution" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ - "arrayvec 0.7.4", + "arrayvec 0.7.6", "bitvec", "fatality", "futures 0.3.31", "futures-timer", - "indexmap 2.2.3", + "indexmap 2.7.0", "parity-scale-codec", "polkadot-node-network-protocol", "polkadot-node-primitives", @@ -11306,14 +12107,14 @@ dependencies = [ "polkadot-primitives", "sp-keystore", "sp-staking", - "thiserror", + "thiserror 1.0.69", "tracing-gum", ] [[package]] name = "polkadot-statement-table" version = "15.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "parity-scale-codec", "polkadot-primitives", @@ -11370,7 +12171,7 @@ dependencies = [ "polkavm-common", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -11380,7 +12181,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ba81f7b5faac81e528eb6158a6f3c9e0bb1008e0ffa19653bc8dea925ecb429" dependencies = [ "polkavm-derive-impl", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -11389,8 +12190,8 @@ version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c7be503e60cf56c0eb785f90aaba4b583b36bff00e93997d93fef97f9553c39" dependencies = [ - "gimli 0.28.0", - "hashbrown 0.14.3", + "gimli 0.28.1", + "hashbrown 0.14.5", "log", "object 0.32.2", "polkavm-common", @@ -11422,16 +12223,17 @@ dependencies = [ [[package]] name = "polling" -version = "3.4.0" +version = "3.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30054e72317ab98eddd8561db0f6524df3367636884b7b21b703e4b280a84a14" +checksum = "a604568c3202727d1507653cb121dbd627a58684eb09a820fd746bee38b4442f" dependencies = [ "cfg-if", "concurrent-queue", + "hermit-abi 0.4.0", "pin-project-lite", - "rustix 0.38.21", + "rustix 0.38.43", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -11441,22 +12243,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" dependencies = [ "cpufeatures", - "opaque-debug 0.3.0", + "opaque-debug 0.3.1", "universal-hash", ] [[package]] name = "polyval" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52cff9d1d4dee5fe6d03729099f4a310a41179e0a10dbf542039873f2e826fb" +checksum = "9d1fe60d06143b2430aa532c94cfe9e29783047f06c0d7fd359a9a51b729fa25" dependencies = [ "cfg-if", "cpufeatures", - "opaque-debug 0.3.0", + "opaque-debug 0.3.1", "universal-hash", ] +[[package]] +name = "portable-atomic" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6" + [[package]] name = "powerfmt" version = "0.2.0" @@ -11465,9 +12273,12 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] [[package]] name = "precompile-utils" @@ -11505,7 +12316,7 @@ source = "git+https://github.com/bifrost-io/frontier?branch=release-polkadot-sta dependencies = [ "case", "num_enum", - "prettyplease 0.2.25", + "prettyplease 0.2.29", "proc-macro2", "quote", "sp-crypto-hashing", @@ -11528,26 +12339,25 @@ dependencies = [ [[package]] name = "predicates" -version = "3.0.3" +version = "3.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09963355b9f467184c04017ced4a2ba2d75cbcb4e7462690d388233253d4b1a9" +checksum = "a5d19ee57562043d37e82899fade9a22ebab7be9cef5026b07fda9cdd4293573" dependencies = [ "anstyle", - "itertools 0.10.5", "predicates-core", ] [[package]] name = "predicates-core" -version = "1.0.6" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b794032607612e7abeb4db69adb4e33590fa6cf1149e95fd7cb00e634b92f174" +checksum = "727e462b119fe9c93fd0eb1429a5f7647394014cf3c04ab2c0350eeb09095ffa" [[package]] name = "predicates-tree" -version = "1.0.9" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368ba315fb8c5052ab692e68a0eefec6ec57b23a36959c14496f0b0df2c0cecf" +checksum = "72dd2d6d381dfb73a193c7fca536518d7caee39fc8503f74e7dc0be0531b425c" dependencies = [ "predicates-core", "termtree", @@ -11565,12 +12375,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.25" +version = "0.2.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" +checksum = "6924ced06e1f7dfe3fa48d57b9f74f55d8915f5036121bef647ef4b204895fac" dependencies = [ "proc-macro2", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -11599,27 +12409,27 @@ dependencies = [ "futures 0.3.31", "futures-timer", "nanorand", - "thiserror", + "thiserror 1.0.69", "tracing", ] [[package]] name = "proc-macro-crate" -version = "1.3.1" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" dependencies = [ - "once_cell", - "toml_edit 0.19.15", + "thiserror 1.0.69", + "toml 0.5.11", ] [[package]] name = "proc-macro-crate" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" dependencies = [ - "toml_edit 0.21.0", + "toml_edit", ] [[package]] @@ -11646,12 +12456,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "proc-macro-hack" -version = "0.5.20+deprecated" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" - [[package]] name = "proc-macro-warning" version = "0.4.2" @@ -11660,25 +12464,25 @@ checksum = "3d1eaa7fa0aa1929ffdf7eeb6eac234dde6268914a14ad44d23521ab6a9b258e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "proc-macro-warning" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b698b0b09d40e9b7c1a47b132d66a8b54bcd20583d9b6d06e4535e383b4405c" +checksum = "834da187cfe638ae8abb0203f0b33e5ccdb02a28e7199f2f47b3e2754f50edca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "proc-macro2" -version = "1.0.92" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" dependencies = [ "unicode-ident", ] @@ -11694,7 +12498,7 @@ dependencies = [ "lazy_static", "memchr", "parking_lot 0.12.3", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -11717,7 +12521,27 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", +] + +[[package]] +name = "proptest" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" +dependencies = [ + "bit-set", + "bit-vec", + "bitflags 2.7.0", + "lazy_static", + "num-traits", + "rand", + "rand_chacha", + "rand_xorshift", + "regex-syntax 0.8.5", + "rusty-fork", + "tempfile", + "unarray", ] [[package]] @@ -11751,7 +12575,7 @@ dependencies = [ "itertools 0.10.5", "lazy_static", "log", - "multimap", + "multimap 0.8.3", "petgraph", "prettyplease 0.1.25", "prost 0.11.9", @@ -11764,22 +12588,22 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.12.4" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80b776a1b2dc779f5ee0641f8ade0125bc1298dd41a9a0c16d8bd57b42d222b1" +checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4" dependencies = [ "bytes", "heck 0.5.0", - "itertools 0.11.0", + "itertools 0.12.1", "log", - "multimap", + "multimap 0.10.0", "once_cell", "petgraph", - "prettyplease 0.2.25", + "prettyplease 0.2.29", "prost 0.12.6", - "prost-types 0.12.4", + "prost-types 0.12.6", "regex", - "syn 2.0.90", + "syn 2.0.96", "tempfile", ] @@ -11803,10 +12627,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" dependencies = [ "anyhow", - "itertools 0.11.0", + "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -11820,31 +12644,30 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.12.4" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3235c33eb02c1f1e212abdbe34c78b264b038fb58ca612664343271e36e55ffe" +checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" dependencies = [ "prost 0.12.6", ] [[package]] name = "psm" -version = "0.1.21" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" +checksum = "200b9ff220857e53e184257720a14553b2f4aa02577d2ed9842d45d4b9654810" dependencies = [ "cc", ] [[package]] name = "quanta" -version = "0.11.1" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17e662a7a8291a865152364c20c7abc5e60486ab2001e8ec10b24862de0b9ab" +checksum = "3bd1fe6824cea6538803de3ff1bc0cf3949024db3d43c9643024bfb33a807c0e" dependencies = [ "crossbeam-utils", "libc", - "mach2", "once_cell", "raw-cpuid", "wasi", @@ -11876,7 +12699,7 @@ dependencies = [ "asynchronous-codec", "bytes", "quick-protobuf", - "thiserror", + "thiserror 1.0.69", "unsigned-varint 0.7.2", ] @@ -11892,7 +12715,7 @@ dependencies = [ "quinn-udp 0.3.2", "rustc-hash", "rustls 0.20.9", - "thiserror", + "thiserror 1.0.69", "tokio", "tracing", "webpki", @@ -11910,8 +12733,8 @@ dependencies = [ "quinn-proto 0.10.6", "quinn-udp 0.4.1", "rustc-hash", - "rustls 0.21.7", - "thiserror", + "rustls 0.21.12", + "thiserror 1.0.69", "tokio", "tracing", ] @@ -11928,7 +12751,7 @@ dependencies = [ "rustc-hash", "rustls 0.20.9", "slab", - "thiserror", + "thiserror 1.0.69", "tinyvec", "tracing", "webpki", @@ -11944,9 +12767,9 @@ dependencies = [ "rand", "ring 0.16.20", "rustc-hash", - "rustls 0.21.7", + "rustls 0.21.12", "slab", - "thiserror", + "thiserror 1.0.69", "tinyvec", "tracing", ] @@ -11959,7 +12782,7 @@ checksum = "641538578b21f5e5c8ea733b736895576d0fe329bb883b937db6f4d163dbaaf4" dependencies = [ "libc", "quinn-proto 0.9.6", - "socket2 0.4.9", + "socket2 0.4.10", "tracing", "windows-sys 0.42.0", ] @@ -11972,16 +12795,16 @@ checksum = "055b4e778e8feb9f93c4e439f71dc2156ef13360b432b799e179a8c4cdf0b1d7" dependencies = [ "bytes", "libc", - "socket2 0.5.7", + "socket2 0.5.8", "tracing", "windows-sys 0.48.0", ] [[package]] name = "quote" -version = "1.0.35" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" dependencies = [ "proc-macro2", ] @@ -12041,13 +12864,22 @@ dependencies = [ "rand_core", ] +[[package]] +name = "rand_xorshift" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" +dependencies = [ + "rand_core", +] + [[package]] name = "raw-cpuid" -version = "10.7.0" +version = "11.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c297679cb867470fa8c9f67dbba74a78d78e3e98d7cf2b08d6d71540f797332" +checksum = "1ab240315c661615f2ee9f0f2cd32d5a7343a84d5ebcccb99d46e6637565e7b0" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.7.0", ] [[package]] @@ -12099,31 +12931,22 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.7.0", ] [[package]] name = "redox_users" -version = "0.4.3" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom", - "redox_syscall 0.2.16", - "thiserror", + "libredox", + "thiserror 1.0.69", ] [[package]] @@ -12135,27 +12958,27 @@ dependencies = [ "derive_more 0.99.18", "fs-err", "static_init", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "ref-cast" -version = "1.0.20" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acde58d073e9c79da00f2b5b84eed919c8326832648a5b109b3fce1bb1175280" +checksum = "ccf0a6f84d5f1d581da8b41b47ec8600871962f2a528115b542b362d4b744931" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.20" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f7473c2cfcf90008193dd0e3e16599455cb601a9fce322b5bb55de799664925" +checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -12185,14 +13008,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.2" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.3", - "regex-syntax 0.8.2", + "regex-automata 0.4.9", + "regex-syntax 0.8.5", ] [[package]] @@ -12206,19 +13029,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed1ceff11a1dddaee50c9dc8e4938bd106e9d89ae372f192311e7da498e3b69" - -[[package]] -name = "regex-automata" -version = "0.4.3" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.2", + "regex-syntax 0.8.5", ] [[package]] @@ -12229,9 +13046,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "resolv-conf" @@ -12250,7 +13067,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" dependencies = [ "hmac 0.12.1", - "subtle 2.5.0", + "subtle 2.6.1", ] [[package]] @@ -12270,16 +13087,17 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.7" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", + "cfg-if", "getrandom", "libc", "spin 0.9.8", "untrusted 0.9.0", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -12326,7 +13144,7 @@ dependencies = [ [[package]] name = "rococo-runtime" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "binary-merkle-tree", "bitvec", @@ -12426,7 +13244,7 @@ dependencies = [ [[package]] name = "rococo-runtime-constants" version = "16.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-support", "polkadot-primitives", @@ -12447,45 +13265,80 @@ checksum = "afab94fb28594581f62d981211a9a4d53cc8130bbcbbb89a0440d9b8e81a7746" [[package]] name = "rpassword" -version = "7.2.0" +version = "7.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6678cf63ab3491898c0d021b493c94c9b221d91295294a2a5746eacbe5928322" +checksum = "80472be3c897911d0137b2d2b9055faf6eeac5b14e324073d83bc17b191d7e3f" dependencies = [ "libc", "rtoolbox", - "winapi", + "windows-sys 0.48.0", ] [[package]] name = "rtnetlink" -version = "0.10.1" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322c53fd76a18698f1c27381d58091de3a043d356aa5bd0d510608b565f469a0" +checksum = "7a552eb82d19f38c3beed3f786bd23aa434ceb9ac43ab44419ca6d67a7e186c0" dependencies = [ "futures 0.3.31", "log", + "netlink-packet-core", "netlink-packet-route", + "netlink-packet-utils", "netlink-proto", - "nix 0.24.3", - "thiserror", + "netlink-sys", + "nix 0.26.4", + "thiserror 1.0.69", "tokio", ] [[package]] name = "rtoolbox" -version = "0.0.1" +version = "0.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "034e22c514f5c0cb8a10ff341b9b048b5ceb21591f31c8f44c43b960f9b3524a" +checksum = "c247d24e63230cdb56463ae328478bd5eac8b8faa8c69461a77e8e323afac90e" dependencies = [ "libc", - "winapi", + "windows-sys 0.48.0", +] + +[[package]] +name = "ruint" +version = "1.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5ef8fb1dd8de3870cb8400d51b4c2023854bbafd5431a3ac7e7317243e22d2f" +dependencies = [ + "alloy-rlp", + "ark-ff 0.3.0", + "ark-ff 0.4.2", + "bytes", + "fastrlp 0.3.1", + "fastrlp 0.4.0", + "num-bigint", + "num-integer", + "num-traits", + "parity-scale-codec", + "primitive-types", + "proptest", + "rand", + "rlp", + "ruint-macro", + "serde", + "valuable", + "zeroize", ] +[[package]] +name = "ruint-macro" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" + [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" @@ -12501,11 +13354,20 @@ checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" [[package]] name = "rustc_version" -version = "0.4.0" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +dependencies = [ + "semver 0.11.0", +] + +[[package]] +name = "rustc_version" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver 1.0.18", + "semver 1.0.24", ] [[package]] @@ -12533,9 +13395,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.23" +version = "0.37.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" +checksum = "519165d378b97752ca44bbe15047d5d3409e875f39327546b42ac81d7e18c1b6" dependencies = [ "bitflags 1.3.2", "errno", @@ -12547,15 +13409,15 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.21" +version = "0.38.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b426b0506e5d50a7d8dafcf2e81471400deb602392c7dd110815afb4eaf02a3" +checksum = "a78891ee6bf2340288408954ac787aa063d8e8817e9f53abb37c695c6d834ef6" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "errno", "libc", - "linux-raw-sys 0.4.10", - "windows-sys 0.48.0", + "linux-raw-sys 0.4.15", + "windows-sys 0.59.0", ] [[package]] @@ -12571,28 +13433,28 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.7" +version = "0.21.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", - "ring 0.16.20", - "rustls-webpki 0.101.4", + "ring 0.17.8", + "rustls-webpki 0.101.7", "sct", ] [[package]] name = "rustls" -version = "0.23.10" +version = "0.23.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05cff451f60db80f490f3c182b77c35260baace73209e9cdbbe526bfe3a4d402" +checksum = "8f287924602bf649d949c63dc8ac8b235fa5387d394020705b80c4eb597ce5b8" dependencies = [ "log", "once_cell", - "ring 0.17.7", + "ring 0.17.8", "rustls-pki-types", - "rustls-webpki 0.102.4", - "subtle 2.5.0", + "rustls-webpki 0.102.8", + "subtle 2.6.1", "zeroize", ] @@ -12603,19 +13465,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", - "rustls-pemfile 1.0.3", + "rustls-pemfile 1.0.4", "schannel", "security-framework", ] [[package]] name = "rustls-native-certs" -version = "0.7.0" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f1fb85efa936c42c6d5fc28d2629bb51e4b2f4b8a5211e297d599cc5a093792" +checksum = "e5bfb394eeed242e909609f56089eecfe5fda225042e8b171791b9c95f5931e5" dependencies = [ "openssl-probe", - "rustls-pemfile 2.0.0", + "rustls-pemfile 2.2.0", "rustls-pki-types", "schannel", "security-framework", @@ -12623,82 +13485,93 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ - "base64 0.21.2", + "base64 0.21.7", ] [[package]] name = "rustls-pemfile" -version = "2.0.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35e4980fa29e4c4b212ffb3db068a564cbf560e51d3944b7c88bd8bf5bec64f4" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" dependencies = [ - "base64 0.21.2", "rustls-pki-types", ] [[package]] name = "rustls-pki-types" -version = "1.7.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" +checksum = "d2bf47e6ff922db3825eb750c4e2ff784c6ff8fb9e13046ef6a1d1c5401b0b37" [[package]] name = "rustls-platform-verifier" -version = "0.3.1" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5f0d26fa1ce3c790f9590868f0109289a044acb954525f933e2aa3b871c157d" +checksum = "afbb878bdfdf63a336a5e63561b1835e7a8c91524f51621db870169eac84b490" dependencies = [ "core-foundation", "core-foundation-sys", "jni", "log", "once_cell", - "rustls 0.23.10", - "rustls-native-certs 0.7.0", + "rustls 0.23.21", + "rustls-native-certs 0.7.3", "rustls-platform-verifier-android", - "rustls-webpki 0.102.4", + "rustls-webpki 0.102.8", "security-framework", "security-framework-sys", - "webpki-roots 0.26.3", + "webpki-roots 0.26.7", "winapi", ] [[package]] name = "rustls-platform-verifier-android" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84e217e7fdc8466b5b35d30f8c0a30febd29173df4a3a0c2115d306b9c4117ad" +checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f" [[package]] name = "rustls-webpki" -version = "0.101.4" +version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d93931baf2d282fff8d3a532bbfd7653f734643161b87e3e01e59a04439bf0d" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring 0.16.20", - "untrusted 0.7.1", + "ring 0.17.8", + "untrusted 0.9.0", ] [[package]] name = "rustls-webpki" -version = "0.102.4" +version = "0.102.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" dependencies = [ - "ring 0.17.7", + "ring 0.17.8", "rustls-pki-types", "untrusted 0.9.0", ] [[package]] name = "rustversion" -version = "1.0.14" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" + +[[package]] +name = "rusty-fork" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" +dependencies = [ + "fnv", + "quick-error", + "tempfile", + "wait-timeout", +] [[package]] name = "ruzstd" @@ -12724,15 +13597,15 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "safe_arch" -version = "0.7.1" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f398075ce1e6a179b46f51bd88d0598b92b00d3551f1a2d4ac49e771b56ac354" +checksum = "96b02de82ddbe1b636e6170c21be622223aea188ef2e139be0a5b219ec215323" dependencies = [ "bytemuck", ] @@ -12749,18 +13622,18 @@ dependencies = [ [[package]] name = "sc-allocator" version = "29.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "log", "sp-core", "sp-wasm-interface", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "sc-authority-discovery" version = "0.44.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "async-trait", "futures 0.3.31", @@ -12769,10 +13642,10 @@ dependencies = [ "libp2p", "linked_hash_set", "log", - "multihash 0.19.1", + "multihash 0.19.3", "parity-scale-codec", "prost 0.12.6", - "prost-build 0.12.4", + "prost-build 0.12.6", "rand", "sc-client-api", "sc-network", @@ -12784,13 +13657,13 @@ dependencies = [ "sp-keystore", "sp-runtime", "substrate-prometheus-endpoint", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "sc-basic-authorship" version = "0.44.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "futures 0.3.31", "futures-timer", @@ -12812,7 +13685,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.42.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "parity-scale-codec", "sp-api", @@ -12827,12 +13700,12 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "array-bytes", "docify", "log", - "memmap2 0.9.3", + "memmap2 0.9.5", "parity-scale-codec", "sc-chain-spec-derive", "sc-client-api", @@ -12854,18 +13727,18 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "12.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "sc-cli" version = "0.46.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "array-bytes", "chrono", @@ -12899,14 +13772,14 @@ dependencies = [ "sp-panic-handler", "sp-runtime", "sp-version", - "thiserror", + "thiserror 1.0.69", "tokio", ] [[package]] name = "sc-client-api" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "fnv", "futures 0.3.31", @@ -12933,9 +13806,9 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.44.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ - "hash-db 0.16.0", + "hash-db", "kvdb", "kvdb-memorydb", "kvdb-rocksdb", @@ -12959,7 +13832,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.43.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "async-trait", "futures 0.3.31", @@ -12977,13 +13850,13 @@ dependencies = [ "sp-runtime", "sp-state-machine", "substrate-prometheus-endpoint", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "sc-consensus-aura" version = "0.44.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "async-trait", "futures 0.3.31", @@ -13006,13 +13879,13 @@ dependencies = [ "sp-keystore", "sp-runtime", "substrate-prometheus-endpoint", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "sc-consensus-babe" version = "0.44.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "async-trait", "fork-tree", @@ -13042,13 +13915,13 @@ dependencies = [ "sp-keystore", "sp-runtime", "substrate-prometheus-endpoint", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "sc-consensus-babe-rpc" version = "0.44.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "futures 0.3.31", "jsonrpsee", @@ -13064,16 +13937,16 @@ dependencies = [ "sp-core", "sp-keystore", "sp-runtime", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "sc-consensus-beefy" version = "23.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "array-bytes", - "async-channel", + "async-channel 1.9.0", "async-trait", "fnv", "futures 0.3.31", @@ -13098,7 +13971,7 @@ dependencies = [ "sp-keystore", "sp-runtime", "substrate-prometheus-endpoint", - "thiserror", + "thiserror 1.0.69", "tokio", "wasm-timer", ] @@ -13106,7 +13979,7 @@ dependencies = [ [[package]] name = "sc-consensus-beefy-rpc" version = "23.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "futures 0.3.31", "jsonrpsee", @@ -13120,13 +13993,13 @@ dependencies = [ "sp-consensus-beefy", "sp-core", "sp-runtime", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "sc-consensus-epochs" version = "0.43.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "fork-tree", "parity-scale-codec", @@ -13139,7 +14012,7 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa" version = "0.29.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "ahash", "array-bytes", @@ -13177,13 +14050,13 @@ dependencies = [ "sp-keystore", "sp-runtime", "substrate-prometheus-endpoint", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "sc-consensus-grandpa-rpc" version = "0.29.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "finality-grandpa", "futures 0.3.31", @@ -13197,13 +14070,13 @@ dependencies = [ "sp-blockchain", "sp-core", "sp-runtime", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "sc-consensus-manual-seal" version = "0.45.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "assert_matches", "async-trait", @@ -13232,13 +14105,13 @@ dependencies = [ "sp-runtime", "sp-timestamp", "substrate-prometheus-endpoint", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "sc-consensus-slots" version = "0.43.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "async-trait", "futures 0.3.31", @@ -13261,7 +14134,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.40.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "parity-scale-codec", "parking_lot 0.12.3", @@ -13284,20 +14157,20 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.35.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "polkavm", "sc-allocator", "sp-maybe-compressed-blob", "sp-wasm-interface", - "thiserror", + "thiserror 1.0.69", "wasm-instrument", ] [[package]] name = "sc-executor-polkavm" version = "0.32.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "log", "polkavm", @@ -13308,7 +14181,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.35.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "anyhow", "cfg-if", @@ -13326,7 +14199,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.43.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "ansi_term", "futures 0.3.31", @@ -13343,7 +14216,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "33.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "array-bytes", "parking_lot 0.12.3", @@ -13351,23 +14224,23 @@ dependencies = [ "sp-application-crypto", "sp-core", "sp-keystore", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "sc-mixnet" version = "0.14.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "array-bytes", - "arrayvec 0.7.4", + "arrayvec 0.7.6", "blake2 0.10.6", "bytes", "futures 0.3.31", "futures-timer", "log", "mixnet", - "multiaddr 0.18.1", + "multiaddr 0.18.2", "parity-scale-codec", "parking_lot 0.12.3", "sc-client-api", @@ -13380,16 +14253,16 @@ dependencies = [ "sp-keystore", "sp-mixnet", "sp-runtime", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "sc-network" -version = "0.44.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +version = "0.44.1" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "array-bytes", - "async-channel", + "async-channel 1.9.0", "async-trait", "asynchronous-codec", "bytes", @@ -13410,7 +14283,7 @@ dependencies = [ "partial_sort", "pin-project", "prost 0.12.6", - "prost-build 0.12.4", + "prost-build 0.12.6", "rand", "sc-client-api", "sc-network-common", @@ -13425,7 +14298,7 @@ dependencies = [ "sp-core", "sp-runtime", "substrate-prometheus-endpoint", - "thiserror", + "thiserror 1.0.69", "tokio", "tokio-stream", "unsigned-varint 0.7.2", @@ -13437,14 +14310,14 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.43.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "async-trait", "bitflags 1.3.2", "futures 0.3.31", "libp2p-identity", "parity-scale-codec", - "prost-build 0.12.4", + "prost-build 0.12.6", "sc-consensus", "sc-network-types", "sp-consensus", @@ -13455,7 +14328,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.44.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "ahash", "futures 0.3.31", @@ -13474,31 +14347,31 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.43.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "array-bytes", - "async-channel", + "async-channel 1.9.0", "futures 0.3.31", "log", "parity-scale-codec", "prost 0.12.6", - "prost-build 0.12.4", + "prost-build 0.12.6", "sc-client-api", "sc-network", "sc-network-types", "sp-blockchain", "sp-core", "sp-runtime", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "sc-network-sync" version = "0.43.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "array-bytes", - "async-channel", + "async-channel 1.9.0", "async-trait", "fork-tree", "futures 0.3.31", @@ -13508,7 +14381,7 @@ dependencies = [ "mockall 0.11.4", "parity-scale-codec", "prost 0.12.6", - "prost-build 0.12.4", + "prost-build 0.12.6", "sc-client-api", "sc-consensus", "sc-network", @@ -13524,7 +14397,7 @@ dependencies = [ "sp-core", "sp-runtime", "substrate-prometheus-endpoint", - "thiserror", + "thiserror 1.0.69", "tokio", "tokio-stream", ] @@ -13532,7 +14405,7 @@ dependencies = [ [[package]] name = "sc-network-transactions" version = "0.43.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "array-bytes", "futures 0.3.31", @@ -13551,31 +14424,31 @@ dependencies = [ [[package]] name = "sc-network-types" version = "0.12.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ - "bs58 0.5.0", + "bs58 0.5.1", "ed25519-dalek", "libp2p-identity", "litep2p", "log", - "multiaddr 0.18.1", - "multihash 0.19.1", + "multiaddr 0.18.2", + "multihash 0.19.3", "rand", - "thiserror", + "thiserror 1.0.69", "zeroize", ] [[package]] name = "sc-offchain" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "array-bytes", "bytes", "fnv", "futures 0.3.31", "futures-timer", - "hyper 0.14.29", + "hyper 0.14.32", "hyper-rustls 0.24.2", "log", "num_cpus", @@ -13602,7 +14475,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.18.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -13611,7 +14484,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "futures 0.3.31", "jsonrpsee", @@ -13643,7 +14516,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.43.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -13657,20 +14530,20 @@ dependencies = [ "sp-rpc", "sp-runtime", "sp-version", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "sc-rpc-server" version = "16.0.2" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "forwarded-header-value", "futures 0.3.31", "governor", - "http 1.1.0", + "http 1.2.0", "http-body-util", - "hyper 1.3.1", + "hyper 1.5.2", "ip_network", "jsonrpsee", "log", @@ -13685,7 +14558,7 @@ dependencies = [ [[package]] name = "sc-rpc-spec-v2" version = "0.44.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "array-bytes", "futures 0.3.31", @@ -13709,7 +14582,7 @@ dependencies = [ "sp-rpc", "sp-runtime", "sp-version", - "thiserror", + "thiserror 1.0.69", "tokio", "tokio-stream", ] @@ -13717,7 +14590,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.45.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "async-trait", "directories", @@ -13772,7 +14645,7 @@ dependencies = [ "static_init", "substrate-prometheus-endpoint", "tempfile", - "thiserror", + "thiserror 1.0.69", "tokio", "tracing", "tracing-futures", @@ -13781,7 +14654,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.36.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "log", "parity-scale-codec", @@ -13792,20 +14665,20 @@ dependencies = [ [[package]] name = "sc-storage-monitor" version = "0.22.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "clap", "fs4", "log", "sp-core", - "thiserror", + "thiserror 1.0.69", "tokio", ] [[package]] name = "sc-sync-state-rpc" version = "0.44.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -13818,13 +14691,13 @@ dependencies = [ "serde_json", "sp-blockchain", "sp-runtime", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "sc-sysinfo" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "derive_more 0.99.18", "futures 0.3.31", @@ -13845,7 +14718,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "24.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "chrono", "futures 0.3.31", @@ -13858,14 +14731,14 @@ dependencies = [ "sc-utils", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "wasm-timer", ] [[package]] name = "sc-tracing" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "ansi_term", "chrono", @@ -13886,7 +14759,7 @@ dependencies = [ "sp-rpc", "sp-runtime", "sp-tracing", - "thiserror", + "thiserror 1.0.69", "tracing", "tracing-log", "tracing-subscriber", @@ -13895,18 +14768,18 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "11.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "sc-transaction-pool" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "async-trait", "futures 0.3.31", @@ -13927,13 +14800,13 @@ dependencies = [ "sp-tracing", "sp-transaction-pool", "substrate-prometheus-endpoint", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "sc-transaction-pool-api" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "async-trait", "futures 0.3.31", @@ -13943,15 +14816,15 @@ dependencies = [ "sp-blockchain", "sp-core", "sp-runtime", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "sc-utils" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ - "async-channel", + "async-channel 1.9.0", "futures 0.3.31", "futures-timer", "lazy_static", @@ -14004,10 +14877,10 @@ version = "2.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6630024bf739e2179b91fb424b28898baf819414262c5d376677dbff1fe7ebf" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -14018,18 +14891,18 @@ checksum = "f0cded6518aa0bd6c1be2b88ac81bf7044992f0f154bfbabd5ad34f43512abcb" [[package]] name = "schannel" -version = "0.1.22" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] name = "schnellru" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9a8ef13a93c54d20580de1e5c413e624e53121d42fc7e2c11d10ef7f8b02367" +checksum = "356285bbf17bea63d9e52e96bd18f039672ac92b55b8cb997d6162a2a37d1649" dependencies = [ "ahash", "cfg-if", @@ -14043,7 +14916,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "844b7645371e6ecdf61ff246ba1958c29e802881a749ae3fb1993675d210d28d" dependencies = [ "arrayref", - "arrayvec 0.7.4", + "arrayvec 0.7.6", "curve25519-dalek-ng", "merlin", "rand_core", @@ -14060,14 +14933,14 @@ checksum = "8de18f6d8ba0aad7045f5feae07ec29899c1112584a38509a84ad7b04451eaa0" dependencies = [ "aead", "arrayref", - "arrayvec 0.7.4", + "arrayvec 0.7.6", "curve25519-dalek", "getrandom_or_panic", "merlin", "rand_core", "serde_bytes", "sha2 0.10.8", - "subtle 2.5.0", + "subtle 2.6.1", "zeroize", ] @@ -14085,12 +14958,12 @@ checksum = "a3cf7c11c38cb994f3d40e8a8cde3bbd1f72a435e4c49e85d6553d8312306152" [[package]] name = "sct" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring 0.16.20", - "untrusted 0.7.1", + "ring 0.17.8", + "untrusted 0.9.0", ] [[package]] @@ -14105,7 +14978,7 @@ dependencies = [ "log", "rand", "slab", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -14119,7 +14992,7 @@ dependencies = [ "generic-array 0.14.7", "pkcs8", "serdect", - "subtle 2.5.0", + "subtle 2.6.1", "zeroize", ] @@ -14161,11 +15034,11 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.11.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "core-foundation", "core-foundation-sys", "libc", @@ -14175,9 +15048,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.11.0" +version = "2.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" +checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" dependencies = [ "core-foundation-sys", "libc", @@ -14189,14 +15062,23 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a3186ec9e65071a2095434b1f5bb24838d4e8e130f584c790f6033c79943537" dependencies = [ - "semver-parser", + "semver-parser 0.7.0", ] [[package]] name = "semver" -version = "1.0.18" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +dependencies = [ + "semver-parser 0.10.3", +] + +[[package]] +name = "semver" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" +checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" dependencies = [ "serde", ] @@ -14207,6 +15089,15 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" +[[package]] +name = "semver-parser" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9900206b54a3527fdc7b8a938bffd94a568bac4f4aa8113b209df75a09c0dec2" +dependencies = [ + "pest", +] + [[package]] name = "send_wrapper" version = "0.4.0" @@ -14221,38 +15112,48 @@ checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" -version = "1.0.216" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" dependencies = [ "serde_derive", ] +[[package]] +name = "serde-hex-utils" +version = "0.1.0" +source = "git+https://github.com/polytope-labs/hyperbridge?branch=polkadot-stable2407#672bd1d27e1ef7cfe168dfccc2edc1754403dc50" +dependencies = [ + "anyhow", + "hex", + "serde", +] + [[package]] name = "serde_bytes" -version = "0.11.12" +version = "0.11.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab33ec92f677585af6d88c65593ae2375adde54efdbf16d597f2cbc7a6d368ff" +checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" dependencies = [ "serde", ] [[package]] name = "serde_derive" -version = "1.0.216" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "serde_json" -version = "1.0.134" +version = "1.0.135" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d00f4175c42ee48b15416f6193a959ba3a0d67fc699a0db9ad12df9f83991c7d" +checksum = "2b0d7ba2887406110130a978386c4e1befb98c674b4fba677954e4db976630d9" dependencies = [ "itoa", "memchr", @@ -14262,9 +15163,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.4" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" dependencies = [ "serde", ] @@ -14289,7 +15190,7 @@ dependencies = [ "cfg-if", "cpufeatures", "digest 0.9.0", - "opaque-debug 0.3.0", + "opaque-debug 0.3.1", ] [[package]] @@ -14317,9 +15218,9 @@ dependencies = [ [[package]] name = "sha1-asm" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ba6947745e7f86be3b8af00b7355857085dbdf8901393c89514510eb61f4e21" +checksum = "286acebaf8b67c1130aedffad26f594eff0c1292389158135327d2e23aed582b" dependencies = [ "cc", ] @@ -14334,7 +15235,7 @@ dependencies = [ "cfg-if", "cpufeatures", "digest 0.9.0", - "opaque-debug 0.3.0", + "opaque-debug 0.3.1", ] [[package]] @@ -14359,10 +15260,20 @@ dependencies = [ ] [[package]] -name = "sharded-slab" +name = "sha3-asm" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +checksum = "c28efc5e327c837aa837c59eae585fc250715ef939ac32881bcc11677cd02d46" +dependencies = [ + "cc", + "cfg-if", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" dependencies = [ "lazy_static", ] @@ -14373,30 +15284,20 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" -[[package]] -name = "signal-hook" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" -dependencies = [ - "libc", - "signal-hook-registry", -] - [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] [[package]] name = "signature" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ "digest 0.10.7", "rand_core", @@ -14404,9 +15305,9 @@ dependencies = [ [[package]] name = "simba" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "061507c94fc6ab4ba1c9a0305018408e312e17c041eb63bef8aa726fa33aceae" +checksum = "b3a386a501cd104797982c15ae17aafe8b9261315b5d07e3ec803f2ea26be0fa" dependencies = [ "approx", "num-complex", @@ -14441,7 +15342,7 @@ version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cae9a3fcdadafb6d97f4c0e007e4247b114ee0f119f650c3cbf3a8b3a1479694" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", ] [[package]] @@ -14486,7 +15387,7 @@ dependencies = [ [[package]] name = "slot-range-helper" version = "15.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "enumn", "parity-scale-codec", @@ -14496,9 +15397,9 @@ dependencies = [ [[package]] name = "slotmap" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1e08e261d0e8f5c43123b7adf3e4ca1690d655377ac93a03b2c9d3e98de1342" +checksum = "dbff4acf519f630b3a3ddcfaea6c06b42174d9a44bc70c620e9ed1649d58b82a" dependencies = [ "version_check", ] @@ -14515,7 +15416,7 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13f2b548cd8447f8de0fdf1c592929f70f4fc7039a05e47404b0d096ec6987a1" dependencies = [ - "async-channel", + "async-channel 1.9.0", "async-executor", "async-fs", "async-io 1.13.0", @@ -14532,13 +15433,13 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0bb30cf57b7b5f6109ce17c3164445e2d6f270af2cb48f6e4d31c2967c9a9f5" dependencies = [ - "arrayvec 0.7.4", + "arrayvec 0.7.6", "async-lock 2.8.0", "atomic-take", - "base64 0.21.2", + "base64 0.21.7", "bip39", "blake2-rfc", - "bs58 0.5.0", + "bs58 0.5.1", "chacha20", "crossbeam-queue", "derive_more 0.99.18", @@ -14548,7 +15449,7 @@ dependencies = [ "fnv", "futures-lite 1.13.0", "futures-util", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "hex", "hmac 0.12.1", "itertools 0.11.0", @@ -14586,9 +15487,9 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "256b5bad1d6b49045e95fe87492ce73d5af81545d8b4d8318a872d2007024c33" dependencies = [ - "async-channel", + "async-channel 1.9.0", "async-lock 2.8.0", - "base64 0.21.2", + "base64 0.21.7", "blake2-rfc", "derive_more 0.99.18", "either", @@ -14597,11 +15498,11 @@ dependencies = [ "futures-channel", "futures-lite 1.13.0", "futures-util", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "hex", "itertools 0.11.0", "log", - "lru 0.11.0", + "lru 0.11.1", "no-std-net", "parking_lot 0.12.3", "pin-project", @@ -14618,9 +15519,9 @@ dependencies = [ [[package]] name = "snap" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e9f0ab6ef7eb7353d9119c170a436d1bf248eea575ac42d19d12f4e34130831" +checksum = "1b6b67fb9a61334225b5b790716f609cd58395f895b3fe8b328786812a40bc3b" [[package]] name = "snow" @@ -14633,17 +15534,17 @@ dependencies = [ "chacha20poly1305", "curve25519-dalek", "rand_core", - "ring 0.17.7", - "rustc_version", + "ring 0.17.8", + "rustc_version 0.4.1", "sha2 0.10.8", - "subtle 2.5.0", + "subtle 2.6.1", ] [[package]] name = "socket2" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" dependencies = [ "libc", "winapi", @@ -14651,9 +15552,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" dependencies = [ "libc", "windows-sys 0.52.0", @@ -14676,14 +15577,14 @@ dependencies = [ [[package]] name = "soketto" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37468c595637c10857701c990f93a40ce0e357cedb0953d1c26c8d8027f9bb53" +checksum = "2e859df029d160cb88608f5d7df7fb4753fd20fdfb4de5644f3d8b8440841721" dependencies = [ "base64 0.22.1", "bytes", "futures 0.3.31", - "http 1.1.0", + "http 1.2.0", "httparse", "log", "rand", @@ -14693,10 +15594,10 @@ dependencies = [ [[package]] name = "sp-api" version = "34.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "docify", - "hash-db 0.16.0", + "hash-db", "log", "parity-scale-codec", "scale-info", @@ -14709,27 +15610,27 @@ dependencies = [ "sp-state-machine", "sp-trie", "sp-version", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "sp-api-proc-macro" version = "20.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "Inflector", "blake2 0.10.6", "expander", - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "sp-application-crypto" version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "parity-scale-codec", "scale-info", @@ -14741,7 +15642,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "26.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "docify", "integer-sqrt", @@ -14755,7 +15656,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "34.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "parity-scale-codec", "scale-info", @@ -14767,7 +15668,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "34.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "sp-api", "sp-inherents", @@ -14777,7 +15678,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "37.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "futures 0.3.31", "parity-scale-codec", @@ -14789,14 +15690,14 @@ dependencies = [ "sp-database", "sp-runtime", "sp-state-machine", - "thiserror", + "thiserror 1.0.69", "tracing", ] [[package]] name = "sp-consensus" version = "0.40.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "async-trait", "futures 0.3.31", @@ -14805,13 +15706,13 @@ dependencies = [ "sp-inherents", "sp-runtime", "sp-state-machine", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "sp-consensus-aura" version = "0.40.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "async-trait", "parity-scale-codec", @@ -14827,7 +15728,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.40.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "async-trait", "parity-scale-codec", @@ -14845,7 +15746,7 @@ dependencies = [ [[package]] name = "sp-consensus-beefy" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "lazy_static", "parity-scale-codec", @@ -14865,7 +15766,7 @@ dependencies = [ [[package]] name = "sp-consensus-grandpa" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "finality-grandpa", "log", @@ -14882,7 +15783,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.40.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "parity-scale-codec", "scale-info", @@ -14893,17 +15794,17 @@ dependencies = [ [[package]] name = "sp-core" version = "34.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "array-bytes", "bitflags 1.3.2", "blake2 0.10.6", "bounded-collections", - "bs58 0.5.0", + "bs58 0.5.1", "dyn-clonable", "ed25519-zebra", "futures 0.3.31", - "hash-db 0.16.0", + "hash-db", "hash256-std-hasher", "impl-serde", "itertools 0.11.0", @@ -14930,7 +15831,7 @@ dependencies = [ "sp-storage", "ss58-registry", "substrate-bip39", - "thiserror", + "thiserror 1.0.69", "tracing", "w3f-bls", "zeroize", @@ -14939,7 +15840,7 @@ dependencies = [ [[package]] name = "sp-crypto-hashing" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "blake2b_simd", "byteorder", @@ -14952,17 +15853,17 @@ dependencies = [ [[package]] name = "sp-crypto-hashing-proc-macro" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "quote", "sp-crypto-hashing", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "sp-database" version = "10.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "kvdb", "parking_lot 0.12.3", @@ -14971,17 +15872,17 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "sp-externalities" version = "0.29.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "environmental", "parity-scale-codec", @@ -14991,7 +15892,7 @@ dependencies = [ [[package]] name = "sp-genesis-builder" version = "0.15.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "parity-scale-codec", "scale-info", @@ -15003,20 +15904,20 @@ dependencies = [ [[package]] name = "sp-inherents" version = "34.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "async-trait", "impl-trait-for-tuples", "parity-scale-codec", "scale-info", "sp-runtime", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "sp-io" version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "bytes", "docify", @@ -15042,7 +15943,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "sp-core", "sp-runtime", @@ -15052,7 +15953,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.40.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "parity-scale-codec", "parking_lot 0.12.3", @@ -15063,16 +15964,16 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "11.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ - "thiserror", + "thiserror 1.0.69", "zstd 0.12.4", ] [[package]] name = "sp-metadata-ir" version = "0.7.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-metadata", "parity-scale-codec", @@ -15082,7 +15983,7 @@ dependencies = [ [[package]] name = "sp-mixnet" version = "0.12.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "parity-scale-codec", "scale-info", @@ -15093,7 +15994,7 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "34.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "log", "parity-scale-codec", @@ -15104,13 +16005,13 @@ dependencies = [ "sp-core", "sp-debug-derive", "sp-runtime", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "sp-npos-elections" version = "34.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "parity-scale-codec", "scale-info", @@ -15123,7 +16024,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "34.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "sp-api", "sp-core", @@ -15133,7 +16034,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "13.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "backtrace", "lazy_static", @@ -15143,7 +16044,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "32.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "rustc-hash", "serde", @@ -15152,8 +16053,8 @@ dependencies = [ [[package]] name = "sp-runtime" -version = "39.0.2" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +version = "39.0.3" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "docify", "either", @@ -15179,7 +16080,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -15198,20 +16099,20 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "18.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "Inflector", "expander", - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "sp-session" version = "35.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "parity-scale-codec", "scale-info", @@ -15225,7 +16126,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "34.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -15238,9 +16139,9 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.43.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ - "hash-db 0.16.0", + "hash-db", "log", "parity-scale-codec", "parking_lot 0.12.3", @@ -15250,7 +16151,7 @@ dependencies = [ "sp-externalities", "sp-panic-handler", "sp-trie", - "thiserror", + "thiserror 1.0.69", "tracing", "trie-db", ] @@ -15258,7 +16159,7 @@ dependencies = [ [[package]] name = "sp-statement-store" version = "18.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "aes-gcm", "curve25519-dalek", @@ -15275,19 +16176,19 @@ dependencies = [ "sp-externalities", "sp-runtime", "sp-runtime-interface", - "thiserror", + "thiserror 1.0.69", "x25519-dalek", ] [[package]] name = "sp-std" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" [[package]] name = "sp-storage" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "impl-serde", "parity-scale-codec", @@ -15299,19 +16200,19 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "34.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "async-trait", "parity-scale-codec", "sp-inherents", "sp-runtime", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "sp-tracing" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "parity-scale-codec", "tracing", @@ -15322,7 +16223,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "34.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "sp-api", "sp-runtime", @@ -15331,7 +16232,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "34.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "async-trait", "parity-scale-codec", @@ -15345,10 +16246,10 @@ dependencies = [ [[package]] name = "sp-trie" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "ahash", - "hash-db 0.16.0", + "hash-db", "lazy_static", "memory-db", "nohash-hasher", @@ -15359,7 +16260,7 @@ dependencies = [ "schnellru", "sp-core", "sp-externalities", - "thiserror", + "thiserror 1.0.69", "tracing", "trie-db", "trie-root", @@ -15368,7 +16269,7 @@ dependencies = [ [[package]] name = "sp-version" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "impl-serde", "parity-scale-codec", @@ -15379,24 +16280,24 @@ dependencies = [ "sp-runtime", "sp-std", "sp-version-proc-macro", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "sp-version-proc-macro" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "parity-scale-codec", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "sp-wasm-interface" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -15408,7 +16309,7 @@ dependencies = [ [[package]] name = "sp-weights" version = "31.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "bounded-collections", "parity-scale-codec", @@ -15434,11 +16335,20 @@ dependencies = [ "lock_api", ] +[[package]] +name = "spinning_top" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d96d2d1d716fb500937168cc09353ffdc7a012be8475ac7308e1bdf0e3923300" +dependencies = [ + "lock_api", +] + [[package]] name = "spki" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ "base64ct", "der", @@ -15486,7 +16396,7 @@ dependencies = [ "futures-util", "hashlink", "hex", - "indexmap 2.2.3", + "indexmap 2.7.0", "log", "memchr", "native-tls", @@ -15497,7 +16407,7 @@ dependencies = [ "sha2 0.10.8", "smallvec", "sqlformat", - "thiserror", + "thiserror 1.0.69", "tokio", "tokio-stream", "tracing", @@ -15566,9 +16476,9 @@ dependencies = [ [[package]] name = "ss58-registry" -version = "1.43.0" +version = "1.51.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e6915280e2d0db8911e5032a5c275571af6bdded2916abd691a659be25d3439" +checksum = "19409f13998e55816d1c728395af0b52ec066206341d939e22e7766df9b494b8" dependencies = [ "Inflector", "num-format", @@ -15588,7 +16498,7 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "staging-node-inspect" version = "0.22.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "clap", "parity-scale-codec", @@ -15600,13 +16510,13 @@ dependencies = [ "sp-io", "sp-runtime", "sp-statement-store", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "staging-parachain-info" version = "0.16.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -15619,7 +16529,7 @@ dependencies = [ [[package]] name = "staging-xcm" version = "14.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "array-bytes", "bounded-collections", @@ -15636,8 +16546,8 @@ dependencies = [ [[package]] name = "staging-xcm-builder" -version = "16.0.2" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +version = "16.0.3" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-support", "frame-system", @@ -15658,7 +16568,7 @@ dependencies = [ [[package]] name = "staging-xcm-executor" version = "16.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "environmental", "frame-benchmarking", @@ -15698,9 +16608,9 @@ dependencies = [ [[package]] name = "static_init_macro" -version = "1.0.2" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70a2595fc3aa78f2d0e45dd425b22282dd863273761cc77780914b2cf3003acf" +checksum = "1389c88ddd739ec6d3f8f83343764a0e944cd23cfbf126a9796a714b0b6edd6f" dependencies = [ "cfg_aliases", "memchr", @@ -15717,7 +16627,7 @@ checksum = "6706347e49b13373f7ddfafad47df7583ed52083d6fc8a594eb2c80497ef959d" dependencies = [ "combine", "crc", - "fastrand 2.1.0", + "fastrand 2.3.0", "hmac 0.12.1", "once_cell", "openssl", @@ -15725,15 +16635,15 @@ dependencies = [ "sctp-proto", "serde", "sha-1 0.10.1", - "thiserror", + "thiserror 1.0.69", "tracing", ] [[package]] name = "strsim" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "strum" @@ -15741,12 +16651,6 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" -[[package]] -name = "strum" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" - [[package]] name = "strum" version = "0.26.3" @@ -15760,26 +16664,13 @@ dependencies = [ name = "strum_macros" version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" -dependencies = [ - "heck 0.4.1", - "proc-macro2", - "quote", - "rustversion", - "syn 1.0.109", -] - -[[package]] -name = "strum_macros" -version = "0.25.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" +checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" dependencies = [ "heck 0.4.1", "proc-macro2", "quote", "rustversion", - "syn 2.0.90", + "syn 1.0.109", ] [[package]] @@ -15792,13 +16683,13 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "substrate-bip39" version = "0.6.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "hmac 0.12.1", "pbkdf2", @@ -15823,12 +16714,12 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "11.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" [[package]] name = "substrate-fixed" version = "0.5.9" -source = "git+https://github.com/encointer/substrate-fixed#879c58bcc6fd676a74315dcd38b598f28708b0b5" +source = "git+https://github.com/encointer/substrate-fixed#ddaa922892d1565f02c9c5702f0aacd17da53ce2" dependencies = [ "parity-scale-codec", "scale-info", @@ -15839,7 +16730,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "docify", "frame-system-rpc-runtime-api", @@ -15859,21 +16750,40 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.17.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "http-body-util", - "hyper 1.3.1", + "hyper 1.5.2", "hyper-util", "log", "prometheus", - "thiserror", + "thiserror 1.0.69", "tokio", ] +[[package]] +name = "substrate-state-machine" +version = "1.15.3" +source = "git+https://github.com/polytope-labs/hyperbridge?branch=polkadot-stable2407#672bd1d27e1ef7cfe168dfccc2edc1754403dc50" +dependencies = [ + "frame-support", + "hash-db", + "ismp", + "pallet-ismp", + "parity-scale-codec", + "primitive-types", + "scale-info", + "serde", + "sp-consensus-aura", + "sp-consensus-babe", + "sp-runtime", + "sp-trie", +] + [[package]] name = "substrate-state-trie-migration-rpc" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -15900,7 +16810,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "24.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "array-bytes", "build-helper", @@ -15920,7 +16830,7 @@ dependencies = [ "sp-version", "strum 0.26.3", "tempfile", - "toml 0.8.8", + "toml 0.8.19", "walkdir", "wasm-opt", ] @@ -15933,9 +16843,9 @@ checksum = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" [[package]] name = "subtle" -version = "2.5.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "subtle-ng" @@ -15956,15 +16866,27 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.90" +version = "2.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" +checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] +[[package]] +name = "syn-solidity" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c837dc8852cb7074e46b444afb81783140dab12c58867b49fb3898fbafedf7ea" +dependencies = [ + "paste", + "proc-macro2", + "quote", + "syn 2.0.96", +] + [[package]] name = "synstructure" version = "0.12.6" @@ -15985,25 +16907,25 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "system-configuration" -version = "0.5.1" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.7.0", "core-foundation", "system-configuration-sys", ] [[package]] name = "system-configuration-sys" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" dependencies = [ "core-foundation-sys", "libc", @@ -16017,28 +16939,29 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "target-lexicon" -version = "0.12.11" +version = "0.12.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d0e916b1148c8e263850e1ebcbd046f333e0683c724876bb0da63ea4373dc8a" +checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tempfile" -version = "3.8.1" +version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" +checksum = "9a8a559c81686f576e8cd0290cd2a24a2a9ad80c98b3478856500fcbd7acd704" dependencies = [ "cfg-if", - "fastrand 2.1.0", - "redox_syscall 0.4.1", - "rustix 0.38.21", - "windows-sys 0.48.0", + "fastrand 2.3.0", + "getrandom", + "once_cell", + "rustix 0.38.43", + "windows-sys 0.59.0", ] [[package]] name = "termcolor" -version = "1.2.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" dependencies = [ "winapi-util", ] @@ -16049,54 +16972,74 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5352447f921fda68cf61b4101566c0bdb5104eff6804d0678e5227580ab6a4e9" dependencies = [ - "rustix 0.38.21", + "rustix 0.38.43", "windows-sys 0.59.0", ] [[package]] name = "termtree" -version = "0.4.1" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f50febec83f5ee1df3015341d8bd429f2d1cc62bcba7ea2076759d315084683" + +[[package]] +name = "thiserror" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] [[package]] name = "thiserror" -version = "1.0.61" +version = "2.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" dependencies = [ - "thiserror-impl", + "thiserror-impl 2.0.11", ] [[package]] name = "thiserror-core" -version = "1.0.38" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d97345f6437bb2004cd58819d8a9ef8e36cdd7661c2abc4bbde0a7c40d9f497" +checksum = "c001ee18b7e5e3f62cbf58c7fe220119e68d902bb7443179c0c8aef30090e999" dependencies = [ "thiserror-core-impl", ] [[package]] name = "thiserror-core-impl" -version = "1.0.38" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10ac1c5050e43014d16b2f94d0d2ce79e65ffdd8b38d8048f9c8f6a8a6da62ac" +checksum = "e4c60d69f36615a077cc7663b9cb8e42275722d23e58a7fa3d2c7f2915d09d04" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.96", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", ] [[package]] name = "thiserror-impl" -version = "1.0.61" +version = "2.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -16107,9 +17050,9 @@ checksum = "3bf63baf9f5039dadc247375c29eb13706706cfde997d0330d05aa63a77d8820" [[package]] name = "thread_local" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ "cfg-if", "once_cell", @@ -16160,9 +17103,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.36" +version = "0.3.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21" dependencies = [ "deranged", "itoa", @@ -16181,9 +17124,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de" dependencies = [ "num-conv", "time-core", @@ -16198,11 +17141,21 @@ dependencies = [ "crunchy", ] +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "022db8904dfa342efe721985167e9fcd16c29b226db4397ed752a761cfce81e8" dependencies = [ "tinyvec_macros", ] @@ -16213,11 +17166,32 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" +[[package]] +name = "token-gateway-primitives" +version = "1.15.1" +dependencies = [ + "alloy-primitives", + "alloy-sol-macro", + "alloy-sol-types", + "anyhow", + "frame-support", + "frame-system", + "ismp", + "log", + "pallet-ismp", + "parity-scale-codec", + "primitive-types", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", +] + [[package]] name = "tokio" -version = "1.42.0" +version = "1.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551" +checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e" dependencies = [ "backtrace", "bytes", @@ -16226,20 +17200,20 @@ dependencies = [ "parking_lot 0.12.3", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.7", + "socket2 0.5.8", "tokio-macros", "windows-sys 0.52.0", ] [[package]] name = "tokio-macros" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" +checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -16248,26 +17222,25 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.7", + "rustls 0.21.12", "tokio", ] [[package]] name = "tokio-rustls" -version = "0.26.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" +checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37" dependencies = [ - "rustls 0.23.10", - "rustls-pki-types", + "rustls 0.23.21", "tokio", ] [[package]] name = "tokio-stream" -version = "0.1.14" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" +checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" dependencies = [ "futures-core", "pin-project-lite", @@ -16283,7 +17256,7 @@ checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" dependencies = [ "futures-util", "log", - "rustls 0.21.7", + "rustls 0.21.12", "rustls-native-certs 0.6.3", "tokio", "tokio-rustls 0.24.1", @@ -16292,9 +17265,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.11" +version = "0.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" +checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" dependencies = [ "bytes", "futures-core", @@ -16315,43 +17288,32 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.8" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.21.0", + "toml_edit", ] [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.19.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" -dependencies = [ - "indexmap 2.2.3", - "toml_datetime", - "winnow", -] - -[[package]] -name = "toml_edit" -version = "0.21.0" +version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ - "indexmap 2.2.3", + "indexmap 2.7.0", "serde", "serde_spanned", "toml_datetime", @@ -16368,7 +17330,6 @@ dependencies = [ "futures-util", "pin-project", "pin-project-lite", - "tokio", "tower-layer", "tower-service", "tracing", @@ -16380,10 +17341,10 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "bytes", - "http 1.1.0", - "http-body 1.0.0", + "http 1.2.0", + "http-body 1.0.1", "http-body-util", "pin-project-lite", "tower-layer", @@ -16392,21 +17353,21 @@ dependencies = [ [[package]] name = "tower-layer" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.40" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ "log", "pin-project-lite", @@ -16416,20 +17377,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" dependencies = [ "once_cell", "valuable", @@ -16448,7 +17409,7 @@ dependencies = [ [[package]] name = "tracing-gum" version = "15.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "coarsetime", "polkadot-primitives", @@ -16459,13 +17420,13 @@ dependencies = [ [[package]] name = "tracing-gum-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "expander", - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] @@ -16481,9 +17442,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" dependencies = [ "matchers", "nu-ansi-term", @@ -16500,11 +17461,11 @@ dependencies = [ [[package]] name = "trie-db" -version = "0.29.0" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65ed83be775d85ebb0e272914fff6462c39b3ddd6dc67b5c1c41271aad280c69" +checksum = "0c992b4f40c234a074d48a757efeabb1a6be88af84c0c23f7ca158950cb0ae7f" dependencies = [ - "hash-db 0.16.0", + "hash-db", "log", "rustc-hex", "smallvec", @@ -16516,17 +17477,7 @@ version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4ed310ef5ab98f5fa467900ed906cb9232dd5376597e00fd4cba2a449d06c0b" dependencies = [ - "hash-db 0.16.0", -] - -[[package]] -name = "triehash" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1631b201eb031b563d2e85ca18ec8092508e262a3196ce9bd10a67ec87b9f5c" -dependencies = [ - "hash-db 0.15.2", - "rlp", + "hash-db", ] [[package]] @@ -16547,8 +17498,8 @@ dependencies = [ "lazy_static", "rand", "smallvec", - "socket2 0.4.9", - "thiserror", + "socket2 0.4.10", + "thiserror 1.0.69", "tinyvec", "tokio", "tracing", @@ -16564,7 +17515,7 @@ dependencies = [ "async-trait", "cfg-if", "data-encoding", - "enum-as-inner 0.6.0", + "enum-as-inner 0.6.1", "futures-channel", "futures-io", "futures-util", @@ -16573,7 +17524,7 @@ dependencies = [ "once_cell", "rand", "smallvec", - "thiserror", + "thiserror 1.0.69", "tinyvec", "tokio", "tracing", @@ -16595,7 +17546,7 @@ dependencies = [ "rand", "resolv-conf", "smallvec", - "thiserror", + "thiserror 1.0.69", "tokio", "tracing", "trust-dns-proto 0.23.2", @@ -16603,9 +17554,9 @@ dependencies = [ [[package]] name = "try-lock" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "tt-call" @@ -16622,13 +17573,13 @@ dependencies = [ "byteorder", "bytes", "data-encoding", - "http 0.2.9", + "http 0.2.12", "httparse", "log", "rand", - "rustls 0.21.7", + "rustls 0.21.12", "sha1", - "thiserror", + "thiserror 1.0.69", "url", "utf-8", ] @@ -16647,15 +17598,15 @@ dependencies = [ [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "ucd-trie" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" [[package]] name = "uint" @@ -16669,17 +17620,23 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "unarray" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" + [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" [[package]] name = "unicode-ident" -version = "1.0.11" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "unicode-normalization" @@ -16692,21 +17649,27 @@ dependencies = [ [[package]] name = "unicode-segmentation" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" [[package]] name = "unicode-width" -version = "0.1.10" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" + +[[package]] +name = "unicode-width" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" [[package]] name = "unicode-xid" -version = "0.2.4" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" [[package]] name = "unicode_categories" @@ -16721,7 +17684,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" dependencies = [ "crypto-common", - "subtle 2.5.0", + "subtle 2.6.1", ] [[package]] @@ -16760,12 +17723,12 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.2" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", - "idna 0.5.0", + "idna 1.0.3", "percent-encoding", ] @@ -16781,11 +17744,23 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "utf8parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "valuable" @@ -16801,9 +17776,9 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "void" @@ -16813,15 +17788,15 @@ checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" [[package]] name = "w3f-bls" -version = "0.1.3" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7335e4c132c28cc43caef6adb339789e599e39adbe78da0c4d547fad48cbc331" +checksum = "70a3028804c8bbae2a97a15b71ffc0e308c4b01a520994aafa77d56e94e19024" dependencies = [ "ark-bls12-377", "ark-bls12-381", "ark-ec", - "ark-ff", - "ark-serialize", + "ark-ff 0.4.2", + "ark-serialize 0.4.2", "ark-serialize-derive", "arrayref", "constcat", @@ -16831,21 +17806,30 @@ dependencies = [ "rand_core", "sha2 0.10.8", "sha3", - "thiserror", + "thiserror 1.0.69", "zeroize", ] +[[package]] +name = "wait-timeout" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" +dependencies = [ + "libc", +] + [[package]] name = "waker-fn" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" +checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7" [[package]] name = "walkdir" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", @@ -16866,48 +17850,59 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasix" +version = "0.12.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1fbb4ef9bbca0c1170e0b00dd28abc9e3b68669821600cad1caaed606583c6d" +dependencies = [ + "wasi", +] + [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" dependencies = [ "cfg-if", + "once_cell", + "rustversion", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" dependencies = [ "bumpalo", "log", - "once_cell", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.37" +version = "0.4.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" dependencies = [ "cfg-if", "js-sys", + "once_cell", "wasm-bindgen", "web-sys", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -16915,22 +17910,25 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] [[package]] name = "wasm-instrument" @@ -16943,16 +17941,16 @@ dependencies = [ [[package]] name = "wasm-opt" -version = "0.116.0" +version = "0.116.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc942673e7684671f0c5708fc18993569d184265fd5223bb51fc8e5b9b6cfd52" +checksum = "2fd87a4c135535ffed86123b6fb0f0a5a0bc89e50416c942c5f0662c645f679c" dependencies = [ "anyhow", "libc", "strum 0.24.1", "strum_macros 0.24.3", "tempfile", - "thiserror", + "thiserror 1.0.69", "wasm-opt-cxx-sys", "wasm-opt-sys", ] @@ -17090,7 +18088,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c86437fa68626fe896e5afc69234bb2b5894949083586535f200385adfd71213" dependencies = [ "anyhow", - "base64 0.21.2", + "base64 0.21.7", "bincode", "directories-next", "file-per-thread-logger", @@ -17119,7 +18117,7 @@ dependencies = [ "log", "object 0.30.4", "target-lexicon", - "thiserror", + "thiserror 1.0.69", "wasmparser", "wasmtime-cranelift-shared", "wasmtime-environ", @@ -17154,7 +18152,7 @@ dependencies = [ "object 0.30.4", "serde", "target-lexicon", - "thiserror", + "thiserror 1.0.69", "wasmparser", "wasmtime-types", ] @@ -17219,7 +18217,7 @@ dependencies = [ "log", "mach", "memfd", - "memoffset 0.8.0", + "memoffset", "paste", "rand", "rustix 0.36.17", @@ -17237,15 +18235,15 @@ checksum = "a4f6fffd2a1011887d57f07654dd112791e872e3ff4a2e626aee8059ee17f06f" dependencies = [ "cranelift-entity", "serde", - "thiserror", + "thiserror 1.0.69", "wasmparser", ] [[package]] name = "web-sys" -version = "0.3.64" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" dependencies = [ "js-sys", "wasm-bindgen", @@ -17257,29 +18255,29 @@ version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" dependencies = [ - "ring 0.17.7", + "ring 0.17.8", "untrusted 0.9.0", ] [[package]] name = "webpki-roots" -version = "0.25.2" +version = "0.25.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" +checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "webpki-roots" -version = "0.26.3" +version = "0.26.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" +checksum = "5d642ff16b7e79272ae451b7322067cdc17cadf68c23264be9d94a32319efe7e" dependencies = [ "rustls-pki-types", ] [[package]] name = "westend-runtime" -version = "17.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +version = "19.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "binary-merkle-tree", "bitvec", @@ -17385,7 +18383,7 @@ dependencies = [ [[package]] name = "westend-runtime-constants" version = "16.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-support", "polkadot-primitives", @@ -17400,20 +18398,21 @@ dependencies = [ [[package]] name = "which" -version = "4.4.0" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" dependencies = [ "either", - "libc", + "home", "once_cell", + "rustix 0.38.43", ] [[package]] name = "wide" -version = "0.7.11" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa469ffa65ef7e0ba0f164183697b89b854253fd31aeb92358b7b6155177d62f" +checksum = "41b5576b9a81633f3e8df296ce0063042a73507636cbe956c61133dd7034ab22" dependencies = [ "bytemuck", "safe_arch", @@ -17421,9 +18420,9 @@ dependencies = [ [[package]] name = "widestring" -version = "1.0.2" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "653f141f39ec16bba3c5abe400a0c60da7468261cc2cbf36805022876bc721a8" +checksum = "7219d36b6eac893fa81e84ebe06485e7dcbb616177469b142df14f1f4deb1311" [[package]] name = "winapi" @@ -17443,11 +18442,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "winapi", + "windows-sys 0.59.0", ] [[package]] @@ -17458,30 +18457,40 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.48.0" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +checksum = "efc5cf48f83140dcaab716eeaea345f9e93d0018fb81162753a3f76c3397b538" dependencies = [ - "windows-targets 0.48.5", + "windows-core 0.53.0", + "windows-targets 0.52.6", ] [[package]] -name = "windows" -version = "0.51.1" +name = "windows-core" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-core", - "windows-targets 0.48.5", + "windows-targets 0.52.6", ] [[package]] name = "windows-core" -version = "0.51.1" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" +checksum = "9dcc5b895a6377f1ab9fa55acedab1fd5ac0db66ad1e6c7f47e28a22e446a5dd" dependencies = [ - "windows-targets 0.48.5", + "windows-result", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" +dependencies = [ + "windows-targets 0.52.6", ] [[package]] @@ -17715,9 +18724,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.5.15" +version = "0.6.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c2e3184b9c4e92ad5167ca73039d0c42476302ab603e2fec4487511f38ccefc" +checksum = "c8d71a593cc5c42ad7876e2c1fda56f314f3754c084128833e64f1345ff8a03a" dependencies = [ "memchr", ] @@ -17732,6 +18741,18 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + [[package]] name = "wyz" version = "0.5.1" @@ -17743,9 +18764,9 @@ dependencies = [ [[package]] name = "x25519-dalek" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb66477291e7e8d2b0ff1bcb900bf29489a9692816d79874bea351e7a8b6de96" +checksum = "c7e468321c81fb07fa7f4c636c3972b9100f0346e5b6a9f2bd0603a52f7ed277" dependencies = [ "curve25519-dalek", "rand_core", @@ -17766,7 +18787,7 @@ dependencies = [ "nom", "oid-registry 0.6.1", "rusticata-macros", - "thiserror", + "thiserror 1.0.69", "time", ] @@ -17776,21 +18797,21 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcbc162f30700d6f3f82a24bf7cc62ffe7caea42c0b2cba8bf7f3ae50cf51f69" dependencies = [ - "asn1-rs 0.6.1", + "asn1-rs 0.6.2", "data-encoding", "der-parser 9.0.0", "lazy_static", "nom", - "oid-registry 0.7.0", + "oid-registry 0.7.1", "rusticata-macros", - "thiserror", + "thiserror 1.0.69", "time", ] [[package]] name = "xcm-emulator" version = "0.15.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "cumulus-pallet-parachain-system", "cumulus-pallet-xcmp-queue", @@ -17824,18 +18845,18 @@ dependencies = [ [[package]] name = "xcm-procedural" version = "10.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#fe4e09d674c954238de06265123a74ac42075aba" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "Inflector", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", ] [[package]] name = "xcm-runtime-apis" -version = "0.3.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +version = "0.3.1" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-support", "parity-scale-codec", @@ -17849,7 +18870,7 @@ dependencies = [ [[package]] name = "xcm-simulator" version = "16.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#c29cf6e1a276d194f2245c20561e37a38c273929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2407#08af3291765e7b00cb2cc2f1fab9235ac9b028cc" dependencies = [ "frame-support", "frame-system", @@ -17870,9 +18891,9 @@ dependencies = [ [[package]] name = "xml-rs" -version = "0.8.20" +version = "0.8.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "791978798f0597cfc70478424c2b4fdc2b7a8024aaff78497ef00f24ef674193" +checksum = "c5b940ebc25896e71dd073bad2dbaa2abfe97b0a391415e22ad1326d9c54e3c4" [[package]] name = "xmltree" @@ -17907,6 +18928,30 @@ dependencies = [ "time", ] +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", + "synstructure 0.13.1", +] + [[package]] name = "zenlink-protocol" version = "0.4.4" @@ -18019,22 +19064,44 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.32" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ + "byteorder", "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", +] + +[[package]] +name = "zerofrom" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", + "synstructure 0.13.1", ] [[package]] @@ -18054,7 +19121,29 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.96", +] + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", ] [[package]] @@ -18097,11 +19186,10 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.8+zstd.1.5.5" +version = "2.0.13+zstd.1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c" +checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" dependencies = [ "cc", - "libc", "pkg-config", ] diff --git a/Cargo.toml b/Cargo.toml index 0ae0360e5d..3199872628 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,8 +31,10 @@ members = [ "pallets/channel-commission", "pallets/clouds-convert", "pallets/vbnc-convert", + "pallets/ismp", "runtime/bifrost-kusama", + "runtime/bifrost-paseo", "runtime/bifrost-polkadot/src/evm/evm-utility/macro", "runtime/bifrost-polkadot/src/evm/precompiles/call-permit", "runtime/bifrost-polkadot", @@ -96,12 +98,15 @@ bifrost-xcm-interface = { path = "pallets/xcm-interface", defau lend-market = { path = "pallets/lend-market", default-features = false } lend-market-rpc-runtime-api = { path = "pallets/lend-market/rpc/runtime-api", default-features = false } leverage-staking = { path = "pallets/leverage-staking", default-features = false } +module-evm-utility = { path = "runtime/bifrost-polkadot/src/evm/evm-utility", default-features = false } module-evm-utility-macro = { path = "runtime/bifrost-polkadot/src/evm/evm-utility/macro", default-features = false } pallet-evm-precompile-call-permit = { path = "runtime/bifrost-polkadot/src/evm/precompiles/call-permit", default-features = false } pallet-evm-accounts = { path = "pallets/evm-accounts", default-features = false } pallet-evm-accounts-rpc-runtime-api = { path = "pallets/evm-accounts/rpc/runtime-api", default-features = false } pallet-prices = { path = "pallets/prices", default-features = false } pallet-traits = { path = "pallets/traits", default-features = false } +bifrost-ismp = { path = "pallets/ismp", default-features = false } +pallet-token-gateway = { path = "pallets/token-gateway", default-features = false } # Zenlink merkle-distributor = { git = "https://github.com/bifrost-io/Zenlink-DEX-Module", branch = "release-polkadot-stable2407", default-features = false } @@ -151,6 +156,17 @@ pallet-evm-precompile-sha3fips = { git = "https://github.com/bifrost-io/frontier pallet-evm-precompile-simple = { git = "https://github.com/bifrost-io/frontier", branch = "release-polkadot-stable2407", default-features = false } precompile-utils = { git = "https://github.com/bifrost-io/frontier", branch = "release-polkadot-stable2407", default-features = false } +# Hyperbridge +pallet-ismp = { git = "https://github.com/polytope-labs/hyperbridge", branch = "polkadot-stable2407", default-features = false } +pallet-ismp-rpc = { git = "https://github.com/polytope-labs/hyperbridge", branch = "polkadot-stable2407" } +pallet-ismp-runtime-api = { git = "https://github.com/polytope-labs/hyperbridge", branch = "polkadot-stable2407", default-features = false } +ismp-parachain = { git = "https://github.com/polytope-labs/hyperbridge", branch = "polkadot-stable2407", default-features = false } +ismp-parachain-inherent = { git = "https://github.com/polytope-labs/hyperbridge", branch = "polkadot-stable2407", default-features = false } +ismp-parachain-runtime-api = { git = "https://github.com/polytope-labs/hyperbridge", branch = "polkadot-stable2407", default-features = false } +ismp = { git = "https://github.com/polytope-labs/hyperbridge", branch = "polkadot-stable2407", default-features = false } +pallet-hyperbridge = { git = "https://github.com/polytope-labs/hyperbridge", branch = "polkadot-stable2407", default-features = false } +anyhow = { version = "1.0.93", default-features = false } + # polkadot-sdk (wasm) cumulus-client-collator = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2407", default-features = false } cumulus-client-consensus-proposer = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2407", default-features = false } @@ -223,6 +239,7 @@ sp-genesis-builder = { git = "https://github.com/parityt sp-inherents = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2407", default-features = false } sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2407", default-features = false } sp-keystore = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2407", default-features = false } +sp-mmr-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2407", default-features = false } sp-offchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2407", default-features = false } sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2407", default-features = false } sp-session = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2407", default-features = false } @@ -285,21 +302,15 @@ xcm-emulator = { git = "https://github.com/pari xcm-simulator = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2407" } # Other -affix = "0.1.2" -case = "1.0" -slices = "0.2.0" -derive_more = "0.99.18" -libsecp256k1 = { version = "0.7", default-features = false } -environmental = { version = "1.1.2", default-features = false } -prettyplease = "0.1.18" -macrotest = "1.0.9" -trybuild = "1.0" +slices = "0.2.0" +derive_more = "0.99.18" +libsecp256k1 = { version = "0.7", default-features = false } async-trait = { version = "0.1.83" } bstringify = { version = "0.1.2" } clap = { version = "4.5.18" } env_logger = { version = "0.10.2" } ethabi = { version = "18.0.0", default-features = false } -ethereum = { version = "0.14.0", default-features = false, features = ["with-codec"] } +ethereum = { version = "0.15.0", default-features = false, features = ["with-codec"] } evm = { version = "0.41.1", default-features = false } flume = { version = "0.11.1" } futures = { version = "0.3.31" } @@ -315,9 +326,9 @@ parity-scale-codec = { version = "3.6.12", default-features = false } paste = { version = "1.0.15" } primitive-types = { version = "0.12.2", default-features = false } proc-macro2 = { version = "1.0.89" } -quote = { version = "1.0.20" } +quote = { version = "1.0.38" } scale-info = { version = "2.11.6", default-features = false } -serde = { version = "1.0.216", default-features = false } +serde = { version = "1.0.217", default-features = false } serde_json = { version = "1.0.134", default-features = false } sha3 = { version = "0.10.6", default-features = false } similar-asserts = { version = "1.6.0" } @@ -327,6 +338,9 @@ strum = { version = "0.26.3", default-features = false, features strum_macros = { version = "0.26.2" } syn = { version = "2.0.90", features = ["full", "fold", "extra-traits", "visit"] } tiny-keccak = { version = "2.0", features = ["fips202"] } +alloy-sol-macro = "0.7.7" +alloy-sol-types = { version = "0.7.7", default-features = false } +alloy-primitives = { version = "0.7.7", default-features = false, features = ["rlp"] } [profile.dev] split-debuginfo = "unpacked" diff --git a/node/cli/Cargo.toml b/node/cli/Cargo.toml index ed7e548bce..418d6db909 100644 --- a/node/cli/Cargo.toml +++ b/node/cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bifrost-cli" -version = "0.16.1" +version = "0.16.2" authors = ["Liebi Technologies "] description = "Bifrost Parachain Node" build = "build.rs" @@ -76,4 +76,4 @@ with-bifrost-kusama-runtime = ["bifrost-service/with-bifrost-kusama-runtime"] with-bifrost-polkadot-runtime = ["bifrost-service/with-bifrost-polkadot-runtime"] with-all-runtime = ["with-bifrost-runtime"] try-runtime = ["bifrost-service/try-runtime"] -fast-runtime = ["bifrost-service/fast-runtime"] \ No newline at end of file +fast-runtime = ["bifrost-service/fast-runtime"] diff --git a/node/cli/src/command.rs b/node/cli/src/command.rs index c9cfc26ba1..db719ed7b8 100644 --- a/node/cli/src/command.rs +++ b/node/cli/src/command.rs @@ -255,7 +255,9 @@ fn set_default_ss58_version(spec: &Box) { /// Parse command line arguments into service configuration. #[allow(unreachable_code)] pub fn run() -> Result<()> { - let cli = Cli::from_args(); + let mut cli = Cli::from_args(); + + cli.run.base.offchain_worker_params.indexing_enabled = true; match &cli.subcommand { Some(Subcommand::BuildSpec(cmd)) => { diff --git a/node/rpc/Cargo.toml b/node/rpc/Cargo.toml index f4b06acea9..6e9cda8360 100644 --- a/node/rpc/Cargo.toml +++ b/node/rpc/Cargo.toml @@ -68,3 +68,6 @@ fc-rpc-core = { workspace = true } fc-storage = { workspace = true } fp-rpc = { workspace = true, features = ["default"] } +pallet-ismp-runtime-api = { workspace = true } +pallet-ismp-rpc = { workspace = true } + diff --git a/node/rpc/src/lib.rs b/node/rpc/src/lib.rs index 3610a0fb1b..16060fa9b3 100644 --- a/node/rpc/src/lib.rs +++ b/node/rpc/src/lib.rs @@ -50,13 +50,16 @@ use bifrost_vtoken_minting_rpc_runtime_api::VtokenMintingRuntimeApi; use futures::channel::mpsc; use lend_market_rpc::{LendMarket, LendMarketApiServer}; use lend_market_rpc_runtime_api::LendMarketApi; +use pallet_ismp_rpc::{IsmpApiServer, IsmpRpcHandler}; use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer}; +use sc_client_api::{AuxStore, BlockBackend, ProofProvider}; use sc_consensus_manual_seal::rpc::{EngineCommand, ManualSeal, ManualSealApiServer}; use sc_rpc_api::DenyUnsafe; use sc_transaction_pool_api::TransactionPool; use sp_api::ProvideRuntimeApi; use sp_block_builder::BlockBuilder; use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata}; +use sp_core::H256; use sp_runtime::traits::BlockIdTo; use substrate_frame_rpc_system::{System, SystemApiServer}; use zenlink_protocol::AssetId; @@ -78,7 +81,7 @@ pub struct FullDeps { } /// Full client dependencies. -pub struct FullDepsPolkadot { +pub struct FullDepsPolkadot { /// The client instance to use. pub client: Arc, /// Transaction pool instance. @@ -87,6 +90,8 @@ pub struct FullDepsPolkadot { pub deny_unsafe: DenyUnsafe, /// Manual seal command sink pub command_sink: Option>>, + /// Backend used by the node. + pub backend: Arc, } /// A IO handler that uses all Full RPC extensions. @@ -140,12 +145,15 @@ where } /// RPC of bifrost-polkadot runtime. -pub fn create_full_polkadot( - deps: FullDepsPolkadot, +pub fn create_full_polkadot( + deps: FullDepsPolkadot, ) -> Result> where C: ProvideRuntimeApi + HeaderBackend + + AuxStore + + BlockBackend + + ProofProvider + HeaderMetadata + Send + Sync @@ -162,6 +170,10 @@ where C::Api: ZenlinkProtocolRuntimeApi, C::Api: StablePoolRuntimeApi, C::Api: BlockBuilder, + B: sc_client_api::Backend + Send + Sync + 'static, + B::State: sc_client_api::StateBackend>, + // pallet_ismp_runtime_api bound + C::Api: pallet_ismp_runtime_api::IsmpRuntimeApi, P: TransactionPool + Sync + Send + 'static, { let mut module = RpcExtension::new(()); @@ -170,6 +182,7 @@ where pool, deny_unsafe, command_sink, + backend, } = deps; module.merge(System::new(client.clone(), pool.clone(), deny_unsafe).into_rpc())?; @@ -182,7 +195,9 @@ where module.merge(ZenlinkProtocol::new(client.clone()).into_rpc())?; module.merge(StablePoolRpc::new(client.clone()).into_rpc())?; module.merge(LendMarket::new(client.clone()).into_rpc())?; - module.merge(VtokenMintingRpc::new(client).into_rpc())?; + module.merge(VtokenMintingRpc::new(client.clone()).into_rpc())?; + + module.merge(IsmpRpcHandler::new(client, backend.clone())?.into_rpc())?; if let Some(command_sink) = command_sink { module.merge( diff --git a/node/service/Cargo.toml b/node/service/Cargo.toml index 64b5126828..0123e20575 100644 --- a/node/service/Cargo.toml +++ b/node/service/Cargo.toml @@ -126,6 +126,8 @@ bifrost-salp-rpc-runtime-api = { workspace = true } bifrost-farming-rpc-runtime-api = { workspace = true } bb-bnc-rpc-runtime-api = { workspace = true } +ismp-parachain-inherent = { workspace = true } + [features] default = [ "std" ] std = [] diff --git a/node/service/src/collator_polkadot.rs b/node/service/src/collator_polkadot.rs index 73e4a7de5a..6b4a95ed35 100644 --- a/node/service/src/collator_polkadot.rs +++ b/node/service/src/collator_polkadot.rs @@ -283,8 +283,23 @@ fn start_consensus( client.clone(), ); + let (client_clone, relay_chain_interface_clone) = + (client.clone(), relay_chain_interface.clone()); let params = AuraParams { - create_inherent_data_providers: move |_, ()| async move { Ok(()) }, + create_inherent_data_providers: move |parent, ()| { + let client = client_clone.clone(); + let relay_chain_interface = relay_chain_interface_clone.clone(); + async move { + let inherent = ismp_parachain_inherent::ConsensusInherentProvider::create( + parent, + client, + relay_chain_interface, + ) + .await?; + + Ok(inherent) + } + }, block_import, para_client: client.clone(), para_backend: backend.clone(), @@ -426,6 +441,7 @@ where let pubsub_notification_sinks = Arc::new(pubsub_notification_sinks); let rpc_builder = { + let backend = backend.clone(); let client = client.clone(); let is_authority = parachain_config.role.is_authority(); let transaction_pool = transaction_pool.clone(); @@ -443,6 +459,7 @@ where pool: transaction_pool.clone(), deny_unsafe, command_sink: None, + backend: backend.clone(), }; let module = crate::rpc::create_full_polkadot(deps)?; diff --git a/node/service/src/dev.rs b/node/service/src/dev.rs index 60cda0bfcd..60a0d206a8 100644 --- a/node/service/src/dev.rs +++ b/node/service/src/dev.rs @@ -207,6 +207,7 @@ where let pubsub_notification_sinks = Arc::new(pubsub_notification_sinks); let rpc_builder = { + let backend = backend.clone(); let client = client.clone(); let is_authority = parachain_config.role.is_authority(); let transaction_pool = transaction_pool.clone(); @@ -224,6 +225,7 @@ where pool: transaction_pool.clone(), deny_unsafe, command_sink: Some(command_sink.clone()), + backend: backend.clone(), }; let module = crate::rpc::create_full_polkadot(deps)?; diff --git a/node/service/src/lib.rs b/node/service/src/lib.rs index dbf35cc57d..aecc3b2a89 100644 --- a/node/service/src/lib.rs +++ b/node/service/src/lib.rs @@ -35,17 +35,26 @@ pub trait IdentifyVariant { /// Returns if this is a configuration for the `Bifrost-Polkadot` network. fn is_bifrost_polkadot(&self) -> bool; + /// Returns if this is a configuration for the `Bifrost-Paseo` network. + fn is_bifrost_paseo(&self) -> bool; + /// Returns if this is a configuration for the `Dev` network. fn is_dev(&self) -> bool; } impl IdentifyVariant for Box { fn is_bifrost_kusama(&self) -> bool { - self.id().starts_with("bifrost") && !self.id().starts_with("bifrost_polkadot") + self.id().starts_with("bifrost") + && !self.id().starts_with("bifrost_polkadot") + && !self.id().starts_with("bifrost_paseo") } fn is_bifrost_polkadot(&self) -> bool { - self.id().starts_with("bifrost_polkadot") + self.id().starts_with("bifrost_polkadot") || self.id().starts_with("bifrost_paseo") + } + + fn is_bifrost_paseo(&self) -> bool { + self.id().starts_with("bifrost_paseo") } fn is_dev(&self) -> bool { diff --git a/pallets/asset-registry/src/lib.rs b/pallets/asset-registry/src/lib.rs index 31e2c617e7..95097cca05 100644 --- a/pallets/asset-registry/src/lib.rs +++ b/pallets/asset-registry/src/lib.rs @@ -23,7 +23,7 @@ #![cfg_attr(not(feature = "std"), no_std)] pub use bifrost_primitives::{ - AssetIds, CurrencyId, + AssetIds, AssetMetadata, CurrencyId, CurrencyId::{Native, Token, Token2}, CurrencyIdConversion, CurrencyIdMapping, CurrencyIdRegister, ForeignAssetId, LeasePeriod, ParaId, PoolId, TokenId, TokenInfo, TokenSymbol, @@ -36,10 +36,10 @@ use frame_support::{ weights::Weight, }; use frame_system::pallet_prelude::*; -use scale_info::{prelude::string::String, TypeInfo}; +use scale_info::prelude::string::String; use sp_runtime::{ traits::{One, UniqueSaturatedFrom}, - ArithmeticError, RuntimeDebug, + ArithmeticError, }; use sp_std::{boxed::Box, vec::Vec}; use xcm::{ @@ -62,14 +62,6 @@ pub use weights::WeightInfo; pub type BalanceOf = <::Currency as Currency<::AccountId>>::Balance; -#[derive(Clone, Eq, PartialEq, RuntimeDebug, Encode, Decode, TypeInfo)] -pub struct AssetMetadata { - pub name: Vec, - pub symbol: Vec, - pub decimals: u8, - pub minimal_balance: Balance, -} - #[frame_support::pallet] pub mod pallet { use super::*; @@ -545,7 +537,7 @@ impl CurrencyIdConversion for AssetIdMaps { } } -impl CurrencyIdRegister for AssetIdMaps { +impl CurrencyIdRegister>> for AssetIdMaps { fn check_token_registered(token_symbol: TokenSymbol) -> bool { CurrencyMetadatas::::get(CurrencyId::Token(token_symbol)).is_some() } @@ -625,4 +617,11 @@ impl CurrencyIdRegister for AssetIdMaps { }, ) } + + fn register_metadata( + currency_id: CurrencyId, + metadata: AssetMetadata>, + ) -> DispatchResult { + Pallet::::do_register_metadata(currency_id, &metadata) + } } diff --git a/pallets/bb-bnc/src/benchmarking.rs b/pallets/bb-bnc/src/benchmarking.rs index f6bff885f4..d074af5324 100644 --- a/pallets/bb-bnc/src/benchmarking.rs +++ b/pallets/bb-bnc/src/benchmarking.rs @@ -345,6 +345,7 @@ mod benchmarks { CurrencyId::VToken(TokenSymbol::BNC), 10_000.into(), 10_000_000_000_000.into(), + 1_000.into(), ); Ok(()) @@ -391,7 +392,8 @@ mod benchmarks { RawOrigin::Root.into(), CurrencyId::VToken(TokenSymbol::BNC), 1_000.into(), - 10_000_000_000_000.into() + 10_000_000_000_000.into(), + 1_000.into(), )); >::set_block_number((2 * 365 * 86400 / 12u32).into()); @@ -446,7 +448,8 @@ mod benchmarks { RawOrigin::Root.into(), CurrencyId::VToken(TokenSymbol::BNC), 1_000.into(), - 10_000_000_000_000.into() + 10_000_000_000_000.into(), + 1_000.into(), )); assert_ok!(BbBNC::::deposit_markup( @@ -507,7 +510,8 @@ mod benchmarks { RawOrigin::Root.into(), CurrencyId::VToken(TokenSymbol::BNC), 1_000.into(), - 10_000_000_000_000.into() + 10_000_000_000_000.into(), + 1_000.into(), )); assert_ok!(BbBNC::::deposit_markup( @@ -565,7 +569,8 @@ mod benchmarks { RawOrigin::Root.into(), CurrencyId::VToken(TokenSymbol::BNC), 1_000.into(), - 10_000_000_000_000.into() + 10_000_000_000_000.into(), + 1_000.into(), )); assert_ok!(BbBNC::::deposit_markup( diff --git a/pallets/bb-bnc/src/lib.rs b/pallets/bb-bnc/src/lib.rs index ad6126afa4..e143dc27db 100644 --- a/pallets/bb-bnc/src/lib.rs +++ b/pallets/bb-bnc/src/lib.rs @@ -48,7 +48,7 @@ use frame_system::pallet_prelude::*; pub use incentive::*; use orml_traits::{LockIdentifier, MultiCurrency, MultiLockableCurrency}; use sp_core::{U256, U512}; -use sp_std::{borrow::ToOwned, cmp::Ordering, collections::btree_map::BTreeMap, vec, vec::Vec}; +use sp_std::{borrow::ToOwned, collections::btree_map::BTreeMap, vec, vec::Vec}; pub use traits::{BbBNCInterface, LockedToken, MarkupCoefficientInfo, MarkupInfo, UserMarkupInfo}; pub use weights::WeightInfo; @@ -588,12 +588,10 @@ pub mod pallet { currency_id: CurrencyId, markup: FixedU128, hardcap: FixedU128, + rwi: FixedU128, ) -> DispatchResult { T::ControlOrigin::ensure_origin(origin)?; - if !TotalLock::::contains_key(currency_id) { - TotalLock::::insert(currency_id, BalanceOf::::zero()); - } let current_block_number: BlockNumberFor = T::BlockNumberProvider::current_block_number(); MarkupCoefficient::::insert( @@ -602,6 +600,7 @@ pub mod pallet { markup_coefficient: markup, hardcap, update_block: current_block_number, + rwi, }, ); Ok(()) @@ -654,7 +653,7 @@ pub mod pallet { } impl Pallet { - pub fn _checkpoint( + pub fn checkpoint( who: &AccountIdOf, position: PositionId, old_locked: LockedBalance, BlockNumberFor>, @@ -834,7 +833,7 @@ pub mod pallet { Ok(()) } - pub fn _deposit_for( + pub fn deposit_for_inner( who: &AccountIdOf, position: PositionId, value: BalanceOf, @@ -843,22 +842,22 @@ pub mod pallet { ) -> DispatchResult { let current_block_number: BlockNumberFor = T::BlockNumberProvider::current_block_number(); - let mut _locked = locked_balance; + let mut locked = locked_balance; let supply_before = Supply::::get(); let supply_after = supply_before .checked_add(value) .ok_or(ArithmeticError::Overflow)?; Supply::::set(supply_after); - let old_locked = _locked.clone(); - _locked.amount = _locked + let old_locked = locked.clone(); + locked.amount = locked .amount .checked_add(value) .ok_or(ArithmeticError::Overflow)?; if unlock_time != Zero::zero() { - _locked.end = unlock_time + locked.end = unlock_time } - Locked::::insert(position, _locked.clone()); + Locked::::insert(position, locked.clone()); let free_balance = T::MultiCurrency::free_balance(T::TokenType::get(), &who); if value != BalanceOf::::zero() { @@ -876,7 +875,7 @@ pub mod pallet { who, position, old_locked, - _locked.clone(), + locked.clone(), UserMarkupInfos::::get(who).as_ref(), )?; @@ -884,8 +883,8 @@ pub mod pallet { who: who.clone(), position, value, - total_value: _locked.amount, - end: _locked.end, + total_value: locked.amount, + end: locked.end, now: current_block_number, }); Self::deposit_event(Event::Supply { @@ -1040,7 +1039,7 @@ pub mod pallet { .ok_or(ArithmeticError::Overflow)?; } - Self::_checkpoint(who, position, old_locked.clone(), new_locked.clone())?; + Self::checkpoint(who, position, old_locked.clone(), new_locked.clone())?; Ok(()) } @@ -1072,8 +1071,7 @@ pub mod pallet { }); locked_token.amount = locked_token.amount.saturating_add(value); - let left: FixedU128 = FixedU128::checked_from_integer(locked_token.amount) - .and_then(|x| x.checked_mul(&markup_coefficient.markup_coefficient)) + let ri = FixedU128::checked_from_integer(locked_token.amount) .and_then(|x| { x.checked_div(&FixedU128::checked_from_integer(TotalLock::::get( currency_id, @@ -1081,21 +1079,20 @@ pub mod pallet { }) .ok_or(ArithmeticError::Overflow)?; - let total_issuance = T::MultiCurrency::total_issuance(currency_id); - let right: FixedU128 = FixedU128::checked_from_integer(locked_token.amount) - .and_then(|x| x.checked_mul(&markup_coefficient.markup_coefficient)) - .and_then(|x| x.checked_div(&FixedU128::checked_from_integer(total_issuance)?)) + let ni = locked_token.amount; + let ti = T::MultiCurrency::total_issuance(currency_id); + let wi = markup_coefficient.markup_coefficient; + let left = markup_coefficient + .rwi + .checked_mul(&ri) + .ok_or(ArithmeticError::Overflow)?; + let right = FixedU128::checked_from_integer(ni) + .and_then(|x| x.checked_mul(&wi)) + .and_then(|x| x.checked_div(&FixedU128::checked_from_integer(ti)?)) .ok_or(ArithmeticError::Overflow)?; + let b = left.checked_add(&right).ok_or(ArithmeticError::Overflow)?; - let currency_id_markup_coefficient: FixedU128 = - left.checked_add(&right).ok_or(ArithmeticError::Overflow)?; - let new_markup_coefficient = match markup_coefficient - .hardcap - .cmp(¤cy_id_markup_coefficient) - { - Ordering::Less => markup_coefficient.hardcap, - Ordering::Equal | Ordering::Greater => currency_id_markup_coefficient, - }; + let new_markup_coefficient = markup_coefficient.hardcap.min(b); Self::update_markup_info( &who, user_markup_info @@ -1111,14 +1108,14 @@ pub mod pallet { LockedTokens::::insert(¤cy_id, &who, locked_token); UserPositions::::get(&who).into_iter().try_for_each( |position| -> DispatchResult { - let _locked: LockedBalance, BlockNumberFor> = + let locked: LockedBalance, BlockNumberFor> = Locked::::get(position); - ensure!(!_locked.amount.is_zero(), Error::::ArgumentsError); + ensure!(!locked.amount.is_zero(), Error::::ArgumentsError); Self::markup_calc( &who, position, - _locked.clone(), - _locked, + locked.clone(), + locked, Some(&user_markup_info), ) }, @@ -1137,7 +1134,10 @@ pub mod pallet { who: &AccountIdOf, currency_id: CurrencyIdOf, ) -> DispatchResult { - let _ = MarkupCoefficient::::get(currency_id).ok_or(Error::::ArgumentsError)?; // Ensure it is the correct token type. + ensure!( + MarkupCoefficient::::contains_key(currency_id), + Error::::ArgumentsError + ); // Ensure it is the correct token type. let mut user_markup_info = UserMarkupInfos::::get(&who).unwrap_or_default(); @@ -1161,14 +1161,14 @@ pub mod pallet { LockedTokens::::remove(¤cy_id, &who); UserPositions::::get(&who).into_iter().try_for_each( |position| -> DispatchResult { - let _locked: LockedBalance, BlockNumberFor> = + let locked: LockedBalance, BlockNumberFor> = Locked::::get(position); - ensure!(!_locked.amount.is_zero(), Error::::ArgumentsError); // TODO + ensure!(!locked.amount.is_zero(), Error::::ArgumentsError); // TODO Self::markup_calc( &who, position, - _locked.clone(), - _locked, + locked.clone(), + locked, Some(&user_markup_info), ) }, @@ -1200,8 +1200,10 @@ pub mod pallet { if locked_token.refresh_block <= markup_coefficient.update_block { locked_token.refresh_block = current_block_number; - let left: FixedU128 = FixedU128::checked_from_integer(locked_token.amount) - .and_then(|x| x.checked_mul(&markup_coefficient.markup_coefficient)) + let mut user_markup_info = + UserMarkupInfos::::get(&who).ok_or(Error::::LockNotExist)?; + + let ri = FixedU128::checked_from_integer(locked_token.amount) .and_then(|x| { x.checked_div(&FixedU128::checked_from_integer(TotalLock::::get( currency_id, @@ -1209,26 +1211,21 @@ pub mod pallet { }) .ok_or(ArithmeticError::Overflow)?; - let total_issuance = T::MultiCurrency::total_issuance(currency_id); - let right: FixedU128 = FixedU128::checked_from_integer(locked_token.amount) - .and_then(|x| x.checked_mul(&markup_coefficient.markup_coefficient)) - .and_then(|x| { - x.checked_div(&FixedU128::checked_from_integer(total_issuance)?) - }) - .ok_or(ArithmeticError::Overflow)?; - let currency_id_markup_coefficient: FixedU128 = - left.checked_add(&right).ok_or(ArithmeticError::Overflow)?; + let ni = locked_token.amount; + let ti = T::MultiCurrency::total_issuance(currency_id); + let wi = markup_coefficient.markup_coefficient; - let mut user_markup_info = - UserMarkupInfos::::get(&who).ok_or(Error::::LockNotExist)?; + let left = markup_coefficient + .rwi + .checked_mul(&ri) + .ok_or(ArithmeticError::Overflow)?; + let right = FixedU128::checked_from_integer(ni) + .and_then(|x| x.checked_mul(&wi)) + .and_then(|x| x.checked_div(&FixedU128::checked_from_integer(ti)?)) + .ok_or(ArithmeticError::Overflow)?; + let b = left.checked_add(&right).ok_or(ArithmeticError::Overflow)?; - let new_markup_coefficient = match markup_coefficient - .hardcap - .cmp(¤cy_id_markup_coefficient) - { - Ordering::Less => markup_coefficient.hardcap, - Ordering::Equal | Ordering::Greater => currency_id_markup_coefficient, - }; + let new_markup_coefficient = markup_coefficient.hardcap.min(b); Self::update_markup_info( &who, user_markup_info @@ -1241,14 +1238,14 @@ pub mod pallet { LockedTokens::::insert(¤cy_id, &who, locked_token); UserPositions::::get(&who).into_iter().try_for_each( |position| -> DispatchResult { - let _locked: LockedBalance, BlockNumberFor> = + let locked: LockedBalance, BlockNumberFor> = Locked::::get(position); - ensure!(!_locked.amount.is_zero(), Error::::ArgumentsError); // TODO + ensure!(!locked.amount.is_zero(), Error::::ArgumentsError); // TODO Self::markup_calc( &who, position, - _locked.clone(), - _locked, + locked.clone(), + locked, Some(&user_markup_info), ) }, @@ -1278,19 +1275,19 @@ pub mod pallet { pub fn withdraw_no_ensure( who: &AccountIdOf, position: PositionId, - mut _locked: LockedBalance, BlockNumberFor>, + mut locked: LockedBalance, BlockNumberFor>, if_fast: Option, ) -> DispatchResult { - let value = _locked.amount; - let old_locked: LockedBalance, BlockNumberFor> = _locked.clone(); - _locked.end = Zero::zero(); - _locked.amount = Zero::zero(); - Locked::::insert(position, _locked.clone()); + let value = locked.amount; + let old_locked: LockedBalance, BlockNumberFor> = locked.clone(); + locked.end = Zero::zero(); + locked.amount = Zero::zero(); + Locked::::insert(position, locked.clone()); let supply_before = Supply::::get(); let supply_after = supply_before .checked_sub(value) - .ok_or(ArithmeticError::Overflow)?; + .ok_or(ArithmeticError::Underflow)?; Supply::::set(supply_after); // BNC should be transferred before checkpoint @@ -1314,7 +1311,7 @@ pub mod pallet { } } - Self::_checkpoint(who, position, old_locked, _locked.clone())?; + Self::checkpoint(who, position, old_locked, locked.clone())?; T::FarmingInfo::refresh_gauge_pool(who)?; Self::deposit_event(Event::Withdrawn { @@ -1349,12 +1346,12 @@ pub mod pallet { /// This function will check the lock and redeem it regardless of whether it has expired. pub fn redeem_unlock_inner(who: &AccountIdOf, position: PositionId) -> DispatchResult { - let mut _locked = Locked::::get(position); + let locked = Locked::::get(position); let current_block_number: BlockNumberFor = T::BlockNumberProvider::current_block_number(); - ensure!(_locked.end > current_block_number, Error::::Expired); - let fast = Self::redeem_commission(_locked.end - current_block_number)?; - Self::withdraw_no_ensure(who, position, _locked, Some(fast)) + ensure!(locked.end > current_block_number, Error::::Expired); + let fast = Self::redeem_commission(locked.end - current_block_number)?; + Self::withdraw_no_ensure(who, position, locked, Some(fast)) } fn set_ve_locked(who: &AccountIdOf, new_locked_balance: BalanceOf) -> DispatchResult { @@ -1388,11 +1385,11 @@ impl BbBNCInterface, CurrencyIdOf, BalanceOf, Bl unlock_time: BlockNumberFor, ) -> DispatchResult { let new_position = Position::::get(); - let mut user_positions = UserPositions::::get(who); - user_positions - .try_push(new_position) - .map_err(|_| Error::::ExceedsMaxPositions)?; - UserPositions::::insert(who, user_positions); + UserPositions::::try_mutate(who, |user_positions| { + user_positions + .try_push(new_position) + .map_err(|_| Error::::ExceedsMaxPositions) + })?; Position::::set(new_position + 1); let bb_config = BbConfigs::::get(); @@ -1400,8 +1397,7 @@ impl BbBNCInterface, CurrencyIdOf, BalanceOf, Bl let current_block_number: BlockNumberFor = T::BlockNumberProvider::current_block_number(); - let _locked: LockedBalance, BlockNumberFor> = - Locked::::get(new_position); + let locked: LockedBalance, BlockNumberFor> = Locked::::get(new_position); let real_unlock_time: BlockNumberFor = unlock_time .saturating_add(current_block_number) .checked_div(&T::Week::get()) @@ -1423,11 +1419,11 @@ impl BbBNCInterface, CurrencyIdOf, BalanceOf, Bl .ok_or(ArithmeticError::Overflow)?; ensure!(real_unlock_time <= max_block, Error::::ArgumentsError); ensure!( - _locked.amount == BalanceOf::::zero(), + locked.amount == BalanceOf::::zero(), Error::::LockExist ); // Withdraw old tokens first - Self::_deposit_for(who, new_position, value, real_unlock_time, _locked)?; + Self::deposit_for_inner(who, new_position, value, real_unlock_time, locked)?; T::FarmingInfo::refresh_gauge_pool(who)?; Self::deposit_event(Event::LockCreated { who: who.to_owned(), @@ -1474,7 +1470,7 @@ impl BbBNCInterface, CurrencyIdOf, BalanceOf, Bl Error::::LockNotExist ); - Self::_deposit_for( + Self::deposit_for_inner( who, position, BalanceOf::::zero(), @@ -1498,15 +1494,15 @@ impl BbBNCInterface, CurrencyIdOf, BalanceOf, Bl ) -> DispatchResult { let bb_config = BbConfigs::::get(); ensure!(value >= bb_config.min_mint, Error::::BelowMinimumMint); - let _locked: LockedBalance, BlockNumberFor> = Locked::::get(position); + let locked: LockedBalance, BlockNumberFor> = Locked::::get(position); ensure!( - _locked.amount > BalanceOf::::zero(), + locked.amount > BalanceOf::::zero(), Error::::LockNotExist ); // Need to be executed after create_lock let current_block_number: BlockNumberFor = T::BlockNumberProvider::current_block_number(); - ensure!(_locked.end > current_block_number, Error::::Expired); // Cannot add to expired/non-existent lock - Self::_deposit_for(who, position, value, Zero::zero(), _locked)?; + ensure!(locked.end > current_block_number, Error::::Expired); // Cannot add to expired/non-existent lock + Self::deposit_for_inner(who, position, value, Zero::zero(), locked)?; T::FarmingInfo::refresh_gauge_pool(who)?; Self::deposit_event(Event::AmountIncreased { who: who.to_owned(), @@ -1518,17 +1514,17 @@ impl BbBNCInterface, CurrencyIdOf, BalanceOf, Bl #[transactional] fn deposit_for(who: &AccountIdOf, position: u128, value: BalanceOf) -> DispatchResult { - let _locked: LockedBalance, BlockNumberFor> = Locked::::get(position); - Self::_deposit_for(who, position, value, Zero::zero(), _locked) + let locked: LockedBalance, BlockNumberFor> = Locked::::get(position); + Self::deposit_for_inner(who, position, value, Zero::zero(), locked) } #[transactional] fn withdraw_inner(who: &AccountIdOf, position: u128) -> DispatchResult { - let mut _locked = Locked::::get(position); + let locked = Locked::::get(position); let current_block_number: BlockNumberFor = T::BlockNumberProvider::current_block_number(); - ensure!(current_block_number >= _locked.end, Error::::Expired); - Self::withdraw_no_ensure(who, position, _locked, None) + ensure!(current_block_number >= locked.end, Error::::Expired); + Self::withdraw_no_ensure(who, position, locked, None) } fn balance_of( @@ -1651,16 +1647,17 @@ impl BbBNCInterface, CurrencyIdOf, BalanceOf, Bl rewards_duration: Option>, controller: Option>, ) { - let mut incentive_config = IncentiveConfigs::::get(pool_id); - - if let Some(rewards_duration) = rewards_duration { - incentive_config.rewards_duration = rewards_duration; - }; - if let Some(controller) = controller { - incentive_config.incentive_controller = Some(controller.clone()); - } - IncentiveConfigs::::set(pool_id, incentive_config.clone()); - Self::deposit_event(Event::IncentiveSet { incentive_config }); + IncentiveConfigs::::mutate(pool_id, |incentive_config| { + if let Some(rewards_duration) = rewards_duration { + incentive_config.rewards_duration = rewards_duration; + }; + if let Some(controller) = controller { + incentive_config.incentive_controller = Some(controller.clone()); + } + Self::deposit_event(Event::IncentiveSet { + incentive_config: incentive_config.clone(), + }); + }) } #[transactional] diff --git a/pallets/bb-bnc/src/tests.rs b/pallets/bb-bnc/src/tests.rs index 3b0e142e01..788990c7b2 100644 --- a/pallets/bb-bnc/src/tests.rs +++ b/pallets/bb-bnc/src/tests.rs @@ -28,6 +28,7 @@ use frame_support::{assert_noop, assert_ok}; const POSITIONID0: u128 = 0; const POSITIONID1: u128 = 1; +const RWI: FixedU128 = FixedU128::from_inner(100_000_000_000_000_000); #[test] fn create_lock_should_work() { @@ -660,12 +661,14 @@ fn deposit_markup_before_lock_should_work() { VBNC, FixedU128::from_inner(100_000_000_000_000_000), // 0.1 FixedU128::saturating_from_integer(1), + RWI, )); assert_ok!(BbBNC::deposit_markup( RuntimeOrigin::signed(BOB), VBNC, 10_000_000_000_000 )); + assert_eq!(TotalLock::::get(VBNC), 10_000_000_000_000); assert_ok!(BbBNC::create_lock_inner( &BOB, 10_000_000_000_000, @@ -716,6 +719,7 @@ fn deposit_markup_before_lock_should_not_work() { VBNC, FixedU128::from_inner(100_000_000_000_000_000), // 0.1 FixedU128::saturating_from_integer(1), + RWI, )); assert_noop!( @@ -765,6 +769,7 @@ fn deposit_markup_before_lock_should_work2() { VBNC, FixedU128::from_inner(100_000_000_000_000_000), // 0.1 FixedU128::saturating_from_integer(1), + RWI, )); assert_ok!(BbBNC::deposit_markup( RuntimeOrigin::signed(BOB), @@ -842,6 +847,7 @@ fn deposit_markup_after_lock_should_work2() { MOVR, FixedU128::from_inner(500_000_000_000_000_000), // 0.5 FixedU128::saturating_from_integer(1), + FixedU128::from_inner(500_000_000_000_000_000), )); assert_eq!( UserPointHistory::::get(POSITIONID0, U256::from(1)), @@ -939,6 +945,7 @@ fn deposit_markup_after_lock_should_not_work2() { MOVR, FixedU128::from_inner(500_000_000_000_000_000), // 0.5 FixedU128::saturating_from_integer(1), + FixedU128::from_inner(500_000_000_000_000_000), )); assert_ok!(BbBNC::deposit_markup( RuntimeOrigin::signed(BOB), @@ -1009,11 +1016,17 @@ fn deposit_markup_after_lock_should_work() { 10_000_000_000_000, System::block_number() + 365 * 86400 / 12, )); + assert_ok!(BbBNC::create_lock_inner( + &ALICE, + 10_000_000_000_000, + System::block_number() + 365 * 86400 / 12, + )); assert_ok!(BbBNC::set_markup_coefficient( RuntimeOrigin::root(), VBNC, FixedU128::from_inner(100_000_000_000_000_000), // 0.1 FixedU128::saturating_from_integer(1), + FixedU128::from_inner(100_000_000_000_000_000), )); assert_eq!( @@ -1030,6 +1043,13 @@ fn deposit_markup_after_lock_should_work() { VBNC, 10_000_000_000_000 )); + assert_eq!(TotalLock::::get(VBNC), 10_000_000_000_000); + assert_ok!(BbBNC::deposit_markup( + RuntimeOrigin::signed(ALICE), + VBNC, + 10_000_000_000_000 + )); + assert_eq!(TotalLock::::get(VBNC), 20_000_000_000_000); assert_eq!( UserPointHistory::::get(POSITIONID0, U256::from(2)), Point { @@ -1047,6 +1067,26 @@ fn deposit_markup_after_lock_should_work() { BbBNC::balance_of(&BOB, Some(System::block_number())), Ok(2796030953200) ); + assert_eq!( + BbBNC::balance_of(&ALICE, Some(System::block_number())), + Ok(2668976276500) + ); + assert_ok!(BbBNC::set_markup_coefficient( + RuntimeOrigin::root(), + VBNC, + FixedU128::from_inner(100_000_000_000_000_000), // 0.1 + FixedU128::saturating_from_integer(1), + FixedU128::from_inner(50_000_000_000_000_000), // 0.05 + )); + assert_ok!(BbBNC::refresh_inner(VBNC)); + assert_eq!( + BbBNC::balance_of(&BOB, Some(System::block_number())), + Ok(2605450273740) + ); + assert_eq!( + BbBNC::balance_of(&ALICE, Some(System::block_number())), + Ok(2605450273740) + ); }); } @@ -1074,6 +1114,7 @@ fn withdraw_markup_after_lock_should_work() { VBNC, FixedU128::from_inner(100_000_000_000_000_000), // 0.1 FixedU128::saturating_from_integer(1), + RWI, )); assert_ok!(BbBNC::deposit_markup( RuntimeOrigin::signed(BOB), @@ -1129,6 +1170,7 @@ fn redeem_unlock_should_work() { VKSM, FixedU128::from_inner(FixedU128::DIV / 10), // 0.1 FixedU128::saturating_from_integer(1), + RWI, )); assert_ok!(BbBNC::deposit_markup( RuntimeOrigin::signed(BOB), @@ -1207,6 +1249,7 @@ fn withdraw_markup_after_lock_should_work3() { VBNC, FixedU128::from_inner(100_000_000_000_000_000), // 0.1 FixedU128::saturating_from_integer(1), + RWI, )); assert_ok!(BbBNC::deposit_markup( RuntimeOrigin::signed(BOB), @@ -1289,6 +1332,7 @@ fn withdraw_markup_after_lock_should_not_work() { VBNC, FixedU128::from_inner(100_000_000_000_000_000), // 0.1 FixedU128::saturating_from_integer(1), + RWI, )); assert_ok!(BbBNC::deposit_markup( RuntimeOrigin::signed(BOB), @@ -1372,6 +1416,7 @@ fn redeem_unlock_after_360_days_should_work() { VKSM, FixedU128::from_inner(FixedU128::DIV / 10), // 0.1 FixedU128::saturating_from_integer(1), + RWI, )); assert_ok!(BbBNC::deposit_markup( RuntimeOrigin::signed(BOB), @@ -1441,6 +1486,7 @@ fn redeem_unlock_after_360_days_should_not_work() { VKSM, FixedU128::from_inner(FixedU128::DIV / 10), // 0.1 FixedU128::saturating_from_integer(1), + RWI, )); assert_ok!(BbBNC::deposit_markup( RuntimeOrigin::signed(BOB), @@ -1485,6 +1531,7 @@ fn redeem_unlock_after_360_days_should_work2() { VKSM, FixedU128::from_inner(FixedU128::DIV / 10), // 0.1 FixedU128::saturating_from_integer(1), + RWI, )); assert_ok!(BbBNC::deposit_markup( RuntimeOrigin::signed(BOB), @@ -1579,6 +1626,7 @@ fn refresh_should_work() { VBNC, FixedU128::from_inner(100_000_000_000_000_000), // 0.1 FixedU128::saturating_from_integer(1), + RWI, )); assert_ok!(BbBNC::deposit_markup( RuntimeOrigin::signed(BOB), @@ -1596,6 +1644,7 @@ fn refresh_should_work() { VBNC, FixedU128::from_inner(200_000_000_000_000_000), // 0.2 FixedU128::saturating_from_integer(1), + FixedU128::from_inner(200_000_000_000_000_000) )); assert_eq!( UserPointHistory::::get(POSITIONID0, U256::one()), diff --git a/pallets/bb-bnc/src/traits.rs b/pallets/bb-bnc/src/traits.rs index efd6433923..50dddadc93 100644 --- a/pallets/bb-bnc/src/traits.rs +++ b/pallets/bb-bnc/src/traits.rs @@ -35,8 +35,8 @@ pub trait BbBNCInterface { who: &AccountId, value: Balance, unlock_time: BlockNumber, - ) -> DispatchResult; // Deposit `_value` BNC for `who` and lock until `_unlock_time` - fn increase_amount_inner(who: &AccountId, position: u128, value: Balance) -> DispatchResult; // Deposit `_value` additional BNC for `who` without modifying the unlock time + ) -> DispatchResult; // Deposit `value` BNC for `who` and lock until `_unlock_time` + fn increase_amount_inner(who: &AccountId, position: u128, value: Balance) -> DispatchResult; // Deposit `value` additional BNC for `who` without modifying the unlock time fn increase_unlock_time_inner( who: &AccountId, position: u128, @@ -194,6 +194,7 @@ pub struct MarkupCoefficientInfo { pub markup_coefficient: FixedU128, pub hardcap: FixedU128, pub update_block: BlockNumber, + pub rwi: FixedU128, } pub trait MarkupInfo { diff --git a/pallets/buy-back/src/lib.rs b/pallets/buy-back/src/lib.rs index 4631c37332..138efcd2b5 100644 --- a/pallets/buy-back/src/lib.rs +++ b/pallets/buy-back/src/lib.rs @@ -30,8 +30,9 @@ mod benchmarking; pub mod weights; -use bb_bnc::{BbBNCInterface, BB_BNC_SYSTEM_POOL_ID}; -use bifrost_primitives::{currency::BNC, CurrencyId, CurrencyIdRegister, TryConvertFrom}; +use bifrost_primitives::{ + currency::BNC, AssetMetadata, CurrencyId, CurrencyIdRegister, TryConvertFrom, +}; use cumulus_primitives_core::ParaId; use frame_support::{ pallet_prelude::*, @@ -87,14 +88,7 @@ pub mod pallet { type ParachainId: Get; - type CurrencyIdRegister: CurrencyIdRegister; - - type BbBNC: BbBNCInterface< - AccountIdOf, - CurrencyIdOf, - BalanceOf, - BlockNumberFor, - >; + type CurrencyIdRegister: CurrencyIdRegister>>; /// The current block number provider. type BlockNumberProvider: BlockNumberProvider>; @@ -453,11 +447,9 @@ pub mod pallet { let destruction_amount = ratio * bnc_balance_before_burn; T::MultiCurrency::withdraw(BNC, &buyback_address, destruction_amount)?; } - T::BbBNC::notify_reward( - BB_BNC_SYSTEM_POOL_ID, - &Some(buyback_address.clone()), - vec![BNC], - ) + let bnc_balance_after_burn = T::MultiCurrency::free_balance(BNC, &buyback_address); + let buyback_to = T::BuyBackAccount::get().into_sub_account_truncating(1); + T::MultiCurrency::transfer(BNC, &buyback_address, &buyback_to, bnc_balance_after_burn) } #[transactional] diff --git a/pallets/buy-back/src/mock.rs b/pallets/buy-back/src/mock.rs index 5873683215..b24d5104bd 100644 --- a/pallets/buy-back/src/mock.rs +++ b/pallets/buy-back/src/mock.rs @@ -177,7 +177,6 @@ impl bifrost_buy_back::Config for Runtime { type LiquidityAccount = LiquidityAccount; type ParachainId = ParaInfo; type CurrencyIdRegister = AssetIdMaps; - type BbBNC = BbBNC; type BlockNumberProvider = System; } diff --git a/pallets/buy-back/src/tests.rs b/pallets/buy-back/src/tests.rs index 917fd03e28..ed245392c9 100644 --- a/pallets/buy-back/src/tests.rs +++ b/pallets/buy-back/src/tests.rs @@ -21,7 +21,6 @@ #![cfg(test)] use crate::{mock::*, *}; -use bifrost_primitives::IncentivePalletId; use frame_support::{assert_noop, assert_ok}; use sp_arithmetic::per_things::Permill; @@ -109,7 +108,8 @@ fn buy_back_with_burn_should_work() { )); let buyback_account = ::BuyBackAccount::get().into_account_truncating(); - let incentive_account = IncentivePalletId::get().into_account_truncating(); + let incentive_account = + ::BuyBackAccount::get().into_sub_account_truncating(1); assert_eq!(Currencies::free_balance(VKSM, &buyback_account), 9000); assert_eq!( Currencies::free_balance(VKSM, &zenlink_pair_account_id), @@ -121,11 +121,6 @@ fn buy_back_with_burn_should_work() { ); assert_eq!(Currencies::free_balance(BNC, &buyback_account), 0); assert_eq!(Currencies::free_balance(BNC, &incentive_account), 0); - BbBNC::set_incentive( - BB_BNC_SYSTEM_POOL_ID, - Some(7 * 86400 / 12), - Some(buyback_account.clone()), - ); assert_ok!(BuyBack::charge(RuntimeOrigin::signed(ALICE), VKSM, 1000)); let infos = Infos::::get(VKSM).unwrap(); assert_ok!(BuyBack::buy_back(&buyback_account, VKSM, &infos, 0)); @@ -167,7 +162,8 @@ fn buy_back_no_burn_should_work() { )); let buyback_account = ::BuyBackAccount::get().into_account_truncating(); - let incentive_account = IncentivePalletId::get().into_account_truncating(); + let incentive_account = + ::BuyBackAccount::get().into_sub_account_truncating(1); assert_eq!(Currencies::free_balance(VKSM, &buyback_account), 9000); assert_eq!( Currencies::free_balance(VKSM, &zenlink_pair_account_id), @@ -179,11 +175,6 @@ fn buy_back_no_burn_should_work() { ); assert_eq!(Currencies::free_balance(BNC, &buyback_account), 0); assert_eq!(Currencies::free_balance(BNC, &incentive_account), 0); - BbBNC::set_incentive( - BB_BNC_SYSTEM_POOL_ID, - Some(7 * 86400 / 12), - Some(buyback_account.clone()), - ); assert_ok!(BuyBack::charge(RuntimeOrigin::signed(ALICE), VKSM, 1000)); let infos = Infos::::get(VKSM).unwrap(); assert_ok!(BuyBack::buy_back(&buyback_account, VKSM, &infos, 0)); @@ -225,7 +216,8 @@ fn on_initialize_no_burn_should_work() { )); let buyback_account = ::BuyBackAccount::get().into_account_truncating(); - let incentive_account = IncentivePalletId::get().into_account_truncating(); + let incentive_account = + ::BuyBackAccount::get().into_sub_account_truncating(1); assert_eq!(Currencies::free_balance(VKSM, &buyback_account), 9000); assert_eq!( Currencies::free_balance(VKSM, &zenlink_pair_account_id), @@ -237,11 +229,6 @@ fn on_initialize_no_burn_should_work() { ); assert_eq!(Currencies::free_balance(BNC, &buyback_account), 0); assert_eq!(Currencies::free_balance(BNC, &incentive_account), 0); - BbBNC::set_incentive( - BB_BNC_SYSTEM_POOL_ID, - Some(7 * 86400 / 12), - Some(buyback_account.clone()), - ); assert_ok!(BuyBack::charge(RuntimeOrigin::signed(ALICE), VKSM, 1000)); System::set_block_number(1); BuyBack::on_initialize(1); @@ -286,7 +273,8 @@ fn on_initialize_with_burn_should_work() { )); let buyback_account = ::BuyBackAccount::get().into_account_truncating(); - let incentive_account = IncentivePalletId::get().into_account_truncating(); + let incentive_account = + ::BuyBackAccount::get().into_sub_account_truncating(1); assert_eq!(Currencies::free_balance(VKSM, &buyback_account), 9000); assert_eq!( Currencies::free_balance(VKSM, &zenlink_pair_account_id), @@ -298,11 +286,6 @@ fn on_initialize_with_burn_should_work() { ); assert_eq!(Currencies::free_balance(BNC, &buyback_account), 0); assert_eq!(Currencies::free_balance(BNC, &incentive_account), 0); - BbBNC::set_incentive( - BB_BNC_SYSTEM_POOL_ID, - Some(7 * 86400 / 12), - Some(buyback_account.clone()), - ); assert_ok!(BuyBack::charge(RuntimeOrigin::signed(ALICE), VKSM, 1000)); System::set_block_number(System::block_number() + 1); BuyBack::on_initialize(0); @@ -345,7 +328,8 @@ fn on_initialize_with_bias_should_work() { )); let buyback_account = ::BuyBackAccount::get().into_account_truncating(); - let incentive_account = IncentivePalletId::get().into_account_truncating(); + let incentive_account = + ::BuyBackAccount::get().into_sub_account_truncating(1); assert_eq!(Currencies::free_balance(VKSM, &buyback_account), 9000); assert_eq!( Currencies::free_balance(VKSM, &zenlink_pair_account_id), @@ -357,11 +341,6 @@ fn on_initialize_with_bias_should_work() { ); assert_eq!(Currencies::free_balance(BNC, &buyback_account), 0); assert_eq!(Currencies::free_balance(BNC, &incentive_account), 0); - BbBNC::set_incentive( - BB_BNC_SYSTEM_POOL_ID, - Some(7 * 86400 / 12), - Some(buyback_account.clone()), - ); assert_ok!(BuyBack::charge(RuntimeOrigin::signed(ALICE), VKSM, 1000)); System::set_block_number(1); BuyBack::on_initialize(1); @@ -419,7 +398,8 @@ fn on_initialize_with_bias_should_not_work() { )); let buyback_account = ::BuyBackAccount::get().into_account_truncating(); - let incentive_account = IncentivePalletId::get().into_account_truncating(); + let incentive_account = + ::BuyBackAccount::get().into_sub_account_truncating(1); assert_eq!(Currencies::free_balance(VKSM, &buyback_account), 9000); assert_eq!( Currencies::free_balance(VKSM, &zenlink_pair_account_id), @@ -431,11 +411,6 @@ fn on_initialize_with_bias_should_not_work() { ); assert_eq!(Currencies::free_balance(BNC, &buyback_account), 0); assert_eq!(Currencies::free_balance(BNC, &incentive_account), 0); - BbBNC::set_incentive( - BB_BNC_SYSTEM_POOL_ID, - Some(7 * 86400 / 12), - Some(buyback_account.clone()), - ); assert_ok!(BuyBack::charge(RuntimeOrigin::signed(ALICE), VKSM, 1000)); BuyBack::on_initialize(1); let path = vec![ diff --git a/pallets/flexible-fee/src/benchmarking.rs b/pallets/flexible-fee/src/benchmarking.rs index dd18e3b930..d54641281e 100644 --- a/pallets/flexible-fee/src/benchmarking.rs +++ b/pallets/flexible-fee/src/benchmarking.rs @@ -55,7 +55,7 @@ mod benchmarks { } impl_benchmark_test_suite!( Pallet, - crate::mock::new_test_ext_benchmark(), - crate::mock::Test + crate::mocks::kusama_mock::new_test_ext_benchmark(), + crate::mocks::kusama_mock::Test ); } diff --git a/pallets/flexible-fee/src/impls/account_fee_currency.rs b/pallets/flexible-fee/src/impls/account_fee_currency.rs index 62620dab7c..10604229dd 100644 --- a/pallets/flexible-fee/src/impls/account_fee_currency.rs +++ b/pallets/flexible-fee/src/impls/account_fee_currency.rs @@ -60,8 +60,13 @@ impl AccountFeeCurrency for Pallet { hopeless_currency = currency; } + // Add a 10% buffer to account for potential inaccuracies in fee estimation. + let fee = fee + .checked_mul(110) + .and_then(|v| v.checked_div(100)) + .ok_or(Error::::PercentageCalculationFailed)?; for maybe_currency in currency_list.iter() { - let comp_res = Self::cmp_with_precision(account, maybe_currency, fee, 18)?; + let comp_res = Self::cmp_with_weth(account, maybe_currency, fee)?; match comp_res { Ordering::Less => { diff --git a/pallets/flexible-fee/src/lib.rs b/pallets/flexible-fee/src/lib.rs index e4bfaa9e3c..519e9a8d8c 100644 --- a/pallets/flexible-fee/src/lib.rs +++ b/pallets/flexible-fee/src/lib.rs @@ -19,10 +19,10 @@ #![cfg_attr(not(feature = "std"), no_std)] pub use crate::pallet::*; -use bifrost_asset_registry::{AssetMetadata, CurrencyIdMapping, TokenInfo}; +use bifrost_asset_registry::{AssetMetadata, CurrencyIdMapping}; use bifrost_primitives::{ traits::XcmDestWeightAndFeeHandler, AssetHubChainId, Balance, BalanceCmp, CurrencyId, - DerivativeIndex, OraclePriceProvider, Price, TryConvertFrom, XcmOperationType, BNC, VBNC, + DerivativeIndex, OraclePriceProvider, Price, TryConvertFrom, XcmOperationType, BNC, VBNC, WETH, }; use bifrost_xcm_interface::calls::{PolkadotXcmCall, RelaychainCall}; use core::convert::Into; @@ -59,8 +59,7 @@ use zenlink_protocol::{AssetId, ExportZenlink}; mod benchmarking; pub mod impls; pub mod migrations; -mod mock; -mod mock_price; +mod mocks; mod tests; pub mod weights; @@ -126,6 +125,9 @@ pub mod pallet { type PalletId: Get; // asset registry to get asset metadata type AssetIdMaps: CurrencyIdMapping>>; + /// The `AllowVBNCAsFee` constant determines whether VBNC is allowed as a fee currency. + #[pallet::constant] + type AllowVBNCAsFee: Get; } #[pallet::hooks] @@ -230,6 +232,8 @@ pub mod pallet { EvmPermitCallExecutionError, /// EVM permit call failed. EvmPermitRunnerError, + /// Percentage calculation failed due to overflow. + PercentageCalculationFailed, } #[pallet::call] @@ -247,8 +251,10 @@ pub mod pallet { let who = ensure_signed(origin)?; if let Some(fee_currency) = ¤cy_id { - // VBNC is not supported. - ensure!(fee_currency != &VBNC, Error::::CurrencyNotSupport); + if !T::AllowVBNCAsFee::get() { + // VBNC is not supported. + ensure!(fee_currency != &VBNC, Error::::CurrencyNotSupport); + } UserDefaultFeeCurrency::::insert(&who, fee_currency); } else { @@ -714,49 +720,30 @@ impl BalanceCmp for Pallet { /// - `currency`: The currency ID to be compared. /// - `amount`: The amount to compare against the account's balance, with the precision /// specified by `amount_precision`. - /// - `amount_precision`: The precision of the `amount` specified. If greater than 18, the - /// precision of the `currency` will be adjusted accordingly. /// /// # Returns /// - `Ok(std::cmp::Ordering)`: Returns the ordering result (`Less`, `Equal`, `Greater`) based /// on the comparison between the adjusted balance and the adjusted amount. /// - `Err(Error)`: Returns an error if the currency is not supported. - fn cmp_with_precision( + fn cmp_with_weth( account: &T::AccountId, currency: &CurrencyId, amount: u128, - amount_precision: u32, ) -> Result> { // Get the reducible balance for the specified account and currency. - let mut balance = T::MultiCurrency::reducible_balance( + let balance = T::MultiCurrency::reducible_balance( *currency, account, Preservation::Preserve, Fortitude::Polite, ); - // Define the standard precision as 18 decimal places. - let standard_precision: u32 = amount_precision.max(18); - - // Adjust the amount to the standard precision. - let precision_offset = standard_precision.saturating_sub(amount_precision); - let adjust_precision = 10u128.pow(precision_offset); - let amount = amount.saturating_mul(adjust_precision); - - // Adjust the balance based on currency type. - let decimals = currency - .decimals() - .or_else(|| { - T::AssetIdMaps::get_currency_metadata(*currency) - .map(|metadata| metadata.decimals.into()) - }) - .ok_or(Error::::CurrencyNotSupport)?; - let balance_precision_offset = standard_precision.saturating_sub(decimals.into()); - - // Apply precision adjustment to balance. - balance = balance.saturating_mul(10u128.pow(balance_precision_offset)); - - // Compare the adjusted balance with the input amount. - Ok(balance.cmp(&amount)) + let (fee_amount, _, _) = + T::OraclePriceProvider::get_oracle_amount_by_currency_and_amount_in( + &WETH, amount, ¤cy, + ) + .ok_or(Error::::ConversionError)?; + + Ok(balance.cmp(&fee_amount)) } } diff --git a/pallets/flexible-fee/src/mock.rs b/pallets/flexible-fee/src/mocks/kusama_mock.rs similarity index 98% rename from pallets/flexible-fee/src/mock.rs rename to pallets/flexible-fee/src/mocks/kusama_mock.rs index 49981d83de..3f992bd0d5 100644 --- a/pallets/flexible-fee/src/mock.rs +++ b/pallets/flexible-fee/src/mocks/kusama_mock.rs @@ -18,8 +18,8 @@ #![cfg(test)] -use super::*; -use crate::{self as flexible_fee, mock_price::MockOraclePriceProvider}; +use crate::*; +use crate::{self as flexible_fee, mocks::mock_price::MockOraclePriceProvider}; use bifrost_asset_registry::AssetIdMaps; use bifrost_currencies::BasicCurrencyAdapter; use bifrost_primitives::{ @@ -175,6 +175,7 @@ impl pallet_evm_accounts::Config for Test { parameter_types! { pub const TreasuryAccount: AccountId32 = TREASURY_ACCOUNT; pub const MaxFeeCurrencyOrderListLen: u32 = 50; + pub AllowVBNCAsFee: bool = false; } impl crate::Config for Test { @@ -196,6 +197,7 @@ impl crate::Config for Test { type InspectEvmAccounts = EVMAccounts; type EvmPermit = PermitDispatchHandler; type AssetIdMaps = AssetIdMaps; + type AllowVBNCAsFee = AllowVBNCAsFee; } pub struct XcmDestWeightAndFee; @@ -337,13 +339,12 @@ parameter_types! { impl BalanceCmp for Test { type Error = Error; - fn cmp_with_precision( + fn cmp_with_weth( account: &AccountId, currency: &CurrencyId, amount: u128, - amount_precision: u32, ) -> Result { - Pallet::::cmp_with_precision(account, currency, amount, amount_precision) + Pallet::::cmp_with_weth(account, currency, amount) } } diff --git a/pallets/flexible-fee/src/mock_price.rs b/pallets/flexible-fee/src/mocks/mock_price.rs similarity index 100% rename from pallets/flexible-fee/src/mock_price.rs rename to pallets/flexible-fee/src/mocks/mock_price.rs diff --git a/pallets/flexible-fee/src/mocks/mod.rs b/pallets/flexible-fee/src/mocks/mod.rs new file mode 100644 index 0000000000..309b49ce88 --- /dev/null +++ b/pallets/flexible-fee/src/mocks/mod.rs @@ -0,0 +1,22 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +pub mod kusama_mock; +pub mod polkadot_mock; + +mod mock_price; diff --git a/pallets/flexible-fee/src/mocks/polkadot_mock.rs b/pallets/flexible-fee/src/mocks/polkadot_mock.rs new file mode 100644 index 0000000000..15e7ac2d92 --- /dev/null +++ b/pallets/flexible-fee/src/mocks/polkadot_mock.rs @@ -0,0 +1,453 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#![cfg(test)] + +use crate::*; +use crate::{self as flexible_fee, mocks::mock_price::MockOraclePriceProvider}; +use bifrost_asset_registry::AssetIdMaps; +use bifrost_currencies::BasicCurrencyAdapter; +use bifrost_primitives::{ + Balance, CurrencyId, EvmPermit, FlexibleFeePalletId, TokenSymbol, ZenlinkPalletId, +}; +use cumulus_primitives_core::ParaId as Pid; +use frame_support::{ + derive_impl, ord_parameter_types, parameter_types, + sp_runtime::{DispatchError, DispatchResult}, + traits::{ConstU128, Get, Nothing}, + weights::{ConstantMultiplier, IdentityFee}, + PalletId, +}; +use frame_system::EnsureSignedBy; +use frame_system::{self, EnsureRoot}; +use orml_traits::MultiCurrency; +use sp_runtime::{ + traits::{AccountIdConversion, IdentityLookup, UniqueSaturatedInto}, + AccountId32, BuildStorage, SaturatedConversion, +}; +use sp_std::marker::PhantomData; +use std::{cell::RefCell, convert::TryInto}; +use zenlink_protocol::{ + AssetBalance, AssetId as ZenlinkAssetId, LocalAssetHandler, PairLpGenerate, ZenlinkMultiAssets, +}; + +pub type AccountId = AccountId32; +pub type BlockNumber = u32; +pub type Amount = i128; + +pub const TREASURY_ACCOUNT: AccountId32 = AccountId32::new([9u8; 32]); + +type Block = frame_system::mocking::MockBlock; + +// Configure a mock runtime to test the pallet. +frame_support::construct_runtime!( + pub enum Test { + System: frame_system, + Balances: pallet_balances = 10, + Tokens: orml_tokens, + TransactionPayment: pallet_transaction_payment, + FlexibleFee: flexible_fee, + ZenlinkProtocol: zenlink_protocol, + Currencies: bifrost_currencies, + AssetRegistry: bifrost_asset_registry, + EVMAccounts: pallet_evm_accounts, + } +); + +ord_parameter_types! { + pub const CouncilAccount: AccountId = AccountId::from([1u8; 32]); +} +impl bifrost_asset_registry::Config for Test { + type RuntimeEvent = RuntimeEvent; + type Currency = Balances; + type RegisterOrigin = EnsureSignedBy; + type WeightInfo = (); +} + +parameter_types! { + pub const BlockHashCount: u32 = 250; +} + +#[derive_impl(frame_system::config_preludes::TestDefaultConfig)] +impl frame_system::Config for Test { + type Block = Block; + type AccountId = AccountId; + type Lookup = IdentityLookup; + type AccountData = pallet_balances::AccountData; +} + +parameter_types! { + pub const TransactionByteFee: Balance = 1; + pub const OperationalFeeMultiplier: u8 = 5; +} + +impl pallet_transaction_payment::Config for Test { + type FeeMultiplierUpdate = (); + type LengthToFee = ConstantMultiplier; + type OnChargeTransaction = FlexibleFee; + type OperationalFeeMultiplier = OperationalFeeMultiplier; + type WeightToFee = IdentityFee; + type RuntimeEvent = RuntimeEvent; +} + +parameter_types! { + pub const ExistentialDeposit: u64 = 1; +} + +impl pallet_balances::Config for Test { + type AccountStore = System; + type Balance = u128; + type DustRemoval = (); + type RuntimeEvent = RuntimeEvent; + type ExistentialDeposit = ExistentialDeposit; + type MaxLocks = (); + type MaxReserves = (); + type ReserveIdentifier = [u8; 8]; + type WeightInfo = (); + type RuntimeHoldReason = RuntimeHoldReason; + type RuntimeFreezeReason = RuntimeFreezeReason; + type FreezeIdentifier = (); + type MaxFreezes = ConstU32<0>; +} + +orml_traits::parameter_type_with_key! { + pub ExistentialDeposits: |_currency_id: CurrencyId| -> Balance { + 1 + }; +} + +parameter_types! { + pub DustAccount: AccountId = PalletId(*b"orml/dst").into_account_truncating(); + pub MaxLocks: u32 = 2; +} + +impl orml_tokens::Config for Test { + type Amount = i128; + type Balance = Balance; + type CurrencyId = CurrencyId; + type DustRemovalWhitelist = Nothing; + type RuntimeEvent = RuntimeEvent; + type ExistentialDeposits = ExistentialDeposits; + type MaxLocks = MaxLocks; + type MaxReserves = (); + type ReserveIdentifier = [u8; 8]; + type WeightInfo = (); + type CurrencyHooks = (); +} + +pub struct EvmNonceProvider; +impl pallet_evm_accounts::EvmNonceProvider for EvmNonceProvider { + fn get_nonce(_: sp_core::H160) -> sp_core::U256 { + sp_core::U256::zero() + } +} + +impl pallet_evm_accounts::Config for Test { + type RuntimeEvent = RuntimeEvent; + type EvmNonceProvider = EvmNonceProvider; + type FeeMultiplier = ConstU32<10>; + type ControllerOrigin = EnsureRoot; + type WeightInfo = (); +} + +parameter_types! { + pub const TreasuryAccount: AccountId32 = TREASURY_ACCOUNT; + pub const MaxFeeCurrencyOrderListLen: u32 = 50; + pub AllowVBNCAsFee: bool = true; +} + +impl crate::Config for Test { + type DexOperator = ZenlinkProtocol; + type RuntimeEvent = RuntimeEvent; + type MultiCurrency = Currencies; + type TreasuryAccount = TreasuryAccount; + type MaxFeeCurrencyOrderListLen = MaxFeeCurrencyOrderListLen; + type WeightInfo = (); + type ParachainId = ParaInfo; + type ControlOrigin = EnsureRoot; + type XcmWeightAndFeeHandler = XcmDestWeightAndFee; + type MinAssetHubExecutionFee = ConstU128<3>; + type MinRelaychainExecutionFee = ConstU128<3>; + type RelaychainCurrencyId = RelayCurrencyId; + type XcmRouter = (); + type PalletId = FlexibleFeePalletId; + type OraclePriceProvider = MockOraclePriceProvider; + type InspectEvmAccounts = EVMAccounts; + type EvmPermit = PermitDispatchHandler; + type AssetIdMaps = AssetIdMaps; + type AllowVBNCAsFee = AllowVBNCAsFee; +} + +pub struct XcmDestWeightAndFee; +impl XcmDestWeightAndFeeHandler for XcmDestWeightAndFee { + fn get_operation_weight_and_fee( + _token: CurrencyId, + _operation: XcmOperationType, + ) -> Option<(Weight, Balance)> { + Some((Weight::from_parts(100, 100), 100u32.into())) + } + + fn set_xcm_dest_weight_and_fee( + _currency_id: CurrencyId, + _operation: XcmOperationType, + _weight_and_fee: Option<(Weight, Balance)>, + ) -> DispatchResult { + Ok(()) + } +} + +pub struct ParaInfo; +impl Get for ParaInfo { + fn get() -> Pid { + Pid::from(2001) + } +} + +parameter_types! { + pub const GetNativeCurrencyId: CurrencyId = BNC; +} + +impl bifrost_currencies::Config for Test { + type GetNativeCurrencyId = GetNativeCurrencyId; + type MultiCurrency = Tokens; + type NativeCurrency = BasicCurrencyAdapter; + type WeightInfo = (); +} + +parameter_types! { + pub const GetExchangeFee: (u32, u32) = (3, 1000); // 0.3% + pub const SelfParaId: u32 = 2001; +} + +impl zenlink_protocol::Config for Test { + type RuntimeEvent = RuntimeEvent; + type MultiAssetsHandler = MultiAssets; + type PalletId = ZenlinkPalletId; + type SelfParaId = SelfParaId; + type TargetChains = (); + type WeightInfo = (); + type AssetId = ZenlinkAssetId; + type LpGenerate = PairLpGenerate; +} + +type MultiAssets = ZenlinkMultiAssets>; + +// Below is the implementation of tokens manipulation functions other than native token. +pub struct LocalAssetAdaptor(PhantomData); + +impl LocalAssetHandler for LocalAssetAdaptor +where + Local: MultiCurrency, +{ + fn local_balance_of(asset_id: ZenlinkAssetId, who: &AccountId) -> AssetBalance { + let currency_id: CurrencyId = asset_id.try_into().unwrap(); + Local::free_balance(currency_id, &who).saturated_into() + } + + fn local_total_supply(asset_id: ZenlinkAssetId) -> AssetBalance { + let currency_id: CurrencyId = asset_id.try_into().unwrap(); + Local::total_issuance(currency_id).saturated_into() + } + + fn local_is_exists(asset_id: ZenlinkAssetId) -> bool { + let rs: Result = asset_id.try_into(); + match rs { + Ok(_) => true, + Err(_) => false, + } + } + + fn local_transfer( + asset_id: ZenlinkAssetId, + origin: &AccountId, + target: &AccountId, + amount: AssetBalance, + ) -> DispatchResult { + let currency_id: CurrencyId = asset_id.try_into().unwrap(); + Local::transfer( + currency_id, + &origin, + &target, + amount.unique_saturated_into(), + )?; + + Ok(()) + } + + fn local_deposit( + asset_id: ZenlinkAssetId, + origin: &AccountId, + amount: AssetBalance, + ) -> Result { + let currency_id: CurrencyId = asset_id.try_into().unwrap(); + Local::deposit(currency_id, &origin, amount.unique_saturated_into())?; + return Ok(amount); + } + + fn local_withdraw( + asset_id: ZenlinkAssetId, + origin: &AccountId, + amount: AssetBalance, + ) -> Result { + let currency_id: CurrencyId = asset_id.try_into().unwrap(); + Local::withdraw(currency_id, &origin, amount.unique_saturated_into())?; + + Ok(amount) + } +} + +// Build genesis storage according to the mock runtime. +pub(crate) fn new_test_ext() -> sp_io::TestExternalities { + let mut t = frame_system::GenesisConfig::::default() + .build_storage() + .unwrap(); + // We use default for brevity, but you can configure as desired if needed. + pallet_balances::GenesisConfig::::default() + .assimilate_storage(&mut t) + .unwrap(); + t.into() +} + +pub const ALICE: AccountId = AccountId::new([0u8; 32]); + +parameter_types! { + pub const RelayCurrencyId: CurrencyId = CurrencyId::Token(TokenSymbol::KSM); +} + +impl BalanceCmp for Test { + type Error = Error; + + fn cmp_with_weth( + account: &AccountId, + currency: &CurrencyId, + amount: u128, + ) -> Result { + Pallet::::cmp_with_weth(account, currency, amount) + } +} + +#[derive(Clone, Debug, PartialEq)] +pub struct PermitDispatchData { + pub source: H160, + pub target: H160, + pub input: Vec, + pub value: U256, + pub gas_limit: u64, + pub max_fee_per_gas: U256, + pub max_priority_fee_per_gas: Option, + pub nonce: Option, + pub access_list: Vec<(H160, Vec)>, +} + +#[derive(Clone, Debug, PartialEq)] +pub struct ValidationData { + pub source: H160, + pub target: H160, + pub input: Vec, + pub value: U256, + pub gas_limit: u64, + pub deadline: U256, + pub v: u8, + pub r: H256, + pub s: H256, +} + +thread_local! { + static PERMIT_VALIDATION: RefCell> = const { RefCell::new(vec![]) }; + static PERMIT_DISPATCH: RefCell> = const { RefCell::new(vec![]) }; +} + +pub struct PermitDispatchHandler; + +impl PermitDispatchHandler { + pub fn last_validation_call_data() -> ValidationData { + PERMIT_VALIDATION.with(|v| v.borrow().last().unwrap().clone()) + } + + pub fn last_dispatch_call_data() -> PermitDispatchData { + PERMIT_DISPATCH.with(|v| v.borrow().last().unwrap().clone()) + } +} + +impl EvmPermit for PermitDispatchHandler { + fn validate_permit( + source: H160, + target: H160, + input: Vec, + value: U256, + gas_limit: u64, + deadline: U256, + v: u8, + r: H256, + s: H256, + ) -> DispatchResult { + let data = ValidationData { + source, + target, + input, + value, + gas_limit, + deadline, + v, + r, + s, + }; + PERMIT_VALIDATION.with(|v| v.borrow_mut().push(data)); + Ok(()) + } + + fn dispatch_permit( + source: H160, + target: H160, + input: Vec, + value: U256, + gas_limit: u64, + max_fee_per_gas: U256, + max_priority_fee_per_gas: Option, + nonce: Option, + access_list: Vec<(H160, Vec)>, + ) -> DispatchResultWithPostInfo { + let data = PermitDispatchData { + source, + target, + input, + value, + gas_limit, + max_fee_per_gas, + max_priority_fee_per_gas, + nonce, + access_list, + }; + PERMIT_DISPATCH.with(|v| v.borrow_mut().push(data)); + Ok(PostDispatchInfo::default()) + } + + fn gas_price() -> (U256, Weight) { + (U256::from(222u128), Weight::zero()) + } + + fn dispatch_weight(_gas_limit: u64) -> Weight { + todo!() + } + + fn permit_nonce(_account: H160) -> U256 { + U256::default() + } + + fn on_dispatch_permit_error() {} +} diff --git a/pallets/flexible-fee/src/tests.rs b/pallets/flexible-fee/src/tests/common_tests.rs similarity index 93% rename from pallets/flexible-fee/src/tests.rs rename to pallets/flexible-fee/src/tests/common_tests.rs index e8756eabd3..cda8b381aa 100644 --- a/pallets/flexible-fee/src/tests.rs +++ b/pallets/flexible-fee/src/tests/common_tests.rs @@ -20,8 +20,8 @@ #![cfg(test)] use crate::{ - impls::on_charge_transaction::PaymentInfo, mock::*, BlockNumberFor, BoundedVec, Config, - DispatchError::BadOrigin, Error, UserDefaultFeeCurrency, + impls::on_charge_transaction::PaymentInfo, mocks::kusama_mock::*, BlockNumberFor, BoundedVec, + Config, DispatchError::BadOrigin, Error, UserDefaultFeeCurrency, }; use bifrost_asset_registry::AssetMetadata; use bifrost_asset_registry::CurrencyMetadatas; @@ -626,6 +626,52 @@ fn get_fee_currency_should_work_with_default_currency() { }); } +#[test] +fn get_fee_currency_should_work_with_dot() { + new_test_ext().execute_with(|| { + ini_meta_data(); + + let origin_signed_alice = RuntimeOrigin::signed(ALICE); + assert_ok!(FlexibleFee::set_user_default_fee_currency( + origin_signed_alice.clone(), + Some(DOT) + )); + + assert_ok!(Currencies::deposit( + DOT, + &ALICE, + 660u128 * 10u128.pow(10) + 1 + )); + assert_ok!(Currencies::deposit(WETH, &ALICE, 100u128.pow(18))); + + let currency = FlexibleFee::get_fee_currency(&ALICE, 10u128.pow(18).into()).unwrap(); + assert_eq!(currency, DOT); + }); +} + +#[test] +fn get_fee_currency_should_work_with_dot_weth() { + new_test_ext().execute_with(|| { + ini_meta_data(); + + let origin_signed_alice = RuntimeOrigin::signed(ALICE); + assert_ok!(FlexibleFee::set_user_default_fee_currency( + origin_signed_alice.clone(), + Some(DOT) + )); + + assert_ok!(Currencies::deposit( + DOT, + &ALICE, + 660u128 * 10u128.pow(10) - 1 + )); + assert_ok!(Currencies::deposit(WETH, &ALICE, 100u128.pow(18))); + + let currency = FlexibleFee::get_fee_currency(&ALICE, 10u128.pow(18).into()).unwrap(); + assert_eq!(currency, WETH); + }); +} + #[test] fn get_fee_currency_should_work_with_default_currency_poor() { new_test_ext().execute_with(|| { @@ -781,38 +827,39 @@ fn get_fee_currency_should_work_with_all_currency_poor() { } #[test] -fn cmp_with_precision_should_work_with_weth() { +fn cmp_with_weth_should_work_with_weth() { new_test_ext().execute_with(|| { ini_meta_data(); - assert_ok!(Currencies::deposit(WETH, &ALICE, 10u128.pow(18) - 1)); // ETH + assert_ok!(Currencies::deposit(WETH, &ALICE, 10u128.pow(18) - 10)); // ETH - let ordering = - FlexibleFee::cmp_with_precision(&ALICE, &WETH, 10u128.pow(18), 18u32).unwrap(); + let ordering = FlexibleFee::cmp_with_weth(&ALICE, &WETH, 10u128.pow(18)).unwrap(); assert_eq!(ordering, Less); }); } #[test] -fn cmp_with_precision_should_work_with_dot() { +fn cmp_with_weth_should_work_with_dot() { new_test_ext().execute_with(|| { ini_meta_data(); - assert_ok!(Currencies::deposit(DOT, &ALICE, 10u128.pow(11) + 1)); // DOT + assert_ok!(Currencies::deposit( + DOT, + &ALICE, + 600u128 * 10u128.pow(10) + 10 + )); // DOT - let ordering = - FlexibleFee::cmp_with_precision(&ALICE, &DOT, 10u128.pow(18), 18u32).unwrap(); + let ordering = FlexibleFee::cmp_with_weth(&ALICE, &DOT, 10u128.pow(18)).unwrap(); assert_eq!(ordering, Greater); }); } #[test] -fn cmp_with_precision_should_work_with_bnc() { +fn cmp_with_weth_should_work_with_bnc() { new_test_ext().execute_with(|| { assert_ok!(Currencies::deposit(BNC, &ALICE, 11u128.pow(12))); // BNC - let ordering = - FlexibleFee::cmp_with_precision(&ALICE, &BNC, 10u128.pow(18), 18u32).unwrap(); + let ordering = FlexibleFee::cmp_with_weth(&ALICE, &BNC, 10u128.pow(12)).unwrap(); assert_eq!(ordering, Greater); }); } diff --git a/pallets/flexible-fee/src/tests/mod.rs b/pallets/flexible-fee/src/tests/mod.rs new file mode 100644 index 0000000000..752e20915b --- /dev/null +++ b/pallets/flexible-fee/src/tests/mod.rs @@ -0,0 +1,20 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +mod common_tests; +mod polkadot_specical_tests; diff --git a/pallets/flexible-fee/src/tests/polkadot_specical_tests.rs b/pallets/flexible-fee/src/tests/polkadot_specical_tests.rs new file mode 100644 index 0000000000..eb3e2bfb28 --- /dev/null +++ b/pallets/flexible-fee/src/tests/polkadot_specical_tests.rs @@ -0,0 +1,44 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +//! Tests for the module. + +#![cfg(test)] +use crate::{mocks::polkadot_mock::*, UserDefaultFeeCurrency}; +use bifrost_primitives::VBNC; +use frame_support::assert_ok; + +#[test] +fn set_user_default_fee_currency_should_fail_with_error_currency() { + new_test_ext().execute_with(|| { + let origin_signed_alice = RuntimeOrigin::signed(ALICE); + assert_ok!(FlexibleFee::set_user_default_fee_currency( + origin_signed_alice.clone(), + Some(VBNC) + )); + + let alice_default_currency = UserDefaultFeeCurrency::::get(ALICE).unwrap(); + assert_eq!(alice_default_currency, VBNC); + + assert_ok!(FlexibleFee::set_user_default_fee_currency( + origin_signed_alice.clone(), + None + )); + assert_eq!(UserDefaultFeeCurrency::::get(ALICE).is_none(), true); + }); +} diff --git a/pallets/ismp/Cargo.toml b/pallets/ismp/Cargo.toml new file mode 100644 index 0000000000..38e417dedf --- /dev/null +++ b/pallets/ismp/Cargo.toml @@ -0,0 +1,47 @@ +[package] +authors = ["Liebi Technologies "] +edition = "2021" +name = "bifrost-ismp" +version = "0.8.0" + +[package.metadata.docs.rs] +targets = ['x86_64-unknown-linux-gnu'] + +[dependencies] +# crates.io +codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false, features = ["derive"] } +scale-info = { workspace = true, default-features = false, features = ["derive"] } +anyhow = { workspace = true, default-features = false } + +# polytope labs +ismp = { workspace = true, default-features = false } +pallet-ismp = { workspace = true, default-features = false } + +# substrate +frame-support = { workspace = true } +frame-system = { workspace = true } +pallet-balances = { workspace = true } +sp-runtime = { workspace = true } +sp-core = { workspace = true } + +[dev-dependencies] + +[features] +default = ["std"] +std = [ + "codec/std", + "frame-support/std", + "frame-system/std", + "sp-runtime/std", + "scale-info/std", + "ismp/std", + "pallet-ismp/std", + "pallet-balances/std", + "anyhow/std" +] + +try-runtime = [ + "frame-support/try-runtime", + "frame-system/try-runtime", + "sp-runtime/try-runtime", +] diff --git a/pallets/ismp/src/lib.rs b/pallets/ismp/src/lib.rs new file mode 100644 index 0000000000..c62062fe5f --- /dev/null +++ b/pallets/ismp/src/lib.rs @@ -0,0 +1,273 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +//! ISMP Assets +//! Simple Demo for Asset transfer over ISMP +#![cfg_attr(not(feature = "std"), no_std)] +#![deny(missing_docs)] + +extern crate alloc; + +use alloc::{format, string::String}; +use frame_support::pallet_prelude::RuntimeDebug; +use frame_support::PalletId; +use ismp::{ + error::Error as IsmpError, + module::IsmpModule, + router::{PostRequest, Request, Response, Timeout}, +}; +pub use pallet::*; +use pallet_ismp::ModuleId; +use sp_core::H160; + +/// Transfer payload +/// This would be encoded to bytes as the request data +#[derive( + Clone, codec::Encode, codec::Decode, scale_info::TypeInfo, PartialEq, Eq, RuntimeDebug, +)] +pub struct Payload { + /// Destination account + pub to: AccountId, + /// Source account + pub from: AccountId, + /// Amount to be transferred + pub amount: Balance, +} + +/// Extrisnic params for evm dispatch +#[derive( + Clone, codec::Encode, codec::Decode, scale_info::TypeInfo, PartialEq, Eq, RuntimeDebug, +)] +pub struct EvmParams { + /// Destination module + pub module: H160, + /// Destination EVM host + pub destination: u32, + /// Timeout timestamp on destination chain in seconds + pub timeout: u64, + /// Request count + pub count: u64, +} + +#[frame_support::pallet] +pub mod pallet { + use super::*; + use crate::alloc::string::ToString; + use alloc::{vec, vec::Vec}; + use frame_support::{ + pallet_prelude::*, + traits::{ + fungible::{Inspect, Mutate}, + tokens::Balance, + }, + }; + use frame_system::pallet_prelude::*; + use ismp::{ + consensus::{StateCommitment, StateMachineHeight}, + dispatcher::{DispatchPost, DispatchRequest, FeeMetadata, IsmpDispatcher}, + host::{IsmpHost, StateMachine}, + }; + + /// [`IsmpModule`] module identifier for incoming requests from hyperbridge + pub const PALLET_BIFROST_ID: &'static [u8] = b"ismp-bnc"; + + /// [`PalletId`] where protocol fees will be collected + pub const PALLET_ID: ModuleId = ModuleId::Pallet(PalletId(*b"ismp-bnc")); + + #[pallet::pallet] + pub struct Pallet(_); + + impl Default for Pallet { + fn default() -> Self { + Self(PhantomData) + } + } + + /// Pallet Configuration + #[pallet::config] + pub trait Config: frame_system::Config + pallet_ismp::Config { + /// Overarching event + type RuntimeEvent: From> + IsType<::RuntimeEvent>; + /// Native balance + type Balance: Balance + + Into<>::Balance> + + From; + /// Native currency implementation + type NativeCurrency: Mutate; + /// Ismp message disptacher + type IsmpHost: IsmpHost + + IsmpDispatcher::Balance> + + Default; + } + + /// Pallet events + #[pallet::event] + #[pallet::generate_deposit(pub(super) fn deposit_event)] + pub enum Event { + /// Some balance has been received + BalanceReceived { + /// Source account + from: T::AccountId, + /// Receiving account + to: T::AccountId, + /// Amount that was received + amount: ::Balance, + /// Source chain's Id + source_chain: StateMachine, + }, + /// Request data receieved + Request { + /// Source of the request + source: StateMachine, + /// utf-8 decoded data + data: String, + }, + /// Get response recieved + GetResponse(Vec>>), + } + + /// Pallet Errors + #[pallet::error] + pub enum Error { + /// Error encountered when initializing transfer + TransferFailed, + } + + // Pallet implements [`Hooks`] trait to define some logic to execute in some context. + #[pallet::hooks] + impl Hooks> for Pallet {} + + #[pallet::call] + impl Pallet { + /// Dispatch request to a connected EVM chain. + #[pallet::weight(Weight::from_parts(1_000_000, 0))] + #[pallet::call_index(0)] + pub fn dispatch_to_evm(origin: OriginFor, params: EvmParams) -> DispatchResult { + let origin = ensure_signed(origin)?; + let post = DispatchPost { + dest: StateMachine::Evm(params.destination), + from: PALLET_ID.to_bytes(), + to: params.module.0.to_vec(), + timeout: params.timeout, + body: b"Hello from polkadot".to_vec(), + }; + let dispatcher = T::IsmpHost::default(); + for _ in 0..params.count { + // dispatch the request + dispatcher + .dispatch_request( + DispatchRequest::Post(post.clone()), + FeeMetadata { + payer: origin.clone(), + fee: Default::default(), + }, + ) + .map_err(|_| Error::::TransferFailed)?; + } + Ok(()) + } + + /// Insert an unverified state commitment into the host, this is for testing purposes only. + #[pallet::weight(Weight::from_parts(1_000_000, 0))] + #[pallet::call_index(1)] + pub fn set_state_commitment( + origin: OriginFor, + height: StateMachineHeight, + commitment: StateCommitment, + ) -> DispatchResult { + use ismp::events::{Event, StateMachineUpdated}; + ensure_root(origin)?; + let host = T::IsmpHost::default(); + + // shouldn't return an error + host.store_state_machine_commitment(height, commitment) + .unwrap(); + host.store_state_machine_update_time(height, host.timestamp()) + .unwrap(); + + // deposit the event + pallet_ismp::Pallet::::deposit_pallet_event(Event::StateMachineUpdated( + StateMachineUpdated { + state_machine_id: height.id, + latest_height: height.height, + }, + )); + + Ok(()) + } + } + + impl IsmpModule for Pallet { + fn on_accept(&self, request: PostRequest) -> Result<(), anyhow::Error> { + let source_chain = request.source; + + match source_chain { + StateMachine::Evm(_) => Pallet::::deposit_event(Event::Request { + source: source_chain, + data: unsafe { String::from_utf8_unchecked(request.body) }, + }), + source => Err(IsmpError::Custom(format!("Unsupported source {source:?}")))?, + } + + Ok(()) + } + + fn on_response(&self, response: Response) -> Result<(), anyhow::Error> { + match response { + Response::Post(_) => Err(IsmpError::Custom( + "Balance transfer protocol does not accept post responses".to_string(), + ))?, + Response::Get(res) => Pallet::::deposit_event(Event::::GetResponse( + res.values + .into_iter() + .map(|storage_value| storage_value.value) + .collect(), + )), + }; + + Ok(()) + } + + fn on_timeout(&self, timeout: Timeout) -> Result<(), anyhow::Error> { + let request = match timeout { + Timeout::Request(Request::Post(post)) => Request::Post(post), + _ => Err(IsmpError::Custom( + "Only Post requests allowed, found Get".to_string(), + ))?, + }; + let source_chain = request.source_chain(); + + let payload = ::Balance> as codec::Decode>::decode( + &mut &*request.body().expect("Request has been checked; qed"), + ) + .map_err(|_| IsmpError::Custom("Failed to decode request data".to_string()))?; + >::mint_into( + &payload.from, + payload.amount.into(), + ) + .map_err(|_| IsmpError::Custom("Failed to mint funds".to_string()))?; + Pallet::::deposit_event(Event::::BalanceReceived { + from: payload.from, + to: payload.to, + amount: payload.amount, + source_chain, + }); + Ok(()) + } + } +} diff --git a/pallets/lend-market/src/benchmarking.rs b/pallets/lend-market/src/benchmarking.rs index b6748310d7..47b16a3f04 100644 --- a/pallets/lend-market/src/benchmarking.rs +++ b/pallets/lend-market/src/benchmarking.rs @@ -2,8 +2,8 @@ #![cfg(feature = "runtime-benchmarks")] pub use crate::{AccountBorrows, Pallet as LendMarket, *}; -use bifrost_primitives::{currency::PHA, Balance, CurrencyId, DOT, DOT_U, KSM, VKSM, VSKSM}; -use frame_benchmarking::{account, benchmarks, impl_benchmark_test_suite, whitelisted_caller}; +use bifrost_primitives::{Balance, CurrencyId, KSM, LKSM, VKSM, VSKSM}; +use frame_benchmarking::v2::*; use frame_support::{ assert_ok, traits::tokens::{Fortitude, Precision}, @@ -12,8 +12,6 @@ use frame_system::{self, RawOrigin as SystemOrigin}; use rate_model::{InterestRateModel, JumpModel}; use sp_std::prelude::*; -pub const LKSM: CurrencyId = CurrencyId::Token2(11); -pub const LUSDT: CurrencyId = CurrencyId::Token2(12); const SEED: u32 = 0; const RATE_MODEL_MOCK: InterestRateModel = InterestRateModel::Jump(JumpModel { @@ -38,8 +36,8 @@ fn market_mock() -> Market> { }), reserve_factor: Ratio::from_percent(15), liquidate_incentive_reserved_factor: Ratio::from_percent(3), - supply_cap: 1_000_000_000_000_000_000_000u128, // set to 1B - borrow_cap: 1_000_000_000_000_000_000_000u128, // set to 1B + supply_cap: 1_000_000_000_000_000_000_000u128, + borrow_cap: 1_000_000_000_000_000_000_000u128, lend_token_id: LKSM, } } @@ -65,16 +63,10 @@ fn transfer_initial_balance< 10_000_000_000_000_u128, ) .unwrap(); - ::Assets::mint_into(DOT_U, &caller, INITIAL_AMOUNT.into()).unwrap(); ::Assets::mint_into(KSM, &caller, INITIAL_AMOUNT.into()).unwrap(); ::Assets::mint_into(VKSM, &caller, INITIAL_AMOUNT.into()).unwrap(); - ::Assets::mint_into(DOT, &caller, INITIAL_AMOUNT.into()).unwrap(); - ::Assets::mint_into(PHA, &caller, INITIAL_AMOUNT.into()).unwrap(); - pallet_prices::Pallet::::set_price(SystemOrigin::Root.into(), DOT_U, 1.into()).unwrap(); pallet_prices::Pallet::::set_price(SystemOrigin::Root.into(), KSM, 1.into()).unwrap(); pallet_prices::Pallet::::set_price(SystemOrigin::Root.into(), VKSM, 1.into()).unwrap(); - pallet_prices::Pallet::::set_price(SystemOrigin::Root.into(), DOT, 1.into()).unwrap(); - pallet_prices::Pallet::::set_price(SystemOrigin::Root.into(), PHA, 1.into()).unwrap(); } fn set_account_borrows( @@ -106,230 +98,476 @@ fn assert_last_event(generic_event: ::RuntimeEvent) { frame_system::Pallet::::assert_last_event(generic_event.into()); } -benchmarks! { - where_clause { - where - T: pallet_prices::Config + pallet_balances::Config // pallet_assets::Config + - } +#[benchmarks( + where + T: Config + pallet_prices::Config + pallet_balances::Config +)] +mod benchmarks { + use super::*; + + #[benchmark] + fn add_market() -> Result<(), BenchmarkError> { + #[extrinsic_call] + _(SystemOrigin::Root, VKSM, pending_market_mock::(VSKSM)); - add_market { - }: _(SystemOrigin::Root, VKSM, pending_market_mock::(VSKSM)) - verify { assert_last_event::(Event::::NewMarket(VKSM, pending_market_mock::(VSKSM)).into()); + Ok(()) } - activate_market { - assert_ok!(LendMarket::::add_market(SystemOrigin::Root.into(), VKSM, pending_market_mock::(VSKSM))); - }: _(SystemOrigin::Root, VKSM) - verify { + #[benchmark] + fn activate_market() -> Result<(), BenchmarkError> { + assert_ok!(LendMarket::::add_market( + SystemOrigin::Root.into(), + VKSM, + pending_market_mock::(VSKSM) + )); + + #[extrinsic_call] + _(SystemOrigin::Root, VKSM); + assert_last_event::(Event::::ActivatedMarket(VKSM).into()); + Ok(()) } - update_rate_model { - assert_ok!(LendMarket::::add_market(SystemOrigin::Root.into(), DOT_U, pending_market_mock::(LUSDT))); - }: _(SystemOrigin::Root, DOT_U, RATE_MODEL_MOCK) - verify { - let mut market = pending_market_mock::(LUSDT); + #[benchmark] + fn update_rate_model() -> Result<(), BenchmarkError> { + assert_ok!(LendMarket::::add_market( + SystemOrigin::Root.into(), + KSM, + pending_market_mock::(VSKSM) + )); + + #[extrinsic_call] + _(SystemOrigin::Root, KSM, RATE_MODEL_MOCK); + + let mut market = pending_market_mock::(VSKSM); market.rate_model = RATE_MODEL_MOCK; - assert_last_event::(Event::::UpdatedMarket(DOT_U, market).into()); + assert_last_event::(Event::::UpdatedMarket(KSM, market).into()); + Ok(()) } - update_market { - assert_ok!(LendMarket::::add_market(SystemOrigin::Root.into(), KSM, pending_market_mock::(LKSM))); - }: _( - SystemOrigin::Root, - KSM, - Some(Ratio::from_percent(50)), - Some(Ratio::from_percent(55)), - Some(Ratio::from_percent(50)), - Some(Ratio::from_percent(15)), - Some(Ratio::from_percent(3)), - Some(Rate::from_inner(Rate::DIV / 100 * 110)), - Some(1_000_000_000_000_000_000_000u128), - Some(1_000_000_000_000_000_000_000u128) - ) - verify { + #[benchmark] + fn update_market() -> Result<(), BenchmarkError> { + assert_ok!(LendMarket::::add_market( + SystemOrigin::Root.into(), + KSM, + pending_market_mock::(LKSM) + )); + + #[extrinsic_call] + _( + SystemOrigin::Root, + KSM, + Some(Ratio::from_percent(50)), + Some(Ratio::from_percent(55)), + Some(Ratio::from_percent(50)), + Some(Ratio::from_percent(15)), + Some(Ratio::from_percent(3)), + Some(Rate::from_inner(Rate::DIV / 100 * 110)), + Some(1_000_000_000_000_000_000_000u128), + Some(1_000_000_000_000_000_000_000u128), + ); + let mut market = pending_market_mock::(LKSM); market.reserve_factor = Ratio::from_percent(50); market.close_factor = Ratio::from_percent(15); assert_last_event::(Event::::UpdatedMarket(KSM, market).into()); + Ok(()) } - force_update_market { - assert_ok!(LendMarket::::add_market(SystemOrigin::Root.into(), DOT_U, pending_market_mock::(LUSDT))); + #[benchmark] + fn force_update_market() -> Result<(), BenchmarkError> { + assert_ok!(LendMarket::::add_market( + SystemOrigin::Root.into(), + KSM, + pending_market_mock::(VSKSM) + )); let caller: T::AccountId = whitelisted_caller(); transfer_initial_balance::(caller.clone()); - }: _(SystemOrigin::Root,DOT_U, pending_market_mock::(LUSDT)) - verify { - assert_last_event::(Event::::UpdatedMarket(DOT_U, pending_market_mock::(LUSDT)).into()); + + #[extrinsic_call] + _(SystemOrigin::Root, KSM, pending_market_mock::(VSKSM)); + + assert_last_event::( + Event::::UpdatedMarket(KSM, pending_market_mock::(VSKSM)).into(), + ); + Ok(()) } - add_reward { - let caller: T::AccountId = whitelisted_caller(); + #[benchmark] + fn add_reward() -> Result<(), BenchmarkError> { + let caller: T::AccountId = account("seed", 1, 1); transfer_initial_balance::(caller.clone()); - }: _(SystemOrigin::Signed(caller.clone()), 1_000_000_000_000_u128) - verify { + + #[extrinsic_call] + _(SystemOrigin::Signed(caller.clone()), 1_000_000_000_000_u128); + assert_last_event::(Event::::RewardAdded(caller, 1_000_000_000_000_u128).into()); + Ok(()) } - withdraw_missing_reward { - let caller: T::AccountId = whitelisted_caller(); + #[benchmark] + fn withdraw_missing_reward() -> Result<(), BenchmarkError> { + let caller: T::AccountId = account("seed", 1, 1); transfer_initial_balance::(caller.clone()); - assert_ok!(LendMarket::::add_reward(SystemOrigin::Signed(caller.clone()).into(), 1_000_000_000_000_u128)); + assert_ok!(LendMarket::::add_reward( + SystemOrigin::Signed(caller.clone()).into(), + 1_000_000_000_000_u128 + )); let receiver = T::Lookup::unlookup(caller.clone()); - }: _(SystemOrigin::Root, receiver, 500_000_000_000_u128) - verify { + + #[extrinsic_call] + _(SystemOrigin::Root, receiver, 500_000_000_000_u128); + assert_last_event::(Event::::RewardWithdrawn(caller, 500_000_000_000_u128).into()); + Ok(()) } - update_market_reward_speed { - assert_ok!(LendMarket::::add_market(SystemOrigin::Root.into(), DOT_U, pending_market_mock::(DOT_U))); - assert_ok!(LendMarket::::activate_market(SystemOrigin::Root.into(), DOT_U)); - }: _(SystemOrigin::Root, DOT_U, Some(1_000_000), Some(1_000_000)) - verify { - assert_last_event::(Event::::MarketRewardSpeedUpdated(DOT_U, 1_000_000, 1_000_000).into()); + #[benchmark] + fn update_market_reward_speed() -> Result<(), BenchmarkError> { + assert_ok!(LendMarket::::add_market( + SystemOrigin::Root.into(), + KSM, + pending_market_mock::(VSKSM) + )); + assert_ok!(LendMarket::::activate_market( + SystemOrigin::Root.into(), + KSM + )); + + #[extrinsic_call] + _( + SystemOrigin::Root, + KSM, + Some(1_000_000_u128), + Some(1_000_000_u128), + ); + + assert_last_event::( + Event::::MarketRewardSpeedUpdated(KSM, 1_000_000_u128.into(), 1_000_000_u128.into()) + .into(), + ); + Ok(()) } - claim_reward { + #[benchmark] + fn claim_reward() -> Result<(), BenchmarkError> { let caller: T::AccountId = whitelisted_caller(); transfer_initial_balance::(caller.clone()); - assert_ok!(LendMarket::::add_market(SystemOrigin::Root.into(), DOT_U, pending_market_mock::(DOT_U))); - assert_ok!(LendMarket::::activate_market(SystemOrigin::Root.into(), DOT_U)); - assert_ok!(LendMarket::::mint(SystemOrigin::Signed(caller.clone()).into(), DOT_U, 100_000_000)); - assert_ok!(LendMarket::::add_reward(SystemOrigin::Signed(caller.clone()).into(), 1_000_000_000_000_u128)); - assert_ok!(LendMarket::::update_market_reward_speed(SystemOrigin::Root.into(), DOT_U, Some(1_000_000), Some(1_000_000))); - let target_height = T::BlockNumberProvider::current_block_number().saturating_add(One::one()); - frame_system::Pallet::::set_block_number(target_height); - }: _(SystemOrigin::Signed(caller.clone())) - verify { - assert_last_event::(Event::::RewardPaid(caller, 1_000_000).into()); + assert_ok!(LendMarket::::add_market( + SystemOrigin::Root.into(), + KSM, + pending_market_mock::(VSKSM) + )); + assert_ok!(LendMarket::::activate_market( + SystemOrigin::Root.into(), + KSM + )); + + #[extrinsic_call] + _(SystemOrigin::Signed(caller.clone())); + + Ok(()) } - claim_reward_for_market { - let caller: T::AccountId = whitelisted_caller(); + #[benchmark] + fn claim_reward_for_market() -> Result<(), BenchmarkError> { + let caller: T::AccountId = account("seed", 1, 1); transfer_initial_balance::(caller.clone()); - assert_ok!(LendMarket::::add_market(SystemOrigin::Root.into(), DOT_U, pending_market_mock::(DOT_U))); - assert_ok!(LendMarket::::activate_market(SystemOrigin::Root.into(), DOT_U)); - assert_ok!(LendMarket::::mint(SystemOrigin::Signed(caller.clone()).into(), DOT_U, 100_000_000)); - assert_ok!(LendMarket::::add_reward(SystemOrigin::Signed(caller.clone()).into(), 1_000_000_000_000_u128)); - assert_ok!(LendMarket::::update_market_reward_speed(SystemOrigin::Root.into(), DOT_U, Some(1_000_000), Some(1_000_000))); - let target_height = T::BlockNumberProvider::current_block_number().saturating_add(One::one()); - frame_system::Pallet::::set_block_number(target_height); - }: _(SystemOrigin::Signed(caller.clone()), DOT_U) - verify { - assert_last_event::(Event::::RewardPaid(caller, 1_000_000).into()); - } + assert_ok!(LendMarket::::add_market( + SystemOrigin::Root.into(), + KSM, + pending_market_mock::(VSKSM) + )); + assert_ok!(LendMarket::::activate_market( + SystemOrigin::Root.into(), + KSM + )); + + assert_ok!(LendMarket::::mint( + SystemOrigin::Signed(caller.clone()).into(), + KSM, + 100_000_000_u32.into() + )); - mint { + assert_ok!(LendMarket::::add_reward( + SystemOrigin::Signed(caller.clone()).into(), + 1_000_000_000_000_u128 + )); + + assert_ok!(LendMarket::::update_market_reward_speed( + SystemOrigin::Root.into(), + KSM, + Some(100_000_u128), + Some(100_000_u128) + )); + + for _i in 1_u32..=10_u32 { + let block_number = frame_system::Pallet::::block_number() + One::one(); + frame_system::Pallet::::set_block_number(block_number); + LendMarket::::on_initialize(block_number); + } + + #[extrinsic_call] + _(SystemOrigin::Signed(caller.clone()), KSM); + + assert_last_event::(Event::::RewardPaid(caller, 1_000_000_u128).into()); + Ok(()) + } + + #[benchmark] + fn mint() -> Result<(), BenchmarkError> { let caller: T::AccountId = whitelisted_caller(); transfer_initial_balance::(caller.clone()); - assert_ok!(LendMarket::::add_market(SystemOrigin::Root.into(), DOT_U, pending_market_mock::(DOT_U))); - assert_ok!(LendMarket::::activate_market(SystemOrigin::Root.into(), DOT_U)); - let amount: u32 = 100_000; - }: _(SystemOrigin::Signed(caller.clone()), DOT_U, amount.into()) - verify { - assert_last_event::(Event::::Deposited(caller, DOT_U, amount.into()).into()); + assert_ok!(LendMarket::::add_market( + SystemOrigin::Root.into(), + KSM, + pending_market_mock::(VSKSM) + )); + assert_ok!(LendMarket::::activate_market( + SystemOrigin::Root.into(), + KSM + )); + let amount: u32 = 300_000_000; + + #[extrinsic_call] + _(SystemOrigin::Signed(caller.clone()), KSM, amount.into()); + + assert_last_event::(Event::::Deposited(caller, KSM, amount.into()).into()); + Ok(()) } - borrow { + #[benchmark] + fn borrow() -> Result<(), BenchmarkError> { let caller: T::AccountId = whitelisted_caller(); transfer_initial_balance::(caller.clone()); let deposit_amount: u32 = 200_000_000; - let borrowed_amount: u32 = 100_000_000; + let borrow_amount: u32 = 100_000_000; + assert_ok!(LendMarket::::add_market_bond( SystemOrigin::Root.into(), - DOT_U, - vec![DOT_U] + KSM, + vec![KSM] + )); + + assert_ok!(LendMarket::::add_market( + SystemOrigin::Root.into(), + KSM, + pending_market_mock::(VSKSM) + )); + assert_ok!(LendMarket::::activate_market( + SystemOrigin::Root.into(), + KSM + )); + assert_ok!(LendMarket::::mint( + SystemOrigin::Signed(caller.clone()).into(), + KSM, + deposit_amount.into() + )); + assert_ok!(LendMarket::::collateral_asset( + SystemOrigin::Signed(caller.clone()).into(), + KSM, + true )); - assert_ok!(LendMarket::::add_market(SystemOrigin::Root.into(), DOT_U, pending_market_mock::(LUSDT))); - assert_ok!(LendMarket::::activate_market(SystemOrigin::Root.into(), DOT_U)); - assert_ok!(LendMarket::::mint(SystemOrigin::Signed(caller.clone()).into(), DOT_U, deposit_amount.into())); - assert_ok!(LendMarket::::collateral_asset(SystemOrigin::Signed(caller.clone()).into(), DOT_U, true)); - }: _(SystemOrigin::Signed(caller.clone()), DOT_U, borrowed_amount.into()) - verify { - assert_last_event::(Event::::Borrowed(caller, DOT_U, borrowed_amount.into()).into()); + + #[extrinsic_call] + _( + SystemOrigin::Signed(caller.clone()), + KSM, + borrow_amount.into(), + ); + + assert_last_event::(Event::::Borrowed(caller, KSM, borrow_amount.into()).into()); + Ok(()) } - redeem { + #[benchmark] + fn redeem() -> Result<(), BenchmarkError> { let caller: T::AccountId = whitelisted_caller(); transfer_initial_balance::(caller.clone()); let deposit_amount: u32 = 100_000_000; let redeem_amount: u32 = 100_000; - assert_ok!(LendMarket::::add_market(SystemOrigin::Root.into(), DOT_U, pending_market_mock::(LUSDT))); - assert_ok!(LendMarket::::activate_market(SystemOrigin::Root.into(), DOT_U)); - assert_ok!(LendMarket::::mint(SystemOrigin::Signed(caller.clone()).into(), DOT_U, deposit_amount.into())); - }: _(SystemOrigin::Signed(caller.clone()), DOT_U, redeem_amount.into()) - verify { - assert_last_event::(Event::::Redeemed(caller, DOT_U, redeem_amount.into()).into()); + + assert_ok!(LendMarket::::add_market( + SystemOrigin::Root.into(), + KSM, + pending_market_mock::(VSKSM) + )); + assert_ok!(LendMarket::::activate_market( + SystemOrigin::Root.into(), + KSM + )); + assert_ok!(LendMarket::::mint( + SystemOrigin::Signed(caller.clone()).into(), + KSM, + deposit_amount.into() + )); + + #[extrinsic_call] + _( + SystemOrigin::Signed(caller.clone()), + KSM, + redeem_amount.into(), + ); + + assert_last_event::(Event::::Redeemed(caller, KSM, redeem_amount.into()).into()); + Ok(()) } - redeem_all { + #[benchmark] + fn redeem_all() -> Result<(), BenchmarkError> { let caller: T::AccountId = whitelisted_caller(); transfer_initial_balance::(caller.clone()); let deposit_amount: u32 = 100_000_000; - assert_ok!(LendMarket::::add_market(SystemOrigin::Root.into(), DOT_U, pending_market_mock::(LUSDT))); - assert_ok!(LendMarket::::activate_market(SystemOrigin::Root.into(), DOT_U)); - assert_ok!(LendMarket::::mint(SystemOrigin::Signed(caller.clone()).into(), DOT_U, deposit_amount.into())); - }: _(SystemOrigin::Signed(caller.clone()), DOT_U) - verify { - assert_last_event::(Event::::Redeemed(caller, DOT_U, deposit_amount.into()).into()); + + assert_ok!(LendMarket::::add_market( + SystemOrigin::Root.into(), + KSM, + pending_market_mock::(VSKSM) + )); + assert_ok!(LendMarket::::activate_market( + SystemOrigin::Root.into(), + KSM + )); + assert_ok!(LendMarket::::mint( + SystemOrigin::Signed(caller.clone()).into(), + KSM, + deposit_amount.into() + )); + + #[extrinsic_call] + _(SystemOrigin::Signed(caller.clone()), KSM); + + assert_last_event::(Event::::Redeemed(caller, KSM, deposit_amount.into()).into()); + Ok(()) } - repay_borrow { + #[benchmark] + fn repay_borrow() -> Result<(), BenchmarkError> { let caller: T::AccountId = whitelisted_caller(); transfer_initial_balance::(caller.clone()); let deposit_amount: u32 = 200_000_000; let borrowed_amount: u32 = 100_000_000; let repay_amount: u32 = 100; + assert_ok!(LendMarket::::add_market_bond( SystemOrigin::Root.into(), - DOT_U, - vec![DOT_U] - )); - assert_ok!(LendMarket::::add_market(SystemOrigin::Root.into(), DOT_U, pending_market_mock::(LUSDT))); - assert_ok!(LendMarket::::activate_market(SystemOrigin::Root.into(), DOT_U)); - assert_ok!(LendMarket::::mint(SystemOrigin::Signed(caller.clone()).into(), DOT_U, deposit_amount.into())); - assert_ok!(LendMarket::::collateral_asset(SystemOrigin::Signed(caller.clone()).into(), DOT_U, true)); - assert_ok!(LendMarket::::borrow(SystemOrigin::Signed(caller.clone()).into(), DOT_U, borrowed_amount.into())); - }: _(SystemOrigin::Signed(caller.clone()), DOT_U, repay_amount.into()) - verify { - assert_last_event::(Event::::RepaidBorrow(caller, DOT_U, repay_amount.into()).into()); + KSM, + vec![KSM] + )); + assert_ok!(LendMarket::::add_market( + SystemOrigin::Root.into(), + KSM, + pending_market_mock::(VSKSM) + )); + assert_ok!(LendMarket::::activate_market( + SystemOrigin::Root.into(), + KSM + )); + assert_ok!(LendMarket::::mint( + SystemOrigin::Signed(caller.clone()).into(), + KSM, + deposit_amount.into() + )); + assert_ok!(LendMarket::::collateral_asset( + SystemOrigin::Signed(caller.clone()).into(), + KSM, + true + )); + assert_ok!(LendMarket::::borrow( + SystemOrigin::Signed(caller.clone()).into(), + KSM, + borrowed_amount.into() + )); + + #[extrinsic_call] + _( + SystemOrigin::Signed(caller.clone()), + KSM, + repay_amount.into(), + ); + + assert_last_event::(Event::::RepaidBorrow(caller, KSM, repay_amount.into()).into()); + Ok(()) } - repay_borrow_all { + #[benchmark] + fn repay_borrow_all() -> Result<(), BenchmarkError> { let caller: T::AccountId = whitelisted_caller(); transfer_initial_balance::(caller.clone()); let deposit_amount: u32 = 200_000_000; let borrowed_amount: u32 = 100_000_000; - assert_ok!(LendMarket::::add_market(SystemOrigin::Root.into(), DOT_U, pending_market_mock::(LUSDT))); + assert_ok!(LendMarket::::add_market_bond( SystemOrigin::Root.into(), - DOT_U, - vec![DOT_U] + KSM, + vec![KSM] + )); + assert_ok!(LendMarket::::add_market( + SystemOrigin::Root.into(), + KSM, + pending_market_mock::(VSKSM) )); - assert_ok!(LendMarket::::activate_market(SystemOrigin::Root.into(), DOT_U)); - assert_ok!(LendMarket::::mint(SystemOrigin::Signed(caller.clone()).into(), DOT_U, deposit_amount.into())); - assert_ok!(LendMarket::::collateral_asset(SystemOrigin::Signed(caller.clone()).into(), DOT_U, true)); - assert_ok!(LendMarket::::borrow(SystemOrigin::Signed(caller.clone()).into(), DOT_U, borrowed_amount.into())); - }: _(SystemOrigin::Signed(caller.clone()), DOT_U) - verify { - assert_last_event::(Event::::RepaidBorrow(caller, DOT_U, borrowed_amount.into()).into()); + assert_ok!(LendMarket::::activate_market( + SystemOrigin::Root.into(), + KSM + )); + assert_ok!(LendMarket::::mint( + SystemOrigin::Signed(caller.clone()).into(), + KSM, + deposit_amount.into() + )); + assert_ok!(LendMarket::::collateral_asset( + SystemOrigin::Signed(caller.clone()).into(), + KSM, + true + )); + assert_ok!(LendMarket::::borrow( + SystemOrigin::Signed(caller.clone()).into(), + KSM, + borrowed_amount.into() + )); + + #[extrinsic_call] + _(SystemOrigin::Signed(caller.clone()), KSM); + + assert_last_event::( + Event::::RepaidBorrow(caller, KSM, borrowed_amount.into()).into(), + ); + Ok(()) } - collateral_asset { + #[benchmark] + fn collateral_asset() -> Result<(), BenchmarkError> { let caller: T::AccountId = whitelisted_caller(); transfer_initial_balance::(caller.clone()); let deposit_amount: u32 = 200_000_000; - assert_ok!(LendMarket::::add_market(SystemOrigin::Root.into(), DOT_U, pending_market_mock::(LUSDT))); - assert_ok!(LendMarket::::activate_market(SystemOrigin::Root.into(), DOT_U)); - assert_ok!(LendMarket::::mint(SystemOrigin::Signed(caller.clone()).into(), DOT_U, deposit_amount.into())); - }: _(SystemOrigin::Signed(caller.clone()), DOT_U, true) - verify { - assert_last_event::(Event::::CollateralAssetAdded(caller, DOT_U).into()); + + assert_ok!(LendMarket::::add_market( + SystemOrigin::Root.into(), + KSM, + pending_market_mock::(VSKSM) + )); + assert_ok!(LendMarket::::activate_market( + SystemOrigin::Root.into(), + KSM + )); + assert_ok!(LendMarket::::mint( + SystemOrigin::Signed(caller.clone()).into(), + KSM, + deposit_amount.into() + )); + + #[extrinsic_call] + _(SystemOrigin::Signed(caller.clone()), KSM, true); + + assert_last_event::(Event::::CollateralAssetAdded(caller, KSM).into()); + Ok(()) } - liquidate_borrow { + #[benchmark] + fn liquidate_borrow() -> Result<(), BenchmarkError> { let alice: T::AccountId = account("Sample", 100, SEED); let bob: T::AccountId = account("Sample", 101, SEED); transfer_initial_balance::(alice.clone()); @@ -338,51 +576,142 @@ benchmarks! { let borrowed_amount: u32 = 200_000_000; let liquidate_amount: u32 = 100_000_000; let incentive_amount: u32 = 110_000_000; - assert_ok!(LendMarket::::add_market(SystemOrigin::Root.into(), VKSM, pending_market_mock::(VSKSM))); - assert_ok!(LendMarket::::activate_market(SystemOrigin::Root.into(), VKSM)); - assert_ok!(LendMarket::::add_market(SystemOrigin::Root.into(), KSM, pending_market_mock::(LKSM))); - assert_ok!(LendMarket::::activate_market(SystemOrigin::Root.into(), KSM)); - assert_ok!(LendMarket::::mint(SystemOrigin::Signed(bob.clone()).into(), KSM, deposit_amount.into())); - assert_ok!(LendMarket::::mint(SystemOrigin::Signed(alice.clone()).into(), VKSM, deposit_amount.into())); - assert_ok!(LendMarket::::collateral_asset(SystemOrigin::Signed(alice.clone()).into(), VKSM, true)); + + assert_ok!(LendMarket::::add_market( + SystemOrigin::Root.into(), + VKSM, + pending_market_mock::(VSKSM) + )); + assert_ok!(LendMarket::::activate_market( + SystemOrigin::Root.into(), + VKSM + )); + assert_ok!(LendMarket::::add_market( + SystemOrigin::Root.into(), + KSM, + pending_market_mock::(LKSM) + )); + assert_ok!(LendMarket::::activate_market( + SystemOrigin::Root.into(), + KSM + )); + assert_ok!(LendMarket::::mint( + SystemOrigin::Signed(bob.clone()).into(), + KSM, + deposit_amount.into() + )); + assert_ok!(LendMarket::::mint( + SystemOrigin::Signed(alice.clone()).into(), + VKSM, + deposit_amount.into() + )); + assert_ok!(LendMarket::::collateral_asset( + SystemOrigin::Signed(alice.clone()).into(), + VKSM, + true + )); set_account_borrows::(alice.clone(), KSM, borrowed_amount.into()); - }: _(SystemOrigin::Signed(bob.clone()), alice.clone(), KSM, liquidate_amount.into(), VKSM) - verify { - assert_last_event::(Event::::LiquidatedBorrow(bob.clone(), alice.clone(), KSM, VKSM, liquidate_amount.into(), incentive_amount.into()).into()); + + #[extrinsic_call] + _( + SystemOrigin::Signed(bob.clone()), + alice.clone(), + KSM, + liquidate_amount.into(), + VKSM, + ); + + assert_last_event::( + Event::::LiquidatedBorrow( + bob.clone(), + alice.clone(), + KSM, + VKSM, + liquidate_amount.into(), + incentive_amount.into(), + ) + .into(), + ); + Ok(()) } - add_reserves { + #[benchmark] + fn add_reserves() -> Result<(), BenchmarkError> { let caller: T::AccountId = whitelisted_caller(); let payer = T::Lookup::unlookup(caller.clone()); transfer_initial_balance::(caller.clone()); - let amount: u32 = 2000; - assert_ok!(LendMarket::::add_market(SystemOrigin::Root.into(), DOT_U, pending_market_mock::(LUSDT))); - assert_ok!(LendMarket::::activate_market(SystemOrigin::Root.into(), DOT_U)); - }: _(SystemOrigin::Root, payer, DOT_U, amount.into()) - verify { - assert_last_event::(Event::::ReservesAdded(caller, DOT_U, amount.into(), amount.into()).into()); + let amount: u32 = 400_000_000; + + assert_ok!(LendMarket::::add_market( + SystemOrigin::Root.into(), + KSM, + pending_market_mock::(VSKSM) + )); + assert_ok!(LendMarket::::activate_market( + SystemOrigin::Root.into(), + KSM + )); + + #[extrinsic_call] + _(SystemOrigin::Root, payer, KSM, amount.into()); + + assert_last_event::( + Event::::ReservesAdded(caller, KSM, amount.into(), amount.into()).into(), + ); + Ok(()) } - reduce_reserves { + #[benchmark] + fn reduce_reserves() -> Result<(), BenchmarkError> { let caller: T::AccountId = whitelisted_caller(); let payer = T::Lookup::unlookup(caller.clone()); transfer_initial_balance::(caller.clone()); - let add_amount: u32 = 2000; - let reduce_amount: u32 = 1000; - assert_ok!(LendMarket::::add_market(SystemOrigin::Root.into(), DOT_U, pending_market_mock::(LUSDT))); - assert_ok!(LendMarket::::activate_market(SystemOrigin::Root.into(), DOT_U)); - assert_ok!(LendMarket::::add_reserves(SystemOrigin::Root.into(), payer.clone(), DOT_U, add_amount.into())); - }: _(SystemOrigin::Root, payer, DOT_U, reduce_amount.into()) - verify { - assert_last_event::(Event::::ReservesReduced(caller, DOT_U, reduce_amount.into(), (add_amount-reduce_amount).into()).into()); + let add_amount: u32 = 400_000_000; + let reduce_amount: u32 = 300_000_000; + + assert_ok!(LendMarket::::add_market( + SystemOrigin::Root.into(), + KSM, + pending_market_mock::(VSKSM) + )); + assert_ok!(LendMarket::::activate_market( + SystemOrigin::Root.into(), + KSM + )); + assert_ok!(LendMarket::::add_reserves( + SystemOrigin::Root.into(), + payer.clone(), + KSM, + add_amount.into() + )); + + #[extrinsic_call] + _(SystemOrigin::Root, payer, KSM, reduce_amount.into()); + + assert_last_event::( + Event::::ReservesReduced( + caller, + KSM, + reduce_amount.into(), + (add_amount - reduce_amount).into(), + ) + .into(), + ); + Ok(()) } - update_liquidation_free_collateral { + #[benchmark] + fn update_liquidation_free_collateral() -> Result<(), BenchmarkError> { + #[extrinsic_call] + _(SystemOrigin::Root, vec![KSM]); - }: _(SystemOrigin::Root, vec![PHA]) - verify { - assert_last_event::(Event::::LiquidationFreeCollateralsUpdated(vec![PHA]).into()); + assert_last_event::(Event::::LiquidationFreeCollateralsUpdated(vec![KSM]).into()); + Ok(()) } -} -impl_benchmark_test_suite!(LendMarket, crate::mock::new_test_ext(), crate::mock::Test); + impl_benchmark_test_suite!( + Pallet, + crate::mock::new_test_ext_benchmark(), + crate::mock::Test + ); +} diff --git a/pallets/lend-market/src/mock.rs b/pallets/lend-market/src/mock.rs index 63ea2fcfce..f0a30ce821 100644 --- a/pallets/lend-market/src/mock.rs +++ b/pallets/lend-market/src/mock.rs @@ -506,3 +506,36 @@ pub const ACTIVE_MARKET_MOCK: Market = { market.state = MarketState::Active; market }; + +pub struct ExtBuilder { + balances: Vec<(AccountId, Balance)>, +} + +impl Default for ExtBuilder { + fn default() -> Self { + Self { balances: vec![] } + } +} + +impl ExtBuilder { + pub fn build(self) -> sp_io::TestExternalities { + let mut t = frame_system::GenesisConfig::::default() + .build_storage() + .unwrap(); + + pallet_balances::GenesisConfig:: { + balances: self.balances.into_iter().collect::>(), + } + .assimilate_storage(&mut t) + .unwrap(); + + let mut ext = sp_io::TestExternalities::new(t); + ext.execute_with(|| System::set_block_number(1)); + ext + } +} + +#[cfg(feature = "runtime-benchmarks")] +pub fn new_test_ext_benchmark() -> sp_io::TestExternalities { + ExtBuilder::default().build() +} diff --git a/pallets/lend-market/src/weights.rs b/pallets/lend-market/src/weights.rs index 96ae775757..0f5ac6c2b1 100644 --- a/pallets/lend-market/src/weights.rs +++ b/pallets/lend-market/src/weights.rs @@ -15,27 +15,34 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. -//! Autogenerated weights for pallet_loans +//! Autogenerated weights for lend_market //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-05-30, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kerria-dev"), DB CACHE: 1024 +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.1 +//! DATE: 2025-01-06, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `mjl-legion`, CPU: `12th Gen Intel(R) Core(TM) i9-12900H` +//! WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 // Executed Command: -// ./target/release/parallel +// target/release/bifrost // benchmark // pallet -// --chain=kerria-dev -// --execution=wasm -// --wasm-execution=compiled -// --pallet=pallet-loans -// --extrinsic=* +// --chain=bifrost-kusama-local // --steps=50 // --repeat=20 +// --pallet=lend-market +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled // --heap-pages=4096 -// --template=./.maintain/frame-weight-template.hbs -// --output=./pallets/loans/src/weights.rs +// --output=./pallets/lend-market/src/weights.rs +// --template=./weight-template/pallet-weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -44,7 +51,7 @@ use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; use sp_std::marker::PhantomData; -/// Weight functions needed for loans. +/// Weight functions needed for lend_market. pub trait WeightInfo { fn add_market() -> Weight; fn activate_market() -> Weight; @@ -52,6 +59,7 @@ pub trait WeightInfo { fn update_market() -> Weight; fn force_update_market() -> Weight; fn add_reward() -> Weight; + fn withdraw_missing_reward() -> Weight; fn update_market_reward_speed() -> Weight; fn claim_reward() -> Weight; fn claim_reward_for_market() -> Weight; @@ -61,1254 +69,526 @@ pub trait WeightInfo { fn redeem_all() -> Weight; fn repay_borrow() -> Weight; fn repay_borrow_all() -> Weight; - fn deposit_all_collateral() -> Weight; - fn withdraw_all_collateral() -> Weight; + fn collateral_asset() -> Weight; fn liquidate_borrow() -> Weight; - fn reduce_incentive_reserves() -> Weight; fn add_reserves() -> Weight; fn reduce_reserves() -> Weight; - fn withdraw_missing_reward() -> Weight; - fn collateral_asset() -> Weight; fn update_liquidation_free_collateral() -> Weight; } -/// Weights for loans using the Substrate node and recommended hardware. -pub struct BifrostWeight(PhantomData); -impl WeightInfo for BifrostWeight { - /// Storage: Loans Markets (r:2 w:1) - /// Proof Skipped: Loans Markets (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans UnderlyingAssetId (r:1 w:1) - /// Proof Skipped: Loans UnderlyingAssetId (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans MinExchangeRate (r:1 w:0) - /// Proof Skipped: Loans MinExchangeRate (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Loans ExchangeRate (r:0 w:1) - /// Proof Skipped: Loans ExchangeRate (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans BorrowIndex (r:0 w:1) - /// Proof Skipped: Loans BorrowIndex (max_values: None, max_size: None, mode: Measured) - fn add_market() -> Weight { - // Proof Size summary in bytes: - // Measured: `1207` - // Estimated: `13955` - // Minimum execution time: 63_487_000 picoseconds. - Weight::from_parts(64_509_000, 13955) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().writes(4_u64)) - } - /// Storage: Loans Markets (r:1 w:1) - /// Proof Skipped: Loans Markets (max_values: None, max_size: None, mode: Measured) - fn activate_market() -> Weight { - // Proof Size summary in bytes: - // Measured: `1504` - // Estimated: `3979` - // Minimum execution time: 38_988_000 picoseconds. - Weight::from_parts(39_729_000, 3979) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: Loans Markets (r:1 w:1) - /// Proof Skipped: Loans Markets (max_values: None, max_size: None, mode: Measured) - fn update_rate_model() -> Weight { - // Proof Size summary in bytes: - // Measured: `1504` - // Estimated: `3979` - // Minimum execution time: 39_930_000 picoseconds. - Weight::from_parts(40_290_000, 3979) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: Loans Markets (r:1 w:1) - /// Proof Skipped: Loans Markets (max_values: None, max_size: None, mode: Measured) - fn update_market() -> Weight { - // Proof Size summary in bytes: - // Measured: `1504` - // Estimated: `3979` - // Minimum execution time: 42_776_000 picoseconds. - Weight::from_parts(43_437_000, 3979) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: Loans UnderlyingAssetId (r:1 w:1) - /// Proof Skipped: Loans UnderlyingAssetId (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans Markets (r:1 w:1) - /// Proof Skipped: Loans Markets (max_values: None, max_size: None, mode: Measured) - fn force_update_market() -> Weight { - // Proof Size summary in bytes: - // Measured: `1515` - // Estimated: `7980` - // Minimum execution time: 49_660_000 picoseconds. - Weight::from_parts(50_240_000, 7980) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - } - /// 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:1) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - fn add_reward() -> Weight { - // Proof Size summary in bytes: - // Measured: `2308` - // Estimated: `7783` - // Minimum execution time: 94_319_000 picoseconds. - Weight::from_parts(95_110_000, 7783) - .saturating_add(T::DbWeight::get().reads(3_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) - } - /// Storage: Loans Markets (r:2 w:0) - /// Proof Skipped: Loans Markets (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardSupplySpeed (r:1 w:1) - /// Proof Skipped: Loans RewardSupplySpeed (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardBorrowSpeed (r:1 w:1) - /// Proof Skipped: Loans RewardBorrowSpeed (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardSupplyState (r:1 w:1) - /// Proof Skipped: Loans RewardSupplyState (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardBorrowState (r:1 w:1) - /// Proof Skipped: Loans RewardBorrowState (max_values: None, max_size: None, mode: Measured) - fn update_market_reward_speed() -> Weight { - // Proof Size summary in bytes: - // Measured: `1518` - // Estimated: `22440` - // Minimum execution time: 71_924_000 picoseconds. - Weight::from_parts(72_495_000, 22440) - .saturating_add(T::DbWeight::get().reads(6_u64)) - .saturating_add(T::DbWeight::get().writes(4_u64)) - } - /// Storage: Loans Markets (r:2 w:0) - /// Proof Skipped: Loans Markets (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardSupplyState (r:1 w:1) - /// Proof Skipped: Loans RewardSupplyState (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardSupplySpeed (r:1 w:0) - /// Proof Skipped: Loans RewardSupplySpeed (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens TotalIssuance (r:1 w:0) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: Loans RewardSupplierIndex (r:1 w:1) - /// Proof Skipped: Loans RewardSupplierIndex (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardAccrued (r:1 w:1) - /// Proof Skipped: Loans RewardAccrued (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:3 w:2) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: Loans RewardBorrowState (r:1 w:1) - /// Proof Skipped: Loans RewardBorrowState (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardBorrowSpeed (r:1 w:0) - /// Proof Skipped: Loans RewardBorrowSpeed (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans TotalBorrows (r:1 w:0) - /// Proof Skipped: Loans TotalBorrows (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans BorrowIndex (r:1 w:0) - /// Proof Skipped: Loans BorrowIndex (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardBorrowerIndex (r:1 w:1) - /// Proof Skipped: Loans RewardBorrowerIndex (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans AccountBorrows (r:1 w:0) - /// Proof Skipped: Loans AccountBorrows (max_values: None, max_size: None, mode: Measured) - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - fn claim_reward() -> Weight { - // Proof Size summary in bytes: - // Measured: `3492` - // Estimated: `80995` - // Minimum execution time: 210_812_000 picoseconds. - Weight::from_parts(211_623_000, 80995) - .saturating_add(T::DbWeight::get().reads(17_u64)) - .saturating_add(T::DbWeight::get().writes(7_u64)) - } - /// Storage: Loans RewardSupplyState (r:1 w:1) - /// Proof Skipped: Loans RewardSupplyState (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardSupplySpeed (r:1 w:0) - /// Proof Skipped: Loans RewardSupplySpeed (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans Markets (r:1 w:0) - /// Proof Skipped: Loans Markets (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens TotalIssuance (r:1 w:0) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: Loans RewardSupplierIndex (r:1 w:1) - /// Proof Skipped: Loans RewardSupplierIndex (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardAccrued (r:1 w:1) - /// Proof Skipped: Loans RewardAccrued (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:3 w:2) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: Loans RewardBorrowState (r:1 w:1) - /// Proof Skipped: Loans RewardBorrowState (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardBorrowSpeed (r:1 w:0) - /// Proof Skipped: Loans RewardBorrowSpeed (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans TotalBorrows (r:1 w:0) - /// Proof Skipped: Loans TotalBorrows (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans BorrowIndex (r:1 w:0) - /// Proof Skipped: Loans BorrowIndex (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardBorrowerIndex (r:1 w:1) - /// Proof Skipped: Loans RewardBorrowerIndex (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans AccountBorrows (r:1 w:0) - /// Proof Skipped: Loans AccountBorrows (max_values: None, max_size: None, mode: Measured) - /// Storage: System Account (r:1 w:0) - /// 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: `3492` - // Estimated: `78520` - // Minimum execution time: 196_984_000 picoseconds. - Weight::from_parts(197_816_000, 78520) - .saturating_add(T::DbWeight::get().reads(16_u64)) - .saturating_add(T::DbWeight::get().writes(7_u64)) - } - /// Storage: Loans Markets (r:2 w:0) - /// Proof Skipped: Loans Markets (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:3 w:3) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, 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) - /// Proof Skipped: Loans LastAccruedInterestTime (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardSupplyState (r:1 w:1) - /// Proof Skipped: Loans RewardSupplyState (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardSupplySpeed (r:1 w:0) - /// Proof Skipped: Loans RewardSupplySpeed (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardSupplierIndex (r:1 w:1) - /// Proof Skipped: Loans RewardSupplierIndex (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardAccrued (r:1 w:1) - /// Proof Skipped: Loans RewardAccrued (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans UnderlyingAssetId (r:1 w:0) - /// Proof Skipped: Loans UnderlyingAssetId (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens TotalIssuance (r:1 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: Loans TotalBorrows (r:1 w:0) - /// Proof Skipped: Loans TotalBorrows (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans TotalReserves (r:1 w:0) - /// Proof Skipped: Loans TotalReserves (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans MinExchangeRate (r:1 w:0) - /// Proof Skipped: Loans MinExchangeRate (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Loans AccountDeposits (r:1 w:0) - /// Proof Skipped: Loans AccountDeposits (max_values: None, max_size: None, mode: Measured) - fn mint() -> Weight { - // Proof Size summary in bytes: - // Measured: `2944` - // Estimated: `73490` - // Minimum execution time: 274_890_000 picoseconds. - Weight::from_parts(276_413_000, 73490) - .saturating_add(T::DbWeight::get().reads(18_u64)) - .saturating_add(T::DbWeight::get().writes(9_u64)) - } - /// Storage: Loans Markets (r:2 w:0) - /// Proof Skipped: Loans Markets (max_values: None, max_size: None, mode: Measured) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: Loans LastAccruedInterestTime (r:1 w:1) - /// Proof Skipped: Loans LastAccruedInterestTime (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans TotalBorrows (r:1 w:1) - /// Proof Skipped: Loans TotalBorrows (max_values: None, max_size: None, mode: Measured) - /// 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: Loans TotalReserves (r:1 w:0) - /// Proof Skipped: Loans TotalReserves (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans AccountDeposits (r:1 w:0) - /// Proof Skipped: Loans AccountDeposits (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans UnderlyingAssetId (r:1 w:0) - /// Proof Skipped: Loans UnderlyingAssetId (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens TotalIssuance (r:1 w:0) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: Loans MinExchangeRate (r:1 w:0) - /// Proof Skipped: Loans MinExchangeRate (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Loans MaxExchangeRate (r:1 w:0) - /// Proof Skipped: Loans MaxExchangeRate (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Loans AccountBorrows (r:1 w:1) - /// Proof Skipped: Loans AccountBorrows (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardBorrowState (r:1 w:1) - /// Proof Skipped: Loans RewardBorrowState (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardBorrowSpeed (r:1 w:0) - /// Proof Skipped: Loans RewardBorrowSpeed (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardBorrowerIndex (r:1 w:1) - /// Proof Skipped: Loans RewardBorrowerIndex (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardAccrued (r:1 w:1) - /// Proof Skipped: Loans RewardAccrued (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans BorrowIndex (r:1 w:0) - /// Proof Skipped: Loans BorrowIndex (max_values: None, max_size: None, mode: Measured) - fn borrow() -> Weight { - // Proof Size summary in bytes: - // Measured: `3312` - // Estimated: `90329` - // Minimum execution time: 262_856_000 picoseconds. - Weight::from_parts(265_230_000, 90329) - .saturating_add(T::DbWeight::get().reads(20_u64)) - .saturating_add(T::DbWeight::get().writes(8_u64)) - } - /// Storage: Loans Markets (r:2 w:0) - /// Proof Skipped: Loans Markets (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans UnderlyingAssetId (r:1 w:0) - /// Proof Skipped: Loans UnderlyingAssetId (max_values: None, max_size: None, mode: Measured) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: Loans LastAccruedInterestTime (r:1 w:1) - /// Proof Skipped: Loans LastAccruedInterestTime (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens TotalIssuance (r:1 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:3 w:3) - /// 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: Loans TotalBorrows (r:1 w:0) - /// Proof Skipped: Loans TotalBorrows (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans TotalReserves (r:1 w:0) - /// Proof Skipped: Loans TotalReserves (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans MinExchangeRate (r:1 w:0) - /// Proof Skipped: Loans MinExchangeRate (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Loans MaxExchangeRate (r:1 w:0) - /// Proof Skipped: Loans MaxExchangeRate (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Loans AccountDeposits (r:1 w:0) - /// Proof Skipped: Loans AccountDeposits (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardSupplyState (r:1 w:1) - /// Proof Skipped: Loans RewardSupplyState (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardSupplySpeed (r:1 w:0) - /// Proof Skipped: Loans RewardSupplySpeed (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardSupplierIndex (r:1 w:1) - /// Proof Skipped: Loans RewardSupplierIndex (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardAccrued (r:1 w:1) - /// Proof Skipped: Loans RewardAccrued (max_values: None, max_size: None, mode: Measured) - fn redeem() -> Weight { - // Proof Size summary in bytes: - // Measured: `3368` - // Estimated: `82017` - // Minimum execution time: 324_119_000 picoseconds. - Weight::from_parts(324_981_000, 82017) - .saturating_add(T::DbWeight::get().reads(19_u64)) - .saturating_add(T::DbWeight::get().writes(8_u64)) - } - /// Storage: Loans Markets (r:2 w:0) - /// Proof Skipped: Loans Markets (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:3 w:3) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: Loans UnderlyingAssetId (r:1 w:0) - /// Proof Skipped: Loans UnderlyingAssetId (max_values: None, max_size: None, mode: Measured) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: Loans LastAccruedInterestTime (r:1 w:1) - /// Proof Skipped: Loans LastAccruedInterestTime (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens TotalIssuance (r:1 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: Loans TotalBorrows (r:1 w:0) - /// Proof Skipped: Loans TotalBorrows (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans TotalReserves (r:1 w:0) - /// Proof Skipped: Loans TotalReserves (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans MinExchangeRate (r:1 w:0) - /// Proof Skipped: Loans MinExchangeRate (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Loans MaxExchangeRate (r:1 w:0) - /// Proof Skipped: Loans MaxExchangeRate (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Loans AccountDeposits (r:1 w:0) - /// Proof Skipped: Loans AccountDeposits (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardSupplyState (r:1 w:1) - /// Proof Skipped: Loans RewardSupplyState (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardSupplySpeed (r:1 w:0) - /// Proof Skipped: Loans RewardSupplySpeed (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardSupplierIndex (r:1 w:1) - /// Proof Skipped: Loans RewardSupplierIndex (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardAccrued (r:1 w:1) - /// Proof Skipped: Loans RewardAccrued (max_values: None, max_size: None, mode: Measured) - fn redeem_all() -> Weight { - // Proof Size summary in bytes: - // Measured: `3368` - // Estimated: `82017` - // Minimum execution time: 325_041_000 picoseconds. - Weight::from_parts(327_495_000, 82017) - .saturating_add(T::DbWeight::get().reads(19_u64)) - .saturating_add(T::DbWeight::get().writes(8_u64)) - } - /// Storage: Loans Markets (r:2 w:0) - /// Proof Skipped: Loans Markets (max_values: None, max_size: None, mode: Measured) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: Loans LastAccruedInterestTime (r:1 w:1) - /// Proof Skipped: Loans LastAccruedInterestTime (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans AccountBorrows (r:1 w:1) - /// Proof Skipped: Loans AccountBorrows (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans BorrowIndex (r:1 w:0) - /// Proof Skipped: Loans BorrowIndex (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardBorrowState (r:1 w:1) - /// Proof Skipped: Loans RewardBorrowState (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardBorrowSpeed (r:1 w:0) - /// Proof Skipped: Loans RewardBorrowSpeed (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardBorrowerIndex (r:1 w:1) - /// Proof Skipped: Loans RewardBorrowerIndex (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardAccrued (r:1 w:1) - /// Proof Skipped: Loans RewardAccrued (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:2 w:2) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: Loans TotalBorrows (r:1 w:1) - /// Proof Skipped: Loans TotalBorrows (max_values: None, max_size: None, mode: Measured) - fn repay_borrow() -> Weight { - // Proof Size summary in bytes: - // Measured: `3407` - // Estimated: `61096` - // Minimum execution time: 179_189_000 picoseconds. - Weight::from_parts(180_952_000, 61096) - .saturating_add(T::DbWeight::get().reads(13_u64)) - .saturating_add(T::DbWeight::get().writes(8_u64)) - } - /// Storage: Loans Markets (r:2 w:0) - /// Proof Skipped: Loans Markets (max_values: None, max_size: None, mode: Measured) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: Loans LastAccruedInterestTime (r:1 w:1) - /// Proof Skipped: Loans LastAccruedInterestTime (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans AccountBorrows (r:1 w:1) - /// Proof Skipped: Loans AccountBorrows (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans BorrowIndex (r:1 w:0) - /// Proof Skipped: Loans BorrowIndex (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardBorrowState (r:1 w:1) - /// Proof Skipped: Loans RewardBorrowState (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardBorrowSpeed (r:1 w:0) - /// Proof Skipped: Loans RewardBorrowSpeed (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardBorrowerIndex (r:1 w:1) - /// Proof Skipped: Loans RewardBorrowerIndex (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardAccrued (r:1 w:1) - /// Proof Skipped: Loans RewardAccrued (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:2 w:2) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: Loans TotalBorrows (r:1 w:1) - /// Proof Skipped: Loans TotalBorrows (max_values: None, max_size: None, mode: Measured) - fn repay_borrow_all() -> Weight { - // Proof Size summary in bytes: - // Measured: `3407` - // Estimated: `61096` - // Minimum execution time: 197_625_000 picoseconds. - Weight::from_parts(198_568_000, 61096) - .saturating_add(T::DbWeight::get().reads(13_u64)) - .saturating_add(T::DbWeight::get().writes(8_u64)) - } - /// Storage: Loans Markets (r:2 w:0) - /// Proof Skipped: Loans Markets (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:1 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: Loans UnderlyingAssetId (r:1 w:0) - /// Proof Skipped: Loans UnderlyingAssetId (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans AccountDeposits (r:1 w:1) - /// Proof Skipped: Loans AccountDeposits (max_values: None, max_size: None, mode: Measured) - fn deposit_all_collateral() -> Weight { - // Proof Size summary in bytes: - // Measured: `2295` - // Estimated: `19375` - // Minimum execution time: 102_335_000 picoseconds. - Weight::from_parts(103_146_000, 19375) - .saturating_add(T::DbWeight::get().reads(5_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - } - /// Storage: Loans Markets (r:2 w:0) - /// Proof Skipped: Loans Markets (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans AccountDeposits (r:1 w:1) - /// Proof Skipped: Loans AccountDeposits (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans UnderlyingAssetId (r:1 w:0) - /// Proof Skipped: Loans UnderlyingAssetId (max_values: None, max_size: None, mode: Measured) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: Loans LastAccruedInterestTime (r:1 w:1) - /// Proof Skipped: Loans LastAccruedInterestTime (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens TotalIssuance (r:1 w:0) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:2 w:1) - /// 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: Loans TotalBorrows (r:1 w:0) - /// Proof Skipped: Loans TotalBorrows (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans TotalReserves (r:1 w:0) - /// Proof Skipped: Loans TotalReserves (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans MinExchangeRate (r:1 w:0) - /// Proof Skipped: Loans MinExchangeRate (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Loans MaxExchangeRate (r:1 w:0) - /// Proof Skipped: Loans MaxExchangeRate (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Loans AccountBorrows (r:1 w:0) - /// Proof Skipped: Loans AccountBorrows (max_values: None, max_size: None, mode: Measured) - fn withdraw_all_collateral() -> Weight { - // Proof Size summary in bytes: - // Measured: `3242` - // Estimated: `60764` - // Minimum execution time: 225_110_000 picoseconds. - Weight::from_parts(226_403_000, 60764) - .saturating_add(T::DbWeight::get().reads(15_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) - } - /// 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:2 w:2) - /// Proof Skipped: Loans LastAccruedInterestTime (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans Markets (r:3 w:0) - /// Proof Skipped: Loans Markets (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans AccountDeposits (r:4 w:1) - /// Proof Skipped: Loans AccountDeposits (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans UnderlyingAssetId (r:1 w:0) - /// Proof Skipped: Loans UnderlyingAssetId (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens TotalIssuance (r:1 w:0) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:6 w:5) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: System Account (r:4 w:2) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: Loans TotalBorrows (r:2 w:1) - /// Proof Skipped: Loans TotalBorrows (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans TotalReserves (r:1 w:0) - /// Proof Skipped: Loans TotalReserves (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans MinExchangeRate (r:1 w:0) - /// Proof Skipped: Loans MinExchangeRate (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Loans MaxExchangeRate (r:1 w:0) - /// Proof Skipped: Loans MaxExchangeRate (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof Skipped: Security ParachainStatus (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Oracle Aggregate (r:1 w:0) - /// Proof Skipped: Oracle Aggregate (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans AccountBorrows (r:3 w:1) - /// Proof Skipped: Loans AccountBorrows (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans BorrowIndex (r:1 w:0) - /// Proof Skipped: Loans BorrowIndex (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardBorrowState (r:1 w:1) - /// Proof Skipped: Loans RewardBorrowState (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardBorrowSpeed (r:1 w:0) - /// Proof Skipped: Loans RewardBorrowSpeed (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardBorrowerIndex (r:1 w:1) - /// Proof Skipped: Loans RewardBorrowerIndex (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardAccrued (r:3 w:3) - /// Proof Skipped: Loans RewardAccrued (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardSupplyState (r:1 w:1) - /// Proof Skipped: Loans RewardSupplyState (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardSupplySpeed (r:1 w:0) - /// Proof Skipped: Loans RewardSupplySpeed (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardSupplierIndex (r:3 w:3) - /// Proof Skipped: Loans RewardSupplierIndex (max_values: None, max_size: None, mode: Measured) - fn liquidate_borrow() -> Weight { - // Proof Size summary in bytes: - // Measured: `5226` - // Estimated: `201519` - // Minimum execution time: 762_145_000 picoseconds. - Weight::from_parts(766_944_000, 201519) - .saturating_add(T::DbWeight::get().reads(44_u64)) - .saturating_add(T::DbWeight::get().writes(21_u64)) - } - /// Storage: Loans Markets (r:2 w:0) - /// Proof Skipped: Loans Markets (max_values: None, max_size: None, mode: Measured) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: Loans LastAccruedInterestTime (r:1 w:1) - /// Proof Skipped: Loans LastAccruedInterestTime (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans UnderlyingAssetId (r:1 w:0) - /// Proof Skipped: Loans UnderlyingAssetId (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens TotalIssuance (r:1 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:4 w:4) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: System Account (r:2 w:1) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: Loans TotalBorrows (r:1 w:0) - /// Proof Skipped: Loans TotalBorrows (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans TotalReserves (r:1 w:0) - /// Proof Skipped: Loans TotalReserves (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans MinExchangeRate (r:1 w:0) - /// Proof Skipped: Loans MinExchangeRate (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Loans MaxExchangeRate (r:1 w:0) - /// Proof Skipped: Loans MaxExchangeRate (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Loans AccountDeposits (r:1 w:0) - /// Proof Skipped: Loans AccountDeposits (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardSupplyState (r:1 w:1) - /// Proof Skipped: Loans RewardSupplyState (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardSupplySpeed (r:1 w:0) - /// Proof Skipped: Loans RewardSupplySpeed (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardSupplierIndex (r:1 w:1) - /// Proof Skipped: Loans RewardSupplierIndex (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardAccrued (r:1 w:1) - /// Proof Skipped: Loans RewardAccrued (max_values: None, max_size: None, mode: Measured) - fn reduce_incentive_reserves() -> Weight { - // Proof Size summary in bytes: - // Measured: `4362` - // Estimated: `99138` - // Minimum execution time: 413_086_000 picoseconds. - Weight::from_parts(417_575_000, 99138) - .saturating_add(T::DbWeight::get().reads(21_u64)) - .saturating_add(T::DbWeight::get().writes(10_u64)) - } - /// Storage: Loans Markets (r:2 w:0) - /// Proof Skipped: Loans Markets (max_values: None, max_size: None, mode: Measured) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: Loans LastAccruedInterestTime (r:1 w:1) - /// Proof Skipped: Loans LastAccruedInterestTime (max_values: None, max_size: None, mode: Measured) - /// 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:1) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: Loans TotalReserves (r:1 w:1) - /// Proof Skipped: Loans TotalReserves (max_values: None, max_size: None, mode: Measured) - fn add_reserves() -> Weight { - // Proof Size summary in bytes: - // Measured: `2768` - // Estimated: `26490` - // Minimum execution time: 131_052_000 picoseconds. - Weight::from_parts(132_405_000, 26490) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().writes(5_u64)) - } - /// Storage: Loans Markets (r:2 w:0) - /// Proof Skipped: Loans Markets (max_values: None, max_size: None, mode: Measured) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: Loans LastAccruedInterestTime (r:1 w:1) - /// Proof Skipped: Loans LastAccruedInterestTime (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans TotalReserves (r:1 w:1) - /// Proof Skipped: Loans TotalReserves (max_values: None, max_size: None, mode: Measured) - /// 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) - fn reduce_reserves() -> Weight { - // Proof Size summary in bytes: - // Measured: `2857` - // Estimated: `26757` - // Minimum execution time: 115_421_000 picoseconds. - Weight::from_parts(116_053_000, 26757) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().writes(4_u64)) - } - fn withdraw_missing_reward() -> Weight { - // Proof Size summary in bytes: - // Measured: `2857` - // Estimated: `26757` - // Minimum execution time: 115_421_000 picoseconds. - Weight::from_parts(116_053_000, 26757) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().writes(4_u64)) - } - fn update_liquidation_free_collateral() -> Weight { - // Proof Size summary in bytes: - // Measured: `2857` - // Estimated: `26757` - // Minimum execution time: 115_421_000 picoseconds. - Weight::from_parts(116_053_000, 26757) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().writes(4_u64)) - } - fn collateral_asset() -> Weight { - // Proof Size summary in bytes: - // Measured: `2857` - // Estimated: `26757` - // Minimum execution time: 115_421_000 picoseconds. - Weight::from_parts(116_053_000, 26757) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().writes(4_u64)) - } -} - // For backwards compatibility and tests impl WeightInfo for () { - /// Storage: Loans Markets (r:2 w:1) - /// Proof Skipped: Loans Markets (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans UnderlyingAssetId (r:1 w:1) - /// Proof Skipped: Loans UnderlyingAssetId (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans MinExchangeRate (r:1 w:0) - /// Proof Skipped: Loans MinExchangeRate (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Loans ExchangeRate (r:0 w:1) - /// Proof Skipped: Loans ExchangeRate (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans BorrowIndex (r:0 w:1) - /// Proof Skipped: Loans BorrowIndex (max_values: None, max_size: None, mode: Measured) + /// Storage: `LendMarket::Markets` (r:2 w:1) + /// Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::UnderlyingAssetId` (r:1 w:1) + /// Proof: `LendMarket::UnderlyingAssetId` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::ExchangeRate` (r:0 w:1) + /// Proof: `LendMarket::ExchangeRate` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::BorrowIndex` (r:0 w:1) + /// Proof: `LendMarket::BorrowIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) fn add_market() -> Weight { // Proof Size summary in bytes: - // Measured: `1207` - // Estimated: `13955` - // Minimum execution time: 63_487_000 picoseconds. - Weight::from_parts(64_509_000, 13955) - .saturating_add(RocksDbWeight::get().reads(4_u64)) + // Measured: `76` + // Estimated: `6016` + // Minimum execution time: 12_841_000 picoseconds. + Weight::from_parts(14_335_000, 6016) + .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } - /// Storage: Loans Markets (r:1 w:1) - /// Proof Skipped: Loans Markets (max_values: None, max_size: None, mode: Measured) + /// Storage: `LendMarket::Markets` (r:1 w:1) + /// Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) fn activate_market() -> Weight { // Proof Size summary in bytes: - // Measured: `1504` - // Estimated: `3979` - // Minimum execution time: 38_988_000 picoseconds. - Weight::from_parts(39_729_000, 3979) + // Measured: `346` + // Estimated: `3811` + // Minimum execution time: 8_263_000 picoseconds. + Weight::from_parts(9_106_000, 3811) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } - /// Storage: Loans Markets (r:1 w:1) - /// Proof Skipped: Loans Markets (max_values: None, max_size: None, mode: Measured) + /// Storage: `LendMarket::Markets` (r:1 w:1) + /// Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) fn update_rate_model() -> Weight { // Proof Size summary in bytes: - // Measured: `1504` - // Estimated: `3979` - // Minimum execution time: 39_930_000 picoseconds. - Weight::from_parts(40_290_000, 3979) + // Measured: `346` + // Estimated: `3811` + // Minimum execution time: 8_885_000 picoseconds. + Weight::from_parts(9_299_000, 3811) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } - /// Storage: Loans Markets (r:1 w:1) - /// Proof Skipped: Loans Markets (max_values: None, max_size: None, mode: Measured) + /// Storage: `LendMarket::Markets` (r:1 w:1) + /// Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) fn update_market() -> Weight { // Proof Size summary in bytes: - // Measured: `1504` - // Estimated: `3979` - // Minimum execution time: 42_776_000 picoseconds. - Weight::from_parts(43_437_000, 3979) + // Measured: `346` + // Estimated: `3811` + // Minimum execution time: 9_517_000 picoseconds. + Weight::from_parts(9_971_000, 3811) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } - /// Storage: Loans UnderlyingAssetId (r:1 w:1) - /// Proof Skipped: Loans UnderlyingAssetId (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans Markets (r:1 w:1) - /// Proof Skipped: Loans Markets (max_values: None, max_size: None, mode: Measured) + /// Storage: `LendMarket::UnderlyingAssetId` (r:1 w:1) + /// Proof: `LendMarket::UnderlyingAssetId` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::Markets` (r:1 w:1) + /// Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) fn force_update_market() -> Weight { // Proof Size summary in bytes: - // Measured: `1515` - // Estimated: `7980` - // Minimum execution time: 49_660_000 picoseconds. - Weight::from_parts(50_240_000, 7980) + // Measured: `354` + // Estimated: `3819` + // Minimum execution time: 13_307_000 picoseconds. + Weight::from_parts(15_131_000, 3819) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } - /// 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:1) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: `System::Account` (r:2 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) fn add_reward() -> Weight { // Proof Size summary in bytes: - // Measured: `2308` - // Estimated: `7783` - // Minimum execution time: 94_319_000 picoseconds. - Weight::from_parts(95_110_000, 7783) - .saturating_add(RocksDbWeight::get().reads(3_u64)) - .saturating_add(RocksDbWeight::get().writes(3_u64)) + // Measured: `103` + // Estimated: `6196` + // Minimum execution time: 30_416_000 picoseconds. + Weight::from_parts(30_973_000, 6196) + .saturating_add(RocksDbWeight::get().reads(2_u64)) + .saturating_add(RocksDbWeight::get().writes(2_u64)) + } + /// Storage: `System::Account` (r:2 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + fn withdraw_missing_reward() -> Weight { + // Proof Size summary in bytes: + // Measured: `206` + // Estimated: `6196` + // Minimum execution time: 30_975_000 picoseconds. + Weight::from_parts(32_101_000, 6196) + .saturating_add(RocksDbWeight::get().reads(2_u64)) + .saturating_add(RocksDbWeight::get().writes(2_u64)) } - /// Storage: Loans Markets (r:2 w:0) - /// Proof Skipped: Loans Markets (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardSupplySpeed (r:1 w:1) - /// Proof Skipped: Loans RewardSupplySpeed (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardBorrowSpeed (r:1 w:1) - /// Proof Skipped: Loans RewardBorrowSpeed (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardSupplyState (r:1 w:1) - /// Proof Skipped: Loans RewardSupplyState (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardBorrowState (r:1 w:1) - /// Proof Skipped: Loans RewardBorrowState (max_values: None, max_size: None, mode: Measured) + /// Storage: `LendMarket::Markets` (r:2 w:0) + /// Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardSupplySpeed` (r:1 w:1) + /// Proof: `LendMarket::RewardSupplySpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardBorrowSpeed` (r:1 w:1) + /// Proof: `LendMarket::RewardBorrowSpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardSupplyState` (r:1 w:1) + /// Proof: `LendMarket::RewardSupplyState` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardBorrowState` (r:1 w:1) + /// Proof: `LendMarket::RewardBorrowState` (`max_values`: None, `max_size`: None, mode: `Measured`) fn update_market_reward_speed() -> Weight { // Proof Size summary in bytes: - // Measured: `1518` - // Estimated: `22440` - // Minimum execution time: 71_924_000 picoseconds. - Weight::from_parts(72_495_000, 22440) + // Measured: `354` + // Estimated: `6294` + // Minimum execution time: 20_031_000 picoseconds. + Weight::from_parts(20_976_000, 6294) .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } - /// Storage: Loans Markets (r:2 w:0) - /// Proof Skipped: Loans Markets (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardSupplyState (r:1 w:1) - /// Proof Skipped: Loans RewardSupplyState (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardSupplySpeed (r:1 w:0) - /// Proof Skipped: Loans RewardSupplySpeed (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens TotalIssuance (r:1 w:0) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: Loans RewardSupplierIndex (r:1 w:1) - /// Proof Skipped: Loans RewardSupplierIndex (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardAccrued (r:1 w:1) - /// Proof Skipped: Loans RewardAccrued (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:3 w:2) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: Loans RewardBorrowState (r:1 w:1) - /// Proof Skipped: Loans RewardBorrowState (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardBorrowSpeed (r:1 w:0) - /// Proof Skipped: Loans RewardBorrowSpeed (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans TotalBorrows (r:1 w:0) - /// Proof Skipped: Loans TotalBorrows (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans BorrowIndex (r:1 w:0) - /// Proof Skipped: Loans BorrowIndex (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardBorrowerIndex (r:1 w:1) - /// Proof Skipped: Loans RewardBorrowerIndex (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans AccountBorrows (r:1 w:0) - /// Proof Skipped: Loans AccountBorrows (max_values: None, max_size: None, mode: Measured) - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: `LendMarket::Markets` (r:2 w:0) + /// Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardSupplyState` (r:1 w:1) + /// Proof: `LendMarket::RewardSupplyState` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardSupplySpeed` (r:1 w:0) + /// Proof: `LendMarket::RewardSupplySpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardSupplierIndex` (r:1 w:1) + /// Proof: `LendMarket::RewardSupplierIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardAccured` (r:1 w:1) + /// Proof: `LendMarket::RewardAccured` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::AccountDeposits` (r:1 w:0) + /// Proof: `LendMarket::AccountDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardBorrowState` (r:1 w:1) + /// Proof: `LendMarket::RewardBorrowState` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardBorrowSpeed` (r:1 w:0) + /// Proof: `LendMarket::RewardBorrowSpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardBorrowerIndex` (r:1 w:1) + /// Proof: `LendMarket::RewardBorrowerIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::AccountBorrows` (r:1 w:0) + /// Proof: `LendMarket::AccountBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::BorrowIndex` (r:1 w:0) + /// Proof: `LendMarket::BorrowIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) fn claim_reward() -> Weight { // Proof Size summary in bytes: - // Measured: `3492` - // Estimated: `80995` - // Minimum execution time: 210_812_000 picoseconds. - Weight::from_parts(211_623_000, 80995) - .saturating_add(RocksDbWeight::get().reads(17_u64)) - .saturating_add(RocksDbWeight::get().writes(7_u64)) + // Measured: `376` + // Estimated: `6316` + // Minimum execution time: 40_397_000 picoseconds. + Weight::from_parts(42_256_000, 6316) + .saturating_add(RocksDbWeight::get().reads(12_u64)) + .saturating_add(RocksDbWeight::get().writes(5_u64)) } - /// Storage: Loans RewardSupplyState (r:1 w:1) - /// Proof Skipped: Loans RewardSupplyState (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardSupplySpeed (r:1 w:0) - /// Proof Skipped: Loans RewardSupplySpeed (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans Markets (r:1 w:0) - /// Proof Skipped: Loans Markets (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens TotalIssuance (r:1 w:0) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: Loans RewardSupplierIndex (r:1 w:1) - /// Proof Skipped: Loans RewardSupplierIndex (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardAccrued (r:1 w:1) - /// Proof Skipped: Loans RewardAccrued (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:3 w:2) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: Loans RewardBorrowState (r:1 w:1) - /// Proof Skipped: Loans RewardBorrowState (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardBorrowSpeed (r:1 w:0) - /// Proof Skipped: Loans RewardBorrowSpeed (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans TotalBorrows (r:1 w:0) - /// Proof Skipped: Loans TotalBorrows (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans BorrowIndex (r:1 w:0) - /// Proof Skipped: Loans BorrowIndex (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardBorrowerIndex (r:1 w:1) - /// Proof Skipped: Loans RewardBorrowerIndex (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans AccountBorrows (r:1 w:0) - /// Proof Skipped: Loans AccountBorrows (max_values: None, max_size: None, mode: Measured) - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: `LendMarket::RewardSupplyState` (r:1 w:1) + /// Proof: `LendMarket::RewardSupplyState` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardSupplySpeed` (r:1 w:0) + /// Proof: `LendMarket::RewardSupplySpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::TotalSupply` (r:1 w:0) + /// Proof: `LendMarket::TotalSupply` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardSupplierIndex` (r:1 w:1) + /// Proof: `LendMarket::RewardSupplierIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardAccured` (r:1 w:1) + /// Proof: `LendMarket::RewardAccured` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::AccountDeposits` (r:1 w:0) + /// Proof: `LendMarket::AccountDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardBorrowState` (r:1 w:1) + /// Proof: `LendMarket::RewardBorrowState` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardBorrowSpeed` (r:1 w:0) + /// Proof: `LendMarket::RewardBorrowSpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::TotalBorrows` (r:1 w:0) + /// Proof: `LendMarket::TotalBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::BorrowIndex` (r:1 w:0) + /// Proof: `LendMarket::BorrowIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardBorrowerIndex` (r:1 w:1) + /// Proof: `LendMarket::RewardBorrowerIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::AccountBorrows` (r:1 w:0) + /// Proof: `LendMarket::AccountBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:2 w:2) + /// 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: `3492` - // Estimated: `78520` - // Minimum execution time: 196_984_000 picoseconds. - Weight::from_parts(197_816_000, 78520) - .saturating_add(RocksDbWeight::get().reads(16_u64)) + // Measured: `1102` + // Estimated: `6196` + // Minimum execution time: 76_602_000 picoseconds. + Weight::from_parts(81_024_000, 6196) + .saturating_add(RocksDbWeight::get().reads(14_u64)) .saturating_add(RocksDbWeight::get().writes(7_u64)) } - /// Storage: Loans Markets (r:2 w:0) - /// Proof Skipped: Loans Markets (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:3 w:3) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, 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) - /// Proof Skipped: Loans LastAccruedInterestTime (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardSupplyState (r:1 w:1) - /// Proof Skipped: Loans RewardSupplyState (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardSupplySpeed (r:1 w:0) - /// Proof Skipped: Loans RewardSupplySpeed (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardSupplierIndex (r:1 w:1) - /// Proof Skipped: Loans RewardSupplierIndex (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardAccrued (r:1 w:1) - /// Proof Skipped: Loans RewardAccrued (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans UnderlyingAssetId (r:1 w:0) - /// Proof Skipped: Loans UnderlyingAssetId (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens TotalIssuance (r:1 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: Loans TotalBorrows (r:1 w:0) - /// Proof Skipped: Loans TotalBorrows (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans TotalReserves (r:1 w:0) - /// Proof Skipped: Loans TotalReserves (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans MinExchangeRate (r:1 w:0) - /// Proof Skipped: Loans MinExchangeRate (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Loans AccountDeposits (r:1 w:0) - /// Proof Skipped: Loans AccountDeposits (max_values: None, max_size: None, mode: Measured) + /// Storage: `LendMarket::Markets` (r:2 w:0) + /// Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Tokens::Accounts` (r:2 w:2) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(118), added: 2593, 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: `LendMarket::LastAccruedInterestTime` (r:1 w:1) + /// Proof: `LendMarket::LastAccruedInterestTime` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardSupplyState` (r:1 w:1) + /// Proof: `LendMarket::RewardSupplyState` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardSupplySpeed` (r:1 w:0) + /// Proof: `LendMarket::RewardSupplySpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardSupplierIndex` (r:1 w:1) + /// Proof: `LendMarket::RewardSupplierIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardAccured` (r:1 w:1) + /// Proof: `LendMarket::RewardAccured` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::AccountDeposits` (r:1 w:1) + /// Proof: `LendMarket::AccountDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::TotalSupply` (r:1 w:1) + /// Proof: `LendMarket::TotalSupply` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `LendMarket::TotalBorrows` (r:1 w:0) + /// Proof: `LendMarket::TotalBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::TotalReserves` (r:1 w:0) + /// Proof: `LendMarket::TotalReserves` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::AccountEarned` (r:1 w:1) + /// Proof: `LendMarket::AccountEarned` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `AssetRegistry::CurrencyMetadatas` (r:1 w:0) + /// Proof: `AssetRegistry::CurrencyMetadatas` (`max_values`: None, `max_size`: None, mode: `Measured`) fn mint() -> Weight { // Proof Size summary in bytes: - // Measured: `2944` - // Estimated: `73490` - // Minimum execution time: 274_890_000 picoseconds. - Weight::from_parts(276_413_000, 73490) - .saturating_add(RocksDbWeight::get().reads(18_u64)) - .saturating_add(RocksDbWeight::get().writes(9_u64)) + // Measured: `1010` + // Estimated: `6950` + // Minimum execution time: 70_577_000 picoseconds. + Weight::from_parts(76_769_000, 6950) + .saturating_add(RocksDbWeight::get().reads(17_u64)) + .saturating_add(RocksDbWeight::get().writes(10_u64)) } - /// Storage: Loans Markets (r:2 w:0) - /// Proof Skipped: Loans Markets (max_values: None, max_size: None, mode: Measured) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: Loans LastAccruedInterestTime (r:1 w:1) - /// Proof Skipped: Loans LastAccruedInterestTime (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans TotalBorrows (r:1 w:1) - /// Proof Skipped: Loans TotalBorrows (max_values: None, max_size: None, mode: Measured) - /// 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: Loans TotalReserves (r:1 w:0) - /// Proof Skipped: Loans TotalReserves (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans AccountDeposits (r:1 w:0) - /// Proof Skipped: Loans AccountDeposits (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans UnderlyingAssetId (r:1 w:0) - /// Proof Skipped: Loans UnderlyingAssetId (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens TotalIssuance (r:1 w:0) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: Loans MinExchangeRate (r:1 w:0) - /// Proof Skipped: Loans MinExchangeRate (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Loans MaxExchangeRate (r:1 w:0) - /// Proof Skipped: Loans MaxExchangeRate (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Loans AccountBorrows (r:1 w:1) - /// Proof Skipped: Loans AccountBorrows (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardBorrowState (r:1 w:1) - /// Proof Skipped: Loans RewardBorrowState (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardBorrowSpeed (r:1 w:0) - /// Proof Skipped: Loans RewardBorrowSpeed (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardBorrowerIndex (r:1 w:1) - /// Proof Skipped: Loans RewardBorrowerIndex (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardAccrued (r:1 w:1) - /// Proof Skipped: Loans RewardAccrued (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans BorrowIndex (r:1 w:0) - /// Proof Skipped: Loans BorrowIndex (max_values: None, max_size: None, mode: Measured) + /// Storage: `LendMarket::Markets` (r:2 w:0) + /// Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `LendMarket::LastAccruedInterestTime` (r:1 w:1) + /// Proof: `LendMarket::LastAccruedInterestTime` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::TotalBorrows` (r:1 w:1) + /// Proof: `LendMarket::TotalBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Tokens::Accounts` (r:2 w:2) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(118), added: 2593, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `LendMarket::TotalReserves` (r:1 w:0) + /// Proof: `LendMarket::TotalReserves` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Prices::EmergencyPrice` (r:1 w:0) + /// Proof: `Prices::EmergencyPrice` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `AssetRegistry::CurrencyMetadatas` (r:1 w:0) + /// Proof: `AssetRegistry::CurrencyMetadatas` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::MarketBond` (r:1 w:0) + /// Proof: `LendMarket::MarketBond` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::AccountBorrows` (r:1 w:1) + /// Proof: `LendMarket::AccountBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::AccountDeposits` (r:1 w:0) + /// Proof: `LendMarket::AccountDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::TotalSupply` (r:1 w:0) + /// Proof: `LendMarket::TotalSupply` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::LiquidationFreeCollaterals` (r:1 w:0) + /// Proof: `LendMarket::LiquidationFreeCollaterals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardBorrowState` (r:1 w:1) + /// Proof: `LendMarket::RewardBorrowState` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardBorrowSpeed` (r:1 w:0) + /// Proof: `LendMarket::RewardBorrowSpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardBorrowerIndex` (r:1 w:1) + /// Proof: `LendMarket::RewardBorrowerIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardAccured` (r:1 w:1) + /// Proof: `LendMarket::RewardAccured` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::BorrowIndex` (r:1 w:0) + /// Proof: `LendMarket::BorrowIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) fn borrow() -> Weight { // Proof Size summary in bytes: - // Measured: `3312` - // Estimated: `90329` - // Minimum execution time: 262_856_000 picoseconds. - Weight::from_parts(265_230_000, 90329) - .saturating_add(RocksDbWeight::get().reads(20_u64)) + // Measured: `1927` + // Estimated: `7867` + // Minimum execution time: 128_738_000 picoseconds. + Weight::from_parts(138_232_000, 7867) + .saturating_add(RocksDbWeight::get().reads(21_u64)) .saturating_add(RocksDbWeight::get().writes(8_u64)) } - /// Storage: Loans Markets (r:2 w:0) - /// Proof Skipped: Loans Markets (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans UnderlyingAssetId (r:1 w:0) - /// Proof Skipped: Loans UnderlyingAssetId (max_values: None, max_size: None, mode: Measured) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: Loans LastAccruedInterestTime (r:1 w:1) - /// Proof Skipped: Loans LastAccruedInterestTime (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens TotalIssuance (r:1 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:3 w:3) - /// 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: Loans TotalBorrows (r:1 w:0) - /// Proof Skipped: Loans TotalBorrows (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans TotalReserves (r:1 w:0) - /// Proof Skipped: Loans TotalReserves (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans MinExchangeRate (r:1 w:0) - /// Proof Skipped: Loans MinExchangeRate (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Loans MaxExchangeRate (r:1 w:0) - /// Proof Skipped: Loans MaxExchangeRate (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Loans AccountDeposits (r:1 w:0) - /// Proof Skipped: Loans AccountDeposits (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardSupplyState (r:1 w:1) - /// Proof Skipped: Loans RewardSupplyState (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardSupplySpeed (r:1 w:0) - /// Proof Skipped: Loans RewardSupplySpeed (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardSupplierIndex (r:1 w:1) - /// Proof Skipped: Loans RewardSupplierIndex (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardAccrued (r:1 w:1) - /// Proof Skipped: Loans RewardAccrued (max_values: None, max_size: None, mode: Measured) + /// Storage: `LendMarket::Markets` (r:2 w:0) + /// Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `LendMarket::LastAccruedInterestTime` (r:1 w:1) + /// Proof: `LendMarket::LastAccruedInterestTime` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::TotalSupply` (r:1 w:1) + /// Proof: `LendMarket::TotalSupply` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Tokens::Accounts` (r:3 w:3) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(118), added: 2593, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:2 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `LendMarket::TotalBorrows` (r:1 w:0) + /// Proof: `LendMarket::TotalBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::TotalReserves` (r:1 w:0) + /// Proof: `LendMarket::TotalReserves` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::AccountDeposits` (r:1 w:1) + /// Proof: `LendMarket::AccountDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::AccountEarned` (r:1 w:1) + /// Proof: `LendMarket::AccountEarned` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardSupplyState` (r:1 w:1) + /// Proof: `LendMarket::RewardSupplyState` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardSupplySpeed` (r:1 w:0) + /// Proof: `LendMarket::RewardSupplySpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardSupplierIndex` (r:1 w:1) + /// Proof: `LendMarket::RewardSupplierIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardAccured` (r:1 w:1) + /// Proof: `LendMarket::RewardAccured` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `AssetRegistry::CurrencyMetadatas` (r:1 w:0) + /// Proof: `AssetRegistry::CurrencyMetadatas` (`max_values`: None, `max_size`: None, mode: `Measured`) fn redeem() -> Weight { // Proof Size summary in bytes: - // Measured: `3368` - // Estimated: `82017` - // Minimum execution time: 324_119_000 picoseconds. - Weight::from_parts(324_981_000, 82017) + // Measured: `1890` + // Estimated: `8769` + // Minimum execution time: 119_454_000 picoseconds. + Weight::from_parts(126_970_000, 8769) .saturating_add(RocksDbWeight::get().reads(19_u64)) - .saturating_add(RocksDbWeight::get().writes(8_u64)) - } - /// Storage: Loans Markets (r:2 w:0) - /// Proof Skipped: Loans Markets (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:3 w:3) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: Loans UnderlyingAssetId (r:1 w:0) - /// Proof Skipped: Loans UnderlyingAssetId (max_values: None, max_size: None, mode: Measured) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: Loans LastAccruedInterestTime (r:1 w:1) - /// Proof Skipped: Loans LastAccruedInterestTime (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens TotalIssuance (r:1 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: Loans TotalBorrows (r:1 w:0) - /// Proof Skipped: Loans TotalBorrows (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans TotalReserves (r:1 w:0) - /// Proof Skipped: Loans TotalReserves (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans MinExchangeRate (r:1 w:0) - /// Proof Skipped: Loans MinExchangeRate (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Loans MaxExchangeRate (r:1 w:0) - /// Proof Skipped: Loans MaxExchangeRate (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Loans AccountDeposits (r:1 w:0) - /// Proof Skipped: Loans AccountDeposits (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardSupplyState (r:1 w:1) - /// Proof Skipped: Loans RewardSupplyState (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardSupplySpeed (r:1 w:0) - /// Proof Skipped: Loans RewardSupplySpeed (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardSupplierIndex (r:1 w:1) - /// Proof Skipped: Loans RewardSupplierIndex (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardAccrued (r:1 w:1) - /// Proof Skipped: Loans RewardAccrued (max_values: None, max_size: None, mode: Measured) + .saturating_add(RocksDbWeight::get().writes(12_u64)) + } + /// Storage: `LendMarket::Markets` (r:2 w:0) + /// Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `LendMarket::LastAccruedInterestTime` (r:1 w:1) + /// Proof: `LendMarket::LastAccruedInterestTime` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::TotalSupply` (r:1 w:1) + /// Proof: `LendMarket::TotalSupply` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Tokens::Accounts` (r:2 w:2) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(118), added: 2593, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `LendMarket::TotalBorrows` (r:1 w:0) + /// Proof: `LendMarket::TotalBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::TotalReserves` (r:1 w:0) + /// Proof: `LendMarket::TotalReserves` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::AccountDeposits` (r:1 w:1) + /// Proof: `LendMarket::AccountDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::AccountEarned` (r:1 w:1) + /// Proof: `LendMarket::AccountEarned` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardSupplyState` (r:1 w:1) + /// Proof: `LendMarket::RewardSupplyState` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardSupplySpeed` (r:1 w:0) + /// Proof: `LendMarket::RewardSupplySpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardSupplierIndex` (r:1 w:1) + /// Proof: `LendMarket::RewardSupplierIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardAccured` (r:1 w:1) + /// Proof: `LendMarket::RewardAccured` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `AssetRegistry::CurrencyMetadatas` (r:1 w:0) + /// Proof: `AssetRegistry::CurrencyMetadatas` (`max_values`: None, `max_size`: None, mode: `Measured`) fn redeem_all() -> Weight { // Proof Size summary in bytes: - // Measured: `3368` - // Estimated: `82017` - // Minimum execution time: 325_041_000 picoseconds. - Weight::from_parts(327_495_000, 82017) - .saturating_add(RocksDbWeight::get().reads(19_u64)) - .saturating_add(RocksDbWeight::get().writes(8_u64)) + // Measured: `1787` + // Estimated: `7727` + // Minimum execution time: 96_462_000 picoseconds. + Weight::from_parts(103_596_000, 7727) + .saturating_add(RocksDbWeight::get().reads(17_u64)) + .saturating_add(RocksDbWeight::get().writes(10_u64)) } - /// Storage: Loans Markets (r:2 w:0) - /// Proof Skipped: Loans Markets (max_values: None, max_size: None, mode: Measured) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: Loans LastAccruedInterestTime (r:1 w:1) - /// Proof Skipped: Loans LastAccruedInterestTime (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans AccountBorrows (r:1 w:1) - /// Proof Skipped: Loans AccountBorrows (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans BorrowIndex (r:1 w:0) - /// Proof Skipped: Loans BorrowIndex (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardBorrowState (r:1 w:1) - /// Proof Skipped: Loans RewardBorrowState (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardBorrowSpeed (r:1 w:0) - /// Proof Skipped: Loans RewardBorrowSpeed (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardBorrowerIndex (r:1 w:1) - /// Proof Skipped: Loans RewardBorrowerIndex (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardAccrued (r:1 w:1) - /// Proof Skipped: Loans RewardAccrued (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:2 w:2) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: Loans TotalBorrows (r:1 w:1) - /// Proof Skipped: Loans TotalBorrows (max_values: None, max_size: None, mode: Measured) + /// Storage: `LendMarket::Markets` (r:2 w:0) + /// Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `LendMarket::LastAccruedInterestTime` (r:1 w:1) + /// Proof: `LendMarket::LastAccruedInterestTime` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::AccountBorrows` (r:1 w:1) + /// Proof: `LendMarket::AccountBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::BorrowIndex` (r:1 w:0) + /// Proof: `LendMarket::BorrowIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardBorrowState` (r:1 w:1) + /// Proof: `LendMarket::RewardBorrowState` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardBorrowSpeed` (r:1 w:0) + /// Proof: `LendMarket::RewardBorrowSpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardBorrowerIndex` (r:1 w:1) + /// Proof: `LendMarket::RewardBorrowerIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardAccured` (r:1 w:1) + /// Proof: `LendMarket::RewardAccured` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Tokens::Accounts` (r:2 w:2) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(118), added: 2593, mode: `MaxEncodedLen`) + /// Storage: `AssetRegistry::CurrencyMetadatas` (r:1 w:0) + /// Proof: `AssetRegistry::CurrencyMetadatas` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::TotalBorrows` (r:1 w:1) + /// Proof: `LendMarket::TotalBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) fn repay_borrow() -> Weight { // Proof Size summary in bytes: - // Measured: `3407` - // Estimated: `61096` - // Minimum execution time: 179_189_000 picoseconds. - Weight::from_parts(180_952_000, 61096) - .saturating_add(RocksDbWeight::get().reads(13_u64)) + // Measured: `1788` + // Estimated: `7728` + // Minimum execution time: 67_983_000 picoseconds. + Weight::from_parts(71_685_000, 7728) + .saturating_add(RocksDbWeight::get().reads(14_u64)) .saturating_add(RocksDbWeight::get().writes(8_u64)) } - /// Storage: Loans Markets (r:2 w:0) - /// Proof Skipped: Loans Markets (max_values: None, max_size: None, mode: Measured) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: Loans LastAccruedInterestTime (r:1 w:1) - /// Proof Skipped: Loans LastAccruedInterestTime (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans AccountBorrows (r:1 w:1) - /// Proof Skipped: Loans AccountBorrows (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans BorrowIndex (r:1 w:0) - /// Proof Skipped: Loans BorrowIndex (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardBorrowState (r:1 w:1) - /// Proof Skipped: Loans RewardBorrowState (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardBorrowSpeed (r:1 w:0) - /// Proof Skipped: Loans RewardBorrowSpeed (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardBorrowerIndex (r:1 w:1) - /// Proof Skipped: Loans RewardBorrowerIndex (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardAccrued (r:1 w:1) - /// Proof Skipped: Loans RewardAccrued (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:2 w:2) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: Loans TotalBorrows (r:1 w:1) - /// Proof Skipped: Loans TotalBorrows (max_values: None, max_size: None, mode: Measured) + /// Storage: `LendMarket::Markets` (r:2 w:0) + /// Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `LendMarket::LastAccruedInterestTime` (r:1 w:1) + /// Proof: `LendMarket::LastAccruedInterestTime` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::AccountBorrows` (r:1 w:1) + /// Proof: `LendMarket::AccountBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::BorrowIndex` (r:1 w:0) + /// Proof: `LendMarket::BorrowIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardBorrowState` (r:1 w:1) + /// Proof: `LendMarket::RewardBorrowState` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardBorrowSpeed` (r:1 w:0) + /// Proof: `LendMarket::RewardBorrowSpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardBorrowerIndex` (r:1 w:1) + /// Proof: `LendMarket::RewardBorrowerIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardAccured` (r:1 w:1) + /// Proof: `LendMarket::RewardAccured` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Tokens::Accounts` (r:2 w:2) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(118), added: 2593, mode: `MaxEncodedLen`) + /// Storage: `AssetRegistry::CurrencyMetadatas` (r:1 w:0) + /// Proof: `AssetRegistry::CurrencyMetadatas` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::TotalBorrows` (r:1 w:1) + /// Proof: `LendMarket::TotalBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) fn repay_borrow_all() -> Weight { // Proof Size summary in bytes: - // Measured: `3407` - // Estimated: `61096` - // Minimum execution time: 197_625_000 picoseconds. - Weight::from_parts(198_568_000, 61096) - .saturating_add(RocksDbWeight::get().reads(13_u64)) + // Measured: `1788` + // Estimated: `7728` + // Minimum execution time: 76_490_000 picoseconds. + Weight::from_parts(84_316_000, 7728) + .saturating_add(RocksDbWeight::get().reads(14_u64)) .saturating_add(RocksDbWeight::get().writes(8_u64)) } - /// Storage: Loans Markets (r:2 w:0) - /// Proof Skipped: Loans Markets (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens Accounts (r:1 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: Loans UnderlyingAssetId (r:1 w:0) - /// Proof Skipped: Loans UnderlyingAssetId (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans AccountDeposits (r:1 w:1) - /// Proof Skipped: Loans AccountDeposits (max_values: None, max_size: None, mode: Measured) - fn deposit_all_collateral() -> Weight { - // Proof Size summary in bytes: - // Measured: `2295` - // Estimated: `19375` - // Minimum execution time: 102_335_000 picoseconds. - Weight::from_parts(103_146_000, 19375) - .saturating_add(RocksDbWeight::get().reads(5_u64)) - .saturating_add(RocksDbWeight::get().writes(2_u64)) - } - /// Storage: Loans Markets (r:2 w:0) - /// Proof Skipped: Loans Markets (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans AccountDeposits (r:1 w:1) - /// Proof Skipped: Loans AccountDeposits (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans UnderlyingAssetId (r:1 w:0) - /// Proof Skipped: Loans UnderlyingAssetId (max_values: None, max_size: None, mode: Measured) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: Loans LastAccruedInterestTime (r:1 w:1) - /// Proof Skipped: Loans LastAccruedInterestTime (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens TotalIssuance (r:1 w:0) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:2 w:1) - /// 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: Loans TotalBorrows (r:1 w:0) - /// Proof Skipped: Loans TotalBorrows (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans TotalReserves (r:1 w:0) - /// Proof Skipped: Loans TotalReserves (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans MinExchangeRate (r:1 w:0) - /// Proof Skipped: Loans MinExchangeRate (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Loans MaxExchangeRate (r:1 w:0) - /// Proof Skipped: Loans MaxExchangeRate (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Loans AccountBorrows (r:1 w:0) - /// Proof Skipped: Loans AccountBorrows (max_values: None, max_size: None, mode: Measured) - fn withdraw_all_collateral() -> Weight { + /// Storage: `LendMarket::Markets` (r:2 w:0) + /// Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::AccountDeposits` (r:1 w:1) + /// Proof: `LendMarket::AccountDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn collateral_asset() -> Weight { // Proof Size summary in bytes: - // Measured: `3242` - // Estimated: `60764` - // Minimum execution time: 225_110_000 picoseconds. - Weight::from_parts(226_403_000, 60764) - .saturating_add(RocksDbWeight::get().reads(15_u64)) - .saturating_add(RocksDbWeight::get().writes(3_u64)) + // Measured: `529` + // Estimated: `6469` + // Minimum execution time: 22_178_000 picoseconds. + Weight::from_parts(24_347_000, 6469) + .saturating_add(RocksDbWeight::get().reads(3_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) } - /// 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:2 w:2) - /// Proof Skipped: Loans LastAccruedInterestTime (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans Markets (r:3 w:0) - /// Proof Skipped: Loans Markets (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans AccountDeposits (r:4 w:1) - /// Proof Skipped: Loans AccountDeposits (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans UnderlyingAssetId (r:1 w:0) - /// Proof Skipped: Loans UnderlyingAssetId (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens TotalIssuance (r:1 w:0) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:6 w:5) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: System Account (r:4 w:2) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: Loans TotalBorrows (r:2 w:1) - /// Proof Skipped: Loans TotalBorrows (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans TotalReserves (r:1 w:0) - /// Proof Skipped: Loans TotalReserves (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans MinExchangeRate (r:1 w:0) - /// Proof Skipped: Loans MinExchangeRate (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Loans MaxExchangeRate (r:1 w:0) - /// Proof Skipped: Loans MaxExchangeRate (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Security ParachainStatus (r:1 w:0) - /// Proof Skipped: Security ParachainStatus (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Oracle Aggregate (r:1 w:0) - /// Proof Skipped: Oracle Aggregate (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans AccountBorrows (r:3 w:1) - /// Proof Skipped: Loans AccountBorrows (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans BorrowIndex (r:1 w:0) - /// Proof Skipped: Loans BorrowIndex (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardBorrowState (r:1 w:1) - /// Proof Skipped: Loans RewardBorrowState (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardBorrowSpeed (r:1 w:0) - /// Proof Skipped: Loans RewardBorrowSpeed (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardBorrowerIndex (r:1 w:1) - /// Proof Skipped: Loans RewardBorrowerIndex (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardAccrued (r:3 w:3) - /// Proof Skipped: Loans RewardAccrued (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardSupplyState (r:1 w:1) - /// Proof Skipped: Loans RewardSupplyState (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardSupplySpeed (r:1 w:0) - /// Proof Skipped: Loans RewardSupplySpeed (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardSupplierIndex (r:3 w:3) - /// Proof Skipped: Loans RewardSupplierIndex (max_values: None, max_size: None, mode: Measured) + /// Storage: `LendMarket::LiquidationFreeCollaterals` (r:1 w:0) + /// Proof: `LendMarket::LiquidationFreeCollaterals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `LendMarket::LastAccruedInterestTime` (r:2 w:2) + /// Proof: `LendMarket::LastAccruedInterestTime` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::Markets` (r:3 w:0) + /// Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::AccountBorrows` (r:3 w:1) + /// Proof: `LendMarket::AccountBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::BorrowIndex` (r:1 w:0) + /// Proof: `LendMarket::BorrowIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Prices::EmergencyPrice` (r:2 w:0) + /// Proof: `Prices::EmergencyPrice` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `AssetRegistry::CurrencyMetadatas` (r:2 w:0) + /// Proof: `AssetRegistry::CurrencyMetadatas` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::AccountDeposits` (r:4 w:3) + /// Proof: `LendMarket::AccountDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::TotalSupply` (r:1 w:0) + /// Proof: `LendMarket::TotalSupply` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Tokens::Accounts` (r:3 w:2) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(118), added: 2593, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:2 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `LendMarket::TotalBorrows` (r:2 w:1) + /// Proof: `LendMarket::TotalBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::TotalReserves` (r:1 w:0) + /// Proof: `LendMarket::TotalReserves` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardBorrowState` (r:1 w:1) + /// Proof: `LendMarket::RewardBorrowState` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardBorrowSpeed` (r:1 w:0) + /// Proof: `LendMarket::RewardBorrowSpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardBorrowerIndex` (r:1 w:1) + /// Proof: `LendMarket::RewardBorrowerIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardAccured` (r:3 w:3) + /// Proof: `LendMarket::RewardAccured` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardSupplyState` (r:1 w:1) + /// Proof: `LendMarket::RewardSupplyState` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardSupplySpeed` (r:1 w:0) + /// Proof: `LendMarket::RewardSupplySpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::RewardSupplierIndex` (r:3 w:3) + /// Proof: `LendMarket::RewardSupplierIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) fn liquidate_borrow() -> Weight { // Proof Size summary in bytes: - // Measured: `5226` - // Estimated: `201519` - // Minimum execution time: 762_145_000 picoseconds. - Weight::from_parts(766_944_000, 201519) - .saturating_add(RocksDbWeight::get().reads(44_u64)) - .saturating_add(RocksDbWeight::get().writes(21_u64)) - } - /// Storage: Loans Markets (r:2 w:0) - /// Proof Skipped: Loans Markets (max_values: None, max_size: None, mode: Measured) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: Loans LastAccruedInterestTime (r:1 w:1) - /// Proof Skipped: Loans LastAccruedInterestTime (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans UnderlyingAssetId (r:1 w:0) - /// Proof Skipped: Loans UnderlyingAssetId (max_values: None, max_size: None, mode: Measured) - /// Storage: Tokens TotalIssuance (r:1 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(35), added: 2510, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:4 w:4) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(115), added: 2590, mode: MaxEncodedLen) - /// Storage: System Account (r:2 w:1) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: Loans TotalBorrows (r:1 w:0) - /// Proof Skipped: Loans TotalBorrows (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans TotalReserves (r:1 w:0) - /// Proof Skipped: Loans TotalReserves (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans MinExchangeRate (r:1 w:0) - /// Proof Skipped: Loans MinExchangeRate (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Loans MaxExchangeRate (r:1 w:0) - /// Proof Skipped: Loans MaxExchangeRate (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Loans AccountDeposits (r:1 w:0) - /// Proof Skipped: Loans AccountDeposits (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardSupplyState (r:1 w:1) - /// Proof Skipped: Loans RewardSupplyState (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardSupplySpeed (r:1 w:0) - /// Proof Skipped: Loans RewardSupplySpeed (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardSupplierIndex (r:1 w:1) - /// Proof Skipped: Loans RewardSupplierIndex (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans RewardAccrued (r:1 w:1) - /// Proof Skipped: Loans RewardAccrued (max_values: None, max_size: None, mode: Measured) - fn reduce_incentive_reserves() -> Weight { - // Proof Size summary in bytes: - // Measured: `4362` - // Estimated: `99138` - // Minimum execution time: 413_086_000 picoseconds. - Weight::from_parts(417_575_000, 99138) - .saturating_add(RocksDbWeight::get().reads(21_u64)) - .saturating_add(RocksDbWeight::get().writes(10_u64)) - } - /// Storage: Loans Markets (r:2 w:0) - /// Proof Skipped: Loans Markets (max_values: None, max_size: None, mode: Measured) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: Loans LastAccruedInterestTime (r:1 w:1) - /// Proof Skipped: Loans LastAccruedInterestTime (max_values: None, max_size: None, mode: Measured) - /// 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:1) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: Loans TotalReserves (r:1 w:1) - /// Proof Skipped: Loans TotalReserves (max_values: None, max_size: None, mode: Measured) + // Measured: `2910` + // Estimated: `13800` + // Minimum execution time: 207_737_000 picoseconds. + Weight::from_parts(231_464_000, 13800) + .saturating_add(RocksDbWeight::get().reads(39_u64)) + .saturating_add(RocksDbWeight::get().writes(18_u64)) + } + /// Storage: `LendMarket::Markets` (r:2 w:0) + /// Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Tokens::Accounts` (r:2 w:2) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(118), added: 2593, mode: `MaxEncodedLen`) + /// Storage: `AssetRegistry::CurrencyMetadatas` (r:1 w:0) + /// Proof: `AssetRegistry::CurrencyMetadatas` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `LendMarket::TotalReserves` (r:1 w:1) + /// Proof: `LendMarket::TotalReserves` (`max_values`: None, `max_size`: None, mode: `Measured`) fn add_reserves() -> Weight { // Proof Size summary in bytes: - // Measured: `2768` - // Estimated: `26490` - // Minimum execution time: 131_052_000 picoseconds. - Weight::from_parts(132_405_000, 26490) - .saturating_add(RocksDbWeight::get().reads(8_u64)) - .saturating_add(RocksDbWeight::get().writes(5_u64)) - } - /// Storage: Loans Markets (r:2 w:0) - /// Proof Skipped: Loans Markets (max_values: None, max_size: None, mode: Measured) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: Loans LastAccruedInterestTime (r:1 w:1) - /// Proof Skipped: Loans LastAccruedInterestTime (max_values: None, max_size: None, mode: Measured) - /// Storage: Loans TotalReserves (r:1 w:1) - /// Proof Skipped: Loans TotalReserves (max_values: None, max_size: None, mode: Measured) - /// 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) - fn reduce_reserves() -> Weight { - // Proof Size summary in bytes: - // Measured: `2857` - // Estimated: `26757` - // Minimum execution time: 115_421_000 picoseconds. - Weight::from_parts(116_053_000, 26757) - .saturating_add(RocksDbWeight::get().reads(8_u64)) + // Measured: `938` + // Estimated: `6878` + // Minimum execution time: 39_609_000 picoseconds. + Weight::from_parts(41_224_000, 6878) + .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } - fn withdraw_missing_reward() -> Weight { + /// Storage: `LendMarket::Markets` (r:2 w:0) + /// Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `LendMarket::TotalReserves` (r:1 w:1) + /// Proof: `LendMarket::TotalReserves` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Tokens::Accounts` (r:2 w:2) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(118), added: 2593, mode: `MaxEncodedLen`) + /// Storage: `AssetRegistry::CurrencyMetadatas` (r:1 w:0) + /// Proof: `AssetRegistry::CurrencyMetadatas` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + fn reduce_reserves() -> Weight { // Proof Size summary in bytes: - // Measured: `2857` - // Estimated: `26757` - // Minimum execution time: 115_421_000 picoseconds. - Weight::from_parts(116_053_000, 26757) - .saturating_add(RocksDbWeight::get().reads(8_u64)) - .saturating_add(RocksDbWeight::get().writes(4_u64)) + // Measured: `1214` + // Estimated: `7154` + // Minimum execution time: 39_219_000 picoseconds. + Weight::from_parts(40_877_000, 7154) + .saturating_add(RocksDbWeight::get().reads(7_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) } + /// Storage: `LendMarket::LiquidationFreeCollaterals` (r:1 w:1) + /// Proof: `LendMarket::LiquidationFreeCollaterals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn update_liquidation_free_collateral() -> Weight { // Proof Size summary in bytes: - // Measured: `2857` - // Estimated: `26757` - // Minimum execution time: 115_421_000 picoseconds. - Weight::from_parts(116_053_000, 26757) - .saturating_add(RocksDbWeight::get().reads(8_u64)) - .saturating_add(RocksDbWeight::get().writes(4_u64)) - } - fn collateral_asset() -> Weight { - // Proof Size summary in bytes: - // Measured: `2857` - // Estimated: `26757` - // Minimum execution time: 115_421_000 picoseconds. - Weight::from_parts(116_053_000, 26757) - .saturating_add(RocksDbWeight::get().reads(8_u64)) - .saturating_add(RocksDbWeight::get().writes(4_u64)) + // Measured: `76` + // Estimated: `1561` + // Minimum execution time: 5_946_000 picoseconds. + Weight::from_parts(6_552_000, 1561) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) } } diff --git a/pallets/salp/src/lib.rs b/pallets/salp/src/lib.rs index 87daa390b4..b96d38a5d8 100644 --- a/pallets/salp/src/lib.rs +++ b/pallets/salp/src/lib.rs @@ -24,7 +24,8 @@ pub use weights::WeightInfo; // Re-export pallet items so that they can be accessed from the crate namespace. use bifrost_primitives::{ - ContributionStatus, CurrencyIdConversion, CurrencyIdRegister, TrieIndex, VtokenMintingInterface, + AssetMetadata, ContributionStatus, CurrencyIdConversion, CurrencyIdRegister, TrieIndex, + VtokenMintingInterface, }; use bifrost_stable_pool::{traits::StablePoolHandler, StableAssetPoolId}; use cumulus_primitives_core::QueryId; @@ -163,7 +164,7 @@ pub mod pallet { type CurrencyIdConversion: CurrencyIdConversion; - type CurrencyIdRegister: CurrencyIdRegister; + type CurrencyIdRegister: CurrencyIdRegister>>; type StablePool: StablePoolHandler, AccountId = Self::AccountId>; diff --git a/pallets/stable-pool/src/lib.rs b/pallets/stable-pool/src/lib.rs index ded1d80606..6ff4505963 100644 --- a/pallets/stable-pool/src/lib.rs +++ b/pallets/stable-pool/src/lib.rs @@ -31,7 +31,7 @@ pub use weights::*; pub mod traits; use bifrost_primitives::{ - CurrencyId, CurrencyIdConversion, CurrencyIdExt, CurrencyIdRegister, TimeUnit, + AssetMetadata, CurrencyId, CurrencyIdConversion, CurrencyIdExt, CurrencyIdRegister, TimeUnit, VtokenMintingOperator, }; pub use bifrost_stable_asset::{ @@ -99,7 +99,7 @@ pub mod pallet { /// Type for converting between different currency IDs. type CurrencyIdConversion: CurrencyIdConversion>; /// Type for registering currency IDs. - type CurrencyIdRegister: CurrencyIdRegister>; + type CurrencyIdRegister: CurrencyIdRegister, AssetMetadata>; } #[pallet::error] diff --git a/pallets/token-gateway/Cargo.toml b/pallets/token-gateway/Cargo.toml new file mode 100644 index 0000000000..7c4e525cc2 --- /dev/null +++ b/pallets/token-gateway/Cargo.toml @@ -0,0 +1,58 @@ +[package] +name = "pallet-token-gateway" +version = "1.15.1" +edition = "2021" +description = "A substrate implementation of the token gateway protocol" +authors = ["Polytope Labs "] +license = "Apache-2.0" +repository = "https://github.com/polytope-labs/hyperbridge" +homepage = "https://docs.hyperbridge.network/developers/polkadot/tokengateway" +documentation = "https://docs.rs/pallet-token-gateway" +keywords = ["substrate", "polkadot-sdk", "ISMP", "interoperability", "pallet-assets"] +readme = "./README.md" + +[dependencies] +frame-support = { workspace = true } +frame-system = { workspace = true } +sp-runtime = { workspace = true } +sp-core = { workspace = true } +sp-io = { workspace = true } +primitive-types = { workspace = true } + +ismp = { workspace = true } +pallet-ismp = { workspace = true } + +log = { workspace = true } +codec = { version = "3.1.3", package = "parity-scale-codec", default-features = false } +scale-info = { workspace = true } +anyhow = { workspace = true } + +alloy-primitives = { workspace = true } +alloy-sol-macro = { workspace = true } +alloy-sol-types = { workspace = true } + +token-gateway-primitives = { version = "1.15.1", path = "./primitives", default-features = false } + +# token-gateway-primitives = { workspace = true } +pallet-hyperbridge = { workspace = true } + +bifrost-primitives = { workspace = true } +[features] +default = ["std"] +std = [ + "frame-support/std", + "frame-system/std", + "sp-runtime/std", + "sp-core/std", + "sp-io/std", + "primitive-types/std", + "ismp/std", + "pallet-ismp/std", + "log/std", + "scale-info/std", + "anyhow/std", + "alloy-primitives/std", + "pallet-hyperbridge/std", + "token-gateway-primitives/std" +] +try-runtime = [] diff --git a/pallets/token-gateway/README.md b/pallets/token-gateway/README.md new file mode 100644 index 0000000000..b8ea56f60b --- /dev/null +++ b/pallets/token-gateway/README.md @@ -0,0 +1,86 @@ +# Pallet Token Gateway + +This allows standalone chains or parachains make asset transfers to and from EVM token gateway deployments. + + +## Overview + +The Pallet allows the [`AdminOrigin`](https://docs.rs/pallet-ismp/latest/pallet_ismp/pallet/trait.Config.html#associatedtype.AdminOrigin) configured in [`pallet-ismp`](https://docs.rs/pallet-ismp/latest/pallet_ismp) to dispatch calls for setting token gateway addresses. + +## Adding to Runtime + +The first step is to implement the pallet config for the runtime. + +```rust,ignore +use frame_support::parameter_types; +use ismp::module::IsmpModule; +use ismp::router::IsmpRouter; + +parameter_types! { + // A constant that should represent the native asset id + pub const NativeAssetId: u32 = 0; + // Set the correct precision for the native currency + pub const Decimals: u8 = 12; +} + +/// Should provide an account that is funded and can be used to pay for asset creation +pub struct AssetAdmin; + +impl Get for AssetAdmin { + fn get() -> AccountId { + Treasury::account_id() + } +} + +impl pallet_token_gateway::Config for Runtime { + // configure the runtime event + type RuntimeEvent = RuntimeEvent; + // Pallet Ismp + type Dispatcher = Ismp; + // Pallet Assets + type Assets = Assets; + // Pallet balances + type Currency = Balances; + // AssetAdmin account + type AssetAdmin = AssetAdmin; + // The Native asset Id + type NativeAssetId = NativeAssetId; + // A type that provides a function for creating unique asset ids + // A concrete implementation for your specific runtime is required + type AssetIdFactory = (); + // The precision of the native asset + type Decimals = Decimals; +} + +// Add the pallet to your ISMP router +#[derive(Default)] +struct Router; +impl IsmpRouter for Router { + fn module_for_id(&self, id: Vec) -> Result, anyhow::Error> { + let module = match id.as_slice() { + id if TokenGateway::is_token_gateway(&id) => Box::new(TokenGateway::default()), + _ => Err(Error::ModuleNotFound(id))? + }; + Ok(module) + } +} +``` + +## Setting up + +The pallet requires some setting up before the teleport function is available for use in the runtime. + +1. Register your native assets directly on `Hyperbridge` by dispatching `create_erc6160_asset`. +3. Set token gateway addresses for the EVM chains of interest by dispatching the `set_token_gateway_addresses` extrinsic. These addresses are used to validate incoming messages. + + +## Dispatchable Functions + +- `teleport` - This function is used to bridge assets through Hyperbridge. +- `set_token_gateway_addresses` - This call allows the `AdminOrigin` origin to set the token gateway address for EVM chains. +- `create_erc6160_asset` - This call dispatches a request to Hyperbridge to create multi chain native assets on token gateway deployments +- `update_erc6160_asset` - This priviledged call dispatches a request to Hyperbridge to update multi chain native assets on token gateway deployments + +## License + +This library is licensed under the Apache 2.0 License, Copyright (c) 2024 Polytope Labs. diff --git a/pallets/token-gateway/primitives/Cargo.toml b/pallets/token-gateway/primitives/Cargo.toml new file mode 100644 index 0000000000..3c2aaffce1 --- /dev/null +++ b/pallets/token-gateway/primitives/Cargo.toml @@ -0,0 +1,51 @@ +[package] +name = "token-gateway-primitives" +version = "1.15.1" +edition = "2021" +description = "A collection of types used by token gateway" +authors = ["Polytope Labs "] +license = "Apache-2.0" +repository = "https://github.com/polytope-labs/hyperbridge" +homepage = "https://docs.hyperbridge.network/developers/polkadot/tokengateway" +documentation = "https://docs.rs/pallet-token-gateway" +keywords = ["substrate", "polkadot-sdk", "ISMP", "interoperability", "pallet-assets"] +readme = "./README.md" + +[dependencies] +frame-support = { workspace = true } +frame-system = { workspace = true } +sp-runtime = { workspace = true } +sp-core = { workspace = true } +sp-io = { workspace = true } +primitive-types = { workspace = true } + +ismp = { workspace = true } +pallet-ismp = { workspace = true } + +log = { workspace = true } +codec = { version = "3.1.3", package = "parity-scale-codec", default-features = false } +scale-info = { workspace = true } +anyhow = { workspace = true } + +alloy-primitives = { workspace = true } +alloy-sol-macro = { workspace = true } +alloy-sol-types = { workspace = true } + + +[features] +default = ["std"] +std = [ + "frame-support/std", + "frame-system/std", + "sp-runtime/std", + "sp-core/std", + "sp-io/std", + "primitive-types/std", + "ismp/std", + "pallet-ismp/std", + "log/std", + "scale-info/std", + "anyhow/std", + "alloy-primitives/std", +] +try-runtime = [] diff --git a/pallets/token-gateway/primitives/README.md b/pallets/token-gateway/primitives/README.md new file mode 100644 index 0000000000..6139aecb18 --- /dev/null +++ b/pallets/token-gateway/primitives/README.md @@ -0,0 +1,7 @@ +# Token Gateway Primitives + +A collection of types used by token gateway + +## License + +This library is licensed under the Apache 2.0 License, Copyright (c) 2024 Polytope Labs. diff --git a/pallets/token-gateway/primitives/src/lib.rs b/pallets/token-gateway/primitives/src/lib.rs new file mode 100644 index 0000000000..a20d233e42 --- /dev/null +++ b/pallets/token-gateway/primitives/src/lib.rs @@ -0,0 +1,91 @@ +// Copyright (C) Polytope Labs Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! This library contains types shared with token gateway and other pallets +#![cfg_attr(not(feature = "std"), no_std)] + +use ismp::host::StateMachine; +use sp_core::{ConstU32, H160, H256}; +use sp_runtime::BoundedVec; + +extern crate alloc; +use alloc::vec::Vec; +use codec::{Decode, Encode}; + +/// The token registry Id +pub const REGISTRY: [u8; 8] = *b"registry"; + +/// Token Gateway Id for substrate chains +/// Module Id is the last 20 bytes of the keccak hash of the pallet id +pub fn token_gateway_id() -> H160 { + let hash = sp_io::hashing::keccak_256(b"tokengty"); + H160::from_slice(&hash[12..32]) +} + +pub fn token_governor_id() -> Vec { + REGISTRY.to_vec() +} + +/// Holds metadata relevant to a multi-chain native asset +#[derive(Debug, Clone, Encode, Decode, scale_info::TypeInfo, PartialEq, Eq, Default)] +pub struct AssetMetadata { + /// The asset name + pub name: BoundedVec>, + /// The asset symbol + pub symbol: BoundedVec>, + /// The asset decimals of the ERC6160 or ERC20 counterpart of this asset + pub decimals: u8, + /// Asset's minimum balance, only used by substrate chains + pub minimum_balance: Option, +} + +/// A struct for deregistering asset id on pallet-token-gateway +#[derive(Debug, Clone, Encode, Decode, scale_info::TypeInfo, PartialEq, Eq, Default)] +pub struct DeregisterAssets { + pub asset_ids: Vec, +} + +/// Holds data required for multi-chain native asset registration +#[derive(Debug, Clone, Encode, Decode, scale_info::TypeInfo, PartialEq, Eq)] +pub struct GatewayAssetRegistration { + /// The asset name + pub name: BoundedVec>, + /// The asset symbol + pub symbol: BoundedVec>, + /// The list of chains to create the asset on + pub chains: Vec, + /// Minimum balance for the asset, for substrate chains, + pub minimum_balance: Option, +} + +/// Allows a user to update their multi-chain native token potentially on multiple chains +#[derive(Debug, Clone, Encode, Decode, scale_info::TypeInfo, PartialEq, Eq, Default)] +pub struct GatewayAssetUpdate { + /// The asset identifier + pub asset_id: H256, + /// Chains to add support for the asset on + pub add_chains: BoundedVec>, + /// Chains to delist the asset from + pub remove_chains: BoundedVec>, + /// Chains to change the asset admin on + pub new_admins: BoundedVec<(StateMachine, H160), ConstU32<100>>, +} + +/// Holds data required for multi-chain native asset registration +#[derive(Debug, Clone, Encode, Decode, scale_info::TypeInfo, PartialEq, Eq)] +pub enum RemoteERC6160AssetRegistration { + CreateAsset(GatewayAssetRegistration), + UpdateAsset(GatewayAssetUpdate), +} diff --git a/pallets/token-gateway/src/impls.rs b/pallets/token-gateway/src/impls.rs new file mode 100644 index 0000000000..efb4d8645a --- /dev/null +++ b/pallets/token-gateway/src/impls.rs @@ -0,0 +1,111 @@ +// Copyright (C) Polytope Labs Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Pallet Implementations +use alloc::string::ToString; +use frame_support::PalletId; +use sp_core::U256; +use sp_runtime::traits::AccountIdConversion; +use token_gateway_primitives::token_gateway_id; + +use crate::{Config, Pallet}; + +impl Pallet { + pub fn pallet_account() -> T::AccountId { + let mut inner = [0u8; 8]; + inner.copy_from_slice(&token_gateway_id().0[0..8]); + PalletId(inner).into_account_truncating() + } + + pub fn is_token_gateway(id: &[u8]) -> bool { + id == &token_gateway_id().0 + } +} + +/// Converts an ERC20 U256 to a u128 +pub fn convert_to_balance( + value: U256, + erc_decimals: u8, + final_decimals: u8, +) -> Result { + let dec_str = (value + / U256::from(10u128.pow(erc_decimals.saturating_sub(final_decimals) as u32))) + .to_string(); + dec_str.parse().map_err(|e| anyhow::anyhow!("{e:?}")) +} + +/// Converts a u128 to an Erc20 denomination +pub fn convert_to_erc20(value: u128, erc_decimals: u8, decimals: u8) -> U256 { + U256::from(value) * U256::from(10u128.pow(erc_decimals.saturating_sub(decimals) as u32)) +} + +#[cfg(test)] +mod tests { + use sp_core::U256; + use sp_runtime::Permill; + use std::ops::Mul; + + use super::{convert_to_balance, convert_to_erc20}; + + #[test] + fn test_per_mill() { + let per_mill = Permill::from_parts(1_000); + + println!("{}", per_mill.mul(20_000_000u128)); + } + + #[test] + fn balance_conversions() { + let supposedly_small_u256 = U256::from_dec_str("1000000000000000000").unwrap(); + // convert erc20 value to dot value + let converted_balance = convert_to_balance(supposedly_small_u256, 18, 10).unwrap(); + println!("{}", converted_balance); + + let dot = 10_000_000_000u128; + + assert_eq!(converted_balance, dot); + + // Convert 1 dot to erc20 + + let dot = 10_000_000_000u128; + let erc_20_val = convert_to_erc20(dot, 18, 10); + assert_eq!( + erc_20_val, + U256::from_dec_str("1000000000000000000").unwrap() + ); + + // Convert 6 decimal ERC 20 + let supposedly_small_u256 = U256::from_dec_str("1000000000000000000").unwrap(); + // convert erc20 value to 18 decimal value + let converted_balance = convert_to_balance(supposedly_small_u256, 6, 18).unwrap(); + println!("{}", converted_balance); + } + + #[test] + fn max_value_check() { + let max = U256::MAX; + + let converted_balance = convert_to_balance(max, 18, 10); + assert!(converted_balance.is_err()) + } + + #[test] + fn min_value_check() { + let min = U256::from(1u128); + + let converted_balance = convert_to_balance(min, 18, 10).unwrap(); + assert_eq!(converted_balance, 0); + } +} diff --git a/pallets/token-gateway/src/lib.rs b/pallets/token-gateway/src/lib.rs new file mode 100644 index 0000000000..626653b222 --- /dev/null +++ b/pallets/token-gateway/src/lib.rs @@ -0,0 +1,741 @@ +// Copyright (C) Polytope Labs Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! The token gateway enables asset transfers to EVM instances of token gateway +#![cfg_attr(not(feature = "std"), no_std)] + +extern crate alloc; + +pub mod impls; +pub mod types; +use crate::impls::{convert_to_balance, convert_to_erc20}; +use alloy_sol_types::SolValue; +use anyhow::anyhow; +use frame_support::{ + ensure, + pallet_prelude::Weight, + traits::{ + fungibles::{self, Mutate}, + tokens::{fungible::Mutate as FungibleMutate, Fortitude, Precision, Preservation}, + Currency, ExistenceRequirement, + }, +}; + +use ismp::{ + events::Meta, + router::{PostRequest, Request, Response, Timeout}, +}; + +use sp_core::{Get, U256}; +use token_gateway_primitives::{token_gateway_id, token_governor_id}; +pub use types::*; + +use alloc::{string::ToString, vec, vec::Vec}; +use ismp::module::IsmpModule; +use primitive_types::H256; + +use bifrost_primitives::{ + AssetMetadata as AssetMetadataBifrost, CurrencyId, CurrencyIdMapping, TokenInfo, +}; +// Re-export pallet items so that they can be accessed from the crate namespace. +pub use pallet::*; + +#[frame_support::pallet] +pub mod pallet { + use alloc::collections::BTreeMap; + use pallet_hyperbridge::PALLET_HYPERBRIDGE; + use sp_runtime::traits::AccountIdConversion; + + use super::*; + use frame_support::{ + pallet_prelude::*, + traits::{tokens::Preservation, Currency, ExistenceRequirement}, + }; + use frame_system::pallet_prelude::*; + use ismp::{ + dispatcher::{DispatchPost, DispatchRequest, FeeMetadata, IsmpDispatcher}, + host::StateMachine, + }; + use pallet_hyperbridge::{SubstrateHostParams, VersionedHostParams}; + use sp_runtime::traits::Zero; + use token_gateway_primitives::{GatewayAssetUpdate, RemoteERC6160AssetRegistration}; + + #[pallet::pallet] + #[pallet::without_storage_info] + pub struct Pallet(_); + + /// The pallet's configuration trait. + #[pallet::config] + pub trait Config: + frame_system::Config + pallet_ismp::Config + pallet_hyperbridge::Config + { + /// The overarching runtime event type. + type RuntimeEvent: From> + IsType<::RuntimeEvent>; + + /// The [`IsmpDispatcher`] for dispatching cross-chain requests + type Dispatcher: IsmpDispatcher; + + /// A currency implementation for interacting with the native asset + type NativeCurrency: Currency; + + /// A funded account that would be set as asset admin and also make payments for asset + /// creation + type AssetAdmin: Get; + + /// Fungible asset implementation + type Assets: fungibles::Mutate + + fungibles::Inspect; + + /// The native asset ID + type NativeAssetId: Get>; + + /// A trait that can be used to create new asset Ids + type AssetIdFactory: CreateAssetId>; + + /// The decimals of the native currency + #[pallet::constant] + type Decimals: Get; + + /// Origin type that will be used to enforce permissions. + type ControlOrigin: EnsureOrigin; + + /// Convert Location to `T::CurrencyId`. + type CurrencyIdConvert: CurrencyIdMapping>; + } + + /// Assets supported by this instance of token gateway + /// A map of the local asset id to the token gateway asset id + #[pallet::storage] + pub type SupportedAssets = + StorageMap<_, Blake2_128Concat, AssetId, H256, OptionQuery>; + + /// Assets that originate from this chain + #[pallet::storage] + pub type NativeAssets = + StorageMap<_, Blake2_128Concat, AssetId, bool, ValueQuery>; + + /// Assets supported by this instance of token gateway + /// A map of the token gateway asset id to the local asset id + #[pallet::storage] + pub type LocalAssets = StorageMap<_, Identity, H256, AssetId, OptionQuery>; + + /// The decimals used by the EVM counterpart of this asset + #[pallet::storage] + pub type Decimals = StorageMap<_, Blake2_128Concat, AssetId, u8, OptionQuery>; + + /// The token gateway adresses on different chains + #[pallet::storage] + pub type TokenGatewayAddresses = + StorageMap<_, Blake2_128Concat, StateMachine, Vec, OptionQuery>; + + /// Pallet events that functions in this pallet can emit. + #[pallet::event] + #[pallet::generate_deposit(pub(super) fn deposit_event)] + pub enum Event { + /// An asset has been teleported + AssetTeleported { + /// Source account on the relaychain + from: T::AccountId, + /// beneficiary account on destination + to: H256, + /// Amount transferred + amount: <::NativeCurrency as Currency>::Balance, + /// Destination chain + dest: StateMachine, + /// Request commitment + commitment: H256, + }, + + /// An asset has been received and transferred to the beneficiary's account + AssetReceived { + /// beneficiary account on relaychain + beneficiary: T::AccountId, + /// Amount transferred + amount: <::NativeCurrency as Currency>::Balance, + /// Destination chain + source: StateMachine, + }, + + /// An asset has been refunded and transferred to the beneficiary's account + AssetRefunded { + /// beneficiary account on relaychain + beneficiary: T::AccountId, + /// Amount transferred + amount: <::NativeCurrency as Currency>::Balance, + /// Destination chain + source: StateMachine, + }, + + /// ERC6160 asset creation request dispatched to hyperbridge + ERC6160AssetRegistrationDispatched { + /// Request commitment + commitment: H256, + }, + } + + /// Errors that can be returned by this pallet. + #[pallet::error] + pub enum Error { + /// A asset that has not been registered + UnregisteredAsset, + /// Error while teleporting asset + AssetTeleportError, + /// Coprocessor was not configured in the runtime + CoprocessorNotConfigured, + /// Asset or update Dispatch Error + DispatchError, + /// Asset Id creation failed + AssetCreationError, + /// Asset decimals not found + AssetDecimalsNotFound, + /// Protocol Params have not been initialized + NotInitialized, + /// Unknown Asset + UnknownAsset, + } + + #[pallet::call] + impl Pallet + where + ::AccountId: From<[u8; 32]>, + u128: From<<::NativeCurrency as Currency>::Balance>, + ::Balance: + From<<::NativeCurrency as Currency>::Balance>, + <::Assets as fungibles::Inspect>::Balance: + From<<::NativeCurrency as Currency>::Balance>, + <::Assets as fungibles::Inspect>::Balance: From, + [u8; 32]: From<::AccountId>, + { + /// Teleports a registered asset + /// locks the asset and dispatches a request to token gateway on the destination + #[pallet::call_index(0)] + #[pallet::weight(weight())] + pub fn teleport( + origin: OriginFor, + params: TeleportParams< + AssetId, + <::NativeCurrency as Currency>::Balance, + >, + ) -> DispatchResult { + let who = ensure_signed(origin)?; + + let dispatcher = ::Dispatcher::default(); + let asset_id = SupportedAssets::::get(params.asset_id.clone()) + .ok_or_else(|| Error::::UnregisteredAsset)?; + let decimals = if params.asset_id == T::NativeAssetId::get() { + // Custody funds in pallet + ::NativeCurrency::transfer( + &who, + &Self::pallet_account(), + params.amount, + ExistenceRequirement::AllowDeath, + )?; + T::Decimals::get() + } else { + let is_native = NativeAssets::::get(params.asset_id.clone()); + if is_native { + ::Assets::transfer( + params.asset_id.clone(), + &who, + &Self::pallet_account(), + params.amount.into(), + Preservation::Expendable, + )?; + } else { + // Assets that do not originate from this chain are burned + ::Assets::burn_from( + params.asset_id.clone(), + &who, + params.amount.into(), + Preservation::Expendable, + Precision::Exact, + Fortitude::Polite, + )?; + } + params + .asset_id + .decimals() + .unwrap_or( + T::CurrencyIdConvert::get_currency_metadata(params.asset_id) + .map_or(12, |metatata| metatata.decimals.into()), + ) + .into() + }; + + let to = params.recepient.0; + let from: [u8; 32] = who.clone().into(); + let erc_decimals = Decimals::::get(params.asset_id) + .ok_or_else(|| Error::::AssetDecimalsNotFound)?; + + let body = Body { + amount: { + let amount: u128 = params.amount.into(); + let mut bytes = [0u8; 32]; + convert_to_erc20(amount, erc_decimals, decimals).to_big_endian(&mut bytes); + alloy_primitives::U256::from_be_bytes(bytes) + }, + asset_id: asset_id.0.into(), + redeem: params.redeem, + from: from.into(), + to: to.into(), + }; + + let dispatch_post = DispatchPost { + dest: params.destination, + from: token_gateway_id().0.to_vec(), + to: params.token_gateway, + timeout: params.timeout, + body: { + // Prefix with the handleIncomingAsset enum variant + let mut encoded = vec![0]; + encoded.extend_from_slice(&Body::abi_encode(&body)); + encoded + }, + }; + + let metadata = FeeMetadata { + payer: who.clone(), + fee: params.relayer_fee.into(), + }; + let commitment = dispatcher + .dispatch_request(DispatchRequest::Post(dispatch_post), metadata) + .map_err(|_| Error::::AssetTeleportError)?; + + Self::deposit_event(Event::::AssetTeleported { + from: who, + to: params.recepient, + dest: params.destination, + amount: params.amount, + commitment, + }); + Ok(()) + } + + /// Set the token gateway address for specified chains + #[pallet::call_index(1)] + #[pallet::weight(weight())] + pub fn set_token_gateway_addresses( + origin: OriginFor, + addresses: BTreeMap>, + ) -> DispatchResult { + T::AdminOrigin::ensure_origin(origin)?; + for (chain, address) in addresses { + TokenGatewayAddresses::::insert(chain, address.clone()); + } + Ok(()) + } + + /// Registers a multi-chain ERC6160 asset. The asset should not already exist. + /// + /// This works by dispatching a request to the TokenGateway module on each requested chain + /// to create the asset. + /// `native` should be true if this asset originates from this chain + #[pallet::call_index(2)] + #[pallet::weight(weight())] + pub fn create_erc6160_asset( + origin: OriginFor, + asset: AssetRegistration>, + native: bool, + ) -> DispatchResult { + T::ControlOrigin::ensure_origin(origin)?; + let who = T::AssetAdmin::get(); + + // charge hyperbridge fees + let VersionedHostParams::V1(SubstrateHostParams { + asset_registration_fee, + .. + }) = pallet_hyperbridge::Pallet::::host_params(); + + if asset_registration_fee != Zero::zero() { + T::Currency::transfer( + &who, + &PALLET_HYPERBRIDGE.into_account_truncating(), + asset_registration_fee.into(), + Preservation::Expendable, + )?; + } + + let asset_id: H256 = sp_io::hashing::keccak_256(asset.reg.symbol.as_ref()).into(); + // If the local asset id already exists we do not change it's metadata we only store + // the mapping to its token gateway asset id + + SupportedAssets::::insert(asset.local_id.clone(), asset_id.clone()); + NativeAssets::::insert(asset.local_id.clone(), native); + LocalAssets::::insert(asset_id, asset.local_id.clone()); + // All ERC6160 assets use 18 decimals + Decimals::::insert(asset.local_id, 18); + + let dispatcher = ::Dispatcher::default(); + let dispatch_post = DispatchPost { + dest: T::Coprocessor::get().ok_or_else(|| Error::::CoprocessorNotConfigured)?, + from: token_gateway_id().0.to_vec(), + to: token_governor_id(), + timeout: 0, + body: { RemoteERC6160AssetRegistration::CreateAsset(asset.reg).encode() }, + }; + + let metadata = FeeMetadata { + payer: who, + fee: Default::default(), + }; + + let commitment = dispatcher + .dispatch_request(DispatchRequest::Post(dispatch_post), metadata) + .map_err(|_| Error::::DispatchError)?; + Self::deposit_event(Event::::ERC6160AssetRegistrationDispatched { commitment }); + + Ok(()) + } + + /// Registers a multi-chain ERC6160 asset. The asset should not already exist. + /// + /// This works by dispatching a request to the TokenGateway module on each requested chain + /// to create the asset. + #[pallet::call_index(3)] + #[pallet::weight(weight())] + pub fn update_erc6160_asset( + origin: OriginFor, + asset: GatewayAssetUpdate, + ) -> DispatchResult { + T::ControlOrigin::ensure_origin(origin)?; + let who = T::AssetAdmin::get(); + + // charge hyperbridge fees + let VersionedHostParams::V1(SubstrateHostParams { + asset_registration_fee, + .. + }) = pallet_hyperbridge::Pallet::::host_params(); + + if asset_registration_fee != Zero::zero() { + T::Currency::transfer( + &who, + &PALLET_HYPERBRIDGE.into_account_truncating(), + asset_registration_fee.into(), + Preservation::Expendable, + )?; + } + + let dispatcher = ::Dispatcher::default(); + let dispatch_post = DispatchPost { + dest: T::Coprocessor::get().ok_or_else(|| Error::::CoprocessorNotConfigured)?, + from: token_gateway_id().0.to_vec(), + to: token_governor_id(), + timeout: 0, + body: { RemoteERC6160AssetRegistration::UpdateAsset(asset).encode() }, + }; + + let metadata = FeeMetadata { + payer: who, + fee: Default::default(), + }; + + let commitment = dispatcher + .dispatch_request(DispatchRequest::Post(dispatch_post), metadata) + .map_err(|_| Error::::DispatchError)?; + Self::deposit_event(Event::::ERC6160AssetRegistrationDispatched { commitment }); + + Ok(()) + } + } + + // Hack for implementing the [`Default`] bound needed for + // [`IsmpDispatcher`](ismp::dispatcher::IsmpDispatcher) and + // [`IsmpModule`](ismp::module::IsmpModule) + impl Default for Pallet { + fn default() -> Self { + Self(PhantomData) + } + } +} + +impl IsmpModule for Pallet +where + ::AccountId: From<[u8; 32]>, + <::NativeCurrency as Currency>::Balance: From, + <::Assets as fungibles::Inspect>::Balance: From, +{ + fn on_accept( + &self, + PostRequest { + body, + from, + source, + dest, + nonce, + .. + }: PostRequest, + ) -> Result<(), anyhow::Error> { + ensure!( + from == TokenGatewayAddresses::::get(source) + .unwrap_or_default() + .to_vec() || from == token_gateway_id().0.to_vec(), + ismp::error::Error::ModuleDispatchError { + msg: "Token Gateway: Unknown source contract address".to_string(), + meta: Meta { + source, + dest, + nonce + }, + } + ); + + let body = Body::abi_decode(&mut &body[1..], true).map_err(|_| { + ismp::error::Error::ModuleDispatchError { + msg: "Token Gateway: Failed to decode request body".to_string(), + meta: Meta { + source, + dest, + nonce, + }, + } + })?; + + let local_asset_id = + LocalAssets::::get(H256::from(body.asset_id.0)).ok_or_else(|| { + ismp::error::Error::ModuleDispatchError { + msg: "Token Gateway: Unknown asset".to_string(), + meta: Meta { + source, + dest, + nonce, + }, + } + })?; + + let decimals = if local_asset_id == T::NativeAssetId::get() { + T::Decimals::get() + } else { + local_asset_id + .decimals() + .unwrap_or( + T::CurrencyIdConvert::get_currency_metadata(local_asset_id) + .map_or(12, |metatata| metatata.decimals.into()), + ) + .into() + }; + let erc_decimals = Decimals::::get(local_asset_id.clone()) + .ok_or_else(|| anyhow!("Asset decimals not configured"))?; + let amount = convert_to_balance( + U256::from_big_endian(&body.amount.to_be_bytes::<32>()), + erc_decimals, + decimals, + ) + .map_err(|_| ismp::error::Error::ModuleDispatchError { + msg: "Token Gateway: Trying to withdraw Invalid amount".to_string(), + meta: Meta { + source, + dest, + nonce, + }, + })?; + let beneficiary: T::AccountId = body.to.0.into(); + if local_asset_id == T::NativeAssetId::get() { + ::NativeCurrency::transfer( + &Pallet::::pallet_account(), + &beneficiary, + amount.into(), + ExistenceRequirement::AllowDeath, + ) + .map_err(|_| ismp::error::Error::ModuleDispatchError { + msg: "Token Gateway: Failed to complete asset transfer".to_string(), + meta: Meta { + source, + dest, + nonce, + }, + })?; + } else { + // Assets that do not originate from this chain are minted + let is_native = NativeAssets::::get(local_asset_id.clone()); + if is_native { + ::Assets::transfer( + local_asset_id, + &Pallet::::pallet_account(), + &beneficiary, + amount.into(), + Preservation::Expendable, + ) + .map_err(|_| ismp::error::Error::ModuleDispatchError { + msg: "Token Gateway: Failed to complete asset transfer".to_string(), + meta: Meta { + source, + dest, + nonce, + }, + })?; + } else { + ::Assets::mint_into(local_asset_id, &beneficiary, amount.into()) + .map_err(|_| ismp::error::Error::ModuleDispatchError { + msg: "Token Gateway: Failed to complete asset transfer".to_string(), + meta: Meta { + source, + dest, + nonce, + }, + })?; + } + } + + Self::deposit_event(Event::::AssetReceived { + beneficiary, + amount: amount.into(), + source, + }); + Ok(()) + } + + fn on_response(&self, _response: Response) -> Result<(), anyhow::Error> { + Err(anyhow!("Module does not accept responses".to_string())) + } + + fn on_timeout(&self, request: Timeout) -> Result<(), anyhow::Error> { + match request { + Timeout::Request(Request::Post(PostRequest { + body, + source, + dest, + nonce, + .. + })) => { + let body = Body::abi_decode(&mut &body[1..], true).map_err(|_| { + ismp::error::Error::ModuleDispatchError { + msg: "Token Gateway: Failed to decode request body".to_string(), + meta: Meta { + source, + dest, + nonce, + }, + } + })?; + let beneficiary = body.from.0.into(); + let local_asset_id = LocalAssets::::get(H256::from(body.asset_id.0)) + .ok_or_else(|| ismp::error::Error::ModuleDispatchError { + msg: "Token Gateway: Unknown asset".to_string(), + meta: Meta { + source, + dest, + nonce, + }, + })?; + let decimals = if local_asset_id == T::NativeAssetId::get() { + T::Decimals::get() + } else { + local_asset_id + .decimals() + .unwrap_or( + T::CurrencyIdConvert::get_currency_metadata(local_asset_id) + .map_or(12, |metatata| metatata.decimals.into()), + ) + .into() + }; + let erc_decimals = Decimals::::get(local_asset_id.clone()) + .ok_or_else(|| anyhow!("Asset decimals not configured"))?; + let amount = convert_to_balance( + U256::from_big_endian(&body.amount.to_be_bytes::<32>()), + erc_decimals, + decimals, + ) + .map_err(|_| ismp::error::Error::ModuleDispatchError { + msg: "Token Gateway: Trying to withdraw Invalid amount".to_string(), + meta: Meta { + source, + dest, + nonce, + }, + })?; + + if local_asset_id == T::NativeAssetId::get() { + ::NativeCurrency::transfer( + &Pallet::::pallet_account(), + &beneficiary, + amount.into(), + ExistenceRequirement::AllowDeath, + ) + .map_err(|_| ismp::error::Error::ModuleDispatchError { + msg: "Token Gateway: Failed to complete asset transfer".to_string(), + meta: Meta { + source, + dest, + nonce, + }, + })?; + } else { + // Assets that do not originate from this chain are minted + let is_native = NativeAssets::::get(local_asset_id.clone()); + if is_native { + ::Assets::transfer( + local_asset_id, + &Pallet::::pallet_account(), + &beneficiary, + amount.into(), + Preservation::Expendable, + ) + .map_err(|_| ismp::error::Error::ModuleDispatchError { + msg: "Token Gateway: Failed to complete asset transfer".to_string(), + meta: Meta { + source, + dest, + nonce, + }, + })?; + } else { + ::Assets::mint_into( + local_asset_id, + &beneficiary, + amount.into(), + ) + .map_err(|_| ismp::error::Error::ModuleDispatchError { + msg: "Token Gateway: Failed to complete asset transfer".to_string(), + meta: Meta { + source, + dest, + nonce, + }, + })?; + } + } + + Pallet::::deposit_event(Event::::AssetRefunded { + beneficiary, + amount: amount.into(), + source: dest, + }); + } + Timeout::Request(Request::Get(get)) => Err(ismp::error::Error::ModuleDispatchError { + msg: "Tried to timeout unsupported request type".to_string(), + meta: Meta { + source: get.source, + dest: get.dest, + nonce: get.nonce, + }, + })?, + + Timeout::Response(response) => Err(ismp::error::Error::ModuleDispatchError { + msg: "Tried to timeout unsupported request type".to_string(), + meta: Meta { + source: response.source_chain(), + dest: response.dest_chain(), + nonce: response.nonce(), + }, + })?, + } + Ok(()) + } +} + +/// Static weights because benchmarks suck, and we'll be getting PolkaVM soon anyways +fn weight() -> Weight { + Weight::from_parts(300_000_000, 0) +} diff --git a/pallets/token-gateway/src/types.rs b/pallets/token-gateway/src/types.rs new file mode 100644 index 0000000000..d143061c25 --- /dev/null +++ b/pallets/token-gateway/src/types.rs @@ -0,0 +1,85 @@ +// Copyright (C) Polytope Labs Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Pallet types + +use alloc::vec::Vec; +use anyhow::anyhow; +use frame_support::{pallet_prelude::*, traits::fungibles}; +use ismp::host::StateMachine; +use primitive_types::H256; + +use crate::Config; + +pub type AssetId = + <::Assets as fungibles::Inspect<::AccountId>>::AssetId; + +/// Asset teleportation parameters +#[derive(Debug, Clone, Encode, Decode, scale_info::TypeInfo, PartialEq, Eq)] +pub struct TeleportParams { + /// Asset Id registered on Hyperbridge + pub asset_id: AssetId, + /// Destination state machine + pub destination: StateMachine, + /// Receiving account on destination + pub recepient: H256, + /// Amount to be sent + pub amount: Balance, + /// Request timeout + pub timeout: u64, + /// Token gateway address + pub token_gateway: Vec, + /// Relayer fee + pub relayer_fee: Balance, + /// Redeem native erc20 assets + pub redeem: bool, +} + +/// Local asset Id and its corresponding token gateway asset id +#[derive(Clone, Encode, Decode, scale_info::TypeInfo, PartialEq, Eq, RuntimeDebug)] +pub struct AssetRegistration { + /// Local Asset Id should already exist + pub local_id: AssetId, + /// MNT Asset registration details + pub reg: token_gateway_primitives::GatewayAssetRegistration, +} + +alloy_sol_macro::sol! { + #![sol(all_derives)] + struct Body { + // Amount of the asset to be sent + uint256 amount; + // The asset identifier + bytes32 asset_id; + // Flag to redeem the erc20 asset on the destination + bool redeem; + // Sender address + bytes32 from; + // Recipient address + bytes32 to; + } +} + +/// A trait that helps in creating new asset ids in the runtime +pub trait CreateAssetId { + /// Should return a unique asset id + fn create_asset_id(symbol: Vec) -> Result; +} + +impl CreateAssetId for () { + fn create_asset_id(_symbol: Vec) -> Result { + Err(anyhow!("Unimplemented")) + } +} diff --git a/pallets/vesting/src/benchmarking.rs b/pallets/vesting/src/benchmarking.rs index fa8df18163..25a5968262 100644 --- a/pallets/vesting/src/benchmarking.rs +++ b/pallets/vesting/src/benchmarking.rs @@ -20,18 +20,13 @@ #![cfg(feature = "runtime-benchmarks")] -use frame_benchmarking::{account, benchmarks, whitelisted_caller}; -use frame_system::{Pallet as System, RawOrigin}; -use sp_runtime::traits::Bounded; - use super::*; -use crate::Pallet as Vesting; +use frame_benchmarking::v2::*; +use frame_system::RawOrigin; +use sp_runtime::traits::Bounded; const SEED: u32 = 0; -type BalanceOf = - <::Currency as Currency<::AccountId>>::Balance; - fn add_locks(who: &T::AccountId, n: u8) { for id in 0..n { let lock_id = [id; 8]; @@ -41,190 +36,279 @@ fn add_locks(who: &T::AccountId, n: u8) { } } -fn add_vesting_schedule(who: &T::AccountId) -> Result<(), &'static str> { +fn add_vesting_schedule(who: &T::AccountId) -> Result, BenchmarkError> { let locked = 100u32; let per_block = 10u32; let starting_block = 1u32; - System::::set_block_number(0u32.into()); + frame_system::Pallet::::set_block_number(0u32.into()); + Pallet::::init_vesting_start_at(RawOrigin::Root.into(), 0u32.into()) + .map_err(|_| BenchmarkError::Stop("Failed to init vesting start"))?; - Vesting::::init_vesting_start_at(RawOrigin::Root.into(), 0u32.into())?; + Pallet::::add_vesting_schedule(&who, locked.into(), per_block.into(), starting_block.into()) + .map_err(|_| BenchmarkError::Stop("Failed to add vesting schedule"))?; - // Add schedule to avoid `NotVesting` error. - Vesting::::add_vesting_schedule( - &who, - locked.into(), - per_block.into(), - starting_block.into(), - )?; - Ok(()) + Ok(locked.into()) } -benchmarks! { - vest_locked { - let l in 0 .. MaxLocksOf::::get(); +#[benchmarks] +mod benchmarks { + use super::*; - let caller = whitelisted_caller(); + #[benchmark] + fn vest_locked( + l: Linear<0, { MaxLocksOf::::get() }>, + s: Linear<2, { T::MAX_VESTING_SCHEDULES }>, + ) -> Result<(), BenchmarkError> { + let caller: T::AccountId = account("seed", 1, 1); T::Currency::make_free_balance_be(&caller, BalanceOf::::max_value()); + add_locks::(&caller, l as u8); add_vesting_schedule::(&caller)?; - // At block zero, everything is vested. - System::::set_block_number(BlockNumberFor::::zero()); + + frame_system::Pallet::::set_block_number(BlockNumberFor::::zero()); assert_eq!( - Vesting::::vesting_balance(&caller), + Pallet::::vesting_balance(&caller), Some(100u32.into()), "Vesting schedule not added", ); - }: vest(RawOrigin::Signed(caller.clone())) - verify { - // Nothing happened since everything is still vested. + + #[extrinsic_call] + vest(RawOrigin::Signed(caller.clone())); + assert_eq!( - Vesting::::vesting_balance(&caller), + Pallet::::vesting_balance(&caller), Some(100u32.into()), "Vesting schedule was removed", ); - } - vest_unlocked { - let l in 0 .. MaxLocksOf::::get(); + Ok(()) + } - let caller = whitelisted_caller(); + #[benchmark] + fn vest_unlocked( + l: Linear<0, { MaxLocksOf::::get() }>, + s: Linear<2, { T::MAX_VESTING_SCHEDULES }>, + ) -> Result<(), BenchmarkError> { + let caller: T::AccountId = account("seed", 1, 1); T::Currency::make_free_balance_be(&caller, BalanceOf::::max_value()); + add_locks::(&caller, l as u8); add_vesting_schedule::(&caller)?; - // At block 20, everything is unvested. - System::::set_block_number(20u32.into()); + + frame_system::Pallet::::set_block_number(20u32.into()); assert_eq!( - Vesting::::vesting_balance(&caller), + Pallet::::vesting_balance(&caller), Some(BalanceOf::::zero()), "Vesting schedule still active", ); - }: vest(RawOrigin::Signed(caller.clone())) - verify { - // Vesting schedule is removed! + + #[extrinsic_call] + vest(RawOrigin::Signed(caller.clone())); + assert_eq!( - Vesting::::vesting_balance(&caller), + Pallet::::vesting_balance(&caller), None, "Vesting schedule was not removed", ); - } - vest_other_locked { - let l in 0 .. MaxLocksOf::::get(); + Ok(()) + } + #[benchmark] + fn vest_other_locked( + l: Linear<0, { MaxLocksOf::::get() }>, + s: Linear<2, { T::MAX_VESTING_SCHEDULES }>, + ) -> Result<(), BenchmarkError> { let other: T::AccountId = account("other", 0, SEED); let other_lookup: ::Source = T::Lookup::unlookup(other.clone()); T::Currency::make_free_balance_be(&other, BalanceOf::::max_value()); + add_locks::(&other, l as u8); add_vesting_schedule::(&other)?; - // At block zero, everything is vested. - System::::set_block_number(BlockNumberFor::::zero()); + + frame_system::Pallet::::set_block_number(BlockNumberFor::::zero()); assert_eq!( - Vesting::::vesting_balance(&other), + Pallet::::vesting_balance(&other), Some(100u32.into()), "Vesting schedule not added", ); let caller: T::AccountId = whitelisted_caller(); - }: vest_other(RawOrigin::Signed(caller.clone()), other_lookup) - verify { - // Nothing happened since everything is still vested. + + #[extrinsic_call] + vest_other(RawOrigin::Signed(caller), other_lookup); + assert_eq!( - Vesting::::vesting_balance(&other), + Pallet::::vesting_balance(&other), Some(100u32.into()), "Vesting schedule was removed", ); - } - vest_other_unlocked { - let l in 0 .. MaxLocksOf::::get(); + Ok(()) + } + #[benchmark] + fn vest_other_unlocked( + l: Linear<0, { MaxLocksOf::::get() }>, + s: Linear<2, { T::MAX_VESTING_SCHEDULES }>, + ) -> Result<(), BenchmarkError> { let other: T::AccountId = account("other", 0, SEED); let other_lookup: ::Source = T::Lookup::unlookup(other.clone()); T::Currency::make_free_balance_be(&other, BalanceOf::::max_value()); + add_locks::(&other, l as u8); add_vesting_schedule::(&other)?; - // At block 20, everything is unvested. - System::::set_block_number(20u32.into()); + + frame_system::Pallet::::set_block_number(20u32.into()); assert_eq!( - Vesting::::vesting_balance(&other), + Pallet::::vesting_balance(&other), Some(BalanceOf::::zero()), "Vesting schedule still active", ); let caller: T::AccountId = whitelisted_caller(); - }: vest_other(RawOrigin::Signed(caller.clone()), other_lookup) - verify { - // Vesting schedule is removed! + + #[extrinsic_call] + vest_other(RawOrigin::Signed(caller), other_lookup); + assert_eq!( - Vesting::::vesting_balance(&other), + Pallet::::vesting_balance(&other), None, "Vesting schedule was not removed", ); - } - vested_transfer { - let l in 0 .. MaxLocksOf::::get(); + Ok(()) + } + #[benchmark] + fn vested_transfer( + l: Linear<0, { MaxLocksOf::::get() }>, + s: Linear<2, { T::MAX_VESTING_SCHEDULES }>, + ) -> Result<(), BenchmarkError> { let caller: T::AccountId = whitelisted_caller(); T::Currency::make_free_balance_be(&caller, BalanceOf::::max_value()); + let target: T::AccountId = account("target", 0, SEED); - let target_lookup: ::Source = T::Lookup::unlookup(target.clone()); + let target_lookup: ::Source = + T::Lookup::unlookup(target.clone()); let transfer_amount = T::MinVestedTransfer::get(); - let vesting_schedule = VestingInfo { locked: transfer_amount, per_block: 10u32.into(), starting_block: 1u32.into(), }; - }: _(RawOrigin::Signed(caller), target_lookup, vesting_schedule) - verify { + + #[extrinsic_call] + _(RawOrigin::Signed(caller), target_lookup, vesting_schedule); + assert_eq!( T::MinVestedTransfer::get(), T::Currency::free_balance(&target), "Transfer didn't happen", ); assert_eq!( - Vesting::::vesting_balance(&target), + Pallet::::vesting_balance(&target), Some(T::MinVestedTransfer::get()), "Lock not created", ); - } - force_vested_transfer { - let l in 0 .. MaxLocksOf::::get(); + Ok(()) + } + #[benchmark] + fn force_vested_transfer( + l: Linear<0, { MaxLocksOf::::get() }>, + s: Linear<2, { T::MAX_VESTING_SCHEDULES }>, + ) -> Result<(), BenchmarkError> { let source: T::AccountId = account("source", 0, SEED); - let source_lookup: ::Source = T::Lookup::unlookup(source.clone()); + let source_lookup: ::Source = + T::Lookup::unlookup(source.clone()); T::Currency::make_free_balance_be(&source, BalanceOf::::max_value()); + let target: T::AccountId = account("target", 0, SEED); - let target_lookup: ::Source = T::Lookup::unlookup(target.clone()); + let target_lookup: ::Source = + T::Lookup::unlookup(target.clone()); let transfer_amount = T::MinVestedTransfer::get(); - let vesting_schedule = VestingInfo { locked: transfer_amount, per_block: 10u32.into(), starting_block: 1u32.into(), }; - }: _(RawOrigin::Root, source_lookup, target_lookup, vesting_schedule) - verify { + + #[extrinsic_call] + _( + RawOrigin::Root, + source_lookup, + target_lookup, + vesting_schedule, + ); + assert_eq!( T::MinVestedTransfer::get(), T::Currency::free_balance(&target), "Transfer didn't happen", ); assert_eq!( - Vesting::::vesting_balance(&target), + Pallet::::vesting_balance(&target), Some(T::MinVestedTransfer::get()), "Lock not created", ); + + Ok(()) + } + + #[benchmark] + fn not_unlocking_merge_schedules( + l: Linear<0, { MaxLocksOf::::get() }>, + s: Linear<2, { T::MAX_VESTING_SCHEDULES }>, + ) -> Result<(), BenchmarkError> { + let caller: T::AccountId = account("seed", 1, 1); + + T::Currency::make_free_balance_be(&caller, T::Currency::minimum_balance()); + + add_locks::(&caller, l as u8); + + add_vesting_schedule::(&caller)?; + add_vesting_schedule::(&caller)?; + + assert_eq!( + frame_system::Pallet::::block_number(), + BlockNumberFor::::zero() + ); + assert_eq!( + Pallet::::vesting_balance(&caller), + Some(200u32.into()), + "Vesting balance should equal sum locked of all schedules", + ); + assert_eq!( + Vesting::::get(&caller).unwrap().len(), + 2, + "There should be exactly two vesting schedules" + ); + + #[extrinsic_call] + merge_schedules(RawOrigin::Signed(caller.clone()), 0, 1); + + let schedules = Vesting::::get(&caller).unwrap(); + assert_eq!(schedules.len(), 1, "Schedule count should be 1 after merge"); + + assert_eq!( + Pallet::::vesting_balance(&caller), + Some(200u32.into()), + "Vesting balance should remain the same after merge", + ); + + Ok(()) } impl_benchmark_test_suite!( - Vesting, - crate::mock::ExtBuilder::default().existential_deposit(256).build(), + Pallet, + crate::mock::ExtBuilder::default() + .existential_deposit(256) + .build(), crate::mock::Test, ); } diff --git a/pallets/vesting/src/mock.rs b/pallets/vesting/src/mock.rs index 2ef0de716c..4b2b3e8227 100644 --- a/pallets/vesting/src/mock.rs +++ b/pallets/vesting/src/mock.rs @@ -143,3 +143,8 @@ impl ExtBuilder { ext } } + +#[cfg(feature = "runtime-benchmarks")] +pub fn new_test_ext_benchmark() -> sp_io::TestExternalities { + ExtBuilder::default().build() +} diff --git a/pallets/vesting/src/weights.rs b/pallets/vesting/src/weights.rs index 297e20452b..95f504caba 100644 --- a/pallets/vesting/src/weights.rs +++ b/pallets/vesting/src/weights.rs @@ -15,30 +15,34 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. -//! Autogenerated weights for pallet_vesting +//! Autogenerated weights for bifrost_vesting //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-04-06, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.1 +//! DATE: 2025-01-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `mjl-legion`, CPU: `12th Gen Intel(R) Core(TM) i9-12900H` +//! WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 // Executed Command: -// ./target/production/substrate +// target/release/bifrost // benchmark // pallet -// --chain=dev +// --chain=bifrost-kusama-local // --steps=50 // --repeat=20 -// --pallet=pallet_vesting +// --pallet=bifrost-vesting // --extrinsic=* // --execution=wasm // --wasm-execution=compiled // --heap-pages=4096 -// --output=./frame/vesting/src/weights.rs -// --header=./HEADER-APACHE2 -// --template=./.maintain/frame-weight-template.hbs +// --output=./pallets/vesting/src/weights.rs +// --template=./weight-template/pallet-weight-template.hbs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -47,7 +51,7 @@ use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; use sp_std::marker::PhantomData; -/// Weight functions needed for pallet_vesting. +/// Weight functions needed for bifrost_vesting. pub trait WeightInfo { fn vest_locked(l: u32, s: u32, ) -> Weight; fn vest_unlocked(l: u32, s: u32, ) -> Weight; @@ -59,348 +63,175 @@ pub trait WeightInfo { fn unlocking_merge_schedules(l: u32, s: u32, ) -> Weight; } -/// Weights for pallet_vesting using the Substrate node and recommended hardware. -pub struct BifrostWeight(PhantomData); -impl WeightInfo for BifrostWeight { - /// Storage: Vesting Vesting (r:1 w:1) - /// Proof: Vesting Vesting (max_values: None, max_size: Some(1057), added: 3532, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) - /// Storage: Balances Freezes (r:1 w:0) - /// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) - /// The range of component `l` is `[0, 49]`. - /// The range of component `s` is `[1, 28]`. - fn vest_locked(l: u32, s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `381 + l * (25 ±0) + s * (36 ±0)` - // Estimated: `4764` - // Minimum execution time: 36_182_000 picoseconds. - Weight::from_parts(35_159_830, 4764) - // Standard Error: 952 - .saturating_add(Weight::from_parts(63_309, 0).saturating_mul(l.into())) - // Standard Error: 1_694 - .saturating_add(Weight::from_parts(62_244, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(3_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - } - /// Storage: Vesting Vesting (r:1 w:1) - /// Proof: Vesting Vesting (max_values: None, max_size: Some(1057), added: 3532, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) - /// Storage: Balances Freezes (r:1 w:0) - /// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) - /// The range of component `l` is `[0, 49]`. - /// The range of component `s` is `[1, 28]`. - fn vest_unlocked(l: u32, s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `381 + l * (25 ±0) + s * (36 ±0)` - // Estimated: `4764` - // Minimum execution time: 39_344_000 picoseconds. - Weight::from_parts(38_921_936, 4764) - // Standard Error: 1_283 - .saturating_add(Weight::from_parts(61_531, 0).saturating_mul(l.into())) - // Standard Error: 2_283 - .saturating_add(Weight::from_parts(36_175, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(3_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - } - /// Storage: Vesting Vesting (r:1 w:1) - /// Proof: Vesting Vesting (max_values: None, max_size: Some(1057), added: 3532, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) - /// Storage: Balances Freezes (r:1 w:0) - /// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// The range of component `l` is `[0, 49]`. - /// The range of component `s` is `[1, 28]`. - fn vest_other_locked(l: u32, s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `484 + l * (25 ±0) + s * (36 ±0)` - // Estimated: `4764` - // Minimum execution time: 39_461_000 picoseconds. - Weight::from_parts(38_206_465, 4764) - // Standard Error: 743 - .saturating_add(Weight::from_parts(56_973, 0).saturating_mul(l.into())) - // Standard Error: 1_322 - .saturating_add(Weight::from_parts(65_059, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) - } - /// Storage: Vesting Vesting (r:1 w:1) - /// Proof: Vesting Vesting (max_values: None, max_size: Some(1057), added: 3532, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) - /// Storage: Balances Freezes (r:1 w:0) - /// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// The range of component `l` is `[0, 49]`. - /// The range of component `s` is `[1, 28]`. - fn vest_other_unlocked(l: u32, s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `484 + l * (25 ±0) + s * (36 ±0)` - // Estimated: `4764` - // Minimum execution time: 42_029_000 picoseconds. - Weight::from_parts(42_153_438, 4764) - // Standard Error: 1_108 - .saturating_add(Weight::from_parts(50_058, 0).saturating_mul(l.into())) - // Standard Error: 1_971 - .saturating_add(Weight::from_parts(32_391, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) - } - /// Storage: Vesting Vesting (r:1 w:1) - /// Proof: Vesting Vesting (max_values: None, max_size: Some(1057), added: 3532, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) - /// Storage: Balances Freezes (r:1 w:0) - /// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) - /// The range of component `l` is `[0, 49]`. - /// The range of component `s` is `[0, 27]`. - fn vested_transfer(l: u32, s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `555 + l * (25 ±0) + s * (36 ±0)` - // Estimated: `4764` - // Minimum execution time: 75_223_000 picoseconds. - Weight::from_parts(76_675_778, 4764) - // Standard Error: 2_534 - .saturating_add(Weight::from_parts(70_731, 0).saturating_mul(l.into())) - // Standard Error: 4_509 - .saturating_add(Weight::from_parts(108_866, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) - } - /// Storage: Vesting Vesting (r:1 w:1) - /// Proof: Vesting Vesting (max_values: None, max_size: Some(1057), added: 3532, mode: MaxEncodedLen) - /// Storage: System Account (r:2 w:2) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) - /// Storage: Balances Freezes (r:1 w:0) - /// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) - /// The range of component `l` is `[0, 49]`. - /// The range of component `s` is `[0, 27]`. - fn force_vested_transfer(l: u32, s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `658 + l * (25 ±0) + s * (36 ±0)` - // Estimated: `6196` - // Minimum execution time: 76_922_000 picoseconds. - Weight::from_parts(78_634_098, 6196) - // Standard Error: 2_099 - .saturating_add(Weight::from_parts(68_218, 0).saturating_mul(l.into())) - // Standard Error: 3_736 - .saturating_add(Weight::from_parts(95_990, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(5_u64)) - .saturating_add(T::DbWeight::get().writes(4_u64)) - } - /// Storage: Vesting Vesting (r:1 w:1) - /// Proof: Vesting Vesting (max_values: None, max_size: Some(1057), added: 3532, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) - /// Storage: Balances Freezes (r:1 w:0) - /// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// The range of component `l` is `[0, 49]`. - /// The range of component `s` is `[2, 28]`. - fn not_unlocking_merge_schedules(l: u32, s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `482 + l * (25 ±0) + s * (36 ±0)` - // Estimated: `4764` - // Minimum execution time: 39_476_000 picoseconds. - Weight::from_parts(38_261_747, 4764) - // Standard Error: 1_794 - .saturating_add(Weight::from_parts(69_639, 0).saturating_mul(l.into())) - // Standard Error: 3_313 - .saturating_add(Weight::from_parts(73_202, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) - } - /// Storage: Vesting Vesting (r:1 w:1) - /// Proof: Vesting Vesting (max_values: None, max_size: Some(1057), added: 3532, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) - /// Storage: Balances Freezes (r:1 w:0) - /// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// The range of component `l` is `[0, 49]`. - /// The range of component `s` is `[2, 28]`. - fn unlocking_merge_schedules(l: u32, s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `482 + l * (25 ±0) + s * (36 ±0)` - // Estimated: `4764` - // Minimum execution time: 43_764_000 picoseconds. - Weight::from_parts(42_679_386, 4764) - // Standard Error: 1_224 - .saturating_add(Weight::from_parts(65_857, 0).saturating_mul(l.into())) - // Standard Error: 2_261 - .saturating_add(Weight::from_parts(70_861, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) - } -} - // For backwards compatibility and tests impl WeightInfo for () { - /// Storage: Vesting Vesting (r:1 w:1) - /// Proof: Vesting Vesting (max_values: None, max_size: Some(1057), added: 3532, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) - /// Storage: Balances Freezes (r:1 w:0) - /// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) - /// The range of component `l` is `[0, 49]`. - /// The range of component `s` is `[1, 28]`. - fn vest_locked(l: u32, s: u32, ) -> Weight { + /// Storage: `Vesting::Cliff` (r:1 w:0) + /// Proof: `Vesting::Cliff` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) + /// Storage: `Vesting::Vesting` (r:1 w:1) + /// Proof: `Vesting::Vesting` (`max_values`: None, `max_size`: Some(1057), added: 3532, mode: `MaxEncodedLen`) + /// Storage: `Vesting::VestingStartAt` (r:1 w:0) + /// Proof: `Vesting::VestingStartAt` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// The range of component `l` is `[0, 50]`. + /// The range of component `s` is `[2, 28]`. + fn vest_locked(l: u32, _s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `381 + l * (25 ±0) + s * (36 ±0)` + // Measured: `972 + l * (25 ±0)` // Estimated: `4764` - // Minimum execution time: 36_182_000 picoseconds. - Weight::from_parts(35_159_830, 4764) - // Standard Error: 952 - .saturating_add(Weight::from_parts(63_309, 0).saturating_mul(l.into())) - // Standard Error: 1_694 - .saturating_add(Weight::from_parts(62_244, 0).saturating_mul(s.into())) - .saturating_add(RocksDbWeight::get().reads(3_u64)) - .saturating_add(RocksDbWeight::get().writes(2_u64)) + // Minimum execution time: 23_957_000 picoseconds. + Weight::from_parts(28_039_235, 4764) + // Standard Error: 1_989 + .saturating_add(Weight::from_parts(25_516, 0).saturating_mul(l.into())) + .saturating_add(RocksDbWeight::get().reads(6_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) } - /// Storage: Vesting Vesting (r:1 w:1) - /// Proof: Vesting Vesting (max_values: None, max_size: Some(1057), added: 3532, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) - /// Storage: Balances Freezes (r:1 w:0) - /// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) - /// The range of component `l` is `[0, 49]`. - /// The range of component `s` is `[1, 28]`. + /// Storage: `Vesting::Cliff` (r:1 w:0) + /// Proof: `Vesting::Cliff` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) + /// Storage: `Vesting::Vesting` (r:1 w:1) + /// Proof: `Vesting::Vesting` (`max_values`: None, `max_size`: Some(1057), added: 3532, mode: `MaxEncodedLen`) + /// Storage: `Vesting::VestingStartAt` (r:1 w:0) + /// Proof: `Vesting::VestingStartAt` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// The range of component `l` is `[0, 50]`. + /// The range of component `s` is `[2, 28]`. fn vest_unlocked(l: u32, s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `381 + l * (25 ±0) + s * (36 ±0)` + // Measured: `972 + l * (25 ±0)` // Estimated: `4764` - // Minimum execution time: 39_344_000 picoseconds. - Weight::from_parts(38_921_936, 4764) - // Standard Error: 1_283 - .saturating_add(Weight::from_parts(61_531, 0).saturating_mul(l.into())) - // Standard Error: 2_283 - .saturating_add(Weight::from_parts(36_175, 0).saturating_mul(s.into())) - .saturating_add(RocksDbWeight::get().reads(3_u64)) - .saturating_add(RocksDbWeight::get().writes(2_u64)) + // Minimum execution time: 24_605_000 picoseconds. + Weight::from_parts(25_363_535, 4764) + // Standard Error: 6_031 + .saturating_add(Weight::from_parts(67_468, 0).saturating_mul(l.into())) + // Standard Error: 11_413 + .saturating_add(Weight::from_parts(54_119, 0).saturating_mul(s.into())) + .saturating_add(RocksDbWeight::get().reads(6_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) } - /// Storage: Vesting Vesting (r:1 w:1) - /// Proof: Vesting Vesting (max_values: None, max_size: Some(1057), added: 3532, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) - /// Storage: Balances Freezes (r:1 w:0) - /// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// The range of component `l` is `[0, 49]`. - /// The range of component `s` is `[1, 28]`. + /// Storage: `Vesting::Cliff` (r:1 w:0) + /// Proof: `Vesting::Cliff` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) + /// Storage: `Vesting::Vesting` (r:1 w:1) + /// Proof: `Vesting::Vesting` (`max_values`: None, `max_size`: Some(1057), added: 3532, mode: `MaxEncodedLen`) + /// Storage: `Vesting::VestingStartAt` (r:1 w:0) + /// Proof: `Vesting::VestingStartAt` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// The range of component `l` is `[0, 50]`. + /// The range of component `s` is `[2, 28]`. fn vest_other_locked(l: u32, s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `484 + l * (25 ±0) + s * (36 ±0)` + // Measured: `1009 + l * (25 ±0)` // Estimated: `4764` - // Minimum execution time: 39_461_000 picoseconds. - Weight::from_parts(38_206_465, 4764) - // Standard Error: 743 - .saturating_add(Weight::from_parts(56_973, 0).saturating_mul(l.into())) - // Standard Error: 1_322 - .saturating_add(Weight::from_parts(65_059, 0).saturating_mul(s.into())) - .saturating_add(RocksDbWeight::get().reads(4_u64)) + // Minimum execution time: 25_729_000 picoseconds. + Weight::from_parts(27_284_518, 4764) + // Standard Error: 8_232 + .saturating_add(Weight::from_parts(42_821, 0).saturating_mul(l.into())) + // Standard Error: 15_580 + .saturating_add(Weight::from_parts(56_486, 0).saturating_mul(s.into())) + .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } - /// Storage: Vesting Vesting (r:1 w:1) - /// Proof: Vesting Vesting (max_values: None, max_size: Some(1057), added: 3532, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) - /// Storage: Balances Freezes (r:1 w:0) - /// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// The range of component `l` is `[0, 49]`. - /// The range of component `s` is `[1, 28]`. - fn vest_other_unlocked(l: u32, s: u32, ) -> Weight { + /// Storage: `Vesting::Cliff` (r:1 w:0) + /// Proof: `Vesting::Cliff` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) + /// Storage: `Vesting::Vesting` (r:1 w:1) + /// Proof: `Vesting::Vesting` (`max_values`: None, `max_size`: Some(1057), added: 3532, mode: `MaxEncodedLen`) + /// Storage: `Vesting::VestingStartAt` (r:1 w:0) + /// Proof: `Vesting::VestingStartAt` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// The range of component `l` is `[0, 50]`. + /// The range of component `s` is `[2, 28]`. + fn vest_other_unlocked(_l: u32, _s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `484 + l * (25 ±0) + s * (36 ±0)` + // Measured: `1009 + l * (25 ±0)` // Estimated: `4764` - // Minimum execution time: 42_029_000 picoseconds. - Weight::from_parts(42_153_438, 4764) - // Standard Error: 1_108 - .saturating_add(Weight::from_parts(50_058, 0).saturating_mul(l.into())) - // Standard Error: 1_971 - .saturating_add(Weight::from_parts(32_391, 0).saturating_mul(s.into())) - .saturating_add(RocksDbWeight::get().reads(4_u64)) + // Minimum execution time: 24_827_000 picoseconds. + Weight::from_parts(31_992_769, 4764) + .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } - /// Storage: Vesting Vesting (r:1 w:1) - /// Proof: Vesting Vesting (max_values: None, max_size: Some(1057), added: 3532, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) - /// Storage: Balances Freezes (r:1 w:0) - /// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) - /// The range of component `l` is `[0, 49]`. - /// The range of component `s` is `[0, 27]`. - fn vested_transfer(l: u32, s: u32, ) -> Weight { + /// Storage: `Vesting::Vesting` (r:1 w:1) + /// Proof: `Vesting::Vesting` (`max_values`: None, `max_size`: Some(1057), added: 3532, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Vesting::VestingStartAt` (r:1 w:0) + /// Proof: `Vesting::VestingStartAt` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + /// The range of component `l` is `[0, 50]`. + /// The range of component `s` is `[2, 28]`. + fn vested_transfer(_l: u32, _s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `555 + l * (25 ±0) + s * (36 ±0)` + // Measured: `822` // Estimated: `4764` - // Minimum execution time: 75_223_000 picoseconds. - Weight::from_parts(76_675_778, 4764) - // Standard Error: 2_534 - .saturating_add(Weight::from_parts(70_731, 0).saturating_mul(l.into())) - // Standard Error: 4_509 - .saturating_add(Weight::from_parts(108_866, 0).saturating_mul(s.into())) - .saturating_add(RocksDbWeight::get().reads(4_u64)) + // Minimum execution time: 48_504_000 picoseconds. + Weight::from_parts(57_984_845, 4764) + .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } - /// Storage: Vesting Vesting (r:1 w:1) - /// Proof: Vesting Vesting (max_values: None, max_size: Some(1057), added: 3532, mode: MaxEncodedLen) - /// Storage: System Account (r:2 w:2) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) - /// Storage: Balances Freezes (r:1 w:0) - /// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) - /// The range of component `l` is `[0, 49]`. - /// The range of component `s` is `[0, 27]`. - fn force_vested_transfer(l: u32, s: u32, ) -> Weight { + /// Storage: `Vesting::Vesting` (r:1 w:1) + /// Proof: `Vesting::Vesting` (`max_values`: None, `max_size`: Some(1057), added: 3532, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:2 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Vesting::VestingStartAt` (r:1 w:0) + /// Proof: `Vesting::VestingStartAt` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + /// The range of component `l` is `[0, 50]`. + /// The range of component `s` is `[2, 28]`. + fn force_vested_transfer(_l: u32, _s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `658 + l * (25 ±0) + s * (36 ±0)` + // Measured: `976` // Estimated: `6196` - // Minimum execution time: 76_922_000 picoseconds. - Weight::from_parts(78_634_098, 6196) - // Standard Error: 2_099 - .saturating_add(Weight::from_parts(68_218, 0).saturating_mul(l.into())) - // Standard Error: 3_736 - .saturating_add(Weight::from_parts(95_990, 0).saturating_mul(s.into())) - .saturating_add(RocksDbWeight::get().reads(5_u64)) + // Minimum execution time: 49_048_000 picoseconds. + Weight::from_parts(58_628_156, 6196) + .saturating_add(RocksDbWeight::get().reads(6_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } - /// Storage: Vesting Vesting (r:1 w:1) - /// Proof: Vesting Vesting (max_values: None, max_size: Some(1057), added: 3532, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) - /// Storage: Balances Freezes (r:1 w:0) - /// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// The range of component `l` is `[0, 49]`. + /// Storage: `Vesting::Vesting` (r:1 w:1) + /// Proof: `Vesting::Vesting` (`max_values`: None, `max_size`: Some(1057), added: 3532, mode: `MaxEncodedLen`) + /// Storage: `Vesting::VestingStartAt` (r:1 w:0) + /// Proof: `Vesting::VestingStartAt` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// The range of component `l` is `[0, 50]`. /// The range of component `s` is `[2, 28]`. fn not_unlocking_merge_schedules(l: u32, s: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `482 + l * (25 ±0) + s * (36 ±0)` + // Measured: `1009 + l * (25 ±0)` // Estimated: `4764` - // Minimum execution time: 39_476_000 picoseconds. - Weight::from_parts(38_261_747, 4764) - // Standard Error: 1_794 - .saturating_add(Weight::from_parts(69_639, 0).saturating_mul(l.into())) - // Standard Error: 3_313 - .saturating_add(Weight::from_parts(73_202, 0).saturating_mul(s.into())) - .saturating_add(RocksDbWeight::get().reads(4_u64)) + // Minimum execution time: 24_019_000 picoseconds. + Weight::from_parts(26_190_811, 4764) + // Standard Error: 2_020 + .saturating_add(Weight::from_parts(45_207, 0).saturating_mul(l.into())) + // Standard Error: 3_824 + .saturating_add(Weight::from_parts(26_045, 0).saturating_mul(s.into())) + .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } /// Storage: Vesting Vesting (r:1 w:1) @@ -426,4 +257,4 @@ impl WeightInfo for () { .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } -} +} \ No newline at end of file diff --git a/primitives/src/currency.rs b/primitives/src/currency.rs index 5dcb8b20b7..d11d52b1a1 100644 --- a/primitives/src/currency.rs +++ b/primitives/src/currency.rs @@ -38,6 +38,7 @@ pub const MOVR: CurrencyId = CurrencyId::Token(TokenSymbol::MOVR); pub const VMOVR: CurrencyId = CurrencyId::VToken(TokenSymbol::MOVR); pub const BNC: CurrencyId = CurrencyId::Native(TokenSymbol::BNC); pub const VBNC: CurrencyId = CurrencyId::VToken(TokenSymbol::BNC); +pub const BNC_DECIMALS: u8 = 12; pub const KSM: CurrencyId = CurrencyId::Token(TokenSymbol::KSM); pub const VKSM: CurrencyId = CurrencyId::VToken(TokenSymbol::KSM); pub const VSKSM: CurrencyId = CurrencyId::VSToken(TokenSymbol::KSM); diff --git a/primitives/src/lib.rs b/primitives/src/lib.rs index fb04d8768e..3fbe971172 100644 --- a/primitives/src/lib.rs +++ b/primitives/src/lib.rs @@ -30,6 +30,7 @@ use sp_runtime::{ traits::{BlakeTwo256, IdentifyAccount, Verify}, FixedU128, MultiSignature, OpaqueExtrinsic, Permill, }; +use sp_std::vec::Vec; pub mod currency; pub use currency::*; @@ -160,6 +161,14 @@ pub type DerivativeIndex = u16; pub type TimeStampedPrice = orml_oracle::TimestampedValue; +#[derive(Clone, Eq, PartialEq, RuntimeDebug, Encode, Decode, TypeInfo)] +pub struct AssetMetadata { + pub name: Vec, + pub symbol: Vec, + pub decimals: u8, + pub minimal_balance: Balance, +} + // Pallet Id parameter_types! { pub const BifrostCrowdloanId: PalletId = PalletId(*b"bf/salp#"); diff --git a/primitives/src/traits.rs b/primitives/src/traits.rs index 5849e6e629..0d6b0b3845 100644 --- a/primitives/src/traits.rs +++ b/primitives/src/traits.rs @@ -21,8 +21,8 @@ #![allow(clippy::unnecessary_cast)] use crate::{ - AssetIds, CurrencyId, DerivativeIndex, LeasePeriod, ParaId, PoolId, RedeemType, TokenId, - TokenSymbol, XcmOperationType, + AssetIds, AssetMetadata, Balance, CurrencyId, DerivativeIndex, LeasePeriod, ParaId, PoolId, + RedeemType, TokenId, TokenSymbol, XcmOperationType, }; use frame_support::pallet_prelude::{DispatchResultWithPostInfo, Weight}; use parity_scale_codec::{Decode, Encode, FullCodec}; @@ -169,7 +169,7 @@ pub trait CurrencyIdConversion { ) -> Result; } -pub trait CurrencyIdRegister { +pub trait CurrencyIdRegister { fn check_token_registered(token_symbol: TokenSymbol) -> bool; fn check_vtoken_registered(token_symbol: TokenSymbol) -> bool; fn check_vstoken_registered(token_symbol: TokenSymbol) -> bool; @@ -184,9 +184,10 @@ pub trait CurrencyIdRegister { fn check_vtoken2_registered(token_id: TokenId) -> bool; fn register_vtoken2_metadata(token_id: TokenId) -> DispatchResult; fn register_blp_metadata(pool_id: PoolId, decimals: u8) -> DispatchResult; + fn register_metadata(currency_id: CurrencyId, metadata: AssetMetadata) -> DispatchResult; } -impl CurrencyIdRegister for () { +impl CurrencyIdRegister> for () { fn check_token_registered(_token_symbol: TokenSymbol) -> bool { false } @@ -227,6 +228,12 @@ impl CurrencyIdRegister for () { fn register_blp_metadata(_pool_id: PoolId, _decimals: u8) -> DispatchResult { Ok(()) } + fn register_metadata( + _currency_id: CurrencyId, + _metadata: AssetMetadata, + ) -> DispatchResult { + Ok(()) + } } /// The interface to call farming pallet functions. @@ -487,17 +494,15 @@ pub trait BalanceCmp { /// - `account`: The account ID whose balance is to be compared. /// - `currency`: The currency ID whose balance is to be compared. /// - `amount`: The amount to compare against. - /// - `amount_precision`: The precision of the input amount. /// /// # Returns /// - `Ok(std::cmp::Ordering)`: The result of the comparison, indicating whether the balance is /// less than, equal to, or greater than the input amount. /// - `Err(Self::Error)`: An error if the comparison fails. - fn cmp_with_precision( + fn cmp_with_weth( account: &AccountId, currency: &CurrencyId, amount: u128, - amount_precision: u32, ) -> Result; } diff --git a/runtime/bifrost-kusama/src/lib.rs b/runtime/bifrost-kusama/src/lib.rs index 82b176821f..1f880a26ae 100644 --- a/runtime/bifrost-kusama/src/lib.rs +++ b/runtime/bifrost-kusama/src/lib.rs @@ -165,7 +165,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("bifrost"), impl_name: create_runtime_str!("bifrost"), authoring_version: 1, - spec_version: 16001, + spec_version: 16002, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, @@ -1113,6 +1113,7 @@ impl bifrost_vesting::Config for Runtime { parameter_types! { pub MaxFeeCurrencyOrderListLen: u32 = 50; + pub AllowVBNCAsFee: bool = false; } impl bifrost_flexible_fee::Config for Runtime { @@ -1134,6 +1135,7 @@ impl bifrost_flexible_fee::Config for Runtime { type InspectEvmAccounts = (); type EvmPermit = bifrost_flexible_fee::impls::evm_permit::DisabledEvmPermitHandler; type AssetIdMaps = AssetIdMaps; + type AllowVBNCAsFee = AllowVBNCAsFee; } parameter_types! { @@ -1712,7 +1714,7 @@ impl lend_market::Config for Runtime { type OraclePriceProvider = Prices; type ReserveOrigin = TechAdminOrCouncil; type UpdateOrigin = TechAdminOrCouncil; - type WeightInfo = lend_market::weights::BifrostWeight; + type WeightInfo = weights::lend_market::BifrostWeight; type UnixTime = Timestamp; type Assets = Currencies; type RewardAssetId = NativeCurrencyId; @@ -2064,6 +2066,7 @@ mod benches { [bifrost_vbnc_convert, VBNCConvert] [bifrost_xcm_interface, XcmInterface] // [bifrost_channel_commission, ChannelCommission] + [bifrost_vesting, Vesting] ); } diff --git a/runtime/bifrost-kusama/src/weights/lend_market.rs b/runtime/bifrost-kusama/src/weights/lend_market.rs new file mode 100644 index 0000000000..321e7bf686 --- /dev/null +++ b/runtime/bifrost-kusama/src/weights/lend_market.rs @@ -0,0 +1,570 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for lend_market +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.1 +//! DATE: 2025-01-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `mjl-legion`, CPU: `12th Gen Intel(R) Core(TM) i9-12900H` +//! WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 + +// Executed Command: +// target/release/bifrost +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=lend-market +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./pallets/lend-market/src/weights.rs +// --template=./weight-template/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; + +/// Weight functions for lend_market. +pub struct BifrostWeight(PhantomData); +impl lend_market::WeightInfo for BifrostWeight { + // Storage: `LendMarket::Markets` (r:2 w:1) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::UnderlyingAssetId` (r:1 w:1) + // Proof: `LendMarket::UnderlyingAssetId` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::ExchangeRate` (r:0 w:1) + // Proof: `LendMarket::ExchangeRate` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::BorrowIndex` (r:0 w:1) + // Proof: `LendMarket::BorrowIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn add_market() -> Weight { + // Proof Size summary in bytes: + // Measured: `76` + // Estimated: `6016` + // Minimum execution time: 13_026 nanoseconds. + Weight::from_parts(13_543_000, 6016) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(4)) + } + // Storage: `LendMarket::Markets` (r:1 w:1) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn activate_market() -> Weight { + // Proof Size summary in bytes: + // Measured: `346` + // Estimated: `3811` + // Minimum execution time: 8_486 nanoseconds. + Weight::from_parts(9_258_000, 3811) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: `LendMarket::Markets` (r:1 w:1) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn update_rate_model() -> Weight { + // Proof Size summary in bytes: + // Measured: `346` + // Estimated: `3811` + // Minimum execution time: 8_533 nanoseconds. + Weight::from_parts(8_844_000, 3811) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: `LendMarket::Markets` (r:1 w:1) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn update_market() -> Weight { + // Proof Size summary in bytes: + // Measured: `346` + // Estimated: `3811` + // Minimum execution time: 9_544 nanoseconds. + Weight::from_parts(10_721_000, 3811) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: `LendMarket::UnderlyingAssetId` (r:1 w:1) + // Proof: `LendMarket::UnderlyingAssetId` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::Markets` (r:1 w:1) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn force_update_market() -> Weight { + // Proof Size summary in bytes: + // Measured: `354` + // Estimated: `3819` + // Minimum execution time: 13_230 nanoseconds. + Weight::from_parts(14_290_000, 3819) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: `System::Account` (r:2 w:2) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + fn add_reward() -> Weight { + // Proof Size summary in bytes: + // Measured: `103` + // Estimated: `6196` + // Minimum execution time: 30_538 nanoseconds. + Weight::from_parts(33_408_000, 6196) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: `System::Account` (r:2 w:2) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + fn withdraw_missing_reward() -> Weight { + // Proof Size summary in bytes: + // Measured: `206` + // Estimated: `6196` + // Minimum execution time: 28_814 nanoseconds. + Weight::from_parts(31_409_000, 6196) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: `LendMarket::Markets` (r:2 w:0) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplySpeed` (r:1 w:1) + // Proof: `LendMarket::RewardSupplySpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowSpeed` (r:1 w:1) + // Proof: `LendMarket::RewardBorrowSpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplyState` (r:1 w:1) + // Proof: `LendMarket::RewardSupplyState` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowState` (r:1 w:1) + // Proof: `LendMarket::RewardBorrowState` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn update_market_reward_speed() -> Weight { + // Proof Size summary in bytes: + // Measured: `354` + // Estimated: `6294` + // Minimum execution time: 20_639 nanoseconds. + Weight::from_parts(22_334_000, 6294) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(4)) + } + // Storage: `LendMarket::Markets` (r:2 w:0) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplyState` (r:1 w:1) + // Proof: `LendMarket::RewardSupplyState` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplySpeed` (r:1 w:0) + // Proof: `LendMarket::RewardSupplySpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplierIndex` (r:1 w:1) + // Proof: `LendMarket::RewardSupplierIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardAccured` (r:1 w:1) + // Proof: `LendMarket::RewardAccured` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountDeposits` (r:1 w:0) + // Proof: `LendMarket::AccountDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowState` (r:1 w:1) + // Proof: `LendMarket::RewardBorrowState` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowSpeed` (r:1 w:0) + // Proof: `LendMarket::RewardBorrowSpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowerIndex` (r:1 w:1) + // Proof: `LendMarket::RewardBorrowerIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountBorrows` (r:1 w:0) + // Proof: `LendMarket::AccountBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::BorrowIndex` (r:1 w:0) + // Proof: `LendMarket::BorrowIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn claim_reward() -> Weight { + // Proof Size summary in bytes: + // Measured: `376` + // Estimated: `6316` + // Minimum execution time: 37_371 nanoseconds. + Weight::from_parts(39_770_000, 6316) + .saturating_add(T::DbWeight::get().reads(12)) + .saturating_add(T::DbWeight::get().writes(5)) + } + // Storage: `LendMarket::RewardSupplyState` (r:1 w:1) + // Proof: `LendMarket::RewardSupplyState` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplySpeed` (r:1 w:0) + // Proof: `LendMarket::RewardSupplySpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::TotalSupply` (r:1 w:0) + // Proof: `LendMarket::TotalSupply` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplierIndex` (r:1 w:1) + // Proof: `LendMarket::RewardSupplierIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardAccured` (r:1 w:1) + // Proof: `LendMarket::RewardAccured` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountDeposits` (r:1 w:0) + // Proof: `LendMarket::AccountDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowState` (r:1 w:1) + // Proof: `LendMarket::RewardBorrowState` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowSpeed` (r:1 w:0) + // Proof: `LendMarket::RewardBorrowSpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::TotalBorrows` (r:1 w:0) + // Proof: `LendMarket::TotalBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::BorrowIndex` (r:1 w:0) + // Proof: `LendMarket::BorrowIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowerIndex` (r:1 w:1) + // Proof: `LendMarket::RewardBorrowerIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountBorrows` (r:1 w:0) + // Proof: `LendMarket::AccountBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `System::Account` (r:2 w:2) + // 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: `1102` + // Estimated: `6196` + // Minimum execution time: 74_938 nanoseconds. + Weight::from_parts(79_615_000, 6196) + .saturating_add(T::DbWeight::get().reads(14)) + .saturating_add(T::DbWeight::get().writes(7)) + } + // Storage: `LendMarket::Markets` (r:2 w:0) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Tokens::Accounts` (r:2 w:2) + // Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(118), added: 2593, 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: `LendMarket::LastAccruedInterestTime` (r:1 w:1) + // Proof: `LendMarket::LastAccruedInterestTime` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplyState` (r:1 w:1) + // Proof: `LendMarket::RewardSupplyState` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplySpeed` (r:1 w:0) + // Proof: `LendMarket::RewardSupplySpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplierIndex` (r:1 w:1) + // Proof: `LendMarket::RewardSupplierIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardAccured` (r:1 w:1) + // Proof: `LendMarket::RewardAccured` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountDeposits` (r:1 w:1) + // Proof: `LendMarket::AccountDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::TotalSupply` (r:1 w:1) + // Proof: `LendMarket::TotalSupply` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `System::Account` (r:1 w:1) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Storage: `LendMarket::TotalBorrows` (r:1 w:0) + // Proof: `LendMarket::TotalBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::TotalReserves` (r:1 w:0) + // Proof: `LendMarket::TotalReserves` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountEarned` (r:1 w:1) + // Proof: `LendMarket::AccountEarned` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `AssetRegistry::CurrencyMetadatas` (r:1 w:0) + // Proof: `AssetRegistry::CurrencyMetadatas` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn mint() -> Weight { + // Proof Size summary in bytes: + // Measured: `1010` + // Estimated: `6950` + // Minimum execution time: 69_957 nanoseconds. + Weight::from_parts(77_602_000, 6950) + .saturating_add(T::DbWeight::get().reads(17)) + .saturating_add(T::DbWeight::get().writes(10)) + } + // Storage: `LendMarket::Markets` (r:2 w:0) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Timestamp::Now` (r:1 w:0) + // Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + // Storage: `LendMarket::LastAccruedInterestTime` (r:1 w:1) + // Proof: `LendMarket::LastAccruedInterestTime` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::TotalBorrows` (r:1 w:1) + // Proof: `LendMarket::TotalBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Tokens::Accounts` (r:2 w:2) + // Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(118), added: 2593, mode: `MaxEncodedLen`) + // Storage: `System::Account` (r:1 w:0) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Storage: `LendMarket::TotalReserves` (r:1 w:0) + // Proof: `LendMarket::TotalReserves` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Prices::EmergencyPrice` (r:1 w:0) + // Proof: `Prices::EmergencyPrice` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `AssetRegistry::CurrencyMetadatas` (r:1 w:0) + // Proof: `AssetRegistry::CurrencyMetadatas` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::MarketBond` (r:1 w:0) + // Proof: `LendMarket::MarketBond` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountBorrows` (r:1 w:1) + // Proof: `LendMarket::AccountBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountDeposits` (r:1 w:0) + // Proof: `LendMarket::AccountDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::TotalSupply` (r:1 w:0) + // Proof: `LendMarket::TotalSupply` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::LiquidationFreeCollaterals` (r:1 w:0) + // Proof: `LendMarket::LiquidationFreeCollaterals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowState` (r:1 w:1) + // Proof: `LendMarket::RewardBorrowState` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowSpeed` (r:1 w:0) + // Proof: `LendMarket::RewardBorrowSpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowerIndex` (r:1 w:1) + // Proof: `LendMarket::RewardBorrowerIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardAccured` (r:1 w:1) + // Proof: `LendMarket::RewardAccured` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::BorrowIndex` (r:1 w:0) + // Proof: `LendMarket::BorrowIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn borrow() -> Weight { + // Proof Size summary in bytes: + // Measured: `1927` + // Estimated: `7867` + // Minimum execution time: 131_552 nanoseconds. + Weight::from_parts(143_114_000, 7867) + .saturating_add(T::DbWeight::get().reads(21)) + .saturating_add(T::DbWeight::get().writes(8)) + } + // Storage: `LendMarket::Markets` (r:2 w:0) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Timestamp::Now` (r:1 w:0) + // Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + // Storage: `LendMarket::LastAccruedInterestTime` (r:1 w:1) + // Proof: `LendMarket::LastAccruedInterestTime` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::TotalSupply` (r:1 w:1) + // Proof: `LendMarket::TotalSupply` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Tokens::Accounts` (r:3 w:3) + // Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(118), added: 2593, mode: `MaxEncodedLen`) + // Storage: `System::Account` (r:2 w:2) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Storage: `LendMarket::TotalBorrows` (r:1 w:0) + // Proof: `LendMarket::TotalBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::TotalReserves` (r:1 w:0) + // Proof: `LendMarket::TotalReserves` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountDeposits` (r:1 w:1) + // Proof: `LendMarket::AccountDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountEarned` (r:1 w:1) + // Proof: `LendMarket::AccountEarned` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplyState` (r:1 w:1) + // Proof: `LendMarket::RewardSupplyState` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplySpeed` (r:1 w:0) + // Proof: `LendMarket::RewardSupplySpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplierIndex` (r:1 w:1) + // Proof: `LendMarket::RewardSupplierIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardAccured` (r:1 w:1) + // Proof: `LendMarket::RewardAccured` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `AssetRegistry::CurrencyMetadatas` (r:1 w:0) + // Proof: `AssetRegistry::CurrencyMetadatas` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn redeem() -> Weight { + // Proof Size summary in bytes: + // Measured: `1890` + // Estimated: `8769` + // Minimum execution time: 116_287 nanoseconds. + Weight::from_parts(128_202_000, 8769) + .saturating_add(T::DbWeight::get().reads(19)) + .saturating_add(T::DbWeight::get().writes(12)) + } + // Storage: `LendMarket::Markets` (r:2 w:0) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Timestamp::Now` (r:1 w:0) + // Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + // Storage: `LendMarket::LastAccruedInterestTime` (r:1 w:1) + // Proof: `LendMarket::LastAccruedInterestTime` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::TotalSupply` (r:1 w:1) + // Proof: `LendMarket::TotalSupply` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Tokens::Accounts` (r:2 w:2) + // Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(118), added: 2593, mode: `MaxEncodedLen`) + // Storage: `System::Account` (r:1 w:1) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Storage: `LendMarket::TotalBorrows` (r:1 w:0) + // Proof: `LendMarket::TotalBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::TotalReserves` (r:1 w:0) + // Proof: `LendMarket::TotalReserves` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountDeposits` (r:1 w:1) + // Proof: `LendMarket::AccountDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountEarned` (r:1 w:1) + // Proof: `LendMarket::AccountEarned` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplyState` (r:1 w:1) + // Proof: `LendMarket::RewardSupplyState` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplySpeed` (r:1 w:0) + // Proof: `LendMarket::RewardSupplySpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplierIndex` (r:1 w:1) + // Proof: `LendMarket::RewardSupplierIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardAccured` (r:1 w:1) + // Proof: `LendMarket::RewardAccured` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `AssetRegistry::CurrencyMetadatas` (r:1 w:0) + // Proof: `AssetRegistry::CurrencyMetadatas` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn redeem_all() -> Weight { + // Proof Size summary in bytes: + // Measured: `1787` + // Estimated: `7727` + // Minimum execution time: 94_336 nanoseconds. + Weight::from_parts(96_915_000, 7727) + .saturating_add(T::DbWeight::get().reads(17)) + .saturating_add(T::DbWeight::get().writes(10)) + } + // Storage: `LendMarket::Markets` (r:2 w:0) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Timestamp::Now` (r:1 w:0) + // Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + // Storage: `LendMarket::LastAccruedInterestTime` (r:1 w:1) + // Proof: `LendMarket::LastAccruedInterestTime` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountBorrows` (r:1 w:1) + // Proof: `LendMarket::AccountBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::BorrowIndex` (r:1 w:0) + // Proof: `LendMarket::BorrowIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowState` (r:1 w:1) + // Proof: `LendMarket::RewardBorrowState` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowSpeed` (r:1 w:0) + // Proof: `LendMarket::RewardBorrowSpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowerIndex` (r:1 w:1) + // Proof: `LendMarket::RewardBorrowerIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardAccured` (r:1 w:1) + // Proof: `LendMarket::RewardAccured` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Tokens::Accounts` (r:2 w:2) + // Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(118), added: 2593, mode: `MaxEncodedLen`) + // Storage: `AssetRegistry::CurrencyMetadatas` (r:1 w:0) + // Proof: `AssetRegistry::CurrencyMetadatas` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::TotalBorrows` (r:1 w:1) + // Proof: `LendMarket::TotalBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn repay_borrow() -> Weight { + // Proof Size summary in bytes: + // Measured: `1788` + // Estimated: `7728` + // Minimum execution time: 69_861 nanoseconds. + Weight::from_parts(73_341_000, 7728) + .saturating_add(T::DbWeight::get().reads(14)) + .saturating_add(T::DbWeight::get().writes(8)) + } + // Storage: `LendMarket::Markets` (r:2 w:0) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Timestamp::Now` (r:1 w:0) + // Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + // Storage: `LendMarket::LastAccruedInterestTime` (r:1 w:1) + // Proof: `LendMarket::LastAccruedInterestTime` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountBorrows` (r:1 w:1) + // Proof: `LendMarket::AccountBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::BorrowIndex` (r:1 w:0) + // Proof: `LendMarket::BorrowIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowState` (r:1 w:1) + // Proof: `LendMarket::RewardBorrowState` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowSpeed` (r:1 w:0) + // Proof: `LendMarket::RewardBorrowSpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowerIndex` (r:1 w:1) + // Proof: `LendMarket::RewardBorrowerIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardAccured` (r:1 w:1) + // Proof: `LendMarket::RewardAccured` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Tokens::Accounts` (r:2 w:2) + // Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(118), added: 2593, mode: `MaxEncodedLen`) + // Storage: `AssetRegistry::CurrencyMetadatas` (r:1 w:0) + // Proof: `AssetRegistry::CurrencyMetadatas` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::TotalBorrows` (r:1 w:1) + // Proof: `LendMarket::TotalBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn repay_borrow_all() -> Weight { + // Proof Size summary in bytes: + // Measured: `1788` + // Estimated: `7728` + // Minimum execution time: 77_216 nanoseconds. + Weight::from_parts(81_489_000, 7728) + .saturating_add(T::DbWeight::get().reads(14)) + .saturating_add(T::DbWeight::get().writes(8)) + } + // Storage: `LendMarket::Markets` (r:2 w:0) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountDeposits` (r:1 w:1) + // Proof: `LendMarket::AccountDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn collateral_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `529` + // Estimated: `6469` + // Minimum execution time: 21_883 nanoseconds. + Weight::from_parts(24_523_000, 6469) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: `LendMarket::LiquidationFreeCollaterals` (r:1 w:0) + // Proof: `LendMarket::LiquidationFreeCollaterals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `Timestamp::Now` (r:1 w:0) + // Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + // Storage: `LendMarket::LastAccruedInterestTime` (r:2 w:2) + // Proof: `LendMarket::LastAccruedInterestTime` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::Markets` (r:3 w:0) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountBorrows` (r:3 w:1) + // Proof: `LendMarket::AccountBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::BorrowIndex` (r:1 w:0) + // Proof: `LendMarket::BorrowIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Prices::EmergencyPrice` (r:2 w:0) + // Proof: `Prices::EmergencyPrice` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `AssetRegistry::CurrencyMetadatas` (r:2 w:0) + // Proof: `AssetRegistry::CurrencyMetadatas` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountDeposits` (r:4 w:3) + // Proof: `LendMarket::AccountDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::TotalSupply` (r:1 w:0) + // Proof: `LendMarket::TotalSupply` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Tokens::Accounts` (r:3 w:2) + // Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(118), added: 2593, mode: `MaxEncodedLen`) + // Storage: `System::Account` (r:2 w:0) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Storage: `LendMarket::TotalBorrows` (r:2 w:1) + // Proof: `LendMarket::TotalBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::TotalReserves` (r:1 w:0) + // Proof: `LendMarket::TotalReserves` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowState` (r:1 w:1) + // Proof: `LendMarket::RewardBorrowState` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowSpeed` (r:1 w:0) + // Proof: `LendMarket::RewardBorrowSpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowerIndex` (r:1 w:1) + // Proof: `LendMarket::RewardBorrowerIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardAccured` (r:3 w:3) + // Proof: `LendMarket::RewardAccured` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplyState` (r:1 w:1) + // Proof: `LendMarket::RewardSupplyState` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplySpeed` (r:1 w:0) + // Proof: `LendMarket::RewardSupplySpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplierIndex` (r:3 w:3) + // Proof: `LendMarket::RewardSupplierIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn liquidate_borrow() -> Weight { + // Proof Size summary in bytes: + // Measured: `2910` + // Estimated: `13800` + // Minimum execution time: 208_693 nanoseconds. + Weight::from_parts(218_121_000, 13800) + .saturating_add(T::DbWeight::get().reads(39)) + .saturating_add(T::DbWeight::get().writes(18)) + } + // Storage: `LendMarket::Markets` (r:2 w:0) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Tokens::Accounts` (r:2 w:2) + // Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(118), added: 2593, mode: `MaxEncodedLen`) + // Storage: `AssetRegistry::CurrencyMetadatas` (r:1 w:0) + // Proof: `AssetRegistry::CurrencyMetadatas` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `System::Account` (r:1 w:1) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Storage: `LendMarket::TotalReserves` (r:1 w:1) + // Proof: `LendMarket::TotalReserves` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn add_reserves() -> Weight { + // Proof Size summary in bytes: + // Measured: `938` + // Estimated: `6878` + // Minimum execution time: 36_687 nanoseconds. + Weight::from_parts(37_948_000, 6878) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(4)) + } + // Storage: `LendMarket::Markets` (r:2 w:0) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::TotalReserves` (r:1 w:1) + // Proof: `LendMarket::TotalReserves` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Tokens::Accounts` (r:2 w:2) + // Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(118), added: 2593, mode: `MaxEncodedLen`) + // Storage: `AssetRegistry::CurrencyMetadatas` (r:1 w:0) + // Proof: `AssetRegistry::CurrencyMetadatas` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `System::Account` (r:1 w:0) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + fn reduce_reserves() -> Weight { + // Proof Size summary in bytes: + // Measured: `1214` + // Estimated: `7154` + // Minimum execution time: 36_510 nanoseconds. + Weight::from_parts(41_064_000, 7154) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: `LendMarket::LiquidationFreeCollaterals` (r:1 w:1) + // Proof: `LendMarket::LiquidationFreeCollaterals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn update_liquidation_free_collateral() -> Weight { + // Proof Size summary in bytes: + // Measured: `76` + // Estimated: `1561` + // Minimum execution time: 6_120 nanoseconds. + Weight::from_parts(6_715_000, 1561) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } +} diff --git a/runtime/bifrost-kusama/src/weights/mod.rs b/runtime/bifrost-kusama/src/weights/mod.rs index 944900a817..3641825a21 100644 --- a/runtime/bifrost-kusama/src/weights/mod.rs +++ b/runtime/bifrost-kusama/src/weights/mod.rs @@ -39,6 +39,7 @@ pub mod bifrost_vstoken_conversion; pub mod bifrost_vtoken_minting; pub mod bifrost_vtoken_voting; pub mod bifrost_xcm_interface; +pub mod lend_market; pub mod orml_oracle; pub mod orml_tokens; pub mod pallet_xcm; diff --git a/runtime/bifrost-kusama/src/xcm_config.rs b/runtime/bifrost-kusama/src/xcm_config.rs index 20dceca6eb..ea178b2d89 100644 --- a/runtime/bifrost-kusama/src/xcm_config.rs +++ b/runtime/bifrost-kusama/src/xcm_config.rs @@ -51,7 +51,9 @@ use pallet_xcm::XcmPassthrough; use parachains_common::message_queue::{NarrowOriginToSibling, ParaIdToSibling}; use polkadot_runtime_common::xcm_sender::NoPriceForMessageDelivery; use xcm::v4::{prelude::*, Location}; -use xcm_builder::{FrameTransactionalProcessor, TrailingSetTopicAsId, WithComputedOrigin}; +use xcm_builder::{ + FrameTransactionalProcessor, TrailingSetTopicAsId, WithComputedOrigin, WithUniqueTopic, +}; parameter_types! { pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); @@ -290,12 +292,12 @@ pub type LocalOriginToLocation = SignedToAccountId32, // ..and XCMP to communicate with the sibling chains. XcmpQueue, -); +)>; #[cfg(feature = "runtime-benchmarks")] parameter_types! { diff --git a/runtime/bifrost-paseo/Cargo.toml b/runtime/bifrost-paseo/Cargo.toml new file mode 100644 index 0000000000..e4bac4bc6f --- /dev/null +++ b/runtime/bifrost-paseo/Cargo.toml @@ -0,0 +1,475 @@ +[package] +name = "bifrost-paseo-runtime" +version = "0.8.0" +authors = ["Liebi Technologies "] +edition = "2021" +build = "build.rs" + +[dependencies] +# third-party dependencies +parity-scale-codec = { workspace = true, features = ["derive", "max-encoded-len"] } +hex-literal = { workspace = true } +log = { workspace = true } +scale-info = { workspace = true, features = ["derive"] } +smallvec = { workspace = true } +static_assertions = { workspace = true } +strum = { workspace = true, features = ["derive"] } +strum_macros = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } + +# frame dependencies +frame-benchmarking = { workspace = true, optional = true } +frame-executive = { workspace = true } +frame-metadata-hash-extension = { workspace = true } +frame-support = { workspace = true, features = ["tuples-96"] } +frame-system = { workspace = true } +frame-system-benchmarking = { workspace = true, optional = true } +frame-system-rpc-runtime-api = { workspace = true } +frame-try-runtime = { workspace = true, optional = true } +pallet-asset-rate = { workspace = true } +pallet-aura = { workspace = true } +pallet-authorship = { workspace = true } +pallet-balances = { workspace = true } +pallet-bounties = { workspace = true } +pallet-collective = { workspace = true } +pallet-conviction-voting = { workspace = true } +pallet-democracy = { workspace = true } +pallet-elections-phragmen = { workspace = true } +pallet-identity = { workspace = true } +pallet-indices = { workspace = true } +pallet-membership = { workspace = true } +pallet-message-queue = { workspace = true } +pallet-multisig = { workspace = true } +pallet-preimage = { workspace = true } +pallet-proxy = { workspace = true } +pallet-ranked-collective = { workspace = true } +pallet-referenda = { workspace = true } +pallet-scheduler = { workspace = true } +pallet-staking = { workspace = true } +pallet-session = { workspace = true } +pallet-sudo = { workspace = true } +pallet-timestamp = { workspace = true } +pallet-tips = { workspace = true } +pallet-tx-pause = { workspace = true } +pallet-transaction-payment = { workspace = true } +pallet-transaction-payment-rpc-runtime-api = { workspace = true } +pallet-treasury = { workspace = true } +pallet-utility = { workspace = true } +pallet-whitelist = { workspace = true } +sp-api = { workspace = true } +sp-arithmetic = { workspace = true } +sp-block-builder = { workspace = true } +sp-consensus-aura = { workspace = true } +sp-core = { workspace = true } +sp-inherents = { workspace = true } +sp-io = { workspace = true } +sp-offchain = { workspace = true } +sp-runtime = { workspace = true } +sp-session = { workspace = true } +sp-staking = { workspace = true } +sp-std = { workspace = true } +sp-transaction-pool = { workspace = true } +sp-version = { workspace = true } +sp-genesis-builder = { workspace = true } + +# Cumulus dependencies +cumulus-pallet-aura-ext = { workspace = true } +cumulus-pallet-parachain-system = { workspace = true } +cumulus-pallet-xcm = { workspace = true } +cumulus-pallet-xcmp-queue = { workspace = true } +cumulus-primitives-aura = { workspace = true } +cumulus-primitives-core = { workspace = true } +cumulus-primitives-timestamp = { workspace = true } +cumulus-primitives-utility = { workspace = true } +parachain-info = { workspace = true } +parachains-common = { workspace = true } + +# Polkadot dependencies +pallet-xcm = { workspace = true } +polkadot-parachain-primitives = { workspace = true } +polkadot-primitives = { workspace = true } +polkadot-runtime-common = { workspace = true } +xcm = { workspace = true } +xcm-builder = { workspace = true } +xcm-executor = { workspace = true } +xcm-runtime-apis = { workspace = true } + +# orml +orml-tokens = { workspace = true } +orml-traits = { workspace = true } +orml-xtokens = { workspace = true } +orml-unknown-tokens = { workspace = true } +orml-xcm = { workspace = true } +orml-xcm-support = { workspace = true } +orml-oracle = { workspace = true } + +# zenlink +merkle-distributor = { workspace = true } +zenlink-protocol = { workspace = true } +zenlink-protocol-runtime-api = { workspace = true } + +# Nuts Finance +bifrost-stable-asset = { workspace = true } + +# Frontier +num_enum = { workspace = true } +primitive-types = { workspace = true } +ethabi = { workspace = true } +module-evm-utility-macro = { workspace = true } +evm = { workspace = true, features = ["with-codec"] } +fp-account = { workspace = true, features = ["serde"] } +fp-evm = { workspace = true, features = ["serde"] } +fp-rpc = { workspace = true } +fp-self-contained = { workspace = true, features = ["serde"] } +pallet-base-fee = { workspace = true } +pallet-dynamic-fee = { workspace = true } +pallet-ethereum = { workspace = true } +pallet-evm = { workspace = true } +pallet-evm-chain-id = { workspace = true } +pallet-evm-precompile-dispatch = { workspace = true } +pallet-evm-precompile-modexp = { workspace = true } +pallet-evm-precompile-sha3fips = { workspace = true } +pallet-evm-precompile-simple = { workspace = true } +pallet-evm-precompile-call-permit = { workspace = true } +pallet-evm-precompile-bn128 = { workspace = true } +pallet-evm-precompile-blake2 = { workspace = true } +pallet-evm-accounts = { workspace = true } +pallet-evm-accounts-rpc-runtime-api = { workspace = true } +pallet-traits = { workspace = true } + +# Bifrost +bifrost-asset-registry = { workspace = true } +bifrost-buy-back = { workspace = true } +bifrost-cross-in-out = { workspace = true } +bifrost-currencies = { workspace = true } +bifrost-farming = { workspace = true } +bifrost-farming-rpc-runtime-api = { workspace = true } +bifrost-fee-share = { workspace = true } +bifrost-flexible-fee = { workspace = true } +bifrost-flexible-fee-rpc-runtime-api = { workspace = true } +bifrost-primitives = { workspace = true } +bifrost-runtime-common = { workspace = true } +bifrost-salp = { workspace = true } +bifrost-salp-rpc-runtime-api = { workspace = true } +bifrost-slp = { workspace = true } +bifrost-slp-v2 = { workspace = true, features = ["polkadot"] } +bifrost-slpx = { workspace = true } +bifrost-stable-pool = { workspace = true } +bifrost-stable-pool-rpc-runtime-api = { workspace = true } +bifrost-system-staking = { workspace = true } +bb-bnc = { workspace = true } +bb-bnc-rpc-runtime-api = { workspace = true } +bifrost-vesting = { workspace = true } +bifrost-vstoken-conversion = { workspace = true } +bifrost-vtoken-minting = { workspace = true } +bifrost-vtoken-voting = { workspace = true, features = ["polkadot"] } +bifrost-xcm-interface = { workspace = true } +bifrost-parachain-staking = { workspace = true } +lend-market = { workspace = true } +lend-market-rpc-runtime-api = { workspace = true } +pallet-prices = { workspace = true } +leverage-staking = { workspace = true } +bifrost-channel-commission = { workspace = true } +bifrost-clouds-convert = { workspace = true } +bifrost-vtoken-minting-rpc-runtime-api = { workspace = true } +bifrost-ismp = { workspace = true } + +# Hyperbridge +pallet-ismp = { workspace = true, features = ["unsigned"] } +pallet-ismp-runtime-api = { workspace = true } +ismp-parachain = { workspace = true } +ismp-parachain-runtime-api = { workspace = true } +sp-mmr-primitives = { workspace = true } +ismp = { workspace = true } +pallet-hyperbridge = { workspace = true } +pallet-token-gateway = { workspace = true } +anyhow = { workspace = true } + +[build-dependencies] +substrate-wasm-builder = { workspace = true, optional = true } + +[features] +default = ["std"] +std = [ + "parity-scale-codec/std", + "log/std", + "scale-info/std", + "strum/std", + "frame-executive/std", + "frame-metadata-hash-extension/std", + "frame-support/std", + "frame-system-rpc-runtime-api/std", + "frame-system/std", + "frame-try-runtime/std", + "pallet-aura/std", + "pallet-balances/std", + "pallet-bounties/std", + "pallet-collective/std", + "pallet-conviction-voting/std", + "pallet-democracy/std", + "pallet-elections-phragmen/std", + "pallet-identity/std", + "pallet-indices/std", + "pallet-membership/std", + "pallet-multisig/std", + "pallet-preimage/std", + "pallet-proxy/std", + "pallet-ranked-collective/std", + "pallet-referenda/std", + "pallet-scheduler/std", + "pallet-session/std", + "pallet-sudo/std", + "pallet-timestamp/std", + "pallet-tips/std", + "pallet-tx-pause/std", + "pallet-transaction-payment-rpc-runtime-api/std", + "pallet-transaction-payment/std", + "pallet-treasury/std", + "pallet-whitelist/std", + "sp-api/std", + "sp-arithmetic/std", + "sp-block-builder/std", + "sp-consensus-aura/std", + "sp-core/std", + "sp-inherents/std", + "sp-io/std", + "sp-offchain/std", + "sp-runtime/std", + "sp-session/std", + "sp-staking/std", + "sp-std/std", + "sp-transaction-pool/std", + "sp-genesis-builder/std", + "cumulus-pallet-aura-ext/std", + "cumulus-pallet-parachain-system/std", + "cumulus-pallet-xcm/std", + "cumulus-pallet-xcmp-queue/std", + "cumulus-primitives-aura/std", + "cumulus-primitives-core/std", + "cumulus-primitives-timestamp/std", + "cumulus-primitives-utility/std", + "parachain-info/std", + "polkadot-primitives/std", + "xcm-builder/std", + "xcm-executor/std", + "xcm/std", + "xcm-runtime-apis/std", + "orml-tokens/std", + "orml-traits/std", + "orml-unknown-tokens/std", + "orml-xcm-support/std", + "orml-oracle/std", + "orml-xcm/std", + "orml-xtokens/std", + "merkle-distributor/std", + "zenlink-protocol-runtime-api/std", + "zenlink-protocol/std", + "bifrost-asset-registry/std", + "bifrost-buy-back/std", + "bifrost-cross-in-out/std", + "bifrost-currencies/std", + "bifrost-farming-rpc-runtime-api/std", + "bifrost-farming/std", + "bifrost-fee-share/std", + "bifrost-flexible-fee-rpc-runtime-api/std", + "bifrost-flexible-fee/std", + "bifrost-primitives/std", + "bifrost-runtime-common/std", + "bifrost-salp-rpc-runtime-api/std", + "bifrost-salp/std", + "bifrost-slp/std", + "bifrost-slp-v2/std", + "bifrost-slpx/std", + "bifrost-stable-pool-rpc-runtime-api/std", + "bifrost-stable-pool/std", + "bifrost-system-staking/std", + "bb-bnc-rpc-runtime-api/std", + "bb-bnc/std", + "bifrost-vesting/std", + "bifrost-vtoken-minting/std", + "bifrost-vtoken-voting/std", + "lend-market/std", + "lend-market-rpc-runtime-api/std", + "pallet-prices/std", + "leverage-staking/std", + "bifrost-xcm-interface/std", + "bifrost-channel-commission/std", + # Frontier + "fp-account/std", + "fp-evm/std", + "fp-rpc/std", + "fp-account/std", + "fp-self-contained/std", + "pallet-base-fee/std", + "pallet-dynamic-fee/std", + "pallet-ethereum/std", + "pallet-evm/std", + "pallet-evm-chain-id/std", + "pallet-evm-precompile-dispatch/std", + "pallet-evm-precompile-modexp/std", + "pallet-evm-precompile-sha3fips/std", + "pallet-evm-precompile-simple/std", + "pallet-evm-precompile-call-permit/std", + "pallet-evm-precompile-bn128/std", + "pallet-evm-precompile-blake2/std", + "pallet-evm-accounts/std", + "pallet-evm-accounts-rpc-runtime-api/std", + "bifrost-clouds-convert/std", + "bifrost-vtoken-minting-rpc-runtime-api/std", + "bifrost-parachain-staking/std", + "substrate-wasm-builder", + + "pallet-ismp/std", + "pallet-ismp-runtime-api/std", + "ismp-parachain/std", + "ismp-parachain-runtime-api/std", + "sp-mmr-primitives/std", + "ismp/std", + "pallet-hyperbridge/std", + "pallet-token-gateway/std", + "anyhow/std", +] +with-tracing = ["frame-executive/with-tracing"] + +runtime-benchmarks = [ + "frame-benchmarking", + "frame-system-benchmarking/runtime-benchmarks", + "frame-support/runtime-benchmarks", + "frame-system/runtime-benchmarks", + "pallet-asset-rate/runtime-benchmarks", + "pallet-collective/runtime-benchmarks", + "pallet-conviction-voting/runtime-benchmarks", + "pallet-ranked-collective/runtime-benchmarks", + "pallet-referenda/runtime-benchmarks", + "pallet-balances/runtime-benchmarks", + "pallet-bounties/runtime-benchmarks", + "pallet-indices/runtime-benchmarks", + "pallet-staking/runtime-benchmarks", + "pallet-scheduler/runtime-benchmarks", + "pallet-timestamp/runtime-benchmarks", + "pallet-treasury/runtime-benchmarks", + "pallet-utility/runtime-benchmarks", + "pallet-ethereum/runtime-benchmarks", + "bifrost-vesting/runtime-benchmarks", + "pallet-xcm/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", + "xcm-builder/runtime-benchmarks", + "bifrost-slp/runtime-benchmarks", + "bifrost-slp-v2/runtime-benchmarks", + "bifrost-salp/runtime-benchmarks", + "bifrost-vtoken-minting/runtime-benchmarks", + "bb-bnc/runtime-benchmarks", + "bifrost-cross-in-out/runtime-benchmarks", + "bifrost-slpx/runtime-benchmarks", + "bifrost-stable-pool/runtime-benchmarks", + "bifrost-vtoken-voting/runtime-benchmarks", + "bifrost-xcm-interface/runtime-benchmarks", + "sp-api/disable-logging", + "lend-market/runtime-benchmarks", + "bifrost-channel-commission/runtime-benchmarks", + "bifrost-clouds-convert/runtime-benchmarks", + "bifrost-buy-back/runtime-benchmarks", + "bifrost-parachain-staking/runtime-benchmarks", + "bifrost-farming/runtime-benchmarks", +] + +try-runtime = [ + "bifrost-asset-registry/try-runtime", + "bifrost-buy-back/try-runtime", + "bifrost-channel-commission/try-runtime", + "bifrost-clouds-convert/try-runtime", + "bifrost-cross-in-out/try-runtime", + "bifrost-currencies/try-runtime", + "bifrost-farming/try-runtime", + "bifrost-fee-share/try-runtime", + "bifrost-flexible-fee/try-runtime", + "bifrost-salp/try-runtime", + "bifrost-slp/try-runtime", + "bifrost-slp-v2/try-runtime", + "bifrost-slpx/try-runtime", + "bifrost-stable-asset/try-runtime", + "bifrost-stable-pool/try-runtime", + "bifrost-system-staking/try-runtime", + "bb-bnc/try-runtime", + "bifrost-vesting/try-runtime", + "bifrost-vstoken-conversion/try-runtime", + "bifrost-vtoken-minting/try-runtime", + "bifrost-vtoken-voting/try-runtime", + "bifrost-xcm-interface/try-runtime", + "cumulus-pallet-aura-ext/try-runtime", + "cumulus-pallet-parachain-system/try-runtime", + "cumulus-pallet-xcm/try-runtime", + "cumulus-pallet-xcmp-queue/try-runtime", + "frame-executive/try-runtime", + "frame-support/try-runtime", + "frame-system/try-runtime", + "frame-try-runtime", + "frame-try-runtime/try-runtime", + "lend-market/try-runtime", + "leverage-staking/try-runtime", + "merkle-distributor/try-runtime", + "orml-oracle/try-runtime", + "orml-tokens/try-runtime", + "orml-unknown-tokens/try-runtime", + "orml-xcm/try-runtime", + "orml-xtokens/try-runtime", + "pallet-aura/try-runtime", + "pallet-authorship/try-runtime", + "pallet-balances/try-runtime", + "pallet-bounties/try-runtime", + "pallet-collective/try-runtime", + "pallet-conviction-voting/try-runtime", + "pallet-democracy/try-runtime", + "pallet-elections-phragmen/try-runtime", + "pallet-identity/try-runtime", + "pallet-indices/try-runtime", + "pallet-membership/try-runtime", + "pallet-multisig/try-runtime", + "pallet-preimage/try-runtime", + "pallet-prices/try-runtime", + "pallet-proxy/try-runtime", + "pallet-ranked-collective/try-runtime", + "pallet-referenda/try-runtime", + "pallet-scheduler/try-runtime", + "pallet-session/try-runtime", + "pallet-timestamp/try-runtime", + "pallet-tips/try-runtime", + "pallet-tx-pause/try-runtime", + "pallet-transaction-payment/try-runtime", + "pallet-treasury/try-runtime", + "pallet-utility/try-runtime", + "pallet-whitelist/try-runtime", + "parachain-info/try-runtime", + "zenlink-protocol/try-runtime", + "fp-self-contained/try-runtime", + "pallet-ethereum/try-runtime", + "pallet-evm-accounts/try-runtime", + "pallet-evm/try-runtime", + "pallet-evm-chain-id/try-runtime", + "pallet-dynamic-fee/try-runtime", + "bifrost-parachain-staking/try-runtime", + "bifrost-ismp/try-runtime", + "pallet-ismp/try-runtime", + "pallet-hyperbridge/try-runtime", + "pallet-token-gateway/try-runtime", + "ismp-parachain/try-runtime", + "pallet-sudo/try-runtime", +] + +# Enable the metadata hash generation in the wasm builder. +metadata-hash = ["substrate-wasm-builder?/metadata-hash"] +# When enabled, the runtime API will not be build. +# +# This is required by Cumulus to access certain types of the +# runtime without clashing with the runtime API exported functions +# in WASM. +disable-runtime-api = [] + +# A feature that should be enabled when the runtime should be build for on-chain +# deployment. This will disable stuff that shouldn't be part of the on-chain wasm +# to make it smaller like logging for example. +on-chain-release-build = ["sp-api/disable-logging", "metadata-hash"] + +# Set timing constants (e.g. session period) to faster versions to speed up testing. +fast-runtime = [] diff --git a/runtime/bifrost-paseo/build.rs b/runtime/bifrost-paseo/build.rs new file mode 100644 index 0000000000..32ac6de120 --- /dev/null +++ b/runtime/bifrost-paseo/build.rs @@ -0,0 +1,31 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +#[cfg(all(feature = "std", feature = "metadata-hash"))] +fn main() { + substrate_wasm_builder::WasmBuilder::init_with_defaults() + .enable_metadata_hash("BNC", 12) + .build() +} + +#[cfg(all(feature = "std", not(feature = "metadata-hash")))] +fn main() { + substrate_wasm_builder::WasmBuilder::build_using_defaults() +} + +#[cfg(not(feature = "std"))] +fn main() {} diff --git a/runtime/bifrost-paseo/src/constants.rs b/runtime/bifrost-paseo/src/constants.rs new file mode 100644 index 0000000000..3c71b00e69 --- /dev/null +++ b/runtime/bifrost-paseo/src/constants.rs @@ -0,0 +1,126 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +//! A set of constant values used in Bifrost runtime. + +/// Money matters. +pub mod currency { + use crate::Runtime; + use bifrost_primitives::{Balance, CurrencyId, TokenSymbol}; + use bifrost_runtime_common::{cent, milli}; + use frame_support::weights::{ + constants::{ExtrinsicBaseWeight, WEIGHT_REF_TIME_PER_SECOND}, + WeightToFeeCoefficient, WeightToFeeCoefficients, WeightToFeePolynomial, + }; + use smallvec::smallvec; + pub use sp_runtime::Perbill; + + pub const BNCS: Balance = 1_000_000_000_000; + pub const DOLLARS: Balance = BNCS; + pub const CENTS: Balance = DOLLARS / 100; // assume this is worth about a cent. + pub const RELAY_CENTS: Balance = DOLLARS / 10_000; + pub const MILLICENTS: Balance = CENTS / 1_000; + pub const MILLIBNC: Balance = 1_000_000_000; + pub const MICROBNC: Balance = 1_000_000; + pub const XCM_WEIGHT: u64 = 1_000_000_000; + + pub const fn deposit(items: u32, bytes: u32) -> Balance { + items as Balance * 15 * CENTS + (bytes as Balance) * 6 * CENTS + } + + pub struct WeightToFee; + impl WeightToFeePolynomial for WeightToFee { + type Balance = Balance; + fn polynomial() -> WeightToFeeCoefficients { + // extrinsic base weight (smallest non-zero weight) is mapped to 1/10 CENT: + let p = base_tx_fee::() * 240; + let q = Balance::from(ExtrinsicBaseWeight::get().ref_time()); + smallvec![WeightToFeeCoefficient { + degree: 1, + negative: false, + coeff_frac: Perbill::from_rational(p % q, q), + coeff_integer: p / q, + }] + } + } + + fn base_tx_fee() -> Balance { + milli::(CurrencyId::Native(TokenSymbol::BNC)) / 3 + } + + fn xcm_base_tx_fee() -> Balance { + cent::(CurrencyId::Native(TokenSymbol::BNC)) / 10 + } + + // 1 KSM = 10 DOT + // DOT precision is 1/100 of KSM and BNC + pub fn dot_per_second() -> u128 { + let base_weight = Balance::from(ExtrinsicBaseWeight::get().ref_time()); + let base_tx_per_second = (WEIGHT_REF_TIME_PER_SECOND as u128) / base_weight; + let fee_per_second = base_tx_per_second * xcm_base_tx_fee::(); + fee_per_second / 100 * 10 / 100 + } +} + +/// Time. +pub mod time { + use bifrost_primitives::{BlockNumber, Moment}; + + /// Since BABE is probabilistic this is the average expected block time that + /// we are targetting. Blocks will be produced at a minimum duration defined + /// by `SLOT_DURATION`, but some slots will not be allocated to any + /// authority and hence no block will be produced. We expect to have this + /// block time on average following the defined slot duration and the value + /// of `c` configured for BABE (where `1 - c` represents the probability of + /// a slot being empty). + /// This value is only used indirectly to define the unit constants below + /// that are expressed in blocks. The rest of the code should use + /// `SLOT_DURATION` instead (like the Timestamp pallet for calculating the + /// minimum period). + /// + /// If using BABE with secondary slots (default) then all of the slots will + /// always be assigned, in which case `MILLISECS_PER_BLOCK` and + /// `SLOT_DURATION` should have the same value. + /// + /// + pub const MILLISECS_PER_BLOCK: Moment = 12000; + pub const SECS_PER_BLOCK: Moment = MILLISECS_PER_BLOCK / 1000; + + pub const SLOT_DURATION: Moment = MILLISECS_PER_BLOCK; + + // 1 in 4 blocks (on average, not counting collisions) will be primary BABE blocks. + pub const PRIMARY_PROBABILITY: (u64, u64) = (1, 4); + + pub const EPOCH_DURATION_IN_BLOCKS: BlockNumber = 6 * HOURS; + pub const EPOCH_DURATION_IN_SLOTS: u64 = { + const SLOT_FILL_RATE: f64 = MILLISECS_PER_BLOCK as f64 / SLOT_DURATION as f64; + + (EPOCH_DURATION_IN_BLOCKS as f64 * SLOT_FILL_RATE) as u64 + }; + + // These time units are defined in number of blocks. + pub const MINUTES: BlockNumber = 60 / (SECS_PER_BLOCK as BlockNumber); + pub const HOURS: BlockNumber = MINUTES * 60; + pub const DAYS: BlockNumber = HOURS * 24; + pub const WEEKS: BlockNumber = DAYS * 7; + + // The `LeasePeriod` defination from `polkadot`. + pub const KUSAMA_LEASE_PERIOD: BlockNumber = 6 * WEEKS; + pub const ROCOCO_LEASE_PERIOD: BlockNumber = 1 * DAYS; + pub const WESTEND_LEASE_PERIOD: BlockNumber = 28 * DAYS; +} diff --git a/runtime/bifrost-paseo/src/evm/accounts_conversion.rs b/runtime/bifrost-paseo/src/evm/accounts_conversion.rs new file mode 100644 index 0000000000..70035a95a4 --- /dev/null +++ b/runtime/bifrost-paseo/src/evm/accounts_conversion.rs @@ -0,0 +1,55 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +#![allow(unused_imports)] +use crate::{ + evm::{ConsensusEngineId, FindAuthor}, + AccountId, Aura, EVMAccounts, Runtime, +}; +use core::marker::PhantomData; +use frame_support::traits::IsType; +use hex_literal::hex; +use pallet_evm::AddressMapping; +use pallet_traits::evm::InspectEvmAccounts; +use parity_scale_codec::{Decode, Encode}; +use sp_core::{crypto::ByteArray, H160}; +use sp_runtime::traits::AccountIdConversion; + +pub struct ExtendedAddressMapping; + +impl AddressMapping for ExtendedAddressMapping { + fn into_account_id(address: H160) -> AccountId { + EVMAccounts::account_id(address) + } +} + +// Ethereum-compatible blocks author (20 bytes) +// Converted by truncating from Substrate author (32 bytes) +pub struct FindAuthorTruncated(PhantomData); +impl> FindAuthor for FindAuthorTruncated { + fn find_author<'a, I>(digests: I) -> Option + where + I: 'a + IntoIterator, + { + if let Some(author_index) = F::find_author(digests) { + let authority_id = + pallet_aura::Authorities::::get()[author_index as usize].clone(); + return Some(H160::from_slice(&authority_id.to_raw_vec()[4..24])); + } + None + } +} diff --git a/runtime/bifrost-paseo/src/evm/evm_fee.rs b/runtime/bifrost-paseo/src/evm/evm_fee.rs new file mode 100644 index 0000000000..9c4fdf2af6 --- /dev/null +++ b/runtime/bifrost-paseo/src/evm/evm_fee.rs @@ -0,0 +1,172 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +use crate::Currencies; +use bifrost_primitives::{ + AccountFeeCurrency, Balance, CurrencyId, OraclePriceProvider, Price, WETH, +}; +use frame_support::traits::TryDrop; +use orml_traits::MultiCurrency; +use pallet_evm::{AddressMapping, Error, OnChargeEVMTransaction}; +use sp_core::{H160, U256}; +use sp_runtime::traits::UniqueSaturatedInto; +use sp_std::marker::PhantomData; + +#[derive(Copy, Debug, Clone, Default, PartialEq)] +pub struct EvmPaymentInfo { + fee_amount: Balance, + fee_currency: CurrencyId, + fee_currency_price: Price, + weth_price: Price, +} + +impl EvmPaymentInfo { + pub fn merge(self, other: Self) -> Self { + EvmPaymentInfo { + fee_amount: self.fee_amount.saturating_add(other.fee_amount), + fee_currency: self.fee_currency, + fee_currency_price: self.fee_currency_price, + weth_price: self.weth_price, + } + } +} + +impl TryDrop for EvmPaymentInfo { + fn try_drop(self) -> Result<(), Self> { + if self.fee_amount == 0 { + Ok(()) + } else { + Err(self) + } + } +} + +/// Implements the transaction payment for EVM transactions. +/// Supports multi-currency fees based on what is provided by AccountFeeCurrency - account currency. +pub struct TransferEvmFees(PhantomData<(AC, MC, Price)>); + +impl OnChargeEVMTransaction for TransferEvmFees +where + T: pallet_evm::Config, + AC: AccountFeeCurrency, // AccountCurrency + Price: OraclePriceProvider, // PriceProvider + MC: MultiCurrency, + U256: UniqueSaturatedInto, + sp_runtime::AccountId32: From<::AccountId>, +{ + type LiquidityInfo = Option; + + fn withdraw_fee(who: &H160, fee: U256) -> Result> { + if fee.is_zero() { + return Ok(None); + } + let account_id = T::AddressMapping::into_account_id(*who); + + let fee_currency = + AC::get_fee_currency(&account_id, fee).map_err(|_| Error::::BalanceLow)?; + + let Some((fee_amount, weth_price, fee_currency_price)) = + Price::get_oracle_amount_by_currency_and_amount_in( + &WETH, + fee.unique_saturated_into(), + &fee_currency, + ) + else { + return Err(Error::::WithdrawFailed); + }; + + // Ensure that converted fee is not zero + if fee_amount == 0 { + return Err(Error::::WithdrawFailed); + } + + log::debug!( + target: "evm", + "Withdrew fee from account {:?} in currency {:?} amount {:?}", + account_id, + fee_currency, + fee_amount + ); + + MC::withdraw(fee_currency, &account_id, fee_amount) + .map_err(|_| Error::::WithdrawFailed)?; + + Ok(Some(EvmPaymentInfo { + fee_amount, + fee_currency, + fee_currency_price, + weth_price, + })) + } + + fn correct_and_deposit_fee( + who: &H160, + corrected_fee: U256, + _base_fee: U256, + already_withdrawn: Self::LiquidityInfo, + ) -> Self::LiquidityInfo { + if let Some(payment_info) = already_withdrawn { + let account_id = T::AddressMapping::into_account_id(*who); + + let adjusted_paid = if let Some(converted_corrected_fee) = Price::get_amount_by_prices( + &WETH, + corrected_fee.unique_saturated_into(), + payment_info.weth_price, + &payment_info.fee_currency, + payment_info.fee_currency_price, + ) { + // Calculate how much refund we should return + let refund_amount = payment_info + .fee_amount + .saturating_sub(converted_corrected_fee); + + // refund to the account that paid the fees. If this fails, the + // account might have dropped below the existential balance. In + // that case we don't refund anything. + let refund_imbalance = + match MC::deposit(payment_info.fee_currency, &account_id, refund_amount) { + Ok(_) => 0, + Err(_) => refund_amount, + }; + // figure out how much is left to mint back + // refund_amount already minted back to account, imbalance is what is left to mint + // if any + payment_info + .fee_amount + .saturating_sub(refund_amount) + .saturating_add(refund_imbalance) + } else { + // if conversion failed for some reason, we refund the whole amount back to treasury + payment_info.fee_amount + }; + + // We can simply refund all the remaining amount back to treasury + let result = Currencies::deposit( + payment_info.fee_currency, + &crate::BifrostTreasuryAccount::get(), + adjusted_paid, + ); + debug_assert_eq!(result, Ok(())); + } + None + } + + fn pay_priority_fee(tip: Self::LiquidityInfo) { + debug_assert_eq!(tip, None); + } +} diff --git a/runtime/bifrost-paseo/src/evm/mod.rs b/runtime/bifrost-paseo/src/evm/mod.rs new file mode 100644 index 0000000000..a6e508c2ed --- /dev/null +++ b/runtime/bifrost-paseo/src/evm/mod.rs @@ -0,0 +1,152 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +use frame_support::{pallet_prelude::Get, parameter_types, traits::FindAuthor, ConsensusEngineId}; +use orml_tokens::CurrencyAdapter; +use pallet_ethereum::PostLogContent; +use pallet_evm::EnsureAddressTruncated; +use primitive_types::U256; + +pub use crate::evm::accounts_conversion::{ExtendedAddressMapping, FindAuthorTruncated}; +use crate::{ + evm::runner::{FeeAssetBalanceInCurrency, WrapRunner}, + governance::TechAdminOrCouncil, + Aura, ConstU32, DynamicFee, EVMChainId, Runtime, RuntimeEvent, Timestamp, Weight, EVM, + MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, WEIGHT_REF_TIME_PER_SECOND, +}; +use bifrost_primitives::{currency::WETH, CurrencyId}; + +mod accounts_conversion; +mod evm_fee; +pub mod permit; +pub mod precompiles; +mod runner; + +// Current approximation of the gas per second consumption considering +// EVM execution over compiled WASM (on 4.4Ghz CPU). +// Given the 500ms Weight, from which 75% only are used for transactions, +// the total EVM execution gas limit is: GAS_PER_SECOND * 0.500 * 0.75 ~= +// 15_000_000. +pub const GAS_PER_SECOND: u64 = 40_000_000; +// Approximate ratio of the amount of Weight per Gas. +const WEIGHT_PER_GAS: u64 = WEIGHT_REF_TIME_PER_SECOND / GAS_PER_SECOND; + +parameter_types! { + // We allow for a 75% fullness of a 0.5s block + pub BlockGasLimit: U256 = U256::from(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT.ref_time() / +WEIGHT_PER_GAS); + pub PrecompilesValue: precompiles::BifrostPrecompiles = +precompiles::BifrostPrecompiles::<_>::new(); + pub WeightPerGas: Weight = Weight::from_parts(WEIGHT_PER_GAS, 0); +} + +pub struct WethAssetId; +impl Get for WethAssetId { + fn get() -> CurrencyId { + WETH + } +} + +type WethCurrency = CurrencyAdapter; + +parameter_types! { + /// The amount of gas per pov. A ratio of 4 if we convert ref_time to gas and we compare + /// it with the pov_size for a block. E.g. + /// ceil( + /// (max_extrinsic.ref_time() / max_extrinsic.proof_size()) / WEIGHT_PER_GAS + /// ) + pub const GasLimitPovSizeRatio: u64 = 4; + /// The amount of gas per storage (in bytes): BLOCK_GAS_LIMIT / BLOCK_STORAGE_LIMIT + /// The current definition of BLOCK_STORAGE_LIMIT is 40 KB, resulting in a value of 366. + pub GasLimitStorageGrowthRatio: u64 = 366; + + pub const SuicideQuickClearLimit: u32 = 0; +} + +impl pallet_evm::Config for Runtime { + type FeeCalculator = DynamicFee; + type GasWeightMapping = pallet_evm::FixedGasWeightMapping; + type WeightPerGas = WeightPerGas; + type BlockHashMapping = pallet_ethereum::EthereumBlockHashMapping; + type CallOrigin = EnsureAddressTruncated; + type WithdrawOrigin = EnsureAddressTruncated; + type AddressMapping = ExtendedAddressMapping; + type Currency = WethCurrency; + type RuntimeEvent = RuntimeEvent; + type PrecompilesType = precompiles::BifrostPrecompiles; + type PrecompilesValue = PrecompilesValue; + type ChainId = EVMChainId; + type BlockGasLimit = BlockGasLimit; + type Runner = WrapRunner< + Self, + pallet_evm::runner::stack::Runner, // Evm runner that we wrap + FeeAssetBalanceInCurrency< + Runtime, + crate::Prices, // Price provider + crate::FlexibleFee, // Get account's fee payment asset + crate::Currencies, // Account balance inspector + >, + >; + type OnChargeTransaction = evm_fee::TransferEvmFees< + crate::FlexibleFee, // Get account's fee payment asset + crate::Currencies, // Multi currency support + crate::Prices, // Price provider + >; + type OnCreate = (); + type FindAuthor = FindAuthorTruncated; + type GasLimitPovSizeRatio = GasLimitPovSizeRatio; + type SuicideQuickClearLimit = SuicideQuickClearLimit; + type Timestamp = Timestamp; + type WeightInfo = pallet_evm::weights::SubstrateWeight; +} + +impl pallet_evm_chain_id::Config for Runtime {} + +parameter_types! { + pub const PostBlockAndTxnHashes: PostLogContent = PostLogContent::BlockAndTxnHashes; +} + +impl pallet_ethereum::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type StateRoot = pallet_ethereum::IntermediateStateRoot; + type PostLogContent = PostBlockAndTxnHashes; + type ExtraDataLength = ConstU32<30>; +} + +pub struct EvmNonceProvider; +impl pallet_evm_accounts::EvmNonceProvider for EvmNonceProvider { + fn get_nonce(evm_address: sp_core::H160) -> U256 { + EVM::account_basic(&evm_address).0.nonce + } +} + +impl pallet_evm_accounts::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type FeeMultiplier = ConstU32<50>; + type EvmNonceProvider = EvmNonceProvider; + type ControllerOrigin = TechAdminOrCouncil; + type WeightInfo = (); +} + +parameter_types! { + pub BoundDivision: U256 = U256::from(1024); +} + +impl pallet_dynamic_fee::Config for Runtime { + type MinGasPriceBoundDivisor = BoundDivision; +} diff --git a/runtime/bifrost-paseo/src/evm/permit.rs b/runtime/bifrost-paseo/src/evm/permit.rs new file mode 100644 index 0000000000..6a48213208 --- /dev/null +++ b/runtime/bifrost-paseo/src/evm/permit.rs @@ -0,0 +1,213 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +use crate::{evm::precompiles, ExtrinsicBaseWeight, Runtime}; +use bifrost_primitives::{AccountId, EvmPermit}; +use evm::ExitReason; +use fp_evm::FeeCalculator; +use frame_support::{ + dispatch::{DispatchErrorWithPostInfo, Pays, PostDispatchInfo, RawOrigin}, + ensure, + pallet_prelude::DispatchResultWithPostInfo, + traits::Time, +}; +use pallet_evm::{AddressMapping, GasWeightMapping, Runner}; +use pallet_evm_precompile_call_permit::NoncesStorage; +use primitive_types::{H160, H256, U256}; +use sp_core::crypto::AccountId32; +use sp_io::hashing::keccak_256; +use sp_runtime::{ + traits::{One, UniqueSaturatedInto}, + DispatchResult, +}; +use sp_std::vec::Vec; +use xcm::prelude::Weight; + +pub struct EvmPermitHandler(sp_std::marker::PhantomData); + +impl EvmPermit for EvmPermitHandler +where + R: frame_system::Config + + pallet_evm::Config + + bifrost_flexible_fee::Config + + pallet_tx_pause::Config + + pallet_evm_accounts::Config, + R::Nonce: Into, + AccountId: From, + R::AccountId: AsRef<[u8; 32]> + frame_support::traits::IsType, +{ + fn validate_permit( + source: H160, + target: H160, + data: Vec, + value: U256, + gas_limit: u64, + deadline: U256, + v: u8, + r: H256, + s: H256, + ) -> DispatchResult { + let account_nonce = NoncesStorage::get(source); + + let permit = pallet_evm_precompile_call_permit::CallPermitPrecompile::::generate_permit( + precompiles::CALLPERMIT, + source, + target, + value, + data, + gas_limit, + account_nonce, + deadline, + ); + + // Blockchain time is in ms while Ethereum use second timestamps. + let timestamp: u128 = ::Timestamp::now().unique_saturated_into(); + let timestamp: U256 = U256::from(timestamp / 1000); + + ensure!( + deadline >= timestamp, + bifrost_flexible_fee::Error::::EvmPermitExpired + ); + + let mut sig = [0u8; 65]; + sig[0..32].copy_from_slice(r.as_bytes()); + sig[32..64].copy_from_slice(s.as_bytes()); + sig[64] = v; + let signer = sp_io::crypto::secp256k1_ecdsa_recover(&sig, &permit) + .map_err(|_| bifrost_flexible_fee::Error::::EvmPermitInvalid)?; + let signer = H160::from(H256::from_slice(keccak_256(&signer).as_slice())); + ensure!( + signer != H160::zero() && signer == source, + bifrost_flexible_fee::Error::::EvmPermitInvalid + ); + + Ok(()) + } + + fn dispatch_permit( + source: H160, + target: H160, + data: Vec, + value: U256, + gas_limit: u64, + max_fee_per_gas: U256, + max_priority_fee_per_gas: Option, + _nonce: Option, + access_list: Vec<(H160, Vec)>, + ) -> DispatchResultWithPostInfo { + // Dispatching permit should not increase account nonce, as TX is not signed by the account. + // Therefore, we need to manually reset it back to current value after execution. + let account_id = ::AddressMapping::into_account_id(source); + let source_nonce = frame_system::Account::::get(&account_id).nonce; + + let is_transactional = true; + let validate = true; + let info = match ::Runner::call( + source, + target, + data, + value, + gas_limit, + Some(max_fee_per_gas), + max_priority_fee_per_gas, + None, + access_list, + is_transactional, + validate, + None, + None, + ::config(), + ) { + Ok(info) => info, + Err(e) => { + return Err(DispatchErrorWithPostInfo { + post_info: PostDispatchInfo { + actual_weight: Some(e.weight), + pays_fee: Pays::Yes, + }, + error: bifrost_flexible_fee::Error::::EvmPermitRunnerError.into(), + }) + } + }; + let account_source_nonce = frame_system::Account::::get(&account_id).nonce; + debug_assert_eq!( + account_source_nonce, + source_nonce + ::Nonce::one() + ); + frame_system::Account::::mutate(account_id, |a| { + a.nonce -= ::Nonce::one() + }); + + let permit_nonce = NoncesStorage::get(source); + NoncesStorage::insert(source, permit_nonce + U256::one()); + + let mut gas_to_weight = ::GasWeightMapping::gas_to_weight( + info.used_gas.standard.unique_saturated_into(), + true, + ); + if let Some(weight_info) = info.weight_info { + if let Some(proof_size_usage) = weight_info.proof_size_usage { + *gas_to_weight.proof_size_mut() = proof_size_usage; + } + } + let actual_weight = gas_to_weight; + let post_info = PostDispatchInfo { + actual_weight: Some(actual_weight), + pays_fee: Pays::No, + }; + + match info.exit_reason { + ExitReason::Succeed(_) => Ok(post_info), + _ => Err(DispatchErrorWithPostInfo { + post_info, + error: bifrost_flexible_fee::Error::::EvmPermitCallExecutionError.into(), + }), + } + } + + fn gas_price() -> (U256, Weight) { + ::FeeCalculator::min_gas_price() + } + + fn dispatch_weight(gas_limit: u64) -> Weight { + let without_base_extrinsic_weight = true; + let weight = ::GasWeightMapping::gas_to_weight( + gas_limit, + without_base_extrinsic_weight, + ); + + // As GasWeightMapping implementation does not include/exclude the weight-with-swap (only + // the frame_system::constants::ExtrinsicBaseWeight) therefore we need to add it manually + // here + weight.saturating_add(ExtrinsicBaseWeight::get()) + } + + fn permit_nonce(account: H160) -> U256 { + NoncesStorage::get(account) + } + + fn on_dispatch_permit_error() { + let _ = pallet_tx_pause::Pallet::::pause( + RawOrigin::Root.into(), + ( + b"FlexibleFee".to_vec().try_into().expect("FlexibleFee"), + b"dispatch_permit".to_vec().try_into().expect("FlexibleFee"), + ), + ); + } +} diff --git a/runtime/bifrost-paseo/src/evm/precompiles/costs.rs b/runtime/bifrost-paseo/src/evm/precompiles/costs.rs new file mode 100644 index 0000000000..980909b166 --- /dev/null +++ b/runtime/bifrost-paseo/src/evm/precompiles/costs.rs @@ -0,0 +1,51 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +//! Cost calculations. +use crate::evm::precompiles::EvmResult; +use pallet_evm::{ExitError, PrecompileFailure}; + +// Cost calculation is copied from EVM code that is not publicly exposed by the crates. +// https://github.com/rust-blockchain/evm/blob/master/gasometer/src/costs.rs#L148 +pub fn log_costs(topics: usize, data_len: usize) -> EvmResult { + const G_LOG: u64 = 375; + const G_LOGDATA: u64 = 8; + const G_LOGTOPIC: u64 = 375; + + let topic_cost = G_LOGTOPIC + .checked_mul(topics as u64) + .ok_or(PrecompileFailure::Error { + exit_status: ExitError::OutOfGas, + })?; + + let data_cost = G_LOGDATA + .checked_mul(data_len as u64) + .ok_or(PrecompileFailure::Error { + exit_status: ExitError::OutOfGas, + })?; + + G_LOG + .checked_add(topic_cost) + .ok_or(PrecompileFailure::Error { + exit_status: ExitError::OutOfGas, + })? + .checked_add(data_cost) + .ok_or(PrecompileFailure::Error { + exit_status: ExitError::OutOfGas, + }) +} diff --git a/runtime/bifrost-paseo/src/evm/precompiles/erc20_mapping.rs b/runtime/bifrost-paseo/src/evm/precompiles/erc20_mapping.rs new file mode 100644 index 0000000000..dcce6f1980 --- /dev/null +++ b/runtime/bifrost-paseo/src/evm/precompiles/erc20_mapping.rs @@ -0,0 +1,80 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#![allow(dead_code)] +use crate::evm::precompiles::EvmAddress; +use bifrost_primitives::CurrencyId; +use parity_scale_codec::{Decode, Encode}; +use primitive_types::H160; + +pub const CURRENCY_PRECOMPILE_ADDRESS_PREFIX: &[u8] = &[255u8; 4]; + +/// A mapping between AssetId and Erc20 EVM address. +pub trait Erc20Mapping { + fn encode_evm_address(currency_id: CurrencyId) -> Option; + + fn decode_evm_address(evm_address: EvmAddress) -> Option; +} + +pub struct BifrostErc20Mapping; + +/// Erc20Mapping logic for HydraDX +/// The asset id (with type u32) is encoded in the last 4 bytes of EVM address +impl Erc20Mapping for BifrostErc20Mapping { + fn encode_evm_address(currency_id: CurrencyId) -> Option { + let asset_id_bytes = currency_id.encode(); + + let mut evm_address_bytes = [0u8; 20]; + + evm_address_bytes[0..4].copy_from_slice(CURRENCY_PRECOMPILE_ADDRESS_PREFIX); + match currency_id { + CurrencyId::VSBond(..) | CurrencyId::VSBond2(..) => { + evm_address_bytes[6..].copy_from_slice(asset_id_bytes.as_slice()) + } + CurrencyId::LPToken(..) => { + evm_address_bytes[15..].copy_from_slice(asset_id_bytes.as_slice()) + } + _ => evm_address_bytes[18..].copy_from_slice(asset_id_bytes.as_slice()), + }; + + Some(EvmAddress::from(evm_address_bytes)) + } + + fn decode_evm_address(evm_address: EvmAddress) -> Option { + if !is_asset_address(evm_address) { + return None; + } + + let mut currency_id = &evm_address.to_fixed_bytes()[6..]; + if !currency_id.to_vec().starts_with(&[0, 0]) { + return CurrencyId::decode(&mut currency_id).ok(); + }; + + let mut currency_id = &evm_address.to_fixed_bytes()[15..]; + if !currency_id.to_vec().starts_with(&[0, 0]) { + return CurrencyId::decode(&mut currency_id).ok(); + }; + + let mut currency_id = &evm_address.to_fixed_bytes()[18..]; + CurrencyId::decode(&mut currency_id).ok() + } +} + +pub fn is_asset_address(address: H160) -> bool { + &address.to_fixed_bytes()[0..4] == CURRENCY_PRECOMPILE_ADDRESS_PREFIX +} diff --git a/runtime/bifrost-paseo/src/evm/precompiles/handle.rs b/runtime/bifrost-paseo/src/evm/precompiles/handle.rs new file mode 100644 index 0000000000..aaab253d75 --- /dev/null +++ b/runtime/bifrost-paseo/src/evm/precompiles/handle.rs @@ -0,0 +1,482 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#![allow(dead_code)] +use crate::evm::precompiles::{costs, revert, Address, Bytes, EvmResult}; +use pallet_evm::{Context, Log, PrecompileHandle}; +use primitive_types::{H160, H256, U256}; +use smallvec::alloc; +use sp_std::{borrow::ToOwned, vec, vec::Vec}; + +/// Wrapper around an EVM input slice, helping to parse it. +/// Provide functions to parse common types. +#[derive(Clone, Copy, Debug)] +pub struct EvmDataReader<'a> { + input: &'a [u8], + cursor: usize, +} + +#[derive(Clone, Debug)] +pub struct EvmDataWriter { + pub(crate) data: Vec, + offset_data: Vec, + selector: Option, +} + +impl EvmDataWriter { + /// Creates a new empty output builder (without selector). + pub fn new() -> Self { + Self { + data: vec![], + offset_data: vec![], + selector: None, + } + } + + /// Return the built data. + pub fn build(mut self) -> Vec { + Self::bake_offsets(&mut self.data, self.offset_data); + + if let Some(selector) = self.selector { + let mut output = selector.to_be_bytes().to_vec(); + output.append(&mut self.data); + output + } else { + self.data + } + } + + /// Add offseted data at the end of this writer's data, updating the offsets. + fn bake_offsets(output: &mut Vec, offsets: Vec) { + for mut offset_datum in offsets { + let offset_position = offset_datum.offset_position; + let offset_position_end = offset_position + 32; + + // The offset is the distance between the start of the data and the + // start of the pointed data (start of a struct, length of an array). + // Offsets in inner data are relative to the start of their respective "container". + // However in arrays the "container" is actually the item itself instead of the whole + // array, which is corrected by `offset_shift`. + let free_space_offset = output.len() - offset_datum.offset_shift; + + // Override dummy offset to the offset it will be in the final output. + U256::from(free_space_offset) + .to_big_endian(&mut output[offset_position..offset_position_end]); + + // Append this data at the end of the current output. + output.append(&mut offset_datum.data); + } + } + + /// Write arbitrary bytes. + /// Doesn't handle any alignement checks, prefer using `write` instead if possible. + fn write_raw_bytes(mut self, value: &[u8]) -> Self { + self.data.extend_from_slice(value); + self + } + + /// Write data of requested type. + pub fn write(mut self, value: T) -> Self { + T::write(&mut self, value); + self + } + + /// Writes a pointer to given data. + /// The data will be appended when calling `build`. + /// Initially write a dummy value as offset in this writer's data, which will be replaced by + /// the correct offset once the pointed data is appended. + /// + /// Takes `&mut self` since its goal is to be used inside `EvmData` impl and not in chains. + pub fn write_pointer(&mut self, data: Vec) { + let offset_position = self.data.len(); + H256::write(self, H256::repeat_byte(0xff)); + + self.offset_data.push(OffsetDatum { + offset_position, + data, + offset_shift: 0, + }); + } +} + +impl Default for EvmDataWriter { + fn default() -> Self { + Self::new() + } +} + +#[derive(Clone, Debug)] +struct OffsetDatum { + // Offset location in the container data. + offset_position: usize, + // Data pointed by the offset that must be inserted at the end of container data. + data: Vec, + // Inside of arrays, the offset is not from the start of array data (length), but from the + // start of the item. This shift allow to correct this. + offset_shift: usize, +} + +/// Data that can be converted from and to EVM data types. +pub trait EvmData: Sized { + fn read(reader: &mut EvmDataReader) -> EvmResult; + fn write(writer: &mut EvmDataWriter, value: Self); + fn has_static_size() -> bool; +} + +impl EvmData for U256 { + fn read(reader: &mut EvmDataReader) -> EvmResult { + let range = reader.move_cursor(32)?; + + let data = reader + .input + .get(range) + .ok_or_else(|| revert("tried to parse U256 out of bounds"))?; + + Ok(U256::from_big_endian(data)) + } + + fn write(writer: &mut EvmDataWriter, value: Self) { + let mut buffer = [0u8; 32]; + value.to_big_endian(&mut buffer); + writer.data.extend_from_slice(&buffer); + } + + fn has_static_size() -> bool { + true + } +} + +impl EvmData for H256 { + fn read(reader: &mut EvmDataReader) -> EvmResult { + let range = reader.move_cursor(32)?; + + let data = reader + .input + .get(range) + .ok_or_else(|| revert("tried to parse H256 out of bounds"))?; + + Ok(H256::from_slice(data)) + } + + fn write(writer: &mut EvmDataWriter, value: Self) { + writer.data.extend_from_slice(value.as_bytes()); + } + + fn has_static_size() -> bool { + true + } +} + +impl EvmData for Bytes { + fn read(reader: &mut EvmDataReader) -> EvmResult { + let mut inner_reader = reader.read_pointer()?; + + // Read bytes/string size. + let array_size: usize = inner_reader + .read::() + .map_err(|_| revert("tried to parse bytes/string length out of bounds"))? + .try_into() + .map_err(|_| revert("bytes/string length is too large"))?; + + // Get valid range over the bytes data. + let range = inner_reader.move_cursor(array_size)?; + + let data = inner_reader + .input + .get(range) + .ok_or_else(|| revert("tried to parse bytes/string out of bounds"))?; + + let bytes = Self(data.to_owned()); + + Ok(bytes) + } + + fn write(writer: &mut EvmDataWriter, value: Self) { + let length = value.0.len(); + + // Pad the data. + // Leave it as is if a multiple of 32, otherwise pad to next + // multiple or 32. + let chunks = length / 32; + let padded_size = match length % 32 { + 0 => chunks * 32, + _ => (chunks + 1) * 32, + }; + + let mut value = value.0.to_vec(); + value.resize(padded_size, 0); + + writer.write_pointer( + EvmDataWriter::new() + .write(U256::from(length)) + .write_raw_bytes(&value) + .build(), + ); + } + + fn has_static_size() -> bool { + false + } +} + +impl EvmData for Address { + fn read(reader: &mut EvmDataReader) -> EvmResult { + let range = reader.move_cursor(32)?; + + let data = reader + .input + .get(range) + .ok_or_else(|| revert("tried to parse H160 out of bounds"))?; + + Ok(H160::from_slice(&data[12..32]).into()) + } + + fn write(writer: &mut EvmDataWriter, value: Self) { + H256::write(writer, value.0.into()); + } + + fn has_static_size() -> bool { + true + } +} + +macro_rules! impl_evmdata_for_uints { + ($($uint:ty, )*) => { + $( + impl EvmData for $uint { + fn read(reader: &mut EvmDataReader) -> EvmResult { + let value256: U256 = reader.read()?; + + value256 + .try_into() + .map_err(|_| revert(alloc::format!( + "value too big for type", + ))) + } + + fn write(writer: &mut EvmDataWriter, value: Self) { + U256::write(writer, value.into()); + } + + fn has_static_size() -> bool { + true + } + } + )* + }; +} + +impl_evmdata_for_uints!(u8, u16, u32, u64, u128,); + +impl EvmData for bool { + fn read(reader: &mut EvmDataReader) -> EvmResult { + let h256 = H256::read(reader).map_err(|_| revert("tried to parse bool out of bounds"))?; + + Ok(!h256.is_zero()) + } + + fn write(writer: &mut EvmDataWriter, value: Self) { + let mut buffer = [0u8; 32]; + if value { + buffer[31] = 1; + } + + writer.data.extend_from_slice(&buffer); + } + + fn has_static_size() -> bool { + true + } +} + +impl<'a> EvmDataReader<'a> { + /// Create a new input parser. + pub fn new(input: &'a [u8]) -> Self { + Self { input, cursor: 0 } + } + + /// Create a new input parser from a selector-initial input. + pub fn read_selector(input: &'a [u8]) -> EvmResult + where + T: num_enum::TryFromPrimitive, + { + if input.len() < 4 { + return Err(revert("tried to parse selector out of bounds")); + } + + let mut buffer = [0u8; 4]; + buffer.copy_from_slice(&input[0..4]); + let selector = T::try_from_primitive(u32::from_be_bytes(buffer)).map_err(|_| { + log::trace!( + target: "precompile-utils", + "Failed to match function selector" + //TODO: add type in log + ); + revert("unknown selector") + })?; + + Ok(selector) + } + + /// Create a new input parser from a selector-initial input. + pub fn new_skip_selector(input: &'a [u8]) -> EvmResult { + if input.len() < 4 { + return Err(revert("input is too short")); + } + + Ok(Self::new(&input[4..])) + } + + /// Check the input has at least the correct amount of arguments before the end (32 bytes + /// values). + pub fn expect_arguments(&self, args: usize) -> EvmResult { + if self.input.len() >= self.cursor + args * 32 { + Ok(()) + } else { + Err(revert("input doesn't match expected length")) + } + } + + /// Read data from the input. + pub fn read(&mut self) -> EvmResult { + T::read(self) + } + + /// Reads a pointer, returning a reader targetting the pointed location. + pub fn read_pointer(&mut self) -> EvmResult { + let offset: usize = self + .read::() + .map_err(|_| revert("tried to parse array offset out of bounds"))? + .try_into() + .map_err(|_| revert("array offset is too large"))?; + + if offset >= self.input.len() { + return Err(revert("pointer points out of bounds")); + } + + Ok(Self { + input: &self.input[offset..], + cursor: 0, + }) + } + + /// Move the reading cursor with provided length, and return a range from the previous cursor + /// location to the new one. + /// Checks cursor overflows. + fn move_cursor(&mut self, len: usize) -> EvmResult> { + let start = self.cursor; + let end = self + .cursor + .checked_add(len) + .ok_or_else(|| revert("data reading cursor overflow"))?; + + self.cursor = end; + + Ok(start..end) + } +} + +/// Represents modifiers a Solidity function can be annotated with. +#[derive(Copy, Clone, PartialEq, Eq)] +pub enum FunctionModifier { + /// Function that doesn't modify the state. + View, + /// Function that modifies the state but refuse receiving funds. + /// Correspond to a Solidity function with no modifiers. + NonPayable, + /// Function that modifies the state and accept funds. + Payable, +} + +pub trait PrecompileHandleExt: PrecompileHandle { + /// Record cost of a log manually. + /// This can be useful to record log costs early when their content have static size. + fn record_log_costs_manual(&mut self, topics: usize, data_len: usize) -> EvmResult; + + /// Record cost of logs. + fn record_log_costs(&mut self, logs: &[&Log]) -> EvmResult; + + /// Check that a function call is compatible with the context it is + /// called into. + fn check_function_modifier(&self, modifier: FunctionModifier) -> EvmResult; + + /// Read the selector from the input data. + fn read_selector(&self) -> EvmResult + where + T: num_enum::TryFromPrimitive; + + /// Returns a reader of the input, skipping the selector. + fn read_input(&self) -> EvmResult; +} + +impl PrecompileHandleExt for T { + /// Record cost of a log manualy. + /// This can be useful to record log costs early when their content have static size. + fn record_log_costs_manual(&mut self, topics: usize, data_len: usize) -> EvmResult { + self.record_cost(costs::log_costs(topics, data_len)?)?; + + Ok(()) + } + + /// Record cost of logs. + fn record_log_costs(&mut self, logs: &[&Log]) -> EvmResult { + for log in logs { + self.record_log_costs_manual(log.topics.len(), log.data.len())?; + } + + Ok(()) + } + + /// Check that a function call is compatible with the context it is + /// called into. + fn check_function_modifier(&self, modifier: FunctionModifier) -> EvmResult { + check_function_modifier(self.context(), self.is_static(), modifier) + } + + /// Read the selector from the input data. + fn read_selector(&self) -> EvmResult + where + S: num_enum::TryFromPrimitive, + { + let input = self.input(); + EvmDataReader::read_selector(input) + } + + /// Returns a reader of the input, skipping the selector. + fn read_input(&self) -> EvmResult { + EvmDataReader::new_skip_selector(self.input()) + } +} + +/// Check that a function call is compatible with the context it is +/// called into. +pub fn check_function_modifier( + context: &Context, + is_static: bool, + modifier: FunctionModifier, +) -> EvmResult { + if is_static && modifier != FunctionModifier::View { + return Err(revert("can't call non-static function in static context")); + } + + if modifier != FunctionModifier::Payable && context.apparent_value > U256::zero() { + return Err(revert("function is not payable")); + } + + Ok(()) +} diff --git a/runtime/bifrost-paseo/src/evm/precompiles/mod.rs b/runtime/bifrost-paseo/src/evm/precompiles/mod.rs new file mode 100644 index 0000000000..4180c12965 --- /dev/null +++ b/runtime/bifrost-paseo/src/evm/precompiles/mod.rs @@ -0,0 +1,238 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +use core::marker::PhantomData; + +use crate::evm::precompiles::{ + erc20_mapping::is_asset_address, multicurrency::MultiCurrencyPrecompile, +}; +use ethabi::Token; +use frame_support::dispatch::{GetDispatchInfo, PostDispatchInfo}; +use hex_literal::hex; +use pallet_evm::{ + ExitRevert, ExitSucceed, IsPrecompileResult, Precompile, PrecompileFailure, PrecompileHandle, + PrecompileOutput, PrecompileResult, PrecompileSet, +}; +use pallet_evm_precompile_blake2::Blake2F; +use pallet_evm_precompile_bn128::{Bn128Add, Bn128Mul, Bn128Pairing}; +use pallet_evm_precompile_modexp::Modexp; +use pallet_evm_precompile_simple::{ECRecover, Identity, Ripemd160, Sha256}; +use parity_scale_codec::Decode; +use primitive_types::{H160, U256}; +use sp_runtime::traits::Dispatchable; +use sp_std::{borrow::ToOwned, vec::Vec}; + +pub mod costs; +pub mod erc20_mapping; +pub mod handle; +pub mod multicurrency; +pub mod substrate; + +pub type EvmResult = Result; + +#[cfg(test)] +mod tests; + +pub type EvmAddress = H160; + +/// The `address` type of Solidity. +/// H160 could represent 2 types of data (bytes20 and address) that are not encoded the same way. +/// To avoid issues writing H160 is thus not supported. +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub struct Address(pub H160); + +impl From for Address { + fn from(a: H160) -> Address { + Address(a) + } +} + +impl From
for H160 { + fn from(a: Address) -> H160 { + a.0 + } +} + +pub struct BifrostPrecompiles(PhantomData); + +impl BifrostPrecompiles { + #[allow(clippy::new_without_default)] // We'll never use Default and can't derive it. + pub fn new() -> Self { + Self(Default::default()) + } +} + +// Same as Moonbean and Centrifuge, should benefit interoperability +// See also +// https://docs.moonbeam.network/builders/pallets-precompiles/precompiles/overview/#precompiled-contract-addresses +const DISPATCH_ADDR: H160 = addr(1025); + +pub const ECRECOVER: H160 = H160(hex!("0000000000000000000000000000000000000001")); +pub const SHA256: H160 = H160(hex!("0000000000000000000000000000000000000002")); +pub const RIPEMD: H160 = H160(hex!("0000000000000000000000000000000000000003")); +pub const IDENTITY: H160 = H160(hex!("0000000000000000000000000000000000000004")); +pub const MODEXP: H160 = H160(hex!("0000000000000000000000000000000000000005")); +pub const BN_ADD: H160 = H160(hex!("0000000000000000000000000000000000000006")); +pub const BN_MUL: H160 = H160(hex!("0000000000000000000000000000000000000007")); +pub const BN_PAIRING: H160 = H160(hex!("0000000000000000000000000000000000000008")); +pub const BLAKE2F: H160 = H160(hex!("0000000000000000000000000000000000000009")); +pub const CALLPERMIT: H160 = H160(hex!("000000000000000000000000000000000000080a")); + +pub const ETH_PRECOMPILE_END: H160 = BLAKE2F; + +fn is_standard_precompile(address: H160) -> bool { + !address.is_zero() && address <= ETH_PRECOMPILE_END +} + +impl PrecompileSet for BifrostPrecompiles +where + R: pallet_evm::Config + bifrost_currencies::Config, + R::RuntimeCall: Dispatchable + GetDispatchInfo + Decode, + ::RuntimeOrigin: From>, + MultiCurrencyPrecompile: Precompile, +{ + fn execute(&self, handle: &mut impl PrecompileHandle) -> Option { + let context = handle.context(); + let address = handle.code_address(); + + // Filter known precompile addresses except Ethereum officials + if address > ETH_PRECOMPILE_END && context.address != address { + return Some(Err(PrecompileFailure::Revert { + exit_status: ExitRevert::Reverted, + output: "cannot be called with DELEGATECALL or CALLCODE".into(), + })); + } + + if address == ECRECOVER { + Some(ECRecover::execute(handle)) + } else if address == SHA256 { + Some(Sha256::execute(handle)) + } else if address == RIPEMD { + Some(Ripemd160::execute(handle)) + } else if address == IDENTITY { + Some(Identity::execute(handle)) + } else if address == MODEXP { + Some(Modexp::execute(handle)) + } else if address == BN_ADD { + Some(Bn128Add::execute(handle)) + } else if address == BN_MUL { + Some(Bn128Mul::execute(handle)) + } else if address == BN_PAIRING { + Some(Bn128Pairing::execute(handle)) + } else if address == BLAKE2F { + Some(Blake2F::execute(handle)) + } else if address == CALLPERMIT { + Some(pallet_evm_precompile_call_permit::CallPermitPrecompile::::execute(handle)) + } else if address == DISPATCH_ADDR { + Some(pallet_evm_precompile_dispatch::Dispatch::::execute( + handle, + )) + } else if is_asset_address(address) { + Some(MultiCurrencyPrecompile::::execute(handle)) + } else { + None + } + } + + fn is_precompile(&self, address: H160, _remaining_gas: u64) -> IsPrecompileResult { + let is_precompile = address == DISPATCH_ADDR + || is_asset_address(address) + || is_standard_precompile(address); + IsPrecompileResult::Answer { + is_precompile, + extra_cost: 0, + } + } +} + +// This is a reimplementation of the upstream u64->H160 conversion +// function, made `const` to make our precompile address `const`s a +// bit cleaner. It can be removed when upstream has a const conversion +// function. +pub const fn addr(a: u64) -> H160 { + let b = a.to_be_bytes(); + H160([ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7], + ]) +} + +pub fn revert(output: impl AsRef<[u8]>) -> PrecompileFailure { + PrecompileFailure::Revert { + exit_status: ExitRevert::Reverted, + output: output.as_ref().to_owned(), + } +} + +pub fn succeed(output: impl AsRef<[u8]>) -> PrecompileOutput { + PrecompileOutput { + exit_status: ExitSucceed::Returned, + output: output.as_ref().to_owned(), + } +} + +pub struct Output; + +impl Output { + pub fn encode_uint(b: T) -> Vec + where + U256: From, + { + ethabi::encode(&[Token::Uint(U256::from(b))]) + } + + pub fn encode_bytes(b: &[u8]) -> Vec { + ethabi::encode(&[Token::Bytes(b.to_vec())]) + } +} + +/// The `bytes`/`string` type of Solidity. +/// It is different from `Vec` which will be serialized with padding for each `u8` element +/// of the array, while `Bytes` is tightly packed. +#[derive(Clone, Debug, Eq, PartialEq)] +pub struct Bytes(pub Vec); + +impl Bytes { + /// Interpret as `bytes`. + pub fn as_bytes(&self) -> &[u8] { + &self.0 + } + + /// Interpret as `string`. + /// Can fail if the string is not valid UTF8. + pub fn as_str(&self) -> Result<&str, sp_std::str::Utf8Error> { + sp_std::str::from_utf8(&self.0) + } +} + +impl From<&[u8]> for Bytes { + fn from(a: &[u8]) -> Self { + Self(a.to_owned()) + } +} + +impl From<&str> for Bytes { + fn from(a: &str) -> Self { + a.as_bytes().into() + } +} + +impl From for Vec { + fn from(val: Bytes) -> Self { + val.0 + } +} diff --git a/runtime/bifrost-paseo/src/evm/precompiles/multicurrency.rs b/runtime/bifrost-paseo/src/evm/precompiles/multicurrency.rs new file mode 100644 index 0000000000..5c2c99e44a --- /dev/null +++ b/runtime/bifrost-paseo/src/evm/precompiles/multicurrency.rs @@ -0,0 +1,244 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +use crate::{ + evm::{ + precompiles::{ + erc20_mapping::{BifrostErc20Mapping, Erc20Mapping}, + handle::{EvmDataWriter, FunctionModifier, PrecompileHandleExt}, + substrate::RuntimeHelper, + succeed, Address, Output, + }, + ExtendedAddressMapping, + }, + Currencies, +}; +use bifrost_asset_registry::AssetIdMaps; +use bifrost_primitives::{Balance, CurrencyId, CurrencyIdMapping}; +use frame_support::traits::OriginTrait; +use num_enum::{IntoPrimitive, TryFromPrimitive}; +use orml_traits::{MultiCurrency as MultiCurrencyT, MultiCurrency}; +use pallet_evm::{ + AddressMapping, ExitRevert, Precompile, PrecompileFailure, PrecompileHandle, PrecompileResult, +}; +use primitive_types::H160; +use sp_runtime::{traits::Dispatchable, RuntimeDebug}; +use sp_std::{marker::PhantomData, prelude::*}; + +#[module_evm_utility_macro::generate_function_selector] +#[derive(RuntimeDebug, Eq, PartialEq, TryFromPrimitive, IntoPrimitive)] +#[repr(u32)] +pub enum Action { + Name = "name()", + Symbol = "symbol()", + Decimals = "decimals()", + TotalSupply = "totalSupply()", + BalanceOf = "balanceOf(address)", + Allowance = "allowance(address,address)", + Transfer = "transfer(address,uint256)", + Approve = "approve(address,uint256)", + TransferFrom = "transferFrom(address,address,uint256)", +} +pub struct MultiCurrencyPrecompile(PhantomData); + +impl Precompile for MultiCurrencyPrecompile +where + Runtime: frame_system::Config + + pallet_evm::Config + + bifrost_asset_registry::Config + + bifrost_currencies::Config, + <::RuntimeCall as Dispatchable>::RuntimeOrigin: OriginTrait, + Currencies: MultiCurrency, + bifrost_currencies::Pallet: + MultiCurrency, + ::AccountId: core::convert::From, + <::RuntimeCall as Dispatchable>::RuntimeOrigin: OriginTrait, +{ + fn execute(handle: &mut impl PrecompileHandle) -> pallet_evm::PrecompileResult { + let address = handle.code_address(); + if let Some(asset_id) = BifrostErc20Mapping::decode_evm_address(address) { + log::debug!(target: "evm", "multicurrency: currency id: {:?}", asset_id); + + let selector = match handle.read_selector() { + Ok(selector) => selector, + Err(e) => return Err(e), + }; + + handle.check_function_modifier(match selector { + Action::Transfer => FunctionModifier::NonPayable, + _ => FunctionModifier::View, + })?; + + return match selector { + Action::Name => Self::name(asset_id, handle), + Action::Symbol => Self::symbol(asset_id, handle), + Action::Decimals => Self::decimals(asset_id, handle), + Action::TotalSupply => Self::total_supply(asset_id, handle), + Action::BalanceOf => Self::balance_of(asset_id, handle), + Action::Transfer => Self::transfer(asset_id, handle), + Action::Allowance => Self::not_supported(asset_id, handle), + Action::Approve => Self::not_supported(asset_id, handle), + Action::TransferFrom => Self::not_supported(asset_id, handle), + }; + } + Err(PrecompileFailure::Revert { + exit_status: ExitRevert::Reverted, + output: "invalid currency id".into(), + }) + } +} + +impl MultiCurrencyPrecompile +where + Runtime: frame_system::Config + + pallet_evm::Config + + bifrost_asset_registry::Config + + bifrost_currencies::Config, + Currencies: MultiCurrency, + bifrost_currencies::Pallet: + MultiCurrency, + ::AccountId: core::convert::From, + <::RuntimeCall as Dispatchable>::RuntimeOrigin: OriginTrait, +{ + fn name(currency_id: CurrencyId, handle: &mut impl PrecompileHandle) -> PrecompileResult { + handle.record_cost(RuntimeHelper::::db_read_gas_cost())?; + + // Parse input + let input = handle.read_input()?; + input.expect_arguments(0)?; + + match AssetIdMaps::::get_currency_metadata(currency_id) { + Some(metadata) => { + let encoded = Output::encode_bytes(metadata.name.as_slice()); + Ok(succeed(encoded)) + } + None => Err(PrecompileFailure::Error { + exit_status: pallet_evm::ExitError::Other("Non-existing asset.".into()), + }), + } + } + + fn symbol(currency_id: CurrencyId, handle: &mut impl PrecompileHandle) -> PrecompileResult { + handle.record_cost(RuntimeHelper::::db_read_gas_cost())?; + + // Parse input + let input = handle.read_input()?; + input.expect_arguments(0)?; + + match AssetIdMaps::::get_currency_metadata(currency_id) { + Some(metadata) => { + let encoded = Output::encode_bytes(metadata.symbol.as_slice()); + Ok(succeed(encoded)) + } + None => Err(PrecompileFailure::Error { + exit_status: pallet_evm::ExitError::Other("Non-existing asset.".into()), + }), + } + } + + fn decimals(currency_id: CurrencyId, handle: &mut impl PrecompileHandle) -> PrecompileResult { + handle.record_cost(RuntimeHelper::::db_read_gas_cost())?; + + // Parse input + let input = handle.read_input()?; + input.expect_arguments(0)?; + + match AssetIdMaps::::get_currency_metadata(currency_id) { + Some(metadata) => { + let encoded = Output::encode_uint::(metadata.decimals); + Ok(succeed(encoded)) + } + None => Err(PrecompileFailure::Error { + exit_status: pallet_evm::ExitError::Other("Non-existing asset.".into()), + }), + } + } + + fn total_supply( + currency_id: CurrencyId, + handle: &mut impl PrecompileHandle, + ) -> PrecompileResult { + handle.record_cost(RuntimeHelper::::db_read_gas_cost())?; + + // Parse input + let input = handle.read_input()?; + input.expect_arguments(0)?; + + let total_issuance = Currencies::total_issuance(currency_id); + + log::debug!(target: "evm", "multicurrency: totalSupply: {:?}", total_issuance); + + let encoded = Output::encode_uint::(total_issuance); + + Ok(succeed(encoded)) + } + + fn balance_of(currency_id: CurrencyId, handle: &mut impl PrecompileHandle) -> PrecompileResult { + handle.record_cost(RuntimeHelper::::db_read_gas_cost())?; + + // Parse input + let mut input = handle.read_input()?; + input.expect_arguments(1)?; + + let owner: H160 = input.read::
()?.into(); + let who: Runtime::AccountId = ExtendedAddressMapping::into_account_id(owner).into(); //TODO: use pallet? + + let free_balance = Currencies::free_balance(currency_id, &who); + + log::debug!(target: "evm", "multicurrency: balanceOf: {:?}", free_balance); + + let encoded = Output::encode_uint::(free_balance); + + Ok(succeed(encoded)) + } + + fn transfer(currency_id: CurrencyId, handle: &mut impl PrecompileHandle) -> PrecompileResult { + handle.record_cost(RuntimeHelper::::db_read_gas_cost())?; + + // Parse input + let mut input = handle.read_input()?; + input.expect_arguments(2)?; + + let to: H160 = input.read::
()?.into(); + let amount = input.read::()?; + + let origin = ExtendedAddressMapping::into_account_id(handle.context().caller); + let to = ExtendedAddressMapping::into_account_id(to); + + log::debug!(target: "evm", "multicurrency: transfer from: {:?}, to: {:?}, amount: {:?}", origin, to, amount); + + as MultiCurrency>::transfer( + currency_id, + &(>::into(origin)), + &(>::into(to)), + amount, + ) + .map_err(|e| PrecompileFailure::Revert { + exit_status: ExitRevert::Reverted, + output: Into::<&str>::into(e).as_bytes().to_vec(), + })?; + + Ok(succeed(EvmDataWriter::new().write(true).build())) + } + + fn not_supported(_: CurrencyId, _: &mut impl PrecompileHandle) -> PrecompileResult { + Err(PrecompileFailure::Error { + exit_status: pallet_evm::ExitError::Other("not supported".into()), + }) + } +} diff --git a/runtime/bifrost-paseo/src/evm/precompiles/substrate.rs b/runtime/bifrost-paseo/src/evm/precompiles/substrate.rs new file mode 100644 index 0000000000..b3214c8223 --- /dev/null +++ b/runtime/bifrost-paseo/src/evm/precompiles/substrate.rs @@ -0,0 +1,43 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +//! Utils related to Substrate features: +//! - Substrate call dispatch. +//! - Substrate DB read and write costs + +use core::marker::PhantomData; +use frame_support::{traits::Get, weights::Weight}; +use pallet_evm::GasWeightMapping; + +/// Helper functions requiring a Substrate runtime. +/// This runtime must of course implement `pallet_evm::Config`. +#[derive(Clone, Copy, Debug)] +pub struct RuntimeHelper(PhantomData); + +impl RuntimeHelper +where + Runtime: pallet_evm::Config + frame_system::Config, +{ + /// Cost of a Substrate DB read in gas. + pub fn db_read_gas_cost() -> u64 { + ::GasWeightMapping::weight_to_gas(Weight::from_parts( + ::DbWeight::get().read, + 0, + )) + } +} diff --git a/runtime/bifrost-paseo/src/evm/precompiles/tests/erc20_mapping.rs b/runtime/bifrost-paseo/src/evm/precompiles/tests/erc20_mapping.rs new file mode 100644 index 0000000000..0ec72e0606 --- /dev/null +++ b/runtime/bifrost-paseo/src/evm/precompiles/tests/erc20_mapping.rs @@ -0,0 +1,160 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +use crate::evm::precompiles::erc20_mapping::{BifrostErc20Mapping, Erc20Mapping}; +use bifrost_primitives::{ + CurrencyId, TokenSymbol, + TokenSymbol::{BNC, KSM}, +}; +use hex_literal::hex; +use primitive_types::H160; + +macro_rules! encode { + ($asset_id:expr) => {{ + BifrostErc20Mapping::encode_evm_address($asset_id).unwrap() + }}; +} + +macro_rules! decode { + ($evm_address:expr) => {{ + BifrostErc20Mapping::decode_evm_address(H160::from($evm_address)).unwrap() + }}; +} + +macro_rules! decode_optional { + ($evm_address:expr) => {{ + BifrostErc20Mapping::decode_evm_address(H160::from($evm_address)) + }}; +} + +#[test] +fn decode_asset_id_from_evm_address_should_work() { + assert_eq!( + decode!(hex!("ffffffff00000000000000000000000000000001")), + CurrencyId::Native(BNC) + ); + assert_eq!( + decode!(hex!("ffffffff00000000000000000000000000000800")), + CurrencyId::Token2(0) + ); + assert_eq!( + decode!(hex!("ffffffff00000000000000000000000000000900")), + CurrencyId::VToken2(0) + ); + assert_eq!( + decode!(hex!("ffffffff00000000000000000000000000000204")), + CurrencyId::Token(KSM) + ); + assert_eq!( + decode!(hex!("ffffffff00000000000000000000000000000104")), + CurrencyId::VToken(KSM) + ); + assert_eq!( + decode!(hex!("ffffffff00000000000000000000000000000404")), + CurrencyId::VSToken(KSM) + ); + assert_eq!( + decode!(hex!("ffffffff00000000000000000000000000000a00")), + CurrencyId::VSToken2(0) + ); + assert_eq!( + decode!(hex!("ffffffff00000000000000000000000000000a00")), + CurrencyId::VSToken2(0) + ); + assert_eq!( + decode!(hex!("ffffffff00000b00000000000000000000000000")), + CurrencyId::VSBond2(0, 0, 0, 0) + ); + assert_eq!( + decode!(hex!("ffffffff00000501000000000000000000000000")), + CurrencyId::VSBond(TokenSymbol::BNC, 0, 0, 0) + ); + assert_eq!( + decode!(hex!("ffffffff00000000000000000000000601000300")), + CurrencyId::LPToken(TokenSymbol::BNC, 0, TokenSymbol::DOT, 0) + ); +} + +#[test] +fn decode_asset_id_from_evm_address_should_not_work_with_invalid_asset_addresses() { + assert_eq!( + decode_optional!(hex!("0000000000000000000000000000000200000000")), + None + ); + assert_eq!( + decode_optional!(hex!("0000000000000000000000000000000000000001")), + None + ); + assert_eq!( + decode_optional!(hex!("90000000000000000000000000000001ffffffff")), + None + ); + assert_eq!( + decode_optional!(hex!("0000000000000000000000000000001100000003")), + None + ); + assert_eq!( + decode_optional!(hex!("0000000000000000900000000000000100000003")), + None + ); + assert_eq!( + decode_optional!(hex!("7777777777777777777777777777777777777777")), + None + ); +} + +#[test] +fn encode_asset_id_to_evm_address_should_work() { + assert_eq!( + encode!(CurrencyId::Native(BNC)), + H160::from(hex!("ffffffff00000000000000000000000000000001")) + ); + assert_eq!( + encode!(CurrencyId::Token2(0)), + H160::from(hex!("ffffffff00000000000000000000000000000800")) + ); + assert_eq!( + encode!(CurrencyId::VToken2(0)), + H160::from(hex!("ffffffff00000000000000000000000000000900")) + ); + assert_eq!( + encode!(CurrencyId::Token(KSM)), + H160::from(hex!("ffffffff00000000000000000000000000000204")) + ); + assert_eq!( + encode!(CurrencyId::VToken(KSM)), + H160::from(hex!("ffffffff00000000000000000000000000000104")) + ); + assert_eq!( + encode!(CurrencyId::VSBond2(0, 0, 0, 0)), + H160::from(hex!("ffffffff00000b00000000000000000000000000")) + ); + assert_eq!( + encode!(CurrencyId::LPToken( + TokenSymbol::BNC, + 0, + TokenSymbol::DOT, + 0 + )), + H160::from(hex!("ffffffff00000000000000000000000601000300")) + ); + assert_eq!( + encode!(CurrencyId::VSBond(TokenSymbol::BNC, 0, 0, 0)), + H160::from(hex!("ffffffff00000501000000000000000000000000")) + ); +} diff --git a/runtime/bifrost-paseo/src/evm/precompiles/tests/mod.rs b/runtime/bifrost-paseo/src/evm/precompiles/tests/mod.rs new file mode 100644 index 0000000000..3f6a293866 --- /dev/null +++ b/runtime/bifrost-paseo/src/evm/precompiles/tests/mod.rs @@ -0,0 +1,19 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +mod erc20_mapping; diff --git a/runtime/bifrost-paseo/src/evm/runner.rs b/runtime/bifrost-paseo/src/evm/runner.rs new file mode 100644 index 0000000000..8e3987aa20 --- /dev/null +++ b/runtime/bifrost-paseo/src/evm/runner.rs @@ -0,0 +1,328 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +//! EVM stack-based runner. +//! This runner is a wrapper around the default stack-based runner that adds possibility to charge +//! fees in different currencies and to validate transactions based on the account's fee payment +//! asset. +//! +//! Shamelessly copied from pallet-evm and modified to support multi-currency fees. + +use crate::{evm::WethAssetId, Weight}; +use bifrost_primitives::{ + AccountFeeCurrency, AccountFeeCurrencyBalanceInCurrency, Balance, CurrencyId, + OraclePriceProvider, +}; +use core::ops::Mul; +use fp_evm::{Account, TransactionValidationError}; +use frame_support::traits::{ + tokens::{Fortitude, Preservation}, + Get, +}; +use pallet_evm::{ + runner::Runner, AddressMapping, CallInfo, Config, CreateInfo, FeeCalculator, RunnerError, +}; +use primitive_types::{H160, H256, U256}; +use sp_runtime::{traits::UniqueSaturatedInto, DispatchError}; +use sp_std::{marker::PhantomData, vec::Vec}; + +/// AccountFeeCurrencyBalanceInCurrency implementation for the FeeAssetBalanceInCurrency. +/// Provides account's balance of fee asset currency in a given currency +pub struct FeeAssetBalanceInCurrency(PhantomData<(T, Price, AC, I)>); + +impl AccountFeeCurrencyBalanceInCurrency + for FeeAssetBalanceInCurrency +where + T: frame_system::Config, + Price: OraclePriceProvider, + AC: AccountFeeCurrency, + I: frame_support::traits::fungibles::Inspect< + T::AccountId, + AssetId = CurrencyId, + Balance = Balance, + >, +{ + type Output = (Balance, Weight); + type Error = DispatchError; + + fn get_balance_in_currency( + to_currency: CurrencyId, + account: &T::AccountId, + fee: U256, + ) -> Result { + let from_currency = AC::get_fee_currency(account, fee) + .map_err(|_| DispatchError::Other("Get Currency Error."))?; + let account_balance = I::reducible_balance( + from_currency, + account, + Preservation::Preserve, + Fortitude::Polite, + ); + let price_weight = T::DbWeight::get().reads(2); // 1 read to get currency and 1 read to get balance + + if from_currency == to_currency { + return Ok((account_balance, price_weight)); + } + + let Some((converted, _, _)) = Price::get_oracle_amount_by_currency_and_amount_in( + &from_currency, + account_balance, + &to_currency, + ) else { + return Ok((0, price_weight)); + }; + Ok((converted, price_weight)) + } +} + +pub struct WrapRunner(sp_std::marker::PhantomData<(T, R, B)>); + +impl Runner for WrapRunner +where + T: Config, + R: Runner, + >::Error: core::convert::From, + B: AccountFeeCurrencyBalanceInCurrency, +{ + type Error = R::Error; + + fn validate( + source: H160, + target: Option, + input: Vec, + value: U256, + gas_limit: u64, + max_fee_per_gas: Option, + max_priority_fee_per_gas: Option, + nonce: Option, + access_list: Vec<(H160, Vec)>, + is_transactional: bool, + weight_limit: Option, + proof_size_base_cost: Option, + evm_config: &evm::Config, + ) -> Result<(), RunnerError> { + let (base_fee, mut weight) = T::FeeCalculator::min_gas_price(); + + let evm_currency = WethAssetId::get(); + let account_id = T::AddressMapping::into_account_id(source); + let account_nonce = frame_system::Pallet::::account_nonce(&account_id); + + let (balance, b_weight) = match B::get_balance_in_currency( + evm_currency, + &account_id, + base_fee.mul(U256::from(gas_limit)), + ) { + Ok((balance, b_weight)) => (balance, b_weight), + Err(_) => (0, T::DbWeight::get().reads(2)), + }; + + let (source_account, inner_weight) = ( + Account { + nonce: U256::from(UniqueSaturatedInto::::unique_saturated_into( + account_nonce, + )), + balance: U256::from(UniqueSaturatedInto::::unique_saturated_into(balance)), + }, + T::DbWeight::get().reads(1).saturating_add(b_weight), + ); + weight = weight.saturating_add(inner_weight); + + let _ = fp_evm::CheckEvmTransaction::::new( + fp_evm::CheckEvmTransactionConfig { + evm_config, + block_gas_limit: T::BlockGasLimit::get(), + base_fee, + chain_id: T::ChainId::get(), + is_transactional, + }, + fp_evm::CheckEvmTransactionInput { + chain_id: Some(T::ChainId::get()), + to: target, + input, + nonce: nonce.unwrap_or(source_account.nonce), + gas_limit: gas_limit.into(), + gas_price: None, + max_fee_per_gas, + max_priority_fee_per_gas, + value, + access_list, + }, + weight_limit, + proof_size_base_cost, + ) + .validate_in_block_for(&source_account) + .and_then(|v| v.with_base_fee()) + .and_then(|v| v.with_balance_for(&source_account)) + .map_err(|error| RunnerError { error, weight })?; + Ok(()) + } + + fn call( + source: H160, + target: H160, + input: Vec, + value: U256, + gas_limit: u64, + max_fee_per_gas: Option, + max_priority_fee_per_gas: Option, + nonce: Option, + access_list: Vec<(H160, Vec)>, + is_transactional: bool, + validate: bool, + weight_limit: Option, + proof_size_base_cost: Option, + config: &evm::Config, + ) -> Result> { + if validate { + Self::validate( + source, + Some(target), + input.clone(), + value, + gas_limit, + max_fee_per_gas, + max_priority_fee_per_gas, + nonce, + access_list.clone(), + is_transactional, + weight_limit, + proof_size_base_cost, + config, + )?; + } + // Validated, flag set to false + R::call( + source, + target, + input, + value, + gas_limit, + max_fee_per_gas, + max_priority_fee_per_gas, + nonce, + access_list, + is_transactional, + false, + weight_limit, + proof_size_base_cost, + config, + ) + } + + fn create( + source: H160, + init: Vec, + value: U256, + gas_limit: u64, + max_fee_per_gas: Option, + max_priority_fee_per_gas: Option, + nonce: Option, + access_list: Vec<(H160, Vec)>, + is_transactional: bool, + validate: bool, + weight_limit: Option, + proof_size_base_cost: Option, + config: &evm::Config, + ) -> Result> { + if validate { + Self::validate( + source, + None, + init.clone(), + value, + gas_limit, + max_fee_per_gas, + max_priority_fee_per_gas, + nonce, + access_list.clone(), + is_transactional, + weight_limit, + proof_size_base_cost, + config, + )?; + } + // Validated, flag set to false + R::create( + source, + init, + value, + gas_limit, + max_fee_per_gas, + max_priority_fee_per_gas, + nonce, + access_list, + is_transactional, + false, + weight_limit, + proof_size_base_cost, + config, + ) + } + + fn create2( + source: H160, + init: Vec, + salt: H256, + value: U256, + gas_limit: u64, + max_fee_per_gas: Option, + max_priority_fee_per_gas: Option, + nonce: Option, + access_list: Vec<(H160, Vec)>, + is_transactional: bool, + validate: bool, + weight_limit: Option, + proof_size_base_cost: Option, + config: &evm::Config, + ) -> Result> { + if validate { + Self::validate( + source, + None, + init.clone(), + value, + gas_limit, + max_fee_per_gas, + max_priority_fee_per_gas, + nonce, + access_list.clone(), + is_transactional, + weight_limit, + proof_size_base_cost, + config, + )?; + } + //Validated, flag set to false + R::create2( + source, + init, + salt, + value, + gas_limit, + max_fee_per_gas, + max_priority_fee_per_gas, + nonce, + access_list, + is_transactional, + false, + weight_limit, + proof_size_base_cost, + config, + ) + } +} diff --git a/runtime/bifrost-paseo/src/governance/fellowship.rs b/runtime/bifrost-paseo/src/governance/fellowship.rs new file mode 100644 index 0000000000..9ce9a26510 --- /dev/null +++ b/runtime/bifrost-paseo/src/governance/fellowship.rs @@ -0,0 +1,365 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +//! Elements of governance concerning the Polkadot Fellowship. This is only a temporary arrangement +//! since the Polkadot Fellowship belongs under the Polkadot Relay. However, that is not yet in +//! place, so until then it will need to live here. Once it is in place and there exists a bridge +//! between Polkadot/Kusama then this code can be removed. + +use super::*; +use frame_support::traits::{EitherOf, MapSuccess, TryMapSuccess}; +use sp_arithmetic::traits::CheckedSub; +use sp_runtime::{ + morph_types, + traits::{ConstU16, Replace, ReplaceWithDefault, TypedGet}, +}; + +parameter_types! { + pub const AlarmInterval: BlockNumber = 1; + pub const SubmissionDeposit: Balance = 0; + pub const UndecidingTimeout: BlockNumber = 7 * DAYS; +} + +pub struct TracksInfo; +impl pallet_referenda::TracksInfo for TracksInfo { + type Id = u16; + type RuntimeOrigin = ::PalletsOrigin; + fn tracks() -> &'static [(Self::Id, pallet_referenda::TrackInfo)] { + static DATA: [(u16, pallet_referenda::TrackInfo); 10] = [ + ( + 0u16, + pallet_referenda::TrackInfo { + name: "candidates", + max_deciding: 10, + decision_deposit: 100 * DOLLARS, + prepare_period: 1 * MINUTES, + decision_period: 2 * DAYS, + confirm_period: 5 * MINUTES, + min_enactment_period: 1 * MINUTES, + min_approval: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(50), + ceil: Perbill::from_percent(100), + }, + min_support: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(50), + ceil: Perbill::from_percent(60), + }, + }, + ), + ( + 1u16, + pallet_referenda::TrackInfo { + name: "members", + max_deciding: 10, + decision_deposit: 10 * DOLLARS, + prepare_period: 1 * MINUTES, + decision_period: 2 * DAYS, + confirm_period: 5 * MINUTES, + min_enactment_period: 1 * MINUTES, + min_approval: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(50), + ceil: Perbill::from_percent(100), + }, + min_support: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(50), + ceil: Perbill::from_percent(60), + }, + }, + ), + ( + 2u16, + pallet_referenda::TrackInfo { + name: "proficients", + max_deciding: 10, + decision_deposit: 10 * DOLLARS, + prepare_period: 1 * MINUTES, + decision_period: 2 * DAYS, + confirm_period: 5 * MINUTES, + min_enactment_period: 1 * MINUTES, + min_approval: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(50), + ceil: Perbill::from_percent(100), + }, + min_support: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(50), + ceil: Perbill::from_percent(60), + }, + }, + ), + ( + 3u16, + pallet_referenda::TrackInfo { + name: "fellows", + max_deciding: 10, + decision_deposit: 10 * DOLLARS, + prepare_period: 1 * MINUTES, + decision_period: 2 * DAYS, + confirm_period: 5 * MINUTES, + min_enactment_period: 1 * MINUTES, + min_approval: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(50), + ceil: Perbill::from_percent(100), + }, + min_support: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(50), + ceil: Perbill::from_percent(60), + }, + }, + ), + ( + 4u16, + pallet_referenda::TrackInfo { + name: "senior fellows", + max_deciding: 10, + decision_deposit: 10 * DOLLARS, + prepare_period: 1 * MINUTES, + decision_period: 2 * DAYS, + confirm_period: 5 * MINUTES, + min_enactment_period: 1 * MINUTES, + min_approval: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(50), + ceil: Perbill::from_percent(100), + }, + min_support: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(50), + ceil: Perbill::from_percent(60), + }, + }, + ), + ( + 5u16, + pallet_referenda::TrackInfo { + name: "experts", + max_deciding: 10, + decision_deposit: 1 * DOLLARS, + prepare_period: 1 * MINUTES, + decision_period: 2 * DAYS, + confirm_period: 5 * MINUTES, + min_enactment_period: 1 * MINUTES, + min_approval: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(50), + ceil: Perbill::from_percent(100), + }, + min_support: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(50), + ceil: Perbill::from_percent(60), + }, + }, + ), + ( + 6u16, + pallet_referenda::TrackInfo { + name: "senior experts", + max_deciding: 10, + decision_deposit: 1 * DOLLARS, + prepare_period: 1 * MINUTES, + decision_period: 2 * DAYS, + confirm_period: 5 * MINUTES, + min_enactment_period: 1 * MINUTES, + min_approval: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(50), + ceil: Perbill::from_percent(100), + }, + min_support: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(50), + ceil: Perbill::from_percent(60), + }, + }, + ), + ( + 7u16, + pallet_referenda::TrackInfo { + name: "masters", + max_deciding: 10, + decision_deposit: 1 * DOLLARS, + prepare_period: 1 * MINUTES, + decision_period: 2 * DAYS, + confirm_period: 5 * MINUTES, + min_enactment_period: 1 * MINUTES, + min_approval: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(50), + ceil: Perbill::from_percent(100), + }, + min_support: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(50), + ceil: Perbill::from_percent(60), + }, + }, + ), + ( + 8u16, + pallet_referenda::TrackInfo { + name: "senior masters", + max_deciding: 10, + decision_deposit: 1 * DOLLARS, + prepare_period: 1 * MINUTES, + decision_period: 2 * DAYS, + confirm_period: 5 * MINUTES, + min_enactment_period: 1 * MINUTES, + min_approval: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(50), + ceil: Perbill::from_percent(100), + }, + min_support: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(50), + ceil: Perbill::from_percent(60), + }, + }, + ), + ( + 9u16, + pallet_referenda::TrackInfo { + name: "grand masters", + max_deciding: 10, + decision_deposit: 1 * DOLLARS, + prepare_period: 1 * MINUTES, + decision_period: 2 * DAYS, + confirm_period: 5 * MINUTES, + min_enactment_period: 1 * MINUTES, + min_approval: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(50), + ceil: Perbill::from_percent(100), + }, + min_support: pallet_referenda::Curve::LinearDecreasing { + length: Perbill::from_percent(100), + floor: Perbill::from_percent(50), + ceil: Perbill::from_percent(60), + }, + }, + ), + ]; + &DATA[..] + } + fn track_for(id: &Self::RuntimeOrigin) -> Result { + #[cfg(feature = "runtime-benchmarks")] + { + // For benchmarks, we enable a root origin. + // It is important that this is not available in production! + let root: Self::RuntimeOrigin = frame_system::RawOrigin::Root.into(); + if &root == id { + return Ok(9); + } + } + + match Origin::try_from(id.clone()) { + Ok(Origin::FellowshipInitiates) => Ok(0), + Ok(Origin::Fellowship1Dan) => Ok(1), + Ok(Origin::Fellowship2Dan) => Ok(2), + Ok(Origin::Fellowship3Dan) | Ok(Origin::Fellows) => Ok(3), + Ok(Origin::Fellowship4Dan) => Ok(4), + Ok(Origin::Fellowship5Dan) | Ok(Origin::FellowshipExperts) => Ok(5), + Ok(Origin::Fellowship6Dan) => Ok(6), + Ok(Origin::Fellowship7Dan | Origin::FellowshipMasters) => Ok(7), + Ok(Origin::Fellowship8Dan) => Ok(8), + Ok(Origin::Fellowship9Dan) => Ok(9), + Ok(Origin::CoreAdmin) => Ok(6), + Ok(Origin::TechAdmin) => Ok(4), + _ => Err(()), + } + } +} +pallet_referenda::impl_tracksinfo_get!(TracksInfo, Balance, BlockNumber); + +pub type FellowshipReferendaInstance = pallet_referenda::Instance2; + +impl pallet_referenda::Config for Runtime { + type WeightInfo = pallet_referenda::weights::SubstrateWeight; + type RuntimeCall = RuntimeCall; + type RuntimeEvent = RuntimeEvent; + type Scheduler = Scheduler; + type Currency = Balances; + type SubmitOrigin = + pallet_ranked_collective::EnsureMember; + type CancelOrigin = FellowshipExperts; + type KillOrigin = FellowshipMasters; + type Slash = Treasury; + type Votes = pallet_ranked_collective::Votes; + type Tally = pallet_ranked_collective::TallyOf; + type SubmissionDeposit = SubmissionDeposit; + type MaxQueued = ConstU32<100>; + type UndecidingTimeout = UndecidingTimeout; + type AlarmInterval = AlarmInterval; + type Tracks = TracksInfo; + type Preimages = Preimage; +} + +pub type FellowshipCollectiveInstance = pallet_ranked_collective::Instance1; + +morph_types! { + /// A `TryMorph` implementation to reduce a scalar by a particular amount, checking for + /// underflow. + pub type CheckedReduceBy: TryMorph = |r: N::Type| -> Result { + r.checked_sub(&N::get()).ok_or(()) + } where N::Type: CheckedSub; +} + +impl pallet_ranked_collective::Config for Runtime { + type WeightInfo = pallet_ranked_collective::weights::SubstrateWeight; + type RuntimeEvent = RuntimeEvent; + // Promotion is by any of: + // - Root can demote arbitrarily. + // - the FellowshipAdmin origin (i.e. token holder referendum); + // - a vote by the rank *above* the new rank. + type PromoteOrigin = EitherOf< + frame_system::EnsureRootWithSuccess>, + EitherOf< + MapSuccess>>, + TryMapSuccess>>, + >, + >; + // Demotion is by any of: + // - Root can demote arbitrarily. + // - the FellowshipAdmin origin (i.e. token holder referendum); + // - a vote by the rank two above the current rank. + type DemoteOrigin = EitherOf< + frame_system::EnsureRootWithSuccess>, + EitherOf< + MapSuccess>>, + TryMapSuccess>>, + >, + >; + type Polls = FellowshipReferenda; + type MinRankOfClass = sp_runtime::traits::Identity; + type VoteWeight = pallet_ranked_collective::Geometric; + type MemberSwappedHandler = (); + type ExchangeOrigin = EitherOfDiverse; + type AddOrigin = MapSuccess>; + type RemoveOrigin = Self::DemoteOrigin; + #[cfg(feature = "runtime-benchmarks")] + type BenchmarkSetup = (); + type MaxMemberCount = (); +} diff --git a/runtime/bifrost-paseo/src/governance/mod.rs b/runtime/bifrost-paseo/src/governance/mod.rs new file mode 100644 index 0000000000..5b5a487a6d --- /dev/null +++ b/runtime/bifrost-paseo/src/governance/mod.rs @@ -0,0 +1,41 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +pub mod referenda; + +use super::*; +pub use bifrost_runtime_common::dollar; +pub mod fellowship; +mod origins; +pub use origins::{ + custom_origins, CoreAdmin, Fellows, FellowshipAdmin, FellowshipExperts, FellowshipInitiates, + FellowshipMasters, LiquidStaking, ReferendumCanceller, ReferendumKiller, SALPAdmin, TechAdmin, + WhitelistedCaller, *, +}; +mod tracks; +pub use tracks::TracksInfo; + +pub type CoreAdminOrCouncil = EitherOfDiverse< + CoreAdmin, + EitherOfDiverse, +>; + +pub type TechAdminOrCouncil = EitherOfDiverse< + TechAdmin, + EitherOfDiverse, +>; diff --git a/runtime/bifrost-paseo/src/governance/origins.rs b/runtime/bifrost-paseo/src/governance/origins.rs new file mode 100644 index 0000000000..5fffa211d9 --- /dev/null +++ b/runtime/bifrost-paseo/src/governance/origins.rs @@ -0,0 +1,185 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +//! Custom origins for governance interventions. +pub use custom_origins::*; + +#[frame_support::pallet] +pub mod custom_origins { + use crate::{Balance, BNCS}; + use frame_support::pallet_prelude::*; + use strum_macros::EnumString; + + #[pallet::config] + pub trait Config: frame_system::Config {} + + #[pallet::pallet] + pub struct Pallet(_); + + #[derive( + PartialEq, Eq, Clone, MaxEncodedLen, Encode, Decode, TypeInfo, RuntimeDebug, EnumString, + )] + #[strum(serialize_all = "snake_case")] + #[pallet::origin] + pub enum Origin { + /// Origin able to dispatch a whitelisted call. + WhitelistedCaller, + /// Origin for managing the composition of the fellowship. + FellowshipAdmin, + /// Origin able to cancel referenda. + ReferendumCanceller, + /// Origin able to kill referenda. + ReferendumKiller, + // Fellows, + /// Origin for managing validater node of SLP protocol. + LiquidStaking, + /// Origin able to execute SALP protocol. + SALPAdmin, + /// Origin commanded by any members of the Polkadot Fellowship (no Dan grade needed). + FellowshipInitiates, + /// Origin commanded by Polkadot Fellows (3rd Dan fellows or greater). + Fellows, + /// Origin commanded by Polkadot Experts (5th Dan fellows or greater). + FellowshipExperts, + /// Origin commanded by Polkadot Masters (7th Dan fellows of greater). + FellowshipMasters, + /// Origin commanded by rank 1 of the Polkadot Fellowship and with a success of 1. + Fellowship1Dan, + /// Origin commanded by rank 2 of the Polkadot Fellowship and with a success of 2. + Fellowship2Dan, + /// Origin commanded by rank 3 of the Polkadot Fellowship and with a success of 3. + Fellowship3Dan, + /// Origin commanded by rank 4 of the Polkadot Fellowship and with a success of 4. + Fellowship4Dan, + /// Origin commanded by rank 5 of the Polkadot Fellowship and with a success of 5. + Fellowship5Dan, + /// Origin commanded by rank 6 of the Polkadot Fellowship and with a success of 6. + Fellowship6Dan, + /// Origin commanded by rank 7 of the Polkadot Fellowship and with a success of 7. + Fellowship7Dan, + /// Origin commanded by rank 8 of the Polkadot Fellowship and with a success of 8. + Fellowship8Dan, + /// Origin commanded by rank 9 of the Polkadot Fellowship and with a success of 9. + Fellowship9Dan, + /// Origin able to manage Pallet with track3. + TechAdmin, + /// Origin able to manage Pallet with track6. + CoreAdmin, + /// Origin able to execute treasury.spend. + TreasurySpend, + } + + macro_rules! decl_unit_ensures { + ( $name:ident: $success_type:ty = $success:expr ) => { + pub struct $name; + impl> + From> + EnsureOrigin for $name + { + type Success = $success_type; + fn try_origin(o: O) -> Result { + o.into().and_then(|o| match o { + Origin::$name => Ok($success), + r => Err(O::from(r)), + }) + } + #[cfg(feature = "runtime-benchmarks")] + fn try_successful_origin() -> Result { + Ok(O::from(Origin::$name)) + } + } + }; + ( $name:ident ) => { decl_unit_ensures! { $name : () = () } }; + ( $name:ident: $success_type:ty = $success:expr, $( $rest:tt )* ) => { + decl_unit_ensures! { $name: $success_type = $success } + decl_unit_ensures! { $( $rest )* } + }; + ( $name:ident, $( $rest:tt )* ) => { + decl_unit_ensures! { $name } + decl_unit_ensures! { $( $rest )* } + }; + () => {} + } + decl_unit_ensures!( + ReferendumCanceller, + ReferendumKiller, + WhitelistedCaller, + FellowshipAdmin, + FellowshipInitiates: u16 = 0, + Fellows: u16 = 3, + FellowshipExperts: u16 = 5, + FellowshipMasters: u16 = 7, + LiquidStaking, + SALPAdmin, + TechAdmin, + CoreAdmin, + TreasurySpend, + ); + + macro_rules! decl_ensure { + ( + $vis:vis type $name:ident: EnsureOrigin { + $( $item:ident = $success:expr, )* + } + ) => { + $vis struct $name; + impl> + From> + EnsureOrigin for $name + { + type Success = $success_type; + fn try_origin(o: O) -> Result { + o.into().and_then(|o| match o { + $( + Origin::$item => Ok($success), + )* + r => Err(O::from(r)), + }) + } + #[cfg(feature = "runtime-benchmarks")] + fn try_successful_origin() -> Result { + // By convention the more privileged origins go later, so for greatest chance + // of success, we want the last one. + let _result: Result = Err(()); + $( + let _result: Result = Ok(O::from(Origin::$item)); + )* + _result + } + } + } + } + + decl_ensure! { + pub type EnsureFellowship: EnsureOrigin { + Fellowship1Dan = 1, + Fellowship2Dan = 2, + Fellowship3Dan = 3, + Fellowship4Dan = 4, + Fellowship5Dan = 5, + Fellowship6Dan = 6, + Fellowship7Dan = 7, + Fellowship8Dan = 8, + Fellowship9Dan = 9, + } + } + + decl_ensure! { + pub type Spender: EnsureOrigin { + TreasurySpend = 100_000 * BNCS, + } + } +} diff --git a/runtime/bifrost-paseo/src/governance/referenda.rs b/runtime/bifrost-paseo/src/governance/referenda.rs new file mode 100644 index 0000000000..f566b2b7eb --- /dev/null +++ b/runtime/bifrost-paseo/src/governance/referenda.rs @@ -0,0 +1,85 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +//! # Gov2 config +//! Includes runtime configs for these substrate pallets: +//! 1. pallet-conviction-voting +//! 2. pallet-whitelist +//! 3. pallet-referenda + +use super::*; +use frame_support::traits::{ConstU16, EitherOf}; +use frame_system::EnsureRootWithSuccess; + +parameter_types! { + pub const VoteLockingPeriod: BlockNumber = 1 * DAYS; +} + +impl pallet_conviction_voting::Config for Runtime { + type WeightInfo = pallet_conviction_voting::weights::SubstrateWeight; + type RuntimeEvent = RuntimeEvent; + type Currency = Balances; + type Polls = Referenda; + type MaxTurnout = frame_support::traits::ActiveIssuanceOf; + // Maximum number of concurrent votes an account may have + type MaxVotes = ConstU32<512>; + // Minimum period of vote locking + type VoteLockingPeriod = VoteLockingPeriod; +} + +parameter_types! { + pub const AlarmInterval: BlockNumber = 1; + pub SubmissionDeposit: Balance = 10 * dollar::(NativeCurrencyId::get()); + pub const UndecidingTimeout: BlockNumber = 14 * DAYS; +} + +impl custom_origins::Config for Runtime {} + +// The purpose of this pallet is to queue calls to be dispatched as by root later => the Dispatch +// origin corresponds to the Gov2 Whitelist track. +impl pallet_whitelist::Config for Runtime { + type WeightInfo = pallet_whitelist::weights::SubstrateWeight; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; + type WhitelistOrigin = + EitherOf>, Fellows>; + type DispatchWhitelistedOrigin = EitherOf, WhitelistedCaller>; + type Preimages = Preimage; +} + +pallet_referenda::impl_tracksinfo_get!(TracksInfo, Balance, BlockNumber); + +impl pallet_referenda::Config for Runtime { + type WeightInfo = pallet_referenda::weights::SubstrateWeight; + type RuntimeCall = RuntimeCall; + type RuntimeEvent = RuntimeEvent; + type Scheduler = Scheduler; + type Currency = Balances; + type SubmitOrigin = frame_system::EnsureSigned; + type CancelOrigin = EitherOf, ReferendumCanceller>; + type KillOrigin = EitherOf, ReferendumKiller>; + type Slash = Treasury; + type Votes = pallet_conviction_voting::VotesOf; + type Tally = pallet_conviction_voting::TallyOf; + type SubmissionDeposit = SubmissionDeposit; + type MaxQueued = ConstU32<100>; + type UndecidingTimeout = UndecidingTimeout; + type AlarmInterval = AlarmInterval; + type Tracks = TracksInfo; + type Preimages = Preimage; +} diff --git a/runtime/bifrost-paseo/src/governance/tracks.rs b/runtime/bifrost-paseo/src/governance/tracks.rs new file mode 100644 index 0000000000..7253b0b9b6 --- /dev/null +++ b/runtime/bifrost-paseo/src/governance/tracks.rs @@ -0,0 +1,228 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +//! Track configurations for governance. + +use super::*; +use sp_std::str::FromStr; + +const fn percent(x: i32) -> sp_runtime::FixedI64 { + sp_runtime::FixedI64::from_rational(x as u128, 100) +} +const fn permill(x: i32) -> sp_runtime::FixedI64 { + sp_runtime::FixedI64::from_rational(x as u128, 1000) +} + +use pallet_referenda::Curve; +const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo); 8] = [ + ( + 0, + pallet_referenda::TrackInfo { + // Name of this track. + name: "root", + // A limit for the number of referenda on this track that can be being decided at once. + // For Root origin this should generally be just one. + max_deciding: 1, + // Amount that must be placed on deposit before a decision can be made. + decision_deposit: 50_000 * BNCS, + // Amount of time this must be submitted for before a decision can be made. + prepare_period: 2 * HOURS, + // Amount of time that a decision may take to be approved prior to cancellation. + decision_period: 14 * DAYS, + // Amount of time that the approval criteria must hold before it can be approved. + confirm_period: 1 * DAYS, + // Minimum amount of time that an approved proposal must be in the dispatch queue. + min_enactment_period: 1 * DAYS, + // Minimum aye votes as percentage of overall conviction-weighted votes needed for + // approval as a function of time into decision period. + min_approval: Curve::make_reciprocal(4, 28, percent(80), percent(50), percent(100)), + // Minimum pre-conviction aye-votes ("support") as percentage of overall population that + // is needed for approval as a function of time into decision period. + min_support: Curve::make_linear(28, 28, permill(0), percent(50)), + }, + ), + ( + 1, + pallet_referenda::TrackInfo { + name: "whitelisted_caller", + max_deciding: 100, + decision_deposit: 5_000 * BNCS, + prepare_period: 5 * MINUTES, + decision_period: 14 * DAYS, + confirm_period: 5 * MINUTES, + min_enactment_period: 5 * MINUTES, + min_approval: Curve::make_reciprocal( + 16, + 28 * 24, + percent(96), + percent(50), + percent(100), + ), + min_support: Curve::make_reciprocal(1, 1792, percent(3), percent(2), percent(50)), + }, + ), + ( + 2, + pallet_referenda::TrackInfo { + name: "fellowship_admin", + max_deciding: 10, + decision_deposit: 2_500 * BNCS, + prepare_period: 2 * HOURS, + decision_period: 14 * DAYS, + confirm_period: 3 * HOURS, + min_enactment_period: 10 * MINUTES, + min_approval: Curve::make_linear(17, 28, percent(50), percent(100)), + min_support: Curve::make_reciprocal(12, 28, percent(1), percent(0), percent(50)), + }, + ), + ( + 3, + pallet_referenda::TrackInfo { + name: "referendum_canceller", + max_deciding: 1_000, + decision_deposit: 5_000 * BNCS, + prepare_period: 2 * HOURS, + decision_period: 7 * DAYS, + confirm_period: 3 * HOURS, + min_enactment_period: 10 * MINUTES, + min_approval: Curve::make_linear(17, 28, percent(50), percent(100)), + min_support: Curve::make_reciprocal(12, 28, percent(1), percent(0), percent(50)), + }, + ), + ( + 4, + pallet_referenda::TrackInfo { + name: "referendum_killer", + max_deciding: 1_000, + decision_deposit: 25_000 * BNCS, + prepare_period: 2 * HOURS, + decision_period: 14 * DAYS, + confirm_period: 3 * HOURS, + min_enactment_period: 10 * MINUTES, + min_approval: Curve::make_linear(17, 28, percent(50), percent(100)), + min_support: Curve::make_reciprocal(12, 28, percent(1), percent(0), percent(50)), + }, + ), + ( + 10, + pallet_referenda::TrackInfo { + name: "liquid_staking", + max_deciding: 10, + decision_deposit: 2_500 * BNCS, + prepare_period: 2 * HOURS, + decision_period: 14 * DAYS, + confirm_period: 3 * HOURS, + min_enactment_period: 10 * MINUTES, + min_approval: Curve::make_reciprocal(2, 28, percent(80), percent(50), percent(100)), + min_support: Curve::make_reciprocal(2, 28, percent(5), percent(0), percent(50)), + }, + ), + ( + 12, + pallet_referenda::TrackInfo { + name: "salp_admin", + max_deciding: 10, + decision_deposit: 2_500 * BNCS, + prepare_period: 15 * MINUTES, + decision_period: 14 * DAYS, + confirm_period: 1 * HOURS, + min_enactment_period: 10 * MINUTES, + min_approval: Curve::make_reciprocal(2, 28, percent(80), percent(50), percent(100)), + min_support: Curve::make_reciprocal(2, 28, percent(5), percent(0), percent(50)), + }, + ), + ( + 13, + pallet_referenda::TrackInfo { + name: "treasury_spend", + max_deciding: 100, + decision_deposit: 500 * BNCS, + prepare_period: 2 * HOURS, + decision_period: 14 * DAYS, + confirm_period: 3 * HOURS, + min_enactment_period: 10 * MINUTES, + min_approval: Curve::make_linear(23, 28, percent(50), percent(100)), + min_support: Curve::make_reciprocal(16, 28, percent(1), percent(0), percent(50)), + }, + ), +]; + +pub struct TracksInfo; +impl pallet_referenda::TracksInfo for TracksInfo { + type Id = u16; + type RuntimeOrigin = ::PalletsOrigin; + fn tracks() -> &'static [(Self::Id, pallet_referenda::TrackInfo)] { + &TRACKS_DATA[..] + } + fn track_for(id: &Self::RuntimeOrigin) -> Result { + if let Ok(system_origin) = frame_system::RawOrigin::try_from(id.clone()) { + match system_origin { + frame_system::RawOrigin::Root => { + if let Some((track_id, _)) = Self::tracks() + .into_iter() + .find(|(_, track)| track.name == "root") + { + Ok(*track_id) + } else { + Err(()) + } + } + _ => Err(()), + } + } else if let Ok(custom_origin) = custom_origins::Origin::try_from(id.clone()) { + if let Some((track_id, _)) = Self::tracks().into_iter().find(|(_, track)| { + if let Ok(track_custom_origin) = custom_origins::Origin::from_str(track.name) { + track_custom_origin == custom_origin + } else { + false + } + }) { + Ok(*track_id) + } else { + Err(()) + } + } else { + Err(()) + } + } +} + +#[test] +/// To ensure voters are always locked into their vote +fn vote_locking_always_longer_than_enactment_period() { + for (_, track) in TRACKS_DATA { + assert!( + ::VoteLockingPeriod::get() + >= track.min_enactment_period, + "Track {} has enactment period {} < vote locking period {}", + track.name, + track.min_enactment_period, + ::VoteLockingPeriod::get(), + ); + } +} + +#[test] +fn all_tracks_have_origins() { + for (_, track) in TRACKS_DATA { + // check name.into() is successful either converts into "root" or custom origin + let track_is_root = track.name == "root"; + let track_has_custom_origin = custom_origins::Origin::from_str(track.name).is_ok(); + assert!(track_is_root || track_has_custom_origin); + } +} diff --git a/runtime/bifrost-paseo/src/hyperbridge.rs b/runtime/bifrost-paseo/src/hyperbridge.rs new file mode 100644 index 0000000000..52686c8c60 --- /dev/null +++ b/runtime/bifrost-paseo/src/hyperbridge.rs @@ -0,0 +1,122 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +use crate::governance::TechAdminOrCouncil; +use crate::{Balances, Ismp, IsmpParachain, NativeCurrencyId, Runtime, RuntimeEvent, Timestamp}; +use crate::{BncDecimals, Currencies}; +use crate::{TokenGateway, Treasury}; +use bifrost_asset_registry::AssetIdMaps; +use bifrost_primitives::{AccountId, Balance}; +use frame_support::parameter_types; +use ismp::{host::StateMachine, module::IsmpModule, router::IsmpRouter}; +use sp_core::Get; +use sp_std::boxed::Box; +use sp_std::vec::Vec; + +impl pallet_hyperbridge::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + // pallet-ismp implements the IsmpHost + type IsmpHost = Ismp; +} + +parameter_types! { + // The hyperbridge parachain on Polkadot + pub const Coprocessor: Option = Some(StateMachine::Kusama(4009)); + // The host state machine of this pallet, your state machine id goes here + pub const HostStateMachine: StateMachine = StateMachine::Kusama(2030); // polkadot +} + +impl pallet_ismp::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + // Modify the consensus client's permissions, for example, TechAdmin + type AdminOrigin = TechAdminOrCouncil; + // The state machine identifier of the chain -- parachain id + type HostStateMachine = HostStateMachine; + type TimestampProvider = Timestamp; + // The router provides the implementation for the IsmpModule as the module id. + type Router = Router; + type Balance = Balance; + // The token used to collect fees, only stablecoins are supported + type Currency = Balances; + // Co-processor + type Coprocessor = Coprocessor; + // A tuple of types implementing the ConsensusClient interface, which defines all consensus algorithms supported by this protocol deployment + type ConsensusClients = (ismp_parachain::ParachainConsensusClient,); + type WeightProvider = (); + type OffchainDB = (); +} + +impl ismp_parachain::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + // pallet-ismp implements the IsmpHost + type IsmpHost = Ismp; +} + +#[derive(Default)] +pub struct Router; + +impl IsmpRouter for Router { + fn module_for_id(&self, id: Vec) -> Result, anyhow::Error> { + match id.as_slice() { + id if TokenGateway::is_token_gateway(&id) => { + Ok(Box::new(pallet_token_gateway::Pallet::::default())) + } + bifrost_ismp::PALLET_BIFROST_ID => { + Ok(Box::new(bifrost_ismp::Pallet::::default())) + } + _ => Err(ismp::Error::ModuleNotFound(id))?, + } + } +} + +impl bifrost_ismp::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type Balance = Balance; + type NativeCurrency = Balances; + type IsmpHost = Ismp; +} + +/// Should provide an account that is funded and can be used to pay for asset creation +pub struct AssetAdmin; +impl Get for AssetAdmin { + fn get() -> AccountId { + Treasury::account_id() + } +} + +impl pallet_token_gateway::Config for Runtime { + // configure the runtime event + type RuntimeEvent = RuntimeEvent; + // Configured as Pallet Ismp + type Dispatcher = Ismp; + // Configured as Pallet Assets + type Assets = Currencies; + // Configured as Pallet balances + type NativeCurrency = Balances; + // AssetAdmin account + type AssetAdmin = AssetAdmin; + // The Native asset Id + type NativeAssetId = NativeCurrencyId; + // A type that provides a function for creating unique asset ids + // A concrete implementation for your specific runtime is required + type AssetIdFactory = (); + // The precision of the native asset + type Decimals = BncDecimals; + type ControlOrigin = TechAdminOrCouncil; + type CurrencyIdConvert = AssetIdMaps; +} diff --git a/runtime/bifrost-paseo/src/lib.rs b/runtime/bifrost-paseo/src/lib.rs new file mode 100644 index 0000000000..28a888267f --- /dev/null +++ b/runtime/bifrost-paseo/src/lib.rs @@ -0,0 +1,2786 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +//! The Bifrost Node runtime. This can be compiled with `#[no_std]`, ready for Wasm. + +#![cfg_attr(not(feature = "std"), no_std)] +// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 512. +#![recursion_limit = "512"] + +// Make the WASM binary available. +#[cfg(feature = "std")] +include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); + +use bifrost_slp::{DerivativeAccountProvider, QueryResponseManager}; +use core::convert::TryInto; +use pallet_traits::evm::InspectEvmAccounts; +// A few exports that help ease life for downstream crates. +pub use bifrost_parachain_staking::{InflationInfo, Range}; +use bifrost_primitives::{ + BifrostCrowdloanId, BifrostVsbondAccount, BuyBackAccount, BuybackPalletId, CloudsPalletId, + CommissionPalletId, FarmingBoostPalletId, FarmingGaugeRewardIssuerPalletId, + FarmingKeeperPalletId, FarmingRewardIssuerPalletId, FeeSharePalletId, FlexibleFeePalletId, + IncentivePalletId, IncentivePoolAccount, LendMarketPalletId, LiquidityAccount, + LocalBncLocation, MerkleDirtributorPalletId, OraclePalletId, ParachainStakingPalletId, + SlpEntrancePalletId, SlpExitPalletId, SystemMakerPalletId, SystemStakingPalletId, + TreasuryPalletId, BNC, BNC_DECIMALS, DOT, VDOT, +}; +use cumulus_pallet_parachain_system::RelayChainState; +use cumulus_pallet_parachain_system::{RelayNumberMonotonicallyIncreases, RelaychainDataProvider}; +pub use frame_support::{ + construct_runtime, match_types, parameter_types, + traits::{ + ConstBool, ConstU128, ConstU32, ConstU64, ConstU8, Contains, EqualPrivilegeOnly, + Everything, Imbalance, InstanceFilter, IsInVec, LockIdentifier, NeverEnsureOrigin, Nothing, + OnUnbalanced, Randomness, WithdrawReasons, + }, + weights::{ + constants::{ + BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_REF_TIME_PER_SECOND, + }, + ConstantMultiplier, IdentityFee, Weight, + }, + PalletId, StorageValue, +}; +use frame_system::limits::{BlockLength, BlockWeights}; +use ismp::host::StateMachine; +use orml_oracle::{DataFeeder, DataProvider, DataProviderExtended}; +pub use pallet_balances::Call as BalancesCall; +pub use pallet_timestamp::Call as TimestampCall; +use sp_api::impl_runtime_apis; +use sp_arithmetic::Percent; +use sp_core::{OpaqueMetadata, H160, H256, U256}; +use sp_runtime::{ + create_runtime_str, generic, impl_opaque_keys, + traits::{AccountIdConversion, BlakeTwo256, Block as BlockT, Zero}, + transaction_validity::{TransactionSource, TransactionValidity}, + ApplyExtrinsicResult, DispatchError, DispatchResult, FixedU128, Perbill, Permill, RuntimeDebug, +}; +use sp_std::{marker::PhantomData, prelude::*}; +#[cfg(feature = "std")] +use sp_version::NativeVersion; +use sp_version::RuntimeVersion; + +/// Constant values used within the runtime. +pub mod constants; +mod evm; +mod migration; +pub mod weights; +use bb_bnc::traits::BbBNCInterface; +use bifrost_asset_registry::AssetIdMaps; +pub use bifrost_primitives::{ + traits::{ + CheckSubAccount, FarmingInfo, VtokenMintingInterface, VtokenMintingOperator, + XcmDestWeightAndFeeHandler, + }, + AccountId, Amount, AssetIds, Balance, BlockNumber, CurrencyId, CurrencyIdMapping, + DistributionId, Liquidity, Moment, Nonce, ParaId, PoolId, Price, Rate, Ratio, + RpcContributionStatus, Shortfall, TimeUnit, TokenSymbol, DOT_TOKEN_ID, GLMR_TOKEN_ID, +}; +use bifrost_runtime_common::{ + constants::time::*, dollar, micro, milli, AuraId, CouncilCollective, + EnsureRootOrAllTechnicalCommittee, MoreThanHalfCouncil, SlowAdjustingFeeUpdate, + TechnicalCollective, +}; +use bifrost_slp::QueryId; +use constants::currency::*; +use cumulus_primitives_core::AggregateMessageOrigin; +use fp_evm::FeeCalculator; +use fp_rpc::TransactionStatus; +use frame_support::{ + dispatch::DispatchClass, + genesis_builder_helper::{build_state, get_preset}, + sp_runtime::traits::{Convert, ConvertInto}, + traits::{ + fungible::HoldConsideration, + tokens::{PayFromAccount, UnityAssetBalanceConversion}, + Currency, EitherOf, EitherOfDiverse, Get, InsideBoth, LinearStoragePrice, OnFinalize, + }, +}; +use frame_system::{EnsureRoot, EnsureRootWithSuccess, EnsureSigned}; +use hex_literal::hex; +use pallet_ethereum::Transaction; +use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; +use zenlink_protocol::{ + AssetBalance, AssetId as ZenlinkAssetId, LocalAssetHandler, MultiAssetsHandler, PairInfo, + PairLpGenerate, ZenlinkMultiAssets, +}; +pub mod xcm_config; +use orml_traits::{currency::MutationHooks, location::RelativeReserveProvider}; +use pallet_evm::{GasWeightMapping, Runner}; +use pallet_identity::legacy::IdentityInfo; +use pallet_xcm::{EnsureResponse, QueryStatus}; +use polkadot_runtime_common::prod_or_fast; +use sp_arithmetic::traits::UniqueSaturatedInto; +use sp_runtime::{ + traits::{DispatchInfoOf, Dispatchable, IdentityLookup, PostDispatchInfoOf, Verify}, + transaction_validity::TransactionValidityError, +}; +use static_assertions::const_assert; +use xcm::{ + v3::MultiLocation, v4::prelude::*, VersionedAssetId, VersionedAssets, VersionedLocation, + VersionedXcm, +}; +pub use xcm_config::{BifrostTreasuryAccount, MultiCurrency}; +use xcm_executor::{traits::QueryHandler, XcmExecutor}; + +pub mod governance; +mod hyperbridge; + +use crate::xcm_config::XcmRouter; +use bifrost_primitives::OraclePriceProvider; +use frame_support::weights::WeightToFee as _; +use governance::{ + custom_origins, CoreAdminOrCouncil, LiquidStaking, SALPAdmin, Spender, TechAdmin, + TechAdminOrCouncil, +}; +use ismp::{ + consensus::{ConsensusClientId, StateMachineHeight, StateMachineId}, + router::{Request, Response}, +}; +use pallet_ismp::offchain::Leaf; +use pallet_ismp::offchain::Proof; +use pallet_ismp::offchain::ProofKeys; +use xcm::IntoVersion; +use xcm_runtime_apis::{ + dry_run::{CallDryRunEffects, Error as XcmDryRunApiError, XcmDryRunEffects}, + fees::Error as XcmPaymentApiError, +}; + +use bifrost_primitives::MoonbeamChainId; +#[cfg(feature = "runtime-benchmarks")] +use bifrost_primitives::{MockXcmRouter, MockXcmTransfer}; +use bifrost_runtime_common::currency_converter::CurrencyIdConvert; + +/// Opaque types. These are used by the CLI to instantiate machinery that don't need to know +/// the specifics of the runtime. They can then be made to be agnostic over specific formats +/// of data like extrinsics, allowing for them to continue syncing the network through upgrades +/// to even the core data structures. +pub mod opaque { + use super::*; + use cumulus_primitives_core::relay_chain::HashT; + + pub use sp_runtime::OpaqueExtrinsic as UncheckedExtrinsic; + + /// Opaque block header type. + pub type Header = generic::Header; + /// Opaque block type. + pub type Block = generic::Block; + /// Opaque block identifier type. + pub type BlockId = generic::BlockId; + /// Opaque block hash type. + pub type Hash = ::Output; + + impl_opaque_keys! { + pub struct SessionKeys { + pub aura: Aura, + } + } +} + +/// This runtime version. +#[sp_version::runtime_version] +pub const VERSION: RuntimeVersion = RuntimeVersion { + spec_name: create_runtime_str!("bifrost_paseo"), + impl_name: create_runtime_str!("bifrost_paseo"), + authoring_version: 0, + spec_version: 16000, + impl_version: 0, + apis: RUNTIME_API_VERSIONS, + transaction_version: 1, + state_version: 0, +}; + +/// The version information used to identify this runtime when compiled natively. +#[cfg(feature = "std")] +pub fn native_version() -> NativeVersion { + NativeVersion { + runtime_version: VERSION, + can_author_with: Default::default(), + } +} + +/// We assume that ~10% of the block weight is consumed by `on_initalize` handlers. +/// This is used to limit the maximal weight of a single extrinsic. +const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10); +/// We allow `Normal` extrinsics to fill up the block up to 75%, the rest can be used +/// by Operational extrinsics. +const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); +/// We allow for 0.5 of a second of compute with a 12 second average block time. +const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts( + WEIGHT_REF_TIME_PER_SECOND.saturating_div(2), + cumulus_primitives_core::relay_chain::MAX_POV_SIZE as u64, +); + +parameter_types! { + pub const BlockHashCount: BlockNumber = 250; + pub const Version: RuntimeVersion = VERSION; + pub RuntimeBlockLength: BlockLength = + BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO); + pub RuntimeBlockWeights: BlockWeights = BlockWeights::builder() + .base_block(BlockExecutionWeight::get()) + .for_class(DispatchClass::all(), |weights| { + weights.base_extrinsic = ExtrinsicBaseWeight::get(); + }) + .for_class(DispatchClass::Normal, |weights| { + weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT); + }) + .for_class(DispatchClass::Operational, |weights| { + weights.max_total = Some(MAXIMUM_BLOCK_WEIGHT); + // Operational transactions have some extra reserved space, so that they + // are included even if block reached `MAXIMUM_BLOCK_WEIGHT`. + weights.reserved = Some( + MAXIMUM_BLOCK_WEIGHT - NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT + ); + }) + .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO) + .build_or_panic(); + pub const SS58Prefix: u8 = 0; +} + +parameter_types! { + pub const NativeCurrencyId: CurrencyId = BNC; + pub const BncDecimals: u8 = BNC_DECIMALS; + pub const RelayCurrencyId: CurrencyId = DOT; + pub const RelayVCurrencyId: CurrencyId = VDOT; + pub SelfParaId: u32 = ParachainInfo::parachain_id().into(); +} + +parameter_types! { + pub CheckingAccount: AccountId = PolkadotXcm::check_account(); + pub const StableAssetPalletId: PalletId = PalletId(*b"bf/stabl"); +} + +impl frame_system::Config for Runtime { + type AccountData = pallet_balances::AccountData; + /// The identifier used to distinguish between accounts. + type AccountId = AccountId; + type BaseCallFilter = InsideBoth; + /// Maximum number of block number to block hash mappings to keep (oldest pruned first). + type BlockHashCount = BlockHashCount; + type BlockLength = RuntimeBlockLength; + /// The index type for blocks. + type Nonce = Nonce; + type BlockWeights = RuntimeBlockWeights; + /// The aggregated dispatch type that is available for extrinsics. + type RuntimeCall = RuntimeCall; + type DbWeight = RocksDbWeight; + /// The ubiquitous event type. + type RuntimeEvent = RuntimeEvent; + /// The type for hashing blocks and tries. + type Hash = Hash; + /// The hashing algorithm used. + type Hashing = BlakeTwo256; + type Block = Block; + /// The lookup mechanism to get account ID from whatever is passed in dispatchers. + type Lookup = Indices; + type OnKilledAccount = (); + type OnNewAccount = (); + type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; + /// The ubiquitous origin type. + type RuntimeOrigin = RuntimeOrigin; + /// Converts a module to an index of this module in the runtime. + type PalletInfo = PalletInfo; + type SS58Prefix = SS58Prefix; + type SystemWeightInfo = frame_system::weights::SubstrateWeight; + /// Runtime version. + type Version = Version; + type MaxConsumers = ConstU32<16>; + type RuntimeTask = (); + type SingleBlockMigrations = (); + type MultiBlockMigrator = (); + type PreInherents = (); + type PostInherents = (); + type PostTransactions = (); +} + +impl pallet_timestamp::Config for Runtime { + type MinimumPeriod = ConstU64<{ SLOT_DURATION / 2 }>; + /// A timestamp: milliseconds since the unix epoch. + type Moment = Moment; + type OnTimestampSet = Aura; + type WeightInfo = pallet_timestamp::weights::SubstrateWeight; +} + +parameter_types! { + pub const ExistentialDeposit: Balance = 10 * MILLIBNC; + pub const TransferFee: Balance = 1 * MILLIBNC; + pub const CreationFee: Balance = 1 * MILLIBNC; + pub const TransactionByteFee: Balance = 16 * MICROBNC; +} + +impl pallet_utility::Config for Runtime { + type RuntimeCall = RuntimeCall; + type RuntimeEvent = RuntimeEvent; + type PalletsOrigin = OriginCaller; + type WeightInfo = pallet_utility::weights::SubstrateWeight; +} + +parameter_types! { + // One storage item; key size 32, value size 8; . + pub const ProxyDepositBase: Balance = deposit(1, 8); + // Additional storage item size of 33 bytes. + pub const ProxyDepositFactor: Balance = deposit(0, 33); + pub const MaxProxies: u16 = 32; + pub const AnnouncementDepositBase: Balance = deposit(1, 8); + pub const AnnouncementDepositFactor: Balance = deposit(0, 66); + pub const MaxPending: u16 = 32; +} + +/// The type used to represent the kinds of proxying allowed. +#[derive( + Copy, + Clone, + Eq, + PartialEq, + Ord, + PartialOrd, + Encode, + Decode, + RuntimeDebug, + MaxEncodedLen, + scale_info::TypeInfo, +)] +pub enum ProxyType { + Any = 0, + NonTransfer = 1, + Governance = 2, + CancelProxy = 3, + IdentityJudgement = 4, + Staking = 5, +} + +impl Default for ProxyType { + fn default() -> Self { + Self::Any + } +} +impl InstanceFilter for ProxyType { + fn filter(&self, c: &RuntimeCall) -> bool { + match self { + ProxyType::Any => true, + ProxyType::NonTransfer => matches!( + c, + RuntimeCall::System(..) | + RuntimeCall::Scheduler(..) | + RuntimeCall::Preimage(_) | + RuntimeCall::Timestamp(..) | + RuntimeCall::Indices(pallet_indices::Call::claim{..}) | + RuntimeCall::Indices(pallet_indices::Call::free{..}) | + RuntimeCall::Indices(pallet_indices::Call::freeze{..}) | + // Specifically omitting Indices `transfer`, `force_transfer` + // Specifically omitting the entire Balances pallet + RuntimeCall::Session(..) | + RuntimeCall::Democracy(..) | + RuntimeCall::Council(..) | + RuntimeCall::TechnicalCommittee(..) | + RuntimeCall::PhragmenElection(..) | + RuntimeCall::TechnicalMembership(..) | + RuntimeCall::Treasury(..) | + RuntimeCall::Vesting(bifrost_vesting::Call::vest{..}) | + RuntimeCall::Vesting(bifrost_vesting::Call::vest_other{..}) | + // Specifically omitting Vesting `vested_transfer`, and `force_vested_transfer` + RuntimeCall::Utility(..) | + RuntimeCall::Proxy(..) | + RuntimeCall::Multisig(..) | + RuntimeCall::ParachainStaking(..) + ), + ProxyType::Staking => { + matches!( + c, + RuntimeCall::ParachainStaking(..) | RuntimeCall::Utility(..) + ) + } + ProxyType::Governance => matches!( + c, + RuntimeCall::Democracy(..) + | RuntimeCall::Council(..) + | RuntimeCall::TechnicalCommittee(..) + | RuntimeCall::PhragmenElection(..) + | RuntimeCall::Treasury(..) + | RuntimeCall::Utility(..) + ), + ProxyType::CancelProxy => { + matches!( + c, + RuntimeCall::Proxy(pallet_proxy::Call::reject_announcement { .. }) + ) + } + ProxyType::IdentityJudgement => matches!( + c, + RuntimeCall::Identity(pallet_identity::Call::provide_judgement { .. }) + | RuntimeCall::Utility(..) + ), + } + } + + fn is_superset(&self, o: &Self) -> bool { + match (self, o) { + (x, y) if x == y => true, + (ProxyType::Any, _) => true, + (_, ProxyType::Any) => false, + (ProxyType::NonTransfer, _) => true, + _ => false, + } + } +} + +impl pallet_proxy::Config for Runtime { + type AnnouncementDepositBase = AnnouncementDepositBase; + type AnnouncementDepositFactor = AnnouncementDepositFactor; + type RuntimeCall = RuntimeCall; + type CallHasher = BlakeTwo256; + type Currency = Balances; + type RuntimeEvent = RuntimeEvent; + type MaxPending = MaxPending; + type MaxProxies = MaxProxies; + type ProxyDepositBase = ProxyDepositBase; + type ProxyDepositFactor = ProxyDepositFactor; + type ProxyType = ProxyType; + type WeightInfo = pallet_proxy::weights::SubstrateWeight; +} + +parameter_types! { + pub const PreimageMaxSize: u32 = 4096 * 1024; + pub PreimageBaseDeposit: Balance = deposit(2, 64); + pub PreimageByteDeposit: Balance = deposit(0, 1); + pub const PreimageHoldReason: RuntimeHoldReason = RuntimeHoldReason::Preimage(pallet_preimage::HoldReason::Preimage); +} + +impl pallet_preimage::Config for Runtime { + type WeightInfo = pallet_preimage::weights::SubstrateWeight; + type RuntimeEvent = RuntimeEvent; + type Currency = Balances; + type ManagerOrigin = EnsureRoot; + type Consideration = HoldConsideration< + AccountId, + Balances, + PreimageHoldReason, + LinearStoragePrice, + >; +} + +parameter_types! { + pub MaximumSchedulerWeight: Weight = Perbill::from_percent(80) * + RuntimeBlockWeights::get().max_block; + pub const MaxScheduledPerBlock: u32 = 50; + pub const NoPreimagePostponement: Option = Some(10); +} + +impl pallet_scheduler::Config for Runtime { + type RuntimeCall = RuntimeCall; + type RuntimeEvent = RuntimeEvent; + type MaxScheduledPerBlock = MaxScheduledPerBlock; + type MaximumWeight = MaximumSchedulerWeight; + type RuntimeOrigin = RuntimeOrigin; + type OriginPrivilegeCmp = EqualPrivilegeOnly; + type PalletsOrigin = OriginCaller; + type ScheduleOrigin = EnsureRoot; + type WeightInfo = pallet_scheduler::weights::SubstrateWeight; + type Preimages = Preimage; +} + +parameter_types! { + // One storage item; key size is 32; value is size 4+4+16+32 bytes = 56 bytes. + pub const DepositBase: Balance = deposit(1, 88); + // Additional storage item size of 32 bytes. + pub const DepositFactor: Balance = deposit(0, 32); + pub const MaxSignatories: u16 = 100; +} + +impl pallet_multisig::Config for Runtime { + type RuntimeCall = RuntimeCall; + type Currency = Balances; + type DepositBase = DepositBase; + type DepositFactor = DepositFactor; + type RuntimeEvent = RuntimeEvent; + type MaxSignatories = MaxSignatories; + type WeightInfo = pallet_multisig::weights::SubstrateWeight; +} + +parameter_types! { + // 1 entry, storing 258 bytes on-chain + pub const BasicDeposit: Balance = deposit(1, 258); + // Additional bytes adds 0 entries, storing 1 byte on-chain + pub const ByteDeposit: Balance = deposit(0, 1); + // 1 entry, storing 53 bytes on-chain + pub const SubAccountDeposit: Balance = deposit(1, 53); + pub const MaxSubAccounts: u32 = 100; + pub const MaxAdditionalFields: u32 = 100; + pub const MaxRegistrars: u32 = 20; +} + +impl pallet_identity::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type Currency = Balances; + type BasicDeposit = BasicDeposit; + type SubAccountDeposit = SubAccountDeposit; + type MaxSubAccounts = MaxSubAccounts; + type IdentityInformation = IdentityInfo; + type MaxRegistrars = MaxRegistrars; + type Slashed = Treasury; + type ForceOrigin = MoreThanHalfCouncil; + type RegistrarOrigin = MoreThanHalfCouncil; + type WeightInfo = pallet_identity::weights::SubstrateWeight; + type ByteDeposit = ByteDeposit; + type OffchainSignature = Signature; + type SigningPublicKey = ::Signer; + type UsernameAuthorityOrigin = EnsureRoot; + type PendingUsernameExpiration = ConstU32<{ 7 * DAYS }>; + type MaxSuffixLength = ConstU32<7>; + type MaxUsernameLength = ConstU32<32>; +} + +parameter_types! { + pub const IndexDeposit: Balance = 10 * DOLLARS; +} + +impl pallet_indices::Config for Runtime { + type AccountIndex = AccountIndex; + type Currency = Balances; + type Deposit = IndexDeposit; + type RuntimeEvent = RuntimeEvent; + type WeightInfo = pallet_indices::weights::SubstrateWeight; +} + +// pallet-treasury did not impl OnUnbalanced, need an adapter to handle dust. +type CreditOf = + frame_support::traits::fungible::Credit<::AccountId, Balances>; +pub struct DustRemovalAdapter; +impl OnUnbalanced for DustRemovalAdapter { + fn on_nonzero_unbalanced(amount: CreditOf) { + let _ = >::deposit_creating( + &TreasuryPalletId::get().into_account_truncating(), + amount.peek(), + ); + } +} + +impl pallet_balances::Config for Runtime { + type AccountStore = System; + /// The type for recording an account's balance. + type Balance = Balance; + type DustRemoval = DustRemovalAdapter; + /// The ubiquitous event type. + type RuntimeEvent = RuntimeEvent; + type ExistentialDeposit = ExistentialDeposit; + type MaxLocks = ConstU32<50>; + type MaxReserves = ConstU32<50>; + type ReserveIdentifier = [u8; 8]; + type FreezeIdentifier = (); + type MaxFreezes = ConstU32<0>; + type WeightInfo = pallet_balances::weights::SubstrateWeight; + type RuntimeHoldReason = RuntimeHoldReason; + type RuntimeFreezeReason = RuntimeFreezeReason; +} + +parameter_types! { + pub const CouncilMotionDuration: BlockNumber = 7 * DAYS; + pub const CouncilMaxProposals: u32 = 100; + pub const CouncilMaxMembers: u32 = 100; +} + +impl pallet_collective::Config for Runtime { + type DefaultVote = pallet_collective::PrimeDefaultVote; + type RuntimeEvent = RuntimeEvent; + type MaxMembers = CouncilMaxMembers; + type MaxProposals = CouncilMaxProposals; + type MotionDuration = CouncilMotionDuration; + type RuntimeOrigin = RuntimeOrigin; + type Proposal = RuntimeCall; + type WeightInfo = pallet_collective::weights::SubstrateWeight; + type MaxProposalWeight = MaxProposalWeight; + type SetMembersOrigin = EnsureRoot; +} + +parameter_types! { + pub const TechnicalMotionDuration: BlockNumber = 7 * DAYS; + pub const TechnicalMaxProposals: u32 = 100; + pub const TechnicalMaxMembers: u32 = 100; + pub MaxProposalWeight: Weight = Perbill::from_percent(50) * RuntimeBlockWeights::get().max_block; +} + +impl pallet_collective::Config for Runtime { + type DefaultVote = pallet_collective::PrimeDefaultVote; + type RuntimeEvent = RuntimeEvent; + type MaxMembers = TechnicalMaxMembers; + type MaxProposals = TechnicalMaxProposals; + type MotionDuration = TechnicalMotionDuration; + type RuntimeOrigin = RuntimeOrigin; + type Proposal = RuntimeCall; + type WeightInfo = pallet_collective::weights::SubstrateWeight; + type MaxProposalWeight = MaxProposalWeight; + type SetMembersOrigin = EnsureRoot; +} + +impl pallet_membership::Config for Runtime { + type AddOrigin = MoreThanHalfCouncil; + type RuntimeEvent = RuntimeEvent; + type MaxMembers = CouncilMaxMembers; + type MembershipChanged = Council; + type MembershipInitialized = Council; + type PrimeOrigin = MoreThanHalfCouncil; + type RemoveOrigin = MoreThanHalfCouncil; + type ResetOrigin = MoreThanHalfCouncil; + type SwapOrigin = MoreThanHalfCouncil; + type WeightInfo = pallet_membership::weights::SubstrateWeight; +} + +impl pallet_membership::Config for Runtime { + type AddOrigin = MoreThanHalfCouncil; + type RuntimeEvent = RuntimeEvent; + type MaxMembers = TechnicalMaxMembers; + type MembershipChanged = TechnicalCommittee; + type MembershipInitialized = TechnicalCommittee; + type PrimeOrigin = MoreThanHalfCouncil; + type RemoveOrigin = MoreThanHalfCouncil; + type ResetOrigin = MoreThanHalfCouncil; + type SwapOrigin = MoreThanHalfCouncil; + type WeightInfo = pallet_membership::weights::SubstrateWeight; +} + +parameter_types! { + pub const CandidacyBond: Balance = 10_000 * DOLLARS; + // 1 storage item created, key size is 32 bytes, value size is 16+16. + pub const VotingBondBase: Balance = deposit(1, 64); + // additional data per vote is 32 bytes (account id). + pub const VotingBondFactor: Balance = deposit(0, 32); + /// Daily council elections + pub const TermDuration: BlockNumber = 7 * DAYS; + pub const DesiredMembers: u32 = 3; + pub const DesiredRunnersUp: u32 = 20; + pub const PhragmenElectionPalletId: LockIdentifier = *b"phrelect"; + pub const MaxVoters: u32 = 512; + pub const MaxVotesPerVoter: u32 = 16; + pub const MaxCandidates: u32 = 64; +} + +// Make sure that there are no more than MaxMembers members elected via phragmen. +const_assert!(DesiredMembers::get() <= CouncilMaxMembers::get()); + +impl pallet_elections_phragmen::Config for Runtime { + type CandidacyBond = CandidacyBond; + type ChangeMembers = Council; + type Currency = Balances; + type CurrencyToVote = sp_staking::currency_to_vote::U128CurrencyToVote; + type DesiredMembers = DesiredMembers; + type DesiredRunnersUp = DesiredRunnersUp; + type RuntimeEvent = RuntimeEvent; + type InitializeMembers = Council; + type KickedMember = Treasury; + type LoserCandidate = Treasury; + type PalletId = PhragmenElectionPalletId; + type TermDuration = TermDuration; + type VotingBondBase = VotingBondBase; + type VotingBondFactor = VotingBondFactor; + type MaxCandidates = MaxCandidates; + type MaxVoters = MaxVoters; + type MaxVotesPerVoter = MaxVotesPerVoter; + type WeightInfo = pallet_elections_phragmen::weights::SubstrateWeight; +} + +parameter_types! { + pub const LaunchPeriod: BlockNumber = 28 * DAYS; + pub const VotingPeriod: BlockNumber = 28 * DAYS; + pub const FastTrackVotingPeriod: BlockNumber = 3 * HOURS; + pub const MinimumDeposit: Balance = 100 * DOLLARS; + pub const EnactmentPeriod: BlockNumber = 28 * DAYS; + pub const CooloffPeriod: BlockNumber = 7 * DAYS; + pub const InstantAllowed: bool = true; + pub const MaxVotes: u32 = 100; + pub const MaxProposals: u32 = 100; +} + +impl pallet_democracy::Config for Runtime { + type BlacklistOrigin = EnsureRoot; + // To cancel a proposal before it has been passed, the technical committee must be unanimous or + // Root must agree. + type CancelProposalOrigin = EitherOfDiverse< + EnsureRoot, + pallet_collective::EnsureProportionAtLeast, + >; + // To cancel a proposal which has been passed, 2/3 of the council must agree to it. + type CancellationOrigin = + pallet_collective::EnsureProportionAtLeast; + type CooloffPeriod = CooloffPeriod; + type Currency = Balances; + type EnactmentPeriod = EnactmentPeriod; + type RuntimeEvent = RuntimeEvent; + /// A unanimous council can have the next scheduled referendum be a straight default-carries + /// (NTB) vote. + type ExternalDefaultOrigin = + pallet_collective::EnsureProportionAtLeast; + /// A super-majority can have the next scheduled referendum be a straight majority-carries vote. + type ExternalMajorityOrigin = + pallet_collective::EnsureProportionAtLeast; + /// A straight majority of the council can decide what their next motion is. + type ExternalOrigin = + pallet_collective::EnsureProportionAtLeast; + /// Two thirds of the technical committee can have an ExternalMajority/ExternalDefault vote + /// be tabled immediately and with a shorter voting/enactment period. + type FastTrackOrigin = + pallet_collective::EnsureProportionAtLeast; + type FastTrackVotingPeriod = FastTrackVotingPeriod; + type InstantAllowed = InstantAllowed; + type InstantOrigin = + pallet_collective::EnsureProportionAtLeast; + type LaunchPeriod = LaunchPeriod; + type MaxProposals = MaxProposals; + type MaxVotes = MaxVotes; + type MinimumDeposit = MinimumDeposit; + type PalletsOrigin = OriginCaller; + type Scheduler = Scheduler; + type Slash = Treasury; + // Any single technical committee member may veto a coming council proposal, however they can + // only do it once and it lasts only for the cool-off period. + type VetoOrigin = pallet_collective::EnsureMember; + type VoteLockingPeriod = EnactmentPeriod; // Same as EnactmentPeriod + type VotingPeriod = VotingPeriod; + type WeightInfo = pallet_democracy::weights::SubstrateWeight; + type Preimages = Preimage; + type MaxDeposits = ConstU32<100>; + type MaxBlacklisted = ConstU32<100>; + type SubmitOrigin = EnsureSigned; +} + +parameter_types! { + pub const ProposalBond: Permill = Permill::from_percent(5); + pub const ProposalBondMinimum: Balance = 100 * DOLLARS; + pub const ProposalBondMaximum: Balance = 500 * DOLLARS; + pub const SpendPeriod: BlockNumber = 6 * DAYS; + pub const PayoutSpendPeriod: BlockNumber = 30 * DAYS; + pub const Burn: Permill = Permill::from_perthousand(0); + pub const TipReportDepositBase: Balance = 1 * DOLLARS; + pub const DataDepositPerByte: Balance = 1 * CENTS; + pub const MaxApprovals: u32 = 100; + pub const MaxBalance: Balance = 800_000 * BNCS; +} + +impl pallet_treasury::Config for Runtime { + type SpendOrigin = EitherOf, Spender>; + type Burn = Burn; + type BurnDestination = (); + type Currency = Balances; + type RuntimeEvent = RuntimeEvent; + type MaxApprovals = MaxApprovals; + type AssetKind = (); + type Beneficiary = AccountId; + type BeneficiaryLookup = IdentityLookup; + type Paymaster = PayFromAccount; + type BalanceConverter = UnityAssetBalanceConversion; + type PayoutPeriod = PayoutSpendPeriod; + #[cfg(feature = "runtime-benchmarks")] + type BenchmarkHelper = (); + type PalletId = TreasuryPalletId; + type RejectOrigin = MoreThanHalfCouncil; + type SpendFunds = (); + type SpendPeriod = SpendPeriod; + type WeightInfo = pallet_treasury::weights::SubstrateWeight; +} + +impl pallet_transaction_payment::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type FeeMultiplierUpdate = SlowAdjustingFeeUpdate; + type LengthToFee = ConstantMultiplier; + type OnChargeTransaction = FlexibleFee; + type OperationalFeeMultiplier = ConstU8<5>; + type WeightToFee = WeightToFee; +} + +/// Calls that can bypass the tx-pause pallet. +/// We always allow system calls and timestamp since it is required for block production +pub struct TxPauseWhitelistedCalls; +impl Contains> for TxPauseWhitelistedCalls { + fn contains(full_name: &pallet_tx_pause::RuntimeCallNameOf) -> bool { + matches!( + full_name.0.as_slice(), + b"System" | b"Timestamp" | b"TxPause" + ) + } +} + +impl pallet_tx_pause::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; + type PauseOrigin = TechAdminOrCouncil; + type UnpauseOrigin = TechAdminOrCouncil; + type WhitelistedCalls = TxPauseWhitelistedCalls; + type MaxNameLen = ConstU32<256>; + type WeightInfo = pallet_tx_pause::weights::SubstrateWeight; +} + +// culumus runtime start +parameter_types! { + pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); + pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); + pub const RelayOrigin: AggregateMessageOrigin = AggregateMessageOrigin::Parent; +} + +type ConsensusHook = cumulus_pallet_aura_ext::FixedVelocityConsensusHook< + Runtime, + RELAY_CHAIN_SLOT_DURATION_MILLIS, + BLOCK_PROCESSING_VELOCITY, + UNINCLUDED_SEGMENT_CAPACITY, +>; + +impl cumulus_pallet_parachain_system::Config for Runtime { + type DmpQueue = frame_support::traits::EnqueueWithOrigin; + type RuntimeEvent = RuntimeEvent; + type OnSystemEvent = (); + type OutboundXcmpMessageSource = XcmpQueue; + type ReservedDmpWeight = ReservedDmpWeight; + type ReservedXcmpWeight = ReservedXcmpWeight; + type SelfParaId = parachain_info::Pallet; + type XcmpMessageHandler = XcmpQueue; + type CheckAssociatedRelayNumber = RelayNumberMonotonicallyIncreases; + type ConsensusHook = ConsensusHook; + type WeightInfo = cumulus_pallet_parachain_system::weights::SubstrateWeight; +} + +impl parachain_info::Config for Runtime {} + +impl cumulus_pallet_aura_ext::Config for Runtime {} + +parameter_types! { + /// Minimum round length is 2 minutes (10 * 12 second block times) + pub const MinBlocksPerRound: u32 = 10; + /// Rounds before the collator leaving the candidates request can be executed + pub const LeaveCandidatesDelay: u32 = 84; + /// Rounds before the candidate bond increase/decrease can be executed + pub const CandidateBondLessDelay: u32 = 84; + /// Rounds before the delegator exit can be executed + pub const LeaveDelegatorsDelay: u32 = 84; + /// Rounds before the delegator revocation can be executed + pub const RevokeDelegationDelay: u32 = 84; + /// Rounds before the delegator bond increase/decrease can be executed + pub const DelegationBondLessDelay: u32 = 84; + /// Rounds before the reward is paid + pub const RewardPaymentDelay: u32 = 2; + /// Minimum collators selected per round, default at genesis and minimum forever after + pub const MinSelectedCandidates: u32 = prod_or_fast!(16,6); + /// Maximum top delegations per candidate + pub const MaxTopDelegationsPerCandidate: u32 = 300; + /// Maximum bottom delegations per candidate + pub const MaxBottomDelegationsPerCandidate: u32 = 50; + /// Maximum delegations per delegator + pub const MaxDelegationsPerDelegator: u32 = 100; + /// Minimum stake required to become a collator + pub MinCollatorStk: u128 = 5000 * BNCS; + /// Minimum stake required to be reserved to be a candidate + pub MinCandidateStk: u128 = 5000 * BNCS; + /// Minimum stake required to be reserved to be a delegator + pub MinDelegatorStk: u128 = 50 * BNCS; + pub AllowInflation: bool = false; + pub ToMigrateInvulnables: Vec = prod_or_fast!(vec![ + hex!["5c7e9ccd1045cac7f8c5c77a79c87f44019d1dda4f5032713bda89c5d73cb36b"].into(), + hex!["606b0aad375ae1715fbe6a07315136a8e9c1c84a91230f6a0c296c2953581335"].into(), + hex!["b6ba81e73bd39203e006fc99cc1e41976745de2ea2007bf62ed7c9a48ccc5b1d"].into(), + hex!["ce42cea2dd0d4ac87ccdd5f0f2e1010955467f5a37587cf6af8ee2b4ba781034"].into(), + ],vec![]); + pub PaymentInRound: u128 = 180 * BNCS; + pub InitSeedStk: u128 = 5000 * BNCS; +} +impl bifrost_parachain_staking::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type Currency = Balances; + type MonetaryGovernanceOrigin = + EitherOfDiverse; + type MinBlocksPerRound = MinBlocksPerRound; + type LeaveCandidatesDelay = LeaveCandidatesDelay; + type CandidateBondLessDelay = CandidateBondLessDelay; + type LeaveDelegatorsDelay = LeaveDelegatorsDelay; + type RevokeDelegationDelay = RevokeDelegationDelay; + type DelegationBondLessDelay = DelegationBondLessDelay; + type RewardPaymentDelay = RewardPaymentDelay; + type MinSelectedCandidates = MinSelectedCandidates; + type MaxTopDelegationsPerCandidate = MaxTopDelegationsPerCandidate; + type MaxBottomDelegationsPerCandidate = MaxBottomDelegationsPerCandidate; + type MaxDelegationsPerDelegator = MaxDelegationsPerDelegator; + type MinCollatorStk = MinCollatorStk; + type MinCandidateStk = MinCandidateStk; + type MinDelegation = MinDelegatorStk; + type MinDelegatorStk = MinDelegatorStk; + type AllowInflation = AllowInflation; + type PaymentInRound = PaymentInRound; + type ToMigrateInvulnables = ToMigrateInvulnables; + type PalletId = ParachainStakingPalletId; + type InitSeedStk = InitSeedStk; + type OnCollatorPayout = (); + type OnNewRound = (); + type WeightInfo = bifrost_parachain_staking::weights::SubstrateWeight; +} + +parameter_types! { + pub const Period: u32 = 6 * HOURS; + pub const Offset: u32 = 0; +} + +impl pallet_session::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type Keys = opaque::SessionKeys; + type NextSessionRotation = ParachainStaking; + // Essentially just Aura, but lets be pedantic. + type SessionHandler = + ::KeyTypeIdProviders; + type SessionManager = ParachainStaking; + type ShouldEndSession = ParachainStaking; + type ValidatorId = ::AccountId; + // we don't have stash and controller, thus we don't need the convert as well. + type ValidatorIdOf = ConvertInto; + type WeightInfo = pallet_session::weights::SubstrateWeight; +} + +impl pallet_authorship::Config for Runtime { + type EventHandler = ParachainStaking; + type FindAuthor = pallet_session::FindAccountFromAuthorIndex; +} + +impl pallet_aura::Config for Runtime { + type AuthorityId = AuraId; + type DisabledValidators = (); + type MaxAuthorities = ConstU32<100_000>; + type AllowMultipleBlocksPerSlot = ConstBool; + type SlotDuration = ConstU64; +} + +// culumus runtime end + +parameter_types! { + pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons = + WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE); +} + +impl bifrost_vesting::Config for Runtime { + type BlockNumberToBalance = ConvertInto; + type Currency = Balances; + type RuntimeEvent = RuntimeEvent; + type MinVestedTransfer = ExistentialDeposit; + type WeightInfo = weights::bifrost_vesting::BifrostWeight; + type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons; + const MAX_VESTING_SCHEDULES: u32 = 28; + type BlockNumberProvider = System; +} + +// Bifrost modules start + +parameter_types! { + pub MaxFeeCurrencyOrderListLen: u32 = 50; + pub AllowVBNCAsFee: bool = true; +} + +impl bifrost_flexible_fee::Config for Runtime { + type DexOperator = ZenlinkProtocol; + type RuntimeEvent = RuntimeEvent; + type MultiCurrency = Currencies; + type TreasuryAccount = BifrostTreasuryAccount; + type MaxFeeCurrencyOrderListLen = MaxFeeCurrencyOrderListLen; + type WeightInfo = weights::bifrost_flexible_fee::BifrostWeight; + type ParachainId = ParachainInfo; + type ControlOrigin = TechAdminOrCouncil; + type XcmWeightAndFeeHandler = XcmInterface; + type MinAssetHubExecutionFee = ConstU128<{ 20 * CENTS }>; + type MinRelaychainExecutionFee = ConstU128<{ 20 * CENTS }>; + type RelaychainCurrencyId = RelayCurrencyId; + type XcmRouter = XcmRouter; + type PalletId = FlexibleFeePalletId; + type OraclePriceProvider = Prices; + type InspectEvmAccounts = EVMAccounts; + type EvmPermit = evm::permit::EvmPermitHandler; + type AssetIdMaps = AssetIdMaps; + type AllowVBNCAsFee = AllowVBNCAsFee; +} + +parameter_types! { + pub BifrostParachainAccountId20: [u8; 20] = cumulus_primitives_core::ParaId::from(ParachainInfo::get()).into_account_truncating(); +} + +pub fn create_x2_multilocation(index: u16, currency_id: CurrencyId) -> MultiLocation { + match currency_id { + CurrencyId::Token2(GLMR_TOKEN_ID) => MultiLocation::new( + 1, + xcm::v3::Junctions::X2( + xcm::v3::Junction::Parachain(MoonbeamChainId::get()), + xcm::v3::Junction::AccountKey20 { + network: None, + key: Slp::derivative_account_id_20( + polkadot_parachain_primitives::primitives::Sibling::from( + ParachainInfo::get(), + ) + .into_account_truncating(), + index, + ) + .into(), + }, + ), + ), + // Only relay chain use the Bifrost para account with "para" + DOT => xcm::v3::Location::new( + 1, + xcm::v3::Junctions::X1(xcm::v3::Junction::AccountId32 { + network: None, + id: Utility::derivative_account_id( + ParachainInfo::get().into_account_truncating(), + index, + ) + .into(), + }), + ), + // Bifrost Polkadot Native token + BNC => xcm::v3::Location::new( + 0, + xcm::v3::Junctions::X1(xcm::v3::Junction::AccountId32 { + network: None, + id: Utility::derivative_account_id( + polkadot_parachain_primitives::primitives::Sibling::from(ParachainInfo::get()) + .into_account_truncating(), + index, + ) + .into(), + }), + ), + // Other sibling chains use the Bifrost para account with "sibl" + _ => { + // get parachain id + if let Some(location) = + CurrencyIdConvert::::convert(currency_id) + { + if let Some(Parachain(para_id)) = location.interior().first() { + xcm::v3::Location::new( + 1, + xcm::v3::Junctions::X2( + xcm::v3::Junction::Parachain(*para_id), + xcm::v3::Junction::AccountId32 { + network: None, + id: Utility::derivative_account_id( + polkadot_parachain_primitives::primitives::Sibling::from( + ParachainInfo::get(), + ) + .into_account_truncating(), + index, + ) + .into(), + }, + ), + ) + } else { + xcm::v3::Location::default() + } + } else { + xcm::v3::Location::default() + } + } + } +} + +pub struct SubAccountIndexMultiLocationConvertor; +impl Convert<(u16, CurrencyId), MultiLocation> for SubAccountIndexMultiLocationConvertor { + fn convert((sub_account_index, currency_id): (u16, CurrencyId)) -> MultiLocation { + create_x2_multilocation(sub_account_index, currency_id) + } +} + +parameter_types! { + pub MinContribution: Balance = dollar::(RelayCurrencyId::get()) * 5; + pub const RemoveKeysLimit: u32 = 500; + pub const VSBondValidPeriod: BlockNumber = 30 * DAYS; + pub const ReleaseCycle: BlockNumber = 1 * DAYS; + pub const LeasePeriod: BlockNumber = POLKA_LEASE_PERIOD; + pub const ReleaseRatio: Percent = Percent::from_percent(50); + pub const SlotLength: BlockNumber = 8u32 as BlockNumber; + pub ConfirmMuitiSigAccount: AccountId = hex!["e4da05f08e89bf6c43260d96f26fffcfc7deae5b465da08669a9d008e64c2c63"].into(); + pub const SalpLockId: LockIdentifier = *b"salplock"; + pub const BatchLimit: u32 = 50; +} + +impl bifrost_salp::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; + type LeasePeriod = LeasePeriod; + type MinContribution = MinContribution; + type MultiCurrency = Currencies; + type PalletId = BifrostCrowdloanId; + type RelayChainToken = RelayCurrencyId; + type ReleaseCycle = ReleaseCycle; + type ReleaseRatio = ReleaseRatio; + type RemoveKeysLimit = RemoveKeysLimit; + type SlotLength = SlotLength; + type VSBondValidPeriod = VSBondValidPeriod; + type WeightInfo = weights::bifrost_salp::BifrostWeight; + type EnsureConfirmAsGovernance = EitherOfDiverse; + type TreasuryAccount = BifrostTreasuryAccount; + type BuybackPalletId = BuybackPalletId; + type CurrencyIdConversion = AssetIdMaps; + type CurrencyIdRegister = AssetIdMaps; + type StablePool = StablePool; + type VtokenMinting = VtokenMinting; +} + +impl bifrost_asset_registry::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type Currency = Balances; + type RegisterOrigin = EitherOfDiverse; + type WeightInfo = weights::bifrost_asset_registry::BifrostWeight; +} + +parameter_types! { + pub const MaxTypeEntryPerBlock: u32 = 10; + pub const MaxRefundPerBlock: u32 = 10; + pub const MaxLengthLimit: u32 = 500; +} + +pub struct SubstrateResponseManager; +impl QueryResponseManager + for SubstrateResponseManager +{ + fn get_query_response_record(query_id: QueryId) -> bool { + if let Some(QueryStatus::Ready { .. }) = PolkadotXcm::query(query_id) { + true + } else { + false + } + } + + fn create_query_record( + responder: Location, + call_back: Option, + timeout: BlockNumber, + ) -> u64 { + if let Some(call_back) = call_back { + PolkadotXcm::new_notify_query(responder.clone(), call_back, timeout, Here) + } else { + PolkadotXcm::new_query(responder, timeout, Here) + } + } + + fn remove_query_record(query_id: QueryId) -> bool { + // Temporarily banned. Querries from pallet_xcm cannot be removed unless it is in ready + // status. And we are not allowed to mannually change query status. + // So in the manual mode, it is not possible to remove the query at all. + // PolkadotXcm::take_response(query_id).is_some() + + PolkadotXcm::take_response(query_id); + true + } +} + +impl bifrost_slp::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; + type MultiCurrency = Currencies; + type ControlOrigin = EitherOfDiverse; + type WeightInfo = weights::bifrost_slp::BifrostWeight; + type VtokenMinting = VtokenMinting; + type AccountConverter = SubAccountIndexMultiLocationConvertor; + type ParachainId = ParachainInfo; + type SubstrateResponseManager = SubstrateResponseManager; + type MaxTypeEntryPerBlock = MaxTypeEntryPerBlock; + type MaxRefundPerBlock = MaxRefundPerBlock; + type ParachainStaking = ParachainStaking; + type XcmTransfer = XTokens; + type MaxLengthLimit = MaxLengthLimit; + type XcmWeightAndFeeHandler = XcmInterface; + type ChannelCommission = ChannelCommission; + type StablePoolHandler = StablePool; + type AssetIdMaps = AssetIdMaps; + type TreasuryAccount = BifrostTreasuryAccount; + type BlockNumberProvider = System; +} + +parameter_types! { + pub const RelayChainTokenSymbolDOT: TokenSymbol = TokenSymbol::DOT; +} + +impl bifrost_vstoken_conversion::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type MultiCurrency = Currencies; + type RelayCurrencyId = RelayCurrencyId; + type TreasuryAccount = BifrostTreasuryAccount; + type ControlOrigin = CoreAdminOrCouncil; + type VsbondAccount = BifrostVsbondAccount; + type CurrencyIdConversion = AssetIdMaps; + type WeightInfo = weights::bifrost_vstoken_conversion::BifrostWeight; +} + +parameter_types! { + pub const WhitelistMaximumLimit: u32 = 10; +} + +impl bifrost_farming::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type CurrencyId = CurrencyId; + type MultiCurrency = Currencies; + type ControlOrigin = TechAdminOrCouncil; + type TreasuryAccount = BifrostTreasuryAccount; + type Keeper = FarmingKeeperPalletId; + type RewardIssuer = FarmingRewardIssuerPalletId; + type WeightInfo = weights::bifrost_farming::BifrostWeight; + type FarmingBoost = FarmingBoostPalletId; + type BbBNC = BbBNC; + type BlockNumberToBalance = ConvertInto; + type WhitelistMaximumLimit = WhitelistMaximumLimit; + type GaugeRewardIssuer = FarmingGaugeRewardIssuerPalletId; + type BlockNumberProvider = System; +} + +parameter_types! { + pub const BlocksPerRound: u32 = prod_or_fast!(1500, 50); + pub const MaxTokenLen: u32 = 500; + pub const MaxFarmingPoolIdLen: u32 = 100; + pub BenefitReceivingAccount: AccountId = FeeSharePalletId::get().into_account_truncating(); +} + +impl bifrost_system_staking::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type MultiCurrency = Currencies; + type EnsureConfirmAsGovernance = CoreAdminOrCouncil; + type WeightInfo = weights::bifrost_system_staking::BifrostWeight; + type FarmingInfo = Farming; + type VtokenMintingInterface = VtokenMinting; + type BenefitReceivingAccount = BenefitReceivingAccount; + type PalletId = SystemStakingPalletId; + type BlocksPerRound = BlocksPerRound; + type MaxTokenLen = MaxTokenLen; + type MaxFarmingPoolIdLen = MaxFarmingPoolIdLen; + type BlockNumberProvider = System; +} + +impl bifrost_fee_share::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type MultiCurrency = Currencies; + type ControlOrigin = CoreAdminOrCouncil; + type WeightInfo = weights::bifrost_fee_share::BifrostWeight; + type FeeSharePalletId = FeeSharePalletId; + type OraclePriceProvider = Prices; + type BlockNumberProvider = System; +} + +impl bifrost_cross_in_out::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type MultiCurrency = Currencies; + type ControlOrigin = TechAdminOrCouncil; + type EntrancePalletId = SlpEntrancePalletId; + type WeightInfo = weights::bifrost_cross_in_out::BifrostWeight; + type MaxLengthLimit = MaxLengthLimit; +} + +impl bifrost_slpx::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type RuntimeOrigin = RuntimeOrigin; + type ControlOrigin = TechAdminOrCouncil; + type MultiCurrency = Currencies; + type VtokenMintingInterface = VtokenMinting; + type XcmTransfer = XTokens; + type XcmSender = XcmRouter; + type CurrencyIdConvert = AssetIdMaps; + type TreasuryAccount = BifrostTreasuryAccount; + type ParachainId = ParachainInfo; + type WeightInfo = weights::bifrost_slpx::BifrostWeight; + type MaxOrderSize = ConstU32<500>; + type BlockNumberProvider = System; +} + +pub struct EnsurePoolAssetId; +impl bifrost_stable_asset::traits::ValidateAssetId for EnsurePoolAssetId { + fn validate(_: CurrencyId) -> bool { + true + } +} + +/// Configure the pallet bifrost_stable_asset in pallets/bifrost_stable_asset. +impl bifrost_stable_asset::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type AssetId = CurrencyId; + type Balance = Balance; + type Assets = Currencies; + type PalletId = StableAssetPalletId; + type AtLeast64BitUnsigned = u128; + type FeePrecision = ConstU128<10_000_000_000>; + type APrecision = ConstU128<100>; + type PoolAssetLimit = ConstU32<5>; + type SwapExactOverAmount = ConstU128<100>; + type WeightInfo = (); + type ListingOrigin = TechAdminOrCouncil; + type EnsurePoolAssetId = EnsurePoolAssetId; + type BlockNumberProvider = System; +} + +impl bifrost_stable_pool::Config for Runtime { + type WeightInfo = weights::bifrost_stable_pool::BifrostWeight; + type ControlOrigin = TechAdminOrCouncil; + type CurrencyId = CurrencyId; + type MultiCurrency = Currencies; + type StableAsset = StableAsset; + type VtokenMinting = VtokenMinting; + type CurrencyIdConversion = AssetIdMaps; + type CurrencyIdRegister = AssetIdMaps; +} + +parameter_types! { + pub const QueryTimeout: BlockNumber = 100; + pub const ReferendumCheckInterval: BlockNumber = 300; +} + +pub struct DerivativeAccountTokenFilter; +impl Contains for DerivativeAccountTokenFilter { + fn contains(token: &CurrencyId) -> bool { + *token == RelayCurrencyId::get() || *token == BNC + } +} + +impl bifrost_vtoken_voting::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; + type MultiCurrency = Currencies; + type ControlOrigin = CoreAdminOrCouncil; + type ResponseOrigin = EnsureResponse; + type XcmDestWeightAndFee = XcmInterface; + type DerivativeAccount = DerivativeAccountProvider; + type RelaychainBlockNumberProvider = RelaychainDataProvider; + type VTokenSupplyProvider = VtokenMinting; + type ParachainId = ParachainInfo; + type MaxVotes = ConstU32<256>; + type QueryTimeout = QueryTimeout; + type ReferendumCheckInterval = ReferendumCheckInterval; + type WeightInfo = weights::bifrost_vtoken_voting::BifrostWeight; + type PalletsOrigin = OriginCaller; + type LocalBlockNumberProvider = System; + type RelayVCurrency = RelayVCurrencyId; +} + +// Bifrost modules end + +// zenlink runtime start + +parameter_types! { + pub const StringLimit: u32 = 50; +} + +impl merkle_distributor::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type CurrencyId = CurrencyId; + type MultiCurrency = Currencies; + type Balance = Balance; + type MerkleDistributorId = u32; + type PalletId = MerkleDirtributorPalletId; + type StringLimit = StringLimit; + type WeightInfo = (); +} + +parameter_types! { + pub const ZenlinkPalletId: PalletId = PalletId(*b"/zenlink"); + pub const GetExchangeFee: (u32, u32) = (3, 1000); // 0.3% +} + +impl zenlink_protocol::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type MultiAssetsHandler = MultiAssets; + type PalletId = ZenlinkPalletId; + type SelfParaId = SelfParaId; + type TargetChains = (); + type WeightInfo = (); + type AssetId = ZenlinkAssetId; + type LpGenerate = PairLpGenerate; +} + +type MultiAssets = ZenlinkMultiAssets>; + +pub struct OnRedeemSuccess; +impl bifrost_vtoken_minting::OnRedeemSuccess for OnRedeemSuccess { + fn on_redeem_success(token_id: CurrencyId, to: AccountId, token_amount: Balance) -> Weight { + SystemStaking::on_redeem_success(token_id, to, token_amount) + } + + fn on_redeemed( + address: AccountId, + token_id: CurrencyId, + token_amount: Balance, + vtoken_amount: Balance, + fee: Balance, + ) -> Weight { + SystemStaking::on_redeemed(address, token_id, token_amount, vtoken_amount, fee) + } +} + +parameter_types! { + pub const MaximumUnlockIdOfUser: u32 = 10; + pub const MaximumUnlockIdOfTimeUnit: u32 = 1000; + pub BifrostFeeAccount: AccountId = TreasuryPalletId::get().into_account_truncating(); +} + +impl bifrost_vtoken_minting::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type MultiCurrency = Currencies; + type ControlOrigin = TechAdminOrCouncil; + type MaximumUnlockIdOfUser = MaximumUnlockIdOfUser; + type MaximumUnlockIdOfTimeUnit = MaximumUnlockIdOfTimeUnit; + type EntranceAccount = SlpEntrancePalletId; + type ExitAccount = SlpExitPalletId; + type FeeAccount = BifrostFeeAccount; + type RedeemFeeAccount = BifrostFeeAccount; + type BifrostSlpx = Slpx; + type WeightInfo = weights::bifrost_vtoken_minting::BifrostWeight; + type OnRedeemSuccess = OnRedeemSuccess; + type RelayChainToken = RelayCurrencyId; + type XcmTransfer = XTokens; + type MoonbeamChainId = MoonbeamChainId; + type ChannelCommission = ChannelCommission; + type MaxLockRecords = ConstU32<100>; + type IncentivePoolAccount = IncentivePoolAccount; + type BbBNC = BbBNC; + type BlockNumberProvider = System; +} + +parameter_types! { + pub const BbBNCTokenType: CurrencyId = CurrencyId::VToken(TokenSymbol::BNC); + pub const Week: BlockNumber = prod_or_fast!(WEEKS, 10); + pub const OneYear: BlockNumber = 365 * DAYS; + pub const MaxBlock: BlockNumber = 4 * 365 * DAYS; + pub const Multiplier: Balance = 10_u128.pow(12); + pub const VoteWeightMultiplier: Balance = 1; + pub const MaxPositions: u32 = 10; + pub const MarkupRefreshLimit: u32 = 100; +} + +impl bb_bnc::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type MultiCurrency = Currencies; + type ControlOrigin = TechAdminOrCouncil; + type TokenType = BbBNCTokenType; + type IncentivePalletId = IncentivePalletId; + type BuyBackAccount = BuyBackAccount; + type WeightInfo = weights::bb_bnc::BifrostWeight; + type BlockNumberToBalance = ConvertInto; + type Week = Week; + type MaxBlock = MaxBlock; + type Multiplier = Multiplier; + type VoteWeightMultiplier = VoteWeightMultiplier; + type MaxPositions = MaxPositions; + type MarkupRefreshLimit = MarkupRefreshLimit; + type VtokenMinting = VtokenMinting; + type FarmingInfo = Farming; + type FourYears = MaxBlock; + type OneYear = OneYear; + type BlockNumberProvider = System; +} + +parameter_types! { + pub const MinimumCount: u32 = 3; + pub const ExpiresIn: Moment = 1000 * 60 * 60; // 60 mins + pub const MaxHasDispatchedSize: u32 = 100; + pub OracleRootOperatorAccountId: AccountId = OraclePalletId::get().into_account_truncating(); + pub const MinimumTimestampInterval: Moment = 1000 * 60 * 10; // 10 mins + pub const MaximumValueInterval: Price = FixedU128::from_inner(200_000_000_000_000_000); // 20% + pub const MinimumValueInterval: Price = FixedU128::from_inner(3_000_000_000_000_000); // 0.3% +} + +type BifrostDataProvider = orml_oracle::Instance1; +impl orml_oracle::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type OnNewData = (); + type CombineData = orml_oracle::DefaultCombineData< + Runtime, + MinimumCount, + ExpiresIn, + MinimumTimestampInterval, + MaximumValueInterval, + MinimumValueInterval, + BifrostDataProvider, + >; + type Time = Timestamp; + type OracleKey = CurrencyId; + type OracleValue = Price; + type RootOperatorAccountId = OracleRootOperatorAccountId; + type MaxHasDispatchedSize = MaxHasDispatchedSize; + type WeightInfo = weights::orml_oracle::WeightInfo; + type Members = OracleMembership; + type MaxFeedValues = ConstU32<100>; + type ControlOrigin = TechAdminOrCouncil; +} + +pub type TimeStampedPrice = orml_oracle::TimestampedValue; +pub struct AggregatedDataProvider; +impl DataProvider for AggregatedDataProvider { + fn get(key: &CurrencyId) -> Option { + Oracle::get(key) + } +} + +impl DataProviderExtended for AggregatedDataProvider { + fn get_no_op(key: &CurrencyId) -> Option { + Oracle::get_no_op(key) + } + + fn get_all_values() -> Vec<(CurrencyId, Option)> { + Oracle::get_all_values() + } +} + +impl DataFeeder for AggregatedDataProvider { + fn feed_value(_: Option, _: CurrencyId, _: TimeStampedPrice) -> DispatchResult { + Err("Not supported".into()) + } +} + +impl pallet_prices::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type Source = AggregatedDataProvider; + type FeederOrigin = TechAdminOrCouncil; + type UpdateOrigin = TechAdminOrCouncil; + type RelayCurrency = RelayCurrencyId; + type CurrencyIdConvert = AssetIdMaps; + type Assets = Currencies; + type WeightInfo = pallet_prices::weights::SubstrateWeight; +} + +impl lend_market::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type PalletId = LendMarketPalletId; + type OraclePriceProvider = Prices; + type ReserveOrigin = TechAdminOrCouncil; + type UpdateOrigin = TechAdminOrCouncil; + type WeightInfo = weights::lend_market::BifrostWeight; + type UnixTime = Timestamp; + type Assets = Currencies; + type RewardAssetId = NativeCurrencyId; + type LiquidationFreeAssetId = RelayCurrencyId; + type MaxLengthLimit = MaxLengthLimit; + type BlockNumberProvider = System; +} + +parameter_types! { + pub const OracleMaxMembers: u32 = 100; +} + +impl pallet_membership::Config for Runtime { + type AddOrigin = CoreAdminOrCouncil; + type RuntimeEvent = RuntimeEvent; + type MaxMembers = OracleMaxMembers; + type MembershipInitialized = (); + type MembershipChanged = (); + type PrimeOrigin = CoreAdminOrCouncil; + type RemoveOrigin = CoreAdminOrCouncil; + type ResetOrigin = CoreAdminOrCouncil; + type SwapOrigin = CoreAdminOrCouncil; + type WeightInfo = pallet_membership::weights::SubstrateWeight; +} + +impl leverage_staking::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type WeightInfo = leverage_staking::weights::SubstrateWeight; + type ControlOrigin = EnsureRoot; + type VtokenMinting = VtokenMinting; + type LendMarket = LendMarket; + type StablePoolHandler = StablePool; + type CurrencyIdConversion = AssetIdMaps; +} + +parameter_types! { + pub const ClearingDuration: u32 = prod_or_fast!(1 * DAYS, 10 * MINUTES); + pub const NameLengthLimit: u32 = 20; + pub BifrostCommissionReceiver: AccountId = FeeSharePalletId::get().into_account_truncating(); +} + +impl bifrost_channel_commission::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type MultiCurrency = Currencies; + type ControlOrigin = EitherOfDiverse; + type CommissionPalletId = CommissionPalletId; + type BifrostCommissionReceiver = BifrostCommissionReceiver; + type WeightInfo = weights::bifrost_channel_commission::BifrostWeight; + type ClearingDuration = ClearingDuration; + type NameLengthLimit = NameLengthLimit; + type BlockNumberProvider = System; + type VtokenMintingInterface = VtokenMinting; +} + +impl bifrost_clouds_convert::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type MultiCurrency = Currencies; + type CloudsPalletId = CloudsPalletId; + type BbBNC = BbBNC; + type WeightInfo = weights::bifrost_clouds_convert::BifrostWeight; + type LockedBlocks = MaxBlock; +} + +impl bifrost_buy_back::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type MultiCurrency = Currencies; + type ControlOrigin = TechAdminOrCouncil; + type WeightInfo = weights::bifrost_buy_back::BifrostWeight; + type DexOperator = ZenlinkProtocol; + type TreasuryAccount = BifrostTreasuryAccount; + type BuyBackAccount = BuyBackAccount; + type LiquidityAccount = LiquidityAccount; + type ParachainId = ParachainInfo; + type CurrencyIdRegister = AssetIdMaps; + type BlockNumberProvider = System; +} + +impl bifrost_slp_v2::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; + type ResponseOrigin = EnsureResponse; + type WeightInfo = weights::bifrost_slp_v2::BifrostWeight; + type MultiCurrency = Currencies; + type ControlOrigin = TechAdminOrCouncil; + #[cfg(not(feature = "runtime-benchmarks"))] + type XcmTransfer = XTokens; + #[cfg(feature = "runtime-benchmarks")] + type XcmTransfer = MockXcmTransfer; + #[cfg(not(feature = "runtime-benchmarks"))] + type XcmSender = XcmRouter; + #[cfg(feature = "runtime-benchmarks")] + type XcmSender = MockXcmRouter; + type VtokenMinting = VtokenMinting; + type CurrencyIdConversion = AssetIdMaps; + type RelaychainBlockNumberProvider = RelaychainDataProvider; + type QueryTimeout = QueryTimeout; + type CommissionPalletId = CommissionPalletId; + type ParachainId = ParachainInfo; + type MaxValidators = ConstU32<256>; +} + +impl pallet_sudo::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; + type WeightInfo = (); +} + +// Below is the implementation of tokens manipulation functions other than native token. +pub struct LocalAssetAdaptor(PhantomData); + +impl LocalAssetHandler for LocalAssetAdaptor +where + Local: MultiCurrency, +{ + fn local_balance_of(asset_id: ZenlinkAssetId, who: &AccountId) -> AssetBalance { + if let Ok(currency_id) = asset_id.try_into() { + return TryInto::::try_into(Local::free_balance(currency_id, &who)) + .unwrap_or_default(); + } + AssetBalance::default() + } + + fn local_total_supply(asset_id: ZenlinkAssetId) -> AssetBalance { + if let Ok(currency_id) = asset_id.try_into() { + return TryInto::::try_into(Local::total_issuance(currency_id)) + .unwrap_or_default(); + } + AssetBalance::default() + } + + fn local_is_exists(asset_id: ZenlinkAssetId) -> bool { + let currency_id: Result = asset_id.try_into(); + match currency_id { + Ok(_) => true, + Err(_) => false, + } + } + + fn local_transfer( + asset_id: ZenlinkAssetId, + origin: &AccountId, + target: &AccountId, + amount: AssetBalance, + ) -> DispatchResult { + if let Ok(currency_id) = asset_id.try_into() { + Local::transfer( + currency_id, + &origin, + &target, + amount + .try_into() + .map_err(|_| DispatchError::Other("convert amount in local transfer"))?, + ) + } else { + Err(DispatchError::Other("unknown asset in local transfer")) + } + } + + fn local_deposit( + asset_id: ZenlinkAssetId, + origin: &AccountId, + amount: AssetBalance, + ) -> Result { + if let Ok(currency_id) = asset_id.try_into() { + Local::deposit( + currency_id, + &origin, + amount + .try_into() + .map_err(|_| DispatchError::Other("convert amount in local deposit"))?, + )?; + } else { + return Err(DispatchError::Other("unknown asset in local transfer")); + } + + Ok(amount) + } + + fn local_withdraw( + asset_id: ZenlinkAssetId, + origin: &AccountId, + amount: AssetBalance, + ) -> Result { + if let Ok(currency_id) = asset_id.try_into() { + Local::withdraw( + currency_id, + &origin, + amount + .try_into() + .map_err(|_| DispatchError::Other("convert amount in local withdraw"))?, + )?; + } else { + return Err(DispatchError::Other("unknown asset in local transfer")); + } + + Ok(amount) + } +} + +// zenlink runtime end + +construct_runtime! { + pub enum Runtime { + // Basic stuff + System: frame_system = 0, + Timestamp: pallet_timestamp = 1, + Indices: pallet_indices = 2, + ParachainSystem: cumulus_pallet_parachain_system = 5, + ParachainInfo: parachain_info = 6, + TxPause: pallet_tx_pause = 7, + Sudo: pallet_sudo = 8, + + // Monetary stuff + Balances: pallet_balances = 10, + TransactionPayment: pallet_transaction_payment = 11, + + // Collator support. the order of these 4 are important and shall not change. + Authorship: pallet_authorship = 20, + Session: pallet_session = 22, + Aura: pallet_aura = 23, + AuraExt: cumulus_pallet_aura_ext = 24, + ParachainStaking: bifrost_parachain_staking = 25, + + // Governance stuff + Democracy: pallet_democracy = 30, + Council: pallet_collective:: = 31, + TechnicalCommittee: pallet_collective:: = 32, + PhragmenElection: pallet_elections_phragmen = 33, + CouncilMembership: pallet_membership:: = 34, + TechnicalMembership: pallet_membership:: = 35, + ConvictionVoting: pallet_conviction_voting = 36, + Referenda: pallet_referenda = 37, + Origins: custom_origins = 38, + Whitelist: pallet_whitelist = 39, + + // XCM helpers. + XcmpQueue: cumulus_pallet_xcmp_queue = 40, + PolkadotXcm: pallet_xcm = 41, + CumulusXcm: cumulus_pallet_xcm = 42, + MessageQueue: pallet_message_queue = 44, + + // utilities + Utility: pallet_utility = 50, + Scheduler: pallet_scheduler = 51, + Proxy: pallet_proxy = 52, + Multisig: pallet_multisig = 53, + Identity: pallet_identity = 54, + + // Vesting. Usable initially, but removed once all vesting is finished. + Vesting: bifrost_vesting = 60, + + // Treasury stuff + Treasury: pallet_treasury = 61, + Preimage: pallet_preimage = 64, + + // Frontier and EVM pallets + Ethereum: pallet_ethereum = 65, + EVM: pallet_evm = 66, + EVMChainId: pallet_evm_chain_id = 67, + DynamicFee: pallet_dynamic_fee = 68, + EVMAccounts: pallet_evm_accounts = 69, + + // Third party modules + XTokens: orml_xtokens = 70, + Tokens: orml_tokens = 71, + Currencies: bifrost_currencies exclude_parts { Call } = 72, + UnknownTokens: orml_unknown_tokens = 73, + OrmlXcm: orml_xcm = 74, + ZenlinkProtocol: zenlink_protocol = 80, + MerkleDistributor: merkle_distributor = 81, + + // Hyperbridge + Ismp: pallet_ismp = 90, + IsmpParachain: ismp_parachain = 91, + Hyperbridge: pallet_hyperbridge = 92, + BifrostIsmp: bifrost_ismp = 93, + TokenGateway: pallet_token_gateway = 94, + + // Bifrost modules + FlexibleFee: bifrost_flexible_fee = 100, + Salp: bifrost_salp = 105, + AssetRegistry: bifrost_asset_registry = 114, + VtokenMinting: bifrost_vtoken_minting = 115, + Slp: bifrost_slp = 116, + XcmInterface: bifrost_xcm_interface = 117, + TokenConversion: bifrost_vstoken_conversion = 118, + Farming: bifrost_farming = 119, + SystemStaking: bifrost_system_staking = 120, + FeeShare: bifrost_fee_share = 122, + CrossInOut: bifrost_cross_in_out = 123, + BbBNC: bb_bnc = 124, + Slpx: bifrost_slpx = 125, + FellowshipCollective: pallet_ranked_collective:: = 126, + FellowshipReferenda: pallet_referenda:: = 127, + StableAsset: bifrost_stable_asset exclude_parts { Call } = 128, + StablePool: bifrost_stable_pool = 129, + VtokenVoting: bifrost_vtoken_voting = 130, + LendMarket: lend_market = 131, + Prices: pallet_prices = 132, + Oracle: orml_oracle:: = 133, + OracleMembership: pallet_membership:: = 134, + LeverageStaking: leverage_staking = 135, + ChannelCommission: bifrost_channel_commission = 136, + CloudsConvert: bifrost_clouds_convert = 137, + BuyBack: bifrost_buy_back = 138, + SlpV2: bifrost_slp_v2 = 139, + } +} + +#[derive(Clone)] +pub struct TransactionConverter; + +impl fp_rpc::ConvertTransaction for TransactionConverter { + fn convert_transaction(&self, transaction: pallet_ethereum::Transaction) -> UncheckedExtrinsic { + UncheckedExtrinsic::new_unsigned( + pallet_ethereum::Call::::transact { transaction }.into(), + ) + } +} + +impl fp_rpc::ConvertTransaction for TransactionConverter { + fn convert_transaction( + &self, + transaction: pallet_ethereum::Transaction, + ) -> opaque::UncheckedExtrinsic { + let extrinsic = UncheckedExtrinsic::new_unsigned( + pallet_ethereum::Call::::transact { transaction }.into(), + ); + let encoded = extrinsic.encode(); + opaque::UncheckedExtrinsic::decode(&mut &encoded[..]) + .expect("Encoded extrinsic is always valid") + } +} + +/// The type for looking up accounts. We don't expect more than 4 billion of them. +pub type AccountIndex = u32; +/// Alias to 512-bit hash when used in the context of a transaction signature on the chain. +pub type Signature = sp_runtime::MultiSignature; +/// Index of a transaction in the chain. +pub type Index = u32; +/// A hash of some data used by the chain. +pub type Hash = sp_core::H256; +/// The address format for describing accounts. +pub type Address = sp_runtime::MultiAddress; +/// Block header type as expected by this runtime. +pub type Header = generic::Header; +/// Block type as expected by this runtime. +pub type Block = generic::Block; +/// A Block signed with a Justification +pub type SignedBlock = generic::SignedBlock; +/// BlockId type as expected by this runtime. +pub type BlockId = generic::BlockId; +/// The SignedExtension to the basic transaction logic. +pub type SignedExtra = ( + frame_system::CheckNonZeroSender, + frame_system::CheckSpecVersion, + frame_system::CheckTxVersion, + frame_system::CheckGenesis, + frame_system::CheckEra, + frame_system::CheckNonce, + frame_system::CheckWeight, + pallet_transaction_payment::ChargeTransactionPayment, + frame_metadata_hash_extension::CheckMetadataHash, +); +/// Unchecked extrinsic type as expected by this runtime. +pub type UncheckedExtrinsic = + fp_self_contained::UncheckedExtrinsic; +/// Extrinsic type that has already been checked. +pub type CheckedExtrinsic = + fp_self_contained::CheckedExtrinsic; +/// The payload being signed in transactions. +pub type SignedPayload = generic::SignedPayload; + +impl cumulus_pallet_xcmp_queue::migration::v5::V5Config for Runtime { + // This must be the same as the `ChannelInfo` from the `Config`: + type ChannelList = ParachainSystem; +} + +/// All migrations that will run on the next runtime upgrade. +/// +/// This contains the combined migrations of the last 10 releases. It allows to skip runtime +/// upgrades in case governance decides to do so. THE ORDER IS IMPORTANT. +pub type Migrations = migrations::Unreleased; + +parameter_types! { + pub const CollatorSelectionName: &'static str = "CollatorSelection"; +} + +/// The runtime migrations per release. +pub mod migrations { + #[allow(unused_imports)] + use super::*; + + /// Unreleased migrations. Add new ones here: + pub type Unreleased = ( + // permanent migration, do not remove + pallet_xcm::migration::MigrateToLatestXcmVersion, + bifrost_channel_commission::migrations::v1::MigrateToV1, + ); +} + +/// Executive: handles dispatch to the various modules. +pub type Executive = frame_executive::Executive< + Runtime, + Block, + frame_system::ChainContext, + Runtime, + AllPalletsWithSystem, + Migrations, +>; + +impl fp_self_contained::SelfContainedCall for RuntimeCall { + type SignedInfo = H160; + + fn is_self_contained(&self) -> bool { + match self { + RuntimeCall::Ethereum(call) => call.is_self_contained(), + _ => false, + } + } + + fn check_self_contained(&self) -> Option> { + match self { + RuntimeCall::Ethereum(call) => call.check_self_contained(), + _ => None, + } + } + + fn validate_self_contained( + &self, + info: &Self::SignedInfo, + dispatch_info: &DispatchInfoOf, + len: usize, + ) -> Option { + match self { + RuntimeCall::Ethereum(call) => call.validate_self_contained(info, dispatch_info, len), + _ => None, + } + } + + fn pre_dispatch_self_contained( + &self, + info: &Self::SignedInfo, + dispatch_info: &DispatchInfoOf, + len: usize, + ) -> Option> { + match self { + RuntimeCall::Ethereum(call) => { + call.pre_dispatch_self_contained(info, dispatch_info, len) + } + _ => None, + } + } + + fn apply_self_contained( + self, + info: Self::SignedInfo, + ) -> Option>> { + match self { + call @ RuntimeCall::Ethereum(pallet_ethereum::Call::transact { .. }) => { + Some(call.dispatch(RuntimeOrigin::from( + pallet_ethereum::RawOrigin::EthereumTransaction(info), + ))) + } + _ => None, + } + } +} + +#[cfg(feature = "runtime-benchmarks")] +#[macro_use] +extern crate frame_benchmarking; + +#[cfg(feature = "runtime-benchmarks")] +mod benches { + define_benchmarks!( + [bb_bnc, BbBNC] + [bifrost_buy_back, BuyBack] + [bifrost_slp_v2, SlpV2] + [bifrost_xcm_interface, XcmInterface] + [bifrost_farming, Farming] + ); +} + +impl_runtime_apis! { + impl sp_transaction_pool::runtime_api::TaggedTransactionQueue for Runtime { + fn validate_transaction( + source: TransactionSource, + tx: ::Extrinsic, + block_hash: ::Hash, + ) -> TransactionValidity { + Executive::validate_transaction(source, tx, block_hash) + } + } + + impl sp_api::Core for Runtime { + fn version() -> RuntimeVersion { + VERSION + } + + fn execute_block(block: Block) { + Executive::execute_block(block); + } + + fn initialize_block(header: &::Header) -> sp_runtime::ExtrinsicInclusionMode { + Executive::initialize_block(header) + } + } + + impl sp_block_builder::BlockBuilder for Runtime { + fn apply_extrinsic( + extrinsic: ::Extrinsic, + ) -> ApplyExtrinsicResult { + Executive::apply_extrinsic(extrinsic) + } + + fn finalize_block() -> ::Header { + Executive::finalize_block() + } + + fn inherent_extrinsics(data: sp_inherents::InherentData) -> Vec<::Extrinsic> { + data.create_extrinsics() + } + + fn check_inherents(block: Block, data: sp_inherents::InherentData) -> sp_inherents::CheckInherentsResult { + data.check_extrinsics(&block) + } + } + + impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { + fn account_nonce(account: AccountId) -> Nonce { + System::account_nonce(account) + } + } + + impl fp_rpc::EthereumRuntimeRPCApi for Runtime { + fn chain_id() -> u64 { + ::ChainId::get() + } + + fn account_basic(address: H160) -> pallet_evm::Account { + let (account, _) = EVM::account_basic(&address); + account + } + + fn gas_price() -> U256 { + let (gas_price, _) = ::FeeCalculator::min_gas_price(); + gas_price + } + + fn account_code_at(address: H160) -> Vec { + pallet_evm::AccountCodes::::get(address) + } + + fn author() -> H160 { + >::find_author() + } + + fn storage_at(address: H160, index: U256) -> H256 { + let mut tmp = [0u8; 32]; + index.to_big_endian(&mut tmp); + pallet_evm::AccountStorages::::get(address, H256::from_slice(&tmp[..])) + } + + fn call( + from: H160, + to: H160, + data: Vec, + value: U256, + gas_limit: U256, + max_fee_per_gas: Option, + max_priority_fee_per_gas: Option, + nonce: Option, + estimate: bool, + access_list: Option)>>, + ) -> Result { + let mut config = ::config().clone(); + config.estimate = estimate; + + let is_transactional = false; + let validate = true; + + // Estimated encoded transaction size must be based on the heaviest transaction + // type (EIP1559Transaction) to be compatible with all transaction types. + let mut estimated_transaction_len = data.len() + + // pallet ethereum index: 1 + // transact call index: 1 + // Transaction enum variant: 1 + // chain_id 8 bytes + // nonce: 32 + // max_priority_fee_per_gas: 32 + // max_fee_per_gas: 32 + // gas_limit: 32 + // action: 21 (enum varianrt + call address) + // value: 32 + // access_list: 1 (empty vec size) + // 65 bytes signature + 258; + + if access_list.is_some() { + estimated_transaction_len += access_list.encoded_size(); + } + + let gas_limit = gas_limit.min(u64::MAX.into()).low_u64(); + let without_base_extrinsic_weight = true; + + let (weight_limit, proof_size_base_cost) = + match ::GasWeightMapping::gas_to_weight( + gas_limit, + without_base_extrinsic_weight + ) { + weight_limit if weight_limit.proof_size() > 0 => { + (Some(weight_limit), Some(estimated_transaction_len as u64)) + } + _ => (None, None), + }; + + // don't allow calling EVM RPC or Runtime API from a bound address + if !estimate && EVMAccounts::bound_account_id(from).is_some() { + return Err(pallet_evm_accounts::Error::::BoundAddressCannotBeUsed.into()) + }; + + ::Runner::call( + from, + to, + data, + value, + gas_limit.unique_saturated_into(), + max_fee_per_gas, + max_priority_fee_per_gas, + nonce, + access_list.unwrap_or_default(), + is_transactional, + validate, + weight_limit, + proof_size_base_cost, + &config, + ) + .map_err(|err| err.error.into()) + } + + fn create( + from: H160, + data: Vec, + value: U256, + gas_limit: U256, + max_fee_per_gas: Option, + max_priority_fee_per_gas: Option, + nonce: Option, + estimate: bool, + access_list: Option)>>, + ) -> Result { + let config = if estimate { + let mut config = ::config().clone(); + config.estimate = true; + Some(config) + } else { + None + }; + + let is_transactional = false; + let validate = true; + + // Reused approach from Moonbeam since Frontier implementation doesn't support this + let mut estimated_transaction_len = data.len() + + // to: 20 + // from: 20 + // value: 32 + // gas_limit: 32 + // nonce: 32 + // 1 byte transaction action variant + // chain id 8 bytes + // 65 bytes signature + 210; + if max_fee_per_gas.is_some() { + estimated_transaction_len += 32; + } + if max_priority_fee_per_gas.is_some() { + estimated_transaction_len += 32; + } + if access_list.is_some() { + estimated_transaction_len += access_list.encoded_size(); + } + + let gas_limit = gas_limit.min(u64::MAX.into()).low_u64(); + let without_base_extrinsic_weight = true; + + let (weight_limit, proof_size_base_cost) = + match ::GasWeightMapping::gas_to_weight( + gas_limit, + without_base_extrinsic_weight + ) { + weight_limit if weight_limit.proof_size() > 0 => { + (Some(weight_limit), Some(estimated_transaction_len as u64)) + } + _ => (None, None), + }; + + // don't allow calling EVM RPC or Runtime API from a bound address + if !estimate && EVMAccounts::bound_account_id(from).is_some() { + return Err(pallet_evm_accounts::Error::::BoundAddressCannotBeUsed.into()) + }; + + // the address needs to have a permission to deploy smart contract + if !EVMAccounts::can_deploy_contracts(from) { + return Err(pallet_evm_accounts::Error::::AddressNotWhitelisted.into()) + }; + + #[allow(clippy::or_fun_call)] // suggestion not helpful here + ::Runner::create( + from, + data, + value, + gas_limit.unique_saturated_into(), + max_fee_per_gas, + max_priority_fee_per_gas, + nonce, + Vec::new(), + is_transactional, + validate, + weight_limit, + proof_size_base_cost, + config + .as_ref() + .unwrap_or(::config()), + ) + .map_err(|err| err.error.into()) + } + + fn current_transaction_statuses() -> Option> { + pallet_ethereum::CurrentTransactionStatuses::::get() + } + + fn current_block() -> Option { + pallet_ethereum::CurrentBlock::::get() + } + + fn current_receipts() -> Option> { + pallet_ethereum::CurrentReceipts::::get() + } + + fn current_all() -> ( + Option, + Option>, + Option>, + ) { + ( + pallet_ethereum::CurrentBlock::::get(), + pallet_ethereum::CurrentReceipts::::get(), + pallet_ethereum::CurrentTransactionStatuses::::get(), + ) + } + + fn extrinsic_filter(xts: Vec<::Extrinsic>) -> Vec { + xts.into_iter() + .filter_map(|xt| match xt.0.function { + RuntimeCall::Ethereum(pallet_ethereum::Call::transact { transaction }) => Some(transaction), + _ => None, + }) + .collect::>() + } + + fn elasticity() -> Option { + None + } + + fn gas_limit_multiplier_support() {} + + fn pending_block( + xts: Vec<::Extrinsic>, + ) -> (Option, Option>) { + for ext in xts.into_iter() { + let _ = Executive::apply_extrinsic(ext); + } + + Ethereum::on_finalize(System::block_number() + 1); + + ( + pallet_ethereum::CurrentBlock::::get(), + pallet_ethereum::CurrentTransactionStatuses::::get() + ) + } + + fn initialize_pending_block(header: &::Header) { + Executive::initialize_block(header); + } + } + + impl fp_rpc::ConvertTransactionRuntimeApi for Runtime { + fn convert_transaction(transaction: Transaction) -> ::Extrinsic { + UncheckedExtrinsic::new_unsigned( + pallet_ethereum::Call::::transact { transaction }.into(), + ) + } + } + + impl pallet_evm_accounts_rpc_runtime_api::EvmAccountsApi for Runtime { + fn evm_address(account_id: AccountId) -> H160 { + EVMAccounts::evm_address(&account_id) + } + fn bound_account_id(evm_address: H160) -> Option { + EVMAccounts::bound_account_id(evm_address) + } + fn account_id(evm_address: H160) -> AccountId { + EVMAccounts::account_id(evm_address) + } + } + + impl pallet_ismp_runtime_api::IsmpRuntimeApi::Hash> for Runtime { + fn host_state_machine() -> StateMachine { + ::HostStateMachine::get() + } + + fn challenge_period(state_machine_id: StateMachineId) -> Option { + pallet_ismp::Pallet::::challenge_period(state_machine_id) + } + + /// Generate a proof for the provided leaf indices + fn generate_proof( + keys: ProofKeys + ) -> Result<(Vec, Proof<::Hash>), sp_mmr_primitives::Error> { + pallet_ismp::Pallet::::generate_proof(keys) + } + + /// Fetch all ISMP events in the block, should only be called from runtime-api. + fn block_events() -> Vec<::ismp::events::Event> { + pallet_ismp::Pallet::::block_events() + } + + /// Fetch all ISMP events and their extrinsic metadata, should only be called from runtime-api. + fn block_events_with_metadata() -> Vec<(::ismp::events::Event, Option)> { + pallet_ismp::Pallet::::block_events_with_metadata() + } + + /// Return the scale encoded consensus state + fn consensus_state(id: ConsensusClientId) -> Option> { + pallet_ismp::Pallet::::consensus_states(id) + } + + /// Return the timestamp this client was last updated in seconds + fn state_machine_update_time(height: StateMachineHeight) -> Option { + pallet_ismp::Pallet::::state_machine_update_time(height) + } + + /// Return the latest height of the state machine + fn latest_state_machine_height(id: StateMachineId) -> Option { + pallet_ismp::Pallet::::latest_state_machine_height(id) + } + + + /// Get actual requests + fn requests(commitments: Vec) -> Vec { + pallet_ismp::Pallet::::requests(commitments) + } + + /// Get actual requests + fn responses(commitments: Vec) -> Vec { + pallet_ismp::Pallet::::responses(commitments) + } + } + + impl ismp_parachain_runtime_api::IsmpParachainApi for Runtime { + fn para_ids() -> Vec { + IsmpParachain::para_ids() + } + + fn current_relay_chain_state() -> RelayChainState { + IsmpParachain::current_relay_chain_state() + } + } + + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi< + Block, + Balance, + > for Runtime { + fn query_info( + uxt: ::Extrinsic, + len: u32, + ) -> pallet_transaction_payment_rpc_runtime_api::RuntimeDispatchInfo { + TransactionPayment::query_info(uxt, len) + } + fn query_fee_details( + uxt: ::Extrinsic, + len: u32, + ) -> pallet_transaction_payment::FeeDetails { + TransactionPayment::query_fee_details(uxt, len) + } + fn query_weight_to_fee(weight: Weight) -> Balance { + TransactionPayment::weight_to_fee(weight) + } + fn query_length_to_fee(length: u32) -> Balance { + TransactionPayment::length_to_fee(length) + } + } + + impl sp_api::Metadata for Runtime { + fn metadata() -> OpaqueMetadata { + OpaqueMetadata::new(Runtime::metadata().into()) + } + fn metadata_at_version(version: u32) -> Option { + Runtime::metadata_at_version(version) + } + fn metadata_versions() -> sp_std::vec::Vec { + Runtime::metadata_versions() + } + } + + impl sp_offchain::OffchainWorkerApi for Runtime { + fn offchain_worker(header: &::Header) { + Executive::offchain_worker(header) + } + } + + impl sp_session::SessionKeys for Runtime { + fn decode_session_keys( + encoded: Vec, + ) -> Option, sp_core::crypto::KeyTypeId)>> { + opaque::SessionKeys::decode_into_raw_public_keys(&encoded) + } + + fn generate_session_keys(seed: Option>) -> Vec { + opaque::SessionKeys::generate(seed) + } + } + + impl cumulus_primitives_core::CollectCollationInfo for Runtime { + fn collect_collation_info(header: &::Header) -> cumulus_primitives_core::CollationInfo { + ParachainSystem::collect_collation_info(header) + } + } + + impl sp_consensus_aura::AuraApi for Runtime { + fn slot_duration() -> sp_consensus_aura::SlotDuration { + sp_consensus_aura::SlotDuration::from_millis(SLOT_DURATION) + } + + fn authorities() -> Vec { + pallet_aura::Authorities::::get().into_inner() + } + } + + impl cumulus_primitives_aura::AuraUnincludedSegmentApi for Runtime { + fn can_build_upon( + included_hash: ::Hash, + slot: cumulus_primitives_aura::Slot, + ) -> bool { + ConsensusHook::can_build_upon(included_hash, slot) + } + } + + impl xcm_runtime_apis::fees::XcmPaymentApi for Runtime { + fn query_acceptable_payment_assets(xcm_version: xcm::Version) -> Result, XcmPaymentApiError> { + let acceptable_assets = AssetRegistry::asset_ids(); + PolkadotXcm::query_acceptable_payment_assets(xcm_version, acceptable_assets) + } + + fn query_weight_to_asset_fee(weight: Weight, asset: VersionedAssetId) -> Result { + let asset = asset + .into_version(4) + .map_err(|_| XcmPaymentApiError::VersionedConversionFailed)?; + let bnc_asset = VersionedAssetId::V4(LocalBncLocation::get().into()); + + if asset == bnc_asset { + // for native token + Ok(WeightToFee::weight_to_fee(&weight)) + } else { + let native_fee = WeightToFee::weight_to_fee(&weight); + let asset_location = &asset.try_as::().map_err(|_| XcmPaymentApiError::VersionedConversionFailed)?.0; + let asset_currency = AssetIdMaps::::get_currency_id(&asset_location).ok_or(XcmPaymentApiError::AssetNotFound)?; + let asset_fee = Prices::get_oracle_amount_by_currency_and_amount_in(&bifrost_primitives::BNC, native_fee, &asset_currency).ok_or(XcmPaymentApiError::AssetNotFound)?.0; + Ok(asset_fee) + } + } + + fn query_xcm_weight(message: VersionedXcm<()>) -> Result { + PolkadotXcm::query_xcm_weight(message) + } + + fn query_delivery_fees(destination: VersionedLocation, message: VersionedXcm<()>) -> Result { + PolkadotXcm::query_delivery_fees(destination, message) + } + } + + impl xcm_runtime_apis::dry_run::DryRunApi for Runtime { + fn dry_run_call(origin: OriginCaller, call: RuntimeCall) -> Result, XcmDryRunApiError> { + PolkadotXcm::dry_run_call::(origin, call) + } + + fn dry_run_xcm(origin_location: VersionedLocation, xcm: VersionedXcm) -> Result, XcmDryRunApiError> { + PolkadotXcm::dry_run_xcm::(origin_location, xcm) + } + } + + impl bifrost_flexible_fee_rpc_runtime_api::FlexibleFeeRuntimeApi for Runtime { + fn get_fee_token_and_amount(who: AccountId, fee: Balance,utx: ::Extrinsic) -> (CurrencyId, Balance) { + let call = utx.0.function; + + let rs = FlexibleFee::cal_fee_token_and_amount(&who, fee, &call); + + match rs { + Ok(val) => val, + _ => (BNC, Zero::zero()), + } + } + } + + // zenlink runtime outer apis + impl zenlink_protocol_runtime_api::ZenlinkProtocolApi for Runtime { + + fn get_balance( + asset_id: ZenlinkAssetId, + owner: AccountId + ) -> AssetBalance { + ::MultiAssetsHandler::balance_of(asset_id, &owner) + } + + fn get_pair_by_asset_id( + asset_0: ZenlinkAssetId, + asset_1: ZenlinkAssetId + ) -> Option> { + ZenlinkProtocol::get_pair_by_asset_id(asset_0, asset_1) + } + + fn get_amount_in_price( + supply: AssetBalance, + path: Vec + ) -> AssetBalance { + ZenlinkProtocol::desired_in_amount(supply, path) + } + + fn get_amount_out_price( + supply: AssetBalance, + path: Vec + ) -> AssetBalance { + ZenlinkProtocol::supply_out_amount(supply, path) + } + + fn get_estimate_lptoken( + token_0: ZenlinkAssetId, + token_1: ZenlinkAssetId, + amount_0_desired: AssetBalance, + amount_1_desired: AssetBalance, + amount_0_min: AssetBalance, + amount_1_min: AssetBalance, + ) -> AssetBalance{ + ZenlinkProtocol::get_estimate_lptoken( + token_0, + token_1, + amount_0_desired, + amount_1_desired, + amount_0_min, + amount_1_min + ) + } + fn calculate_remove_liquidity( + asset_0: ZenlinkAssetId, + asset_1: ZenlinkAssetId, + amount: AssetBalance, + ) -> Option<(AssetBalance, AssetBalance)>{ + ZenlinkProtocol::calculate_remove_liquidity( + asset_0, + asset_1, + amount, + ) + } + } + + impl bifrost_salp_rpc_runtime_api::SalpRuntimeApi for Runtime { + fn get_contribution(index: ParaId, who: AccountId) -> (Balance,RpcContributionStatus) { + let rs = Salp::contribution_by_fund(index, &who); + match rs { + Ok((val,status)) => (val,status.to_rpc()), + _ => (Zero::zero(),RpcContributionStatus::Idle), + } + } + } + + impl bifrost_farming_rpc_runtime_api::FarmingRuntimeApi for Runtime { + fn get_farming_rewards(who: AccountId, pid: PoolId) -> Vec<(CurrencyId, Balance)> { + Farming::get_farming_rewards(&who, pid).unwrap_or(Vec::new()) + } + + fn get_gauge_rewards(who: AccountId, pid: PoolId) -> Vec<(CurrencyId, Balance)> { + Farming::get_gauge_rewards(&who, pid).unwrap_or(Vec::new()) + } + } + + impl bb_bnc_rpc_runtime_api::BbBNCRuntimeApi for Runtime { + fn balance_of( + who: AccountId, + t: Option, + ) -> Balance{ + BbBNC::balance_of(&who, t).unwrap_or(Zero::zero()) + } + + fn total_supply( + t: bifrost_primitives::BlockNumber, + ) -> Balance{ + BbBNC::total_supply(t).unwrap_or(Zero::zero()) + } + + fn find_block_epoch( + block: bifrost_primitives::BlockNumber, + max_epoch: U256, + ) -> U256{ + BbBNC::find_block_epoch(block, max_epoch) + } + } + + impl lend_market_rpc_runtime_api::LendMarketApi for Runtime { + fn get_account_liquidity(account: AccountId) -> Result<(Liquidity, Shortfall, Liquidity, Shortfall), DispatchError> { + LendMarket::get_account_liquidity(&account) + } + + fn get_market_status(asset_id: CurrencyId) -> Result<(Rate, Rate, Rate, Ratio, Balance, Balance, sp_runtime::FixedU128), DispatchError> { + LendMarket::get_market_status(asset_id) + } + + fn get_liquidation_threshold_liquidity(account: AccountId) -> Result<(Liquidity, Shortfall, Liquidity, Shortfall), DispatchError> { + LendMarket::get_account_liquidation_threshold_liquidity(&account) + } + } + + impl bifrost_stable_pool_rpc_runtime_api::StablePoolRuntimeApi for Runtime { + fn get_swap_output( + pool_id: u32, + currency_id_in: u32, + currency_id_out: u32, + amount: Balance, + ) -> Balance { + StablePool::get_swap_output(pool_id, currency_id_in, currency_id_out, amount).unwrap_or(Zero::zero()) + } + + fn add_liquidity_amount( + pool_id: u32, + amounts: Vec, + ) -> Balance { + StablePool::add_liquidity_amount(pool_id, amounts).unwrap_or(Zero::zero()) + } + } + + impl bifrost_vtoken_minting_rpc_runtime_api::VtokenMintingRuntimeApi for Runtime { + fn get_currency_amount_by_v_currency_amount(currnecy_id: CurrencyId, v_currency_id: CurrencyId, v_currency_amount: Balance) -> Balance { + VtokenMinting::get_currency_amount_by_v_currency_amount(currnecy_id, v_currency_id, v_currency_amount).unwrap_or(0) + } + + fn get_v_currency_amount_by_currency_amount(currnecy_id: CurrencyId, v_currency_id: CurrencyId, currency_amount: Balance) -> Balance { + VtokenMinting::get_v_currency_amount_by_currency_amount(currnecy_id, v_currency_id, currency_amount).unwrap_or(0) + } + } + + #[cfg(feature = "runtime-benchmarks")] + impl frame_benchmarking::Benchmark for Runtime { + fn benchmark_metadata(extra: bool) -> ( + Vec, + Vec, + ) { + use frame_benchmarking::{Benchmarking, BenchmarkList}; + use frame_support::traits::StorageInfoTrait; + + let mut list = Vec::::new(); + list_benchmarks!(list, extra); + + let storage_info = AllPalletsWithSystem::storage_info(); + return (list, storage_info) + } + + fn dispatch_benchmark( + config: frame_benchmarking::BenchmarkConfig + ) -> Result, sp_runtime::RuntimeString> { + use frame_benchmarking::{Benchmarking, BenchmarkBatch}; + use frame_support::traits::TrackedStorageKey; + + impl frame_system_benchmarking::Config for Runtime {} + + let whitelist: Vec = vec![ + // you can whitelist any storage keys you do not want to track here + ]; + + 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) + } + } + + #[cfg(feature = "try-runtime")] + impl frame_try_runtime::TryRuntime for Runtime { + fn on_runtime_upgrade(checks: frame_try_runtime::UpgradeCheckSelect) -> (Weight, Weight) { + log::info!("try-runtime::on_runtime_upgrade bifrost."); + let weight = Executive::try_runtime_upgrade(checks).unwrap(); + (weight, RuntimeBlockWeights::get().max_block) + } + fn execute_block( + block: Block, + state_root_check: bool, + signature_check: bool, + select: frame_try_runtime::TryStateSelect + ) -> Weight { + // NOTE: intentional unwrap: we don't want to propagate the error backwards, and want to + // have a backtrace here. + Executive::try_execute_block(block, state_root_check,signature_check, select).unwrap() + } + } + + impl sp_genesis_builder::GenesisBuilder for Runtime { + fn build_state(config: Vec) -> sp_genesis_builder::Result { + build_state::(config) + } + + fn get_preset(id: &Option) -> Option> { + get_preset::(id, |_| None) + } + + fn preset_names() -> Vec { + vec![] + } + } +} + +cumulus_pallet_parachain_system::register_validate_block! { + Runtime = Runtime, + BlockExecutor = cumulus_pallet_aura_ext::BlockExecutor::, +} diff --git a/runtime/bifrost-paseo/src/migration.rs b/runtime/bifrost-paseo/src/migration.rs new file mode 100644 index 0000000000..a3aa396a28 --- /dev/null +++ b/runtime/bifrost-paseo/src/migration.rs @@ -0,0 +1,465 @@ +#![allow(dead_code)] + +use super::*; +use frame_support::{pallet_prelude::*, storage_alias, traits::OnRuntimeUpgrade}; +use log; +use parity_scale_codec::{Decode, Encode, EncodeLike, MaxEncodedLen}; +use sp_std::fmt::Debug; + +#[cfg(feature = "try-runtime")] +use sp_runtime::TryRuntimeError; + +parameter_types! { + pub const FellowshipReferendaData: &'static str = r#"[{"index":0,"deposit1":{"who":"fAGgdvAYwqCwpt3Wda1mzpACnNyESbfgfgvm1RLSudBsUEu","amount":0},"deposit2":null},{"index":10,"deposit1":{"who":"dEmQ58Mi6YKd16XifjaX9jPg13C1HHV1EdeEQqQn3GwLueP","amount":0},"deposit2":{"who":"dEmQ58Mi6YKd16XifjaX9jPg13C1HHV1EdeEQqQn3GwLueP","amount":1000000000000}},{"index":4,"deposit1":{"who":"fAGgdvAYwqCwpt3Wda1mzpACnNyESbfgfgvm1RLSudBsUEu","amount":0},"deposit2":null},{"index":21,"deposit1":{"who":"fAGgdvAYwqCwpt3Wda1mzpACnNyESbfgfgvm1RLSudBsUEu","amount":0},"deposit2":{"who":"fAGgdvAYwqCwpt3Wda1mzpACnNyESbfgfgvm1RLSudBsUEu","amount":10000000000000}},{"index":20,"deposit1":{"who":"fAGgdvAYwqCwpt3Wda1mzpACnNyESbfgfgvm1RLSudBsUEu","amount":0},"deposit2":{"who":"fAGgdvAYwqCwpt3Wda1mzpACnNyESbfgfgvm1RLSudBsUEu","amount":10000000000000}},{"index":16,"deposit1":{"who":"fAGgdvAYwqCwpt3Wda1mzpACnNyESbfgfgvm1RLSudBsUEu","amount":0},"deposit2":{"who":"fAGgdvAYwqCwpt3Wda1mzpACnNyESbfgfgvm1RLSudBsUEu","amount":10000000000000}},{"index":11,"deposit1":{"who":"fAGgdvAYwqCwpt3Wda1mzpACnNyESbfgfgvm1RLSudBsUEu","amount":0},"deposit2":null},{"index":14,"deposit1":{"who":"fAGgdvAYwqCwpt3Wda1mzpACnNyESbfgfgvm1RLSudBsUEu","amount":0},"deposit2":null},{"index":6,"deposit1":{"who":"fAGgdvAYwqCwpt3Wda1mzpACnNyESbfgfgvm1RLSudBsUEu","amount":0},"deposit2":null},{"index":19,"deposit1":{"who":"dEmQ58Mi6YKd16XifjaX9jPg13C1HHV1EdeEQqQn3GwLueP","amount":0},"deposit2":{"who":"dEmQ58Mi6YKd16XifjaX9jPg13C1HHV1EdeEQqQn3GwLueP","amount":1000000000000}},{"index":15,"deposit1":{"who":"fAGgdvAYwqCwpt3Wda1mzpACnNyESbfgfgvm1RLSudBsUEu","amount":0},"deposit2":{"who":"fAGgdvAYwqCwpt3Wda1mzpACnNyESbfgfgvm1RLSudBsUEu","amount":10000000000000}},{"index":2,"deposit1":{"who":"fAGgdvAYwqCwpt3Wda1mzpACnNyESbfgfgvm1RLSudBsUEu","amount":0},"deposit2":null},{"index":13,"deposit1":{"who":"fAGgdvAYwqCwpt3Wda1mzpACnNyESbfgfgvm1RLSudBsUEu","amount":0},"deposit2":null},{"index":5,"deposit1":{"who":"fAGgdvAYwqCwpt3Wda1mzpACnNyESbfgfgvm1RLSudBsUEu","amount":0},"deposit2":null},{"index":18,"deposit1":{"who":"fAGgdvAYwqCwpt3Wda1mzpACnNyESbfgfgvm1RLSudBsUEu","amount":0},"deposit2":{"who":"fAGgdvAYwqCwpt3Wda1mzpACnNyESbfgfgvm1RLSudBsUEu","amount":10000000000000}},{"index":7,"deposit1":{"who":"fAGgdvAYwqCwpt3Wda1mzpACnNyESbfgfgvm1RLSudBsUEu","amount":0},"deposit2":null},{"index":22,"deposit1":{"who":"fAGgdvAYwqCwpt3Wda1mzpACnNyESbfgfgvm1RLSudBsUEu","amount":0},"deposit2":{"who":"fAGgdvAYwqCwpt3Wda1mzpACnNyESbfgfgvm1RLSudBsUEu","amount":10000000000000}},{"index":24,"deposit1":{"who":"fAGgdvAYwqCwpt3Wda1mzpACnNyESbfgfgvm1RLSudBsUEu","amount":0},"deposit2":{"who":"fAGgdvAYwqCwpt3Wda1mzpACnNyESbfgfgvm1RLSudBsUEu","amount":10000000000000}},{"index":8,"deposit1":{"who":"fAGgdvAYwqCwpt3Wda1mzpACnNyESbfgfgvm1RLSudBsUEu","amount":0},"deposit2":null},{"index":1,"deposit1":{"who":"fAGgdvAYwqCwpt3Wda1mzpACnNyESbfgfgvm1RLSudBsUEu","amount":0},"deposit2":null},{"index":12,"deposit1":{"who":"cYPu6g4apwndq26ryA4gFjW7us5LdcpCnzgkeFyxdgu5aop","amount":0},"deposit2":{"who":"cYPu6g4apwndq26ryA4gFjW7us5LdcpCnzgkeFyxdgu5aop","amount":10000000000000}},{"index":3,"deposit1":{"who":"fAGgdvAYwqCwpt3Wda1mzpACnNyESbfgfgvm1RLSudBsUEu","amount":0},"deposit2":null},{"index":17,"deposit1":{"who":"fAGgdvAYwqCwpt3Wda1mzpACnNyESbfgfgvm1RLSudBsUEu","amount":0},"deposit2":{"who":"fAGgdvAYwqCwpt3Wda1mzpACnNyESbfgfgvm1RLSudBsUEu","amount":10000000000000}},{"index":25,"deposit1":{"who":"fAGgdvAYwqCwpt3Wda1mzpACnNyESbfgfgvm1RLSudBsUEu","amount":0},"deposit2":{"who":"fAGgdvAYwqCwpt3Wda1mzpACnNyESbfgfgvm1RLSudBsUEu","amount":10000000000000}},{"index":23,"deposit1":{"who":"fAGgdvAYwqCwpt3Wda1mzpACnNyESbfgfgvm1RLSudBsUEu","amount":0},"deposit2":{"who":"fAGgdvAYwqCwpt3Wda1mzpACnNyESbfgfgvm1RLSudBsUEu","amount":10000000000000}},{"index":9,"deposit1":{"who":"dEmQ58Mi6YKd16XifjaX9jPg13C1HHV1EdeEQqQn3GwLueP","amount":0},"deposit2":null}]"#; + pub const ReferendaData: &'static str = r#"[{"index":0,"deposit1":{"who":"fAGgdvAYwqCwpt3Wda1mzpACnNyESbfgfgvm1RLSudBsUEu","amount":10000000000000},"deposit2":null},{"index":4,"deposit1":{"who":"gB5r2iWvPCZcUMXxXBfp9UChnRovJ9YwZMrPGDdbxayuqhZ","amount":10000000000000},"deposit2":null},{"index":6,"deposit1":{"who":"g5SajmWUz458LZG1EEX9ybhkQ35nDXr4fg1yjkq5kiVkKcD","amount":10000000000000},"deposit2":{"who":"g5SajmWUz458LZG1EEX9ybhkQ35nDXr4fg1yjkq5kiVkKcD","amount":2500000000000000}},{"index":2,"deposit1":{"who":"fAGgdvAYwqCwpt3Wda1mzpACnNyESbfgfgvm1RLSudBsUEu","amount":10000000000000},"deposit2":null},{"index":5,"deposit1":{"who":"gB5r2iWvPCZcUMXxXBfp9UChnRovJ9YwZMrPGDdbxayuqhZ","amount":10000000000000},"deposit2":null},{"index":7,"deposit1":{"who":"gB5r2iWvPCZcUMXxXBfp9UChnRovJ9YwZMrPGDdbxayuqhZ","amount":10000000000000},"deposit2":null},{"index":1,"deposit1":{"who":"fAGgdvAYwqCwpt3Wda1mzpACnNyESbfgfgvm1RLSudBsUEu","amount":10000000000000},"deposit2":null},{"index":3,"deposit1":{"who":"fAGgdvAYwqCwpt3Wda1mzpACnNyESbfgfgvm1RLSudBsUEu","amount":10000000000000},"deposit2":null}]"#; +} + +/// Initial version of storage types. +pub mod v0 { + use super::*; + use pallet_referenda::{ + BalanceOf, BoundedCallOf, Config, Deposit, Pallet, PalletsOriginOf, ReferendumIndex, + ReferendumStatus, ScheduleAddressOf, TallyOf, TrackIdOf, + }; + // ReferendumStatus and its dependency types referenced from the latest version while staying + // unchanged. [`super::test::referendum_status_v0()`] checks its immutability between v0 and + // latest version. + + pub type ReferendumInfoOf = ReferendumInfo< + TrackIdOf, + PalletsOriginOf, + frame_system::pallet_prelude::BlockNumberFor, + BoundedCallOf, + BalanceOf, + TallyOf, + ::AccountId, + ScheduleAddressOf, + >; + + /// Info regarding a referendum, present or past. + #[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] + pub enum ReferendumInfo< + TrackId: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, + RuntimeOrigin: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, + Moment: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone + EncodeLike, + Call: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, + Balance: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, + Tally: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, + AccountId: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, + ScheduleAddress: Eq + PartialEq + Debug + Encode + Decode + TypeInfo + Clone, + > { + /// Referendum has been submitted and is being voted on. + Ongoing( + ReferendumStatus< + TrackId, + RuntimeOrigin, + Moment, + Call, + Balance, + Tally, + AccountId, + ScheduleAddress, + >, + ), + /// Referendum finished with approval. Submission deposit is held. + Approved( + Moment, + Option>, + Option>, + ), + /// Referendum finished with rejection. Submission deposit is held. + Rejected( + Moment, + Option>, + Option>, + ), + /// Referendum finished with cancellation. Submission deposit is held. + Cancelled( + Moment, + Option>, + Option>, + ), + /// Referendum finished and was never decided. Submission deposit is held. + TimedOut( + Moment, + Option>, + Option>, + ), + /// Referendum finished with a kill. + Killed(Moment), + } + + #[storage_alias] + pub type ReferendumInfoFor, I: 'static> = + StorageMap, Blake2_128Concat, ReferendumIndex, ReferendumInfoOf>; +} + +pub mod v1 { + use super::*; + use pallet_referenda::{ + BalanceOf, Config, Deposit, Pallet, ReferendumIndex, ReferendumInfo, ReferendumInfoFor, + }; + use sp_runtime::Deserialize; + + /// The log target. + const TARGET: &'static str = "runtime::referenda::migration::v1"; + + #[derive(Debug, Deserialize, Clone)] + struct ForeignReferendumInfo { + index: ReferendumIndex, + deposit1: Option>, + deposit2: Option>, + } + + #[derive(Debug, Deserialize, Clone)] + struct ForeignDeposit { + who: AccountId, + amount: Balance, + } + + /// Restore ReferendumInfo(Approved|Rejected|Cancelled|TimedOut). + pub struct RestoreReferendaV1, T, I = ()>(PhantomData<(R, T, I)>); + impl, T: Config, I: 'static> OnRuntimeUpgrade + for RestoreReferendaV1 + { + #[cfg(feature = "try-runtime")] + fn pre_upgrade() -> Result, TryRuntimeError> { + let referendum_count = v0::ReferendumInfoFor::::iter().count(); + log::info!( + target: TARGET, + "pre-upgrade state contains '{}' referendums.", + referendum_count + ); + let infos = v0::ReferendumInfoFor::::iter().collect::>(); + log::info!("pre_upgrade infos: {:?}", infos); + Ok((referendum_count as u32).encode()) + } + + fn on_runtime_upgrade() -> Weight { + let result: Vec>> = + serde_json::from_str(R::get()).expect("Failed to deserialize JSON"); + + let mut weight = T::DbWeight::get().reads(1); + + v0::ReferendumInfoFor::::iter().for_each(|(key, value)| { + let item = result + .iter() + .filter(|item| item.index == key) + .cloned() + .collect::>>>(); + if item.len() != 1 { + weight.saturating_accrue(T::DbWeight::get().reads(1)); + return; + } + let maybe_new_value = match value { + v0::ReferendumInfo::Ongoing(_) | v0::ReferendumInfo::Killed(_) => None, + v0::ReferendumInfo::Approved(e, mut s, mut d) => { + if let Some(a) = &item[0].deposit1 { + s = Some(Deposit { + amount: a.amount, + who: a.who.clone(), + }) + } + if let Some(a) = &item[0].deposit2 { + d = Some(Deposit { + amount: a.amount, + who: a.who.clone(), + }) + } + Some(ReferendumInfo::Approved(e, s, d)) + } + v0::ReferendumInfo::Rejected(e, mut s, mut d) => { + if let Some(a) = &item[0].deposit1 { + s = Some(Deposit { + amount: a.amount, + who: a.who.clone(), + }) + } + if let Some(a) = &item[0].deposit2 { + d = Some(Deposit { + amount: a.amount, + who: a.who.clone(), + }) + } + Some(ReferendumInfo::Rejected(e, s, d)) + } + v0::ReferendumInfo::Cancelled(e, mut s, mut d) => { + if let Some(a) = &item[0].deposit1 { + s = Some(Deposit { + amount: a.amount, + who: a.who.clone(), + }) + } + if let Some(a) = &item[0].deposit2 { + d = Some(Deposit { + amount: a.amount, + who: a.who.clone(), + }) + } + Some(ReferendumInfo::Cancelled(e, s, d)) + } + v0::ReferendumInfo::TimedOut(e, mut s, mut d) => { + if let Some(a) = &item[0].deposit1 { + s = Some(Deposit { + amount: a.amount, + who: a.who.clone(), + }) + } + if let Some(a) = &item[0].deposit2 { + d = Some(Deposit { + amount: a.amount, + who: a.who.clone(), + }) + } + Some(ReferendumInfo::TimedOut(e, s, d)) + } + }; + if let Some(new_value) = maybe_new_value { + weight.saturating_accrue(T::DbWeight::get().reads_writes(1, 1)); + log::info!(target: TARGET, "migrating referendum #{:?}", &key); + ReferendumInfoFor::::insert(key, new_value); + } else { + weight.saturating_accrue(T::DbWeight::get().reads(1)); + } + }); + StorageVersion::new(1).put::>(); + weight.saturating_accrue(T::DbWeight::get().writes(1)); + weight + } + + #[cfg(feature = "try-runtime")] + fn post_upgrade(state: Vec) -> Result<(), TryRuntimeError> { + let pre_referendum_count: u32 = Decode::decode(&mut &state[..]) + .expect("failed to decode the state from pre-upgrade."); + let post_referendum_count = ReferendumInfoFor::::iter().count() as u32; + ensure!( + post_referendum_count == pre_referendum_count, + "must migrate all referendums." + ); + + let result: Vec>> = + serde_json::from_str(R::get()).expect("Failed to deserialize JSON"); + for item in result { + let referendum_info = ReferendumInfoFor::::get(item.index) + .expect("failed to decode the state from pre-upgrade."); + + match referendum_info { + ReferendumInfo::Ongoing(_) | ReferendumInfo::Killed(_) => (), + ReferendumInfo::Approved(_e, s, d) + | ReferendumInfo::Rejected(_e, s, d) + | ReferendumInfo::Cancelled(_e, s, d) + | ReferendumInfo::TimedOut(_e, s, d) => { + match (s, item.deposit1) { + (Some(s), Some(a)) => { + ensure!(s.amount == a.amount, "amount not equal"); + ensure!(s.who == a.who, "who not equal"); + } + (None, None) => (), + _ => return Err(TryRuntimeError::Other("Referenda Data mismatch")), + } + match (d, item.deposit2) { + (Some(d), Some(a)) => { + ensure!(d.amount == a.amount, "amount not equal"); + ensure!(d.who == a.who, "who not equal"); + } + (None, None) => (), + _ => return Err(TryRuntimeError::Other("Referenda Data mismatch")), + } + () + } + }; + } + + log::info!(target: TARGET, "migrated all referendums."); + Ok(()) + } + } +} + +pub mod slpx_migrates_whitelist { + use super::*; + use bifrost_slpx::types::SupportChain; + use sp_core::crypto::Ss58Codec; + + pub struct UpdateWhitelist; + impl OnRuntimeUpgrade for UpdateWhitelist { + fn on_runtime_upgrade() -> Weight { + pallet_xcm::migrations::migrate_to_v1::>(); + let new_whitelist: BoundedVec> = vec![ + AccountId::from_ss58check("gWEvf2EDMzxR7JHyrEHXf3nqxKLGvHaFbk7HUkJnNPUxDts") + .unwrap(), + AccountId::from_ss58check("bpRBE4rWcBJqqN2ESts5LefuvLonBeZ4r2YBpfuuxvMxoea") + .unwrap(), + ] + .try_into() + .unwrap(); + bifrost_slpx::WhitelistAccountId::::insert( + SupportChain::Moonbeam, + new_whitelist, + ); + + let new_whitelist: BoundedVec> = vec![ + AccountId::from_ss58check("g96o4GVpsAop1MJiArnmUYtXUjEisfkbfcpsuqmXrS28MEr") + .unwrap(), + AccountId::from_ss58check("dZWAvaUWbPN1oKbWMkeDWHBceX8RqP4CMwmi1trq9uf5pBn") + .unwrap(), + ] + .try_into() + .unwrap(); + bifrost_slpx::WhitelistAccountId::::insert(SupportChain::Astar, new_whitelist); + + Weight::from(::DbWeight::get().writes(2u64)) + } + + #[cfg(feature = "try-runtime")] + fn post_upgrade(_state: Vec) -> Result<(), TryRuntimeError> { + let whitelist = + bifrost_slpx::WhitelistAccountId::::get(SupportChain::Moonbeam); + let new_whitelist: BoundedVec> = vec![ + AccountId::from_ss58check("gWEvf2EDMzxR7JHyrEHXf3nqxKLGvHaFbk7HUkJnNPUxDts") + .unwrap(), + AccountId::from_ss58check("bpRBE4rWcBJqqN2ESts5LefuvLonBeZ4r2YBpfuuxvMxoea") + .unwrap(), + ] + .try_into() + .unwrap(); + assert_eq!(whitelist, new_whitelist); + + let whitelist = bifrost_slpx::WhitelistAccountId::::get(SupportChain::Astar); + let new_whitelist: BoundedVec> = vec![ + AccountId::from_ss58check("g96o4GVpsAop1MJiArnmUYtXUjEisfkbfcpsuqmXrS28MEr") + .unwrap(), + AccountId::from_ss58check("dZWAvaUWbPN1oKbWMkeDWHBceX8RqP4CMwmi1trq9uf5pBn") + .unwrap(), + ] + .try_into() + .unwrap(); + assert_eq!(whitelist, new_whitelist); + + Ok(()) + } + } +} + +pub mod opengov { + use super::*; + use pallet_ranked_collective::{Config, IdToIndex, IndexToId}; + use sp_core::crypto::Ss58Codec; + + pub struct RankedCollectiveV1(PhantomData<(T, I)>); + impl, I: 'static> OnRuntimeUpgrade for RankedCollectiveV1 + where + AccountId: + Ss58Codec + parity_scale_codec::EncodeLike<::AccountId>, + { + fn on_runtime_upgrade() -> Weight { + let remove_member = + AccountId::from_ss58check("cYPu6g4apwndq26ryA4gFjW7us5LdcpCnzgkeFyxdgu5aop") + .unwrap(); + let demote_member1 = + AccountId::from_ss58check("fXznm8JzrUuyEijnyy8M2tfdFQeot2bUrERe3ZK9FwTaZZw") + .unwrap(); + let demote_member2 = + AccountId::from_ss58check("fAGgdvAYwqCwpt3Wda1mzpACnNyESbfgfgvm1RLSudBsUEu") + .unwrap(); + IdToIndex::::remove(5, demote_member1.clone()); + IdToIndex::::remove(5, demote_member2.clone()); + IdToIndex::::remove(6, demote_member1.clone()); + IdToIndex::::remove(6, demote_member2.clone()); + IdToIndex::::remove(0, remove_member.clone()); + IdToIndex::::remove(1, remove_member.clone()); + IdToIndex::::remove(2, remove_member.clone()); + IdToIndex::::remove(3, remove_member.clone()); + IdToIndex::::remove(4, remove_member.clone()); + IdToIndex::::remove(5, remove_member.clone()); + IdToIndex::::remove(6, remove_member.clone()); + + IndexToId::::remove(2, 14); + IndexToId::::remove(3, 10); + IndexToId::::remove(4, 7); + + IndexToId::::remove(5, 2); + IndexToId::::remove(5, 3); + IndexToId::::remove(5, 4); + IndexToId::::remove(6, 2); + IndexToId::::remove(6, 3); + IndexToId::::remove(6, 4); + Weight::from(::DbWeight::get().writes(20u64)) + } + + #[cfg(feature = "try-runtime")] + fn post_upgrade(_state: Vec) -> Result<(), TryRuntimeError> { + let rank6_member = + AccountId::from_ss58check("hJmectFjn7CCEQL1tKDxvboA1i9hcfTyUrLuW3xjDqRgxmm") + .unwrap(); + let remove_member = + AccountId::from_ss58check("cYPu6g4apwndq26ryA4gFjW7us5LdcpCnzgkeFyxdgu5aop") + .unwrap(); + let demote_member1 = + AccountId::from_ss58check("fXznm8JzrUuyEijnyy8M2tfdFQeot2bUrERe3ZK9FwTaZZw") + .unwrap(); + let demote_member2 = + AccountId::from_ss58check("fAGgdvAYwqCwpt3Wda1mzpACnNyESbfgfgvm1RLSudBsUEu") + .unwrap(); + assert_eq!(IdToIndex::::get(5, rank6_member.clone()), Some(0)); + assert_eq!(IdToIndex::::get(6, rank6_member.clone()), Some(0)); + assert_eq!(IndexToId::::get(5, 2), None); + assert_eq!(IndexToId::::get(5, 3), None); + assert_eq!(IndexToId::::get(5, 4), None); + assert_eq!(IndexToId::::get(6, 2), None); + assert_eq!(IndexToId::::get(6, 3), None); + assert_eq!(IndexToId::::get(6, 4), None); + + assert_eq!(IndexToId::::get(4, 7), None); + assert_eq!(IndexToId::::get(4, 8), None); + assert_eq!(IndexToId::::get(3, 10), None); + assert_eq!(IndexToId::::get(3, 11), None); + assert_eq!(IndexToId::::get(2, 14), None); + assert_eq!(IndexToId::::get(1, 19), None); + assert_eq!(IndexToId::::get(0, 19), None); + + let deserialize_to_account_id32 = |account_id: T::AccountId| -> AccountId { + let encoded = account_id.encode(); + AccountId::decode(&mut &encoded[..]).expect("Failed to decode AccountId") + }; + assert_eq!( + IndexToId::::get(5, 0).map(deserialize_to_account_id32), + Some(rank6_member) + ); + assert_eq!(IdToIndex::::get(5, demote_member1.clone()), None); + assert_eq!(IdToIndex::::get(6, demote_member1.clone()), None); + assert_eq!(IdToIndex::::get(5, demote_member2.clone()), None); + assert_eq!(IdToIndex::::get(6, demote_member2.clone()), None); + + assert_eq!(IdToIndex::::get(0, remove_member.clone()), None); + assert_eq!(IdToIndex::::get(1, remove_member.clone()), None); + assert_eq!(IdToIndex::::get(2, remove_member.clone()), None); + assert_eq!(IdToIndex::::get(3, remove_member.clone()), None); + assert_eq!(IdToIndex::::get(4, remove_member.clone()), None); + assert_eq!(IdToIndex::::get(5, remove_member.clone()), None); + assert_eq!(IdToIndex::::get(6, remove_member.clone()), None); + + Ok(()) + } + } +} + +pub mod genesis_evm_storage { + use crate::{Runtime, Weight}; + use frame_support::traits::OnRuntimeUpgrade; + use pallet_dynamic_fee::MinGasPrice; + use pallet_evm_chain_id::ChainId; + use primitive_types::U256; + + pub struct GenesisEVMStorage; + + impl OnRuntimeUpgrade for GenesisEVMStorage { + fn on_runtime_upgrade() -> Weight { + let evm_id: u64 = 996u64; + let min_gas_fee: U256 = U256::from(560174200u64); + ChainId::::put(evm_id); + MinGasPrice::::put(min_gas_fee); + ::DbWeight::get().reads_writes(0, 2) + } + } +} diff --git a/runtime/bifrost-paseo/src/weights/bb_bnc.rs b/runtime/bifrost-paseo/src/weights/bb_bnc.rs new file mode 100644 index 0000000000..4dd0155da7 --- /dev/null +++ b/runtime/bifrost-paseo/src/weights/bb_bnc.rs @@ -0,0 +1,552 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for bb_bnc +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-09-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bifrost-jenkins`, CPU: `Intel(R) Xeon(R) CPU E5-26xx v4` +//! WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-polkadot-local"), DB CACHE: 1024 + +// Executed Command: +// target/release/bifrost +// benchmark +// pallet +// --chain=bifrost-polkadot-local +// --steps=50 +// --repeat=20 +// --pallet=bb_bnc +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/bifrost-polkadot/src/weights/bb_bnc.rs +// --template=./weight-template/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; + +/// Weight functions for bb_bnc. +pub struct BifrostWeight(PhantomData); +impl bb_bnc::WeightInfo for BifrostWeight { + /// Storage: `BbBNC::IncentiveConfigs` (r:1 w:1) + /// Proof: `BbBNC::IncentiveConfigs` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Number` (r:1 w:0) + /// Proof: `System::Number` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BbBNC::Epoch` (r:1 w:0) + /// Proof: `BbBNC::Epoch` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::PointHistory` (r:1 w:0) + /// Proof: `BbBNC::PointHistory` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:2 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `System::ExecutionPhase` (r:1 w:0) + /// Proof: `System::ExecutionPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) + /// Storage: `System::EventCount` (r:1 w:1) + /// Proof: `System::EventCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `System::Events` (r:1 w:1) + /// Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn on_initialize() -> Weight { + // Proof Size summary in bytes: + // Measured: `462` + // Estimated: `6196` + // Minimum execution time: 22_033_000 picoseconds. + Weight::from_parts(22_373_000, 0) + .saturating_add(Weight::from_parts(0, 6196)) + .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: BbBNC VeConfigs (r:1 w:1) + // Proof Skipped: BbBNC VeConfigs (max_values: Some(1), max_size: None, mode: Measured) + // Storage: System Number (r:1 w:0) + // Proof: System Number (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: System ExecutionPhase (r:1 w:0) + // Proof: System ExecutionPhase (max_values: Some(1), max_size: Some(5), added: 500, mode: MaxEncodedLen) + // Storage: System EventCount (r:1 w:1) + // Proof: System EventCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: System Events (r:1 w:1) + // Proof Skipped: System Events (max_values: Some(1), max_size: None, mode: Measured) + fn set_config() -> Weight { + // Proof Size summary in bytes: + // Measured: `200` + // Estimated: `1685` + // Minimum execution time: 33_022 nanoseconds. + Weight::from_parts(33_924_000, 1685) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: BbBNC VeConfigs (r:1 w:0) + // Proof Skipped: BbBNC VeConfigs (max_values: Some(1), max_size: None, mode: Measured) + // Storage: BbBNC Locked (r:1 w:1) + // Proof Skipped: BbBNC Locked (max_values: None, max_size: None, mode: Measured) + // Storage: System Number (r:1 w:0) + // Proof: System Number (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: BbBNC Supply (r:1 w:1) + // Proof Skipped: BbBNC Supply (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:2 w:2) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: System Account (r:2 w:1) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: System ExecutionPhase (r:1 w:0) + // Proof: System ExecutionPhase (max_values: Some(1), max_size: Some(5), added: 500, mode: MaxEncodedLen) + // Storage: System EventCount (r:1 w:1) + // Proof: System EventCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: System Events (r:1 w:1) + // Proof Skipped: System Events (max_values: Some(1), max_size: None, mode: Measured) + // Storage: BbBNC IncentiveConfigs (r:1 w:1) + // Proof Skipped: BbBNC IncentiveConfigs (max_values: Some(1), max_size: None, mode: Measured) + // Storage: BbBNC Epoch (r:1 w:1) + // Proof Skipped: BbBNC Epoch (max_values: Some(1), max_size: None, mode: Measured) + // Storage: BbBNC PointHistory (r:1 w:1) + // Proof Skipped: BbBNC PointHistory (max_values: None, max_size: None, mode: Measured) + // Storage: BbBNC UserPointEpoch (r:1 w:1) + // Proof Skipped: BbBNC UserPointEpoch (max_values: None, max_size: None, mode: Measured) + // Storage: BbBNC Rewards (r:1 w:0) + // Proof Skipped: BbBNC Rewards (max_values: None, max_size: None, mode: Measured) + // Storage: BbBNC SlopeChanges (r:2 w:1) + // Proof Skipped: BbBNC SlopeChanges (max_values: None, max_size: None, mode: Measured) + // Storage: BbBNC UserPointHistory (r:0 w:1) + // Proof Skipped: BbBNC UserPointHistory (max_values: None, max_size: None, mode: Measured) + // Storage: BbBNC UserRewardPerTokenPaid (r:0 w:1) + // Proof Skipped: BbBNC UserRewardPerTokenPaid (max_values: None, max_size: None, mode: Measured) + fn create_lock() -> Weight { + // Proof Size summary in bytes: + // Measured: `1439` + // Estimated: `7379` + // Minimum execution time: 257_228 nanoseconds. + Weight::from_parts(260_165_000, 7379) + .saturating_add(T::DbWeight::get().reads(19)) + .saturating_add(T::DbWeight::get().writes(14)) + } + // Storage: BbBNC VeConfigs (r:1 w:0) + // Proof Skipped: BbBNC VeConfigs (max_values: Some(1), max_size: None, mode: Measured) + // Storage: BbBNC Locked (r:1 w:1) + // Proof Skipped: BbBNC Locked (max_values: None, max_size: None, mode: Measured) + // Storage: System Number (r:1 w:0) + // Proof: System Number (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: BbBNC Supply (r:1 w:1) + // Proof Skipped: BbBNC Supply (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:2 w:2) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: System Account (r:1 w:0) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: System ExecutionPhase (r:1 w:0) + // Proof: System ExecutionPhase (max_values: Some(1), max_size: Some(5), added: 500, mode: MaxEncodedLen) + // Storage: System EventCount (r:1 w:1) + // Proof: System EventCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: System Events (r:1 w:1) + // Proof Skipped: System Events (max_values: Some(1), max_size: None, mode: Measured) + // Storage: BbBNC IncentiveConfigs (r:1 w:1) + // Proof Skipped: BbBNC IncentiveConfigs (max_values: Some(1), max_size: None, mode: Measured) + // Storage: BbBNC Epoch (r:1 w:1) + // Proof Skipped: BbBNC Epoch (max_values: Some(1), max_size: None, mode: Measured) + // Storage: BbBNC PointHistory (r:1 w:1) + // Proof Skipped: BbBNC PointHistory (max_values: None, max_size: None, mode: Measured) + // Storage: BbBNC UserPointEpoch (r:1 w:1) + // Proof Skipped: BbBNC UserPointEpoch (max_values: None, max_size: None, mode: Measured) + // Storage: BbBNC UserPointHistory (r:1 w:1) + // Proof Skipped: BbBNC UserPointHistory (max_values: None, max_size: None, mode: Measured) + // Storage: BbBNC Rewards (r:1 w:1) + // Proof Skipped: BbBNC Rewards (max_values: None, max_size: None, mode: Measured) + // Storage: BbBNC UserRewardPerTokenPaid (r:1 w:1) + // Proof Skipped: BbBNC UserRewardPerTokenPaid (max_values: None, max_size: None, mode: Measured) + // Storage: BbBNC SlopeChanges (r:1 w:1) + // Proof Skipped: BbBNC SlopeChanges (max_values: None, max_size: None, mode: Measured) + fn increase_amount() -> Weight { + // Proof Size summary in bytes: + // Measured: `2083` + // Estimated: `6176` + // Minimum execution time: 282_580 nanoseconds. + Weight::from_parts(291_800_000, 6176) + .saturating_add(T::DbWeight::get().reads(19)) + .saturating_add(T::DbWeight::get().writes(14)) + } + // Storage: BbBNC VeConfigs (r:1 w:0) + // Proof Skipped: BbBNC VeConfigs (max_values: Some(1), max_size: None, mode: Measured) + // Storage: BbBNC Locked (r:1 w:1) + // Proof Skipped: BbBNC Locked (max_values: None, max_size: None, mode: Measured) + // Storage: System Number (r:1 w:0) + // Proof: System Number (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: BbBNC Supply (r:1 w:1) + // Proof Skipped: BbBNC Supply (max_values: Some(1), max_size: None, mode: Measured) + // Storage: BbBNC IncentiveConfigs (r:1 w:1) + // Proof Skipped: BbBNC IncentiveConfigs (max_values: Some(1), max_size: None, mode: Measured) + // Storage: BbBNC Epoch (r:1 w:1) + // Proof Skipped: BbBNC Epoch (max_values: Some(1), max_size: None, mode: Measured) + // Storage: BbBNC PointHistory (r:1 w:1) + // Proof Skipped: BbBNC PointHistory (max_values: None, max_size: None, mode: Measured) + // Storage: BbBNC UserPointEpoch (r:1 w:1) + // Proof Skipped: BbBNC UserPointEpoch (max_values: None, max_size: None, mode: Measured) + // Storage: BbBNC UserPointHistory (r:1 w:1) + // Proof Skipped: BbBNC UserPointHistory (max_values: None, max_size: None, mode: Measured) + // Storage: BbBNC Rewards (r:1 w:1) + // Proof Skipped: BbBNC Rewards (max_values: None, max_size: None, mode: Measured) + // Storage: BbBNC UserRewardPerTokenPaid (r:1 w:1) + // Proof Skipped: BbBNC UserRewardPerTokenPaid (max_values: None, max_size: None, mode: Measured) + // Storage: BbBNC SlopeChanges (r:2 w:2) + // Proof Skipped: BbBNC SlopeChanges (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:1 w:0) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: System ExecutionPhase (r:1 w:0) + // Proof: System ExecutionPhase (max_values: Some(1), max_size: Some(5), added: 500, mode: MaxEncodedLen) + // Storage: System EventCount (r:1 w:1) + // Proof: System EventCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: System Events (r:1 w:1) + // Proof Skipped: System Events (max_values: Some(1), max_size: None, mode: Measured) + fn increase_unlock_time() -> Weight { + // Proof Size summary in bytes: + // Measured: `1589` + // Estimated: `7529` + // Minimum execution time: 228_588 nanoseconds. + Weight::from_parts(233_726_000, 7529) + .saturating_add(T::DbWeight::get().reads(17)) + .saturating_add(T::DbWeight::get().writes(13)) + } + // Storage: BbBNC Locked (r:1 w:1) + // Proof Skipped: BbBNC Locked (max_values: None, max_size: None, mode: Measured) + // Storage: System Number (r:1 w:0) + // Proof: System Number (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: BbBNC Supply (r:1 w:1) + // Proof Skipped: BbBNC Supply (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:2 w:2) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: System Account (r:1 w:1) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: System ExecutionPhase (r:1 w:0) + // Proof: System ExecutionPhase (max_values: Some(1), max_size: Some(5), added: 500, mode: MaxEncodedLen) + // Storage: System EventCount (r:1 w:1) + // Proof: System EventCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: System Events (r:1 w:1) + // Proof Skipped: System Events (max_values: Some(1), max_size: None, mode: Measured) + // Storage: BbBNC IncentiveConfigs (r:1 w:1) + // Proof Skipped: BbBNC IncentiveConfigs (max_values: Some(1), max_size: None, mode: Measured) + // Storage: BbBNC Epoch (r:1 w:1) + // Proof Skipped: BbBNC Epoch (max_values: Some(1), max_size: None, mode: Measured) + // Storage: BbBNC PointHistory (r:1 w:105) + // Proof Skipped: BbBNC PointHistory (max_values: None, max_size: None, mode: Measured) + // Storage: BbBNC SlopeChanges (r:104 w:0) + // Proof Skipped: BbBNC SlopeChanges (max_values: None, max_size: None, mode: Measured) + // Storage: BbBNC UserPointEpoch (r:1 w:1) + // Proof Skipped: BbBNC UserPointEpoch (max_values: None, max_size: None, mode: Measured) + // Storage: BbBNC UserPointHistory (r:1 w:1) + // Proof Skipped: BbBNC UserPointHistory (max_values: None, max_size: None, mode: Measured) + // Storage: BbBNC Rewards (r:1 w:1) + // Proof Skipped: BbBNC Rewards (max_values: None, max_size: None, mode: Measured) + // Storage: BbBNC UserRewardPerTokenPaid (r:1 w:1) + // Proof Skipped: BbBNC UserRewardPerTokenPaid (max_values: None, max_size: None, mode: Measured) + fn withdraw() -> Weight { + // Proof Size summary in bytes: + // Measured: `2059` + // Estimated: `260449` + // Minimum execution time: 1_301_179 nanoseconds. + Weight::from_parts(1_319_174_000, 260449) + .saturating_add(T::DbWeight::get().reads(121)) + .saturating_add(T::DbWeight::get().writes(118)) + } + // Storage: BbBNC IncentiveConfigs (r:1 w:1) + // Proof Skipped: BbBNC IncentiveConfigs (max_values: Some(1), max_size: None, mode: Measured) + // Storage: System Number (r:1 w:0) + // Proof: System Number (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: BbBNC Epoch (r:1 w:0) + // Proof Skipped: BbBNC Epoch (max_values: Some(1), max_size: None, mode: Measured) + // Storage: BbBNC PointHistory (r:1 w:0) + // Proof Skipped: BbBNC PointHistory (max_values: None, max_size: None, mode: Measured) + // Storage: BbBNC SlopeChanges (r:104 w:0) + // Proof Skipped: BbBNC SlopeChanges (max_values: None, max_size: None, mode: Measured) + // Storage: BbBNC UserPointEpoch (r:1 w:0) + // Proof Skipped: BbBNC UserPointEpoch (max_values: None, max_size: None, mode: Measured) + // Storage: BbBNC UserPointHistory (r:1 w:0) + // Proof Skipped: BbBNC UserPointHistory (max_values: None, max_size: None, mode: Measured) + // Storage: BbBNC Rewards (r:1 w:1) + // Proof Skipped: BbBNC Rewards (max_values: None, max_size: None, mode: Measured) + // Storage: BbBNC UserRewardPerTokenPaid (r:1 w:1) + // Proof Skipped: BbBNC UserRewardPerTokenPaid (max_values: None, max_size: None, mode: Measured) + // Storage: Balances TotalIssuance (r:1 w:1) + // Proof: Balances TotalIssuance (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + // Storage: System Account (r:3 w:3) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: System ExecutionPhase (r:1 w:0) + // Proof: System ExecutionPhase (max_values: Some(1), max_size: Some(5), added: 500, mode: MaxEncodedLen) + // Storage: System EventCount (r:1 w:1) + // Proof: System EventCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: System Events (r:1 w:1) + // Proof Skipped: System Events (max_values: Some(1), max_size: None, mode: Measured) + fn get_rewards() -> Weight { + // Proof Size summary in bytes: + // Measured: `1384` + // Estimated: `259774` + // Minimum execution time: 754_097 nanoseconds. + Weight::from_parts(761_819_000, 259774) + .saturating_add(T::DbWeight::get().reads(119)) + .saturating_add(T::DbWeight::get().writes(9)) + } + // Storage: BbBNC IncentiveConfigs (r:1 w:1) + // Proof Skipped: BbBNC IncentiveConfigs (max_values: Some(1), max_size: None, mode: Measured) + // Storage: System Number (r:1 w:0) + // Proof: System Number (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: System ExecutionPhase (r:1 w:0) + // Proof: System ExecutionPhase (max_values: Some(1), max_size: Some(5), added: 500, mode: MaxEncodedLen) + // Storage: System EventCount (r:1 w:1) + // Proof: System EventCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: System Events (r:1 w:1) + // Proof Skipped: System Events (max_values: Some(1), max_size: None, mode: Measured) + // Storage: BbBNC Epoch (r:1 w:0) + // Proof Skipped: BbBNC Epoch (max_values: Some(1), max_size: None, mode: Measured) + // Storage: BbBNC PointHistory (r:1 w:0) + // Proof Skipped: BbBNC PointHistory (max_values: None, max_size: None, mode: Measured) + // Storage: System Account (r:2 w:2) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: Balances TotalIssuance (r:1 w:0) + // Proof: Balances TotalIssuance (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + fn notify_rewards() -> Weight { + // Proof Size summary in bytes: + // Measured: `508` + // Estimated: `6196` + // Minimum execution time: 176_065 nanoseconds. + Weight::from_parts(177_901_000, 6196) + .saturating_add(T::DbWeight::get().reads(10)) + .saturating_add(T::DbWeight::get().writes(5)) + } + /// Storage: `BbBNC::TotalLock` (r:1 w:1) + /// Proof: `BbBNC::TotalLock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Number` (r:1 w:0) + /// Proof: `System::Number` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BbBNC::MarkupCoefficient` (r:0 w:1) + /// Proof: `BbBNC::MarkupCoefficient` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn set_markup_coefficient() -> Weight { + // Proof Size summary in bytes: + // Measured: `213` + // Estimated: `3678` + // Minimum execution time: 12_353_000 picoseconds. + Weight::from_parts(12_533_000, 0) + .saturating_add(Weight::from_parts(0, 3678)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `BbBNC::MarkupCoefficient` (r:1 w:0) + /// Proof: `BbBNC::MarkupCoefficient` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::TotalLock` (r:1 w:1) + /// Proof: `BbBNC::TotalLock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Number` (r:1 w:0) + /// Proof: `System::Number` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BbBNC::UserMarkupInfos` (r:1 w:1) + /// Proof: `BbBNC::UserMarkupInfos` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::LockedTokens` (r:1 w:1) + /// Proof: `BbBNC::LockedTokens` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Tokens::Locks` (r:1 w:1) + /// Proof: `Tokens::Locks` (`max_values`: None, `max_size`: Some(1271), added: 3746, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Accounts` (r:1 w:1) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(118), added: 2593, mode: `MaxEncodedLen`) + /// Storage: `AssetRegistry::CurrencyMetadatas` (r:1 w:0) + /// Proof: `AssetRegistry::CurrencyMetadatas` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::ExecutionPhase` (r:1 w:0) + /// Proof: `System::ExecutionPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) + /// Storage: `System::EventCount` (r:1 w:1) + /// Proof: `System::EventCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `System::Events` (r:1 w:1) + /// Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::UserPositions` (r:1 w:0) + /// Proof: `BbBNC::UserPositions` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::Locked` (r:1 w:0) + /// Proof: `BbBNC::Locked` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::IncentiveConfigs` (r:1 w:1) + /// Proof: `BbBNC::IncentiveConfigs` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::Epoch` (r:1 w:1) + /// Proof: `BbBNC::Epoch` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::PointHistory` (r:1 w:105) + /// Proof: `BbBNC::PointHistory` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::SlopeChanges` (r:104 w:0) + /// Proof: `BbBNC::SlopeChanges` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::UserPointEpoch` (r:1 w:1) + /// Proof: `BbBNC::UserPointEpoch` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::UserPointHistory` (r:1 w:1) + /// Proof: `BbBNC::UserPointHistory` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::Rewards` (r:1 w:1) + /// Proof: `BbBNC::Rewards` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::UserRewardPerTokenPaid` (r:1 w:1) + /// Proof: `BbBNC::UserRewardPerTokenPaid` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::Supply` (r:1 w:0) + /// Proof: `BbBNC::Supply` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn deposit_markup() -> Weight { + // Proof Size summary in bytes: + // Measured: `2260` + // Estimated: `260650` + // Minimum execution time: 820_796_000 picoseconds. + Weight::from_parts(831_306_000, 0) + .saturating_add(Weight::from_parts(0, 260650)) + .saturating_add(T::DbWeight::get().reads(125)) + .saturating_add(T::DbWeight::get().writes(118)) + } + /// Storage: `BbBNC::MarkupCoefficient` (r:1 w:0) + /// Proof: `BbBNC::MarkupCoefficient` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::UserMarkupInfos` (r:1 w:1) + /// Proof: `BbBNC::UserMarkupInfos` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::LockedTokens` (r:1 w:1) + /// Proof: `BbBNC::LockedTokens` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::TotalLock` (r:1 w:1) + /// Proof: `BbBNC::TotalLock` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Tokens::Locks` (r:1 w:1) + /// Proof: `Tokens::Locks` (`max_values`: None, `max_size`: Some(1271), added: 3746, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Accounts` (r:1 w:1) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(118), added: 2593, mode: `MaxEncodedLen`) + /// Storage: `AssetRegistry::CurrencyMetadatas` (r:1 w:0) + /// Proof: `AssetRegistry::CurrencyMetadatas` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Number` (r:1 w:0) + /// Proof: `System::Number` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `System::ExecutionPhase` (r:1 w:0) + /// Proof: `System::ExecutionPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) + /// Storage: `System::EventCount` (r:1 w:1) + /// Proof: `System::EventCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `System::Events` (r:1 w:1) + /// Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::UserPositions` (r:1 w:0) + /// Proof: `BbBNC::UserPositions` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::Locked` (r:1 w:0) + /// Proof: `BbBNC::Locked` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::IncentiveConfigs` (r:1 w:1) + /// Proof: `BbBNC::IncentiveConfigs` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::Epoch` (r:1 w:1) + /// Proof: `BbBNC::Epoch` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::PointHistory` (r:1 w:105) + /// Proof: `BbBNC::PointHistory` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::SlopeChanges` (r:104 w:0) + /// Proof: `BbBNC::SlopeChanges` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::UserPointEpoch` (r:1 w:1) + /// Proof: `BbBNC::UserPointEpoch` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::UserPointHistory` (r:1 w:1) + /// Proof: `BbBNC::UserPointHistory` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::Rewards` (r:1 w:1) + /// Proof: `BbBNC::Rewards` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::UserRewardPerTokenPaid` (r:1 w:1) + /// Proof: `BbBNC::UserRewardPerTokenPaid` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::Supply` (r:1 w:0) + /// Proof: `BbBNC::Supply` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn withdraw_markup() -> Weight { + // Proof Size summary in bytes: + // Measured: `2725` + // Estimated: `261115` + // Minimum execution time: 813_232_000 picoseconds. + Weight::from_parts(823_401_000, 0) + .saturating_add(Weight::from_parts(0, 261115)) + .saturating_add(T::DbWeight::get().reads(125)) + .saturating_add(T::DbWeight::get().writes(118)) + } + /// Storage: `BbBNC::Locked` (r:1 w:1) + /// Proof: `BbBNC::Locked` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Number` (r:1 w:0) + /// Proof: `System::Number` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BbBNC::Supply` (r:1 w:1) + /// Proof: `BbBNC::Supply` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::UserPositions` (r:1 w:1) + /// Proof: `BbBNC::UserPositions` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::UserLocked` (r:1 w:1) + /// Proof: `BbBNC::UserLocked` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Tokens::Accounts` (r:2 w:2) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(118), added: 2593, mode: `MaxEncodedLen`) + /// Storage: `AssetRegistry::CurrencyMetadatas` (r:1 w:0) + /// Proof: `AssetRegistry::CurrencyMetadatas` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:2 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `System::ExecutionPhase` (r:1 w:0) + /// Proof: `System::ExecutionPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) + /// Storage: `System::EventCount` (r:1 w:1) + /// Proof: `System::EventCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `System::Events` (r:1 w:1) + /// Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::IncentiveConfigs` (r:1 w:1) + /// Proof: `BbBNC::IncentiveConfigs` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::Epoch` (r:1 w:1) + /// Proof: `BbBNC::Epoch` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::PointHistory` (r:1 w:105) + /// Proof: `BbBNC::PointHistory` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::SlopeChanges` (r:104 w:0) + /// Proof: `BbBNC::SlopeChanges` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::Rewards` (r:1 w:1) + /// Proof: `BbBNC::Rewards` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::UserRewardPerTokenPaid` (r:1 w:1) + /// Proof: `BbBNC::UserRewardPerTokenPaid` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::UserPointHistory` (r:0 w:1) + /// Proof: `BbBNC::UserPointHistory` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::UserPointEpoch` (r:0 w:1) + /// Proof: `BbBNC::UserPointEpoch` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn redeem_unlock() -> Weight { + // Proof Size summary in bytes: + // Measured: `2525` + // Estimated: `260915` + // Minimum execution time: 818_341_000 picoseconds. + Weight::from_parts(827_248_000, 0) + .saturating_add(Weight::from_parts(0, 260915)) + .saturating_add(T::DbWeight::get().reads(122)) + .saturating_add(T::DbWeight::get().writes(120)) + } + /// Storage: `BbBNC::MarkupCoefficient` (r:1 w:0) + /// Proof: `BbBNC::MarkupCoefficient` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Number` (r:1 w:0) + /// Proof: `System::Number` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `BbBNC::LockedTokens` (r:2 w:1) + /// Proof: `BbBNC::LockedTokens` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::UserMarkupInfos` (r:1 w:1) + /// Proof: `BbBNC::UserMarkupInfos` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::UserPositions` (r:1 w:0) + /// Proof: `BbBNC::UserPositions` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::Locked` (r:1 w:0) + /// Proof: `BbBNC::Locked` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::IncentiveConfigs` (r:1 w:1) + /// Proof: `BbBNC::IncentiveConfigs` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::Epoch` (r:1 w:1) + /// Proof: `BbBNC::Epoch` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::PointHistory` (r:1 w:1) + /// Proof: `BbBNC::PointHistory` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::UserPointEpoch` (r:1 w:1) + /// Proof: `BbBNC::UserPointEpoch` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::UserPointHistory` (r:1 w:1) + /// Proof: `BbBNC::UserPointHistory` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::Rewards` (r:1 w:1) + /// Proof: `BbBNC::Rewards` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::UserRewardPerTokenPaid` (r:1 w:1) + /// Proof: `BbBNC::UserRewardPerTokenPaid` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::SlopeChanges` (r:1 w:1) + /// Proof: `BbBNC::SlopeChanges` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::Supply` (r:1 w:0) + /// Proof: `BbBNC::Supply` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn refresh() -> Weight { + // Proof Size summary in bytes: + // Measured: `1687` + // Estimated: `7627` + // Minimum execution time: 129_204_000 picoseconds. + Weight::from_parts(130_316_000, 0) + .saturating_add(Weight::from_parts(0, 7627)) + .saturating_add(T::DbWeight::get().reads(16)) + .saturating_add(T::DbWeight::get().writes(10)) + } +} diff --git a/runtime/bifrost-paseo/src/weights/bifrost_asset_registry.rs b/runtime/bifrost-paseo/src/weights/bifrost_asset_registry.rs new file mode 100644 index 0000000000..cbc3b0ac0f --- /dev/null +++ b/runtime/bifrost-paseo/src/weights/bifrost_asset_registry.rs @@ -0,0 +1,126 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for bifrost_asset_registry +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-09-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bifrost-jenkins`, CPU: `Intel(R) Xeon(R) CPU E5-26xx v4` +//! WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 + +// Executed Command: +// target/release/bifrost +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_asset_registry +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/bifrost-kusama/src/weights/bifrost_asset_registry.rs +// --template=./weight-template/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; + +/// Weight functions for bifrost_asset_registry. +pub struct BifrostWeight(PhantomData); +impl bifrost_asset_registry::WeightInfo for BifrostWeight { + // Storage: AssetRegistry NextTokenId (r:1 w:1) + // Proof Skipped: AssetRegistry NextTokenId (max_values: Some(1), max_size: None, mode: Measured) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:1) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + fn register_token_metadata() -> Weight { + // Proof Size summary in bytes: + // Measured: `607` + // Estimated: `4072` + // Minimum execution time: 44_741 nanoseconds. + Weight::from_parts(46_339_000, 4072) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: AssetRegistry CurrencyMetadatas (r:2 w:1) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + fn register_vtoken_metadata() -> Weight { + // Proof Size summary in bytes: + // Measured: `779` + // Estimated: `6719` + // Minimum execution time: 51_173 nanoseconds. + Weight::from_parts(52_854_000, 6719) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: AssetRegistry LocationToCurrencyIds (r:1 w:1) + // Proof Skipped: AssetRegistry LocationToCurrencyIds (max_values: None, max_size: None, mode: Measured) + // Storage: AssetRegistry CurrencyIdToLocations (r:1 w:1) + // Proof Skipped: AssetRegistry CurrencyIdToLocations (max_values: None, max_size: None, mode: Measured) + // Storage: AssetRegistry CurrencyIdToWeights (r:0 w:1) + // Proof Skipped: AssetRegistry CurrencyIdToWeights (max_values: None, max_size: None, mode: Measured) + fn register_location() -> Weight { + // Proof Size summary in bytes: + // Measured: `683` + // Estimated: `4148` + // Minimum execution time: 45_385 nanoseconds. + Weight::from_parts(46_739_000, 4148) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: AssetRegistry LocationToCurrencyIds (r:0 w:1) + // Proof Skipped: AssetRegistry LocationToCurrencyIds (max_values: None, max_size: None, mode: Measured) + // Storage: AssetRegistry CurrencyIdToWeights (r:0 w:1) + // Proof Skipped: AssetRegistry CurrencyIdToWeights (max_values: None, max_size: None, mode: Measured) + // Storage: AssetRegistry CurrencyIdToLocations (r:0 w:1) + // Proof Skipped: AssetRegistry CurrencyIdToLocations (max_values: None, max_size: None, mode: Measured) + fn force_set_location() -> Weight { + // Proof Size summary in bytes: + // Measured: `683` + // Estimated: `4148` + // Minimum execution time: 50_743 nanoseconds. + Weight::from_parts(52_775_000, 4148) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: `AssetRegistry::CurrencyMetadatas` (r:1 w:1) + // Proof: `AssetRegistry::CurrencyMetadatas` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn update_currency_metadata() -> Weight { + // Proof Size summary in bytes: + // Measured: `409` + // Estimated: `3874` + // Minimum execution time: 12_000 nanoseconds. + Weight::from_parts(13_000_000, 3874) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } +} diff --git a/runtime/bifrost-paseo/src/weights/bifrost_buy_back.rs b/runtime/bifrost-paseo/src/weights/bifrost_buy_back.rs new file mode 100644 index 0000000000..f8b8a00355 --- /dev/null +++ b/runtime/bifrost-paseo/src/weights/bifrost_buy_back.rs @@ -0,0 +1,130 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +//! Autogenerated weights for `bifrost_buy_back` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 +//! DATE: 2024-06-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `yml`, CPU: `AMD Ryzen 9 3950X 16-Core Processor` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("bifrost-polkadot-local")`, DB CACHE: 1024 + +// Executed Command: +// ./target/release/bifrost +// benchmark +// pallet +// --chain=bifrost-polkadot-local +// --pallet=bifrost-buy-back +// --extrinsic=* +// --steps=50 +// --repeat=20 +// --wasm-execution=compiled +// --heap-pages=4096 +// --header=./HEADER-GPL3 +// --output=./bifrost-buy-back.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `bifrost_buy_back`. +pub struct BifrostWeight(PhantomData); +impl bifrost_buy_back::WeightInfo for BifrostWeight { + /// Storage: `System::Number` (r:1 w:0) + /// Proof: `System::Number` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `System::ExecutionPhase` (r:1 w:0) + /// Proof: `System::ExecutionPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) + /// Storage: `System::EventCount` (r:1 w:1) + /// Proof: `System::EventCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `System::Events` (r:1 w:1) + /// Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `BuyBack::Infos` (r:0 w:1) + /// Proof: `BuyBack::Infos` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn set_vtoken() -> Weight { + // Proof Size summary in bytes: + // Measured: `25` + // Estimated: `1510` + // Minimum execution time: 11_582_000 picoseconds. + Weight::from_parts(11_753_000, 0) + .saturating_add(Weight::from_parts(0, 1510)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `Tokens::Accounts` (r:2 w:2) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(118), added: 2593, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:2 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `System::Number` (r:1 w:0) + /// Proof: `System::Number` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `System::ExecutionPhase` (r:1 w:0) + /// Proof: `System::ExecutionPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) + /// Storage: `System::EventCount` (r:1 w:1) + /// Proof: `System::EventCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `System::Events` (r:1 w:1) + /// Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn charge() -> Weight { + // Proof Size summary in bytes: + // Measured: `508` + // Estimated: `6196` + // Minimum execution time: 43_842_000 picoseconds. + Weight::from_parts(44_144_000, 0) + .saturating_add(Weight::from_parts(0, 6196)) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(5)) + } + /// Storage: `System::Number` (r:1 w:0) + /// Proof: `System::Number` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `System::ExecutionPhase` (r:1 w:0) + /// Proof: `System::ExecutionPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) + /// Storage: `System::EventCount` (r:1 w:1) + /// Proof: `System::EventCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `System::Events` (r:1 w:1) + /// Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `BuyBack::Infos` (r:0 w:1) + /// Proof: `BuyBack::Infos` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn remove_vtoken() -> Weight { + // Proof Size summary in bytes: + // Measured: `25` + // Estimated: `1510` + // Minimum execution time: 10_931_000 picoseconds. + Weight::from_parts(11_161_000, 0) + .saturating_add(Weight::from_parts(0, 1510)) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `BuyBack::Infos` (r:2 w:1) + /// Proof: `BuyBack::Infos` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) + /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Accounts` (r:2 w:0) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(118), added: 2593, mode: `MaxEncodedLen`) + fn on_initialize() -> Weight { + // Proof Size summary in bytes: + // Measured: `502` + // Estimated: `6442` + // Minimum execution time: 32_792_000 picoseconds. + Weight::from_parts(33_293_000, 0) + .saturating_add(Weight::from_parts(0, 6442)) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(1)) + } +} diff --git a/runtime/bifrost-paseo/src/weights/bifrost_channel_commission.rs b/runtime/bifrost-paseo/src/weights/bifrost_channel_commission.rs new file mode 100644 index 0000000000..4e25a05fa5 --- /dev/null +++ b/runtime/bifrost-paseo/src/weights/bifrost_channel_commission.rs @@ -0,0 +1,175 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +//! Autogenerated weights for `bifrost_channel_commission` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-12-20, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `bifrost-build-machine`, CPU: `Intel(R) Xeon(R) CPU E5-26xx v4` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("bifrost-kusama-local")`, DB CACHE: 1024 + +// Executed Command: +// target/debug/bifrost +// benchmark +// pallet +// --pallet=bifrost_channel_commission +// --chain=bifrost-kusama-local +// --extrinsic=* +// --steps=50 +// --repeat=20 +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --header=./HEADER-GPL3 +// --output=./bifrost_channel_commission.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `bifrost_channel_commission`. +pub struct BifrostWeight(PhantomData); +impl bifrost_channel_commission::WeightInfo for BifrostWeight { + /// Storage: `ChannelCommission::ChannelNextId` (r:1 w:1) + /// Proof: `ChannelCommission::ChannelNextId` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ChannelCommission::CommissionTokens` (r:31 w:0) + /// Proof: `ChannelCommission::CommissionTokens` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ChannelCommission::Channels` (r:0 w:1) + /// Proof: `ChannelCommission::Channels` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ChannelCommission::ChannelCommissionTokenRates` (r:0 w:30) + /// Proof: `ChannelCommission::ChannelCommissionTokenRates` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `x` is `[1, 30]`. + fn register_channel(x: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `132 + x * (24 ±0)` + // Estimated: `3597 + x * (2499 ±0)` + // Minimum execution time: 687_870_000 picoseconds. + Weight::from_parts(590_441_786, 0) + .saturating_add(Weight::from_parts(0, 3597)) + // Standard Error: 280_698 + .saturating_add(Weight::from_parts(150_823_505, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(x.into()))) + .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(x.into()))) + .saturating_add(Weight::from_parts(0, 2499).saturating_mul(x.into())) + } + /// Storage: `ChannelCommission::Channels` (r:1 w:1) + /// Proof: `ChannelCommission::Channels` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ChannelCommission::ChannelClaimableCommissions` (r:1 w:0) + /// Proof: `ChannelCommission::ChannelClaimableCommissions` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn remove_channel() -> Weight { + // Proof Size summary in bytes: + // Measured: `219` + // Estimated: `3684` + // Minimum execution time: 923_024_000 picoseconds. + Weight::from_parts(948_797_000, 0) + .saturating_add(Weight::from_parts(0, 3684)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `ChannelCommission::Channels` (r:1 w:1) + /// Proof: `ChannelCommission::Channels` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn update_channel_receive_account() -> Weight { + // Proof Size summary in bytes: + // Measured: `219` + // Estimated: `3684` + // Minimum execution time: 459_058_000 picoseconds. + Weight::from_parts(495_611_000, 0) + .saturating_add(Weight::from_parts(0, 3684)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `ChannelCommission::Channels` (r:1 w:0) + /// Proof: `ChannelCommission::Channels` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ChannelCommission::CommissionTokens` (r:1 w:0) + /// Proof: `ChannelCommission::CommissionTokens` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ChannelCommission::ChannelCommissionTokenRates` (r:0 w:1) + /// Proof: `ChannelCommission::ChannelCommissionTokenRates` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn set_channel_commission_token() -> Weight { + // Proof Size summary in bytes: + // Measured: `284` + // Estimated: `3749` + // Minimum execution time: 549_732_000 picoseconds. + Weight::from_parts(561_049_000, 0) + .saturating_add(Weight::from_parts(0, 3749)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `ChannelCommission::CommissionTokens` (r:1 w:1) + /// Proof: `ChannelCommission::CommissionTokens` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn set_commission_tokens() -> Weight { + // Proof Size summary in bytes: + // Measured: `109` + // Estimated: `3574` + // Minimum execution time: 415_042_000 picoseconds. + Weight::from_parts(438_659_000, 0) + .saturating_add(Weight::from_parts(0, 3574)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `ChannelCommission::Channels` (r:1 w:0) + /// Proof: `ChannelCommission::Channels` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ChannelCommission::ChannelClaimableCommissions` (r:2 w:1) + /// Proof: `ChannelCommission::ChannelClaimableCommissions` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Tokens::Accounts` (r:2 w:2) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(118), added: 2593, mode: `MaxEncodedLen`) + /// Storage: `AssetRegistry::CurrencyMetadatas` (r:1 w:0) + /// Proof: `AssetRegistry::CurrencyMetadatas` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + fn claim_commissions() -> Weight { + // Proof Size summary in bytes: + // Measured: `2055` + // Estimated: `7995` + // Minimum execution time: 1_855_043_000 picoseconds. + Weight::from_parts(1_928_764_000, 0) + .saturating_add(Weight::from_parts(0, 7995)) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `ChannelCommission::ChannelNextId` (r:1 w:0) + /// Proof: `ChannelCommission::ChannelNextId` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// The range of component `x` is `[1, 30]`. + fn on_initialize(x: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `347` + // Estimated: `1832` + // Minimum execution time: 0_000 picoseconds. + Weight::from_parts(133_647_144, 0) + .saturating_add(Weight::from_parts(0, 1832)) + // Standard Error: 66_075 + .saturating_add(Weight::from_parts(220_865, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(1)) + } + + fn set_channel_vtoken_shares(x: u32, ) -> Weight { + Weight::from_parts(43_239_575, 3597) + .saturating_add(Weight::from_parts(5_355_920, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(x.into()))) + .saturating_add(T::DbWeight::get().writes(2_u64)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(x.into()))) + .saturating_add(Weight::from_parts(0, 2499).saturating_mul(x.into())) + } +} diff --git a/runtime/bifrost-paseo/src/weights/bifrost_clouds_convert.rs b/runtime/bifrost-paseo/src/weights/bifrost_clouds_convert.rs new file mode 100644 index 0000000000..31ce89d090 --- /dev/null +++ b/runtime/bifrost-paseo/src/weights/bifrost_clouds_convert.rs @@ -0,0 +1,46 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +#![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; + +pub struct BifrostWeight(PhantomData); +impl bifrost_clouds_convert::WeightInfo for BifrostWeight { + fn clouds_to_vebnc() -> Weight { + Weight::from_parts(150_867_000, 5223) + .saturating_add(RocksDbWeight::get().reads(7_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) + } + + fn charge_vbnc() -> Weight { + Weight::from_parts(150_867_000, 5223) + .saturating_add(RocksDbWeight::get().reads(7_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) + } +} diff --git a/runtime/bifrost-paseo/src/weights/bifrost_cross_in_out.rs b/runtime/bifrost-paseo/src/weights/bifrost_cross_in_out.rs new file mode 100644 index 0000000000..eaf91c404e --- /dev/null +++ b/runtime/bifrost-paseo/src/weights/bifrost_cross_in_out.rs @@ -0,0 +1,153 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for bifrost_cross_in_out +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-09-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bifrost-jenkins`, CPU: `Intel(R) Xeon(R) CPU E5-26xx v4` +//! WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 + +// Executed Command: +// target/release/bifrost +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_cross_in_out +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/bifrost-kusama/src/weights/bifrost_cross_in_out.rs +// --template=./weight-template/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; + +/// Weight functions for bifrost_cross_in_out. +pub struct BifrostWeight(PhantomData); +impl bifrost_cross_in_out::WeightInfo for BifrostWeight { + // Storage: CrossInOut CrossCurrencyRegistry (r:1 w:1) + // Proof Skipped: CrossInOut CrossCurrencyRegistry (max_values: None, max_size: None, mode: Measured) + fn deregister_currency_for_cross_in_out() -> Weight { + // Proof Size summary in bytes: + // Measured: `119` + // Estimated: `3584` + // Minimum execution time: 32_781 nanoseconds. + Weight::from_parts(33_720_000, 3584) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: CrossInOut CrossingMinimumAmount (r:0 w:1) + // Proof Skipped: CrossInOut CrossingMinimumAmount (max_values: None, max_size: None, mode: Measured) + fn set_crossing_minimum_amount() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 24_811 nanoseconds. + Weight::from_parts(25_172_000, 0) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: CrossInOut RegisterWhiteList (r:1 w:1) + // Proof Skipped: CrossInOut RegisterWhiteList (max_values: None, max_size: None, mode: Measured) + fn add_to_register_whitelist() -> Weight { + // Proof Size summary in bytes: + // Measured: `76` + // Estimated: `3541` + // Minimum execution time: 38_561 nanoseconds. + Weight::from_parts(39_371_000, 3541) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: CrossInOut RegisterWhiteList (r:1 w:1) + // Proof Skipped: CrossInOut RegisterWhiteList (max_values: None, max_size: None, mode: Measured) + fn remove_from_register_whitelist() -> Weight { + // Proof Size summary in bytes: + // Measured: `154` + // Estimated: `3619` + // Minimum execution time: 35_886 nanoseconds. + Weight::from_parts(36_589_000, 3619) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: CrossInOut RegisterWhiteList (r:1 w:0) + // Proof Skipped: CrossInOut RegisterWhiteList (max_values: None, max_size: None, mode: Measured) + // Storage: CrossInOut CrossCurrencyRegistry (r:1 w:0) + // Proof Skipped: CrossInOut CrossCurrencyRegistry (max_values: None, max_size: None, mode: Measured) + // Storage: CrossInOut AccountToOuterMultilocation (r:1 w:1) + // Proof Skipped: CrossInOut AccountToOuterMultilocation (max_values: None, max_size: None, mode: Measured) + // Storage: CrossInOut OuterMultilocationToAccount (r:0 w:1) + // Proof Skipped: CrossInOut OuterMultilocationToAccount (max_values: None, max_size: None, mode: Measured) + fn register_linked_account() -> Weight { + // Proof Size summary in bytes: + // Measured: `193` + // Estimated: `3658` + // Minimum execution time: 58_096 nanoseconds. + Weight::from_parts(59_952_000, 3658) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: CrossInOut CrossCurrencyRegistry (r:1 w:0) + // Proof Skipped: CrossInOut CrossCurrencyRegistry (max_values: None, max_size: None, mode: Measured) + // Storage: CrossInOut CrossingMinimumAmount (r:1 w:0) + // Proof Skipped: CrossInOut CrossingMinimumAmount (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:1 w:1) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: CrossInOut AccountToOuterMultilocation (r:1 w:0) + // Proof Skipped: CrossInOut AccountToOuterMultilocation (max_values: None, max_size: None, mode: Measured) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens TotalIssuance (r:1 w:1) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + fn cross_out() -> Weight { + // Proof Size summary in bytes: + // Measured: `1781` + // Estimated: `5246` + // Minimum execution time: 121_799 nanoseconds. + Weight::from_parts(124_055_000, 5246) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: CrossInOut CrossCurrencyRegistry (r:1 w:0) + // Proof Skipped: CrossInOut CrossCurrencyRegistry (max_values: None, max_size: None, mode: Measured) + // Storage: CrossInOut AccountToOuterMultilocation (r:1 w:1) + // Proof Skipped: CrossInOut AccountToOuterMultilocation (max_values: None, max_size: None, mode: Measured) + // Storage: CrossInOut OuterMultilocationToAccount (r:0 w:1) + // Proof Skipped: CrossInOut OuterMultilocationToAccount (max_values: None, max_size: None, mode: Measured) + fn change_outer_linked_account() -> Weight { + // Proof Size summary in bytes: + // Measured: `312` + // Estimated: `3777` + // Minimum execution time: 56_108 nanoseconds. + Weight::from_parts(57_171_000, 3777) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } +} diff --git a/runtime/bifrost-paseo/src/weights/bifrost_currencies.rs b/runtime/bifrost-paseo/src/weights/bifrost_currencies.rs new file mode 100644 index 0000000000..887a44be19 --- /dev/null +++ b/runtime/bifrost-paseo/src/weights/bifrost_currencies.rs @@ -0,0 +1,90 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +//! Autogenerated weights for `bifrost_currencies` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2021-11-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asgard-local"), DB CACHE: 128 + +// Executed Command: +// target/release/bifrost +// benchmark +// --chain=asgard-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost-currencies +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --header=./HEADER-GPL3 +// --output=./runtime/asgard/src/weights/bifrost_currencies.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::Weight}; +use sp_std::marker::PhantomData; + +/// Weight functions for bifrost_currencies. +pub struct WeightInfo(PhantomData); +impl bifrost_currencies::WeightInfo for WeightInfo { + // Storage: Tokens Accounts (r:2 w:2) + // Storage: EvmAccounts EvmAddresses (r:1 w:0) + // Storage: System Account (r:1 w:1) + fn transfer_non_native_currency() -> Weight { + // Minimum execution time: 46_505 nanoseconds. + Weight::from_parts(47_602_000, 0) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: System Account (r:1 w:1) + // Storage: EvmAccounts EvmAddresses (r:1 w:0) + fn transfer_native_currency() -> Weight { + // Minimum execution time: 36_413 nanoseconds. + Weight::from_parts(37_625_000, 0) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Tokens Accounts (r:1 w:1) + // Storage: Tokens TotalIssuance (r:1 w:1) + // Storage: System Account (r:1 w:1) + fn update_balance_non_native_currency() -> Weight { + // Minimum execution time: 27_242 nanoseconds. + Weight::from_parts(28_038_000, 0) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: System Account (r:1 w:1) + fn update_balance_native_currency_creating() -> Weight { + // Minimum execution time: 27_678 nanoseconds. + Weight::from_parts(28_544_000, 0) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: System Account (r:1 w:1) + // Storage: EvmAccounts EvmAddresses (r:1 w:0) + fn update_balance_native_currency_killing() -> Weight { + // Minimum execution time: 27_789 nanoseconds. + Weight::from_parts(29_601_000, 0) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } +} diff --git a/runtime/bifrost-paseo/src/weights/bifrost_farming.rs b/runtime/bifrost-paseo/src/weights/bifrost_farming.rs new file mode 100644 index 0000000000..ae26727bbc --- /dev/null +++ b/runtime/bifrost-paseo/src/weights/bifrost_farming.rs @@ -0,0 +1,359 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for bifrost_farming +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-09-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bifrost-jenkins`, CPU: `Intel(R) Xeon(R) CPU E5-26xx v4` +//! WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 + +// Executed Command: +// target/release/bifrost +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_farming +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/bifrost-kusama/src/weights/bifrost_farming.rs +// --template=./weight-template/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; + +/// Weight functions for bifrost_farming. +pub struct BifrostWeight(PhantomData); +impl bifrost_farming::WeightInfo for BifrostWeight { + // Storage: Farming PoolInfos (r:1 w:0) + // Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Farming GaugePoolInfos (r:1 w:0) + // Proof Skipped: Farming GaugePoolInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Farming BoostPoolInfos (r:1 w:0) + // Proof Skipped: Farming BoostPoolInfos (max_values: Some(1), max_size: None, mode: Measured) + fn on_initialize() -> Weight { + // Proof Size summary in bytes: + // Measured: `113` + // Estimated: `3578` + // Minimum execution time: 21_942 nanoseconds. + Weight::from_parts(22_864_000, 3578) + .saturating_add(T::DbWeight::get().reads(3)) + } + // Storage: Farming PoolNextId (r:1 w:1) + // Proof Skipped: Farming PoolNextId (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Farming GaugePoolNextId (r:1 w:1) + // Proof Skipped: Farming GaugePoolNextId (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Farming GaugePoolInfos (r:0 w:1) + // Proof Skipped: Farming GaugePoolInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Farming PoolInfos (r:0 w:1) + // Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) + fn create_farming_pool() -> Weight { + // Proof Size summary in bytes: + // Measured: `109` + // Estimated: `1594` + // Minimum execution time: 52_521 nanoseconds. + Weight::from_parts(53_437_000, 1594) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(4)) + } + // Storage: Farming PoolInfos (r:1 w:1) + // Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:2 w:2) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: System Account (r:1 w:1) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: Farming SharesAndWithdrawnRewards (r:1 w:1) + // Proof Skipped: Farming SharesAndWithdrawnRewards (max_values: None, max_size: None, mode: Measured) + fn deposit() -> Weight { + // Proof Size summary in bytes: + // Measured: `1752` + // Estimated: `6176` + // Minimum execution time: 164_962 nanoseconds. + Weight::from_parts(169_239_000, 6176) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(5)) + } + // Storage: Farming PoolInfos (r:1 w:1) + // Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Farming SharesAndWithdrawnRewards (r:1 w:1) + // Proof Skipped: Farming SharesAndWithdrawnRewards (max_values: None, max_size: None, mode: Measured) + fn withdraw() -> Weight { + // Proof Size summary in bytes: + // Measured: `510` + // Estimated: `3975` + // Minimum execution time: 77_186 nanoseconds. + Weight::from_parts(78_796_000, 3975) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: Farming PoolInfos (r:1 w:1) + // Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Farming SharesAndWithdrawnRewards (r:1 w:1) + // Proof Skipped: Farming SharesAndWithdrawnRewards (max_values: None, max_size: None, mode: Measured) + // Storage: Farming GaugeInfos (r:1 w:0) + // Proof Skipped: Farming GaugeInfos (max_values: None, max_size: None, mode: Measured) + fn claim() -> Weight { + // Proof Size summary in bytes: + // Measured: `547` + // Estimated: `4012` + // Minimum execution time: 76_561 nanoseconds. + Weight::from_parts(77_635_000, 4012) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: Farming PoolInfos (r:1 w:0) + // Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Farming SharesAndWithdrawnRewards (r:1 w:1) + // Proof Skipped: Farming SharesAndWithdrawnRewards (max_values: None, max_size: None, mode: Measured) + fn withdraw_claim() -> Weight { + // Proof Size summary in bytes: + // Measured: `510` + // Estimated: `3975` + // Minimum execution time: 52_808 nanoseconds. + Weight::from_parts(53_519_000, 3975) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Farming PoolInfos (r:1 w:1) + // Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Farming GaugePoolNextId (r:1 w:1) + // Proof Skipped: Farming GaugePoolNextId (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Farming GaugePoolInfos (r:0 w:1) + // Proof Skipped: Farming GaugePoolInfos (max_values: None, max_size: None, mode: Measured) + fn reset_pool() -> Weight { + // Proof Size summary in bytes: + // Measured: `436` + // Estimated: `3901` + // Minimum execution time: 58_270 nanoseconds. + Weight::from_parts(59_721_000, 3901) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Farming PoolInfos (r:1 w:1) + // Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Farming RetireLimit (r:1 w:0) + // Proof Skipped: Farming RetireLimit (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Farming SharesAndWithdrawnRewards (r:1 w:0) + // Proof Skipped: Farming SharesAndWithdrawnRewards (max_values: None, max_size: None, mode: Measured) + // Storage: Farming GaugePoolInfos (r:1 w:1) + // Proof Skipped: Farming GaugePoolInfos (max_values: None, max_size: None, mode: Measured) + fn force_retire_pool() -> Weight { + // Proof Size summary in bytes: + // Measured: `627` + // Estimated: `4092` + // Minimum execution time: 71_326 nanoseconds. + Weight::from_parts(72_463_000, 4092) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: Farming PoolInfos (r:1 w:1) + // Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) + fn kill_pool() -> Weight { + // Proof Size summary in bytes: + // Measured: `380` + // Estimated: `3845` + // Minimum execution time: 50_342 nanoseconds. + Weight::from_parts(51_828_000, 3845) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Farming PoolInfos (r:1 w:1) + // Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Farming GaugePoolInfos (r:1 w:1) + // Proof Skipped: Farming GaugePoolInfos (max_values: None, max_size: None, mode: Measured) + fn edit_pool() -> Weight { + // Proof Size summary in bytes: + // Measured: `513` + // Estimated: `3978` + // Minimum execution time: 55_700 nanoseconds. + Weight::from_parts(57_535_000, 3978) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: Farming PoolInfos (r:1 w:1) + // Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) + fn close_pool() -> Weight { + // Proof Size summary in bytes: + // Measured: `417` + // Estimated: `3882` + // Minimum execution time: 45_159 nanoseconds. + Weight::from_parts(46_221_000, 3882) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Farming PoolInfos (r:1 w:1) + // Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:2 w:2) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: System Account (r:1 w:1) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn charge() -> Weight { + // Proof Size summary in bytes: + // Measured: `2059` + // Estimated: `6176` + // Minimum execution time: 162_037 nanoseconds. + Weight::from_parts(167_329_000, 6176) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(4)) + } + // Storage: Farming RetireLimit (r:1 w:0) + // Proof Skipped: Farming RetireLimit (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Farming GaugeInfos (r:2 w:1) + // Proof Skipped: Farming GaugeInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Farming GaugePoolInfos (r:1 w:1) + // Proof Skipped: Farming GaugePoolInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Farming PoolInfos (r:1 w:0) + // Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Farming SharesAndWithdrawnRewards (r:1 w:0) + // Proof Skipped: Farming SharesAndWithdrawnRewards (max_values: None, max_size: None, mode: Measured) + fn force_gauge_claim() -> Weight { + // Proof Size summary in bytes: + // Measured: `855` + // Estimated: `6795` + // Minimum execution time: 99_268 nanoseconds. + Weight::from_parts(100_563_000, 6795) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: Farming RetireLimit (r:1 w:1) + // Proof Skipped: Farming RetireLimit (max_values: Some(1), max_size: None, mode: Measured) + fn set_retire_limit() -> Weight { + // Proof Size summary in bytes: + // Measured: `109` + // Estimated: `1594` + // Minimum execution time: 28_852 nanoseconds. + Weight::from_parts(29_866_000, 1594) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Farming BoostWhitelist (r:0 w:1) + // Proof Skipped: Farming BoostWhitelist (max_values: None, max_size: None, mode: Measured) + fn add_boost_pool_whitelist() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 11_356 nanoseconds. + Weight::from_parts(11_723_000, 0) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Farming BoostNextRoundWhitelist (r:0 w:1) + // Proof Skipped: Farming BoostNextRoundWhitelist (max_values: None, max_size: None, mode: Measured) + fn set_next_round_whitelist() -> Weight { + // Proof Size summary in bytes: + // Measured: `145` + // Estimated: `145` + // Minimum execution time: 16_252 nanoseconds. + Weight::from_parts(19_916_000, 145) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Farming BoostPoolInfos (r:1 w:1) + // Proof Skipped: Farming BoostPoolInfos (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Farming UserBoostInfos (r:1 w:1) + // Proof Skipped: Farming UserBoostInfos (max_values: None, max_size: None, mode: Measured) + // Storage: Farming BoostWhitelist (r:1 w:0) + // Proof Skipped: Farming BoostWhitelist (max_values: None, max_size: None, mode: Measured) + // Storage: Farming BoostVotingPools (r:1 w:1) + // Proof Skipped: Farming BoostVotingPools (max_values: None, max_size: None, mode: Measured) + fn vote() -> Weight { + // Proof Size summary in bytes: + // Measured: `145` + // Estimated: `3610` + // Minimum execution time: 50_384 nanoseconds. + Weight::from_parts(52_399_000, 3610) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Farming BoostPoolInfos (r:1 w:1) + // Proof Skipped: Farming BoostPoolInfos (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Farming BoostNextRoundWhitelist (r:1 w:0) + // Proof Skipped: Farming BoostNextRoundWhitelist (max_values: None, max_size: None, mode: Measured) + // Storage: Farming BoostWhitelist (r:2 w:0) + // Proof Skipped: Farming BoostWhitelist (max_values: None, max_size: None, mode: Measured) + // Storage: Farming BoostVotingPools (r:1 w:0) + // Proof Skipped: Farming BoostVotingPools (max_values: None, max_size: None, mode: Measured) + fn start_boost_round() -> Weight { + // Proof Size summary in bytes: + // Measured: `149` + // Estimated: `6089` + // Minimum execution time: 63_053 nanoseconds. + Weight::from_parts(64_194_000, 6089) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Farming BoostPoolInfos (r:1 w:1) + // Proof Skipped: Farming BoostPoolInfos (max_values: Some(1), max_size: None, mode: Measured) + fn end_boost_round() -> Weight { + // Proof Size summary in bytes: + // Measured: `195` + // Estimated: `1680` + // Minimum execution time: 42_148 nanoseconds. + Weight::from_parts(43_580_000, 1680) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Tokens Accounts (r:2 w:2) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: System Account (r:1 w:1) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn charge_boost() -> Weight { + // Proof Size summary in bytes: + // Measured: `1477` + // Estimated: `6176` + // Minimum execution time: 126_868 nanoseconds. + Weight::from_parts(131_856_000, 6176) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `Farming::UserFarmingPool` (r:1 w:0) + /// Proof: `Farming::UserFarmingPool` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Farming::SharesAndWithdrawnRewards` (r:2 w:0) + /// Proof: `Farming::SharesAndWithdrawnRewards` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Farming::PoolInfos` (r:1 w:0) + /// Proof: `Farming::PoolInfos` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `BbBNC::UserPositions` (r:1 w:0) + /// Proof: `BbBNC::UserPositions` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn refresh() -> Weight { + // Proof Size summary in bytes: + // Measured: `604` + // Estimated: `6544` + // Minimum execution time: 16_472_000 picoseconds. + Weight::from_parts(17_023_000, 0) + .saturating_add(Weight::from_parts(0, 6544)) + .saturating_add(T::DbWeight::get().reads(5)) + } +} diff --git a/runtime/bifrost-paseo/src/weights/bifrost_fee_share.rs b/runtime/bifrost-paseo/src/weights/bifrost_fee_share.rs new file mode 100644 index 0000000000..1e2478564b --- /dev/null +++ b/runtime/bifrost-paseo/src/weights/bifrost_fee_share.rs @@ -0,0 +1,144 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for bifrost_fee_share +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-09-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bifrost-jenkins`, CPU: `Intel(R) Xeon(R) CPU E5-26xx v4` +//! WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 + +// Executed Command: +// target/release/bifrost +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_fee_share +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/bifrost-kusama/src/weights/bifrost_fee_share.rs +// --template=./weight-template/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; + +/// Weight functions for bifrost_fee_share. +pub struct BifrostWeight(PhantomData); +impl bifrost_fee_share::WeightInfo for BifrostWeight { + // Storage: FeeShare AutoEra (r:1 w:0) + // Proof Skipped: FeeShare AutoEra (max_values: Some(1), max_size: None, mode: Measured) + fn on_initialize() -> Weight { + // Proof Size summary in bytes: + // Measured: `4` + // Estimated: `1489` + // Minimum execution time: 7_333 nanoseconds. + Weight::from_parts(7_571_000, 1489) + .saturating_add(T::DbWeight::get().reads(1)) + } + // Storage: FeeShare DistributionNextId (r:1 w:1) + // Proof Skipped: FeeShare DistributionNextId (max_values: Some(1), max_size: None, mode: Measured) + // Storage: FeeShare DistributionInfos (r:0 w:1) + // Proof Skipped: FeeShare DistributionInfos (max_values: None, max_size: None, mode: Measured) + fn create_distribution() -> Weight { + // Proof Size summary in bytes: + // Measured: `4` + // Estimated: `1489` + // Minimum execution time: 37_152 nanoseconds. + Weight::from_parts(38_371_000, 1489) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: FeeShare DistributionInfos (r:1 w:1) + // Proof Skipped: FeeShare DistributionInfos (max_values: None, max_size: None, mode: Measured) + fn edit_distribution() -> Weight { + // Proof Size summary in bytes: + // Measured: `139` + // Estimated: `3604` + // Minimum execution time: 40_063 nanoseconds. + Weight::from_parts(40_816_000, 3604) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: FeeShare AutoEra (r:0 w:1) + // Proof Skipped: FeeShare AutoEra (max_values: Some(1), max_size: None, mode: Measured) + fn set_era_length() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 23_201 nanoseconds. + Weight::from_parts(23_949_000, 0) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: FeeShare DistributionInfos (r:1 w:0) + // Proof Skipped: FeeShare DistributionInfos (max_values: None, max_size: None, mode: Measured) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:2 w:0) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + fn execute_distribute() -> Weight { + // Proof Size summary in bytes: + // Measured: `1616` + // Estimated: `6176` + // Minimum execution time: 78_453 nanoseconds. + Weight::from_parts(80_732_000, 6176) + .saturating_add(T::DbWeight::get().reads(4)) + } + // Storage: FeeShare DistributionInfos (r:1 w:1) + // Proof Skipped: FeeShare DistributionInfos (max_values: None, max_size: None, mode: Measured) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:2 w:0) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + fn delete_distribution() -> Weight { + // Proof Size summary in bytes: + // Measured: `1616` + // Estimated: `6176` + // Minimum execution time: 80_872 nanoseconds. + Weight::from_parts(82_734_000, 6176) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `FeeShare::DistributionInfos` (r:1 w:0) + /// Proof: `FeeShare::DistributionInfos` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `FeeShare::DollarStandardInfos` (r:0 w:1) + /// Proof: `FeeShare::DollarStandardInfos` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn set_usd_config() -> Weight { + // Proof Size summary in bytes: + // Measured: `94` + // Estimated: `3559` + // Minimum execution time: 9_077_000 picoseconds. + Weight::from_parts(9_408_000, 0) + .saturating_add(Weight::from_parts(0, 3559)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } +} diff --git a/runtime/bifrost-paseo/src/weights/bifrost_flexible_fee.rs b/runtime/bifrost-paseo/src/weights/bifrost_flexible_fee.rs new file mode 100644 index 0000000000..be88dd7124 --- /dev/null +++ b/runtime/bifrost-paseo/src/weights/bifrost_flexible_fee.rs @@ -0,0 +1,77 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for bifrost_flexible_fee +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-09-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bifrost-jenkins`, CPU: `Intel(R) Xeon(R) CPU E5-26xx v4` +//! WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 + +// Executed Command: +// target/release/bifrost +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_flexible_fee +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/bifrost-kusama/src/weights/bifrost_flexible_fee.rs +// --template=./weight-template/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; + +/// Weight functions for bifrost_flexible_fee. +pub struct BifrostWeight(PhantomData); +impl bifrost_flexible_fee::WeightInfo for BifrostWeight { + // Storage: FlexibleFee UserDefaultFeeCurrency (r:0 w:1) + // Proof Skipped: FlexibleFee UserDefaultFeeCurrency (max_values: None, max_size: None, mode: Measured) + fn set_user_default_fee_currency() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 10_741 nanoseconds. + Weight::from_parts(11_257_000, 0) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: FlexibleFee UniversalFeeCurrencyOrderList (r:0 w:1) + // Proof Skipped: FlexibleFee UniversalFeeCurrencyOrderList (max_values: Some(1), max_size: None, mode: Measured) + fn set_default_fee_currency_list() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 9_810 nanoseconds. + Weight::from_parts(10_160_000, 0) + .saturating_add(T::DbWeight::get().writes(1)) + } +} diff --git a/runtime/bifrost-paseo/src/weights/bifrost_salp.rs b/runtime/bifrost-paseo/src/weights/bifrost_salp.rs new file mode 100644 index 0000000000..79c1612f54 --- /dev/null +++ b/runtime/bifrost-paseo/src/weights/bifrost_salp.rs @@ -0,0 +1,348 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for bifrost_salp +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-09-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bifrost-jenkins`, CPU: `Intel(R) Xeon(R) CPU E5-26xx v4` +//! WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 + +// Executed Command: +// target/release/bifrost +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_salp +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/bifrost-kusama/src/weights/bifrost_salp.rs +// --template=./weight-template/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; + +/// Weight functions for bifrost_salp. +pub struct BifrostWeight(PhantomData); +impl bifrost_salp::WeightInfo for BifrostWeight { + // Storage: Salp Funds (r:1 w:0) + // Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:1 w:1) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm QueryCounter (r:1 w:1) + // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) + // Storage: ParachainInfo ParachainId (r:1 w:0) + // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: Salp QueryIdContributionInfo (r:0 w:1) + // Proof Skipped: Salp QueryIdContributionInfo (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm Queries (r:0 w:1) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + // Storage: unknown `0xd861ea1ebf4800d4b89f4ff787ad79ee96d9a708c85b57da7eb8f9ddeda61291` (r:1 w:1) + // Proof Skipped: unknown `0xd861ea1ebf4800d4b89f4ff787ad79ee96d9a708c85b57da7eb8f9ddeda61291` (r:1 w:1) + fn contribute() -> Weight { + // Proof Size summary in bytes: + // Measured: `2252` + // Estimated: `5717` + // Minimum execution time: 178_249 nanoseconds. + Weight::from_parts(181_741_000, 5717) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(5)) + } + // Storage: Salp FailedFundsToRefund (r:1 w:0) + // Proof Skipped: Salp FailedFundsToRefund (max_values: None, max_size: None, mode: Measured) + // Storage: Salp Funds (r:1 w:1) + // Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) + // Storage: Salp RedeemPool (r:1 w:1) + // Proof Skipped: Salp RedeemPool (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:4 w:4) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens TotalIssuance (r:2 w:2) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + // Storage: System Account (r:1 w:1) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn refund() -> Weight { + // Proof Size summary in bytes: + // Measured: `2375` + // Estimated: `11362` + // Minimum execution time: 269_471 nanoseconds. + Weight::from_parts(271_761_000, 11362) + .saturating_add(T::DbWeight::get().reads(11)) + .saturating_add(T::DbWeight::get().writes(9)) + } + // Storage: Salp Funds (r:1 w:0) + // Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:2 w:2) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: unknown `0xd861ea1ebf4800d4b89f4ff787ad79ee96d9a708c85b57da7eb8f9ddeda61291` (r:1 w:0) + // Proof Skipped: unknown `0xd861ea1ebf4800d4b89f4ff787ad79ee96d9a708c85b57da7eb8f9ddeda61291` (r:1 w:0) + fn unlock() -> Weight { + // Proof Size summary in bytes: + // Measured: `1962` + // Estimated: `6176` + // Minimum execution time: 131_128 nanoseconds. + Weight::from_parts(132_692_000, 6176) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: Salp Funds (r:1 w:1) + // Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) + // Storage: Salp RedeemPool (r:1 w:1) + // Proof Skipped: Salp RedeemPool (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:4 w:4) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens TotalIssuance (r:2 w:2) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + // Storage: System Account (r:1 w:1) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn redeem() -> Weight { + // Proof Size summary in bytes: + // Measured: `2356` + // Estimated: `11362` + // Minimum execution time: 253_883 nanoseconds. + Weight::from_parts(256_438_000, 11362) + .saturating_add(T::DbWeight::get().reads(10)) + .saturating_add(T::DbWeight::get().writes(9)) + } + // Storage: Salp MultisigConfirmAccount (r:0 w:1) + // Proof Skipped: Salp MultisigConfirmAccount (max_values: Some(1), max_size: None, mode: Measured) + fn set_multisig_confirm_account() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 9_755 nanoseconds. + Weight::from_parts(10_191_000, 0) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Salp Funds (r:1 w:1) + // Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) + fn fund_success() -> Weight { + // Proof Size summary in bytes: + // Measured: `292` + // Estimated: `3757` + // Minimum execution time: 42_866 nanoseconds. + Weight::from_parts(43_319_000, 3757) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Salp Funds (r:1 w:1) + // Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) + fn fund_fail() -> Weight { + // Proof Size summary in bytes: + // Measured: `292` + // Estimated: `3757` + // Minimum execution time: 43_032 nanoseconds. + Weight::from_parts(43_468_000, 3757) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Salp Funds (r:1 w:1) + // Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) + // Storage: AssetRegistry CurrencyMetadatas (r:2 w:1) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: Salp FailedFundsToRefund (r:0 w:1) + // Proof Skipped: Salp FailedFundsToRefund (max_values: None, max_size: None, mode: Measured) + fn continue_fund() -> Weight { + // Proof Size summary in bytes: + // Measured: `1061` + // Estimated: `7001` + // Minimum execution time: 101_152 nanoseconds. + Weight::from_parts(103_733_000, 7001) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Salp Funds (r:1 w:1) + // Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) + fn fund_retire() -> Weight { + // Proof Size summary in bytes: + // Measured: `292` + // Estimated: `3757` + // Minimum execution time: 42_448 nanoseconds. + Weight::from_parts(43_562_000, 3757) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Salp Funds (r:1 w:1) + // Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) + fn fund_end() -> Weight { + // Proof Size summary in bytes: + // Measured: `325` + // Estimated: `3790` + // Minimum execution time: 43_007 nanoseconds. + Weight::from_parts(44_240_000, 3790) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Salp Funds (r:1 w:1) + // Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) + // Storage: Salp CurrentTrieIndex (r:1 w:1) + // Proof Skipped: Salp CurrentTrieIndex (max_values: Some(1), max_size: None, mode: Measured) + // Storage: AssetRegistry CurrencyMetadatas (r:2 w:1) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + fn create() -> Weight { + // Proof Size summary in bytes: + // Measured: `833` + // Estimated: `6773` + // Minimum execution time: 82_745 nanoseconds. + Weight::from_parts(85_358_000, 6773) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Salp Funds (r:1 w:1) + // Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) + fn edit() -> Weight { + // Proof Size summary in bytes: + // Measured: `292` + // Estimated: `3757` + // Minimum execution time: 38_572 nanoseconds. + Weight::from_parts(39_606_000, 3757) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Salp MultisigConfirmAccount (r:1 w:0) + // Proof Skipped: Salp MultisigConfirmAccount (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Salp QueryIdContributionInfo (r:1 w:1) + // Proof Skipped: Salp QueryIdContributionInfo (max_values: None, max_size: None, mode: Measured) + // Storage: Salp Funds (r:1 w:1) + // Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:4 w:4) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens TotalIssuance (r:2 w:2) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + // Storage: System Account (r:1 w:1) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: unknown `0xd861ea1ebf4800d4b89f4ff787ad79ee96d9a708c85b57da7eb8f9ddeda61291` (r:1 w:1) + // Proof Skipped: unknown `0xd861ea1ebf4800d4b89f4ff787ad79ee96d9a708c85b57da7eb8f9ddeda61291` (r:1 w:1) + fn confirm_contribute() -> Weight { + // Proof Size summary in bytes: + // Measured: `2556` + // Estimated: `11362` + // Minimum execution time: 282_283 nanoseconds. + Weight::from_parts(290_913_000, 11362) + .saturating_add(T::DbWeight::get().reads(12)) + .saturating_add(T::DbWeight::get().writes(10)) + } + // Storage: Salp Funds (r:1 w:1) + // Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) + // Storage: Salp RedeemPool (r:1 w:1) + // Proof Skipped: Salp RedeemPool (max_values: Some(1), max_size: None, mode: Measured) + fn withdraw() -> Weight { + // Proof Size summary in bytes: + // Measured: `325` + // Estimated: `3790` + // Minimum execution time: 45_530 nanoseconds. + Weight::from_parts(47_033_000, 3790) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: Salp FailedFundsToRefund (r:1 w:1) + // Proof Skipped: Salp FailedFundsToRefund (max_values: None, max_size: None, mode: Measured) + fn dissolve_refunded() -> Weight { + // Proof Size summary in bytes: + // Measured: `403` + // Estimated: `3868` + // Minimum execution time: 54_018 nanoseconds. + Weight::from_parts(55_598_000, 3868) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Salp Funds (r:1 w:1) + // Proof Skipped: Salp Funds (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:3 w:3) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: System Account (r:3 w:3) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: unknown `0x` (r:1 w:0) + // Proof Skipped: unknown `0x` (r:1 w:0) + // Storage: unknown `0xd861ea1ebf4800d4b89f4ff787ad79ee96d9a708c85b57da7eb8f9ddeda61291` (r:1 w:1) + // Proof Skipped: unknown `0xd861ea1ebf4800d4b89f4ff787ad79ee96d9a708c85b57da7eb8f9ddeda61291` (r:1 w:1) + fn dissolve() -> Weight { + // Proof Size summary in bytes: + // Measured: `2063` + // Estimated: `8799` + // Minimum execution time: 256_408 nanoseconds. + Weight::from_parts(261_096_000, 8799) + .saturating_add(T::DbWeight::get().reads(10)) + .saturating_add(T::DbWeight::get().writes(8)) + } + // Storage: ParachainInfo ParachainId (r:1 w:0) + // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: Tokens Accounts (r:4 w:4) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: System Account (r:3 w:1) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: ZenlinkProtocol PairStatuses (r:1 w:0) + // Proof Skipped: ZenlinkProtocol PairStatuses (max_values: None, max_size: None, mode: Measured) + fn buyback() -> Weight { + // Proof Size summary in bytes: + // Measured: `2284` + // Estimated: `11362` + // Minimum execution time: 245_677 nanoseconds. + Weight::from_parts(249_443_000, 11362) + .saturating_add(T::DbWeight::get().reads(10)) + .saturating_add(T::DbWeight::get().writes(5)) + } + // Storage: StableAsset Pools (r:1 w:1) + // Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:4 w:4) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: StableAsset TokenRateCaches (r:2 w:0) + // Proof Skipped: StableAsset TokenRateCaches (max_values: None, max_size: None, mode: Measured) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: System Account (r:2 w:1) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn buyback_vstoken_by_stable_pool() -> Weight { + // Proof Size summary in bytes: + // Measured: `2438` + // Estimated: `11362` + // Minimum execution time: 362_245 nanoseconds. + Weight::from_parts(367_702_000, 11362) + .saturating_add(T::DbWeight::get().reads(10)) + .saturating_add(T::DbWeight::get().writes(6)) + } +} diff --git a/runtime/bifrost-paseo/src/weights/bifrost_slp.rs b/runtime/bifrost-paseo/src/weights/bifrost_slp.rs new file mode 100644 index 0000000000..7b4b8cdb02 --- /dev/null +++ b/runtime/bifrost-paseo/src/weights/bifrost_slp.rs @@ -0,0 +1,801 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for bifrost_slp +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-09-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bifrost-jenkins`, CPU: `Intel(R) Xeon(R) CPU E5-26xx v4` +//! WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 + +// Executed Command: +// target/release/bifrost +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_slp +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/bifrost-kusama/src/weights/bifrost_slp.rs +// --template=./weight-template/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; + +/// Weight functions for bifrost_slp. +pub struct BifrostWeight(PhantomData); +impl bifrost_slp::WeightInfo for BifrostWeight { + // Storage: Slp DelegatorNextIndex (r:1 w:1) + // Proof Skipped: Slp DelegatorNextIndex (max_values: None, max_size: None, mode: Measured) + // Storage: ParachainInfo ParachainId (r:1 w:0) + // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: Slp DelegatorsIndex2Multilocation (r:1 w:1) + // Proof Skipped: Slp DelegatorsIndex2Multilocation (max_values: None, max_size: None, mode: Measured) + // Storage: Slp MinimumsAndMaximums (r:1 w:0) + // Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) + // Storage: Slp DelegatorsMultilocation2Index (r:0 w:1) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + fn initialize_delegator() -> Weight { + // Proof Size summary in bytes: + // Measured: `166` + // Estimated: `3631` + // Minimum execution time: 66_316 nanoseconds. + Weight::from_parts(67_556_000, 3631) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Slp DelegatorLedgers (r:1 w:1) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + // Storage: Slp MinimumsAndMaximums (r:1 w:0) + // Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm QueryCounter (r:1 w:1) + // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (max_values: None, max_size: None, mode: Measured) + // Storage: ParachainInfo ParachainId (r:1 w:0) + // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: Slp DelegatorLedgerXcmUpdateQueue (r:0 w:1) + // Proof Skipped: Slp DelegatorLedgerXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm Queries (r:0 w:1) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn bond() -> Weight { + // Proof Size summary in bytes: + // Measured: `629` + // Estimated: `4094` + // Minimum execution time: 104_135 nanoseconds. + Weight::from_parts(105_944_000, 4094) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(4)) + } + // Storage: Slp DelegatorLedgers (r:1 w:0) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + // Storage: Slp MinimumsAndMaximums (r:1 w:0) + // Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm QueryCounter (r:1 w:1) + // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (max_values: None, max_size: None, mode: Measured) + // Storage: ParachainInfo ParachainId (r:1 w:0) + // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: Slp DelegatorLedgerXcmUpdateQueue (r:0 w:1) + // Proof Skipped: Slp DelegatorLedgerXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm Queries (r:0 w:1) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn bond_extra() -> Weight { + // Proof Size summary in bytes: + // Measured: `896` + // Estimated: `4361` + // Minimum execution time: 105_850 nanoseconds. + Weight::from_parts(109_005_000, 4361) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Slp DelegatorLedgers (r:1 w:0) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + // Storage: Slp MinimumsAndMaximums (r:1 w:0) + // Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm QueryCounter (r:1 w:1) + // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (max_values: None, max_size: None, mode: Measured) + // Storage: ParachainInfo ParachainId (r:1 w:0) + // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: VtokenMinting OngoingTimeUnit (r:1 w:0) + // Proof: VtokenMinting OngoingTimeUnit (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen) + // Storage: Slp CurrencyDelays (r:1 w:0) + // Proof Skipped: Slp CurrencyDelays (max_values: None, max_size: None, mode: Measured) + // Storage: Slp DelegatorLedgerXcmUpdateQueue (r:0 w:1) + // Proof Skipped: Slp DelegatorLedgerXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm Queries (r:0 w:1) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn unbond() -> Weight { + // Proof Size summary in bytes: + // Measured: `1028` + // Estimated: `4493` + // Minimum execution time: 128_505 nanoseconds. + Weight::from_parts(130_525_000, 4493) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Slp DelegatorLedgers (r:1 w:0) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm QueryCounter (r:1 w:1) + // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (max_values: None, max_size: None, mode: Measured) + // Storage: ParachainInfo ParachainId (r:1 w:0) + // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: VtokenMinting OngoingTimeUnit (r:1 w:0) + // Proof: VtokenMinting OngoingTimeUnit (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen) + // Storage: Slp CurrencyDelays (r:1 w:0) + // Proof Skipped: Slp CurrencyDelays (max_values: None, max_size: None, mode: Measured) + // Storage: Slp DelegatorLedgerXcmUpdateQueue (r:0 w:1) + // Proof Skipped: Slp DelegatorLedgerXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm Queries (r:0 w:1) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn unbond_all() -> Weight { + // Proof Size summary in bytes: + // Measured: `1006` + // Estimated: `4471` + // Minimum execution time: 120_242 nanoseconds. + Weight::from_parts(124_199_000, 4471) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Slp DelegatorLedgers (r:1 w:0) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + // Storage: Slp MinimumsAndMaximums (r:1 w:0) + // Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm QueryCounter (r:1 w:1) + // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (max_values: None, max_size: None, mode: Measured) + // Storage: ParachainInfo ParachainId (r:1 w:0) + // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: Slp DelegatorLedgerXcmUpdateQueue (r:0 w:1) + // Proof Skipped: Slp DelegatorLedgerXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm Queries (r:0 w:1) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn rebond() -> Weight { + // Proof Size summary in bytes: + // Measured: `941` + // Estimated: `4406` + // Minimum execution time: 106_179 nanoseconds. + Weight::from_parts(108_122_000, 4406) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Slp DelegatorLedgers (r:1 w:0) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + // Storage: Slp MinimumsAndMaximums (r:1 w:0) + // Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) + // Storage: Slp Validators (r:1 w:0) + // Proof Skipped: Slp Validators (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm QueryCounter (r:1 w:1) + // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (max_values: None, max_size: None, mode: Measured) + // Storage: ParachainInfo ParachainId (r:1 w:0) + // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: Slp ValidatorsByDelegatorXcmUpdateQueue (r:0 w:1) + // Proof Skipped: Slp ValidatorsByDelegatorXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm Queries (r:0 w:1) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn delegate() -> Weight { + // Proof Size summary in bytes: + // Measured: `963` + // Estimated: `4428` + // Minimum execution time: 120_559 nanoseconds. + Weight::from_parts(123_430_000, 4428) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Slp DelegatorLedgers (r:1 w:0) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + // Storage: Slp ValidatorsByDelegator (r:1 w:0) + // Proof Skipped: Slp ValidatorsByDelegator (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm QueryCounter (r:1 w:1) + // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (max_values: None, max_size: None, mode: Measured) + // Storage: ParachainInfo ParachainId (r:1 w:0) + // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: Slp ValidatorsByDelegatorXcmUpdateQueue (r:0 w:1) + // Proof Skipped: Slp ValidatorsByDelegatorXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm Queries (r:0 w:1) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn undelegate() -> Weight { + // Proof Size summary in bytes: + // Measured: `1031` + // Estimated: `4496` + // Minimum execution time: 111_483 nanoseconds. + Weight::from_parts(113_771_000, 4496) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Slp DelegatorLedgers (r:1 w:0) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + // Storage: Slp MinimumsAndMaximums (r:1 w:0) + // Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) + // Storage: Slp Validators (r:1 w:0) + // Proof Skipped: Slp Validators (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm QueryCounter (r:1 w:1) + // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (max_values: None, max_size: None, mode: Measured) + // Storage: ParachainInfo ParachainId (r:1 w:0) + // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: Slp ValidatorsByDelegatorXcmUpdateQueue (r:0 w:1) + // Proof Skipped: Slp ValidatorsByDelegatorXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm Queries (r:0 w:1) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn redelegate() -> Weight { + // Proof Size summary in bytes: + // Measured: `963` + // Estimated: `4428` + // Minimum execution time: 121_646 nanoseconds. + Weight::from_parts(123_838_000, 4428) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (max_values: None, max_size: None, mode: Measured) + // Storage: ParachainInfo ParachainId (r:1 w:0) + // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + fn payout() -> Weight { + // Proof Size summary in bytes: + // Measured: `367` + // Estimated: `3832` + // Minimum execution time: 61_226 nanoseconds. + Weight::from_parts(62_259_000, 3832) + .saturating_add(T::DbWeight::get().reads(3)) + } + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm QueryCounter (r:1 w:1) + // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (max_values: None, max_size: None, mode: Measured) + // Storage: ParachainInfo ParachainId (r:1 w:0) + // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: VtokenMinting OngoingTimeUnit (r:1 w:0) + // Proof: VtokenMinting OngoingTimeUnit (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen) + // Storage: Slp DelegatorLedgerXcmUpdateQueue (r:0 w:1) + // Proof Skipped: Slp DelegatorLedgerXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm Queries (r:0 w:1) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn liquidize() -> Weight { + // Proof Size summary in bytes: + // Measured: `612` + // Estimated: `4077` + // Minimum execution time: 98_187 nanoseconds. + Weight::from_parts(100_637_000, 4077) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm QueryCounter (r:1 w:1) + // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (max_values: None, max_size: None, mode: Measured) + // Storage: ParachainInfo ParachainId (r:1 w:0) + // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: Slp DelegatorLedgers (r:1 w:0) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + // Storage: VtokenMinting OngoingTimeUnit (r:1 w:0) + // Proof: VtokenMinting OngoingTimeUnit (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen) + // Storage: Slp CurrencyDelays (r:1 w:0) + // Proof Skipped: Slp CurrencyDelays (max_values: None, max_size: None, mode: Measured) + // Storage: Slp DelegatorLedgerXcmUpdateQueue (r:0 w:1) + // Proof Skipped: Slp DelegatorLedgerXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm Queries (r:0 w:1) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn chill() -> Weight { + // Proof Size summary in bytes: + // Measured: `1006` + // Estimated: `4471` + // Minimum execution time: 127_921 nanoseconds. + Weight::from_parts(129_570_000, 4471) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: ParachainInfo ParachainId (r:1 w:0) + // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (max_values: None, max_size: None, mode: Measured) + fn transfer_back() -> Weight { + // Proof Size summary in bytes: + // Measured: `401` + // Estimated: `3866` + // Minimum execution time: 74_216 nanoseconds. + Weight::from_parts(75_781_000, 3866) + .saturating_add(T::DbWeight::get().reads(3)) + } + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (max_values: None, max_size: None, mode: Measured) + fn transfer_to() -> Weight { + // Proof Size summary in bytes: + // Measured: `298` + // Estimated: `3763` + // Minimum execution time: 55_326 nanoseconds. + Weight::from_parts(57_260_000, 3763) + .saturating_add(T::DbWeight::get().reads(2)) + } + // Storage: Slp DelegatorLedgers (r:1 w:0) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm QueryCounter (r:1 w:1) + // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (max_values: None, max_size: None, mode: Measured) + // Storage: ParachainInfo ParachainId (r:1 w:0) + // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: PolkadotXcm Queries (r:0 w:1) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn convert_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `697` + // Estimated: `4162` + // Minimum execution time: 87_626 nanoseconds. + Weight::from_parts(89_702_000, 4162) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: VtokenMinting TokenPool (r:1 w:1) + // Proof: VtokenMinting TokenPool (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + fn increase_token_pool() -> Weight { + // Proof Size summary in bytes: + // Measured: `180` + // Estimated: `3503` + // Minimum execution time: 30_773 nanoseconds. + Weight::from_parts(31_754_000, 3503) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: VtokenMinting TokenPool (r:1 w:1) + // Proof: VtokenMinting TokenPool (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + fn decrease_token_pool() -> Weight { + // Proof Size summary in bytes: + // Measured: `230` + // Estimated: `3503` + // Minimum execution time: 33_009 nanoseconds. + Weight::from_parts(33_510_000, 3503) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp OngoingTimeUnitUpdateInterval (r:1 w:0) + // Proof Skipped: Slp OngoingTimeUnitUpdateInterval (max_values: None, max_size: None, mode: Measured) + // Storage: Slp LastTimeUpdatedOngoingTimeUnit (r:1 w:1) + // Proof Skipped: Slp LastTimeUpdatedOngoingTimeUnit (max_values: None, max_size: None, mode: Measured) + // Storage: VtokenMinting OngoingTimeUnit (r:1 w:1) + // Proof: VtokenMinting OngoingTimeUnit (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen) + fn update_ongoing_time_unit() -> Weight { + // Proof Size summary in bytes: + // Measured: `277` + // Estimated: `3742` + // Minimum execution time: 55_617 nanoseconds. + Weight::from_parts(56_576_000, 3742) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: Tokens Accounts (r:2 w:2) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: VtokenMinting OngoingTimeUnit (r:1 w:0) + // Proof: VtokenMinting OngoingTimeUnit (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen) + // Storage: VtokenMinting TimeUnitUnlockLedger (r:1 w:0) + // Proof: VtokenMinting TimeUnitUnlockLedger (max_values: None, max_size: Some(282), added: 2757, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: System Account (r:2 w:2) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn refund_currency_due_unbond() -> Weight { + // Proof Size summary in bytes: + // Measured: `1897` + // Estimated: `6196` + // Minimum execution time: 157_504 nanoseconds. + Weight::from_parts(160_216_000, 6196) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(4)) + } + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: Slp FeeSources (r:1 w:0) + // Proof Skipped: Slp FeeSources (max_values: None, max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (max_values: None, max_size: None, mode: Measured) + fn supplement_fee_reserve() -> Weight { + // Proof Size summary in bytes: + // Measured: `391` + // Estimated: `3856` + // Minimum execution time: 62_010 nanoseconds. + Weight::from_parts(63_508_000, 3856) + .saturating_add(T::DbWeight::get().reads(3)) + } + // Storage: Slp CurrencyTuneExchangeRateLimit (r:1 w:0) + // Proof Skipped: Slp CurrencyTuneExchangeRateLimit (max_values: None, max_size: None, mode: Measured) + // Storage: VtokenMinting TokenPool (r:1 w:1) + // Proof: VtokenMinting TokenPool (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + // Storage: VtokenMinting OngoingTimeUnit (r:1 w:0) + // Proof: VtokenMinting OngoingTimeUnit (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen) + // Storage: Slp CurrencyLatestTuneRecord (r:1 w:1) + // Proof Skipped: Slp CurrencyLatestTuneRecord (max_values: None, max_size: None, mode: Measured) + // Storage: Slp HostingFees (r:1 w:0) + // Proof Skipped: Slp HostingFees (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens TotalIssuance (r:1 w:1) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + // Storage: Tokens Accounts (r:1 w:1) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: System Account (r:1 w:1) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:0) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: Slp DelegatorLatestTuneRecord (r:1 w:1) + // Proof Skipped: Slp DelegatorLatestTuneRecord (max_values: None, max_size: None, mode: Measured) + // Storage: Slp DelegatorLedgers (r:1 w:1) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + fn charge_host_fee_and_tune_vtoken_exchange_rate() -> Weight { + // Proof Size summary in bytes: + // Measured: `2097` + // Estimated: `5562` + // Minimum execution time: 215_456 nanoseconds. + Weight::from_parts(221_225_000, 5562) + .saturating_add(T::DbWeight::get().reads(12)) + .saturating_add(T::DbWeight::get().writes(7)) + } + // Storage: Slp OperateOrigins (r:1 w:1) + // Proof Skipped: Slp OperateOrigins (max_values: None, max_size: None, mode: Measured) + fn set_operate_origin() -> Weight { + // Proof Size summary in bytes: + // Measured: `4` + // Estimated: `3469` + // Minimum execution time: 29_641 nanoseconds. + Weight::from_parts(31_358_000, 3469) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp FeeSources (r:1 w:1) + // Proof Skipped: Slp FeeSources (max_values: None, max_size: None, mode: Measured) + fn set_fee_source() -> Weight { + // Proof Size summary in bytes: + // Measured: `4` + // Estimated: `3469` + // Minimum execution time: 28_008 nanoseconds. + Weight::from_parts(33_202_000, 3469) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp DelegatorsIndex2Multilocation (r:1 w:1) + // Proof Skipped: Slp DelegatorsIndex2Multilocation (max_values: None, max_size: None, mode: Measured) + // Storage: Slp DelegatorNextIndex (r:1 w:0) + // Proof Skipped: Slp DelegatorNextIndex (max_values: None, max_size: None, mode: Measured) + // Storage: Slp MinimumsAndMaximums (r:1 w:0) + // Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) + // Storage: Slp DelegatorsMultilocation2Index (r:0 w:1) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + fn add_delegator() -> Weight { + // Proof Size summary in bytes: + // Measured: `63` + // Estimated: `3528` + // Minimum execution time: 51_783 nanoseconds. + Weight::from_parts(53_173_000, 3528) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: Slp DelegatorLedgers (r:1 w:1) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + // Storage: Slp DelegatorsMultilocation2Index (r:1 w:1) + // Proof Skipped: Slp DelegatorsMultilocation2Index (max_values: None, max_size: None, mode: Measured) + // Storage: Slp DelegatorsIndex2Multilocation (r:0 w:1) + // Proof Skipped: Slp DelegatorsIndex2Multilocation (max_values: None, max_size: None, mode: Measured) + fn remove_delegator() -> Weight { + // Proof Size summary in bytes: + // Measured: `340` + // Estimated: `3805` + // Minimum execution time: 61_870 nanoseconds. + Weight::from_parts(64_474_000, 3805) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Slp Validators (r:1 w:1) + // Proof Skipped: Slp Validators (max_values: None, max_size: None, mode: Measured) + // Storage: Slp MinimumsAndMaximums (r:1 w:0) + // Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) + fn add_validator() -> Weight { + // Proof Size summary in bytes: + // Measured: `63` + // Estimated: `3528` + // Minimum execution time: 40_832 nanoseconds. + Weight::from_parts(41_891_000, 3528) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp Validators (r:1 w:1) + // Proof Skipped: Slp Validators (max_values: None, max_size: None, mode: Measured) + fn remove_validator() -> Weight { + // Proof Size summary in bytes: + // Measured: `120` + // Estimated: `3585` + // Minimum execution time: 40_957 nanoseconds. + Weight::from_parts(42_157_000, 3585) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp MinimumsAndMaximums (r:1 w:0) + // Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) + // Storage: Slp DelegatorLedgers (r:1 w:0) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + // Storage: Slp Validators (r:1 w:0) + // Proof Skipped: Slp Validators (max_values: None, max_size: None, mode: Measured) + // Storage: Slp ValidatorsByDelegator (r:0 w:1) + // Proof Skipped: Slp ValidatorsByDelegator (max_values: None, max_size: None, mode: Measured) + fn set_validators_by_delegator() -> Weight { + // Proof Size summary in bytes: + // Measured: `331` + // Estimated: `3796` + // Minimum execution time: 61_606 nanoseconds. + Weight::from_parts(62_459_000, 3796) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp DelegatorLedgers (r:1 w:1) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + fn set_delegator_ledger() -> Weight { + // Proof Size summary in bytes: + // Measured: `242` + // Estimated: `3707` + // Minimum execution time: 45_286 nanoseconds. + Weight::from_parts(46_262_000, 3707) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp MinimumsAndMaximums (r:1 w:1) + // Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) + fn set_minimums_and_maximums() -> Weight { + // Proof Size summary in bytes: + // Measured: `4` + // Estimated: `3469` + // Minimum execution time: 31_060 nanoseconds. + Weight::from_parts(32_075_000, 3469) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp CurrencyDelays (r:1 w:1) + // Proof Skipped: Slp CurrencyDelays (max_values: None, max_size: None, mode: Measured) + fn set_currency_delays() -> Weight { + // Proof Size summary in bytes: + // Measured: `4` + // Estimated: `3469` + // Minimum execution time: 26_703 nanoseconds. + Weight::from_parts(30_485_000, 3469) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp HostingFees (r:1 w:1) + // Proof Skipped: Slp HostingFees (max_values: None, max_size: None, mode: Measured) + fn set_hosting_fees() -> Weight { + // Proof Size summary in bytes: + // Measured: `4` + // Estimated: `3469` + // Minimum execution time: 31_853 nanoseconds. + Weight::from_parts(33_036_000, 3469) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp CurrencyTuneExchangeRateLimit (r:1 w:1) + // Proof Skipped: Slp CurrencyTuneExchangeRateLimit (max_values: None, max_size: None, mode: Measured) + fn set_currency_tune_exchange_rate_limit() -> Weight { + // Proof Size summary in bytes: + // Measured: `4` + // Estimated: `3469` + // Minimum execution time: 29_121 nanoseconds. + Weight::from_parts(30_332_000, 3469) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp OngoingTimeUnitUpdateInterval (r:1 w:1) + // Proof Skipped: Slp OngoingTimeUnitUpdateInterval (max_values: None, max_size: None, mode: Measured) + // Storage: Slp LastTimeUpdatedOngoingTimeUnit (r:0 w:1) + // Proof Skipped: Slp LastTimeUpdatedOngoingTimeUnit (max_values: None, max_size: None, mode: Measured) + fn set_ongoing_time_unit_update_interval() -> Weight { + // Proof Size summary in bytes: + // Measured: `4` + // Estimated: `3469` + // Minimum execution time: 31_333 nanoseconds. + Weight::from_parts(36_804_000, 3469) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: Slp SupplementFeeAccountWhitelist (r:1 w:1) + // Proof Skipped: Slp SupplementFeeAccountWhitelist (max_values: None, max_size: None, mode: Measured) + fn add_supplement_fee_account_to_whitelist() -> Weight { + // Proof Size summary in bytes: + // Measured: `4` + // Estimated: `3469` + // Minimum execution time: 37_467 nanoseconds. + Weight::from_parts(38_636_000, 3469) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp SupplementFeeAccountWhitelist (r:1 w:1) + // Proof Skipped: Slp SupplementFeeAccountWhitelist (max_values: None, max_size: None, mode: Measured) + fn remove_supplement_fee_account_from_whitelist() -> Weight { + // Proof Size summary in bytes: + // Measured: `119` + // Estimated: `3584` + // Minimum execution time: 41_910 nanoseconds. + Weight::from_parts(42_858_000, 3584) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp DelegatorLedgerXcmUpdateQueue (r:1 w:1) + // Proof Skipped: Slp DelegatorLedgerXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) + // Storage: Slp DelegatorLedgers (r:1 w:1) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm Queries (r:1 w:0) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn confirm_delegator_ledger_query_response() -> Weight { + // Proof Size summary in bytes: + // Measured: `597` + // Estimated: `4062` + // Minimum execution time: 73_648 nanoseconds. + Weight::from_parts(74_976_000, 4062) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: Slp DelegatorLedgerXcmUpdateQueue (r:1 w:1) + // Proof Skipped: Slp DelegatorLedgerXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm Queries (r:1 w:0) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn fail_delegator_ledger_query_response() -> Weight { + // Proof Size summary in bytes: + // Measured: `496` + // Estimated: `3961` + // Minimum execution time: 52_423 nanoseconds. + Weight::from_parts(53_428_000, 3961) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp ValidatorsByDelegatorXcmUpdateQueue (r:1 w:1) + // Proof Skipped: Slp ValidatorsByDelegatorXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) + // Storage: Slp ValidatorsByDelegator (r:0 w:1) + // Proof Skipped: Slp ValidatorsByDelegator (max_values: None, max_size: None, mode: Measured) + fn confirm_validators_by_delegator_query_response() -> Weight { + // Proof Size summary in bytes: + // Measured: `229` + // Estimated: `3694` + // Minimum execution time: 47_808 nanoseconds. + Weight::from_parts(48_657_000, 3694) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: Slp ValidatorsByDelegatorXcmUpdateQueue (r:1 w:1) + // Proof Skipped: Slp ValidatorsByDelegatorXcmUpdateQueue (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm Queries (r:1 w:0) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn fail_validators_by_delegator_query_response() -> Weight { + // Proof Size summary in bytes: + // Measured: `561` + // Estimated: `4026` + // Minimum execution time: 54_224 nanoseconds. + Weight::from_parts(55_128_000, 4026) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp MinimumsAndMaximums (r:1 w:0) + // Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) + // Storage: Slp Validators (r:0 w:1) + // Proof Skipped: Slp Validators (max_values: None, max_size: None, mode: Measured) + fn reset_validators() -> Weight { + // Proof Size summary in bytes: + // Measured: `63` + // Estimated: `3528` + // Minimum execution time: 36_205 nanoseconds. + Weight::from_parts(39_311_000, 3528) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp MinimumsAndMaximums (r:1 w:0) + // Proof Skipped: Slp MinimumsAndMaximums (max_values: None, max_size: None, mode: Measured) + // Storage: Slp Validators (r:1 w:1) + // Proof Skipped: Slp Validators (max_values: None, max_size: None, mode: Measured) + // Storage: Slp ValidatorBoostList (r:0 w:1) + // Proof Skipped: Slp ValidatorBoostList (max_values: None, max_size: None, mode: Measured) + fn set_validator_boost_list() -> Weight { + // Proof Size summary in bytes: + // Measured: `63` + // Estimated: `3528` + // Minimum execution time: 60_318 nanoseconds. + Weight::from_parts(61_929_000, 3528) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: Slp ValidatorBoostList (r:1 w:1) + // Proof Skipped: Slp ValidatorBoostList (max_values: None, max_size: None, mode: Measured) + // Storage: Slp Validators (r:1 w:1) + // Proof Skipped: Slp Validators (max_values: None, max_size: None, mode: Measured) + fn add_to_validator_boost_list() -> Weight { + // Proof Size summary in bytes: + // Measured: `42` + // Estimated: `3507` + // Minimum execution time: 53_855 nanoseconds. + Weight::from_parts(56_070_000, 3507) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: Slp ValidatorBoostList (r:1 w:1) + // Proof Skipped: Slp ValidatorBoostList (max_values: None, max_size: None, mode: Measured) + fn remove_from_validator_boot_list() -> Weight { + // Proof Size summary in bytes: + // Measured: `161` + // Estimated: `3626` + // Minimum execution time: 37_202 nanoseconds. + Weight::from_parts(37_957_000, 3626) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + fn convert_treasury_vtoken() -> Weight { + Weight::from_parts(42_190_000, 3911) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } + fn clean_outdated_validator_boost_list() -> Weight { + Weight::from_parts(42_190_000, 3911) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } +} diff --git a/runtime/bifrost-paseo/src/weights/bifrost_slp_v2.rs b/runtime/bifrost-paseo/src/weights/bifrost_slp_v2.rs new file mode 100644 index 0000000000..b7bd7ff5bf --- /dev/null +++ b/runtime/bifrost-paseo/src/weights/bifrost_slp_v2.rs @@ -0,0 +1,351 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for bifrost_slp_v2 +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 +//! DATE: 2024-09-11, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bifrost-jenkins`, CPU: `Intel(R) Xeon(R) CPU E5-26xx v4` +//! WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-polkadot-local"), DB CACHE: 1024 + +// Executed Command: +// ./target/release/bifrost +// benchmark +// pallet +// --chain=bifrost-polkadot-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_slp_v2 +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --header=./HEADER-GPL3 +// --output=./weight.rs +// --template +// ./weight-template/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; + +/// Weight functions for bifrost_slp_v2. +pub struct BifrostWeight(PhantomData); +impl bifrost_slp_v2::WeightInfo for BifrostWeight { + // Storage: `SlpV2::NextDelegatorIndexByStakingProtocol` (r:1 w:1) + // Proof: `SlpV2::NextDelegatorIndexByStakingProtocol` (`max_values`: None, `max_size`: Some(19), added: 2494, mode: `MaxEncodedLen`) + // Storage: `ParachainInfo::ParachainId` (r:1 w:0) + // Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + // Storage: `SlpV2::DelegatorByStakingProtocolAndDelegatorIndex` (r:1 w:1) + // Proof: `SlpV2::DelegatorByStakingProtocolAndDelegatorIndex` (`max_values`: None, `max_size`: Some(68), added: 2543, mode: `MaxEncodedLen`) + // Storage: `SlpV2::DelegatorIndexByStakingProtocolAndDelegator` (r:1 w:1) + // Proof: `SlpV2::DelegatorIndexByStakingProtocolAndDelegator` (`max_values`: None, `max_size`: Some(68), added: 2543, mode: `MaxEncodedLen`) + // Storage: `System::Number` (r:1 w:0) + // Proof: `System::Number` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + // Storage: `System::ExecutionPhase` (r:1 w:0) + // Proof: `System::ExecutionPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) + // Storage: `System::EventCount` (r:1 w:1) + // Proof: `System::EventCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + // Storage: `System::Events` (r:1 w:1) + // Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `SlpV2::LedgerByStakingProtocolAndDelegator` (r:0 w:1) + // Proof: `SlpV2::LedgerByStakingProtocolAndDelegator` (`max_values`: None, `max_size`: Some(252), added: 2727, mode: `MaxEncodedLen`) + fn add_delegator() -> Weight { + // Proof Size summary in bytes: + // Measured: `341` + // Estimated: `3533` + // Minimum execution time: 53_863 nanoseconds. + Weight::from_parts(54_653_000, 3533) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(6)) + } + // Storage: `SlpV2::DelegatorIndexByStakingProtocolAndDelegator` (r:1 w:1) + // Proof: `SlpV2::DelegatorIndexByStakingProtocolAndDelegator` (`max_values`: None, `max_size`: Some(68), added: 2543, mode: `MaxEncodedLen`) + // Storage: `System::Number` (r:1 w:0) + // Proof: `System::Number` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + // Storage: `System::ExecutionPhase` (r:1 w:0) + // Proof: `System::ExecutionPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) + // Storage: `System::EventCount` (r:1 w:1) + // Proof: `System::EventCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + // Storage: `System::Events` (r:1 w:1) + // Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `SlpV2::LedgerByStakingProtocolAndDelegator` (r:0 w:1) + // Proof: `SlpV2::LedgerByStakingProtocolAndDelegator` (`max_values`: None, `max_size`: Some(252), added: 2727, mode: `MaxEncodedLen`) + // Storage: `SlpV2::DelegatorByStakingProtocolAndDelegatorIndex` (r:0 w:1) + // Proof: `SlpV2::DelegatorByStakingProtocolAndDelegatorIndex` (`max_values`: None, `max_size`: Some(68), added: 2543, mode: `MaxEncodedLen`) + // Storage: `SlpV2::ValidatorsByStakingProtocolAndDelegator` (r:0 w:1) + // Proof: `SlpV2::ValidatorsByStakingProtocolAndDelegator` (`max_values`: None, `max_size`: Some(8772), added: 11247, mode: `MaxEncodedLen`) + fn remove_delegator() -> Weight { + // Proof Size summary in bytes: + // Measured: `432` + // Estimated: `3533` + // Minimum execution time: 44_302 nanoseconds. + Weight::from_parts(45_092_000, 3533) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(6)) + } + // Storage: `SlpV2::DelegatorIndexByStakingProtocolAndDelegator` (r:1 w:0) + // Proof: `SlpV2::DelegatorIndexByStakingProtocolAndDelegator` (`max_values`: None, `max_size`: Some(68), added: 2543, mode: `MaxEncodedLen`) + // Storage: `SlpV2::DelegatorByStakingProtocolAndDelegatorIndex` (r:1 w:0) + // Proof: `SlpV2::DelegatorByStakingProtocolAndDelegatorIndex` (`max_values`: None, `max_size`: Some(68), added: 2543, mode: `MaxEncodedLen`) + // Storage: `SlpV2::ValidatorsByStakingProtocolAndDelegator` (r:1 w:1) + // Proof: `SlpV2::ValidatorsByStakingProtocolAndDelegator` (`max_values`: None, `max_size`: Some(8772), added: 11247, mode: `MaxEncodedLen`) + // Storage: `System::Number` (r:1 w:0) + // Proof: `System::Number` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + // Storage: `System::ExecutionPhase` (r:1 w:0) + // Proof: `System::ExecutionPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) + // Storage: `System::EventCount` (r:1 w:1) + // Proof: `System::EventCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + // Storage: `System::Events` (r:1 w:1) + // Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn add_validator() -> Weight { + // Proof Size summary in bytes: + // Measured: `487` + // Estimated: `12237` + // Minimum execution time: 45_532 nanoseconds. + Weight::from_parts(46_472_000, 12237) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: `SlpV2::DelegatorIndexByStakingProtocolAndDelegator` (r:1 w:0) + // Proof: `SlpV2::DelegatorIndexByStakingProtocolAndDelegator` (`max_values`: None, `max_size`: Some(68), added: 2543, mode: `MaxEncodedLen`) + // Storage: `SlpV2::DelegatorByStakingProtocolAndDelegatorIndex` (r:1 w:0) + // Proof: `SlpV2::DelegatorByStakingProtocolAndDelegatorIndex` (`max_values`: None, `max_size`: Some(68), added: 2543, mode: `MaxEncodedLen`) + // Storage: `SlpV2::ValidatorsByStakingProtocolAndDelegator` (r:1 w:1) + // Proof: `SlpV2::ValidatorsByStakingProtocolAndDelegator` (`max_values`: None, `max_size`: Some(8772), added: 11247, mode: `MaxEncodedLen`) + // Storage: `System::Number` (r:1 w:0) + // Proof: `System::Number` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + // Storage: `System::ExecutionPhase` (r:1 w:0) + // Proof: `System::ExecutionPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) + // Storage: `System::EventCount` (r:1 w:1) + // Proof: `System::EventCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + // Storage: `System::Events` (r:1 w:1) + // Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn remove_validator() -> Weight { + // Proof Size summary in bytes: + // Measured: `598` + // Estimated: `12237` + // Minimum execution time: 46_892 nanoseconds. + Weight::from_parts(48_157_000, 12237) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: `SlpV2::ConfigurationByStakingProtocol` (r:1 w:1) + // Proof: `SlpV2::ConfigurationByStakingProtocol` (`max_values`: None, `max_size`: Some(102), added: 2577, mode: `MaxEncodedLen`) + // Storage: `System::Number` (r:1 w:0) + // Proof: `System::Number` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + // Storage: `System::ExecutionPhase` (r:1 w:0) + // Proof: `System::ExecutionPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) + // Storage: `System::EventCount` (r:1 w:1) + // Proof: `System::EventCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + // Storage: `System::Events` (r:1 w:1) + // Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn set_protocol_configuration() -> Weight { + // Proof Size summary in bytes: + // Measured: `238` + // Estimated: `3567` + // Minimum execution time: 29_559 nanoseconds. + Weight::from_parts(30_338_000, 3567) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: `SlpV2::DelegatorIndexByStakingProtocolAndDelegator` (r:1 w:0) + // Proof: `SlpV2::DelegatorIndexByStakingProtocolAndDelegator` (`max_values`: None, `max_size`: Some(68), added: 2543, mode: `MaxEncodedLen`) + // Storage: `SlpV2::DelegatorByStakingProtocolAndDelegatorIndex` (r:1 w:0) + // Proof: `SlpV2::DelegatorByStakingProtocolAndDelegatorIndex` (`max_values`: None, `max_size`: Some(68), added: 2543, mode: `MaxEncodedLen`) + // Storage: `SlpV2::LedgerByStakingProtocolAndDelegator` (r:1 w:1) + // Proof: `SlpV2::LedgerByStakingProtocolAndDelegator` (`max_values`: None, `max_size`: Some(252), added: 2727, mode: `MaxEncodedLen`) + // Storage: `System::Number` (r:1 w:0) + // Proof: `System::Number` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + // Storage: `System::ExecutionPhase` (r:1 w:0) + // Proof: `System::ExecutionPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) + // Storage: `System::EventCount` (r:1 w:1) + // Proof: `System::EventCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + // Storage: `System::Events` (r:1 w:1) + // Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn set_ledger() -> Weight { + // Proof Size summary in bytes: + // Measured: `545` + // Estimated: `3717` + // Minimum execution time: 47_747 nanoseconds. + Weight::from_parts(48_586_000, 3717) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: `SlpV2::DelegatorIndexByStakingProtocolAndDelegator` (r:1 w:0) + // Proof: `SlpV2::DelegatorIndexByStakingProtocolAndDelegator` (`max_values`: None, `max_size`: Some(68), added: 2543, mode: `MaxEncodedLen`) + // Storage: `SlpV2::DelegatorByStakingProtocolAndDelegatorIndex` (r:1 w:0) + // Proof: `SlpV2::DelegatorByStakingProtocolAndDelegatorIndex` (`max_values`: None, `max_size`: Some(68), added: 2543, mode: `MaxEncodedLen`) + // Storage: `Tokens::Accounts` (r:1 w:0) + // Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(118), added: 2593, mode: `MaxEncodedLen`) + // Storage: `System::Number` (r:1 w:0) + // Proof: `System::Number` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + // Storage: `System::ExecutionPhase` (r:1 w:0) + // Proof: `System::ExecutionPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) + // Storage: `System::EventCount` (r:1 w:1) + // Proof: `System::EventCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + // Storage: `System::Events` (r:1 w:1) + // Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn transfer_to() -> Weight { + // Proof Size summary in bytes: + // Measured: `942` + // Estimated: `3583` + // Minimum execution time: 51_620 nanoseconds. + Weight::from_parts(52_770_000, 3583) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: `SlpV2::DelegatorIndexByStakingProtocolAndDelegator` (r:1 w:0) + // Proof: `SlpV2::DelegatorIndexByStakingProtocolAndDelegator` (`max_values`: None, `max_size`: Some(68), added: 2543, mode: `MaxEncodedLen`) + // Storage: `SlpV2::DelegatorByStakingProtocolAndDelegatorIndex` (r:1 w:0) + // Proof: `SlpV2::DelegatorByStakingProtocolAndDelegatorIndex` (`max_values`: None, `max_size`: Some(68), added: 2543, mode: `MaxEncodedLen`) + // Storage: `SlpV2::ConfigurationByStakingProtocol` (r:1 w:0) + // Proof: `SlpV2::ConfigurationByStakingProtocol` (`max_values`: None, `max_size`: Some(102), added: 2577, mode: `MaxEncodedLen`) + // Storage: `System::Number` (r:1 w:0) + // Proof: `System::Number` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + // Storage: `System::ExecutionPhase` (r:1 w:0) + // Proof: `System::ExecutionPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) + // Storage: `System::EventCount` (r:1 w:1) + // Proof: `System::EventCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + // Storage: `System::Events` (r:1 w:1) + // Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn transfer_back() -> Weight { + // Proof Size summary in bytes: + // Measured: `596` + // Estimated: `3567` + // Minimum execution time: 57_783 nanoseconds. + Weight::from_parts(59_016_000, 3567) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: `ParachainSystem::ValidationData` (r:1 w:0) + // Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::LastRelayChainBlockNumber` (r:1 w:0) + // Proof: `ParachainSystem::LastRelayChainBlockNumber` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `SlpV2::ConfigurationByStakingProtocol` (r:1 w:0) + // Proof: `SlpV2::ConfigurationByStakingProtocol` (`max_values`: None, `max_size`: Some(102), added: 2577, mode: `MaxEncodedLen`) + // Storage: `SlpV2::LastUpdateOngoingTimeUnitBlockNumber` (r:1 w:1) + // Proof: `SlpV2::LastUpdateOngoingTimeUnitBlockNumber` (`max_values`: None, `max_size`: Some(21), added: 2496, mode: `MaxEncodedLen`) + // Storage: `VtokenMinting::OngoingTimeUnit` (r:1 w:1) + // Proof: `VtokenMinting::OngoingTimeUnit` (`max_values`: None, `max_size`: Some(27), added: 2502, mode: `MaxEncodedLen`) + // Storage: `System::Number` (r:1 w:0) + // Proof: `System::Number` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + // Storage: `System::ExecutionPhase` (r:1 w:0) + // Proof: `System::ExecutionPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) + // Storage: `System::EventCount` (r:1 w:1) + // Proof: `System::EventCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + // Storage: `System::Events` (r:1 w:1) + // Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn update_ongoing_time_unit() -> Weight { + // Proof Size summary in bytes: + // Measured: `560` + // Estimated: `3567` + // Minimum execution time: 45_649 nanoseconds. + Weight::from_parts(47_962_000, 3567) + .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().writes(4)) + } + // Storage: `SlpV2::ConfigurationByStakingProtocol` (r:1 w:0) + // Proof: `SlpV2::ConfigurationByStakingProtocol` (`max_values`: None, `max_size`: Some(102), added: 2577, mode: `MaxEncodedLen`) + // Storage: `ParachainSystem::ValidationData` (r:1 w:0) + // Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::LastRelayChainBlockNumber` (r:1 w:0) + // Proof: `ParachainSystem::LastRelayChainBlockNumber` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `SlpV2::LastUpdateTokenExchangeRateBlockNumber` (r:1 w:1) + // Proof: `SlpV2::LastUpdateTokenExchangeRateBlockNumber` (`max_values`: None, `max_size`: Some(70), added: 2545, mode: `MaxEncodedLen`) + // Storage: `VtokenMinting::TokenPool` (r:1 w:1) + // Proof: `VtokenMinting::TokenPool` (`max_values`: None, `max_size`: Some(38), added: 2513, mode: `MaxEncodedLen`) + // Storage: `SlpV2::LedgerByStakingProtocolAndDelegator` (r:1 w:1) + // Proof: `SlpV2::LedgerByStakingProtocolAndDelegator` (`max_values`: None, `max_size`: Some(252), added: 2727, mode: `MaxEncodedLen`) + // Storage: `System::Number` (r:1 w:0) + // Proof: `System::Number` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + // Storage: `System::ExecutionPhase` (r:1 w:0) + // Proof: `System::ExecutionPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) + // Storage: `System::EventCount` (r:1 w:1) + // Proof: `System::EventCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + // Storage: `System::Events` (r:1 w:1) + // Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn update_token_exchange_rate() -> Weight { + // Proof Size summary in bytes: + // Measured: `755` + // Estimated: `3717` + // Minimum execution time: 62_204 nanoseconds. + Weight::from_parts(63_446_000, 3717) + .saturating_add(T::DbWeight::get().reads(10)) + .saturating_add(T::DbWeight::get().writes(5)) + } + // Storage: `SlpV2::DelegatorIndexByStakingProtocolAndDelegator` (r:1 w:0) + // Proof: `SlpV2::DelegatorIndexByStakingProtocolAndDelegator` (`max_values`: None, `max_size`: Some(68), added: 2543, mode: `MaxEncodedLen`) + // Storage: `SlpV2::DelegatorByStakingProtocolAndDelegatorIndex` (r:1 w:0) + // Proof: `SlpV2::DelegatorByStakingProtocolAndDelegatorIndex` (`max_values`: None, `max_size`: Some(68), added: 2543, mode: `MaxEncodedLen`) + // Storage: `System::Number` (r:1 w:0) + // Proof: `System::Number` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + // Storage: `PolkadotXcm::QueryCounter` (r:1 w:1) + // Proof: `PolkadotXcm::QueryCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `SlpV2::ConfigurationByStakingProtocol` (r:1 w:0) + // Proof: `SlpV2::ConfigurationByStakingProtocol` (`max_values`: None, `max_size`: Some(102), added: 2577, mode: `MaxEncodedLen`) + // Storage: `System::ExecutionPhase` (r:1 w:0) + // Proof: `System::ExecutionPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) + // Storage: `System::EventCount` (r:1 w:1) + // Proof: `System::EventCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + // Storage: `System::Events` (r:1 w:1) + // Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `SlpV2::PendingStatusByQueryId` (r:0 w:1) + // Proof: `SlpV2::PendingStatusByQueryId` (`max_values`: None, `max_size`: Some(75), added: 2550, mode: `MaxEncodedLen`) + // Storage: `PolkadotXcm::Queries` (r:0 w:1) + // Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn astar_dapp_staking() -> Weight { + // Proof Size summary in bytes: + // Measured: `836` + // Estimated: `3567` + // Minimum execution time: 72_646 nanoseconds. + Weight::from_parts(73_892_000, 3567) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(5)) + } + // Storage: `SlpV2::PendingStatusByQueryId` (r:1 w:0) + // Proof: `SlpV2::PendingStatusByQueryId` (`max_values`: None, `max_size`: Some(75), added: 2550, mode: `MaxEncodedLen`) + // Storage: `SlpV2::LedgerByStakingProtocolAndDelegator` (r:1 w:1) + // Proof: `SlpV2::LedgerByStakingProtocolAndDelegator` (`max_values`: None, `max_size`: Some(252), added: 2727, mode: `MaxEncodedLen`) + // Storage: `System::Number` (r:1 w:0) + // Proof: `System::Number` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + // Storage: `System::ExecutionPhase` (r:1 w:0) + // Proof: `System::ExecutionPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) + // Storage: `System::EventCount` (r:1 w:1) + // Proof: `System::EventCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + // Storage: `System::Events` (r:1 w:1) + // Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn notify_astar_dapp_staking() -> Weight { + // Proof Size summary in bytes: + // Measured: `567` + // Estimated: `3717` + // Minimum execution time: 40_876 nanoseconds. + Weight::from_parts(41_668_000, 3717) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) + } +} \ No newline at end of file diff --git a/runtime/bifrost-paseo/src/weights/bifrost_slpx.rs b/runtime/bifrost-paseo/src/weights/bifrost_slpx.rs new file mode 100644 index 0000000000..555e30e8fb --- /dev/null +++ b/runtime/bifrost-paseo/src/weights/bifrost_slpx.rs @@ -0,0 +1,153 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for bifrost_slpx +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 +//! DATE: 2024-11-20, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bifrost-jenkins`, CPU: `Intel(R) Xeon(R) CPU E5-26xx v4` +//! WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 + +// Executed Command: +// ./target/release/bifrost +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost-slpx +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --header=./HEADER-GPL3 +// --output=./weight.rs +// --template +// ./weight-template/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; + +/// Weight functions for bifrost_slpx. +pub struct BifrostWeight(PhantomData); +impl bifrost_slpx::WeightInfo for BifrostWeight { + // Storage: `Slpx::WhitelistAccountId` (r:1 w:1) + // Proof: `Slpx::WhitelistAccountId` (`max_values`: None, `max_size`: Some(338), added: 2813, mode: `MaxEncodedLen`) + fn add_whitelist() -> Weight { + // Proof Size summary in bytes: + // Measured: `4` + // Estimated: `3803` + // Minimum execution time: 25_165 nanoseconds. + Weight::from_parts(26_022_000, 3803) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: `Slpx::WhitelistAccountId` (r:1 w:1) + // Proof: `Slpx::WhitelistAccountId` (`max_values`: None, `max_size`: Some(338), added: 2813, mode: `MaxEncodedLen`) + fn remove_whitelist() -> Weight { + // Proof Size summary in bytes: + // Measured: `81` + // Estimated: `3803` + // Minimum execution time: 27_790 nanoseconds. + Weight::from_parts(28_537_000, 3803) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: `Slpx::ExecutionFee` (r:0 w:1) + // Proof: `Slpx::ExecutionFee` (`max_values`: None, `max_size`: Some(46), added: 2521, mode: `MaxEncodedLen`) + fn set_execution_fee() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 15_997 nanoseconds. + Weight::from_parts(16_309_000, 0) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: `Slpx::TransferToFee` (r:0 w:1) + // Proof: `Slpx::TransferToFee` (`max_values`: None, `max_size`: Some(33), added: 2508, mode: `MaxEncodedLen`) + fn set_transfer_to_fee() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 15_990 nanoseconds. + Weight::from_parts(16_543_000, 0) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: `Slpx::WhitelistAccountId` (r:1 w:0) + // Proof: `Slpx::WhitelistAccountId` (`max_values`: None, `max_size`: Some(338), added: 2813, mode: `MaxEncodedLen`) + // Storage: `Slpx::OrderQueue` (r:1 w:1) + // Proof: `Slpx::OrderQueue` (`max_values`: Some(1), `max_size`: Some(113502), added: 113997, mode: `MaxEncodedLen`) + fn mint() -> Weight { + // Proof Size summary in bytes: + // Measured: `81` + // Estimated: `114987` + // Minimum execution time: 33_327 nanoseconds. + Weight::from_parts(34_485_000, 114987) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: `Slpx::WhitelistAccountId` (r:1 w:0) + // Proof: `Slpx::WhitelistAccountId` (`max_values`: None, `max_size`: Some(338), added: 2813, mode: `MaxEncodedLen`) + // Storage: `Slpx::OrderQueue` (r:1 w:1) + // Proof: `Slpx::OrderQueue` (`max_values`: Some(1), `max_size`: Some(113502), added: 113997, mode: `MaxEncodedLen`) + fn mint_with_channel_id() -> Weight { + // Proof Size summary in bytes: + // Measured: `81` + // Estimated: `114987` + // Minimum execution time: 33_004 nanoseconds. + Weight::from_parts(33_780_000, 114987) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: `Slpx::WhitelistAccountId` (r:1 w:0) + // Proof: `Slpx::WhitelistAccountId` (`max_values`: None, `max_size`: Some(338), added: 2813, mode: `MaxEncodedLen`) + // Storage: `Slpx::OrderQueue` (r:1 w:1) + // Proof: `Slpx::OrderQueue` (`max_values`: Some(1), `max_size`: Some(113502), added: 113997, mode: `MaxEncodedLen`) + fn redeem() -> Weight { + // Proof Size summary in bytes: + // Measured: `81` + // Estimated: `114987` + // Minimum execution time: 31_663 nanoseconds. + Weight::from_parts(33_722_000, 114987) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: `Slpx::WhitelistAccountId` (r:1 w:0) + // Proof: `Slpx::WhitelistAccountId` (`max_values`: None, `max_size`: Some(338), added: 2813, mode: `MaxEncodedLen`) + // Storage: `Slpx::OrderQueue` (r:1 w:1) + // Proof: `Slpx::OrderQueue` (`max_values`: Some(1), `max_size`: Some(113502), added: 113997, mode: `MaxEncodedLen`) + fn evm_create_order() -> Weight { + // Proof Size summary in bytes: + // Measured: `81` + // Estimated: `114987` + // Minimum execution time: 32_494 nanoseconds. + Weight::from_parts(33_539_000, 114987) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } +} \ No newline at end of file diff --git a/runtime/bifrost-paseo/src/weights/bifrost_stable_pool.rs b/runtime/bifrost-paseo/src/weights/bifrost_stable_pool.rs new file mode 100644 index 0000000000..c5d39b1d61 --- /dev/null +++ b/runtime/bifrost-paseo/src/weights/bifrost_stable_pool.rs @@ -0,0 +1,247 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for bifrost_stable_pool +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-09-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bifrost-jenkins`, CPU: `Intel(R) Xeon(R) CPU E5-26xx v4` +//! WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 + +// Executed Command: +// target/release/bifrost +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_stable_pool +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/bifrost-kusama/src/weights/bifrost_stable_pool.rs +// --template=./weight-template/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; + +/// Weight functions for bifrost_stable_pool. +pub struct BifrostWeight(PhantomData); +impl bifrost_stable_pool::WeightInfo for BifrostWeight { + // Storage: StableAsset PoolCount (r:1 w:1) + // Proof Skipped: StableAsset PoolCount (max_values: Some(1), max_size: None, mode: Measured) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:1) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: StableAsset Pools (r:1 w:1) + // Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) + // Storage: System Account (r:1 w:1) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn create_pool() -> Weight { + // Proof Size summary in bytes: + // Measured: `663` + // Estimated: `4128` + // Minimum execution time: 90_724 nanoseconds. + Weight::from_parts(93_251_000, 4128) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(4)) + } + // Storage: StableAsset PoolCount (r:1 w:0) + // Proof Skipped: StableAsset PoolCount (max_values: Some(1), max_size: None, mode: Measured) + // Storage: StableAsset TokenRateCaches (r:3 w:2) + // Proof Skipped: StableAsset TokenRateCaches (max_values: None, max_size: None, mode: Measured) + fn edit_token_rate() -> Weight { + // Proof Size summary in bytes: + // Measured: `258` + // Estimated: `8673` + // Minimum execution time: 70_303 nanoseconds. + Weight::from_parts(71_635_000, 8673) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `StableAsset::TokenRateHardcap` (r:0 w:1) + /// Proof: `StableAsset::TokenRateHardcap` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn config_vtoken_auto_refresh() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 12_383_000 picoseconds. + Weight::from_parts(12_724_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `StableAsset::TokenRateHardcap` (r:0 w:1) + /// Proof: `StableAsset::TokenRateHardcap` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn remove_vtoken_auto_refresh() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 12_453_000 picoseconds. + Weight::from_parts(12_564_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: StableAsset Pools (r:1 w:1) + // Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) + // Storage: StableAsset TokenRateCaches (r:2 w:0) + // Proof Skipped: StableAsset TokenRateCaches (max_values: None, max_size: None, mode: Measured) + // Storage: System Account (r:2 w:2) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: Tokens Accounts (r:3 w:3) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:2 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens TotalIssuance (r:1 w:1) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + fn add_liquidity() -> Weight { + // Proof Size summary in bytes: + // Measured: `2557` + // Estimated: `8769` + // Minimum execution time: 427_183 nanoseconds. + Weight::from_parts(438_909_000, 8769) + .saturating_add(T::DbWeight::get().reads(11)) + .saturating_add(T::DbWeight::get().writes(7)) + } + // Storage: StableAsset Pools (r:1 w:1) + // Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) + // Storage: System Account (r:2 w:2) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: StableAsset TokenRateCaches (r:1 w:0) + // Proof Skipped: StableAsset TokenRateCaches (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:1 w:1) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens TotalIssuance (r:1 w:1) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + fn swap() -> Weight { + // Proof Size summary in bytes: + // Measured: `2239` + // Estimated: `6196` + // Minimum execution time: 375_244 nanoseconds. + Weight::from_parts(385_475_000, 6196) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(5)) + } + // Storage: StableAsset Pools (r:1 w:1) + // Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) + // Storage: System Account (r:2 w:2) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: StableAsset TokenRateCaches (r:1 w:0) + // Proof Skipped: StableAsset TokenRateCaches (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:1 w:1) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens TotalIssuance (r:1 w:1) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + fn redeem_proportion() -> Weight { + // Proof Size summary in bytes: + // Measured: `2239` + // Estimated: `6196` + // Minimum execution time: 359_499 nanoseconds. + Weight::from_parts(370_566_000, 6196) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(5)) + } + // Storage: StableAsset Pools (r:1 w:1) + // Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) + // Storage: System Account (r:2 w:2) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: StableAsset TokenRateCaches (r:1 w:0) + // Proof Skipped: StableAsset TokenRateCaches (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:1 w:1) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens TotalIssuance (r:1 w:1) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + fn redeem_single() -> Weight { + // Proof Size summary in bytes: + // Measured: `2239` + // Estimated: `6196` + // Minimum execution time: 304_691 nanoseconds. + Weight::from_parts(312_518_000, 6196) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(5)) + } + // Storage: StableAsset Pools (r:1 w:1) + // Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) + // Storage: System Account (r:2 w:2) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: StableAsset TokenRateCaches (r:1 w:0) + // Proof Skipped: StableAsset TokenRateCaches (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:1 w:1) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens TotalIssuance (r:1 w:1) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + fn redeem_multi() -> Weight { + // Proof Size summary in bytes: + // Measured: `2239` + // Estimated: `6196` + // Minimum execution time: 363_000 nanoseconds. + Weight::from_parts(367_057_000, 6196) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(5)) + } + // Storage: StableAsset Pools (r:1 w:1) + // Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) + fn modify_a() -> Weight { + // Proof Size summary in bytes: + // Measured: `446` + // Estimated: `3911` + // Minimum execution time: 45_142 nanoseconds. + Weight::from_parts(46_445_000, 3911) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: StableAsset Pools (r:1 w:1) + // Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) + fn modify_fees() -> Weight { + // Proof Size summary in bytes: + // Measured: `446` + // Estimated: `3911` + // Minimum execution time: 42_836 nanoseconds. + Weight::from_parts(44_114_000, 3911) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: StableAsset Pools (r:1 w:1) + // Proof Skipped: StableAsset Pools (max_values: None, max_size: None, mode: Measured) + fn modify_recipients() -> Weight { + // Proof Size summary in bytes: + // Measured: `446` + // Estimated: `3911` + // Minimum execution time: 42_455 nanoseconds. + Weight::from_parts(43_753_000, 3911) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } +} diff --git a/runtime/bifrost-paseo/src/weights/bifrost_system_staking.rs b/runtime/bifrost-paseo/src/weights/bifrost_system_staking.rs new file mode 100644 index 0000000000..ad7e3aed07 --- /dev/null +++ b/runtime/bifrost-paseo/src/weights/bifrost_system_staking.rs @@ -0,0 +1,140 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for bifrost_system_staking +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-09-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bifrost-jenkins`, CPU: `Intel(R) Xeon(R) CPU E5-26xx v4` +//! WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 + +// Executed Command: +// target/release/bifrost +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_system_staking +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/bifrost-kusama/src/weights/bifrost_system_staking.rs +// --template=./weight-template/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; + +/// Weight functions for bifrost_system_staking. +pub struct BifrostWeight(PhantomData); +impl bifrost_system_staking::WeightInfo for BifrostWeight { + // Storage: SystemStaking TokenList (r:1 w:0) + // Proof Skipped: SystemStaking TokenList (max_values: Some(1), max_size: None, mode: Measured) + // Storage: SystemStaking Round (r:1 w:0) + // Proof Skipped: SystemStaking Round (max_values: Some(1), max_size: None, mode: Measured) + // Storage: SystemStaking TokenStatus (r:2 w:0) + // Proof Skipped: SystemStaking TokenStatus (max_values: None, max_size: None, mode: Measured) + fn on_initialize() -> Weight { + // Proof Size summary in bytes: + // Measured: `445` + // Estimated: `6385` + // Minimum execution time: 28_850 nanoseconds. + Weight::from_parts(29_556_000, 6385) + .saturating_add(T::DbWeight::get().reads(4)) + } + // Storage: SystemStaking TokenStatus (r:1 w:1) + // Proof Skipped: SystemStaking TokenStatus (max_values: None, max_size: None, mode: Measured) + // Storage: SystemStaking TokenList (r:1 w:1) + // Proof Skipped: SystemStaking TokenList (max_values: Some(1), max_size: None, mode: Measured) + fn token_config() -> Weight { + // Proof Size summary in bytes: + // Measured: `109` + // Estimated: `3574` + // Minimum execution time: 41_759 nanoseconds. + Weight::from_parts(42_957_000, 3574) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: SystemStaking TokenStatus (r:1 w:1) + // Proof Skipped: SystemStaking TokenStatus (max_values: None, max_size: None, mode: Measured) + // Storage: Farming PoolInfos (r:1 w:0) + // Proof Skipped: Farming PoolInfos (max_values: None, max_size: None, mode: Measured) + fn refresh_token_info() -> Weight { + // Proof Size summary in bytes: + // Measured: `403` + // Estimated: `3868` + // Minimum execution time: 51_852 nanoseconds. + Weight::from_parts(53_735_000, 3868) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: SystemStaking TokenStatus (r:1 w:0) + // Proof Skipped: SystemStaking TokenStatus (max_values: None, max_size: None, mode: Measured) + // Storage: Tokens Accounts (r:1 w:0) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: VtokenMinting TokenPool (r:1 w:0) + // Proof: VtokenMinting TokenPool (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + // Storage: Tokens TotalIssuance (r:1 w:0) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + fn payout() -> Weight { + // Proof Size summary in bytes: + // Measured: `1190` + // Estimated: `4655` + // Minimum execution time: 68_013 nanoseconds. + Weight::from_parts(69_859_000, 4655) + .saturating_add(T::DbWeight::get().reads(4)) + } + fn on_redeem_success() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 1_959 nanoseconds. + Weight::from_parts(2_084_000, 0) + } + fn on_redeemed() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 1_994 nanoseconds. + Weight::from_parts(2_059_000, 0) + } + // Storage: SystemStaking TokenList (r:1 w:1) + // Proof Skipped: SystemStaking TokenList (max_values: Some(1), max_size: None, mode: Measured) + // Storage: SystemStaking TokenStatus (r:0 w:1) + // Proof Skipped: SystemStaking TokenStatus (max_values: None, max_size: None, mode: Measured) + fn delete_token() -> Weight { + // Proof Size summary in bytes: + // Measured: `169` + // Estimated: `1654` + // Minimum execution time: 22_823 nanoseconds. + Weight::from_parts(23_707_000, 1654) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) + } +} diff --git a/runtime/bifrost-paseo/src/weights/bifrost_vesting.rs b/runtime/bifrost-paseo/src/weights/bifrost_vesting.rs new file mode 100644 index 0000000000..4b4570a42f --- /dev/null +++ b/runtime/bifrost-paseo/src/weights/bifrost_vesting.rs @@ -0,0 +1,233 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +//! Autogenerated weights for pallet_vesting +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-04-06, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 + +// Executed Command: +// ./target/production/substrate +// benchmark +// pallet +// --chain=dev +// --steps=50 +// --repeat=20 +// --pallet=pallet_vesting +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./frame/vesting/src/weights.rs +// --header=./HEADER-APACHE2 +// --template=./.maintain/frame-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 pallet_vesting using the Substrate node and recommended hardware. +pub struct BifrostWeight(PhantomData); +impl bifrost_vesting::WeightInfo for BifrostWeight { + /// Storage: Vesting Vesting (r:1 w:1) + /// Proof: Vesting Vesting (max_values: None, max_size: Some(1057), added: 3532, mode: MaxEncodedLen) + /// Storage: Balances Locks (r:1 w:1) + /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) + /// Storage: Balances Freezes (r:1 w:0) + /// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) + /// The range of component `l` is `[0, 49]`. + /// The range of component `s` is `[1, 28]`. + fn vest_locked(l: u32, s: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `381 + l * (25 ±0) + s * (36 ±0)` + // Estimated: `4764` + // Minimum execution time: 36_182_000 picoseconds. + Weight::from_parts(35_159_830, 4764) + // Standard Error: 952 + .saturating_add(Weight::from_parts(63_309, 0).saturating_mul(l.into())) + // Standard Error: 1_694 + .saturating_add(Weight::from_parts(62_244, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) + } + /// Storage: Vesting Vesting (r:1 w:1) + /// Proof: Vesting Vesting (max_values: None, max_size: Some(1057), added: 3532, mode: MaxEncodedLen) + /// Storage: Balances Locks (r:1 w:1) + /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) + /// Storage: Balances Freezes (r:1 w:0) + /// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) + /// The range of component `l` is `[0, 49]`. + /// The range of component `s` is `[1, 28]`. + fn vest_unlocked(l: u32, s: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `381 + l * (25 ±0) + s * (36 ±0)` + // Estimated: `4764` + // Minimum execution time: 39_344_000 picoseconds. + Weight::from_parts(38_921_936, 4764) + // Standard Error: 1_283 + .saturating_add(Weight::from_parts(61_531, 0).saturating_mul(l.into())) + // Standard Error: 2_283 + .saturating_add(Weight::from_parts(36_175, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) + } + /// Storage: Vesting Vesting (r:1 w:1) + /// Proof: Vesting Vesting (max_values: None, max_size: Some(1057), added: 3532, mode: MaxEncodedLen) + /// Storage: Balances Locks (r:1 w:1) + /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) + /// Storage: Balances Freezes (r:1 w:0) + /// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// The range of component `l` is `[0, 49]`. + /// The range of component `s` is `[1, 28]`. + fn vest_other_locked(l: u32, s: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `484 + l * (25 ±0) + s * (36 ±0)` + // Estimated: `4764` + // Minimum execution time: 39_461_000 picoseconds. + Weight::from_parts(38_206_465, 4764) + // Standard Error: 743 + .saturating_add(Weight::from_parts(56_973, 0).saturating_mul(l.into())) + // Standard Error: 1_322 + .saturating_add(Weight::from_parts(65_059, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } + /// Storage: Vesting Vesting (r:1 w:1) + /// Proof: Vesting Vesting (max_values: None, max_size: Some(1057), added: 3532, mode: MaxEncodedLen) + /// Storage: Balances Locks (r:1 w:1) + /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) + /// Storage: Balances Freezes (r:1 w:0) + /// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// The range of component `l` is `[0, 49]`. + /// The range of component `s` is `[1, 28]`. + fn vest_other_unlocked(l: u32, s: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `484 + l * (25 ±0) + s * (36 ±0)` + // Estimated: `4764` + // Minimum execution time: 42_029_000 picoseconds. + Weight::from_parts(42_153_438, 4764) + // Standard Error: 1_108 + .saturating_add(Weight::from_parts(50_058, 0).saturating_mul(l.into())) + // Standard Error: 1_971 + .saturating_add(Weight::from_parts(32_391, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } + /// Storage: Vesting Vesting (r:1 w:1) + /// Proof: Vesting Vesting (max_values: None, max_size: Some(1057), added: 3532, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: Balances Locks (r:1 w:1) + /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) + /// Storage: Balances Freezes (r:1 w:0) + /// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) + /// The range of component `l` is `[0, 49]`. + /// The range of component `s` is `[0, 27]`. + fn vested_transfer(l: u32, s: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `555 + l * (25 ±0) + s * (36 ±0)` + // Estimated: `4764` + // Minimum execution time: 75_223_000 picoseconds. + Weight::from_parts(76_675_778, 4764) + // Standard Error: 2_534 + .saturating_add(Weight::from_parts(70_731, 0).saturating_mul(l.into())) + // Standard Error: 4_509 + .saturating_add(Weight::from_parts(108_866, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } + /// Storage: Vesting Vesting (r:1 w:1) + /// Proof: Vesting Vesting (max_values: None, max_size: Some(1057), added: 3532, mode: MaxEncodedLen) + /// Storage: System Account (r:2 w:2) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: Balances Locks (r:1 w:1) + /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) + /// Storage: Balances Freezes (r:1 w:0) + /// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) + /// The range of component `l` is `[0, 49]`. + /// The range of component `s` is `[0, 27]`. + fn force_vested_transfer(l: u32, s: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `658 + l * (25 ±0) + s * (36 ±0)` + // Estimated: `6196` + // Minimum execution time: 76_922_000 picoseconds. + Weight::from_parts(78_634_098, 6196) + // Standard Error: 2_099 + .saturating_add(Weight::from_parts(68_218, 0).saturating_mul(l.into())) + // Standard Error: 3_736 + .saturating_add(Weight::from_parts(95_990, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(5_u64)) + .saturating_add(T::DbWeight::get().writes(4_u64)) + } + /// Storage: Vesting Vesting (r:1 w:1) + /// Proof: Vesting Vesting (max_values: None, max_size: Some(1057), added: 3532, mode: MaxEncodedLen) + /// Storage: Balances Locks (r:1 w:1) + /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) + /// Storage: Balances Freezes (r:1 w:0) + /// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// The range of component `l` is `[0, 49]`. + /// The range of component `s` is `[2, 28]`. + fn not_unlocking_merge_schedules(l: u32, s: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `482 + l * (25 ±0) + s * (36 ±0)` + // Estimated: `4764` + // Minimum execution time: 39_476_000 picoseconds. + Weight::from_parts(38_261_747, 4764) + // Standard Error: 1_794 + .saturating_add(Weight::from_parts(69_639, 0).saturating_mul(l.into())) + // Standard Error: 3_313 + .saturating_add(Weight::from_parts(73_202, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } + /// Storage: Vesting Vesting (r:1 w:1) + /// Proof: Vesting Vesting (max_values: None, max_size: Some(1057), added: 3532, mode: MaxEncodedLen) + /// Storage: Balances Locks (r:1 w:1) + /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) + /// Storage: Balances Freezes (r:1 w:0) + /// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// The range of component `l` is `[0, 49]`. + /// The range of component `s` is `[2, 28]`. + fn unlocking_merge_schedules(l: u32, s: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `482 + l * (25 ±0) + s * (36 ±0)` + // Estimated: `4764` + // Minimum execution time: 43_764_000 picoseconds. + Weight::from_parts(42_679_386, 4764) + // Standard Error: 1_224 + .saturating_add(Weight::from_parts(65_857, 0).saturating_mul(l.into())) + // Standard Error: 2_261 + .saturating_add(Weight::from_parts(70_861, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } +} diff --git a/runtime/bifrost-paseo/src/weights/bifrost_vstoken_conversion.rs b/runtime/bifrost-paseo/src/weights/bifrost_vstoken_conversion.rs new file mode 100644 index 0000000000..dc9a50fe53 --- /dev/null +++ b/runtime/bifrost-paseo/src/weights/bifrost_vstoken_conversion.rs @@ -0,0 +1,136 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for bifrost_vstoken_conversion +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-09-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bifrost-jenkins`, CPU: `Intel(R) Xeon(R) CPU E5-26xx v4` +//! WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 + +// Executed Command: +// target/release/bifrost +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_vstoken_conversion +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/bifrost-kusama/src/weights/bifrost_vstoken_conversion.rs +// --template=./weight-template/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; + +/// Weight functions for bifrost_vstoken_conversion. +pub struct BifrostWeight(PhantomData); +impl bifrost_vstoken_conversion::WeightInfo for BifrostWeight { + // Storage: VstokenConversion ExchangeFee (r:1 w:1) + // Proof: VstokenConversion ExchangeFee (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) + fn set_exchange_fee() -> Weight { + // Proof Size summary in bytes: + // Measured: `180` + // Estimated: `1517` + // Minimum execution time: 31_889 nanoseconds. + Weight::from_parts(32_495_000, 1517) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: VstokenConversion ExchangeRate (r:1 w:1) + // Proof: VstokenConversion ExchangeRate (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) + fn set_exchange_rate() -> Weight { + // Proof Size summary in bytes: + // Measured: `180` + // Estimated: `3479` + // Minimum execution time: 32_059 nanoseconds. + Weight::from_parts(33_515_000, 3479) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: VstokenConversion RelaychainLease (r:1 w:1) + // Proof: VstokenConversion RelaychainLease (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + fn set_relaychain_lease() -> Weight { + // Proof Size summary in bytes: + // Measured: `180` + // Estimated: `1489` + // Minimum execution time: 29_697 nanoseconds. + Weight::from_parts(30_880_000, 1489) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Tokens Accounts (r:4 w:4) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:2 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: VstokenConversion RelaychainLease (r:1 w:0) + // Proof: VstokenConversion RelaychainLease (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: VstokenConversion ExchangeRate (r:1 w:0) + // Proof: VstokenConversion ExchangeRate (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) + // Storage: VstokenConversion ExchangeFee (r:1 w:0) + // Proof: VstokenConversion ExchangeFee (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) + // Storage: System Account (r:3 w:3) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: Tokens TotalIssuance (r:2 w:2) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + fn vsbond_convert_to_vstoken() -> Weight { + // Proof Size summary in bytes: + // Measured: `2336` + // Estimated: `11362` + // Minimum execution time: 261_794 nanoseconds. + Weight::from_parts(267_446_000, 11362) + .saturating_add(T::DbWeight::get().reads(14)) + .saturating_add(T::DbWeight::get().writes(9)) + } + // Storage: Tokens Accounts (r:4 w:4) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:2 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: VstokenConversion RelaychainLease (r:1 w:0) + // Proof: VstokenConversion RelaychainLease (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: VstokenConversion ExchangeRate (r:1 w:0) + // Proof: VstokenConversion ExchangeRate (max_values: None, max_size: Some(14), added: 2489, mode: MaxEncodedLen) + // Storage: VstokenConversion ExchangeFee (r:1 w:0) + // Proof: VstokenConversion ExchangeFee (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) + // Storage: System Account (r:3 w:2) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: Tokens TotalIssuance (r:1 w:1) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + fn vstoken_convert_to_vsbond() -> Weight { + // Proof Size summary in bytes: + // Measured: `2327` + // Estimated: `11362` + // Minimum execution time: 244_918 nanoseconds. + Weight::from_parts(250_767_000, 11362) + .saturating_add(T::DbWeight::get().reads(13)) + .saturating_add(T::DbWeight::get().writes(7)) + } +} diff --git a/runtime/bifrost-paseo/src/weights/bifrost_vtoken_minting.rs b/runtime/bifrost-paseo/src/weights/bifrost_vtoken_minting.rs new file mode 100644 index 0000000000..b8430618a5 --- /dev/null +++ b/runtime/bifrost-paseo/src/weights/bifrost_vtoken_minting.rs @@ -0,0 +1,326 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for bifrost_vtoken_minting +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-09-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bifrost-jenkins`, CPU: `Intel(R) Xeon(R) CPU E5-26xx v4` +//! WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 + +// Executed Command: +// target/release/bifrost +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_vtoken_minting +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/bifrost-kusama/src/weights/bifrost_vtoken_minting.rs +// --template=./weight-template/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; + +/// Weight functions for bifrost_vtoken_minting. +pub struct BifrostWeight(PhantomData); +impl bifrost_vtoken_minting::WeightInfo for BifrostWeight { + // Storage: VtokenMinting MinimumMint (r:1 w:1) + // Proof: VtokenMinting MinimumMint (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + fn set_minimum_mint() -> Weight { + // Proof Size summary in bytes: + // Measured: `732` + // Estimated: `4197` + // Minimum execution time: 47_604 nanoseconds. + Weight::from_parts(48_620_000, 4197) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: VtokenMinting MinimumRedeem (r:1 w:1) + // Proof: VtokenMinting MinimumRedeem (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + fn set_minimum_redeem() -> Weight { + // Proof Size summary in bytes: + // Measured: `180` + // Estimated: `3503` + // Minimum execution time: 31_648 nanoseconds. + Weight::from_parts(33_004_000, 3503) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: VtokenMinting UnlockDuration (r:1 w:1) + // Proof: VtokenMinting UnlockDuration (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen) + fn set_unlock_duration() -> Weight { + // Proof Size summary in bytes: + // Measured: `180` + // Estimated: `3492` + // Minimum execution time: 32_605 nanoseconds. + Weight::from_parts(33_244_000, 3492) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `VtokenMinting::UnlockingTotal` (r:1 w:1) + /// Proof: `VtokenMinting::UnlockingTotal` (`max_values`: None, `max_size`: Some(38), added: 2513, mode: `MaxEncodedLen`) + fn set_unlocking_total() -> Weight { + // Proof Size summary in bytes: + // Measured: `180` + // Estimated: `3503` + // Minimum execution time: 14_808_000 picoseconds. + Weight::from_parts(15_209_000, 0) + .saturating_add(Weight::from_parts(0, 3503)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `VtokenMinting::MinTimeUnit` (r:1 w:1) + /// Proof: `VtokenMinting::MinTimeUnit` (`max_values`: None, `max_size`: Some(27), added: 2502, mode: `MaxEncodedLen`) + fn set_min_time_unit() -> Weight { + // Proof Size summary in bytes: + // Measured: `180` + // Estimated: `3492` + // Minimum execution time: 15_269_000 picoseconds. + Weight::from_parts(15_499_000, 0) + .saturating_add(Weight::from_parts(0, 3492)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `VtokenMinting::OngoingTimeUnit` (r:1 w:1) + /// Proof: `VtokenMinting::OngoingTimeUnit` (`max_values`: None, `max_size`: Some(27), added: 2502, mode: `MaxEncodedLen`) + fn set_ongoing_time_unit() -> Weight { + // Proof Size summary in bytes: + // Measured: `180` + // Estimated: `3492` + // Minimum execution time: 15_209_000 picoseconds. + Weight::from_parts(15_509_000, 0) + .saturating_add(Weight::from_parts(0, 3492)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: VtokenMinting TokenToRebond (r:1 w:1) + // Proof: VtokenMinting TokenToRebond (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + fn add_support_rebond_token() -> Weight { + // Proof Size summary in bytes: + // Measured: `180` + // Estimated: `3503` + // Minimum execution time: 33_236 nanoseconds. + Weight::from_parts(34_638_000, 3503) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: VtokenMinting TokenToRebond (r:1 w:1) + // Proof: VtokenMinting TokenToRebond (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + fn remove_support_rebond_token() -> Weight { + // Proof Size summary in bytes: + // Measured: `230` + // Estimated: `3503` + // Minimum execution time: 36_978 nanoseconds. + Weight::from_parts(38_593_000, 3503) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: VtokenMinting Fees (r:1 w:1) + // Proof: VtokenMinting Fees (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + fn set_fees() -> Weight { + // Proof Size summary in bytes: + // Measured: `180` + // Estimated: `1493` + // Minimum execution time: 30_702 nanoseconds. + Weight::from_parts(31_421_000, 1493) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: VtokenMinting HookIterationLimit (r:1 w:1) + // Proof: VtokenMinting HookIterationLimit (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + fn set_hook_iteration_limit() -> Weight { + // Proof Size summary in bytes: + // Measured: `180` + // Estimated: `1489` + // Minimum execution time: 28_783 nanoseconds. + Weight::from_parts(30_913_000, 1489) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: VtokenMinting MinimumMint (r:1 w:0) + // Proof: VtokenMinting MinimumMint (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + // Storage: VtokenMinting TokenPool (r:1 w:1) + // Proof: VtokenMinting TokenPool (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + // Storage: Tokens TotalIssuance (r:1 w:1) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + // Storage: VtokenMinting Fees (r:1 w:0) + // Proof: VtokenMinting Fees (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + // Storage: Tokens Accounts (r:3 w:3) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: System Account (r:1 w:1) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn mint() -> Weight { + // Proof Size summary in bytes: + // Measured: `2041` + // Estimated: `8769` + // Minimum execution time: 204_920 nanoseconds. + Weight::from_parts(207_086_000, 8769) + .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().writes(6)) + } + // Storage: VtokenMinting MinimumRedeem (r:1 w:0) + // Proof: VtokenMinting MinimumRedeem (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + // Storage: Slp DelegationsOccupied (r:1 w:0) + // Proof Skipped: Slp DelegationsOccupied (max_values: None, max_size: None, mode: Measured) + // Storage: VtokenMinting Fees (r:1 w:0) + // Proof: VtokenMinting Fees (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + // Storage: Tokens Accounts (r:2 w:2) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: System Account (r:1 w:1) + // Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + // Storage: VtokenMinting TokenPool (r:1 w:1) + // Proof: VtokenMinting TokenPool (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + // Storage: Tokens TotalIssuance (r:1 w:1) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + // Storage: VtokenMinting OngoingTimeUnit (r:1 w:0) + // Proof: VtokenMinting OngoingTimeUnit (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen) + // Storage: VtokenMinting UnlockDuration (r:1 w:0) + // Proof: VtokenMinting UnlockDuration (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen) + // Storage: VtokenMinting UnlockingTotal (r:1 w:1) + // Proof: VtokenMinting UnlockingTotal (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + // Storage: VtokenMinting TokenUnlockNextId (r:1 w:1) + // Proof: VtokenMinting TokenUnlockNextId (max_values: None, max_size: Some(26), added: 2501, mode: MaxEncodedLen) + // Storage: VtokenMinting UserUnlockLedger (r:1 w:1) + // Proof: VtokenMinting UserUnlockLedger (max_values: None, max_size: Some(135), added: 2610, mode: MaxEncodedLen) + // Storage: VtokenMinting TimeUnitUnlockLedger (r:1 w:1) + // Proof: VtokenMinting TimeUnitUnlockLedger (max_values: None, max_size: Some(282), added: 2757, mode: MaxEncodedLen) + // Storage: VtokenMinting TokenUnlockLedger (r:0 w:1) + // Proof: VtokenMinting TokenUnlockLedger (max_values: None, max_size: Some(136), added: 2611, mode: MaxEncodedLen) + fn redeem() -> Weight { + // Proof Size summary in bytes: + // Measured: `2187` + // Estimated: `6176` + // Minimum execution time: 244_947 nanoseconds. + Weight::from_parts(249_155_000, 6176) + .saturating_add(T::DbWeight::get().reads(15)) + .saturating_add(T::DbWeight::get().writes(10)) + } + // Storage: VtokenMinting TokenToRebond (r:1 w:1) + // Proof: VtokenMinting TokenToRebond (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + // Storage: VtokenMinting UserUnlockLedger (r:1 w:1) + // Proof: VtokenMinting UserUnlockLedger (max_values: None, max_size: Some(135), added: 2610, mode: MaxEncodedLen) + // Storage: VtokenMinting TokenUnlockLedger (r:1 w:1) + // Proof: VtokenMinting TokenUnlockLedger (max_values: None, max_size: Some(136), added: 2611, mode: MaxEncodedLen) + // Storage: VtokenMinting TimeUnitUnlockLedger (r:1 w:1) + // Proof: VtokenMinting TimeUnitUnlockLedger (max_values: None, max_size: Some(282), added: 2757, mode: MaxEncodedLen) + // Storage: VtokenMinting UnlockingTotal (r:1 w:1) + // Proof: VtokenMinting UnlockingTotal (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + // Storage: VtokenMinting TokenPool (r:1 w:1) + // Proof: VtokenMinting TokenPool (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + // Storage: Tokens TotalIssuance (r:1 w:1) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + // Storage: VtokenMinting Fees (r:1 w:0) + // Proof: VtokenMinting Fees (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + // Storage: Tokens Accounts (r:3 w:3) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + fn rebond() -> Weight { + // Proof Size summary in bytes: + // Measured: `2620` + // Estimated: `8769` + // Minimum execution time: 231_220 nanoseconds. + Weight::from_parts(235_084_000, 8769) + .saturating_add(T::DbWeight::get().reads(12)) + .saturating_add(T::DbWeight::get().writes(10)) + } + // Storage: VtokenMinting TokenToRebond (r:1 w:1) + // Proof: VtokenMinting TokenToRebond (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + // Storage: VtokenMinting TokenUnlockLedger (r:1 w:1) + // Proof: VtokenMinting TokenUnlockLedger (max_values: None, max_size: Some(136), added: 2611, mode: MaxEncodedLen) + // Storage: VtokenMinting TimeUnitUnlockLedger (r:1 w:1) + // Proof: VtokenMinting TimeUnitUnlockLedger (max_values: None, max_size: Some(282), added: 2757, mode: MaxEncodedLen) + // Storage: VtokenMinting UserUnlockLedger (r:1 w:1) + // Proof: VtokenMinting UserUnlockLedger (max_values: None, max_size: Some(135), added: 2610, mode: MaxEncodedLen) + // Storage: VtokenMinting UnlockingTotal (r:1 w:1) + // Proof: VtokenMinting UnlockingTotal (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + // Storage: VtokenMinting TokenPool (r:1 w:1) + // Proof: VtokenMinting TokenPool (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + // Storage: Tokens TotalIssuance (r:1 w:1) + // Proof: Tokens TotalIssuance (max_values: None, max_size: Some(38), added: 2513, mode: MaxEncodedLen) + // Storage: VtokenMinting Fees (r:1 w:0) + // Proof: VtokenMinting Fees (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + // Storage: Tokens Accounts (r:3 w:3) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + fn rebond_by_unlock_id() -> Weight { + // Proof Size summary in bytes: + // Measured: `2620` + // Estimated: `8769` + // Minimum execution time: 221_577 nanoseconds. + Weight::from_parts(223_798_000, 8769) + .saturating_add(T::DbWeight::get().reads(12)) + .saturating_add(T::DbWeight::get().writes(10)) + } + // Storage: VtokenMinting OngoingTimeUnit (r:1 w:0) + // Proof: VtokenMinting OngoingTimeUnit (max_values: None, max_size: Some(27), added: 2502, mode: MaxEncodedLen) + fn on_initialize() -> Weight { + // Proof Size summary in bytes: + // Measured: `211` + // Estimated: `3492` + // Minimum execution time: 16_412 nanoseconds. + Weight::from_parts(16_763_000, 3492) + .saturating_add(T::DbWeight::get().reads(1)) + } + + fn mint_with_lock() -> Weight { + Weight::from_parts(325_143_000, 8769) + .saturating_add(RocksDbWeight::get().reads(9_u64)) + .saturating_add(RocksDbWeight::get().writes(6_u64)) + } + + fn unlock_incentive_minted_vtoken() -> Weight { + Weight::from_parts(227_544_000, 8769) + .saturating_add(RocksDbWeight::get().reads(12_u64)) + .saturating_add(RocksDbWeight::get().writes(10_u64)) + } + + fn set_incentive_coef() -> Weight { + Weight::from_parts(44_736_000, 1493) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } + + fn set_vtoken_incentive_lock_blocks() -> Weight { + Weight::from_parts(44_736_000, 1493) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } +} diff --git a/runtime/bifrost-paseo/src/weights/bifrost_vtoken_voting.rs b/runtime/bifrost-paseo/src/weights/bifrost_vtoken_voting.rs new file mode 100644 index 0000000000..8939443b4a --- /dev/null +++ b/runtime/bifrost-paseo/src/weights/bifrost_vtoken_voting.rs @@ -0,0 +1,272 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for bifrost_vtoken_voting +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-09-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bifrost-jenkins`, CPU: `Intel(R) Xeon(R) CPU E5-26xx v4` +//! WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 + +// Executed Command: +// target/release/bifrost +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_vtoken_voting +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./runtime/bifrost-kusama/src/weights/bifrost_vtoken_voting.rs +// --template=./weight-template/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; + +/// Weight functions for bifrost_vtoken_voting. +pub struct BifrostWeight(PhantomData); +impl bifrost_vtoken_voting::WeightInfo for BifrostWeight { + // Storage: VtokenVoting UndecidingTimeout (r:1 w:0) + // Proof: VtokenVoting UndecidingTimeout (max_values: None, max_size: Some(26), added: 2501, mode: MaxEncodedLen) + // Storage: VtokenVoting DelegatorVote (r:2 w:1) + // Proof: VtokenVoting DelegatorVote (max_values: None, max_size: Some(81), added: 2556, mode: MaxEncodedLen) + // Storage: Slp DelegatorsIndex2Multilocation (r:1 w:0) + // Proof Skipped: Slp DelegatorsIndex2Multilocation (max_values: None, max_size: None, mode: Measured) + // Storage: Slp DelegatorLedgers (r:1 w:0) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + // Storage: VtokenVoting PendingVotingInfo (r:1 w:1) + // Proof: VtokenVoting PendingVotingInfo (max_values: None, max_size: Some(117), added: 2592, mode: MaxEncodedLen) + // Storage: VtokenVoting ReferendumInfoFor (r:1 w:1) + // Proof: VtokenVoting ReferendumInfoFor (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen) + // Storage: Tokens Accounts (r:1 w:1) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: VtokenVoting VotingFor (r:1 w:1) + // Proof: VtokenVoting VotingFor (max_values: None, max_size: Some(13663), added: 16138, mode: MaxEncodedLen) + // Storage: VtokenVoting ClassLocksFor (r:1 w:1) + // Proof: VtokenVoting ClassLocksFor (max_values: None, max_size: Some(5162), added: 7637, mode: MaxEncodedLen) + // Storage: Tokens Locks (r:1 w:1) + // Proof: Tokens Locks (max_values: None, max_size: Some(1271), added: 3746, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm QueryCounter (r:1 w:1) + // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) + // Storage: ParachainInfo ParachainId (r:1 w:0) + // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: VtokenVoting PendingReferendumInfo (r:0 w:1) + // Proof: VtokenVoting PendingReferendumInfo (max_values: None, max_size: Some(34), added: 2509, mode: MaxEncodedLen) + // Storage: PolkadotXcm Queries (r:0 w:1) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn vote_new() -> Weight { + // Proof Size summary in bytes: + // Measured: `14356` + // Estimated: `17821` + // Minimum execution time: 298_891 nanoseconds. + Weight::from_parts(310_932_000, 17821) + .saturating_add(T::DbWeight::get().reads(15)) + .saturating_add(T::DbWeight::get().writes(10)) + } + // Storage: VtokenVoting UndecidingTimeout (r:1 w:0) + // Proof: VtokenVoting UndecidingTimeout (max_values: None, max_size: Some(26), added: 2501, mode: MaxEncodedLen) + // Storage: VtokenVoting DelegatorVote (r:2 w:1) + // Proof: VtokenVoting DelegatorVote (max_values: None, max_size: Some(81), added: 2556, mode: MaxEncodedLen) + // Storage: Slp DelegatorsIndex2Multilocation (r:1 w:0) + // Proof Skipped: Slp DelegatorsIndex2Multilocation (max_values: None, max_size: None, mode: Measured) + // Storage: Slp DelegatorLedgers (r:1 w:0) + // Proof Skipped: Slp DelegatorLedgers (max_values: None, max_size: None, mode: Measured) + // Storage: VtokenVoting PendingVotingInfo (r:1 w:1) + // Proof: VtokenVoting PendingVotingInfo (max_values: None, max_size: Some(117), added: 2592, mode: MaxEncodedLen) + // Storage: VtokenVoting ReferendumInfoFor (r:1 w:1) + // Proof: VtokenVoting ReferendumInfoFor (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen) + // Storage: Tokens Accounts (r:1 w:1) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: VtokenVoting VotingFor (r:1 w:1) + // Proof: VtokenVoting VotingFor (max_values: None, max_size: Some(13663), added: 16138, mode: MaxEncodedLen) + // Storage: VtokenVoting ClassLocksFor (r:1 w:1) + // Proof: VtokenVoting ClassLocksFor (max_values: None, max_size: Some(5162), added: 7637, mode: MaxEncodedLen) + // Storage: Tokens Locks (r:1 w:1) + // Proof: Tokens Locks (max_values: None, max_size: Some(1271), added: 3746, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) + // Proof Skipped: XcmInterface XcmWeightAndFee (max_values: None, max_size: None, mode: Measured) + // Storage: PolkadotXcm QueryCounter (r:1 w:1) + // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) + // Storage: ParachainInfo ParachainId (r:1 w:0) + // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + // Storage: PolkadotXcm Queries (r:0 w:1) + // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + fn vote_existing() -> Weight { + // Proof Size summary in bytes: + // Measured: `5531` + // Estimated: `17128` + // Minimum execution time: 267_328 nanoseconds. + Weight::from_parts(274_051_000, 17128) + .saturating_add(T::DbWeight::get().reads(15)) + .saturating_add(T::DbWeight::get().writes(9)) + } + // Storage: VtokenVoting ReferendumInfoFor (r:1 w:0) + // Proof: VtokenVoting ReferendumInfoFor (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen) + // Storage: VtokenVoting VoteLockingPeriod (r:1 w:0) + // Proof: VtokenVoting VoteLockingPeriod (max_values: None, max_size: Some(26), added: 2501, mode: MaxEncodedLen) + // Storage: ParachainSystem ValidationData (r:1 w:0) + // Proof Skipped: ParachainSystem ValidationData (max_values: Some(1), max_size: None, mode: Measured) + // Storage: VtokenVoting VotingFor (r:1 w:1) + // Proof: VtokenVoting VotingFor (max_values: None, max_size: Some(13663), added: 16138, mode: MaxEncodedLen) + // Storage: VtokenVoting ClassLocksFor (r:1 w:1) + // Proof: VtokenVoting ClassLocksFor (max_values: None, max_size: Some(5162), added: 7637, mode: MaxEncodedLen) + // Storage: Tokens Locks (r:1 w:1) + // Proof: Tokens Locks (max_values: None, max_size: Some(1271), added: 3746, mode: MaxEncodedLen) + // Storage: Tokens Accounts (r:1 w:1) + // Proof: Tokens Accounts (max_values: None, max_size: Some(118), added: 2593, mode: MaxEncodedLen) + // Storage: AssetRegistry CurrencyMetadatas (r:1 w:0) + // Proof Skipped: AssetRegistry CurrencyMetadatas (max_values: None, max_size: None, mode: Measured) + fn unlock() -> Weight { + // Proof Size summary in bytes: + // Measured: `2103` + // Estimated: `17128` + // Minimum execution time: 163_235 nanoseconds. + Weight::from_parts(166_276_000, 17128) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(4)) + } + // Storage: `VtokenVoting::DelegatorVotes` (r:1 w:0) + // Proof: `VtokenVoting::DelegatorVotes` (`max_values`: None, `max_size`: Some(5136), added: 7611, mode: `MaxEncodedLen`) + // Storage: `VtokenVoting::ReferendumInfoFor` (r:1 w:0) + // Proof: `VtokenVoting::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(88), added: 2563, mode: `MaxEncodedLen`) + // Storage: `ParachainSystem::ValidationData` (r:1 w:0) + // Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::LastRelayChainBlockNumber` (r:1 w:0) + // Proof: `ParachainSystem::LastRelayChainBlockNumber` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmInterface::XcmWeightAndFee` (r:1 w:0) + // Proof: `XcmInterface::XcmWeightAndFee` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `PolkadotXcm::QueryCounter` (r:1 w:1) + // Proof: `PolkadotXcm::QueryCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainInfo::ParachainId` (r:1 w:0) + // Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + // Storage: `VtokenVoting::PendingRemoveDelegatorVote` (r:0 w:1) + // Proof: `VtokenVoting::PendingRemoveDelegatorVote` (`max_values`: None, `max_size`: Some(36), added: 2511, mode: `MaxEncodedLen`) + // Storage: `PolkadotXcm::Queries` (r:0 w:1) + // Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn remove_delegator_vote() -> Weight { + // Proof Size summary in bytes: + // Measured: `1048` + // Estimated: `8601` + // Minimum execution time: 34_000 nanoseconds. + Weight::from_parts(35_000_000, 8601) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: VtokenVoting ReferendumInfoFor (r:1 w:1) + // Proof: VtokenVoting ReferendumInfoFor (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen) + // Storage: ParachainSystem ValidationData (r:1 w:0) + // Proof Skipped: ParachainSystem ValidationData (max_values: Some(1), max_size: None, mode: Measured) + fn kill_referendum() -> Weight { + // Proof Size summary in bytes: + // Measured: `370` + // Estimated: `3553` + // Minimum execution time: 39_404 nanoseconds. + Weight::from_parts(45_802_000, 3553) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: Slp DelegatorsIndex2Multilocation (r:1 w:0) + // Proof Skipped: Slp DelegatorsIndex2Multilocation (max_values: None, max_size: None, mode: Measured) + // Storage: VtokenVoting DelegatorVote (r:1 w:1) + // Proof: VtokenVoting DelegatorVote (max_values: None, max_size: Some(81), added: 2556, mode: MaxEncodedLen) + fn add_delegator() -> Weight { + // Proof Size summary in bytes: + // Measured: `372` + // Estimated: `3837` + // Minimum execution time: 49_788 nanoseconds. + Weight::from_parts(50_805_000, 3837) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: VtokenVoting ReferendumInfoFor (r:1 w:1) + // Proof: VtokenVoting ReferendumInfoFor (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen) + fn set_referendum_status() -> Weight { + // Proof Size summary in bytes: + // Measured: `321` + // Estimated: `3553` + // Minimum execution time: 40_937 nanoseconds. + Weight::from_parts(41_714_000, 3553) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: VtokenVoting UndecidingTimeout (r:0 w:1) + // Proof: VtokenVoting UndecidingTimeout (max_values: None, max_size: Some(26), added: 2501, mode: MaxEncodedLen) + fn set_undeciding_timeout() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 7_244 nanoseconds. + Weight::from_parts(24_083_000, 0) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: VtokenVoting VoteLockingPeriod (r:0 w:1) + // Proof: VtokenVoting VoteLockingPeriod (max_values: None, max_size: Some(26), added: 2501, mode: MaxEncodedLen) + fn set_vote_locking_period() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 23_244 nanoseconds. + Weight::from_parts(23_717_000, 0) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: VtokenVoting PendingVotingInfo (r:1 w:0) + // Proof: VtokenVoting PendingVotingInfo (max_values: None, max_size: Some(117), added: 2592, mode: MaxEncodedLen) + // Storage: VtokenVoting PendingReferendumInfo (r:1 w:0) + // Proof: VtokenVoting PendingReferendumInfo (max_values: None, max_size: Some(34), added: 2509, mode: MaxEncodedLen) + fn notify_vote() -> Weight { + // Proof Size summary in bytes: + // Measured: `361` + // Estimated: `3582` + // Minimum execution time: 43_638 nanoseconds. + Weight::from_parts(44_768_000, 3582) + .saturating_add(T::DbWeight::get().reads(2)) + } + // Storage: VtokenVoting PendingRemoveDelegatorVote (r:1 w:0) + // Proof: VtokenVoting PendingRemoveDelegatorVote (max_values: None, max_size: Some(36), added: 2511, mode: MaxEncodedLen) + fn notify_remove_delegator_vote() -> Weight { + // Proof Size summary in bytes: + // Measured: `329` + // Estimated: `3501` + // Minimum execution time: 38_311 nanoseconds. + Weight::from_parts(38_955_000, 3501) + .saturating_add(T::DbWeight::get().reads(1)) + } + fn set_vote_cap_ratio() -> Weight { + Weight::from_parts(38_955_000, 3501) + .saturating_add(T::DbWeight::get().reads(1)) + } +} diff --git a/runtime/bifrost-paseo/src/weights/bifrost_xcm_interface.rs b/runtime/bifrost-paseo/src/weights/bifrost_xcm_interface.rs new file mode 100644 index 0000000000..1682d24144 --- /dev/null +++ b/runtime/bifrost-paseo/src/weights/bifrost_xcm_interface.rs @@ -0,0 +1,78 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for bifrost_xcm_interface +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 +//! DATE: 2024-09-24, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bifrost-jenkins`, CPU: `Intel(R) Xeon(R) CPU E5-26xx v4` +//! WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-polkadot-local"), DB CACHE: 1024 + +// Executed Command: +// ./target/release/bifrost +// benchmark +// pallet +// --chain=bifrost-polkadot-local +// --steps=50 +// --repeat=20 +// --pallet=bifrost_xcm_interface +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --header=./HEADER-GPL3 +// --output=./weight.rs +// --template +// ./weight-template/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; + +/// Weight functions for bifrost_xcm_interface. +pub struct BifrostWeight(PhantomData); +impl bifrost_xcm_interface::WeightInfo for BifrostWeight { + // Storage: `XcmInterface::XcmWeightAndFee` (r:1 w:1) + // Proof: `XcmInterface::XcmWeightAndFee` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `System::Number` (r:1 w:0) + // Proof: `System::Number` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + // Storage: `System::ExecutionPhase` (r:1 w:0) + // Proof: `System::ExecutionPhase` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) + // Storage: `System::EventCount` (r:1 w:1) + // Proof: `System::EventCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + // Storage: `System::Events` (r:1 w:1) + // Proof: `System::Events` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn update_xcm_dest_weight_and_fee() -> Weight { + // Proof Size summary in bytes: + // Measured: `134` + // Estimated: `3599` + // Minimum execution time: 56_793 nanoseconds. + Weight::from_parts(58_130_000, 3599) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(3)) + } +} \ No newline at end of file diff --git a/runtime/bifrost-paseo/src/weights/lend_market.rs b/runtime/bifrost-paseo/src/weights/lend_market.rs new file mode 100644 index 0000000000..321e7bf686 --- /dev/null +++ b/runtime/bifrost-paseo/src/weights/lend_market.rs @@ -0,0 +1,570 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for lend_market +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.1 +//! DATE: 2025-01-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `mjl-legion`, CPU: `12th Gen Intel(R) Core(TM) i9-12900H` +//! WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 + +// Executed Command: +// target/release/bifrost +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=lend-market +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./pallets/lend-market/src/weights.rs +// --template=./weight-template/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; + +/// Weight functions for lend_market. +pub struct BifrostWeight(PhantomData); +impl lend_market::WeightInfo for BifrostWeight { + // Storage: `LendMarket::Markets` (r:2 w:1) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::UnderlyingAssetId` (r:1 w:1) + // Proof: `LendMarket::UnderlyingAssetId` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::ExchangeRate` (r:0 w:1) + // Proof: `LendMarket::ExchangeRate` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::BorrowIndex` (r:0 w:1) + // Proof: `LendMarket::BorrowIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn add_market() -> Weight { + // Proof Size summary in bytes: + // Measured: `76` + // Estimated: `6016` + // Minimum execution time: 13_026 nanoseconds. + Weight::from_parts(13_543_000, 6016) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(4)) + } + // Storage: `LendMarket::Markets` (r:1 w:1) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn activate_market() -> Weight { + // Proof Size summary in bytes: + // Measured: `346` + // Estimated: `3811` + // Minimum execution time: 8_486 nanoseconds. + Weight::from_parts(9_258_000, 3811) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: `LendMarket::Markets` (r:1 w:1) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn update_rate_model() -> Weight { + // Proof Size summary in bytes: + // Measured: `346` + // Estimated: `3811` + // Minimum execution time: 8_533 nanoseconds. + Weight::from_parts(8_844_000, 3811) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: `LendMarket::Markets` (r:1 w:1) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn update_market() -> Weight { + // Proof Size summary in bytes: + // Measured: `346` + // Estimated: `3811` + // Minimum execution time: 9_544 nanoseconds. + Weight::from_parts(10_721_000, 3811) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: `LendMarket::UnderlyingAssetId` (r:1 w:1) + // Proof: `LendMarket::UnderlyingAssetId` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::Markets` (r:1 w:1) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn force_update_market() -> Weight { + // Proof Size summary in bytes: + // Measured: `354` + // Estimated: `3819` + // Minimum execution time: 13_230 nanoseconds. + Weight::from_parts(14_290_000, 3819) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: `System::Account` (r:2 w:2) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + fn add_reward() -> Weight { + // Proof Size summary in bytes: + // Measured: `103` + // Estimated: `6196` + // Minimum execution time: 30_538 nanoseconds. + Weight::from_parts(33_408_000, 6196) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: `System::Account` (r:2 w:2) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + fn withdraw_missing_reward() -> Weight { + // Proof Size summary in bytes: + // Measured: `206` + // Estimated: `6196` + // Minimum execution time: 28_814 nanoseconds. + Weight::from_parts(31_409_000, 6196) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: `LendMarket::Markets` (r:2 w:0) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplySpeed` (r:1 w:1) + // Proof: `LendMarket::RewardSupplySpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowSpeed` (r:1 w:1) + // Proof: `LendMarket::RewardBorrowSpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplyState` (r:1 w:1) + // Proof: `LendMarket::RewardSupplyState` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowState` (r:1 w:1) + // Proof: `LendMarket::RewardBorrowState` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn update_market_reward_speed() -> Weight { + // Proof Size summary in bytes: + // Measured: `354` + // Estimated: `6294` + // Minimum execution time: 20_639 nanoseconds. + Weight::from_parts(22_334_000, 6294) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(4)) + } + // Storage: `LendMarket::Markets` (r:2 w:0) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplyState` (r:1 w:1) + // Proof: `LendMarket::RewardSupplyState` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplySpeed` (r:1 w:0) + // Proof: `LendMarket::RewardSupplySpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplierIndex` (r:1 w:1) + // Proof: `LendMarket::RewardSupplierIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardAccured` (r:1 w:1) + // Proof: `LendMarket::RewardAccured` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountDeposits` (r:1 w:0) + // Proof: `LendMarket::AccountDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowState` (r:1 w:1) + // Proof: `LendMarket::RewardBorrowState` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowSpeed` (r:1 w:0) + // Proof: `LendMarket::RewardBorrowSpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowerIndex` (r:1 w:1) + // Proof: `LendMarket::RewardBorrowerIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountBorrows` (r:1 w:0) + // Proof: `LendMarket::AccountBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::BorrowIndex` (r:1 w:0) + // Proof: `LendMarket::BorrowIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn claim_reward() -> Weight { + // Proof Size summary in bytes: + // Measured: `376` + // Estimated: `6316` + // Minimum execution time: 37_371 nanoseconds. + Weight::from_parts(39_770_000, 6316) + .saturating_add(T::DbWeight::get().reads(12)) + .saturating_add(T::DbWeight::get().writes(5)) + } + // Storage: `LendMarket::RewardSupplyState` (r:1 w:1) + // Proof: `LendMarket::RewardSupplyState` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplySpeed` (r:1 w:0) + // Proof: `LendMarket::RewardSupplySpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::TotalSupply` (r:1 w:0) + // Proof: `LendMarket::TotalSupply` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplierIndex` (r:1 w:1) + // Proof: `LendMarket::RewardSupplierIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardAccured` (r:1 w:1) + // Proof: `LendMarket::RewardAccured` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountDeposits` (r:1 w:0) + // Proof: `LendMarket::AccountDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowState` (r:1 w:1) + // Proof: `LendMarket::RewardBorrowState` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowSpeed` (r:1 w:0) + // Proof: `LendMarket::RewardBorrowSpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::TotalBorrows` (r:1 w:0) + // Proof: `LendMarket::TotalBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::BorrowIndex` (r:1 w:0) + // Proof: `LendMarket::BorrowIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowerIndex` (r:1 w:1) + // Proof: `LendMarket::RewardBorrowerIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountBorrows` (r:1 w:0) + // Proof: `LendMarket::AccountBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `System::Account` (r:2 w:2) + // 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: `1102` + // Estimated: `6196` + // Minimum execution time: 74_938 nanoseconds. + Weight::from_parts(79_615_000, 6196) + .saturating_add(T::DbWeight::get().reads(14)) + .saturating_add(T::DbWeight::get().writes(7)) + } + // Storage: `LendMarket::Markets` (r:2 w:0) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Tokens::Accounts` (r:2 w:2) + // Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(118), added: 2593, 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: `LendMarket::LastAccruedInterestTime` (r:1 w:1) + // Proof: `LendMarket::LastAccruedInterestTime` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplyState` (r:1 w:1) + // Proof: `LendMarket::RewardSupplyState` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplySpeed` (r:1 w:0) + // Proof: `LendMarket::RewardSupplySpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplierIndex` (r:1 w:1) + // Proof: `LendMarket::RewardSupplierIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardAccured` (r:1 w:1) + // Proof: `LendMarket::RewardAccured` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountDeposits` (r:1 w:1) + // Proof: `LendMarket::AccountDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::TotalSupply` (r:1 w:1) + // Proof: `LendMarket::TotalSupply` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `System::Account` (r:1 w:1) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Storage: `LendMarket::TotalBorrows` (r:1 w:0) + // Proof: `LendMarket::TotalBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::TotalReserves` (r:1 w:0) + // Proof: `LendMarket::TotalReserves` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountEarned` (r:1 w:1) + // Proof: `LendMarket::AccountEarned` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `AssetRegistry::CurrencyMetadatas` (r:1 w:0) + // Proof: `AssetRegistry::CurrencyMetadatas` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn mint() -> Weight { + // Proof Size summary in bytes: + // Measured: `1010` + // Estimated: `6950` + // Minimum execution time: 69_957 nanoseconds. + Weight::from_parts(77_602_000, 6950) + .saturating_add(T::DbWeight::get().reads(17)) + .saturating_add(T::DbWeight::get().writes(10)) + } + // Storage: `LendMarket::Markets` (r:2 w:0) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Timestamp::Now` (r:1 w:0) + // Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + // Storage: `LendMarket::LastAccruedInterestTime` (r:1 w:1) + // Proof: `LendMarket::LastAccruedInterestTime` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::TotalBorrows` (r:1 w:1) + // Proof: `LendMarket::TotalBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Tokens::Accounts` (r:2 w:2) + // Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(118), added: 2593, mode: `MaxEncodedLen`) + // Storage: `System::Account` (r:1 w:0) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Storage: `LendMarket::TotalReserves` (r:1 w:0) + // Proof: `LendMarket::TotalReserves` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Prices::EmergencyPrice` (r:1 w:0) + // Proof: `Prices::EmergencyPrice` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `AssetRegistry::CurrencyMetadatas` (r:1 w:0) + // Proof: `AssetRegistry::CurrencyMetadatas` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::MarketBond` (r:1 w:0) + // Proof: `LendMarket::MarketBond` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountBorrows` (r:1 w:1) + // Proof: `LendMarket::AccountBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountDeposits` (r:1 w:0) + // Proof: `LendMarket::AccountDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::TotalSupply` (r:1 w:0) + // Proof: `LendMarket::TotalSupply` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::LiquidationFreeCollaterals` (r:1 w:0) + // Proof: `LendMarket::LiquidationFreeCollaterals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowState` (r:1 w:1) + // Proof: `LendMarket::RewardBorrowState` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowSpeed` (r:1 w:0) + // Proof: `LendMarket::RewardBorrowSpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowerIndex` (r:1 w:1) + // Proof: `LendMarket::RewardBorrowerIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardAccured` (r:1 w:1) + // Proof: `LendMarket::RewardAccured` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::BorrowIndex` (r:1 w:0) + // Proof: `LendMarket::BorrowIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn borrow() -> Weight { + // Proof Size summary in bytes: + // Measured: `1927` + // Estimated: `7867` + // Minimum execution time: 131_552 nanoseconds. + Weight::from_parts(143_114_000, 7867) + .saturating_add(T::DbWeight::get().reads(21)) + .saturating_add(T::DbWeight::get().writes(8)) + } + // Storage: `LendMarket::Markets` (r:2 w:0) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Timestamp::Now` (r:1 w:0) + // Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + // Storage: `LendMarket::LastAccruedInterestTime` (r:1 w:1) + // Proof: `LendMarket::LastAccruedInterestTime` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::TotalSupply` (r:1 w:1) + // Proof: `LendMarket::TotalSupply` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Tokens::Accounts` (r:3 w:3) + // Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(118), added: 2593, mode: `MaxEncodedLen`) + // Storage: `System::Account` (r:2 w:2) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Storage: `LendMarket::TotalBorrows` (r:1 w:0) + // Proof: `LendMarket::TotalBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::TotalReserves` (r:1 w:0) + // Proof: `LendMarket::TotalReserves` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountDeposits` (r:1 w:1) + // Proof: `LendMarket::AccountDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountEarned` (r:1 w:1) + // Proof: `LendMarket::AccountEarned` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplyState` (r:1 w:1) + // Proof: `LendMarket::RewardSupplyState` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplySpeed` (r:1 w:0) + // Proof: `LendMarket::RewardSupplySpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplierIndex` (r:1 w:1) + // Proof: `LendMarket::RewardSupplierIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardAccured` (r:1 w:1) + // Proof: `LendMarket::RewardAccured` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `AssetRegistry::CurrencyMetadatas` (r:1 w:0) + // Proof: `AssetRegistry::CurrencyMetadatas` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn redeem() -> Weight { + // Proof Size summary in bytes: + // Measured: `1890` + // Estimated: `8769` + // Minimum execution time: 116_287 nanoseconds. + Weight::from_parts(128_202_000, 8769) + .saturating_add(T::DbWeight::get().reads(19)) + .saturating_add(T::DbWeight::get().writes(12)) + } + // Storage: `LendMarket::Markets` (r:2 w:0) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Timestamp::Now` (r:1 w:0) + // Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + // Storage: `LendMarket::LastAccruedInterestTime` (r:1 w:1) + // Proof: `LendMarket::LastAccruedInterestTime` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::TotalSupply` (r:1 w:1) + // Proof: `LendMarket::TotalSupply` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Tokens::Accounts` (r:2 w:2) + // Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(118), added: 2593, mode: `MaxEncodedLen`) + // Storage: `System::Account` (r:1 w:1) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Storage: `LendMarket::TotalBorrows` (r:1 w:0) + // Proof: `LendMarket::TotalBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::TotalReserves` (r:1 w:0) + // Proof: `LendMarket::TotalReserves` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountDeposits` (r:1 w:1) + // Proof: `LendMarket::AccountDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountEarned` (r:1 w:1) + // Proof: `LendMarket::AccountEarned` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplyState` (r:1 w:1) + // Proof: `LendMarket::RewardSupplyState` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplySpeed` (r:1 w:0) + // Proof: `LendMarket::RewardSupplySpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplierIndex` (r:1 w:1) + // Proof: `LendMarket::RewardSupplierIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardAccured` (r:1 w:1) + // Proof: `LendMarket::RewardAccured` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `AssetRegistry::CurrencyMetadatas` (r:1 w:0) + // Proof: `AssetRegistry::CurrencyMetadatas` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn redeem_all() -> Weight { + // Proof Size summary in bytes: + // Measured: `1787` + // Estimated: `7727` + // Minimum execution time: 94_336 nanoseconds. + Weight::from_parts(96_915_000, 7727) + .saturating_add(T::DbWeight::get().reads(17)) + .saturating_add(T::DbWeight::get().writes(10)) + } + // Storage: `LendMarket::Markets` (r:2 w:0) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Timestamp::Now` (r:1 w:0) + // Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + // Storage: `LendMarket::LastAccruedInterestTime` (r:1 w:1) + // Proof: `LendMarket::LastAccruedInterestTime` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountBorrows` (r:1 w:1) + // Proof: `LendMarket::AccountBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::BorrowIndex` (r:1 w:0) + // Proof: `LendMarket::BorrowIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowState` (r:1 w:1) + // Proof: `LendMarket::RewardBorrowState` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowSpeed` (r:1 w:0) + // Proof: `LendMarket::RewardBorrowSpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowerIndex` (r:1 w:1) + // Proof: `LendMarket::RewardBorrowerIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardAccured` (r:1 w:1) + // Proof: `LendMarket::RewardAccured` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Tokens::Accounts` (r:2 w:2) + // Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(118), added: 2593, mode: `MaxEncodedLen`) + // Storage: `AssetRegistry::CurrencyMetadatas` (r:1 w:0) + // Proof: `AssetRegistry::CurrencyMetadatas` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::TotalBorrows` (r:1 w:1) + // Proof: `LendMarket::TotalBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn repay_borrow() -> Weight { + // Proof Size summary in bytes: + // Measured: `1788` + // Estimated: `7728` + // Minimum execution time: 69_861 nanoseconds. + Weight::from_parts(73_341_000, 7728) + .saturating_add(T::DbWeight::get().reads(14)) + .saturating_add(T::DbWeight::get().writes(8)) + } + // Storage: `LendMarket::Markets` (r:2 w:0) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Timestamp::Now` (r:1 w:0) + // Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + // Storage: `LendMarket::LastAccruedInterestTime` (r:1 w:1) + // Proof: `LendMarket::LastAccruedInterestTime` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountBorrows` (r:1 w:1) + // Proof: `LendMarket::AccountBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::BorrowIndex` (r:1 w:0) + // Proof: `LendMarket::BorrowIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowState` (r:1 w:1) + // Proof: `LendMarket::RewardBorrowState` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowSpeed` (r:1 w:0) + // Proof: `LendMarket::RewardBorrowSpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowerIndex` (r:1 w:1) + // Proof: `LendMarket::RewardBorrowerIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardAccured` (r:1 w:1) + // Proof: `LendMarket::RewardAccured` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Tokens::Accounts` (r:2 w:2) + // Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(118), added: 2593, mode: `MaxEncodedLen`) + // Storage: `AssetRegistry::CurrencyMetadatas` (r:1 w:0) + // Proof: `AssetRegistry::CurrencyMetadatas` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::TotalBorrows` (r:1 w:1) + // Proof: `LendMarket::TotalBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn repay_borrow_all() -> Weight { + // Proof Size summary in bytes: + // Measured: `1788` + // Estimated: `7728` + // Minimum execution time: 77_216 nanoseconds. + Weight::from_parts(81_489_000, 7728) + .saturating_add(T::DbWeight::get().reads(14)) + .saturating_add(T::DbWeight::get().writes(8)) + } + // Storage: `LendMarket::Markets` (r:2 w:0) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountDeposits` (r:1 w:1) + // Proof: `LendMarket::AccountDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn collateral_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `529` + // Estimated: `6469` + // Minimum execution time: 21_883 nanoseconds. + Weight::from_parts(24_523_000, 6469) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: `LendMarket::LiquidationFreeCollaterals` (r:1 w:0) + // Proof: `LendMarket::LiquidationFreeCollaterals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `Timestamp::Now` (r:1 w:0) + // Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + // Storage: `LendMarket::LastAccruedInterestTime` (r:2 w:2) + // Proof: `LendMarket::LastAccruedInterestTime` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::Markets` (r:3 w:0) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountBorrows` (r:3 w:1) + // Proof: `LendMarket::AccountBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::BorrowIndex` (r:1 w:0) + // Proof: `LendMarket::BorrowIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Prices::EmergencyPrice` (r:2 w:0) + // Proof: `Prices::EmergencyPrice` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `AssetRegistry::CurrencyMetadatas` (r:2 w:0) + // Proof: `AssetRegistry::CurrencyMetadatas` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountDeposits` (r:4 w:3) + // Proof: `LendMarket::AccountDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::TotalSupply` (r:1 w:0) + // Proof: `LendMarket::TotalSupply` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Tokens::Accounts` (r:3 w:2) + // Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(118), added: 2593, mode: `MaxEncodedLen`) + // Storage: `System::Account` (r:2 w:0) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Storage: `LendMarket::TotalBorrows` (r:2 w:1) + // Proof: `LendMarket::TotalBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::TotalReserves` (r:1 w:0) + // Proof: `LendMarket::TotalReserves` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowState` (r:1 w:1) + // Proof: `LendMarket::RewardBorrowState` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowSpeed` (r:1 w:0) + // Proof: `LendMarket::RewardBorrowSpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowerIndex` (r:1 w:1) + // Proof: `LendMarket::RewardBorrowerIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardAccured` (r:3 w:3) + // Proof: `LendMarket::RewardAccured` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplyState` (r:1 w:1) + // Proof: `LendMarket::RewardSupplyState` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplySpeed` (r:1 w:0) + // Proof: `LendMarket::RewardSupplySpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplierIndex` (r:3 w:3) + // Proof: `LendMarket::RewardSupplierIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn liquidate_borrow() -> Weight { + // Proof Size summary in bytes: + // Measured: `2910` + // Estimated: `13800` + // Minimum execution time: 208_693 nanoseconds. + Weight::from_parts(218_121_000, 13800) + .saturating_add(T::DbWeight::get().reads(39)) + .saturating_add(T::DbWeight::get().writes(18)) + } + // Storage: `LendMarket::Markets` (r:2 w:0) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Tokens::Accounts` (r:2 w:2) + // Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(118), added: 2593, mode: `MaxEncodedLen`) + // Storage: `AssetRegistry::CurrencyMetadatas` (r:1 w:0) + // Proof: `AssetRegistry::CurrencyMetadatas` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `System::Account` (r:1 w:1) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Storage: `LendMarket::TotalReserves` (r:1 w:1) + // Proof: `LendMarket::TotalReserves` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn add_reserves() -> Weight { + // Proof Size summary in bytes: + // Measured: `938` + // Estimated: `6878` + // Minimum execution time: 36_687 nanoseconds. + Weight::from_parts(37_948_000, 6878) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(4)) + } + // Storage: `LendMarket::Markets` (r:2 w:0) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::TotalReserves` (r:1 w:1) + // Proof: `LendMarket::TotalReserves` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Tokens::Accounts` (r:2 w:2) + // Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(118), added: 2593, mode: `MaxEncodedLen`) + // Storage: `AssetRegistry::CurrencyMetadatas` (r:1 w:0) + // Proof: `AssetRegistry::CurrencyMetadatas` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `System::Account` (r:1 w:0) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + fn reduce_reserves() -> Weight { + // Proof Size summary in bytes: + // Measured: `1214` + // Estimated: `7154` + // Minimum execution time: 36_510 nanoseconds. + Weight::from_parts(41_064_000, 7154) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: `LendMarket::LiquidationFreeCollaterals` (r:1 w:1) + // Proof: `LendMarket::LiquidationFreeCollaterals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn update_liquidation_free_collateral() -> Weight { + // Proof Size summary in bytes: + // Measured: `76` + // Estimated: `1561` + // Minimum execution time: 6_120 nanoseconds. + Weight::from_parts(6_715_000, 1561) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } +} diff --git a/runtime/bifrost-paseo/src/weights/mod.rs b/runtime/bifrost-paseo/src/weights/mod.rs new file mode 100644 index 0000000000..ee1d410d49 --- /dev/null +++ b/runtime/bifrost-paseo/src/weights/mod.rs @@ -0,0 +1,47 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 2.0.0 + +//! A list of the different weight modules for our runtime. + +pub mod bb_bnc; +pub mod bifrost_asset_registry; +pub mod bifrost_buy_back; +pub mod bifrost_channel_commission; +pub mod bifrost_clouds_convert; +pub mod bifrost_cross_in_out; +pub mod bifrost_currencies; +pub mod bifrost_farming; +pub mod bifrost_fee_share; +pub mod bifrost_flexible_fee; +pub mod bifrost_salp; +pub mod bifrost_slp; +pub mod bifrost_slp_v2; +pub mod bifrost_slpx; +pub mod bifrost_stable_pool; +pub mod bifrost_system_staking; +pub mod bifrost_vesting; +pub mod bifrost_vstoken_conversion; +pub mod bifrost_vtoken_minting; +pub mod bifrost_vtoken_voting; +pub mod bifrost_xcm_interface; +pub mod lend_market; +pub mod orml_oracle; +pub mod orml_tokens; +pub mod pallet_xcm; diff --git a/runtime/bifrost-paseo/src/weights/orml_oracle.rs b/runtime/bifrost-paseo/src/weights/orml_oracle.rs new file mode 100644 index 0000000000..dffcbeaf83 --- /dev/null +++ b/runtime/bifrost-paseo/src/weights/orml_oracle.rs @@ -0,0 +1,45 @@ +//! Autogenerated weights for orml_oracle +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 +//! DATE: 2021-05-04, STEPS: [50, ], REPEAT: 20, LOW RANGE: [], HIGH RANGE: [] +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128 + +// Executed Command: +// target/release/bifrost +// benchmark +// --chain=dev +// --steps=50 +// --repeat=20 +// --pallet=orml_oracle +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./oracle/src/weights.rs +// --template +// ../templates/orml-weight-template.hbs + + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(clippy::unnecessary_cast)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +pub struct WeightInfo(PhantomData); +impl orml_oracle::WeightInfo for WeightInfo { + fn feed_values(c: u32, ) -> Weight { + Weight::from_parts(16_800_000, 0) + // Standard Error: 84_000 + .saturating_add(Weight::from_parts(3_600_000, 0).saturating_mul(c as u64)) + .saturating_add(RocksDbWeight::get().reads(3 as u64)) + .saturating_add(RocksDbWeight::get().writes(1 as u64)) + .saturating_add(RocksDbWeight::get().writes((2 as u64).saturating_mul(c as u64))) + } + fn on_finalize() -> Weight { + Weight::from_parts(3_000_000, 0) + .saturating_add(RocksDbWeight::get().writes(1 as u64)) + } +} \ No newline at end of file diff --git a/runtime/bifrost-paseo/src/weights/orml_tokens.rs b/runtime/bifrost-paseo/src/weights/orml_tokens.rs new file mode 100644 index 0000000000..2c3d2973b8 --- /dev/null +++ b/runtime/bifrost-paseo/src/weights/orml_tokens.rs @@ -0,0 +1,93 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +//! Autogenerated weights for `orml_tokens` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2021-11-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asgard-local"), DB CACHE: 128 + +// Executed Command: +// target/release/bifrost +// benchmark +// --chain=asgard-local +// --steps=50 +// --repeat=20 +// --pallet=orml-tokens +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --header=./HEADER-GPL3 +// --output=./runtime/asgard/src/weights/orml_tokens.rs + + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::Weight}; +use sp_std::marker::PhantomData; + +/// Weight functions for orml_tokens. +pub struct WeightInfo(PhantomData); +impl orml_tokens::WeightInfo for WeightInfo { + // Storage: Tokens Accounts (r:2 w:2) + // Storage: EvmAccounts EvmAddresses (r:1 w:0) + // Storage: System Account (r:1 w:1) + fn transfer() -> Weight { + // Minimum execution time: 43_684 nanoseconds. + Weight::from_parts(44_569_000, 0) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Tokens Accounts (r:2 w:2) + // Storage: EvmAccounts EvmAddresses (r:1 w:0) + // Storage: System Account (r:1 w:1) + fn transfer_all() -> Weight { + // Minimum execution time: 45_979 nanoseconds. + Weight::from_parts(47_580_000, 0) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Tokens Accounts (r:2 w:2) + // Storage: System Account (r:1 w:1) + fn transfer_keep_alive() -> Weight { + // Minimum execution time: 33_081 nanoseconds. + Weight::from_parts(33_673_000, 0) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Tokens Accounts (r:2 w:2) + // Storage: System Account (r:2 w:1) + fn force_transfer() -> Weight { + // Minimum execution time: 35_052 nanoseconds. + Weight::from_parts(36_041_000, 0) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: Tokens Accounts (r:1 w:1) + // Storage: Tokens TotalIssuance (r:1 w:1) + // Storage: System Account (r:1 w:1) + fn set_balance() -> Weight { + // Minimum execution time: 26_951 nanoseconds. + Weight::from_parts(27_606_000, 0) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + } +} diff --git a/runtime/bifrost-paseo/src/weights/pallet_xcm.rs b/runtime/bifrost-paseo/src/weights/pallet_xcm.rs new file mode 100644 index 0000000000..5fe4c382a8 --- /dev/null +++ b/runtime/bifrost-paseo/src/weights/pallet_xcm.rs @@ -0,0 +1,400 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +//! Autogenerated weights for `pallet_xcm` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("asset-hub-kusama-dev"), DB CACHE: 1024 + +// Executed Command: +// ./artifacts/polkadot-parachain +// benchmark +// pallet +// --chain=asset-hub-kusama-dev +// --execution=wasm +// --wasm-execution=compiled +// --pallet=pallet_xcm +// --extrinsic=* +// --steps=50 +// --repeat=20 +// --json +// --header=./file_header.txt +// --output=./parachains/runtimes/assets/asset-hub-kusama/src/weights/pallet_xcm.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_xcm`. +pub struct WeightInfo(PhantomData); +impl pallet_xcm::WeightInfo for WeightInfo { + /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) + /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) + /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1) + /// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0) + /// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) + /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) + /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn send() -> Weight { + // Proof Size summary in bytes: + // Measured: `145` + // Estimated: `3610` + // Minimum execution time: 21_170_000 picoseconds. + Weight::from_parts(21_757_000, 0) + .saturating_add(Weight::from_parts(0, 3610)) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) + /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) + /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) + /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1) + /// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0) + /// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) + /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) + /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn teleport_assets() -> Weight { + // Proof Size summary in bytes: + // Measured: `197` + // Estimated: `3662` + // Minimum execution time: 94_487_000 picoseconds. + Weight::from_parts(96_276_000, 0) + .saturating_add(Weight::from_parts(0, 3662)) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) + /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:2 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) + /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1) + /// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0) + /// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) + /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) + /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) + /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn reserve_transfer_assets() -> Weight { + // Proof Size summary in bytes: + // Measured: `419` + // Estimated: `6196` + // Minimum execution time: 119_502_000 picoseconds. + Weight::from_parts(121_486_000, 0) + .saturating_add(Weight::from_parts(0, 6196)) + .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().writes(5)) + } + /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) + /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Assets::Asset` (r:1 w:1) + /// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) + /// Storage: `Assets::Account` (r:2 w:2) + /// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:2 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) + /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) + /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1) + /// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0) + /// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) + /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) + /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn transfer_assets() -> Weight { + // Proof Size summary in bytes: + // Measured: `600` + // Estimated: `6208` + // Minimum execution time: 143_889_000 picoseconds. + Weight::from_parts(147_227_000, 0) + .saturating_add(Weight::from_parts(0, 6208)) + .saturating_add(T::DbWeight::get().reads(12)) + .saturating_add(T::DbWeight::get().writes(7)) + } + /// Storage: `Benchmark::Override` (r:0 w:0) + /// Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn execute() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 18_446_744_073_709_551_000 picoseconds. + Weight::from_parts(18_446_744_073_709_551_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + } + /// Storage: `PolkadotXcm::SupportedVersion` (r:0 w:1) + /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn force_xcm_version() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 6_141_000 picoseconds. + Weight::from_parts(6_320_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `PolkadotXcm::SafeXcmVersion` (r:0 w:1) + /// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn force_default_xcm_version() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 2_013_000 picoseconds. + Weight::from_parts(2_144_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `PolkadotXcm::VersionNotifiers` (r:1 w:1) + /// Proof: `PolkadotXcm::VersionNotifiers` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::QueryCounter` (r:1 w:1) + /// Proof: `PolkadotXcm::QueryCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) + /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) + /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1) + /// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0) + /// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) + /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) + /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::Queries` (r:0 w:1) + /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn force_subscribe_version_notify() -> Weight { + // Proof Size summary in bytes: + // Measured: `145` + // Estimated: `3610` + // Minimum execution time: 26_192_000 picoseconds. + Weight::from_parts(26_891_000, 0) + .saturating_add(Weight::from_parts(0, 3610)) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(5)) + } + /// Storage: `PolkadotXcm::VersionNotifiers` (r:1 w:1) + /// Proof: `PolkadotXcm::VersionNotifiers` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) + /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) + /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1) + /// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0) + /// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) + /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) + /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::Queries` (r:0 w:1) + /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn force_unsubscribe_version_notify() -> Weight { + // Proof Size summary in bytes: + // Measured: `363` + // Estimated: `3828` + // Minimum execution time: 28_794_000 picoseconds. + Weight::from_parts(29_672_000, 0) + .saturating_add(Weight::from_parts(0, 3828)) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(4)) + } + /// Storage: `PolkadotXcm::XcmExecutionSuspended` (r:0 w:1) + /// Proof: `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: 1_890_000 picoseconds. + Weight::from_parts(2_068_000, 0) + .saturating_add(Weight::from_parts(0, 0)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `PolkadotXcm::SupportedVersion` (r:5 w:2) + /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn migrate_supported_version() -> Weight { + // Proof Size summary in bytes: + // Measured: `159` + // Estimated: `13524` + // Minimum execution time: 18_690_000 picoseconds. + Weight::from_parts(19_397_000, 0) + .saturating_add(Weight::from_parts(0, 13524)) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `PolkadotXcm::VersionNotifiers` (r:5 w:2) + /// Proof: `PolkadotXcm::VersionNotifiers` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn migrate_version_notifiers() -> Weight { + // Proof Size summary in bytes: + // Measured: `163` + // Estimated: `13528` + // Minimum execution time: 18_719_000 picoseconds. + Weight::from_parts(19_241_000, 0) + .saturating_add(Weight::from_parts(0, 13528)) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:6 w:0) + /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn already_notified_target() -> Weight { + // Proof Size summary in bytes: + // Measured: `173` + // Estimated: `16013` + // Minimum execution time: 20_555_000 picoseconds. + Weight::from_parts(21_068_000, 0) + .saturating_add(Weight::from_parts(0, 16013)) + .saturating_add(T::DbWeight::get().reads(6)) + } + /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:2 w:1) + /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) + /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) + /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1) + /// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0) + /// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) + /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) + /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn notify_current_targets() -> Weight { + // Proof Size summary in bytes: + // Measured: `212` + // Estimated: `6152` + // Minimum execution time: 26_014_000 picoseconds. + Weight::from_parts(26_786_000, 0) + .saturating_add(Weight::from_parts(0, 6152)) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:4 w:0) + /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn notify_target_migration_fail() -> Weight { + // Proof Size summary in bytes: + // Measured: `206` + // Estimated: `11096` + // Minimum execution time: 11_678_000 picoseconds. + Weight::from_parts(12_132_000, 0) + .saturating_add(Weight::from_parts(0, 11096)) + .saturating_add(T::DbWeight::get().reads(4)) + } + /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:5 w:2) + /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn migrate_version_notify_targets() -> Weight { + // Proof Size summary in bytes: + // Measured: `170` + // Estimated: `13535` + // Minimum execution time: 19_050_000 picoseconds. + Weight::from_parts(19_546_000, 0) + .saturating_add(Weight::from_parts(0, 13535)) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:5 w:2) + /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0) + /// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) + /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1) + /// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0) + /// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) + /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) + /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn migrate_and_notify_old_targets() -> Weight { + // Proof Size summary in bytes: + // Measured: `212` + // Estimated: `13577` + // Minimum execution time: 34_690_000 picoseconds. + Weight::from_parts(35_397_000, 0) + .saturating_add(Weight::from_parts(0, 13577)) + .saturating_add(T::DbWeight::get().reads(11)) + .saturating_add(T::DbWeight::get().writes(4)) + } + /// Storage: `PolkadotXcm::QueryCounter` (r:1 w:1) + /// Proof: `PolkadotXcm::QueryCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::Queries` (r:0 w:1) + /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn new_query() -> Weight { + // Proof Size summary in bytes: + // Measured: `103` + // Estimated: `1588` + // Minimum execution time: 4_663_000 picoseconds. + Weight::from_parts(4_812_000, 0) + .saturating_add(Weight::from_parts(0, 1588)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `PolkadotXcm::Queries` (r:1 w:1) + /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn take_response() -> Weight { + // Proof Size summary in bytes: + // Measured: `7740` + // Estimated: `11205` + // Minimum execution time: 25_044_000 picoseconds. + Weight::from_parts(25_416_000, 0) + .saturating_add(Weight::from_parts(0, 11205)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `PolkadotXcm::AssetTraps` (r:1 w:1) + /// Proof: `PolkadotXcm::AssetTraps` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn claim_assets() -> Weight { + // Proof Size summary in bytes: + // Measured: `160` + // Estimated: `3625` + // Minimum execution time: 37_380_000 picoseconds. + Weight::from_parts(37_761_000, 0) + .saturating_add(Weight::from_parts(0, 3625)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } +} \ No newline at end of file diff --git a/runtime/bifrost-paseo/src/xcm_config.rs b/runtime/bifrost-paseo/src/xcm_config.rs new file mode 100644 index 0000000000..a21cd93cd1 --- /dev/null +++ b/runtime/bifrost-paseo/src/xcm_config.rs @@ -0,0 +1,501 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +use super::*; +use bifrost_asset_registry::AssetIdMaps; +use bifrost_currencies::BasicCurrencyAdapter; +use bifrost_primitives::{ + currency::WETH_TOKEN_ID, AccountId, AccountIdToLocation, AssetHubLocation, AssetPrefixFrom, + CurrencyId, CurrencyIdMapping, EthereumLocation, NativeAssetFrom, PolkadotNetwork, + PolkadotUniversalLocation, SelfLocation, TokenSymbol, DOT_TOKEN_ID, +}; +use bifrost_runtime_common::{ + currency_adapter::{BifrostDropAssets, DepositToAlternative, MultiCurrencyAdapter}, + xcm_weight_trader::XcmWeightTrader, +}; +use cumulus_primitives_core::AggregateMessageOrigin; +pub use cumulus_primitives_core::ParaId; +use frame_support::{ + sp_runtime::traits::Convert, + traits::{Get, TransformOrigin}, +}; +pub use orml_traits::{location::AbsoluteReserveProvider, parameter_type_with_key, MultiCurrency}; +use orml_xcm_support::{IsNativeConcrete, MultiNativeAsset}; +use pallet_xcm::XcmPassthrough; +use parachains_common::message_queue::{NarrowOriginToSibling, ParaIdToSibling}; +pub use polkadot_parachain_primitives::primitives::Sibling; +use polkadot_runtime_common::xcm_sender::NoPriceForMessageDelivery; +use xcm::v4::{Asset, AssetId, Location}; +pub use xcm_builder::{ + AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, + AllowTopLevelPaidExecutionFrom, EnsureXcmOrigin, FixedRateOfFungible, FixedWeightBounds, + IsConcrete, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, + SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, + SovereignSignedViaLocation, TakeRevenue, TakeWeightCredit, +}; +use xcm_builder::{ + DescribeAllTerminal, DescribeFamily, FrameTransactionalProcessor, HashedDescription, + TrailingSetTopicAsId, WithComputedOrigin, +}; + +parameter_types! { + pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); + // Maximum weight assigned to MessageQueue pallet to execute messages when the block is on_initialize + pub MessageQueueServiceWeight: Weight = Perbill::from_percent(35) * RuntimeBlockWeights::get().max_block; + // Maximum weight assigned to MessageQueue pallet to execute messages when the block is on_idle + pub MessageQueueIdleServiceWeight: Weight = Perbill::from_percent(35) * RuntimeBlockWeights::get().max_block; + // XTokens pallet BaseXcmWeight, Actually weight for an XCM message is `T::BaseXcmWeight + T::Weigher::weight(&msg)`. + pub const BaseXcmWeight: Weight = Weight::from_parts(1000_000_000u64, 0); + // XTokens pallet supports maximum number of assets to be transferred at a time + pub const MaxAssetsForTransfer: usize = 2; + // One XCM operation is 200_000_000 weight, cross-chain transfer ~= 2x of transfer = 3_000_000_000 + pub const UnitWeightCost: Weight = Weight::from_parts(50_000_000, 0); + // Maximum number of instructions that can be executed in one XCM message + pub const MaxInstructions: u32 = 100; +} + +/// Type for specifying how a `Location` can be converted into an `AccountId`. This is used +/// when determining ownership of accounts for asset transacting and when attempting to use XCM +/// `Transact` in order to determine the dispatch RuntimeOrigin. +pub type LocationToAccountId = ( + // The parent (Relay-chain) origin converts to the parent `AccountId`. + ParentIsPreset, + // Sibling parachain origins convert to AccountId via the `ParaId::into`. + SiblingParachainConvertsVia, + // Straight up local `AccountId32` origins just alias directly to `AccountId`. + AccountId32Aliases, + // Foreign locations alias into accounts according to a hash of their standard description. + HashedDescription>, +); + +/// This is the type we use to convert an (incoming) XCM origin into a local `RuntimeOrigin` +/// instance, ready for dispatching a transaction with Xcm's `Transact`. There is an `OriginKind` +/// which can biases the kind of local `RuntimeOrigin` it will become. +pub type XcmOriginToTransactDispatchOrigin = ( + // Sovereign account converter; this attempts to derive an `AccountId` from the origin location + // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for + // foreign chains who want to have a local sovereign account on this chain which they control. + SovereignSignedViaLocation, + // Native converter for Relay-chain (Parent) location; will converts to a `Relay` origin when + // recognized. + RelayChainAsNative, + // Native converter for sibling Parachains; will convert to a `SiblingPara` origin when + // recognized. + SiblingParachainAsNative, + // Superuser converter for the Relay-chain (Parent) location. This will allow it to issue a + // transaction from the Root origin. + ParentAsSuperuser, + // Native signed account converter; this just converts an `AccountId32` origin into a normal + // `RuntimeOrigin::Signed` origin of the same 32-byte value. + SignedAccountId32AsNative, + // Xcm origins can be represented natively under the Xcm pallet's Xcm origin. + XcmPassthrough, +); + +pub type Barrier = TrailingSetTopicAsId<( + // Weight that is paid for may be consumed. + TakeWeightCredit, + // Expected responses are OK. + AllowKnownQueryResponses, + WithComputedOrigin< + ( + // If the message is one that immediately attemps to pay for execution, then allow it. + AllowTopLevelPaidExecutionFrom, + // TODO: Messages coming from system parachains need not pay for execution. + // AllowExplicitUnpaidExecutionFrom, + // Subscriptions for version tracking are OK. + AllowSubscriptionsFrom, + ), + PolkadotUniversalLocation, + ConstU32<8>, + >, +)>; + +pub type BifrostAssetTransactor = MultiCurrencyAdapter< + Currencies, + UnknownTokens, + IsNativeConcrete>, + AccountId, + LocationToAccountId, + CurrencyId, + CurrencyIdConvert, + DepositToAlternative, +>; + +pub struct ToTreasury; +impl TakeRevenue for ToTreasury { + fn take_revenue(revenue: Asset) { + if let Asset { + id: AssetId(location), + fun: Fungible(amount), + } = revenue + { + if let Some(currency_id) = + CurrencyIdConvert::::convert(location) + { + let _ = Currencies::deposit(currency_id, &BifrostTreasuryAccount::get(), amount); + } + } + } +} + +/// A call filter for the XCM Transact instruction. This is a temporary measure until we properly +/// account for proof size weights. +/// +/// Calls that are allowed through this filter must: +/// 1. Have a fixed weight; +/// 2. Cannot lead to another call being made; +/// 3. Have a defined proof size weight, e.g. no unbounded vecs in call parameters. +pub struct SafeCallFilter; +impl Contains for SafeCallFilter { + fn contains(call: &RuntimeCall) -> bool { + #[cfg(feature = "runtime-benchmarks")] + { + if matches!( + call, + RuntimeCall::System(frame_system::Call::remark_with_event { .. }) + ) { + return true; + } + } + + match call { + RuntimeCall::System( + frame_system::Call::kill_prefix { .. } | frame_system::Call::set_heap_pages { .. }, + ) | + RuntimeCall::Timestamp(..) | + RuntimeCall::Indices(..) | + RuntimeCall::Balances(..) | + RuntimeCall::Session(pallet_session::Call::purge_keys { .. }) | + RuntimeCall::Treasury(..) | + RuntimeCall::Utility(pallet_utility::Call::as_derivative { .. }) | + RuntimeCall::Identity( + pallet_identity::Call::add_registrar { .. } | + pallet_identity::Call::set_identity { .. } | + pallet_identity::Call::clear_identity { .. } | + pallet_identity::Call::request_judgement { .. } | + pallet_identity::Call::cancel_request { .. } | + pallet_identity::Call::set_fee { .. } | + pallet_identity::Call::set_account_id { .. } | + pallet_identity::Call::set_fields { .. } | + pallet_identity::Call::provide_judgement { .. } | + pallet_identity::Call::kill_identity { .. } | + pallet_identity::Call::add_sub { .. } | + pallet_identity::Call::rename_sub { .. } | + pallet_identity::Call::remove_sub { .. } | + pallet_identity::Call::quit_sub { .. }, + ) | + RuntimeCall::Vesting(..) | + RuntimeCall::PolkadotXcm(pallet_xcm::Call::limited_reserve_transfer_assets { .. }) | + RuntimeCall::Proxy(..) | + RuntimeCall::Tokens( + orml_tokens::Call::transfer { .. } | + orml_tokens::Call::transfer_all { .. } | + orml_tokens::Call::transfer_keep_alive { .. } + ) | + // Bifrost moudule + RuntimeCall::Farming( + bifrost_farming::Call::claim { .. } | + bifrost_farming::Call::deposit { .. } | + bifrost_farming::Call::withdraw { .. } | + bifrost_farming::Call::withdraw_claim { .. } + ) | + RuntimeCall::Salp( + bifrost_salp::Call::redeem { .. } + ) | + RuntimeCall::TokenConversion( + bifrost_vstoken_conversion::Call::vsbond_convert_to_vstoken { .. } | + bifrost_vstoken_conversion::Call::vstoken_convert_to_vsbond { .. } + ) | + RuntimeCall::BbBNC( + bb_bnc::Call::increase_amount { .. } | + bb_bnc::Call::increase_unlock_time { .. } | + bb_bnc::Call::withdraw { .. } | + bb_bnc::Call::get_rewards { .. } + ) | + RuntimeCall::VtokenMinting( + bifrost_vtoken_minting::Call::mint { .. } | + bifrost_vtoken_minting::Call::rebond { .. } | + bifrost_vtoken_minting::Call::rebond_by_unlock_id { .. } | + bifrost_vtoken_minting::Call::redeem { .. } + ) | + RuntimeCall::Slpx(..) | + RuntimeCall::ZenlinkProtocol( + zenlink_protocol::Call::add_liquidity { .. } | + zenlink_protocol::Call::remove_liquidity { .. } | + zenlink_protocol::Call::transfer { .. } + ) => true, + _ => false, + } + } +} + +pub struct XcmConfig; +impl xcm_executor::Config for XcmConfig { + type AssetClaims = PolkadotXcm; + type AssetTransactor = BifrostAssetTransactor; + type AssetTrap = BifrostDropAssets; + type Barrier = Barrier; + type RuntimeCall = RuntimeCall; + type IsReserve = ( + NativeAssetFrom, + AssetPrefixFrom, + MultiNativeAsset, + ); + type IsTeleporter = (); + type UniversalLocation = PolkadotUniversalLocation; + type OriginConverter = XcmOriginToTransactDispatchOrigin; + type ResponseHandler = PolkadotXcm; + type SubscriptionService = PolkadotXcm; + type Trader = XcmWeightTrader, ToTreasury>; + // TODO: Implement XcmWeigher, using real Weight, currently per instruction Weight = + // Weight::from_parts(50_000_000, 0) + type Weigher = FixedWeightBounds; + type XcmSender = XcmRouter; + type PalletInstancesInfo = AllPalletsWithSystem; + type MaxAssetsIntoHolding = ConstU32<8>; + type UniversalAliases = Nothing; + type CallDispatcher = RuntimeCall; + type SafeCallFilter = SafeCallFilter; + type AssetLocker = (); + type AssetExchanger = (); + type FeeManager = (); + type MessageExporter = (); + type Aliasers = Nothing; + type TransactionalProcessor = FrameTransactionalProcessor; + type HrmpNewChannelOpenRequestHandler = (); + type HrmpChannelAcceptedHandler = (); + type HrmpChannelClosingHandler = (); + type XcmRecorder = (); +} + +/// Local origins on this chain are allowed to dispatch XCM sends/executions. +pub type LocalOriginToLocation = SignedToAccountId32; + +/// The means for routing XCM messages which are not for local execution into the right message +/// queues. +pub type XcmRouter = ( + // Two routers - use UMP to communicate with the relay chain: + cumulus_primitives_utility::ParentAsUmp, + // ..and XCMP to communicate with the sibling chains. + XcmpQueue, +); + +#[cfg(feature = "runtime-benchmarks")] +parameter_types! { + pub ReachableDest: Option = Some(Parent.into()); +} + +impl pallet_xcm::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type ExecuteXcmOrigin = EnsureXcmOrigin; + type UniversalLocation = PolkadotUniversalLocation; + type SendXcmOrigin = EnsureXcmOrigin; + type Weigher = FixedWeightBounds; + type XcmExecuteFilter = Nothing; + type XcmExecutor = XcmExecutor; + type XcmReserveTransferFilter = Everything; + #[cfg(feature = "runtime-benchmarks")] + type XcmRouter = MockXcmRouter; + #[cfg(not(feature = "runtime-benchmarks"))] + type XcmRouter = XcmRouter; + type XcmTeleportFilter = Nothing; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; + const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; + type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; + type Currency = Balances; + type CurrencyMatcher = (); + type TrustedLockers = (); + type SovereignAccountOf = (); + type MaxLockers = ConstU32<8>; + type WeightInfo = weights::pallet_xcm::WeightInfo; + type AdminOrigin = EnsureRoot; + type MaxRemoteLockConsumers = ConstU32<0>; + type RemoteLockConsumerIdentifier = (); +} + +impl cumulus_pallet_xcm::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type XcmExecutor = XcmExecutor; +} + +impl cumulus_pallet_xcmp_queue::Config for Runtime { + type ChannelInfo = ParachainSystem; + type RuntimeEvent = RuntimeEvent; + type VersionWrapper = PolkadotXcm; + type XcmpQueue = TransformOrigin; + type MaxInboundSuspended = ConstU32<1_000>; + type ControllerOrigin = EnsureRoot; + type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; + type WeightInfo = cumulus_pallet_xcmp_queue::weights::SubstrateWeight; + type PriceForSiblingDelivery = NoPriceForMessageDelivery; + type MaxActiveOutboundChannels = ConstU32<128>; + type MaxPageSize = ConstU32<{ 103 * 1024 }>; +} + +impl pallet_message_queue::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type WeightInfo = pallet_message_queue::weights::SubstrateWeight; + #[cfg(feature = "runtime-benchmarks")] + type MessageProcessor = + pallet_message_queue::mock_helpers::NoopMessageProcessor; + #[cfg(not(feature = "runtime-benchmarks"))] + type MessageProcessor = xcm_builder::ProcessXcmMessage< + AggregateMessageOrigin, + xcm_executor::XcmExecutor, + RuntimeCall, + >; + type Size = u32; + type QueueChangeHandler = NarrowOriginToSibling; + type QueuePausedQuery = NarrowOriginToSibling; + type HeapSize = ConstU32<{ 64 * 1024 }>; + type MaxStale = ConstU32<8>; + type ServiceWeight = MessageQueueServiceWeight; + type IdleMaxServiceWeight = MessageQueueIdleServiceWeight; +} + +// orml runtime start + +impl bifrost_currencies::Config for Runtime { + type GetNativeCurrencyId = NativeCurrencyId; + type MultiCurrency = Tokens; + type NativeCurrency = BasicCurrencyAdapter; + type WeightInfo = weights::bifrost_currencies::WeightInfo; +} + +parameter_type_with_key! { + pub ExistentialDeposits: |currency_id: CurrencyId| -> Balance { + match currency_id { + &CurrencyId::Token2(WETH_TOKEN_ID) => 15_000_000_000_000, // 0.000015 WETH + &CurrencyId::Native(TokenSymbol::BNC) => 10 * milli::(NativeCurrencyId::get()), // 0.01 BNC + &CurrencyId::Token2(DOT_TOKEN_ID) => 1_000_000, // DOT + &CurrencyId::LPToken(..) => 1 * micro::(NativeCurrencyId::get()), + CurrencyId::ForeignAsset(foreign_asset_id) => { + AssetIdMaps::::get_asset_metadata(AssetIds::ForeignAssetId(*foreign_asset_id)). + map_or(Balance::max_value(), |metatata| metatata.minimal_balance) + }, + _ => AssetIdMaps::::get_currency_metadata(*currency_id) + .map_or(Balance::max_value(), |metatata| metatata.minimal_balance) + } + }; +} + +pub struct DustRemovalWhitelist; +impl Contains for DustRemovalWhitelist { + fn contains(a: &AccountId) -> bool { + let whitelist: Vec = vec![ + TreasuryPalletId::get().into_account_truncating(), + BifrostCrowdloanId::get().into_account_truncating(), + BifrostVsbondAccount::get().into_account_truncating(), + SlpEntrancePalletId::get().into_account_truncating(), + SlpExitPalletId::get().into_account_truncating(), + BuybackPalletId::get().into_account_truncating(), + SystemMakerPalletId::get().into_account_truncating(), + ZenklinkFeeAccount::get(), + CommissionPalletId::get().into_account_truncating(), + BuyBackAccount::get().into_account_truncating(), + LiquidityAccount::get().into_account_truncating(), + ]; + whitelist.contains(a) + || FarmingKeeperPalletId::get().check_sub_account::(a) + || FarmingRewardIssuerPalletId::get().check_sub_account::(a) + || FeeSharePalletId::get().check_sub_account::(a) + } +} + +parameter_types! { + pub BifrostTreasuryAccount: AccountId = TreasuryPalletId::get().into_account_truncating(); + // gVLo8SqxQsm11cXpkFJnaqXhAd6qtxwi2DhxfUFE7pSiyoi + pub ZenklinkFeeAccount: AccountId = hex!["d2ca9ceb400cc68dcf58de4871bd261406958fd17338d2d82ad2592db62e6a2a"].into(); +} + +pub struct CurrencyHooks; +impl MutationHooks for CurrencyHooks { + type OnDust = orml_tokens::TransferDust; + type OnSlash = (); + type PreDeposit = (); + type PostDeposit = (); + type PreTransfer = (); + type PostTransfer = (); + type OnNewTokenAccount = (); + type OnKilledTokenAccount = (); +} + +impl orml_tokens::Config for Runtime { + type Amount = Amount; + type Balance = Balance; + type CurrencyId = CurrencyId; + type DustRemovalWhitelist = DustRemovalWhitelist; + type RuntimeEvent = RuntimeEvent; + type ExistentialDeposits = ExistentialDeposits; + type MaxLocks = ConstU32<50>; + type MaxReserves = ConstU32<50>; + type ReserveIdentifier = [u8; 8]; + type WeightInfo = weights::orml_tokens::WeightInfo; + type CurrencyHooks = CurrencyHooks; +} + +parameter_type_with_key! { + pub ParachainMinFee: |_location: Location| -> Option { + Some(u128::MAX) + }; +} + +impl orml_xtokens::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type Balance = Balance; + type CurrencyId = CurrencyId; + type CurrencyIdConvert = CurrencyIdConvert; + type AccountIdToLocation = AccountIdToLocation; + type UniversalLocation = PolkadotUniversalLocation; + type SelfLocation = SelfLocation; + type XcmExecutor = XcmExecutor; + type Weigher = FixedWeightBounds; + type BaseXcmWeight = BaseXcmWeight; + type MaxAssetsForTransfer = MaxAssetsForTransfer; + type MinXcmFee = ParachainMinFee; + type LocationsFilter = Everything; + type ReserveProvider = RelativeReserveProvider; + type RateLimiter = (); + type RateLimiterId = (); +} + +impl orml_unknown_tokens::Config for Runtime { + type RuntimeEvent = RuntimeEvent; +} + +impl orml_xcm::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type SovereignOrigin = MoreThanHalfCouncil; +} + +parameter_types! { + pub ParachainAccount: AccountId = ParachainInfo::get().into_account_truncating(); +} + +impl bifrost_xcm_interface::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type UpdateOrigin = TechAdminOrCouncil; + type MultiCurrency = Currencies; + type AccountIdToLocation = AccountIdToLocation; + type ParachainId = ParachainInfo; + type CurrencyIdConvert = AssetIdMaps; + type XcmRouter = XcmRouter; + type WeightInfo = weights::bifrost_xcm_interface::BifrostWeight; +} diff --git a/runtime/bifrost-polkadot/Cargo.toml b/runtime/bifrost-polkadot/Cargo.toml index dc4c4d9e4a..889675d232 100644 --- a/runtime/bifrost-polkadot/Cargo.toml +++ b/runtime/bifrost-polkadot/Cargo.toml @@ -174,6 +174,17 @@ bifrost-channel-commission = { workspace = true } bifrost-clouds-convert = { workspace = true } bifrost-vtoken-minting-rpc-runtime-api = { workspace = true } +# Hyperbridge +pallet-ismp = { workspace = true, features = ["unsigned"] } +pallet-ismp-runtime-api = { workspace = true } +ismp-parachain = { workspace = true } +ismp-parachain-runtime-api = { workspace = true } +sp-mmr-primitives = { workspace = true } +ismp = { workspace = true } +pallet-hyperbridge = { workspace = true } +pallet-token-gateway = { workspace = true } +anyhow = { workspace = true } + [build-dependencies] substrate-wasm-builder = { workspace = true, optional = true } @@ -314,7 +325,17 @@ std = [ "bifrost-vtoken-minting-rpc-runtime-api/std", "bifrost-parachain-staking/std", - "substrate-wasm-builder" + "substrate-wasm-builder", + + "pallet-ismp/std", + "pallet-ismp-runtime-api/std", + "ismp-parachain/std", + "ismp-parachain-runtime-api/std", + "sp-mmr-primitives/std", + "ismp/std", + "pallet-hyperbridge/std", + "pallet-token-gateway/std", + "anyhow/std", ] with-tracing = ["frame-executive/with-tracing"] @@ -436,6 +457,10 @@ try-runtime = [ "pallet-evm-chain-id/try-runtime", "pallet-dynamic-fee/try-runtime", "bifrost-parachain-staking/try-runtime", + "pallet-ismp/try-runtime", + "pallet-hyperbridge/try-runtime", + "pallet-token-gateway/try-runtime", + "ismp-parachain/try-runtime", ] # Enable the metadata hash generation in the wasm builder. @@ -455,6 +480,6 @@ on-chain-release-build = ["sp-api/disable-logging", "metadata-hash"] # Set timing constants (e.g. session period) to faster versions to speed up testing. fast-runtime = [] -# By default RuntimeDebug implements Debug that outputs when std is disabled. +# By default RuntimeDebug implements Debug that outputs when std is disabled. # This feature enables the detailed display of debug output. force-debug = ["sp-debug-derive/force-debug"] diff --git a/runtime/bifrost-polkadot/src/evm/runner.rs b/runtime/bifrost-polkadot/src/evm/runner.rs index 4c84772410..8e3987aa20 100644 --- a/runtime/bifrost-polkadot/src/evm/runner.rs +++ b/runtime/bifrost-polkadot/src/evm/runner.rs @@ -28,6 +28,7 @@ use bifrost_primitives::{ AccountFeeCurrency, AccountFeeCurrencyBalanceInCurrency, Balance, CurrencyId, OraclePriceProvider, }; +use core::ops::Mul; use fp_evm::{Account, TransactionValidationError}; use frame_support::traits::{ tokens::{Fortitude, Preservation}, @@ -121,11 +122,14 @@ where let account_id = T::AddressMapping::into_account_id(source); let account_nonce = frame_system::Pallet::::account_nonce(&account_id); - let (balance, b_weight) = - match B::get_balance_in_currency(evm_currency, &account_id, base_fee) { - Ok((balance, b_weight)) => (balance, b_weight), - Err(_) => (0, T::DbWeight::get().reads(2)), - }; + let (balance, b_weight) = match B::get_balance_in_currency( + evm_currency, + &account_id, + base_fee.mul(U256::from(gas_limit)), + ) { + Ok((balance, b_weight)) => (balance, b_weight), + Err(_) => (0, T::DbWeight::get().reads(2)), + }; let (source_account, inner_weight) = ( Account { diff --git a/runtime/bifrost-polkadot/src/hyperbridge.rs b/runtime/bifrost-polkadot/src/hyperbridge.rs new file mode 100644 index 0000000000..79d14fa5ef --- /dev/null +++ b/runtime/bifrost-polkadot/src/hyperbridge.rs @@ -0,0 +1,115 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +use crate::governance::TechAdminOrCouncil; +use crate::{Balances, Ismp, IsmpParachain, NativeCurrencyId, Runtime, RuntimeEvent, Timestamp}; +use crate::{BncDecimals, Currencies}; +use crate::{TokenGateway, Treasury}; +use bifrost_asset_registry::AssetIdMaps; +use bifrost_primitives::{AccountId, Balance}; +use frame_support::parameter_types; +use ismp::{host::StateMachine, module::IsmpModule, router::IsmpRouter}; +use sp_core::Get; +use sp_std::boxed::Box; +use sp_std::vec::Vec; + +impl pallet_hyperbridge::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + // pallet-ismp implements the IsmpHost + type IsmpHost = Ismp; +} + +parameter_types! { + // The hyperbridge parachain on Polkadot + pub const Coprocessor: Option = Some(StateMachine::Polkadot(3367)); + // The host state machine of this pallet, your state machine id goes here + pub const HostStateMachine: StateMachine = StateMachine::Polkadot(2030); // polkadot +} + +impl pallet_ismp::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + // Modify the consensus client's permissions, for example, TechAdmin + type AdminOrigin = TechAdminOrCouncil; + // The state machine identifier of the chain -- parachain id + type HostStateMachine = HostStateMachine; + type TimestampProvider = Timestamp; + // The router provides the implementation for the IsmpModule as the module id. + type Router = Router; + type Balance = Balance; + // The token used to collect fees, only stablecoins are supported + type Currency = Balances; + // Co-processor + type Coprocessor = Coprocessor; + // A tuple of types implementing the ConsensusClient interface, which defines all consensus algorithms supported by this protocol deployment + type ConsensusClients = (ismp_parachain::ParachainConsensusClient,); + type WeightProvider = (); + type OffchainDB = (); +} + +impl ismp_parachain::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + // pallet-ismp implements the IsmpHost + type IsmpHost = Ismp; +} + +#[derive(Default)] +pub struct Router; + +impl IsmpRouter for Router { + fn module_for_id(&self, id: Vec) -> Result, anyhow::Error> { + match id.as_slice() { + pallet_hyperbridge::PALLET_HYPERBRIDGE_ID => { + Ok(Box::new(pallet_hyperbridge::Pallet::::default())) + } + id if TokenGateway::is_token_gateway(&id) => { + Ok(Box::new(pallet_token_gateway::Pallet::::default())) + } + _ => Err(ismp::Error::ModuleNotFound(id))?, + } + } +} + +/// Should provide an account that is funded and can be used to pay for asset creation +pub struct AssetAdmin; +impl Get for AssetAdmin { + fn get() -> AccountId { + Treasury::account_id() + } +} + +impl pallet_token_gateway::Config for Runtime { + // configure the runtime event + type RuntimeEvent = RuntimeEvent; + // Configured as Pallet Ismp + type Dispatcher = Ismp; + // Configured as Pallet Assets + type Assets = Currencies; + // Configured as Pallet balances + type NativeCurrency = Balances; + // AssetAdmin account + type AssetAdmin = AssetAdmin; + // The Native asset Id + type NativeAssetId = NativeCurrencyId; + // A type that provides a function for creating unique asset ids + // A concrete implementation for your specific runtime is required + type AssetIdFactory = (); + // The precision of the native asset + type Decimals = BncDecimals; + type ControlOrigin = TechAdminOrCouncil; + type CurrencyIdConvert = AssetIdMaps; +} diff --git a/runtime/bifrost-polkadot/src/lib.rs b/runtime/bifrost-polkadot/src/lib.rs index 4f624df241..250aaab879 100644 --- a/runtime/bifrost-polkadot/src/lib.rs +++ b/runtime/bifrost-polkadot/src/lib.rs @@ -38,8 +38,9 @@ use bifrost_primitives::{ IncentivePalletId, IncentivePoolAccount, LendMarketPalletId, LiquidityAccount, LocalBncLocation, MerkleDirtributorPalletId, OraclePalletId, ParachainStakingPalletId, SlpEntrancePalletId, SlpExitPalletId, SystemMakerPalletId, SystemStakingPalletId, - TreasuryPalletId, BNC, DOT, VDOT, + TreasuryPalletId, BNC, BNC_DECIMALS, DOT, VDOT, }; +use cumulus_pallet_parachain_system::RelayChainState; use cumulus_pallet_parachain_system::{RelayNumberMonotonicallyIncreases, RelaychainDataProvider}; pub use frame_support::{ construct_runtime, match_types, parameter_types, @@ -57,6 +58,7 @@ pub use frame_support::{ PalletId, StorageValue, }; use frame_system::limits::{BlockLength, BlockWeights}; +use ismp::host::StateMachine; use orml_oracle::{DataFeeder, DataProvider, DataProviderExtended}; pub use pallet_balances::Call as BalancesCall; pub use pallet_timestamp::Call as TimestampCall; @@ -138,6 +140,8 @@ pub use xcm_config::{BifrostTreasuryAccount, MultiCurrency}; use xcm_executor::{traits::QueryHandler, XcmExecutor}; pub mod governance; +mod hyperbridge; + use crate::xcm_config::XcmRouter; use bifrost_primitives::OraclePriceProvider; use frame_support::weights::WeightToFee as _; @@ -145,6 +149,13 @@ use governance::{ custom_origins, CoreAdminOrCouncil, LiquidStaking, SALPAdmin, Spender, TechAdmin, TechAdminOrCouncil, }; +use ismp::{ + consensus::{ConsensusClientId, StateMachineHeight, StateMachineId}, + router::{Request, Response}, +}; +use pallet_ismp::offchain::Leaf; +use pallet_ismp::offchain::Proof; +use pallet_ismp::offchain::ProofKeys; use xcm::IntoVersion; use xcm_runtime_apis::{ dry_run::{CallDryRunEffects, Error as XcmDryRunApiError, XcmDryRunEffects}, @@ -188,7 +199,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("bifrost_polkadot"), impl_name: create_runtime_str!("bifrost_polkadot"), authoring_version: 0, - spec_version: 16001, + spec_version: 16002, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, @@ -244,6 +255,7 @@ parameter_types! { parameter_types! { pub const NativeCurrencyId: CurrencyId = BNC; + pub const BncDecimals: u8 = BNC_DECIMALS; pub const RelayCurrencyId: CurrencyId = DOT; pub const RelayVCurrencyId: CurrencyId = VDOT; pub SelfParaId: u32 = ParachainInfo::parachain_id().into(); @@ -968,6 +980,7 @@ impl bifrost_vesting::Config for Runtime { parameter_types! { pub MaxFeeCurrencyOrderListLen: u32 = 50; + pub AllowVBNCAsFee: bool = true; } impl bifrost_flexible_fee::Config for Runtime { @@ -989,6 +1002,7 @@ impl bifrost_flexible_fee::Config for Runtime { type InspectEvmAccounts = EVMAccounts; type EvmPermit = evm::permit::EvmPermitHandler; type AssetIdMaps = AssetIdMaps; + type AllowVBNCAsFee = AllowVBNCAsFee; } parameter_types! { @@ -1542,7 +1556,7 @@ impl lend_market::Config for Runtime { type OraclePriceProvider = Prices; type ReserveOrigin = TechAdminOrCouncil; type UpdateOrigin = TechAdminOrCouncil; - type WeightInfo = lend_market::weights::BifrostWeight; + type WeightInfo = weights::lend_market::BifrostWeight; type UnixTime = Timestamp; type Assets = Currencies; type RewardAssetId = NativeCurrencyId; @@ -1617,7 +1631,6 @@ impl bifrost_buy_back::Config for Runtime { type LiquidityAccount = LiquidityAccount; type ParachainId = ParachainInfo; type CurrencyIdRegister = AssetIdMaps; - type BbBNC = BbBNC; type BlockNumberProvider = System; } @@ -1809,6 +1822,12 @@ construct_runtime! { ZenlinkProtocol: zenlink_protocol = 80, MerkleDistributor: merkle_distributor = 81, + // Hyperbridge + Ismp: pallet_ismp = 90, + IsmpParachain: ismp_parachain = 91, + Hyperbridge: pallet_hyperbridge = 92, + TokenGateway: pallet_token_gateway = 94, + // Bifrost modules FlexibleFee: bifrost_flexible_fee = 100, Salp: bifrost_salp = 105, @@ -1926,6 +1945,7 @@ pub mod migrations { /// Unreleased migrations. Add new ones here: pub type Unreleased = ( + crate::migration::update_evm_min_gas_price::MigrateMinGasPrice, // permanent migration, do not remove pallet_xcm::migration::MigrateToLatestXcmVersion, ); @@ -2067,7 +2087,7 @@ impl_runtime_apis! { } } -impl fp_rpc::EthereumRuntimeRPCApi for Runtime { + impl fp_rpc::EthereumRuntimeRPCApi for Runtime { fn chain_id() -> u64 { ::ChainId::get() } @@ -2340,6 +2360,69 @@ impl fp_rpc::EthereumRuntimeRPCApi for Runtime { } } + impl pallet_ismp_runtime_api::IsmpRuntimeApi::Hash> for Runtime { + fn host_state_machine() -> StateMachine { + ::HostStateMachine::get() + } + + fn challenge_period(state_machine_id: StateMachineId) -> Option { + pallet_ismp::Pallet::::challenge_period(state_machine_id) + } + + /// Generate a proof for the provided leaf indices + fn generate_proof( + keys: ProofKeys + ) -> Result<(Vec, Proof<::Hash>), sp_mmr_primitives::Error> { + pallet_ismp::Pallet::::generate_proof(keys) + } + + /// Fetch all ISMP events in the block, should only be called from runtime-api. + fn block_events() -> Vec<::ismp::events::Event> { + pallet_ismp::Pallet::::block_events() + } + + /// Fetch all ISMP events and their extrinsic metadata, should only be called from runtime-api. + fn block_events_with_metadata() -> Vec<(::ismp::events::Event, Option)> { + pallet_ismp::Pallet::::block_events_with_metadata() + } + + /// Return the scale encoded consensus state + fn consensus_state(id: ConsensusClientId) -> Option> { + pallet_ismp::Pallet::::consensus_states(id) + } + + /// Return the timestamp this client was last updated in seconds + fn state_machine_update_time(height: StateMachineHeight) -> Option { + pallet_ismp::Pallet::::state_machine_update_time(height) + } + + /// Return the latest height of the state machine + fn latest_state_machine_height(id: StateMachineId) -> Option { + pallet_ismp::Pallet::::latest_state_machine_height(id) + } + + + /// Get actual requests + fn requests(commitments: Vec) -> Vec { + pallet_ismp::Pallet::::requests(commitments) + } + + /// Get actual requests + fn responses(commitments: Vec) -> Vec { + pallet_ismp::Pallet::::responses(commitments) + } + } + + impl ismp_parachain_runtime_api::IsmpParachainApi for Runtime { + fn para_ids() -> Vec { + IsmpParachain::para_ids() + } + + fn current_relay_chain_state() -> RelayChainState { + IsmpParachain::current_relay_chain_state() + } + } + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi< Block, Balance, diff --git a/runtime/bifrost-polkadot/src/migration.rs b/runtime/bifrost-polkadot/src/migration.rs index a3aa396a28..e610109bb1 100644 --- a/runtime/bifrost-polkadot/src/migration.rs +++ b/runtime/bifrost-polkadot/src/migration.rs @@ -463,3 +463,20 @@ pub mod genesis_evm_storage { } } } + +pub mod update_evm_min_gas_price { + use crate::{Runtime, Weight}; + use frame_support::traits::OnRuntimeUpgrade; + use pallet_dynamic_fee::MinGasPrice; + use primitive_types::U256; + + pub struct MigrateMinGasPrice; + + impl OnRuntimeUpgrade for MigrateMinGasPrice { + fn on_runtime_upgrade() -> Weight { + let min_gas_fee: U256 = U256::from(83102775u64); + MinGasPrice::::put(min_gas_fee); + ::DbWeight::get().reads_writes(0, 2) + } + } +} diff --git a/runtime/bifrost-polkadot/src/weights/lend_market.rs b/runtime/bifrost-polkadot/src/weights/lend_market.rs new file mode 100644 index 0000000000..321e7bf686 --- /dev/null +++ b/runtime/bifrost-polkadot/src/weights/lend_market.rs @@ -0,0 +1,570 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for lend_market +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 42.0.1 +//! DATE: 2025-01-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `mjl-legion`, CPU: `12th Gen Intel(R) Core(TM) i9-12900H` +//! WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 + +// Executed Command: +// target/release/bifrost +// benchmark +// pallet +// --chain=bifrost-kusama-local +// --steps=50 +// --repeat=20 +// --pallet=lend-market +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./pallets/lend-market/src/weights.rs +// --template=./weight-template/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; + +/// Weight functions for lend_market. +pub struct BifrostWeight(PhantomData); +impl lend_market::WeightInfo for BifrostWeight { + // Storage: `LendMarket::Markets` (r:2 w:1) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::UnderlyingAssetId` (r:1 w:1) + // Proof: `LendMarket::UnderlyingAssetId` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::ExchangeRate` (r:0 w:1) + // Proof: `LendMarket::ExchangeRate` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::BorrowIndex` (r:0 w:1) + // Proof: `LendMarket::BorrowIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn add_market() -> Weight { + // Proof Size summary in bytes: + // Measured: `76` + // Estimated: `6016` + // Minimum execution time: 13_026 nanoseconds. + Weight::from_parts(13_543_000, 6016) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(4)) + } + // Storage: `LendMarket::Markets` (r:1 w:1) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn activate_market() -> Weight { + // Proof Size summary in bytes: + // Measured: `346` + // Estimated: `3811` + // Minimum execution time: 8_486 nanoseconds. + Weight::from_parts(9_258_000, 3811) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: `LendMarket::Markets` (r:1 w:1) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn update_rate_model() -> Weight { + // Proof Size summary in bytes: + // Measured: `346` + // Estimated: `3811` + // Minimum execution time: 8_533 nanoseconds. + Weight::from_parts(8_844_000, 3811) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: `LendMarket::Markets` (r:1 w:1) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn update_market() -> Weight { + // Proof Size summary in bytes: + // Measured: `346` + // Estimated: `3811` + // Minimum execution time: 9_544 nanoseconds. + Weight::from_parts(10_721_000, 3811) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: `LendMarket::UnderlyingAssetId` (r:1 w:1) + // Proof: `LendMarket::UnderlyingAssetId` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::Markets` (r:1 w:1) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn force_update_market() -> Weight { + // Proof Size summary in bytes: + // Measured: `354` + // Estimated: `3819` + // Minimum execution time: 13_230 nanoseconds. + Weight::from_parts(14_290_000, 3819) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: `System::Account` (r:2 w:2) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + fn add_reward() -> Weight { + // Proof Size summary in bytes: + // Measured: `103` + // Estimated: `6196` + // Minimum execution time: 30_538 nanoseconds. + Weight::from_parts(33_408_000, 6196) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: `System::Account` (r:2 w:2) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + fn withdraw_missing_reward() -> Weight { + // Proof Size summary in bytes: + // Measured: `206` + // Estimated: `6196` + // Minimum execution time: 28_814 nanoseconds. + Weight::from_parts(31_409_000, 6196) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + // Storage: `LendMarket::Markets` (r:2 w:0) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplySpeed` (r:1 w:1) + // Proof: `LendMarket::RewardSupplySpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowSpeed` (r:1 w:1) + // Proof: `LendMarket::RewardBorrowSpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplyState` (r:1 w:1) + // Proof: `LendMarket::RewardSupplyState` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowState` (r:1 w:1) + // Proof: `LendMarket::RewardBorrowState` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn update_market_reward_speed() -> Weight { + // Proof Size summary in bytes: + // Measured: `354` + // Estimated: `6294` + // Minimum execution time: 20_639 nanoseconds. + Weight::from_parts(22_334_000, 6294) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(4)) + } + // Storage: `LendMarket::Markets` (r:2 w:0) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplyState` (r:1 w:1) + // Proof: `LendMarket::RewardSupplyState` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplySpeed` (r:1 w:0) + // Proof: `LendMarket::RewardSupplySpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplierIndex` (r:1 w:1) + // Proof: `LendMarket::RewardSupplierIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardAccured` (r:1 w:1) + // Proof: `LendMarket::RewardAccured` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountDeposits` (r:1 w:0) + // Proof: `LendMarket::AccountDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowState` (r:1 w:1) + // Proof: `LendMarket::RewardBorrowState` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowSpeed` (r:1 w:0) + // Proof: `LendMarket::RewardBorrowSpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowerIndex` (r:1 w:1) + // Proof: `LendMarket::RewardBorrowerIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountBorrows` (r:1 w:0) + // Proof: `LendMarket::AccountBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::BorrowIndex` (r:1 w:0) + // Proof: `LendMarket::BorrowIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn claim_reward() -> Weight { + // Proof Size summary in bytes: + // Measured: `376` + // Estimated: `6316` + // Minimum execution time: 37_371 nanoseconds. + Weight::from_parts(39_770_000, 6316) + .saturating_add(T::DbWeight::get().reads(12)) + .saturating_add(T::DbWeight::get().writes(5)) + } + // Storage: `LendMarket::RewardSupplyState` (r:1 w:1) + // Proof: `LendMarket::RewardSupplyState` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplySpeed` (r:1 w:0) + // Proof: `LendMarket::RewardSupplySpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::TotalSupply` (r:1 w:0) + // Proof: `LendMarket::TotalSupply` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplierIndex` (r:1 w:1) + // Proof: `LendMarket::RewardSupplierIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardAccured` (r:1 w:1) + // Proof: `LendMarket::RewardAccured` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountDeposits` (r:1 w:0) + // Proof: `LendMarket::AccountDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowState` (r:1 w:1) + // Proof: `LendMarket::RewardBorrowState` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowSpeed` (r:1 w:0) + // Proof: `LendMarket::RewardBorrowSpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::TotalBorrows` (r:1 w:0) + // Proof: `LendMarket::TotalBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::BorrowIndex` (r:1 w:0) + // Proof: `LendMarket::BorrowIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowerIndex` (r:1 w:1) + // Proof: `LendMarket::RewardBorrowerIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountBorrows` (r:1 w:0) + // Proof: `LendMarket::AccountBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `System::Account` (r:2 w:2) + // 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: `1102` + // Estimated: `6196` + // Minimum execution time: 74_938 nanoseconds. + Weight::from_parts(79_615_000, 6196) + .saturating_add(T::DbWeight::get().reads(14)) + .saturating_add(T::DbWeight::get().writes(7)) + } + // Storage: `LendMarket::Markets` (r:2 w:0) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Tokens::Accounts` (r:2 w:2) + // Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(118), added: 2593, 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: `LendMarket::LastAccruedInterestTime` (r:1 w:1) + // Proof: `LendMarket::LastAccruedInterestTime` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplyState` (r:1 w:1) + // Proof: `LendMarket::RewardSupplyState` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplySpeed` (r:1 w:0) + // Proof: `LendMarket::RewardSupplySpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplierIndex` (r:1 w:1) + // Proof: `LendMarket::RewardSupplierIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardAccured` (r:1 w:1) + // Proof: `LendMarket::RewardAccured` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountDeposits` (r:1 w:1) + // Proof: `LendMarket::AccountDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::TotalSupply` (r:1 w:1) + // Proof: `LendMarket::TotalSupply` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `System::Account` (r:1 w:1) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Storage: `LendMarket::TotalBorrows` (r:1 w:0) + // Proof: `LendMarket::TotalBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::TotalReserves` (r:1 w:0) + // Proof: `LendMarket::TotalReserves` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountEarned` (r:1 w:1) + // Proof: `LendMarket::AccountEarned` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `AssetRegistry::CurrencyMetadatas` (r:1 w:0) + // Proof: `AssetRegistry::CurrencyMetadatas` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn mint() -> Weight { + // Proof Size summary in bytes: + // Measured: `1010` + // Estimated: `6950` + // Minimum execution time: 69_957 nanoseconds. + Weight::from_parts(77_602_000, 6950) + .saturating_add(T::DbWeight::get().reads(17)) + .saturating_add(T::DbWeight::get().writes(10)) + } + // Storage: `LendMarket::Markets` (r:2 w:0) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Timestamp::Now` (r:1 w:0) + // Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + // Storage: `LendMarket::LastAccruedInterestTime` (r:1 w:1) + // Proof: `LendMarket::LastAccruedInterestTime` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::TotalBorrows` (r:1 w:1) + // Proof: `LendMarket::TotalBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Tokens::Accounts` (r:2 w:2) + // Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(118), added: 2593, mode: `MaxEncodedLen`) + // Storage: `System::Account` (r:1 w:0) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Storage: `LendMarket::TotalReserves` (r:1 w:0) + // Proof: `LendMarket::TotalReserves` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Prices::EmergencyPrice` (r:1 w:0) + // Proof: `Prices::EmergencyPrice` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `AssetRegistry::CurrencyMetadatas` (r:1 w:0) + // Proof: `AssetRegistry::CurrencyMetadatas` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::MarketBond` (r:1 w:0) + // Proof: `LendMarket::MarketBond` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountBorrows` (r:1 w:1) + // Proof: `LendMarket::AccountBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountDeposits` (r:1 w:0) + // Proof: `LendMarket::AccountDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::TotalSupply` (r:1 w:0) + // Proof: `LendMarket::TotalSupply` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::LiquidationFreeCollaterals` (r:1 w:0) + // Proof: `LendMarket::LiquidationFreeCollaterals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowState` (r:1 w:1) + // Proof: `LendMarket::RewardBorrowState` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowSpeed` (r:1 w:0) + // Proof: `LendMarket::RewardBorrowSpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowerIndex` (r:1 w:1) + // Proof: `LendMarket::RewardBorrowerIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardAccured` (r:1 w:1) + // Proof: `LendMarket::RewardAccured` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::BorrowIndex` (r:1 w:0) + // Proof: `LendMarket::BorrowIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn borrow() -> Weight { + // Proof Size summary in bytes: + // Measured: `1927` + // Estimated: `7867` + // Minimum execution time: 131_552 nanoseconds. + Weight::from_parts(143_114_000, 7867) + .saturating_add(T::DbWeight::get().reads(21)) + .saturating_add(T::DbWeight::get().writes(8)) + } + // Storage: `LendMarket::Markets` (r:2 w:0) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Timestamp::Now` (r:1 w:0) + // Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + // Storage: `LendMarket::LastAccruedInterestTime` (r:1 w:1) + // Proof: `LendMarket::LastAccruedInterestTime` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::TotalSupply` (r:1 w:1) + // Proof: `LendMarket::TotalSupply` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Tokens::Accounts` (r:3 w:3) + // Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(118), added: 2593, mode: `MaxEncodedLen`) + // Storage: `System::Account` (r:2 w:2) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Storage: `LendMarket::TotalBorrows` (r:1 w:0) + // Proof: `LendMarket::TotalBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::TotalReserves` (r:1 w:0) + // Proof: `LendMarket::TotalReserves` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountDeposits` (r:1 w:1) + // Proof: `LendMarket::AccountDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountEarned` (r:1 w:1) + // Proof: `LendMarket::AccountEarned` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplyState` (r:1 w:1) + // Proof: `LendMarket::RewardSupplyState` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplySpeed` (r:1 w:0) + // Proof: `LendMarket::RewardSupplySpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplierIndex` (r:1 w:1) + // Proof: `LendMarket::RewardSupplierIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardAccured` (r:1 w:1) + // Proof: `LendMarket::RewardAccured` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `AssetRegistry::CurrencyMetadatas` (r:1 w:0) + // Proof: `AssetRegistry::CurrencyMetadatas` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn redeem() -> Weight { + // Proof Size summary in bytes: + // Measured: `1890` + // Estimated: `8769` + // Minimum execution time: 116_287 nanoseconds. + Weight::from_parts(128_202_000, 8769) + .saturating_add(T::DbWeight::get().reads(19)) + .saturating_add(T::DbWeight::get().writes(12)) + } + // Storage: `LendMarket::Markets` (r:2 w:0) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Timestamp::Now` (r:1 w:0) + // Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + // Storage: `LendMarket::LastAccruedInterestTime` (r:1 w:1) + // Proof: `LendMarket::LastAccruedInterestTime` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::TotalSupply` (r:1 w:1) + // Proof: `LendMarket::TotalSupply` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Tokens::Accounts` (r:2 w:2) + // Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(118), added: 2593, mode: `MaxEncodedLen`) + // Storage: `System::Account` (r:1 w:1) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Storage: `LendMarket::TotalBorrows` (r:1 w:0) + // Proof: `LendMarket::TotalBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::TotalReserves` (r:1 w:0) + // Proof: `LendMarket::TotalReserves` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountDeposits` (r:1 w:1) + // Proof: `LendMarket::AccountDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountEarned` (r:1 w:1) + // Proof: `LendMarket::AccountEarned` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplyState` (r:1 w:1) + // Proof: `LendMarket::RewardSupplyState` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplySpeed` (r:1 w:0) + // Proof: `LendMarket::RewardSupplySpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplierIndex` (r:1 w:1) + // Proof: `LendMarket::RewardSupplierIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardAccured` (r:1 w:1) + // Proof: `LendMarket::RewardAccured` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `AssetRegistry::CurrencyMetadatas` (r:1 w:0) + // Proof: `AssetRegistry::CurrencyMetadatas` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn redeem_all() -> Weight { + // Proof Size summary in bytes: + // Measured: `1787` + // Estimated: `7727` + // Minimum execution time: 94_336 nanoseconds. + Weight::from_parts(96_915_000, 7727) + .saturating_add(T::DbWeight::get().reads(17)) + .saturating_add(T::DbWeight::get().writes(10)) + } + // Storage: `LendMarket::Markets` (r:2 w:0) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Timestamp::Now` (r:1 w:0) + // Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + // Storage: `LendMarket::LastAccruedInterestTime` (r:1 w:1) + // Proof: `LendMarket::LastAccruedInterestTime` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountBorrows` (r:1 w:1) + // Proof: `LendMarket::AccountBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::BorrowIndex` (r:1 w:0) + // Proof: `LendMarket::BorrowIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowState` (r:1 w:1) + // Proof: `LendMarket::RewardBorrowState` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowSpeed` (r:1 w:0) + // Proof: `LendMarket::RewardBorrowSpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowerIndex` (r:1 w:1) + // Proof: `LendMarket::RewardBorrowerIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardAccured` (r:1 w:1) + // Proof: `LendMarket::RewardAccured` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Tokens::Accounts` (r:2 w:2) + // Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(118), added: 2593, mode: `MaxEncodedLen`) + // Storage: `AssetRegistry::CurrencyMetadatas` (r:1 w:0) + // Proof: `AssetRegistry::CurrencyMetadatas` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::TotalBorrows` (r:1 w:1) + // Proof: `LendMarket::TotalBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn repay_borrow() -> Weight { + // Proof Size summary in bytes: + // Measured: `1788` + // Estimated: `7728` + // Minimum execution time: 69_861 nanoseconds. + Weight::from_parts(73_341_000, 7728) + .saturating_add(T::DbWeight::get().reads(14)) + .saturating_add(T::DbWeight::get().writes(8)) + } + // Storage: `LendMarket::Markets` (r:2 w:0) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Timestamp::Now` (r:1 w:0) + // Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + // Storage: `LendMarket::LastAccruedInterestTime` (r:1 w:1) + // Proof: `LendMarket::LastAccruedInterestTime` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountBorrows` (r:1 w:1) + // Proof: `LendMarket::AccountBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::BorrowIndex` (r:1 w:0) + // Proof: `LendMarket::BorrowIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowState` (r:1 w:1) + // Proof: `LendMarket::RewardBorrowState` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowSpeed` (r:1 w:0) + // Proof: `LendMarket::RewardBorrowSpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowerIndex` (r:1 w:1) + // Proof: `LendMarket::RewardBorrowerIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardAccured` (r:1 w:1) + // Proof: `LendMarket::RewardAccured` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Tokens::Accounts` (r:2 w:2) + // Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(118), added: 2593, mode: `MaxEncodedLen`) + // Storage: `AssetRegistry::CurrencyMetadatas` (r:1 w:0) + // Proof: `AssetRegistry::CurrencyMetadatas` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::TotalBorrows` (r:1 w:1) + // Proof: `LendMarket::TotalBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn repay_borrow_all() -> Weight { + // Proof Size summary in bytes: + // Measured: `1788` + // Estimated: `7728` + // Minimum execution time: 77_216 nanoseconds. + Weight::from_parts(81_489_000, 7728) + .saturating_add(T::DbWeight::get().reads(14)) + .saturating_add(T::DbWeight::get().writes(8)) + } + // Storage: `LendMarket::Markets` (r:2 w:0) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountDeposits` (r:1 w:1) + // Proof: `LendMarket::AccountDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn collateral_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `529` + // Estimated: `6469` + // Minimum execution time: 21_883 nanoseconds. + Weight::from_parts(24_523_000, 6469) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(1)) + } + // Storage: `LendMarket::LiquidationFreeCollaterals` (r:1 w:0) + // Proof: `LendMarket::LiquidationFreeCollaterals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `Timestamp::Now` (r:1 w:0) + // Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + // Storage: `LendMarket::LastAccruedInterestTime` (r:2 w:2) + // Proof: `LendMarket::LastAccruedInterestTime` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::Markets` (r:3 w:0) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountBorrows` (r:3 w:1) + // Proof: `LendMarket::AccountBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::BorrowIndex` (r:1 w:0) + // Proof: `LendMarket::BorrowIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Prices::EmergencyPrice` (r:2 w:0) + // Proof: `Prices::EmergencyPrice` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `AssetRegistry::CurrencyMetadatas` (r:2 w:0) + // Proof: `AssetRegistry::CurrencyMetadatas` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::AccountDeposits` (r:4 w:3) + // Proof: `LendMarket::AccountDeposits` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::TotalSupply` (r:1 w:0) + // Proof: `LendMarket::TotalSupply` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Tokens::Accounts` (r:3 w:2) + // Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(118), added: 2593, mode: `MaxEncodedLen`) + // Storage: `System::Account` (r:2 w:0) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Storage: `LendMarket::TotalBorrows` (r:2 w:1) + // Proof: `LendMarket::TotalBorrows` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::TotalReserves` (r:1 w:0) + // Proof: `LendMarket::TotalReserves` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowState` (r:1 w:1) + // Proof: `LendMarket::RewardBorrowState` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowSpeed` (r:1 w:0) + // Proof: `LendMarket::RewardBorrowSpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardBorrowerIndex` (r:1 w:1) + // Proof: `LendMarket::RewardBorrowerIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardAccured` (r:3 w:3) + // Proof: `LendMarket::RewardAccured` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplyState` (r:1 w:1) + // Proof: `LendMarket::RewardSupplyState` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplySpeed` (r:1 w:0) + // Proof: `LendMarket::RewardSupplySpeed` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::RewardSupplierIndex` (r:3 w:3) + // Proof: `LendMarket::RewardSupplierIndex` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn liquidate_borrow() -> Weight { + // Proof Size summary in bytes: + // Measured: `2910` + // Estimated: `13800` + // Minimum execution time: 208_693 nanoseconds. + Weight::from_parts(218_121_000, 13800) + .saturating_add(T::DbWeight::get().reads(39)) + .saturating_add(T::DbWeight::get().writes(18)) + } + // Storage: `LendMarket::Markets` (r:2 w:0) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Tokens::Accounts` (r:2 w:2) + // Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(118), added: 2593, mode: `MaxEncodedLen`) + // Storage: `AssetRegistry::CurrencyMetadatas` (r:1 w:0) + // Proof: `AssetRegistry::CurrencyMetadatas` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `System::Account` (r:1 w:1) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + // Storage: `LendMarket::TotalReserves` (r:1 w:1) + // Proof: `LendMarket::TotalReserves` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn add_reserves() -> Weight { + // Proof Size summary in bytes: + // Measured: `938` + // Estimated: `6878` + // Minimum execution time: 36_687 nanoseconds. + Weight::from_parts(37_948_000, 6878) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(4)) + } + // Storage: `LendMarket::Markets` (r:2 w:0) + // Proof: `LendMarket::Markets` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `LendMarket::TotalReserves` (r:1 w:1) + // Proof: `LendMarket::TotalReserves` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `Tokens::Accounts` (r:2 w:2) + // Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(118), added: 2593, mode: `MaxEncodedLen`) + // Storage: `AssetRegistry::CurrencyMetadatas` (r:1 w:0) + // Proof: `AssetRegistry::CurrencyMetadatas` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `System::Account` (r:1 w:0) + // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + fn reduce_reserves() -> Weight { + // Proof Size summary in bytes: + // Measured: `1214` + // Estimated: `7154` + // Minimum execution time: 36_510 nanoseconds. + Weight::from_parts(41_064_000, 7154) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) + } + // Storage: `LendMarket::LiquidationFreeCollaterals` (r:1 w:1) + // Proof: `LendMarket::LiquidationFreeCollaterals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn update_liquidation_free_collateral() -> Weight { + // Proof Size summary in bytes: + // Measured: `76` + // Estimated: `1561` + // Minimum execution time: 6_120 nanoseconds. + Weight::from_parts(6_715_000, 1561) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } +} diff --git a/runtime/bifrost-polkadot/src/weights/mod.rs b/runtime/bifrost-polkadot/src/weights/mod.rs index 812a4fb6c3..ee1d410d49 100644 --- a/runtime/bifrost-polkadot/src/weights/mod.rs +++ b/runtime/bifrost-polkadot/src/weights/mod.rs @@ -41,6 +41,7 @@ pub mod bifrost_vstoken_conversion; pub mod bifrost_vtoken_minting; pub mod bifrost_vtoken_voting; pub mod bifrost_xcm_interface; +pub mod lend_market; pub mod orml_oracle; pub mod orml_tokens; pub mod pallet_xcm; diff --git a/runtime/bifrost-polkadot/src/xcm_config.rs b/runtime/bifrost-polkadot/src/xcm_config.rs index a21cd93cd1..853885d280 100644 --- a/runtime/bifrost-polkadot/src/xcm_config.rs +++ b/runtime/bifrost-polkadot/src/xcm_config.rs @@ -50,7 +50,7 @@ pub use xcm_builder::{ }; use xcm_builder::{ DescribeAllTerminal, DescribeFamily, FrameTransactionalProcessor, HashedDescription, - TrailingSetTopicAsId, WithComputedOrigin, + TrailingSetTopicAsId, WithComputedOrigin, WithUniqueTopic, }; parameter_types! { @@ -289,12 +289,12 @@ pub type LocalOriginToLocation = SignedToAccountId32, // ..and XCMP to communicate with the sibling chains. XcmpQueue, -); +)>; #[cfg(feature = "runtime-benchmarks")] parameter_types! {