Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Add OpenGov to Rococo and Westend runtimes #7272

Open
wants to merge 36 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
6ed0f84
Rococo bounties SpendOrigin to root
al3mart May 23, 2023
6500cf8
Merge branch 'master' into al3mart/rococo-spendorigin
al3mart Jun 26, 2023
0bf252d
opengov in Rococo
al3mart Jun 26, 2023
86e050e
opengov in Westend
al3mart Jul 6, 2023
34be311
sp-keystore wout serde feature
al3mart Jul 6, 2023
74e2d4f
QueuePausedQuery & bump recursion limit
al3mart Jul 6, 2023
450e6ee
merge master
al3mart Jul 6, 2023
8a21492
trasury in westend chainspec
al3mart Jun 26, 2023
0d51017
removing QUID
al3mart Jul 7, 2023
734b309
Update runtime/rococo/src/governance/mod.rs
al3mart Jul 7, 2023
5dc0332
rename fellowships
al3mart Jul 7, 2023
14ed4da
remove QUID from Rococo
al3mart Jul 7, 2023
fb1df64
add benches
al3mart Jul 10, 2023
ac39528
remove custom_origins from benches
al3mart Jul 10, 2023
352a239
Merge branch 'master' of https://github.com/paritytech/polkadot into …
Jul 10, 2023
0f0ed3b
".git/.scripts/commands/bench/bench.sh" runtime westend pallet_convic…
Jul 10, 2023
3356add
Merge branch 'master' of https://github.com/paritytech/polkadot into …
Jul 11, 2023
8d79770
".git/.scripts/commands/bench/bench.sh" runtime rococo pallet_referenda
Jul 11, 2023
44f4ea0
".git/.scripts/commands/bench/bench.sh" runtime rococo pallet_ranked_…
Jul 11, 2023
f8cc76e
merge changes
al3mart Jul 12, 2023
0c33f7f
add generic in Treasury Config
al3mart Jul 12, 2023
c82f27e
add generic for wested Treasury Config
al3mart Jul 12, 2023
41fff79
".git/.scripts/commands/bench/bench.sh" runtime westend pallet_whitelist
Jul 12, 2023
02b8de7
".git/.scripts/commands/bench/bench.sh" runtime westend pallet_treasury
Jul 13, 2023
97f33ff
remove gov1 from rococo runtime lib
al3mart Aug 3, 2023
4ad2c13
remove gov1 from rococo xcm_config
al3mart Aug 3, 2023
158bd40
remove gov1 rococo deps
al3mart Aug 3, 2023
46f6e54
remove unused weights
al3mart Aug 3, 2023
094107a
rococo chain_spec
al3mart Aug 4, 2023
7083b8e
cargo update
al3mart Aug 4, 2023
cf7d0d8
merge conflicts
al3mart Aug 4, 2023
47c3847
cargo update
al3mart Aug 4, 2023
8477d48
merge master
al3mart Aug 25, 2023
9e2dbe4
take CheckedReduceBy from sp_runtime
al3mart Aug 25, 2023
cc5cccc
westend to follow polkadot
al3mart Aug 25, 2023
9692495
".git/.scripts/commands/bench/bench.sh" --subcommand=runtime --runtim…
Aug 25, 2023
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
Prev Previous commit
Next Next commit
westend to follow polkadot
  • Loading branch information
al3mart committed Aug 25, 2023
commit cc5cccc5521c70d1ce60396a86d09a47fe9be538
371 changes: 185 additions & 186 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions runtime/rococo/src/governance/fellowship.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
//! Elements of governance concerning the Rococo Fellowship.

use frame_support::traits::{MapSuccess, TryMapSuccess};
use sp_runtime::{
traits::{ConstU16, Replace, CheckedReduceBy},
};
use sp_runtime::traits::{CheckedReduceBy, ConstU16, Replace};

