Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The Ambassador Program #291

Merged
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Add `pallet-vesting` to Asset Hubs ([polkadot-fellows/runtimes#269](https://github.com/polkadot-fellows/runtimes/pull/269))
- Add Pay Salary Collectives test ([polkadot-fellows/runtimes#260](https://github.com/polkadot-fellows/runtimes/pull/260))
- Add `pallet-xcm::transfer_assets_using_type_and_then()` for complex asset transfers ([polkadot-fellows/runtimes#311](https://github.com/polkadot-fellows/runtimes/pull/311))
- The Ambassador Program ([polkadot-fellows/runtimes#291](https://github.com/polkadot-fellows/runtimes/pull/291))

### Removed

Expand Down
28 changes: 28 additions & 0 deletions system-parachains/asset-hubs/asset-hub-polkadot/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,32 @@ impl Contains<Location> for FellowshipEntities {
}
}

pub struct AmbassadorEntities;
impl Contains<Location> for AmbassadorEntities {
Comment on lines +264 to +265
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't have anything for the BodyId. I guess they have no power outside their Treasury/Salary so maybe it is not important. We just have to make sure to add this if they ever do get some new power or need that origin. Perhaps put it in docs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. I cannot come up with a good location for such doc. If some collective plurality gets to manage something in Asset Hub, an engineer will need only to update an ensure origin impl for some pallet. I think an engineer should keep in mind that xcm execution is not for free by default.
We can also just grant a free xcm execution for all Collectives Parachain pluralities, but I am not sure if that will be true for all future pluralities.

fn contains(location: &Location) -> bool {
matches!(
location.unpack(),
(
1,
[
Parachain(system_parachain::COLLECTIVES_ID),
PalletInstance(
collectives_polkadot_runtime_constants::AMBASSADOR_SALARY_PALLET_INDEX
)
]
) | (
1,
[
Parachain(system_parachain::COLLECTIVES_ID),
PalletInstance(
collectives_polkadot_runtime_constants::AMBASSADOR_TREASURY_PALLET_INDEX
)
]
)
)
}
}

pub struct ParentOrParentsPlurality;
impl Contains<Location> for ParentOrParentsPlurality {
fn contains(location: &Location) -> bool {
Expand Down Expand Up @@ -289,6 +315,7 @@ pub type Barrier = TrailingSetTopicAsId<
FellowshipEntities,
Equals<RelayTreasuryLocation>,
Equals<bridging::SiblingBridgeHub>,
AmbassadorEntities,
)>,
// Subscriptions for version tracking are OK.
AllowSubscriptionsFrom<ParentRelayOrSiblingParachains>,
Expand All @@ -314,6 +341,7 @@ pub type WaivedLocations = (
RelayOrOtherSystemParachains<AllSiblingSystemParachains, Runtime>,
Equals<RelayTreasuryLocation>,
FellowshipEntities,
AmbassadorEntities,
);

/// Cases where a remote origin is accepted as trusted Teleporter for a given asset:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,14 @@

#![no_std]

/// Polkadot Collectives Salary pallet instance.
/// Polkadot Fellowship Salary pallet instance.
pub const FELLOWSHIP_SALARY_PALLET_INDEX: u8 = 64;

/// Polkadot Collectives Treasury pallet instance.
/// Polkadot Fellowship Treasury pallet instance.
pub const FELLOWSHIP_TREASURY_PALLET_INDEX: u8 = 65;

/// Polkadot Ambassador Salary pallet instance.
pub const AMBASSADOR_SALARY_PALLET_INDEX: u8 = 74;

/// Polkadot Ambassador Treasury pallet instance.
pub const AMBASSADOR_TREASURY_PALLET_INDEX: u8 = 75;
Loading
Loading