Skip to content

Commit

Permalink
Add delivery fees to encointer and people chains (#390)
Browse files Browse the repository at this point in the history
Fixes #388.

While working on #380 I
noticed `Encointer`, `PeopleKusama` and `PeoplePolkadot` didn't have
delivery fees setup for UMP.
In most cases, the types were created but not used.
This PR uses them.
  • Loading branch information
franciscoaguirre authored Jul 18, 2024
1 parent 7a5c66f commit db3ac1a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Added

- Kusama: Relay General Admin Origin mapping to xcm Location ([polkadot-fellows/runtimes#383](https://github.com/polkadot-fellows/runtimes/pull/383))
- Encointer, PeopleKusama, PeoplePolkadot: Configure delivery fees for UMP ([polkadot-fellows/runtimes#390](https://github.com/polkadot-fellows/runtimes/pull/390))

### Changed

Expand Down
14 changes: 11 additions & 3 deletions system-parachains/encointer/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
//! Almost identical to ../asset-hubs/asset-hub-kusama
use super::{
AccountId, Balances, CollatorSelection, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime,
RuntimeCall, RuntimeEvent, RuntimeOrigin, WeightToFee, XcmpQueue,
AccountId, Balances, CollatorSelection, FeeAssetId, ParachainInfo, ParachainSystem,
PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, ToParentBaseDeliveryFee,
TransactionByteFee, WeightToFee, XcmpQueue,
};
use frame_support::{
parameter_types,
Expand Down Expand Up @@ -198,11 +199,18 @@ impl xcm_executor::Config for XcmConfig {
/// Forms the basis for local origins sending/executing XCMs.
pub type LocalOriginToLocation = SignedToAccountId32<RuntimeOrigin, AccountId, RelayNetwork>;

pub type PriceForParentDelivery = polkadot_runtime_common::xcm_sender::ExponentialPrice<
FeeAssetId,
ToParentBaseDeliveryFee,
TransactionByteFee,
ParachainSystem,
>;

/// 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<ParachainSystem, PolkadotXcm, ()>,
cumulus_primitives_utility::ParentAsUmp<ParachainSystem, PolkadotXcm, PriceForParentDelivery>,
// ..and XCMP to communicate with the sibling chains.
XcmpQueue,
);
Expand Down
2 changes: 1 addition & 1 deletion system-parachains/people/people-kusama/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ pub type LocalOriginToLocation = SignedToAccountId32<RuntimeOrigin, AccountId, R
/// queues.
pub type XcmRouter = WithUniqueTopic<(
// Two routers - use UMP to communicate with the relay chain:
cumulus_primitives_utility::ParentAsUmp<ParachainSystem, PolkadotXcm, ()>,
cumulus_primitives_utility::ParentAsUmp<ParachainSystem, PolkadotXcm, PriceForParentDelivery>,
// ..and XCMP to communicate with the sibling chains.
XcmpQueue,
)>;
Expand Down
2 changes: 1 addition & 1 deletion system-parachains/people/people-polkadot/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ pub type LocalOriginToLocation = SignedToAccountId32<RuntimeOrigin, AccountId, R
/// queues.
pub type XcmRouter = WithUniqueTopic<(
// Two routers - use UMP to communicate with the relay chain:
cumulus_primitives_utility::ParentAsUmp<ParachainSystem, PolkadotXcm, ()>,
cumulus_primitives_utility::ParentAsUmp<ParachainSystem, PolkadotXcm, PriceForParentDelivery>,
// ..and XCMP to communicate with the sibling chains.
XcmpQueue,
)>;
Expand Down

0 comments on commit db3ac1a

Please sign in to comment.