Skip to content

Commit

Permalink
Fixes for polkadot-sdk 1.3.0 crates (#165)
Browse files Browse the repository at this point in the history
<!-- Remember that you can run `/merge` to enable auto-merge in the PR
-->

# Changes

- Updated the version for `staging-xcm-executor` to include a fix for
XCM delivery fees on Kusama. Also, transactional processing.
- Fixes for pallet-nomination-pools
- Other crates needed for XCM transactional processing were bumped. Also
added the `FrameTransactionalProcessing` config item to all runtimes

# Dependency updates

- staging-xcm-executor
- pallet-nomination-pools
- cumulus-primitives-utility
- staging-xcm-builder
- pallet-xcm-benchmarks
- penpal-runtime

<!-- Remember to modify the changelog. If you don't need to modify it,
you can check the following box.
Instead, if you have already modified it, simply delete the following
line. -->

- [x] Does not require a CHANGELOG entry

---------

Co-authored-by: Oliver Tale-Yazdi <[email protected]>
  • Loading branch information
franciscoaguirre and ggwpez authored Jan 30, 2024
1 parent 1f5dc6f commit ecd1687
Show file tree
Hide file tree
Showing 26 changed files with 113 additions and 59 deletions.
24 changes: 12 additions & 12 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion integration-tests/emulated/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ cumulus-pallet-xcmp-queue = { version = "0.4.0" }
cumulus-pallet-parachain-system = { features = ["parameterized-consensus-hook",] , version = "0.4.0" }
asset-test-utils = { version = "4.0.0" }
cumulus-pallet-dmp-queue = { version = "0.4.0" }
penpal-runtime = { version = "0.11.0" }
penpal-runtime = { version = "0.11.1" }

# Local runtimes
kusama-runtime = { package = "staging-kusama-runtime", path = "../../../relay/kusama" }
Expand Down
4 changes: 2 additions & 2 deletions relay/kusama/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ pallet-membership = { default-features = false , version = "25.0.0" }
pallet-message-queue = { default-features = false , version = "28.0.0" }
pallet-mmr = { default-features = false , version = "24.0.0" }
pallet-multisig = { default-features = false , version = "25.0.0" }
pallet-nomination-pools = { default-features = false , version = "22.0.0" }
pallet-nomination-pools = { default-features = false , version = "22.0.2" }
pallet-offences = { default-features = false , version = "24.0.0" }
pallet-preimage = { default-features = false , version = "25.0.0" }
pallet-proxy = { default-features = false , version = "25.0.0" }
Expand Down Expand Up @@ -112,7 +112,7 @@ runtime-parachains = { package = "polkadot-runtime-parachains", default-features
primitives = { package = "polkadot-primitives", default-features = false , version = "4.0.0" }

xcm = { package = "staging-xcm", default-features = false , version = "4.0.0" }
xcm-executor = { package = "staging-xcm-executor", default-features = false , version = "4.0.0" }
xcm-executor = { package = "staging-xcm-executor", default-features = false , version = "4.0.2" }
xcm-builder = { package = "staging-xcm-builder", default-features = false , version = "4.0.0" }

sp-debug-derive = { default-features = false, version = "10.0.0" }
Expand Down
7 changes: 7 additions & 0 deletions relay/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2416,6 +2416,13 @@ sp_api::impl_runtime_apis! {
Ok((origin, ticket, assets))
}

fn fee_asset() -> Result<MultiAsset, BenchmarkError> {
Ok(MultiAsset {
id: Concrete(TokenLocation::get()),
fun: Fungible(1_000_000 * UNITS),
})
}

fn unlockable_asset() -> Result<(MultiLocation, MultiLocation, MultiAsset), BenchmarkError> {
// Kusama doesn't support asset locking
Err(BenchmarkError::Skip)
Expand Down
9 changes: 5 additions & 4 deletions relay/kusama/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ use xcm_builder::{
AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses,
AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, ChildParachainAsNative,
ChildParachainConvertsVia, CurrencyAdapter as XcmCurrencyAdapter, DescribeAllTerminal,
DescribeFamily, HashedDescription, IsChildSystemParachain, IsConcrete, MintLocation,
OriginToPluralityVoice, SignedAccountId32AsNative, SignedToAccountId32,
SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId, UsingComponents,
WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, XcmFeesToAccount,
DescribeFamily, FrameTransactionalProcessor, HashedDescription, IsChildSystemParachain,
IsConcrete, MintLocation, OriginToPluralityVoice, SignedAccountId32AsNative,
SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId,
UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, XcmFeesToAccount,
};
use xcm_executor::traits::WithOriginFilter;

Expand Down Expand Up @@ -362,6 +362,7 @@ impl xcm_executor::Config for XcmConfig {
type CallDispatcher = WithOriginFilter<SafeCallFilter>;
type SafeCallFilter = SafeCallFilter;
type Aliasers = Nothing;
type TransactionalProcessor = FrameTransactionalProcessor;
}

parameter_types! {
Expand Down
4 changes: 2 additions & 2 deletions relay/polkadot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ pallet-membership = { default-features = false , version = "25.0.0" }
pallet-message-queue = { default-features = false , version = "28.0.0" }
pallet-mmr = { default-features = false , version = "24.0.0" }
pallet-multisig = { default-features = false , version = "25.0.0" }
pallet-nomination-pools = { default-features = false , version = "22.0.0" }
pallet-nomination-pools = { default-features = false , version = "22.0.2" }
pallet-nomination-pools-runtime-api = { default-features = false , version = "20.0.0" }
pallet-offences = { default-features = false , version = "24.0.0" }
pallet-preimage = { default-features = false , version = "25.0.0" }
Expand Down Expand Up @@ -108,7 +108,7 @@ runtime-parachains = { package = "polkadot-runtime-parachains", default-features
primitives = { package = "polkadot-primitives", default-features = false , version = "4.0.0" }

xcm = { package = "staging-xcm", default-features = false , version = "4.0.0" }
xcm-executor = { package = "staging-xcm-executor", default-features = false , version = "4.0.0" }
xcm-executor = { package = "staging-xcm-executor", default-features = false , version = "4.0.2" }
xcm-builder = { package = "staging-xcm-builder", default-features = false , version = "4.0.0" }

sp-debug-derive = { default-features = false, version = "10.0.0" }
Expand Down
7 changes: 7 additions & 0 deletions relay/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2407,6 +2407,13 @@ sp_api::impl_runtime_apis! {
Ok((origin, ticket, assets))
}

fn fee_asset() -> Result<MultiAsset, BenchmarkError> {
Ok(MultiAsset {
id: Concrete(TokenLocation::get()),
fun: Fungible(1_000_000 * UNITS),
})
}

fn unlockable_asset() -> Result<(MultiLocation, MultiLocation, MultiAsset), BenchmarkError> {
// Polkadot doesn't support asset locking
Err(BenchmarkError::Skip)
Expand Down
9 changes: 5 additions & 4 deletions relay/polkadot/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ use xcm_builder::{
AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses,
AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, ChildParachainAsNative,
ChildParachainConvertsVia, CurrencyAdapter as XcmCurrencyAdapter, DescribeAllTerminal,
DescribeFamily, HashedDescription, IsConcrete, MintLocation, OriginToPluralityVoice,
SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit,
TrailingSetTopicAsId, UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic,
XcmFeesToAccount,
DescribeFamily, FrameTransactionalProcessor, HashedDescription, IsConcrete, MintLocation,
OriginToPluralityVoice, SignedAccountId32AsNative, SignedToAccountId32,
SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId, UsingComponents,
WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, XcmFeesToAccount,
};
use xcm_executor::traits::WithOriginFilter;

Expand Down Expand Up @@ -366,6 +366,7 @@ impl xcm_executor::Config for XcmConfig {
type CallDispatcher = WithOriginFilter<SafeCallFilter>;
type SafeCallFilter = SafeCallFilter;
type Aliasers = Nothing;
type TransactionalProcessor = FrameTransactionalProcessor;
}

parameter_types! {
Expand Down
2 changes: 1 addition & 1 deletion system-parachains/asset-hubs/asset-hub-kusama/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ polkadot-parachain-primitives = { default-features = false, version = "3.0.0" }
polkadot-runtime-common = { default-features = false, version = "4.0.0" }
xcm = { package = "staging-xcm", default-features = false, version = "4.0.0" }
xcm-builder = { package = "staging-xcm-builder", default-features = false, version = "4.0.0" }
xcm-executor = { package = "staging-xcm-executor", default-features = false, version = "4.0.0" }
xcm-executor = { package = "staging-xcm-executor", default-features = false, version = "4.0.2" }

# Cumulus
cumulus-pallet-aura-ext = { default-features = false , version = "0.4.0" }
Expand Down
7 changes: 7 additions & 0 deletions system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1381,6 +1381,13 @@ impl_runtime_apis! {
Ok((origin, ticket, assets))
}

fn fee_asset() -> Result<MultiAsset, BenchmarkError> {
Ok(MultiAsset {
id: Concrete(KsmLocation::get()),
fun: Fungible(1_000_000 * UNITS),
})
}

fn unlockable_asset() -> Result<(MultiLocation, MultiLocation, MultiAsset), BenchmarkError> {
Err(BenchmarkError::Skip)
}
Expand Down
14 changes: 8 additions & 6 deletions system-parachains/asset-hubs/asset-hub-kusama/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,13 @@ use xcm_builder::{
AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses,
AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, CurrencyAdapter,
DenyReserveTransferToRelayChain, DenyThenTry, DescribeAllTerminal, DescribeFamily,
EnsureXcmOrigin, FungiblesAdapter, GlobalConsensusParachainConvertsFor, HashedDescription,
IsConcrete, LocalMint, NoChecking, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative,
SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative,
SignedToAccountId32, SovereignSignedViaLocation, StartsWith, StartsWithExplicitGlobalConsensus,
TakeWeightCredit, TrailingSetTopicAsId, UsingComponents, WeightInfoBounds, WithComputedOrigin,
WithUniqueTopic, XcmFeesToAccount,
EnsureXcmOrigin, FrameTransactionalProcessor, FungiblesAdapter,
GlobalConsensusParachainConvertsFor, HashedDescription, IsConcrete, LocalMint, NoChecking,
ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative,
SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32,
SovereignSignedViaLocation, StartsWith, StartsWithExplicitGlobalConsensus, TakeWeightCredit,
TrailingSetTopicAsId, UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic,
XcmFeesToAccount,
};
use xcm_executor::{traits::WithOriginFilter, XcmExecutor};

Expand Down Expand Up @@ -601,6 +602,7 @@ impl xcm_executor::Config for XcmConfig {
type CallDispatcher = WithOriginFilter<SafeCallFilter>;
type SafeCallFilter = SafeCallFilter;
type Aliasers = Nothing;
type TransactionalProcessor = FrameTransactionalProcessor;
}

/// Converts a local signed origin into an XCM multilocation.
Expand Down
2 changes: 1 addition & 1 deletion system-parachains/asset-hubs/asset-hub-polkadot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ polkadot-parachain-primitives = { default-features = false, version = "3.0.0" }
polkadot-runtime-common = { default-features = false, version = "4.0.0" }
xcm = { package = "staging-xcm", default-features = false, version = "4.0.0" }
xcm-builder = { package = "staging-xcm-builder", default-features = false, version = "4.0.0" }
xcm-executor = { package = "staging-xcm-executor", default-features = false, version = "4.0.0" }
xcm-executor = { package = "staging-xcm-executor", default-features = false, version = "4.0.2" }

# Cumulus
cumulus-pallet-aura-ext = { default-features = false , version = "0.4.0" }
Expand Down
7 changes: 7 additions & 0 deletions system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1272,6 +1272,13 @@ impl_runtime_apis! {
Ok((origin, ticket, assets))
}

fn fee_asset() -> Result<MultiAsset, BenchmarkError> {
Ok(MultiAsset {
id: Concrete(DotLocation::get()),
fun: Fungible(1_000_000 * UNITS),
})
}

fn unlockable_asset() -> Result<(MultiLocation, MultiLocation, MultiAsset), BenchmarkError> {
Err(BenchmarkError::Skip)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,13 @@ use xcm_builder::{
AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses,
AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, CurrencyAdapter,
DenyReserveTransferToRelayChain, DenyThenTry, DescribeAllTerminal, DescribeFamily,
EnsureXcmOrigin, FungiblesAdapter, GlobalConsensusParachainConvertsFor, HashedDescription,
IsConcrete, LocalMint, NoChecking, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative,
SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative,
SignedToAccountId32, SovereignSignedViaLocation, StartsWith, StartsWithExplicitGlobalConsensus,
TakeWeightCredit, TrailingSetTopicAsId, UsingComponents, WeightInfoBounds, WithComputedOrigin,
WithUniqueTopic, XcmFeesToAccount,
EnsureXcmOrigin, FrameTransactionalProcessor, FungiblesAdapter,
GlobalConsensusParachainConvertsFor, HashedDescription, IsConcrete, LocalMint, NoChecking,
ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative,
SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32,
SovereignSignedViaLocation, StartsWith, StartsWithExplicitGlobalConsensus, TakeWeightCredit,
TrailingSetTopicAsId, UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic,
XcmFeesToAccount,
};
use xcm_executor::{traits::WithOriginFilter, XcmExecutor};

Expand Down Expand Up @@ -523,6 +524,7 @@ impl xcm_executor::Config for XcmConfig {
type CallDispatcher = WithOriginFilter<SafeCallFilter>;
type SafeCallFilter = SafeCallFilter;
type Aliasers = Nothing;
type TransactionalProcessor = FrameTransactionalProcessor;
}

/// Converts a local signed origin into an XCM multilocation.
Expand Down
2 changes: 1 addition & 1 deletion system-parachains/bridge-hubs/bridge-hub-kusama/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ polkadot-parachain-primitives = { default-features = false, version = "3.0.0" }
polkadot-runtime-common = { default-features = false, version = "4.0.0" }
xcm = { package = "staging-xcm", default-features = false, version = "4.0.0" }
xcm-builder = { package = "staging-xcm-builder", default-features = false, version = "4.0.0" }
xcm-executor = { package = "staging-xcm-executor", default-features = false, version = "4.0.0" }
xcm-executor = { package = "staging-xcm-executor", default-features = false, version = "4.0.2" }

# Cumulus
cumulus-pallet-aura-ext = { default-features = false , version = "0.4.0" }
Expand Down
8 changes: 8 additions & 0 deletions system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,14 @@ impl_runtime_apis! {
Ok((origin, ticket, assets))
}

fn fee_asset() -> Result<MultiAsset, BenchmarkError> {
Ok(MultiAsset {
id: Concrete(KsmRelayLocation::get()),
fun: Fungible(1_000_000 * UNITS),
})
}


fn unlockable_asset() -> Result<(MultiLocation, MultiLocation, MultiAsset), BenchmarkError> {
Err(BenchmarkError::Skip)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ use xcm_builder::{
AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses,
AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, CurrencyAdapter,
DenyReserveTransferToRelayChain, DenyThenTry, DescribeAllTerminal, DescribeFamily,
EnsureXcmOrigin, HashedDescription, IsConcrete, ParentAsSuperuser, ParentIsPreset,
RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
EnsureXcmOrigin, FrameTransactionalProcessor, HashedDescription, IsConcrete, ParentAsSuperuser,
ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit,
TrailingSetTopicAsId, UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic,
XcmFeesToAccount,
Expand Down Expand Up @@ -281,6 +281,7 @@ impl xcm_executor::Config for XcmConfig {
type CallDispatcher = WithOriginFilter<SafeCallFilter>;
type SafeCallFilter = SafeCallFilter;
type Aliasers = Nothing;
type TransactionalProcessor = FrameTransactionalProcessor;
}

/// Converts a local signed origin into an XCM multilocation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ polkadot-parachain-primitives = { default-features = false, version = "3.0.0" }
polkadot-runtime-common = { default-features = false, version = "4.0.0" }
xcm = { package = "staging-xcm", default-features = false, version = "4.0.0" }
xcm-builder = { package = "staging-xcm-builder", default-features = false, version = "4.0.0" }
xcm-executor = { package = "staging-xcm-executor", default-features = false, version = "4.0.0" }
xcm-executor = { package = "staging-xcm-executor", default-features = false, version = "4.0.2" }

# Cumulus
cumulus-pallet-aura-ext = { default-features = false , version = "0.4.0" }
Expand Down
7 changes: 7 additions & 0 deletions system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,13 @@ impl_runtime_apis! {
Ok((origin, ticket, assets))
}

fn fee_asset() -> Result<MultiAsset, BenchmarkError> {
Ok(MultiAsset {
id: Concrete(DotRelayLocation::get()),
fun: Fungible(1_000_000 * UNITS),
})
}

fn unlockable_asset() -> Result<(MultiLocation, MultiLocation, MultiAsset), BenchmarkError> {
Err(BenchmarkError::Skip)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ use xcm_builder::{
AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses,
AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, CurrencyAdapter,
DenyReserveTransferToRelayChain, DenyThenTry, DescribeAllTerminal, DescribeFamily,
EnsureXcmOrigin, HashedDescription, IsConcrete, ParentAsSuperuser, ParentIsPreset,
RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
EnsureXcmOrigin, FrameTransactionalProcessor, HashedDescription, IsConcrete, ParentAsSuperuser,
ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit,
TrailingSetTopicAsId, UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic,
XcmFeesToAccount,
Expand Down Expand Up @@ -288,6 +288,7 @@ impl xcm_executor::Config for XcmConfig {
type CallDispatcher = WithOriginFilter<SafeCallFilter>;
type SafeCallFilter = SafeCallFilter;
type Aliasers = Nothing;
type TransactionalProcessor = FrameTransactionalProcessor;
}

/// Converts a local signed origin into an XCM multilocation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ polkadot-runtime-common = { default-features = false, version = "4.0.0" }
polkadot-runtime-constants = { path = "../../../relay/polkadot/constants", default-features = false}
xcm = { package = "staging-xcm", default-features = false, version = "4.0.0" }
xcm-builder = { package = "staging-xcm-builder", default-features = false, version = "4.0.0" }
xcm-executor = { package = "staging-xcm-executor", default-features = false, version = "4.0.0" }
xcm-executor = { package = "staging-xcm-executor", default-features = false, version = "4.0.2" }

# Cumulus
cumulus-pallet-aura-ext = { default-features = false , version = "0.4.0" }
Expand Down
Loading

0 comments on commit ecd1687

Please sign in to comment.