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

upgrade to v1.2 #56

Merged
merged 16 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from 12 commits
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
1,158 changes: 572 additions & 586 deletions Cargo.lock

Large diffs are not rendered by default.

184 changes: 92 additions & 92 deletions relay/kusama/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,112 +19,112 @@ serde_derive = { version = "1.0.117", optional = true }
static_assertions = "1.1.0"
smallvec = "1.8.0"

authority-discovery-primitives = { package = "sp-authority-discovery", default-features = false , version = "21.0.0" }
babe-primitives = { package = "sp-consensus-babe", default-features = false , version = "0.27.0" }
beefy-primitives = { package = "sp-consensus-beefy", default-features = false , version = "8.0.0" }
binary-merkle-tree = { default-features = false , version = "8.0.0" }
authority-discovery-primitives = { package = "sp-authority-discovery", default-features = false , version = "22.0.0" }
babe-primitives = { package = "sp-consensus-babe", default-features = false , version = "0.28.0" }
beefy-primitives = { package = "sp-consensus-beefy", default-features = false , version = "9.0.0" }
binary-merkle-tree = { default-features = false , version = "9.0.0" }
kusama-runtime-constants = { package = "kusama-runtime-constants", path = "constants", default-features = false }
sp-api = { default-features = false , version = "21.0.0" }
inherents = { package = "sp-inherents", default-features = false , version = "21.0.0" }
offchain-primitives = { package = "sp-offchain", default-features = false , version = "21.0.0" }
sp-std = { package = "sp-std", default-features = false , version = "10.0.0" }
sp-application-crypto = { default-features = false , version = "25.0.0" }
sp-arithmetic = { default-features = false , version = "18.0.0" }
sp-io = { default-features = false , version = "25.0.0" }
sp-mmr-primitives = { default-features = false , version = "21.0.0" }
sp-runtime = { default-features = false , version = "26.0.0" }
sp-staking = { default-features = false , version = "21.0.0" }
sp-core = { default-features = false , version = "23.0.0" }
sp-session = { default-features = false , version = "22.0.0" }
sp-storage = { default-features = false , version = "15.0.0" }
sp-version = { default-features = false , version = "24.0.0" }
tx-pool-api = { package = "sp-transaction-pool", default-features = false , version = "21.0.0" }
block-builder-api = { package = "sp-block-builder", default-features = false , version = "21.0.0" }
sp-npos-elections = { default-features = false , version = "21.0.0" }
sp-api = { default-features = false , version = "22.0.0" }
inherents = { package = "sp-inherents", default-features = false , version = "22.0.0" }
offchain-primitives = { package = "sp-offchain", default-features = false , version = "22.0.0" }
sp-std = { package = "sp-std", default-features = false , version = "11.0.0" }
sp-application-crypto = { default-features = false , version = "26.0.0" }
sp-arithmetic = { default-features = false , version = "19.0.0" }
sp-io = { default-features = false , version = "26.0.0" }
sp-mmr-primitives = { default-features = false , version = "22.0.0" }
sp-runtime = { default-features = false , version = "27.0.0" }
sp-staking = { default-features = false , version = "22.0.0" }
sp-core = { default-features = false , version = "24.0.0" }
sp-session = { default-features = false , version = "23.0.0" }
sp-storage = { default-features = false , version = "16.0.0" }
sp-version = { default-features = false , version = "25.0.0" }
tx-pool-api = { package = "sp-transaction-pool", default-features = false , version = "22.0.0" }
block-builder-api = { package = "sp-block-builder", default-features = false , version = "22.0.0" }
sp-npos-elections = { default-features = false , version = "22.0.0" }

