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

Update Rococo to mirror Kusama #5617

Merged
merged 42 commits into from
Sep 8, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
49f9eb7
upgrade to kusama base
NachoPal May 30, 2022
c9c86e2
rollback epoch and clean up
NachoPal May 31, 2022
db8b128
Substitue DOLLARS with UNITS
Jun 16, 2022
e074eb0
money constatns to mirror Kusama
Jun 16, 2022
1aa6ac0
fixing typo in test
Jun 16, 2022
8aac79d
scheduler+collective+membership+preimage
NachoPal Jun 20, 2022
97be489
Merge branch 'nacho/update-rococo-to-kusama' of github.com:paritytech…
NachoPal Jun 20, 2022
f70dc72
treasury+democracy+bounties+child_bounties+society
NachoPal Jun 20, 2022
d110c56
tips+claim+identity+elections_phragmen+vesting
NachoPal Jun 20, 2022
58498df
recovery+gilt
NachoPal Jun 20, 2022
0d8a06f
proxy+slot+auction+registar+crowdloan
NachoPal Jun 20, 2022
982d220
babe+epoch_time modificaction
NachoPal Jun 21, 2022
f1ef966
xcm_config
NachoPal Jun 21, 2022
a202cf4
xcm_config fix
NachoPal Jun 21, 2022
d565aa2
constants
NachoPal Jun 21, 2022
2a00894
fix conflicts
NachoPal Jul 11, 2022
20e75c7
fix conflicts 2
NachoPal Jul 11, 2022
78c5e0c
fmt
NachoPal Jul 11, 2022
8c5ccb5
update xcm_config
NachoPal Jul 11, 2022
761133a
revert xcm_config change
NachoPal Jul 11, 2022
a40f68f
fixing benchmarks
NachoPal Jul 14, 2022
098b63f
cargo.lock
NachoPal Jul 14, 2022
e9382cf
Revert "babe+epoch_time modificaction"
NachoPal Jul 14, 2022
79bc851
Merge branch 'master' of github.com:paritytech/polkadot into nacho/up…
NachoPal Jul 18, 2022
7ffd2d9
fix benchamrks 2
NachoPal Jul 20, 2022
128f830
fix benchmarks 3
NachoPal Jul 20, 2022
2d3ce2d
typos
NachoPal Jul 26, 2022
4b666a7
miscelaneous
NachoPal Jul 26, 2022
ee144d4
fix constants test
NachoPal Jul 26, 2022
7324ce4
fix conflicts
NachoPal Jul 26, 2022
e9d7f18
rollback comments
NachoPal Jul 26, 2022
43a7372
rollback lease period
NachoPal Jul 26, 2022
0e1a2d0
fmt
NachoPal Jul 26, 2022
f09d5ee
add ROC to spellcheck dictionary
alvicsam Jul 26, 2022
5147aa4
merge master
NachoPal Aug 11, 2022
288f3dc
fix cargo.toml + fixes
NachoPal Aug 11, 2022
f2e652f
Merge branch 'nacho/update-rococo-to-kusama' of github.com:paritytech…
NachoPal Aug 11, 2022
ac9093e
remove TODOs
NachoPal Aug 12, 2022
6688c34
nit fix
NachoPal Aug 12, 2022
a02840c
solve conflicts
NachoPal Sep 6, 2022
07e6aa9
weights 1.5
NachoPal Sep 7, 2022
b497f49
Bumping number of perm/temp slots available
Sep 7, 2022
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
2 changes: 0 additions & 2 deletions node/service/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1065,7 +1065,6 @@ fn rococo_staging_testnet_config_genesis(wasm_binary: &[u8]) -> rococo_runtime::
next_free_para_id: polkadot_primitives::v2::LOWEST_PUBLIC_ID,
},
xcm_pallet: Default::default(),
transaction_payment: Default::default(),
bridge_rococo_grandpa: rococo_runtime::BridgeRococoGrandpaConfig {
owner: Some(endowed_accounts[0].clone()),
..Default::default()
Expand Down Expand Up @@ -1628,7 +1627,6 @@ pub fn rococo_testnet_genesis(
next_free_para_id: polkadot_primitives::v2::LOWEST_PUBLIC_ID,
},
xcm_pallet: Default::default(),
transaction_payment: Default::default(),
bridge_rococo_grandpa: rococo_runtime::BridgeRococoGrandpaConfig {
owner: Some(root_key.clone()),
..Default::default()
Expand Down
44 changes: 23 additions & 21 deletions runtime/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256.
#![recursion_limit = "256"]

use pallet_transaction_payment::CurrencyAdapter;
use parity_scale_codec::{Decode, Encode, MaxEncodedLen};
use primitives::v2::{
AccountId, AccountIndex, Balance, BlockNumber, CandidateEvent, CandidateHash,
Expand Down Expand Up @@ -62,7 +61,7 @@ use frame_system::EnsureRoot;
use pallet_grandpa::{fg_primitives, AuthorityId as GrandpaId};
use pallet_im_online::sr25519::AuthorityId as ImOnlineId;
use pallet_session::historical as session_historical;
use pallet_transaction_payment::{FeeDetails, RuntimeDispatchInfo};
use pallet_transaction_payment::{CurrencyAdapter, FeeDetails, RuntimeDispatchInfo};
use sp_core::OpaqueMetadata;
use sp_mmr_primitives as mmr;
use sp_runtime::{
Expand All @@ -81,13 +80,13 @@ use sp_version::RuntimeVersion;
use static_assertions::const_assert;

pub use frame_system::Call as SystemCall;
pub use pallet_balances::Call as BalancesCall;
// pub use pallet_balances::Call as BalancesCall;
NachoPal marked this conversation as resolved.
Show resolved Hide resolved
pub use pallet_election_provider_multi_phase::Call as EPMCall;
#[cfg(feature = "std")]
pub use pallet_staking::StakerStatus;
pub use pallet_timestamp::Call as TimestampCall;
#[cfg(any(feature = "std", test))]
pub use sp_runtime::BuildStorage;
// pub use pallet_timestamp::Call as TimestampCall;
NachoPal marked this conversation as resolved.
Show resolved Hide resolved
// #[cfg(any(feature = "std", test))]
// pub use sp_runtime::BuildStorage;
NachoPal marked this conversation as resolved.
Show resolved Hide resolved

/// Constant values used within the runtime.
use kusama_runtime_constants::{currency::*, fee::*, time::*};
Expand Down Expand Up @@ -147,11 +146,6 @@ impl Contains<Call> for BaseFilter {
}
}

type MoreThanHalfCouncil = EnsureOneOf<
EnsureRoot<AccountId>,
pallet_collective::EnsureProportionMoreThan<AccountId, CouncilCollective, 1, 2>,
>;

parameter_types! {
pub const Version: RuntimeVersion = VERSION;
pub const SS58Prefix: u8 = 2;
Expand Down Expand Up @@ -355,10 +349,10 @@ impl pallet_authorship::Config for Runtime {
type EventHandler = (Staking, ImOnline);
}

parameter_types! {
pub const Period: BlockNumber = 10 * MINUTES;
pub const Offset: BlockNumber = 0;
}
// parameter_types! {
// pub const Period: BlockNumber = 10 * MINUTES;
// pub const Offset: BlockNumber = 0;
// }
NachoPal marked this conversation as resolved.
Show resolved Hide resolved

impl_opaque_keys! {
pub struct SessionKeys {
Expand Down Expand Up @@ -419,6 +413,8 @@ parameter_types! {
/// ... and all of the validators as electable targets. Whilst this is the case, we cannot and
/// shall not increase the size of the validator intentions.
pub const MaxElectableTargets: u16 = u16::MAX;
pub NposSolutionPriority: TransactionPriority =
Perbill::from_percent(90) * TransactionPriority::max_value();
}

generate_solution_type!(
Expand Down Expand Up @@ -756,6 +752,11 @@ impl pallet_collective::Config<TechnicalCollective> for Runtime {
type WeightInfo = weights::pallet_collective_technical_committee::WeightInfo<Runtime>;
}

type MoreThanHalfCouncil = EnsureOneOf<
EnsureRoot<AccountId>,
pallet_collective::EnsureProportionMoreThan<AccountId, CouncilCollective, 1, 2>,
>;

impl pallet_membership::Config<pallet_membership::Instance1> for Runtime {
type Event = Event;
type AddOrigin = MoreThanHalfCouncil;
Expand Down Expand Up @@ -871,8 +872,6 @@ impl pallet_authority_discovery::Config for Runtime {
}

parameter_types! {
pub NposSolutionPriority: TransactionPriority =
Perbill::from_percent(90) * TransactionPriority::max_value();
pub const ImOnlineUnsignedPriority: TransactionPriority = TransactionPriority::max_value();
}

Expand Down Expand Up @@ -1296,7 +1295,7 @@ impl parachains_hrmp::Config for Runtime {
type Event = Event;
type Origin = Origin;
type Currency = Balances;
type WeightInfo = weights::runtime_parachains_hrmp::WeightInfo<Self>;
type WeightInfo = weights::runtime_parachains_hrmp::WeightInfo<Runtime>;
}

impl parachains_paras_inherent::Config for Runtime {
Expand Down Expand Up @@ -1496,15 +1495,13 @@ construct_runtime! {
Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 2,
Indices: pallet_indices::{Pallet, Call, Storage, Config<T>, Event<T>} = 3,
Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>} = 4,
TransactionPayment: pallet_transaction_payment::{Pallet, Storage} = 33,

// Consensus support.
// Authorship must be before session in order to note author in the correct session and era
// for im-online and staking.
Authorship: pallet_authorship::{Pallet, Call, Storage} = 5,
Staking: pallet_staking::{Pallet, Call, Storage, Config<T>, Event<T>} = 6,
Offences: pallet_offences::{Pallet, Storage, Event} = 7,
Historical: session_historical::{Pallet} = 34,
Session: pallet_session::{Pallet, Call, Storage, Event, Config<T>} = 8,
Grandpa: pallet_grandpa::{Pallet, Call, Storage, Config, Event, ValidateUnsigned} = 10,
ImOnline: pallet_im_online::{Pallet, Call, Storage, Event<T>, ValidateUnsigned, Config<T>} = 11,
Expand All @@ -1518,7 +1515,6 @@ construct_runtime! {
TechnicalMembership: pallet_membership::<Instance1>::{Pallet, Call, Storage, Event<T>, Config<T>} = 17,
Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event<T>} = 18,


// Claims. Usable initially.
Claims: claims::{Pallet, Call, Storage, Event<T>, Config<T>, ValidateUnsigned} = 19,

Expand Down Expand Up @@ -1549,6 +1545,12 @@ construct_runtime! {
// Preimage registrar.
Preimage: pallet_preimage::{Pallet, Call, Storage, Event<T>} = 32,

// Trasaction Payment module
TransactionPayment: pallet_transaction_payment::{Pallet, Storage} = 33,

// Historical module
Historical: session_historical::{Pallet} = 34,

// Bounties modules.
Bounties: pallet_bounties::{Pallet, Call, Storage, Event<T>} = 35,
ChildBounties: pallet_child_bounties = 40,
Expand Down
3 changes: 2 additions & 1 deletion runtime/kusama/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,9 @@ pub type XcmRouter = (
parameter_types! {
pub const Kusama: MultiAssetFilter = Wild(AllOf { fun: WildFungible, id: Concrete(KsmLocation::get()) });
pub const Statemine: MultiLocation = Parachain(1000).into();
pub const Encointer: MultiLocation = Parachain(1001).into();
pub const KusamaForStatemine: (MultiAssetFilter, MultiLocation) = (Kusama::get(), Statemine::get());
pub const KusamaForEncointer: (MultiAssetFilter, MultiLocation) = (Kusama::get(), Parachain(1001).into());
pub const KusamaForEncointer: (MultiAssetFilter, MultiLocation) = (Kusama::get(), Encointer::get());
}
pub type TrustedTeleporters =
(xcm_builder::Case<KusamaForStatemine>, xcm_builder::Case<KusamaForEncointer>);
Expand Down
6 changes: 4 additions & 2 deletions runtime/rococo/constants/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@ pub mod weights;
pub mod currency {
use primitives::v2::Balance;

/// The existential deposit.
pub const EXISTENTIAL_DEPOSIT: Balance = 1 * CENTS;

pub const UNITS: Balance = 1_000_000_000_000;
pub const DOLLARS: Balance = UNITS;
pub const CENTS: Balance = DOLLARS / 100;
pub const DOLLARS: Balance = UNITS;
pub const MILLICENTS: Balance = CENTS / 1_000;

pub const fn deposit(items: u32, bytes: u32) -> Balance {
Expand All @@ -36,7 +39,6 @@ pub mod currency {
pub mod time {
use primitives::v2::{BlockNumber, Moment};
use runtime_common::prod_or_fast;

pub const MILLISECS_PER_BLOCK: Moment = 6000;
pub const SLOT_DURATION: Moment = MILLISECS_PER_BLOCK;
pub const DEFAULT_EPOCH_DURATION: BlockNumber = prod_or_fast!(1 * HOURS, 1 * MINUTES);
Expand Down
Loading