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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [Unreleased]

### Added

- Add `pallet-vesting` to Asset Hubs ([polkadot-fellows/runtimes#269](https://github.com/polkadot-fellows/runtimes/pull/269))
- The Ambassador Program ([polkadot-fellows/runtimes#291](https://github.com/polkadot-fellows/runtimes/pull/291))

### Changed

- Remove DMP queue and allow `system::authorize_upgrade` in XCM's call filter ([polkadot-fellows/runtimes#280](https://github.com/polkadot-fellows/runtimes/pull/280))

## [1.2.3] 29.04.2024
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 @@ -264,6 +264,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 @@ -475,6 +501,7 @@ pub type Barrier = TrailingSetTopicAsId<
FellowshipEntities,
Equals<RelayTreasuryLocation>,
Equals<bridging::SiblingBridgeHub>,
AmbassadorEntities,
)>,
// Subscriptions for version tracking are OK.
AllowSubscriptionsFrom<ParentRelayOrSiblingParachains>,
Expand All @@ -500,6 +527,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