pallet-authority-discovery = { default-features = false , version = "23.0.0" }
pallet-authorship = { default-features = false , version = "23.0.0" }
pallet-babe = { default-features = false , version = "23.0.0" }
pallet-bags-list = { default-features = false , version = "22.0.0" }
pallet-balances = { default-features = false , version = "23.0.0" }
pallet-beefy = { default-features = false , version = "23.0.0" }
pallet-beefy-mmr = { default-features = false , version = "23.0.0" }
pallet-bounties = { default-features = false , version = "22.0.0" }
pallet-child-bounties = { default-features = false , version = "22.0.0" }
pallet-transaction-payment = { default-features = false , version = "23.0.0" }
pallet-transaction-payment-rpc-runtime-api = { default-features = false , version = "23.0.0" }
pallet-nomination-pools-runtime-api = { default-features = false , version = "18.0.0" }
pallet-collective = { default-features = false , version = "23.0.0" }
pallet-conviction-voting = { default-features = false , version = "23.0.0" }
pallet-democracy = { default-features = false , version = "23.0.0" }
pallet-elections-phragmen = { default-features = false , version = "24.0.0" }
pallet-election-provider-multi-phase = { default-features = false , version = "22.0.0" }
pallet-fast-unstake = { default-features = false , version = "22.0.0" }
frame-executive = { default-features = false , version = "23.0.0" }
pallet-grandpa = { default-features = false , version = "23.0.0" }
pallet-nis = { default-features = false , version = "23.0.0" }
pallet-identity = { default-features = false , version = "23.0.0" }
pallet-im-online = { default-features = false , version = "22.0.0" }
pallet-indices = { default-features = false , version = "23.0.0" }
pallet-membership = { default-features = false , version = "23.0.0" }
pallet-message-queue = { default-features = false , version = "26.0.0" }
pallet-mmr = { default-features = false , version = "22.0.0" }
pallet-multisig = { default-features = false , version = "23.0.0" }
pallet-nomination-pools = { default-features = false , version = "20.0.0" }
pallet-offences = { default-features = false , version = "22.0.0" }
pallet-preimage = { default-features = false , version = "23.0.0" }
pallet-proxy = { default-features = false , version = "23.0.0" }
pallet-ranked-collective = { default-features = false , version = "23.0.0" }
pallet-recovery = { default-features = false , version = "23.0.0" }
pallet-referenda = { default-features = false , version = "23.0.0" }
pallet-scheduler = { default-features = false , version = "24.0.0" }
pallet-session = { default-features = false , version = "23.0.0" }
pallet-society = { default-features = false, features = ["experimental"] , version = "23.0.0" }
frame-support = { default-features = false , version = "23.0.0" }
pallet-staking = { default-features = false , version = "23.0.0" }
pallet-state-trie-migration = { default-features = false , version = "24.0.0" }
pallet-staking-runtime-api = { default-features = false , version = "9.0.0" }
frame-system = { default-features = false , version = "23.0.0" }
frame-system-rpc-runtime-api = { default-features = false , version = "21.0.0" }
pallet-timestamp = { default-features = false , version = "22.0.0" }
pallet-tips = { default-features = false , version = "22.0.0" }
pallet-treasury = { default-features = false , version = "22.0.0" }
pallet-utility = { default-features = false , version = "23.0.0" }
pallet-vesting = { default-features = false , version = "23.0.0" }
pallet-whitelist = { default-features = false , version = "22.0.0" }
pallet-xcm = { default-features = false , version = "2.0.0" }
pallet-xcm-benchmarks = { default-features = false, optional = true , version = "2.0.0" }
frame-election-provider-support = { default-features = false , version = "23.0.0" }
pallet-authority-discovery = { default-features = false , version = "24.0.0" }
pallet-authorship = { default-features = false , version = "24.0.0" }
pallet-babe = { default-features = false , version = "24.0.0" }
pallet-bags-list = { default-features = false , version = "23.0.0" }
pallet-balances = { default-features = false , version = "24.0.0" }
pallet-beefy = { default-features = false , version = "24.0.0" }
pallet-beefy-mmr = { default-features = false , version = "24.0.0" }
pallet-bounties = { default-features = false , version = "23.0.0" }
pallet-child-bounties = { default-features = false , version = "23.0.0" }
pallet-transaction-payment = { default-features = false , version = "24.0.0" }
pallet-transaction-payment-rpc-runtime-api = { default-features = false , version = "24.0.0" }
pallet-nomination-pools-runtime-api = { default-features = false , version = "19.0.0" }
pallet-collective = { default-features = false , version = "24.0.0" }
pallet-conviction-voting = { default-features = false , version = "24.0.0" }
pallet-democracy = { default-features = false , version = "24.0.0" }
pallet-elections-phragmen = { default-features = false , version = "25.0.0" }
pallet-election-provider-multi-phase = { default-features = false , version = "23.0.0" }
pallet-fast-unstake = { default-features = false , version = "23.0.0" }
frame-executive = { default-features = false , version = "24.0.0" }
pallet-grandpa = { default-features = false , version = "24.0.0" }
pallet-nis = { default-features = false , version = "24.0.0" }
pallet-identity = { default-features = false , version = "24.0.0" }
pallet-im-online = { default-features = false , version = "23.0.0" }
pallet-indices = { default-features = false , version = "24.0.0" }
pallet-membership = { default-features = false , version = "24.0.0" }
pallet-message-queue = { default-features = false , version = "27.0.0" }
pallet-mmr = { default-features = false , version = "23.0.0" }
pallet-multisig = { default-features = false , version = "24.0.0" }
pallet-nomination-pools = { default-features = false , version = "21.0.0" }
pallet-offences = { default-features = false , version = "23.0.0" }
pallet-preimage = { default-features = false , version = "24.0.0" }
pallet-proxy = { default-features = false , version = "24.0.0" }
pallet-ranked-collective = { default-features = false , version = "24.0.0" }
pallet-recovery = { default-features = false , version = "24.0.0" }
pallet-referenda = { default-features = false , version = "24.0.0" }
pallet-scheduler = { default-features = false , version = "25.0.0" }
pallet-session = { default-features = false , version = "24.0.0" }
pallet-society = { default-features = false, version = "24.0.0" }
frame-support = { default-features = false , version = "24.0.0" }
pallet-staking = { default-features = false , version = "24.0.0" }
pallet-state-trie-migration = { default-features = false , version = "25.0.0" }
pallet-staking-runtime-api = { default-features = false , version = "10.0.0" }
frame-system = { default-features = false , version = "24.0.0" }
frame-system-rpc-runtime-api = { default-features = false , version = "22.0.0" }
pallet-timestamp = { default-features = false , version = "23.0.0" }
pallet-tips = { default-features = false , version = "23.0.0" }
pallet-treasury = { default-features = false , version = "23.0.0" }
pallet-utility = { default-features = false , version = "24.0.0" }
pallet-vesting = { default-features = false , version = "24.0.0" }
pallet-whitelist = { default-features = false , version = "23.0.0" }
pallet-xcm = { default-features = false , version = "3.0.0" }
pallet-xcm-benchmarks = { default-features = false, optional = true , version = "3.0.0" }
frame-election-provider-support = { default-features = false , version = "24.0.0" }

