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

Commit

Permalink
Update Rococo to mirror Kusama (#5617)
Browse files Browse the repository at this point in the history
* upgrade to kusama base

* rollback epoch and clean up

* Substitue DOLLARS with UNITS

* money constatns to mirror Kusama

* fixing typo in test

* scheduler+collective+membership+preimage

* treasury+democracy+bounties+child_bounties+society

* tips+claim+identity+elections_phragmen+vesting

* recovery+gilt

* proxy+slot+auction+registar+crowdloan

* babe+epoch_time modificaction

* xcm_config

* xcm_config fix

* constants

* fix conflicts 2

* fmt

* update xcm_config

* revert xcm_config change

* fixing benchmarks

* cargo.lock

* Revert "babe+epoch_time modificaction"

This reverts commit 982d220.

* fix benchamrks 2

* fix benchmarks 3

* typos

* miscelaneous

* fix constants test

* rollback comments

* rollback lease period

* fmt

* add ROC to spellcheck dictionary

* fix cargo.toml + fixes

* remove TODOs

* nit fix

* weights 1.5

* Bumping number of perm/temp slots available

Co-authored-by: al3mart <alejandro@parity.io>
Co-authored-by: alvicsam <alvicsam@gmail.com>
  • Loading branch information
3 people authored Sep 8, 2022
1 parent 7222d32 commit 00fed3b
Show file tree
Hide file tree
Showing 29 changed files with 4,314 additions and 765 deletions.
20 changes: 20 additions & 0 deletions Cargo.lock

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

30 changes: 24 additions & 6 deletions node/service/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1048,26 +1048,35 @@ fn rococo_staging_testnet_config_genesis(wasm_binary: &[u8]) -> rococo_runtime::
})
.collect::<Vec<_>>(),
},
phragmen_election: Default::default(),
babe: rococo_runtime::BabeConfig {
authorities: Default::default(),
epoch_config: Some(rococo_runtime::BABE_GENESIS_EPOCH_CONFIG),
},
grandpa: Default::default(),
im_online: Default::default(),
collective: Default::default(),
membership: Default::default(),
democracy: rococo_runtime::DemocracyConfig::default(),
council: rococo::CouncilConfig { members: vec![], phantom: Default::default() },
technical_committee: rococo::TechnicalCommitteeConfig {
members: vec![],
phantom: Default::default(),
},
technical_membership: Default::default(),
treasury: Default::default(),
authority_discovery: rococo_runtime::AuthorityDiscoveryConfig { keys: vec![] },
claims: rococo::ClaimsConfig { claims: vec![], vesting: vec![] },
vesting: rococo::VestingConfig { vesting: vec![] },
sudo: rococo_runtime::SudoConfig { key: Some(endowed_accounts[0].clone()) },
paras: rococo_runtime::ParasConfig { paras: vec![] },
hrmp: Default::default(),
configuration: rococo_runtime::ConfigurationConfig {
config: default_parachains_host_configuration(),
},
gilt: Default::default(),
registrar: rococo_runtime::RegistrarConfig {
next_free_para_id: polkadot_primitives::v2::LOWEST_PUBLIC_ID,
},
xcm_pallet: Default::default(),
transaction_payment: Default::default(),
}
}

Expand Down Expand Up @@ -1599,8 +1608,17 @@ pub fn rococo_testnet_genesis(
},
grandpa: Default::default(),
im_online: Default::default(),
collective: Default::default(),
membership: Default::default(),
phragmen_election: Default::default(),
democracy: rococo::DemocracyConfig::default(),
council: rococo::CouncilConfig { members: vec![], phantom: Default::default() },
technical_committee: rococo::TechnicalCommitteeConfig {
members: vec![],
phantom: Default::default(),
},
technical_membership: Default::default(),
treasury: Default::default(),
claims: rococo::ClaimsConfig { claims: vec![], vesting: vec![] },
vesting: rococo::VestingConfig { vesting: vec![] },
authority_discovery: rococo_runtime::AuthorityDiscoveryConfig { keys: vec![] },
sudo: rococo_runtime::SudoConfig { key: Some(root_key.clone()) },
hrmp: Default::default(),
Expand All @@ -1610,12 +1628,12 @@ pub fn rococo_testnet_genesis(
..default_parachains_host_configuration()
},
},
gilt: Default::default(),
paras: rococo_runtime::ParasConfig { paras: vec![] },
registrar: rococo_runtime::RegistrarConfig {
next_free_para_id: polkadot_primitives::v2::LOWEST_PUBLIC_ID,
},
xcm_pallet: Default::default(),
transaction_payment: Default::default(),
}
}

Expand Down
16 changes: 4 additions & 12 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 @@ -63,7 +62,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 @@ -86,7 +85,6 @@ pub use pallet_balances::Call as BalancesCall;
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;

Expand Down Expand Up @@ -361,11 +359,6 @@ impl pallet_authorship::Config for Runtime {
type EventHandler = (Staking, ImOnline);
}

parameter_types! {
pub const Period: BlockNumber = 10 * MINUTES;
pub const Offset: BlockNumber = 0;
}

impl_opaque_keys! {
pub struct SessionKeys {
pub grandpa: Grandpa,
Expand Down Expand Up @@ -425,6 +418,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 @@ -733,8 +728,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 @@ -1159,7 +1152,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 @@ -1343,7 +1336,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
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
Loading

0 comments on commit 00fed3b

Please sign in to comment.