Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into fix/xcm-fee-return
Browse files Browse the repository at this point in the history
* origin/master:
  Xcm trap assets ed (#1654)
  re-benchmarked the homa-lite module (#1638)

# Conflicts:
#	runtime/integration-tests/src/relaychain/kusama_cross_chain_transfer.rs
  • Loading branch information
Roy Yang committed Dec 1, 2021
2 parents dda7edf + 9a27cfd commit 3b4d0bf
Show file tree
Hide file tree
Showing 13 changed files with 413 additions and 129 deletions.
3 changes: 3 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

74 changes: 37 additions & 37 deletions modules/homa-lite/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
//! Autogenerated weights for module_homa_lite
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2021-11-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2021-11-24, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("karura-dev"), DB CACHE: 128

// Executed Command:
Expand Down Expand Up @@ -77,29 +77,29 @@ impl<T: frame_system::Config> WeightInfo for AcalaWeight<T> {
.saturating_add(T::DbWeight::get().reads(1 as Weight))
}
fn mint() -> Weight {
(139_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(17 as Weight))
.saturating_add(T::DbWeight::get().writes(8 as Weight))
(130_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(19 as Weight))
.saturating_add(T::DbWeight::get().writes(9 as Weight))
}
fn mint_for_requests() -> Weight {
(145_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(19 as Weight))
.saturating_add(T::DbWeight::get().writes(8 as Weight))
(139_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(21 as Weight))
.saturating_add(T::DbWeight::get().writes(9 as Weight))
}
fn set_total_staking_currency() -> Weight {
(12_000_000 as Weight)
(11_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn adjust_total_staking_currency() -> Weight {
(12_000_000 as Weight)
(11_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn adjust_available_staking_balance_with_no_matches() -> Weight {
(11_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
(18_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn set_minting_cap() -> Weight {
(10_000_000 as Weight)
Expand All @@ -110,9 +110,9 @@ impl<T: frame_system::Config> WeightInfo for AcalaWeight<T> {
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn request_redeem() -> Weight {
(73_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(7 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
(32_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn schedule_unbond() -> Weight {
(12_000_000 as Weight)
Expand All @@ -124,16 +124,16 @@ impl<T: frame_system::Config> WeightInfo for AcalaWeight<T> {
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn set_staking_interest_rate_per_update() -> Weight {
(10_000_000 as Weight)
(9_000_000 as Weight)
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn redeem_with_available_staking_balance() -> Weight {
(8_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(3 as Weight))
(5_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn xcm_unbond() -> Weight {
(32_000_000 as Weight)
(30_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(8 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
Expand All @@ -151,29 +151,29 @@ impl WeightInfo for () {
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
}
fn mint() -> Weight {
(139_000_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(17 as Weight))
.saturating_add(RocksDbWeight::get().writes(8 as Weight))
(130_000_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(19 as Weight))
.saturating_add(RocksDbWeight::get().writes(9 as Weight))
}
fn mint_for_requests() -> Weight {
(145_000_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(19 as Weight))
.saturating_add(RocksDbWeight::get().writes(8 as Weight))
(139_000_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(21 as Weight))
.saturating_add(RocksDbWeight::get().writes(9 as Weight))
}
fn set_total_staking_currency() -> Weight {
(12_000_000 as Weight)
(11_000_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
fn adjust_total_staking_currency() -> Weight {
(12_000_000 as Weight)
(11_000_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
fn adjust_available_staking_balance_with_no_matches() -> Weight {
(11_000_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
(18_000_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(4 as Weight))
.saturating_add(RocksDbWeight::get().writes(2 as Weight))
}
fn set_minting_cap() -> Weight {
(10_000_000 as Weight)
Expand All @@ -184,9 +184,9 @@ impl WeightInfo for () {
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
fn request_redeem() -> Weight {
(73_000_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(7 as Weight))
.saturating_add(RocksDbWeight::get().writes(4 as Weight))
(32_000_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(4 as Weight))
.saturating_add(RocksDbWeight::get().writes(3 as Weight))
}
fn schedule_unbond() -> Weight {
(12_000_000 as Weight)
Expand All @@ -198,16 +198,16 @@ impl WeightInfo for () {
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
fn set_staking_interest_rate_per_update() -> Weight {
(10_000_000 as Weight)
(9_000_000 as Weight)
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
fn redeem_with_available_staking_balance() -> Weight {
(8_000_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(3 as Weight))
(5_000_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(2 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
fn xcm_unbond() -> Weight {
(32_000_000 as Weight)
(30_000_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(8 as Weight))
.saturating_add(RocksDbWeight::get().writes(3 as Weight))
}
Expand Down
10 changes: 9 additions & 1 deletion runtime/acala/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ pub use primitives::{
AuctionId, AuthoritysOriginId, Balance, BlockNumber, CurrencyId, DataProviderId, EraIndex, Hash, Moment, Nonce,
ReserveIdentifier, Share, Signature, TokenSymbol, TradingPair,
};
use runtime_common::AcalaDropAssets;
pub use runtime_common::{
cent, dollar, microcent, millicent, EnsureRootOrAllGeneralCouncil, EnsureRootOrAllTechnicalCommittee,
EnsureRootOrHalfFinancialCouncil, EnsureRootOrHalfGeneralCouncil, EnsureRootOrHalfHomaCouncil,
Expand Down Expand Up @@ -1452,7 +1453,14 @@ impl xcm_executor::Config for XcmConfig {
type Weigher = FixedWeightBounds<UnitWeightCost, Call, MaxInstructions>;
type Trader = Trader;
type ResponseHandler = PolkadotXcm;
type AssetTrap = PolkadotXcm;
type AssetTrap = AcalaDropAssets<
PolkadotXcm,
ToTreasury,
CurrencyIdConvert,
GetNativeCurrencyId,
NativeTokenExistentialDeposit,
ExistentialDeposits,
>;
type AssetClaims = PolkadotXcm;
type SubscriptionService = PolkadotXcm;
}
Expand Down
38 changes: 19 additions & 19 deletions runtime/acala/src/weights/module_homa_lite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
//! Autogenerated weights for module_homa_lite
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2021-11-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2021-11-24, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("acala-dev"), DB CACHE: 128

// Executed Command:
Expand Down Expand Up @@ -48,7 +48,7 @@ use sp_std::marker::PhantomData;
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> module_homa_lite::WeightInfo for WeightInfo<T> {
fn on_initialize() -> Weight {
(12_000_000 as Weight)
(13_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
Expand All @@ -57,14 +57,14 @@ impl<T: frame_system::Config> module_homa_lite::WeightInfo for WeightInfo<T> {
.saturating_add(T::DbWeight::get().reads(1 as Weight))
}
fn mint() -> Weight {
(136_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(17 as Weight))
.saturating_add(T::DbWeight::get().writes(8 as Weight))
(129_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(19 as Weight))
.saturating_add(T::DbWeight::get().writes(9 as Weight))
}
fn mint_for_requests() -> Weight {
(325_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(33 as Weight))
.saturating_add(T::DbWeight::get().writes(22 as Weight))
(330_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(35 as Weight))
.saturating_add(T::DbWeight::get().writes(23 as Weight))
}
fn set_total_staking_currency() -> Weight {
(11_000_000 as Weight)
Expand All @@ -77,25 +77,25 @@ impl<T: frame_system::Config> module_homa_lite::WeightInfo for WeightInfo<T> {
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn adjust_available_staking_balance_with_no_matches() -> Weight {
(11_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
(18_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn set_minting_cap() -> Weight {
(10_000_000 as Weight)
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn set_xcm_dest_weight() -> Weight {
(10_000_000 as Weight)
(9_000_000 as Weight)
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn request_redeem() -> Weight {
(73_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(7 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
(32_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn schedule_unbond() -> Weight {
(12_000_000 as Weight)
(11_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
Expand All @@ -108,12 +108,12 @@ impl<T: frame_system::Config> module_homa_lite::WeightInfo for WeightInfo<T> {
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn redeem_with_available_staking_balance() -> Weight {
(7_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(3 as Weight))
(5_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn xcm_unbond() -> Weight {
(32_000_000 as Weight)
(30_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(8 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
Expand Down
8 changes: 8 additions & 0 deletions runtime/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ module-transaction-payment = { path = "../../modules/transaction-payment", defau
module-nft = { path = "../../modules/nft", default-features = false }
module-dex = { path = "../../modules/dex", default-features = false }

xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.12", default-features = false }
xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.12", default-features = false }
xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.12", default-features = false }

[dev-dependencies]
serde_json = "1.0.64"
hex-literal = "0.3.1"
Expand Down Expand Up @@ -87,6 +91,10 @@ std = [
"module-transaction-payment/std",
"module-nft/std",
"module-dex/std",

"xcm/std",
"xcm-executor/std",
"xcm-builder/std",
]
with-ethereum-compatibility = [
"module-evm/with-ethereum-compatibility",
Expand Down
Loading

0 comments on commit 3b4d0bf

Please sign in to comment.