frame-benchmarking = { default-features = false, optional = true , version = "23.0.0" }
frame-try-runtime = { default-features = false, optional = true , version = "0.29.0" }
pallet-offences-benchmarking = { default-features = false, optional = true , version = "23.0.0" }
pallet-session-benchmarking = { default-features = false, optional = true , version = "23.0.0" }
pallet-nomination-pools-benchmarking = { default-features = false, optional = true , version = "21.0.0" }
frame-system-benchmarking = { default-features = false, optional = true , version = "23.0.0" }
pallet-election-provider-support-benchmarking = { default-features = false, optional = true , version = "22.0.0" }
frame-benchmarking = { default-features = false, optional = true , version = "24.0.0" }
frame-try-runtime = { default-features = false, optional = true , version = "0.30.0" }
pallet-offences-benchmarking = { default-features = false, optional = true , version = "24.0.0" }
pallet-session-benchmarking = { default-features = false, optional = true , version = "24.0.0" }
pallet-nomination-pools-benchmarking = { default-features = false, optional = true , version = "22.0.0" }
frame-system-benchmarking = { default-features = false, optional = true , version = "24.0.0" }
pallet-election-provider-support-benchmarking = { default-features = false, optional = true , version = "23.0.0" }
hex-literal = "0.4.1"

runtime-common = { package = "polkadot-runtime-common", default-features = false, features = ["experimental"] , version = "2.0.0" }
runtime-parachains = { package = "polkadot-runtime-parachains", default-features = false , version = "2.0.0" }
primitives = { package = "polkadot-primitives", default-features = false , version = "2.0.0" }
runtime-common = { package = "polkadot-runtime-common", default-features = false, version = "3.0.0" }
runtime-parachains = { package = "polkadot-runtime-parachains", default-features = false , version = "3.0.0" }
primitives = { package = "polkadot-primitives", default-features = false , version = "3.0.0" }

