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

Secretary Program #347

Open
wants to merge 45 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
939392f
init
Doordashcon May 9, 2024
acd23f2
imp Doc comm 1
Doordashcon May 13, 2024
7d03cac
remove unreachable pattern
Doordashcon May 13, 2024
1c4659b
location
Doordashcon May 14, 2024
188759e
nit
Doordashcon May 14, 2024
154efb5
update origin, secretary submit fellowship ref
Doordashcon May 17, 2024
bea78a3
changelog include
Doordashcon May 18, 2024
c203940
update imports
Doordashcon May 20, 2024
334c35c
Merge branch 'main' into ddc-secretary-collective
Doordashcon May 20, 2024
482d0be
cargo +nightly fmt
Doordashcon May 20, 2024
d7d4b87
getting weights..
Doordashcon May 21, 2024
2e0968a
nit parameter types
Doordashcon May 21, 2024
572d398
origin update
Doordashcon Jun 1, 2024
09d317c
reset head
Doordashcon Jun 10, 2024
4e5116b
improve documentation
Doordashcon Jun 13, 2024
365d3c5
fmt
Doordashcon Jun 15, 2024
600d2c2
clippy nit
Doordashcon Jun 16, 2024
e884c30
Merge branch 'main' into ddc-secretary-collective2
Doordashcon Jun 18, 2024
bcd0a17
Fellowship Admin
Doordashcon Jun 23, 2024
47ed39e
Merge branch 'main' into ddc-secretary-collective2
Doordashcon Jul 7, 2024
7b0064a
confl-main
Doordashcon Jul 16, 2024
bdbc39b
conflict fix in progress
Doordashcon Jul 16, 2024
ef75bf7
same Cargo.toml
Doordashcon Jul 16, 2024
86d489f
Cargo.lock
Doordashcon Jul 16, 2024
313bb8c
Merge branch 'main' into ddc-secretary-collective2
Doordashcon Jul 16, 2024
d34fcb2
adjust salary periods
Doordashcon Jul 17, 2024
5722c25
doc nit
Doordashcon Jul 22, 2024
b3a82cf
Merge branch 'main' into ddc-secretary-collective2
Doordashcon Jul 23, 2024
daca216
no-op poll + nit
Doordashcon Jul 27, 2024
f8ab6a1
secretary on fellow ref submission removal
Doordashcon Jul 27, 2024
95a2cfb
Merge branch 'main' into ddc-secretary-collective2
Doordashcon Jul 27, 2024
c32eb13
nit max_ongoing
Doordashcon Jul 27, 2024
51b94ef
remove M: GetMaxVoters
Doordashcon Jul 29, 2024
eaaab37
Merge branch 'main' into ddc-secretary-collective2
Doordashcon Jul 31, 2024
ec53bb8
changelog update
Doordashcon Jul 31, 2024
906bc10
Merge branch 'main' into ddc-secretary-collective2
Doordashcon Aug 3, 2024
1b1e81f
rm origins && secrt
Doordashcon Aug 13, 2024
d4dac6f
Merge branch 'main' into ddc-secretary-collective2
Doordashcon Aug 13, 2024
02f8a49
Merge branch 'main' into ddc-secretary-collective2
Doordashcon Aug 15, 2024
a80a668
Merge branch 'main' into ddc-secretary-collective2
Doordashcon Aug 17, 2024
1962aef
cllective
Doordashcon Aug 30, 2024
fe184d9
Merge branch 'main' into ddc-secretary-collective2
Doordashcon Aug 30, 2024
53e60a6
Merge branch 'main' into ddc-secretary-collective2
Doordashcon Sep 4, 2024
fd82ec2
nit time crate + fmt
Doordashcon Sep 6, 2024
b34d4b1
remove {} AHP
Doordashcon Sep 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Migration to remove all but the 21 first elected Head Ambassador members from the Program ([polkadot-fellows/runtimes#422](https://github.com/polkadot-fellows/runtimes/pull/422)).
- Kusama: Make the current inflation formula adjustable ([polkadot-fellows/runtimes#364](https://github.com/polkadot-fellows/runtimes/pull/364))
- Port Agile Coretime migration from polkadot-sdk in order to fix leases with gaps handling([polkadot-fellows/runtimes#426](https://github.com/polkadot-fellows/runtimes/pull/426))
- The Secretary Program ([polkadot-fellows/runtimes#306](https://github.com/polkadot-fellows/runtimes/pull/306))

#### From [#322](https://github.com/polkadot-fellows/runtimes/pull/322):

Expand Down Expand Up @@ -410,4 +411,4 @@ Note: This release only affects the following runtimes and is not a full system
- Assets `destroy_accounts` releases the deposit
([paritytech/substrate#14443](https://github.com/paritytech/substrate/pull/14443))
- Update Polkadot Collectives to use `limited_teleport_assets` for automatic slash handling, as
`teleport_assets` is deprecated and caused a failing integration test. ([polkadot-fellows/runtimes#46](https://github.com/polkadot-fellows/runtimes/pull/46))
`teleport_assets` is deprecated and caused a failing integration test. ([polkadot-fellows/runtimes#46](https://github.com/polkadot-fellows/runtimes/pull/46))
16 changes: 12 additions & 4 deletions Cargo.lock

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

5 changes: 3 additions & 2 deletions system-parachains/asset-hubs/asset-hub-polkadot/src/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,9 @@ pub mod tx_payment {
// The error should not occur since swap was quoted before.
Err((refund, _)) => {
match T::Assets::settle(who, debt, Preservation::Expendable) {
Ok(dust) =>
ensure!(dust.peek().is_zero(), InvalidTransaction::Payment),
Ok(dust) => {
ensure!(dust.peek().is_zero(), InvalidTransaction::Payment)
},
// The error should not occur as the `debt` was just withdrawn
// above.
Err(_) => return Err(InvalidTransaction::Payment.into()),
Expand Down
17 changes: 8 additions & 9 deletions system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -485,15 +485,14 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
RuntimeCall::Utility { .. } |
RuntimeCall::Multisig { .. }
),
ProxyType::Assets => {
matches!(
c,
RuntimeCall::Assets { .. } |
RuntimeCall::Utility { .. } |
RuntimeCall::Multisig { .. } |
RuntimeCall::Nfts { .. } | RuntimeCall::Uniques { .. }
)
},
ProxyType::Assets => matches!(
c,
RuntimeCall::Assets { .. } |
RuntimeCall::Utility { .. } |
RuntimeCall::Multisig { .. } |
RuntimeCall::Nfts { .. } |
RuntimeCall::Uniques { .. }
),
ProxyType::AssetOwner => matches!(
c,
RuntimeCall::Assets(TrustBackedAssetsCall::create { .. }) |
Expand Down
26 changes: 26 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 @@ -227,6 +227,8 @@ parameter_types! {
pub XcmAssetFeesReceiver: Option<AccountId> = Authorship::author();
}

/// Location type to determine the Technical Fellowship related
/// pallets for use in XCM.
pub struct FellowshipEntities;
impl Contains<Location> for FellowshipEntities {
fn contains(location: &Location) -> bool {
Expand Down Expand Up @@ -259,6 +261,8 @@ impl Contains<Location> for FellowshipEntities {
}
}

/// Location type to determine the Ambassador Collective
/// pallets for use in XCM.
pub struct AmbassadorEntities;
impl Contains<Location> for AmbassadorEntities {
fn contains(location: &Location) -> bool {
Expand All @@ -285,6 +289,26 @@ impl Contains<Location> for AmbassadorEntities {
}
}

/// Location type to determine the Secretary Collective related
/// pallets for use in XCM.
pub struct SecretaryEntities;
impl Contains<Location> for SecretaryEntities {
fn contains(location: &Location) -> bool {
matches!(
location.unpack(),
(
1,
[
Parachain(system_parachain::COLLECTIVES_ID),
PalletInstance(
collectives_polkadot_runtime_constants::SECRETARY_SALARY_PALLET_INDEX
)
]
)
)
}
}

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

/// 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 @@ -27,3 +27,6 @@ pub const AMBASSADOR_SALARY_PALLET_INDEX: u8 = 74;

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

/// Polkadot Secretary Salary pallet instance.
pub const SECRETARY_SALARY_PALLET_INDEX: u8 = 81;
20 changes: 20 additions & 0 deletions system-parachains/collectives/collectives-polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ pub mod xcm_config;
pub mod fellowship;
pub use ambassador::pallet_ambassador_origins;

// Secretary Configuration
pub mod secretary;

use cumulus_pallet_parachain_system::RelayNumberMonotonicallyIncreases;
use cumulus_primitives_core::{AggregateMessageOrigin, ParaId};
use fellowship::{pallet_fellowship_origins, Fellows};
Expand Down Expand Up @@ -314,6 +317,8 @@ pub enum ProxyType {
Fellowship,
/// Ambassador proxy. Allows calls related to the Ambassador Program.
Ambassador,
/// Secretary proxy. Allows calls related to the Secretary collective
Secretary,
}
impl Default for ProxyType {
fn default() -> Self {
Expand Down Expand Up @@ -360,6 +365,13 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
RuntimeCall::Utility { .. } |
RuntimeCall::Multisig { .. }
),
ProxyType::Secretary => matches!(
c,
RuntimeCall::SecretaryCollective { .. } |
RuntimeCall::SecretarySalary { .. } |
RuntimeCall::Utility { .. } |
RuntimeCall::Multisig { .. }
),
}
}
fn is_superset(&self, o: &Self) -> bool {
Expand Down Expand Up @@ -740,6 +752,12 @@ construct_runtime!(
AmbassadorCore: pallet_core_fellowship::<Instance2> = 73,
AmbassadorSalary: pallet_salary::<Instance2> = 74,
AmbassadorTreasury: pallet_treasury::<Instance2> = 75,

// The Secretary Collective
// pub type SecretaryCollectiveInstance = pallet_ranked_collective::instance3;
SecretaryCollective: pallet_ranked_collective::<Instance3> = 80,
// pub type SecretarySalaryInstance = pallet_salary::Instance3;
SecretarySalary: pallet_salary::<Instance3> = 81,
}
);

Expand Down Expand Up @@ -819,6 +837,8 @@ mod benches {
[pallet_core_fellowship, AmbassadorCore]
[pallet_salary, AmbassadorSalary]
[pallet_treasury, AmbassadorTreasury]
[pallet_ranked_collective, SecretaryCollective]
[pallet_salary, SecretarySalary]
);
}

Expand Down
Loading
Loading