use super::*;
use crate::{CENTS, DAYS};
Expand Down
8 changes: 4 additions & 4 deletions runtime/rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ use beefy_primitives::{
use frame_support::{
construct_runtime, parameter_types,
traits::{
Contains, EitherOf, EitherOfDiverse, InstanceFilter, KeyOwnerProofSystem,
PrivilegeCmp, ProcessMessage, ProcessMessageError, StorageMapShim, WithdrawReasons,
Contains, EitherOf, EitherOfDiverse, InstanceFilter, KeyOwnerProofSystem, PrivilegeCmp,
ProcessMessage, ProcessMessageError, StorageMapShim, WithdrawReasons,
},
weights::{ConstantMultiplier, WeightMeter},
PalletId,
Expand All @@ -79,7 +79,7 @@ use sp_runtime::{
Extrinsic as ExtrinsicT, Keccak256, OpaqueKeys, SaturatedConversion, Verify,
},
transaction_validity::{TransactionPriority, TransactionSource, TransactionValidity},
ApplyExtrinsicResult, FixedU128, KeyTypeId, Perbill, Percent, Permill, RuntimeDebug
ApplyExtrinsicResult, FixedU128, KeyTypeId, Perbill, Percent, Permill, RuntimeDebug,
};
use sp_staking::SessionIndex;
#[cfg(any(feature = "std", test))]
Expand Down Expand Up @@ -757,7 +757,7 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
),
ProxyType::Governance => matches!(
c,
RuntimeCall::Bounties(..) |
RuntimeCall::Bounties(..) |
RuntimeCall::Utility(..) |
RuntimeCall::ChildBounties(..) |
// OpenGov calls
Expand Down
22 changes: 11 additions & 11 deletions runtime/rococo/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
//! XCM configuration for Rococo.

use super::{
parachains_origin, AccountId, AllPalletsWithSystem, Balances, Fellows, ParaId, Runtime,
RuntimeCall, RuntimeEvent, RuntimeOrigin, WeightToFee, XcmPallet, TransactionByteFee, Dmp,
parachains_origin, AccountId, AllPalletsWithSystem, Balances, Dmp, Fellows, ParaId, Runtime,
RuntimeCall, RuntimeEvent, RuntimeOrigin, TransactionByteFee, WeightToFee, XcmPallet,
};

use crate::governance::StakingAdmin;
Expand All @@ -39,8 +39,8 @@ use sp_core::ConstU32;
use xcm::latest::prelude::*;
use xcm_builder::{
AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses,
AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom,
ChildParachainAsNative, ChildParachainConvertsVia, ChildSystemParachainAsSuperuser,
AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, ChildParachainAsNative,
ChildParachainConvertsVia, ChildSystemParachainAsSuperuser,
CurrencyAdapter as XcmCurrencyAdapter, FixedWeightBounds, IsChildSystemParachain, IsConcrete,
MintLocation, OriginToPluralityVoice, SignedAccountId32AsNative, SignedToAccountId32,
SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId, UsingComponents,
Expand Down Expand Up @@ -315,8 +315,8 @@ parameter_types! {
pub ReachableDest: Option<MultiLocation> = Some(Parachain(1000).into());
}

/// Type to convert an `Origin` type value into a `MultiLocation` value which represents an interior location
/// of this chain.
/// Type to convert an `Origin` type value into a `MultiLocation` value which represents an interior
/// location of this chain.
pub type LocalOriginToLocation = (
// And a usual Signed origin to be used in XCM as a corresponding AccountId32
SignedToAccountId32<RuntimeOrigin, AccountId, ThisNetwork>,
Expand All @@ -329,8 +329,8 @@ pub type StakingAdminToPlurality =
/// Type to convert the Fellows origin to a Plurality `MultiLocation` value.
pub type FellowsToPlurality = OriginToPluralityVoice<RuntimeOrigin, Fellows, FellowsBodyId>;

/// Type to convert a pallet `Origin` type value into a `MultiLocation` value which represents an interior location
/// of this chain for a destination chain.
/// Type to convert a pallet `Origin` type value into a `MultiLocation` value which represents an
/// interior location of this chain for a destination chain.
pub type LocalPalletOriginToLocation = (
// StakingAdmin origin to be used in XCM as a corresponding Plurality `MultiLocation` value.
StakingAdminToPlurality,
Expand All @@ -341,9 +341,9 @@ pub type LocalPalletOriginToLocation = (
impl pallet_xcm::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
// We only allow the root, fellows and the staking admin to send messages.
// This is basically safe to enable for everyone (safe the possibility of someone spamming the parachain
// if they're willing to pay the KSM to send from the Relay-chain), but it's useless until we bring in XCM v3
// which will make `DescendOrigin` a bit more useful.
// This is basically safe to enable for everyone (safe the possibility of someone spamming the
// parachain if they're willing to pay the KSM to send from the Relay-chain), but it's useless
// until we bring in XCM v3 which will make `DescendOrigin` a bit more useful.
type SendXcmOrigin = xcm_builder::EnsureXcmOrigin<RuntimeOrigin, LocalPalletOriginToLocation>;
type XcmRouter = XcmRouter;
// Anyone can execute XCM messages locally.
Expand Down
4 changes: 0 additions & 4 deletions runtime/westend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ pallet-conviction-voting = { git = "https://github.com/paritytech/substrate", br
pallet-offences = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-preimage = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-proxy = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-ranked-collective = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-recovery = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-referenda = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-scheduler = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
Expand Down Expand Up @@ -170,7 +169,6 @@ std = [
"pallet-offences/std",
"pallet-preimage/std",
"pallet-proxy/std",
"pallet-ranked-collective/std",
"pallet-recovery/std",
"pallet-referenda/std",
"pallet-scheduler/std",
Expand Down Expand Up @@ -236,7 +234,6 @@ runtime-benchmarks = [
"pallet-nomination-pools-benchmarking/runtime-benchmarks",
"pallet-preimage/runtime-benchmarks",
"pallet-proxy/runtime-benchmarks",
"pallet-ranked-collective/runtime-benchmarks",
"pallet-recovery/runtime-benchmarks",
"pallet-referenda/runtime-benchmarks",
"pallet-scheduler/runtime-benchmarks",
Expand Down Expand Up @@ -288,7 +285,6 @@ try-runtime = [
"pallet-offences/try-runtime",
"pallet-preimage/try-runtime",
"pallet-proxy/try-runtime",
"pallet-ranked-collective/try-runtime",
"pallet-recovery/try-runtime",
"pallet-referenda/try-runtime",
"pallet-scheduler/try-runtime",
Expand Down
20 changes: 20 additions & 0 deletions runtime/westend/constants/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,26 @@ pub mod fee {
}
}

/// XCM protocol related constants.
pub mod xcm {
/// Pluralistic bodies existing within the consensus.
pub mod body {
// Preallocated for the Root body.
#[allow(dead_code)]
const ROOT_INDEX: u32 = 0;
// The bodies corresponding to the Polkadot OpenGov Origins.
pub const FELLOWSHIP_ADMIN_INDEX: u32 = 1;
}
}

/// System Parachains.
pub mod system_parachain {
/// Statemint parachain ID.
pub const WESTMINT_ID: u32 = 1000;
/// Collectives parachain ID.
pub const COLLECTIVES_ID: u32 = 1001;
}

#[cfg(test)]
mod tests {
use super::{
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.