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

bump deps, fix aura-ext pallet, and fill in stubs for XCM #600

Merged
merged 6 commits into from
Sep 4, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
785 changes: 338 additions & 447 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pallets/aura-ext/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub mod pallet {
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {
fn on_finalize(_: BlockNumberFor<T>) {
// Update to the latest AuRa authorities.
Authorities::<T>::put(Aura::<T>::authorities());
Authorities::<T>::put(Aura::<T>::authorities().into_inner());
}

fn on_initialize(_: BlockNumberFor<T>) -> Weight {
Expand Down Expand Up @@ -98,7 +98,7 @@ pub mod pallet {
"AuRa authorities empty, maybe wrong order in `construct_runtime!`?",
);

Authorities::<T>::put(authorities);
Authorities::<T>::put(authorities.into_inner());
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions pallets/collator-selection/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ impl pallet_timestamp::Config for Test {

impl pallet_aura::Config for Test {
type AuthorityId = sp_consensus_aura::sr25519::AuthorityId;
type MaxAuthorities = MaxAuthorities;
type DisabledValidators = ();
}

Expand Down Expand Up @@ -190,6 +191,7 @@ parameter_types! {
pub const MaxCandidates: u32 = 20;
pub const MaxInvulnerables: u32 = 20;
pub const MinCandidates: u32 = 1;
pub const MaxAuthorities: u32 = 100_000;
}

pub struct IsRegistered;
Expand Down
9 changes: 8 additions & 1 deletion polkadot-parachains/rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,9 @@ impl Config for XcmConfig {
type Weigher = FixedWeightBounds<UnitWeightCost, Call, MaxInstructions>;
type Trader = UsingComponents<IdentityFee<Balance>, RocLocation, AccountId, Balances, ()>;
type ResponseHandler = (); // Don't handle responses for now.
type AssetTrap = (); // don't trap for now
type AssetClaims = (); // don't claim for now
type SubscriptionService = (); // don't handle subscriptions for now
}

/// No local origins on this chain are allowed to dispatch XCM sends/executions.
Expand Down Expand Up @@ -376,6 +379,8 @@ impl pallet_xcm::Config for Runtime {
type LocationInverter = LocationInverter<Ancestry>;
type Origin = Origin;
type Call = Call;
const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100;
type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;
}

impl cumulus_pallet_xcm::Config for Runtime {
Expand Down Expand Up @@ -410,6 +415,7 @@ parameter_types! {
pub const MetadataDepositBase: Balance = 1 * ROC;
pub const MetadataDepositPerByte: Balance = 10 * MILLIROC;
pub const UnitBody: BodyId = BodyId::Unit;
pub const MaxAuthorities: u32 = 100_000;
}

/// A majority of the Unit body from Rococo over XCM is our required administration origin.
Expand All @@ -434,6 +440,7 @@ impl pallet_assets::Config for Runtime {
impl pallet_aura::Config for Runtime {
type AuthorityId = AuraId;
type DisabledValidators = ();
type MaxAuthorities = MaxAuthorities;
}

construct_runtime! {
Expand Down Expand Up @@ -589,7 +596,7 @@ impl_runtime_apis! {
}

fn authorities() -> Vec<AuraId> {
Aura::authorities()
Aura::authorities().into_inner()
}
}

Expand Down
3 changes: 3 additions & 0 deletions polkadot-parachains/shell/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@ impl Config for XcmConfig {
type Weigher = FixedWeightBounds<UnitWeightCost, Call, MaxInstructions>; // balances not supported
type Trader = (); // balances not supported
type ResponseHandler = (); // Don't handle responses for now.
type AssetTrap = (); // don't trap for now
type AssetClaims = (); // don't claim for now
type SubscriptionService = (); // don't handle subscriptions for now
}

impl cumulus_pallet_xcm::Config for Runtime {
Expand Down
10 changes: 9 additions & 1 deletion polkadot-parachains/statemine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,9 @@ impl Config for XcmConfig {
type Weigher = FixedWeightBounds<UnitWeightCost, Call, MaxInstructions>;
type Trader = UsingComponents<IdentityFee<Balance>, KsmLocation, AccountId, Balances, ()>;
type ResponseHandler = (); // Don't handle responses for now.
type AssetTrap = (); // don't trap for now
type AssetClaims = (); // don't claim for now
type SubscriptionService = (); // don't handle subscriptions for now
}

parameter_types! {
Expand Down Expand Up @@ -574,6 +577,9 @@ impl pallet_xcm::Config for Runtime {
type LocationInverter = LocationInverter<Ancestry>;
type Origin = Origin;
type Call = Call;

const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100;
type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;
}

impl cumulus_pallet_xcm::Config for Runtime {
Expand All @@ -598,6 +604,7 @@ parameter_types! {
pub const DisabledValidatorsThreshold: Perbill = Perbill::from_percent(33);
pub const Period: u32 = 6 * HOURS;
pub const Offset: u32 = 0;
pub const MaxAuthorities: u32 = 100_000;
}

impl pallet_session::Config for Runtime {
Expand All @@ -618,6 +625,7 @@ impl pallet_session::Config for Runtime {
impl pallet_aura::Config for Runtime {
type AuthorityId = AuraId;
type DisabledValidators = ();
type MaxAuthorities = MaxAuthorities;
}

parameter_types! {
Expand Down Expand Up @@ -743,7 +751,7 @@ impl_runtime_apis! {
}

fn authorities() -> Vec<AuraId> {
Aura::authorities()
Aura::authorities().into_inner()
}
}

Expand Down
9 changes: 8 additions & 1 deletion polkadot-parachains/statemint/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,9 @@ impl Config for XcmConfig {
type Weigher = FixedWeightBounds<UnitWeightCost, Call, MaxInstructions>;
type Trader = UsingComponents<IdentityFee<Balance>, DotLocation, AccountId, Balances, ()>;
type ResponseHandler = (); // Don't handle responses for now.
type AssetTrap = (); // don't trap for now
type AssetClaims = (); // don't claim for now
type SubscriptionService = (); // don't handle subscriptions for now
}

parameter_types! {
Expand Down Expand Up @@ -539,6 +542,8 @@ impl pallet_xcm::Config for Runtime {
type LocationInverter = LocationInverter<Ancestry>;
type Origin = Origin;
type Call = Call;
const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100;
type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;
}

impl cumulus_pallet_xcm::Config for Runtime {
Expand All @@ -563,6 +568,7 @@ parameter_types! {
pub const DisabledValidatorsThreshold: Perbill = Perbill::from_percent(33);
pub const Period: u32 = 6 * HOURS;
pub const Offset: u32 = 0;
pub const MaxAuthorities: u32 = 100_000;
}

impl pallet_session::Config for Runtime {
Expand All @@ -583,6 +589,7 @@ impl pallet_session::Config for Runtime {
impl pallet_aura::Config for Runtime {
type AuthorityId = AuraId;
type DisabledValidators = ();
type MaxAuthorities = MaxAuthorities;
}

parameter_types! {
Expand Down Expand Up @@ -726,7 +733,7 @@ impl_runtime_apis! {
}

fn authorities() -> Vec<AuraId> {
Aura::authorities()
Aura::authorities().into_inner()
}
}

Expand Down
10 changes: 9 additions & 1 deletion polkadot-parachains/westmint/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,9 @@ impl Config for XcmConfig {
type Weigher = FixedWeightBounds<UnitWeightCost, Call, MaxInstructions>;
type Trader = UsingComponents<IdentityFee<Balance>, WestendLocation, AccountId, Balances, ()>;
type ResponseHandler = (); // Don't handle responses for now.
type AssetTrap = (); // don't trap for now
type AssetClaims = (); // don't claim for now
type SubscriptionService = (); // don't handle subscriptions for now
}

parameter_types! {
Expand Down Expand Up @@ -537,6 +540,9 @@ impl pallet_xcm::Config for Runtime {
type LocationInverter = LocationInverter<Ancestry>;
type Origin = Origin;
type Call = Call;

const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100;
type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;
}

impl cumulus_pallet_xcm::Config for Runtime {
Expand All @@ -561,6 +567,7 @@ parameter_types! {
pub const DisabledValidatorsThreshold: Perbill = Perbill::from_percent(33);
pub const Period: u32 = 6 * HOURS;
pub const Offset: u32 = 0;
pub const MaxAuthorities: u32 = 100_000;
}

impl pallet_session::Config for Runtime {
Expand All @@ -581,6 +588,7 @@ impl pallet_session::Config for Runtime {
impl pallet_aura::Config for Runtime {
type AuthorityId = AuraId;
type DisabledValidators = ();
type MaxAuthorities = MaxAuthorities;
}

parameter_types! {
Expand Down Expand Up @@ -728,7 +736,7 @@ impl_runtime_apis! {
}

fn authorities() -> Vec<AuraId> {
Aura::authorities()
Aura::authorities().into_inner()
}
}

Expand Down