xcm = { package = "staging-xcm", default-features = false , version = "2.0.1" }
xcm-executor = { package = "staging-xcm-executor", default-features = false , version = "2.0.0" }
xcm-builder = { package = "staging-xcm-builder", default-features = false , version = "2.0.1" }
xcm = { package = "staging-xcm", default-features = false , version = "3.0.1" }
xcm-executor = { package = "staging-xcm-executor", default-features = false , version = "3.0.0" }
xcm-builder = { package = "staging-xcm-builder", default-features = false , version = "3.0.1" }

[dev-dependencies]
tiny-keccak = { version = "2.0.2", features = ["keccak"] }
keyring = { package = "sp-keyring", version = "26.0.0" }
sp-trie = { version = "24.0.0" }
keyring = { package = "sp-keyring", version = "27.0.0" }
sp-trie = { version = "25.0.0" }
separator = "0.4.1"
serde_json = "1.0.96"
remote-externalities = { package = "frame-remote-externalities", version = "0.30.0" }
remote-externalities = { package = "frame-remote-externalities" , version = "0.31.0" }
tokio = { version = "1.24.2", features = ["macros"] }
sp-tracing = { default-features = false , version = "12.0.0" }
sp-tracing = { default-features = false , version = "13.0.0" }

[build-dependencies]
substrate-wasm-builder = { version = "12.0.0" }
substrate-wasm-builder = { version = "13.0.0" }

[features]
default = [ "std" ]
Expand Down
12 changes: 6 additions & 6 deletions relay/kusama/constants/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ license.workspace = true
[dependencies]
smallvec = "1.8.0"

frame-support = { default-features = false , version = "23.0.0" }
primitives = { package = "polkadot-primitives", default-features = false , version = "2.0.0" }
runtime-common = { package = "polkadot-runtime-common", default-features = false , version = "2.0.0" }
sp-runtime = { default-features = false , version = "26.0.0" }
sp-weights = { default-features = false , version = "22.0.0" }
sp-core = { default-features = false , version = "23.0.0" }
frame-support = { default-features = false , version = "24.0.0" }
primitives = { package = "polkadot-primitives", default-features = false , version = "3.0.0" }
runtime-common = { package = "polkadot-runtime-common", default-features = false , version = "3.0.0" }
sp-runtime = { default-features = false , version = "27.0.0" }
sp-weights = { default-features = false , version = "23.0.0" }
sp-core = { default-features = false , version = "24.0.0" }

[features]
default = [ "std" ]
Expand Down
32 changes: 19 additions & 13 deletions relay/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ use runtime_parachains::{
inclusion::{AggregateMessageOrigin, UmpQueueId},
initializer as parachains_initializer, origin as parachains_origin, paras as parachains_paras,
paras_inherent as parachains_paras_inherent, reward_points as parachains_reward_points,
runtime_api_impl::v5 as parachains_runtime_api_impl,
runtime_api_impl::v7 as parachains_runtime_api_impl,
scheduler as parachains_scheduler, session_info as parachains_session_info,
shared as parachains_shared,
};
Expand All @@ -63,8 +63,9 @@ use frame_election_provider_support::{
use frame_support::{
construct_runtime, parameter_types,
traits::{
ConstU32, Contains, EitherOf, EitherOfDiverse, InstanceFilter, KeyOwnerProofSystem,
PrivilegeCmp, ProcessMessage, ProcessMessageError, StorageMapShim, WithdrawReasons,
fungible::HoldConsideration, ConstU32, Contains, EitherOf, EitherOfDiverse, InstanceFilter,
KeyOwnerProofSystem, LinearStoragePrice, PrivilegeCmp, ProcessMessage, ProcessMessageError,
StorageMapShim, WithdrawReasons,
},
weights::{ConstantMultiplier, WeightMeter},
PalletId,
Expand Down Expand Up @@ -92,7 +93,7 @@ use xcm::latest::Junction;

pub use frame_system::Call as SystemCall;
pub use pallet_balances::Call as BalancesCall;
pub use pallet_election_provider_multi_phase::Call as EPMCall;
pub use pallet_election_provider_multi_phase::{Call as EPMCall, GeometricDepositBase};
#[cfg(feature = "std")]
pub use pallet_staking::StakerStatus;
use pallet_staking::UseValidatorsMap;
Expand All @@ -109,8 +110,6 @@ mod weights;
// Voter bag threshold definitions.
mod bag_thresholds;

mod paras_scheduler_migration;

// Historical information of society finances.
mod past_payouts;

Expand Down Expand Up @@ -241,15 +240,21 @@ impl pallet_scheduler::Config for Runtime {
parameter_types! {
pub const PreimageBaseDeposit: Balance = deposit(2, 64);
pub const PreimageByteDeposit: Balance = deposit(0, 1);
pub const PreimageHoldReason: RuntimeHoldReason =
RuntimeHoldReason::Preimage(pallet_preimage::HoldReason::Preimage);
}

impl pallet_preimage::Config for Runtime {
type WeightInfo = weights::pallet_preimage::WeightInfo<Runtime>;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type ManagerOrigin = EnsureRoot<AccountId>;
type BaseDeposit = PreimageBaseDeposit;
type ByteDeposit = PreimageByteDeposit;
type Consideration = HoldConsideration<
AccountId,
Balances,
PreimageHoldReason,
LinearStoragePrice<PreimageBaseDeposit, PreimageByteDeposit, Balance>,
>;
}

parameter_types! {
Expand Down Expand Up @@ -507,7 +512,8 @@ parameter_types! {
// signed config
pub const SignedMaxSubmissions: u32 = 16;
pub const SignedMaxRefunds: u32 = 16 / 4;
pub const SignedDepositBase: Balance = deposit(2, 0);
pub const SignedFixedDeposit: Balance = deposit(2, 0);
pub const SignedDepositIncreaseFactor: Percent = Percent::from_percent(10);
pub const SignedDepositByte: Balance = deposit(0, 10) / 1024;
// Each good submission will get 1/10 KSM as reward
pub SignedRewardBase: Balance = UNITS / 10;
Expand Down Expand Up @@ -580,7 +586,8 @@ impl pallet_election_provider_multi_phase::Config for Runtime {
type SignedMaxSubmissions = SignedMaxSubmissions;
type SignedMaxRefunds = SignedMaxRefunds;
type SignedRewardBase = SignedRewardBase;
type SignedDepositBase = SignedDepositBase;
type SignedDepositBase =
GeometricDepositBase<Balance, SignedFixedDeposit, SignedDepositIncreaseFactor>;
type SignedDepositByte = SignedDepositByte;
type SignedDepositWeight = ();
type SignedMaxWeight =
Expand Down Expand Up @@ -1562,7 +1569,7 @@ construct_runtime! {
Multisig: pallet_multisig::{Pallet, Call, Storage, Event<T>} = 31,

// Preimage registrar.
Preimage: pallet_preimage::{Pallet, Call, Storage, Event<T>} = 32,
Preimage: pallet_preimage::{Pallet, Call, Storage, Event<T>, HoldReason} = 32,

// Bounties modules.
Bounties: pallet_bounties::{Pallet, Call, Storage, Event<T>} = 35,
Expand Down Expand Up @@ -1736,7 +1743,6 @@ pub mod migrations {
>,
pallet_im_online::migration::v1::Migration<Runtime>,
parachains_configuration::migration::v7::MigrateToV7<Runtime>,
paras_scheduler_migration::v1::MigrateToV1<Runtime>,
parachains_configuration::migration::v8::MigrateToV8<Runtime>,

// Unlock/unreserve balances from Gov v1 pallets that hold them
Expand Down Expand Up @@ -2480,7 +2486,7 @@ mod fees_tests {
fn signed_deposit_is_sensible() {
// ensure this number does not change, or that it is checked after each change.
// a 1 MB solution should need around 0.16 KSM deposit
let deposit = SignedDepositBase::get() + (SignedDepositByte::get() * 1024 * 1024);
let deposit = SignedFixedDeposit::get() + (SignedDepositByte::get() * 1024 * 1024);
assert_eq_error_rate!(deposit, UNITS * 167 / 100, UNITS / 100);
}
}
Expand Down
Loading
Loading