mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-10 04:07:59 +00:00
add parachains pallets to Polkadot runtime (#3815)
* add parachains pallets to Polkadot runtime * some updates * temp update deposits, fix compile * lower para byte deposit * fix genesis * fmt * fix spell * updates to consts * update benchmark list * fix merge master * cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=polkadot-dev --steps=50 --repeat=20 --pallet=runtime_common::crowdloan --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/polkadot/src/weights/runtime_common_crowdloan.rs * skip large meta * cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=polkadot-dev --steps=50 --repeat=20 --pallet=runtime_common::crowdloan --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/polkadot/src/weights/runtime_common_crowdloan.rs * cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=polkadot-dev --steps=50 --repeat=20 --pallet=runtime_common::paras_registrar --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/polkadot/src/weights/runtime_common_paras_registrar.rs * fmt * add and update proxies * add weight info * weights * lower minimum contribution to 5 DOT * only overwrite when default Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com> Co-authored-by: Parity Bot <admin@parity.io>
This commit is contained in:
committed by
GitHub
parent
03934d2af1
commit
ccb7bc5c60
Generated
+1
@@ -6655,6 +6655,7 @@ dependencies = [
|
||||
"parity-scale-codec",
|
||||
"polkadot-primitives",
|
||||
"polkadot-runtime-common",
|
||||
"polkadot-runtime-parachains",
|
||||
"rustc-hex",
|
||||
"scale-info",
|
||||
"separator",
|
||||
|
||||
@@ -157,7 +157,12 @@ pub fn wococo_config() -> Result<RococoChainSpec, String> {
|
||||
}
|
||||
|
||||
/// The default parachains host configuration.
|
||||
#[cfg(any(feature = "rococo-native", feature = "kusama-native", feature = "westend-native"))]
|
||||
#[cfg(any(
|
||||
feature = "rococo-native",
|
||||
feature = "kusama-native",
|
||||
feature = "westend-native",
|
||||
feature = "polkadot-native"
|
||||
))]
|
||||
fn default_parachains_host_configuration(
|
||||
) -> polkadot_runtime_parachains::configuration::HostConfiguration<
|
||||
polkadot_primitives::v1::BlockNumber,
|
||||
@@ -364,6 +369,10 @@ fn polkadot_staging_testnet_config_genesis(wasm_binary: &[u8]) -> polkadot::Gene
|
||||
claims: polkadot::ClaimsConfig { claims: vec![], vesting: vec![] },
|
||||
vesting: polkadot::VestingConfig { vesting: vec![] },
|
||||
treasury: Default::default(),
|
||||
configuration: polkadot::ConfigurationConfig {
|
||||
config: default_parachains_host_configuration(),
|
||||
},
|
||||
paras: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1310,6 +1319,10 @@ pub fn polkadot_testnet_genesis(
|
||||
claims: polkadot::ClaimsConfig { claims: vec![], vesting: vec![] },
|
||||
vesting: polkadot::VestingConfig { vesting: vec![] },
|
||||
treasury: Default::default(),
|
||||
configuration: polkadot::ConfigurationConfig {
|
||||
config: default_parachains_host_configuration(),
|
||||
},
|
||||
paras: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1942,6 +1942,7 @@ mod benchmarking {
|
||||
}
|
||||
|
||||
// Worst case: Refund removes `RemoveKeysLimit` keys, and is fully refunded.
|
||||
#[skip_meta]
|
||||
refund {
|
||||
let k in 0 .. T::RemoveKeysLimit::get();
|
||||
let fund_index = create_fund::<T>(1337, 100u32.into());
|
||||
|
||||
@@ -77,6 +77,7 @@ pallet-session-benchmarking = { git = "https://github.com/paritytech/substrate",
|
||||
hex-literal = { version = "0.3.3", optional = true }
|
||||
|
||||
runtime-common = { package = "polkadot-runtime-common", path = "../common", default-features = false }
|
||||
runtime-parachains = { package = "polkadot-runtime-parachains", path = "../parachains", default-features = false }
|
||||
primitives = { package = "polkadot-primitives", path = "../../primitives", default-features = false }
|
||||
|
||||
[dev-dependencies]
|
||||
|
||||
@@ -39,6 +39,7 @@ pub mod time {
|
||||
pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber);
|
||||
pub const HOURS: BlockNumber = MINUTES * 60;
|
||||
pub const DAYS: BlockNumber = HOURS * 24;
|
||||
pub const WEEKS: BlockNumber = DAYS * 7;
|
||||
|
||||
// 1 in 4 blocks (on average, not counting collisions) will be primary babe blocks.
|
||||
pub const PRIMARY_PROBABILITY: (u64, u64) = (1, 4);
|
||||
|
||||
@@ -22,9 +22,18 @@
|
||||
|
||||
use pallet_transaction_payment::CurrencyAdapter;
|
||||
use runtime_common::{
|
||||
claims, impls::DealWithFees, AssignmentSessionKeyPlaceholder, BlockHashCount, BlockLength,
|
||||
BlockWeights, CurrencyToVote, OffchainSolutionLengthLimit, OffchainSolutionWeightLimit,
|
||||
ParachainSessionKeyPlaceholder, RocksDbWeight, SlowAdjustingFeeUpdate,
|
||||
auctions, claims, crowdloan, impls::DealWithFees, paras_registrar, slots, BlockHashCount,
|
||||
BlockLength, BlockWeights, CurrencyToVote, OffchainSolutionLengthLimit,
|
||||
OffchainSolutionWeightLimit, RocksDbWeight, SlowAdjustingFeeUpdate,
|
||||
};
|
||||
|
||||
use runtime_parachains::{
|
||||
configuration as parachains_configuration, dmp as parachains_dmp, hrmp as parachains_hrmp,
|
||||
inclusion as parachains_inclusion, 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::v1 as parachains_runtime_api_impl, scheduler as parachains_scheduler,
|
||||
session_info as parachains_session_info, shared as parachains_shared, ump as parachains_ump,
|
||||
};
|
||||
|
||||
use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId;
|
||||
@@ -32,7 +41,7 @@ use beefy_primitives::crypto::AuthorityId as BeefyId;
|
||||
use frame_support::{
|
||||
construct_runtime, parameter_types,
|
||||
traits::{Contains, KeyOwnerProofSystem, LockIdentifier, OnRuntimeUpgrade},
|
||||
weights::Weight,
|
||||
weights::{constants::WEIGHT_PER_MILLIS, Weight},
|
||||
PalletId, RuntimeDebug,
|
||||
};
|
||||
use frame_system::{EnsureOneOf, EnsureRoot};
|
||||
@@ -44,9 +53,9 @@ use pallet_transaction_payment::{FeeDetails, RuntimeDispatchInfo};
|
||||
use parity_scale_codec::{Decode, Encode, MaxEncodedLen};
|
||||
use primitives::v1::{
|
||||
AccountId, AccountIndex, Balance, BlockNumber, CandidateEvent, CommittedCandidateReceipt,
|
||||
CoreState, GroupRotationInfo, Hash, Id, InboundDownwardMessage, InboundHrmpMessage, Moment,
|
||||
Nonce, OccupiedCoreAssumption, PersistedValidationData, SessionInfo, Signature, ValidationCode,
|
||||
ValidationCodeHash, ValidatorId, ValidatorIndex,
|
||||
CoreState, GroupRotationInfo, Hash, Id as ParaId, InboundDownwardMessage, InboundHrmpMessage,
|
||||
Moment, Nonce, OccupiedCoreAssumption, PersistedValidationData, SessionInfo, Signature,
|
||||
ValidationCode, ValidationCodeHash, ValidatorId, ValidatorIndex,
|
||||
};
|
||||
use sp_core::{
|
||||
u32_trait::{_1, _2, _3, _4, _5},
|
||||
@@ -148,7 +157,19 @@ impl Contains<Call> for BaseFilter {
|
||||
Call::Multisig(_) |
|
||||
Call::Bounties(_) |
|
||||
Call::Tips(_) |
|
||||
Call::ElectionProviderMultiPhase(_) => true,
|
||||
Call::ElectionProviderMultiPhase(_) |
|
||||
Call::Configuration(_) |
|
||||
Call::ParasShared(_) |
|
||||
Call::ParaInclusion(_) |
|
||||
Call::Paras(_) |
|
||||
Call::Initializer(_) |
|
||||
Call::ParaInherent(_) |
|
||||
Call::Dmp(_) |
|
||||
Call::Ump(_) |
|
||||
Call::Hrmp(_) |
|
||||
Call::Slots(_) => true,
|
||||
// Disable paras registration, crowdloans, and auctions for now.
|
||||
Call::Registrar(_) | Call::Auctions(_) | Call::Crowdloan(_) => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -317,8 +338,8 @@ impl_opaque_keys! {
|
||||
pub grandpa: Grandpa,
|
||||
pub babe: Babe,
|
||||
pub im_online: ImOnline,
|
||||
pub para_validator: ParachainSessionKeyPlaceholder<Runtime>,
|
||||
pub para_assignment: AssignmentSessionKeyPlaceholder<Runtime>,
|
||||
pub para_validator: Initializer,
|
||||
pub para_assignment: ParaSessionInfo,
|
||||
pub authority_discovery: AuthorityDiscovery,
|
||||
}
|
||||
}
|
||||
@@ -944,6 +965,7 @@ pub enum ProxyType {
|
||||
// Skip 4 as it is now removed (was SudoBalances)
|
||||
IdentityJudgement = 5,
|
||||
CancelProxy = 6,
|
||||
Auction = 7,
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
@@ -1017,7 +1039,14 @@ impl InstanceFilter<Call> for ProxyType {
|
||||
Call::Utility(..) |
|
||||
Call::Identity(..) |
|
||||
Call::Proxy(..) |
|
||||
Call::Multisig(..)
|
||||
Call::Multisig(..) |
|
||||
Call::Registrar(paras_registrar::Call::register {..}) |
|
||||
Call::Registrar(paras_registrar::Call::deregister {..}) |
|
||||
// Specifically omitting Registrar `swap`
|
||||
Call::Registrar(paras_registrar::Call::reserve {..}) |
|
||||
Call::Crowdloan(..) |
|
||||
Call::Slots(..) |
|
||||
Call::Auctions(..) // Specifically omitting the entire XCM Pallet
|
||||
),
|
||||
ProxyType::Governance => matches!(
|
||||
c,
|
||||
@@ -1037,6 +1066,10 @@ impl InstanceFilter<Call> for ProxyType {
|
||||
ProxyType::CancelProxy => {
|
||||
matches!(c, Call::Proxy(pallet_proxy::Call::reject_announcement { .. }))
|
||||
},
|
||||
ProxyType::Auction => matches!(
|
||||
c,
|
||||
Call::Auctions(..) | Call::Crowdloan(..) | Call::Registrar(..) | Call::Slots(..)
|
||||
),
|
||||
}
|
||||
}
|
||||
fn is_superset(&self, o: &Self) -> bool {
|
||||
@@ -1065,6 +1098,135 @@ impl pallet_proxy::Config for Runtime {
|
||||
type AnnouncementDepositFactor = AnnouncementDepositFactor;
|
||||
}
|
||||
|
||||
impl parachains_origin::Config for Runtime {}
|
||||
|
||||
impl parachains_configuration::Config for Runtime {
|
||||
type WeightInfo = weights::runtime_parachains_configuration::WeightInfo<Runtime>;
|
||||
}
|
||||
|
||||
impl parachains_shared::Config for Runtime {}
|
||||
|
||||
impl parachains_session_info::Config for Runtime {}
|
||||
|
||||
impl parachains_inclusion::Config for Runtime {
|
||||
type Event = Event;
|
||||
type DisputesHandler = ();
|
||||
type RewardValidators = parachains_reward_points::RewardValidatorsWithEraPoints<Runtime>;
|
||||
}
|
||||
|
||||
impl parachains_paras::Config for Runtime {
|
||||
type Origin = Origin;
|
||||
type Event = Event;
|
||||
type WeightInfo = weights::runtime_parachains_paras::WeightInfo<Runtime>;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
pub const FirstMessageFactorPercent: u64 = 100;
|
||||
}
|
||||
|
||||
impl parachains_ump::Config for Runtime {
|
||||
type Event = Event;
|
||||
type UmpSink = ();
|
||||
type FirstMessageFactorPercent = FirstMessageFactorPercent;
|
||||
type ExecuteOverweightOrigin = EnsureRoot<AccountId>;
|
||||
}
|
||||
|
||||
impl parachains_dmp::Config for Runtime {}
|
||||
|
||||
impl parachains_hrmp::Config for Runtime {
|
||||
type Event = Event;
|
||||
type Origin = Origin;
|
||||
type Currency = Balances;
|
||||
}
|
||||
|
||||
impl parachains_paras_inherent::Config for Runtime {}
|
||||
|
||||
impl parachains_scheduler::Config for Runtime {}
|
||||
|
||||
impl parachains_initializer::Config for Runtime {
|
||||
type Randomness = pallet_babe::RandomnessFromOneEpochAgo<Runtime>;
|
||||
type ForceOrigin = EnsureRoot<AccountId>;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
// Mostly arbitrary deposit price, but should provide an adequate incentive not to spam reserve
|
||||
// `ParaId`s.
|
||||
pub const ParaDeposit: Balance = 100 * DOLLARS;
|
||||
pub const ParaDataByteDeposit: Balance = deposit(0, 1);
|
||||
}
|
||||
|
||||
impl paras_registrar::Config for Runtime {
|
||||
type Event = Event;
|
||||
type Origin = Origin;
|
||||
type Currency = Balances;
|
||||
type OnSwap = (Crowdloan, Slots);
|
||||
type ParaDeposit = ParaDeposit;
|
||||
type DataDepositPerByte = ParaDataByteDeposit;
|
||||
type WeightInfo = weights::runtime_common_paras_registrar::WeightInfo<Runtime>;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
// 12 weeks = 3 months per lease period -> 8 lease periods ~ 2 years
|
||||
pub const LeasePeriod: BlockNumber = 12 * WEEKS;
|
||||
}
|
||||
|
||||
impl slots::Config for Runtime {
|
||||
type Event = Event;
|
||||
type Currency = Balances;
|
||||
type Registrar = Registrar;
|
||||
type LeasePeriod = LeasePeriod;
|
||||
type WeightInfo = weights::runtime_common_slots::WeightInfo<Runtime>;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
pub const CrowdloanId: PalletId = PalletId(*b"py/cfund");
|
||||
// Accounts for 10_000 contributions, each using 48 bytes (16 bytes for balance, and 32 bytes
|
||||
// for a memo).
|
||||
pub const SubmissionDeposit: Balance = deposit(1, 480_000);
|
||||
// The minimum crowdloan contribution.
|
||||
pub const MinContribution: Balance = 5 * DOLLARS;
|
||||
pub const RemoveKeysLimit: u32 = 1000;
|
||||
// Allow 32 bytes for an additional memo to a crowdloan.
|
||||
pub const MaxMemoLength: u8 = 32;
|
||||
}
|
||||
|
||||
impl crowdloan::Config for Runtime {
|
||||
type Event = Event;
|
||||
type PalletId = CrowdloanId;
|
||||
type SubmissionDeposit = SubmissionDeposit;
|
||||
type MinContribution = MinContribution;
|
||||
type RemoveKeysLimit = RemoveKeysLimit;
|
||||
type Registrar = Registrar;
|
||||
type Auctioneer = Auctions;
|
||||
type MaxMemoLength = MaxMemoLength;
|
||||
type WeightInfo = weights::runtime_common_crowdloan::WeightInfo<Runtime>;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
// The average auction is 7 days long, so this will be 70% for ending period.
|
||||
// 5 Days = 72000 Blocks @ 6 sec per block
|
||||
pub const EndingPeriod: BlockNumber = 5 * DAYS;
|
||||
// ~ 1000 samples per day -> ~ 20 blocks per sample -> 2 minute samples
|
||||
pub const SampleLength: BlockNumber = 2 * MINUTES;
|
||||
}
|
||||
|
||||
type AuctionInitiate = EnsureOneOf<
|
||||
AccountId,
|
||||
EnsureRoot<AccountId>,
|
||||
pallet_collective::EnsureProportionAtLeast<_2, _3, AccountId, CouncilCollective>,
|
||||
>;
|
||||
|
||||
impl auctions::Config for Runtime {
|
||||
type Event = Event;
|
||||
type Leaser = Slots;
|
||||
type Registrar = Registrar;
|
||||
type EndingPeriod = EndingPeriod;
|
||||
type SampleLength = SampleLength;
|
||||
type Randomness = pallet_babe::RandomnessFromOneEpochAgo<Runtime>;
|
||||
type InitiateOrigin = AuctionInitiate;
|
||||
type WeightInfo = weights::runtime_common_auctions::WeightInfo<Runtime>;
|
||||
}
|
||||
|
||||
construct_runtime! {
|
||||
pub enum Runtime where
|
||||
Block = Block,
|
||||
@@ -1125,6 +1287,26 @@ construct_runtime! {
|
||||
|
||||
// Election pallet. Only works with staking, but placed here to maintain indices.
|
||||
ElectionProviderMultiPhase: pallet_election_provider_multi_phase::{Pallet, Call, Storage, Event<T>, ValidateUnsigned} = 36,
|
||||
|
||||
// Parachains pallets. Start indices at 50 to leave room.
|
||||
ParachainsOrigin: parachains_origin::{Pallet, Origin} = 50,
|
||||
Configuration: parachains_configuration::{Pallet, Call, Storage, Config<T>} = 51,
|
||||
ParasShared: parachains_shared::{Pallet, Call, Storage} = 52,
|
||||
ParaInclusion: parachains_inclusion::{Pallet, Call, Storage, Event<T>} = 53,
|
||||
ParaInherent: parachains_paras_inherent::{Pallet, Call, Storage, Inherent} = 54,
|
||||
ParaScheduler: parachains_scheduler::{Pallet, Storage} = 55,
|
||||
Paras: parachains_paras::{Pallet, Call, Storage, Event, Config} = 56,
|
||||
Initializer: parachains_initializer::{Pallet, Call, Storage} = 57,
|
||||
Dmp: parachains_dmp::{Pallet, Call, Storage} = 58,
|
||||
Ump: parachains_ump::{Pallet, Call, Storage, Event} = 59,
|
||||
Hrmp: parachains_hrmp::{Pallet, Call, Storage, Event<T>} = 60,
|
||||
ParaSessionInfo: parachains_session_info::{Pallet, Storage} = 61,
|
||||
|
||||
// Parachain Onboarding Pallets. Start indices at 70 to leave room.
|
||||
Registrar: paras_registrar::{Pallet, Call, Storage, Event<T>} = 70,
|
||||
Slots: slots::{Pallet, Call, Storage, Event<T>} = 71,
|
||||
Auctions: auctions::{Pallet, Call, Storage, Event<T>} = 72,
|
||||
Crowdloan: crowdloan::{Pallet, Call, Storage, Event<T>} = 73,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1159,6 +1341,7 @@ pub type Executive = frame_executive::Executive<
|
||||
Runtime,
|
||||
AllPallets,
|
||||
(
|
||||
SetInitialHostConfiguration,
|
||||
BountiesPrefixMigration,
|
||||
CouncilStoragePrefixMigration,
|
||||
TechnicalCommitteeStoragePrefixMigration,
|
||||
@@ -1230,7 +1413,7 @@ impl OnRuntimeUpgrade for CouncilStoragePrefixMigration {
|
||||
}
|
||||
|
||||
const TECHNICAL_COMMITTEE_OLD_PREFIX: &str = "Instance2Collective";
|
||||
/// Migrate from 'Instance2Collective' to the new pallet prefix `TechnicalCommittee`
|
||||
/// Migrate from `Instance2Collective` to the new pallet prefix `TechnicalCommittee`
|
||||
pub struct TechnicalCommitteeStoragePrefixMigration;
|
||||
|
||||
impl OnRuntimeUpgrade for TechnicalCommitteeStoragePrefixMigration {
|
||||
@@ -1297,6 +1480,64 @@ impl OnRuntimeUpgrade for TechnicalMembershipStoragePrefixMigration {
|
||||
}
|
||||
}
|
||||
|
||||
/// Set the initial host configuration for Polkadot.
|
||||
pub struct SetInitialHostConfiguration;
|
||||
impl OnRuntimeUpgrade for SetInitialHostConfiguration {
|
||||
fn on_runtime_upgrade() -> frame_support::weights::Weight {
|
||||
use parachains_configuration::HostConfiguration;
|
||||
|
||||
let active_config: HostConfiguration<BlockNumber> = HostConfiguration {
|
||||
max_code_size: 10_485_760,
|
||||
max_head_data_size: 20_480,
|
||||
max_upward_queue_count: 10,
|
||||
max_upward_queue_size: 51_200,
|
||||
max_upward_message_size: 51_200,
|
||||
max_upward_message_num_per_candidate: 10,
|
||||
hrmp_max_message_num_per_candidate: 10,
|
||||
validation_upgrade_frequency: 14_400,
|
||||
validation_upgrade_delay: 600,
|
||||
max_pov_size: 5_242_880,
|
||||
max_downward_message_size: 51_200,
|
||||
ump_service_total_weight: 100_000_000_000,
|
||||
hrmp_max_parachain_outbound_channels: 10,
|
||||
hrmp_max_parathread_outbound_channels: 0,
|
||||
hrmp_sender_deposit: deposit(1004, 100 * 1024),
|
||||
hrmp_recipient_deposit: deposit(1004, 100 * 1024),
|
||||
hrmp_channel_max_capacity: 1_000,
|
||||
hrmp_channel_max_total_size: 102_400,
|
||||
hrmp_max_parachain_inbound_channels: 10,
|
||||
hrmp_max_parathread_inbound_channels: 0,
|
||||
hrmp_channel_max_message_size: 102_400,
|
||||
code_retention_period: EPOCH_DURATION_IN_SLOTS * 6,
|
||||
parathread_cores: 0,
|
||||
parathread_retries: 0,
|
||||
group_rotation_frequency: 10,
|
||||
chain_availability_period: 10,
|
||||
thread_availability_period: 10,
|
||||
scheduling_lookahead: 1,
|
||||
max_validators_per_core: Some(5),
|
||||
max_validators: Some(200),
|
||||
dispute_period: 6,
|
||||
dispute_post_conclusion_acceptance_period: 600,
|
||||
dispute_max_spam_slots: 2,
|
||||
dispute_conclusion_by_time_out_period: 600,
|
||||
no_show_slots: 2,
|
||||
n_delay_tranches: 89,
|
||||
zeroth_delay_tranche_width: 0,
|
||||
needed_approvals: 30,
|
||||
relay_vrf_modulo_samples: 40,
|
||||
ump_max_individual_weight: 20 * WEIGHT_PER_MILLIS,
|
||||
};
|
||||
|
||||
// Only set the config if it's needed to be set explicitly.
|
||||
if Configuration::config() == Default::default() {
|
||||
Configuration::force_set_active_config(active_config);
|
||||
}
|
||||
|
||||
RocksDbWeight::get().reads(1) + RocksDbWeight::get().writes(1)
|
||||
}
|
||||
}
|
||||
|
||||
const TIPS_OLD_PREFIX: &str = "Treasury";
|
||||
/// Migrate pallet-tips from `Treasury` to the new pallet prefix `Tips`
|
||||
pub struct MigrateTipsPalletPrefix;
|
||||
@@ -1380,60 +1621,69 @@ sp_api::impl_runtime_apis! {
|
||||
|
||||
impl primitives::v1::ParachainHost<Block, Hash, BlockNumber> for Runtime {
|
||||
fn validators() -> Vec<ValidatorId> {
|
||||
Vec::new()
|
||||
parachains_runtime_api_impl::validators::<Runtime>()
|
||||
}
|
||||
|
||||
fn validator_groups() -> (Vec<Vec<ValidatorIndex>>, GroupRotationInfo<BlockNumber>) {
|
||||
(Vec::new(), GroupRotationInfo { session_start_block: 0, group_rotation_frequency: 0, now: 0 })
|
||||
parachains_runtime_api_impl::validator_groups::<Runtime>()
|
||||
}
|
||||
|
||||
fn availability_cores() -> Vec<CoreState<Hash, BlockNumber>> {
|
||||
Vec::new()
|
||||
parachains_runtime_api_impl::availability_cores::<Runtime>()
|
||||
}
|
||||
|
||||
fn persisted_validation_data(_: Id, _: OccupiedCoreAssumption)
|
||||
fn persisted_validation_data(para_id: ParaId, assumption: OccupiedCoreAssumption)
|
||||
-> Option<PersistedValidationData<Hash, BlockNumber>> {
|
||||
None
|
||||
parachains_runtime_api_impl::persisted_validation_data::<Runtime>(para_id, assumption)
|
||||
}
|
||||
|
||||
fn check_validation_outputs(_: Id, _: primitives::v1::CandidateCommitments) -> bool {
|
||||
false
|
||||
fn check_validation_outputs(
|
||||
para_id: ParaId,
|
||||
outputs: primitives::v1::CandidateCommitments,
|
||||
) -> bool {
|
||||
parachains_runtime_api_impl::check_validation_outputs::<Runtime>(para_id, outputs)
|
||||
}
|
||||
|
||||
fn session_index_for_child() -> SessionIndex {
|
||||
0
|
||||
parachains_runtime_api_impl::session_index_for_child::<Runtime>()
|
||||
}
|
||||
|
||||
fn session_info(_: SessionIndex) -> Option<SessionInfo> {
|
||||
None
|
||||
fn validation_code(para_id: ParaId, assumption: OccupiedCoreAssumption)
|
||||
-> Option<ValidationCode> {
|
||||
parachains_runtime_api_impl::validation_code::<Runtime>(para_id, assumption)
|
||||
}
|
||||
|
||||
fn validation_code(_: Id, _: OccupiedCoreAssumption) -> Option<ValidationCode> {
|
||||
None
|
||||
}
|
||||
|
||||
fn candidate_pending_availability(_: Id) -> Option<CommittedCandidateReceipt<Hash>> {
|
||||
None
|
||||
fn candidate_pending_availability(para_id: ParaId) -> Option<CommittedCandidateReceipt<Hash>> {
|
||||
parachains_runtime_api_impl::candidate_pending_availability::<Runtime>(para_id)
|
||||
}
|
||||
|
||||
fn candidate_events() -> Vec<CandidateEvent<Hash>> {
|
||||
Vec::new()
|
||||
parachains_runtime_api_impl::candidate_events::<Runtime, _>(|ev| {
|
||||
match ev {
|
||||
Event::ParaInclusion(ev) => {
|
||||
Some(ev)
|
||||
}
|
||||
_ => None,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fn dmq_contents(
|
||||
_recipient: Id,
|
||||
) -> Vec<InboundDownwardMessage<BlockNumber>> {
|
||||
Vec::new()
|
||||
fn session_info(index: SessionIndex) -> Option<SessionInfo> {
|
||||
parachains_runtime_api_impl::session_info::<Runtime>(index)
|
||||
}
|
||||
|
||||
fn dmq_contents(recipient: ParaId) -> Vec<InboundDownwardMessage<BlockNumber>> {
|
||||
parachains_runtime_api_impl::dmq_contents::<Runtime>(recipient)
|
||||
}
|
||||
|
||||
fn inbound_hrmp_channels_contents(
|
||||
_recipient: Id
|
||||
) -> BTreeMap<Id, Vec<InboundHrmpMessage<BlockNumber>>> {
|
||||
BTreeMap::new()
|
||||
recipient: ParaId
|
||||
) -> BTreeMap<ParaId, Vec<InboundHrmpMessage<BlockNumber>>> {
|
||||
parachains_runtime_api_impl::inbound_hrmp_channels_contents::<Runtime>(recipient)
|
||||
}
|
||||
|
||||
fn validation_code_by_hash(_hash: ValidationCodeHash) -> Option<ValidationCode> {
|
||||
None
|
||||
fn validation_code_by_hash(hash: ValidationCodeHash) -> Option<ValidationCode> {
|
||||
parachains_runtime_api_impl::validation_code_by_hash::<Runtime>(hash)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1626,6 +1876,10 @@ sp_api::impl_runtime_apis! {
|
||||
// NOTE: Make sure to prefix these `runtime_common::` so that path resolves correctly
|
||||
// in the generated file.
|
||||
list_benchmark!(list, extra, runtime_common::claims, Claims);
|
||||
list_benchmark!(list, extra, runtime_common::crowdloan, Crowdloan);
|
||||
list_benchmark!(list, extra, runtime_common::claims, Claims);
|
||||
list_benchmark!(list, extra, runtime_common::slots, Slots);
|
||||
list_benchmark!(list, extra, runtime_common::paras_registrar, Registrar);
|
||||
// Substrate
|
||||
list_benchmark!(list, extra, pallet_balances, Balances);
|
||||
list_benchmark!(list, extra, pallet_bounties, Bounties);
|
||||
@@ -1694,6 +1948,10 @@ sp_api::impl_runtime_apis! {
|
||||
// NOTE: Make sure to prefix these `runtime_common::` so that path resolves correctly
|
||||
// in the generated file.
|
||||
add_benchmark!(params, batches, runtime_common::claims, Claims);
|
||||
add_benchmark!(params, batches, runtime_common::crowdloan, Crowdloan);
|
||||
add_benchmark!(params, batches, runtime_common::claims, Claims);
|
||||
add_benchmark!(params, batches, runtime_common::slots, Slots);
|
||||
add_benchmark!(params, batches, runtime_common::paras_registrar, Registrar);
|
||||
// Substrate
|
||||
add_benchmark!(params, batches, pallet_balances, Balances);
|
||||
add_benchmark!(params, batches, pallet_bounties, Bounties);
|
||||
|
||||
@@ -37,4 +37,10 @@ pub mod pallet_tips;
|
||||
pub mod pallet_treasury;
|
||||
pub mod pallet_utility;
|
||||
pub mod pallet_vesting;
|
||||
pub mod runtime_common_auctions;
|
||||
pub mod runtime_common_claims;
|
||||
pub mod runtime_common_crowdloan;
|
||||
pub mod runtime_common_paras_registrar;
|
||||
pub mod runtime_common_slots;
|
||||
pub mod runtime_parachains_configuration;
|
||||
pub mod runtime_parachains_paras;
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
// Copyright 2017-2020 Parity Technologies (UK) Ltd.
|
||||
// This file is part of Polkadot.
|
||||
|
||||
// Polkadot is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// Polkadot is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
|
||||
//! Autogenerated weights for `runtime_common::auctions`
|
||||
//!
|
||||
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0
|
||||
//! DATE: 2021-07-01, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
|
||||
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 128
|
||||
|
||||
// Executed Command:
|
||||
// target/release/polkadot
|
||||
// benchmark
|
||||
// --chain=kusama-dev
|
||||
// --steps=50
|
||||
// --repeat=20
|
||||
// --pallet=runtime_common::auctions
|
||||
// --extrinsic=*
|
||||
// --execution=wasm
|
||||
// --wasm-execution=compiled
|
||||
// --heap-pages=4096
|
||||
// --header=./file_header.txt
|
||||
// --output=./runtime/kusama/src/weights/
|
||||
|
||||
#![allow(unused_parens)]
|
||||
#![allow(unused_imports)]
|
||||
|
||||
use frame_support::{traits::Get, weights::Weight};
|
||||
use sp_std::marker::PhantomData;
|
||||
|
||||
/// Weight functions for `runtime_common::auctions`.
|
||||
pub struct WeightInfo<T>(PhantomData<T>);
|
||||
impl<T: frame_system::Config> runtime_common::auctions::WeightInfo for WeightInfo<T> {
|
||||
fn new_auction() -> Weight {
|
||||
(24_436_000 as Weight)
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
}
|
||||
fn bid() -> Weight {
|
||||
(137_499_000 as Weight)
|
||||
.saturating_add(T::DbWeight::get().reads(8 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(4 as Weight))
|
||||
}
|
||||
fn on_initialize() -> Weight {
|
||||
(23_555_687_000 as Weight)
|
||||
.saturating_add(T::DbWeight::get().reads(3688 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(3683 as Weight))
|
||||
}
|
||||
fn cancel_auction() -> Weight {
|
||||
(5_007_594_000 as Weight)
|
||||
.saturating_add(T::DbWeight::get().reads(73 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(3673 as Weight))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
// Copyright 2017-2021 Parity Technologies (UK) Ltd.
|
||||
// This file is part of Polkadot.
|
||||
|
||||
// Polkadot is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// Polkadot is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
|
||||
//! Autogenerated weights for `runtime_common::crowdloan`
|
||||
//!
|
||||
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
|
||||
//! DATE: 2021-09-15, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
|
||||
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("polkadot-dev"), DB CACHE: 128
|
||||
|
||||
// Executed Command:
|
||||
// target/release/polkadot
|
||||
// benchmark
|
||||
// --chain=polkadot-dev
|
||||
// --steps=50
|
||||
// --repeat=20
|
||||
// --pallet=runtime_common::crowdloan
|
||||
// --extrinsic=*
|
||||
// --execution=wasm
|
||||
// --wasm-execution=compiled
|
||||
// --heap-pages=4096
|
||||
// --header=./file_header.txt
|
||||
// --output=./runtime/polkadot/src/weights/runtime_common_crowdloan.rs
|
||||
|
||||
|
||||
#![cfg_attr(rustfmt, rustfmt_skip)]
|
||||
#![allow(unused_parens)]
|
||||
#![allow(unused_imports)]
|
||||
|
||||
use frame_support::{traits::Get, weights::Weight};
|
||||
use sp_std::marker::PhantomData;
|
||||
|
||||
/// Weight functions for runtime_common::crowdloan.
|
||||
pub struct WeightInfo<T>(PhantomData<T>);
|
||||
impl<T: frame_system::Config> runtime_common::crowdloan::WeightInfo for WeightInfo<T> {
|
||||
// Storage: Crowdloan Funds (r:1 w:1)
|
||||
// Storage: Registrar Paras (r:1 w:1)
|
||||
// Storage: Paras ParaLifecycles (r:1 w:0)
|
||||
// Storage: Crowdloan NextTrieIndex (r:1 w:1)
|
||||
fn create() -> Weight {
|
||||
(78_186_000 as Weight)
|
||||
.saturating_add(T::DbWeight::get().reads(4 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(3 as Weight))
|
||||
}
|
||||
// Storage: Crowdloan Funds (r:1 w:1)
|
||||
// Storage: Slots Leases (r:1 w:0)
|
||||
// Storage: Auctions AuctionInfo (r:1 w:0)
|
||||
// Storage: System Account (r:1 w:1)
|
||||
// Storage: Crowdloan EndingsCount (r:1 w:0)
|
||||
// Storage: Crowdloan NewRaise (r:1 w:1)
|
||||
// Storage: unknown [0xd861ea1ebf4800d4b89f4ff787ad79ee96d9a708c85b57da7eb8f9ddeda61291] (r:1 w:1)
|
||||
fn contribute() -> Weight {
|
||||
(294_308_000 as Weight)
|
||||
.saturating_add(T::DbWeight::get().reads(7 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(4 as Weight))
|
||||
}
|
||||
// Storage: Crowdloan Funds (r:1 w:1)
|
||||
// Storage: System Account (r:2 w:2)
|
||||
// Storage: unknown [0xc85982571aa615c788ef9b2c16f54f25773fd439e8ee1ed2aa3ae43d48e880f0] (r:1 w:1)
|
||||
fn withdraw() -> Weight {
|
||||
(102_518_000 as Weight)
|
||||
.saturating_add(T::DbWeight::get().reads(4 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(4 as Weight))
|
||||
}
|
||||
// Storage: Skipped Metadata (r:0 w:0)
|
||||
fn refund(k: u32, ) -> Weight {
|
||||
(0 as Weight)
|
||||
// Standard Error: 22_000
|
||||
.saturating_add((38_550_000 as Weight).saturating_mul(k as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(k as Weight)))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(k as Weight)))
|
||||
}
|
||||
// Storage: Crowdloan Funds (r:1 w:1)
|
||||
// Storage: System Account (r:1 w:1)
|
||||
fn dissolve() -> Weight {
|
||||
(58_176_000 as Weight)
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
}
|
||||
// Storage: Crowdloan Funds (r:1 w:1)
|
||||
fn edit() -> Weight {
|
||||
(37_125_000 as Weight)
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
// Storage: Crowdloan Funds (r:1 w:0)
|
||||
// Storage: unknown [0xd861ea1ebf4800d4b89f4ff787ad79ee96d9a708c85b57da7eb8f9ddeda61291] (r:1 w:1)
|
||||
fn add_memo() -> Weight {
|
||||
(55_338_000 as Weight)
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
// Storage: Crowdloan Funds (r:1 w:0)
|
||||
// Storage: Crowdloan NewRaise (r:1 w:1)
|
||||
fn poke() -> Weight {
|
||||
(41_233_000 as Weight)
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
// Storage: Auctions AuctionInfo (r:1 w:0)
|
||||
// Storage: Crowdloan EndingsCount (r:1 w:1)
|
||||
// Storage: Crowdloan NewRaise (r:1 w:1)
|
||||
// Storage: Crowdloan Funds (r:2 w:0)
|
||||
// Storage: Auctions AuctionCounter (r:1 w:0)
|
||||
// Storage: Paras ParaLifecycles (r:2 w:0)
|
||||
// Storage: Slots Leases (r:2 w:0)
|
||||
// Storage: Auctions Winning (r:1 w:1)
|
||||
// Storage: Auctions ReservedAmounts (r:2 w:2)
|
||||
// Storage: System Account (r:2 w:2)
|
||||
fn on_initialize(n: u32, ) -> Weight {
|
||||
(0 as Weight)
|
||||
// Standard Error: 25_000
|
||||
.saturating_add((98_572_000 as Weight).saturating_mul(n as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(5 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads((5 as Weight).saturating_mul(n as Weight)))
|
||||
.saturating_add(T::DbWeight::get().writes(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(n as Weight)))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
// Copyright 2017-2021 Parity Technologies (UK) Ltd.
|
||||
// This file is part of Polkadot.
|
||||
|
||||
// Polkadot is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// Polkadot is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
|
||||
//! Autogenerated weights for `runtime_common::paras_registrar`
|
||||
//!
|
||||
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
|
||||
//! DATE: 2021-09-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
|
||||
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("polkadot-dev"), DB CACHE: 128
|
||||
|
||||
// Executed Command:
|
||||
// target/release/polkadot
|
||||
// benchmark
|
||||
// --chain=polkadot-dev
|
||||
// --steps=50
|
||||
// --repeat=20
|
||||
// --pallet=runtime_common::paras_registrar
|
||||
// --extrinsic=*
|
||||
// --execution=wasm
|
||||
// --wasm-execution=compiled
|
||||
// --heap-pages=4096
|
||||
// --header=./file_header.txt
|
||||
// --output=./runtime/polkadot/src/weights/runtime_common_paras_registrar.rs
|
||||
|
||||
|
||||
#![cfg_attr(rustfmt, rustfmt_skip)]
|
||||
#![allow(unused_parens)]
|
||||
#![allow(unused_imports)]
|
||||
|
||||
use frame_support::{traits::Get, weights::Weight};
|
||||
use sp_std::marker::PhantomData;
|
||||
|
||||
/// Weight functions for runtime_common::paras_registrar.
|
||||
pub struct WeightInfo<T>(PhantomData<T>);
|
||||
impl<T: frame_system::Config> runtime_common::paras_registrar::WeightInfo for WeightInfo<T> {
|
||||
// Storage: Registrar NextFreeParaId (r:1 w:1)
|
||||
// Storage: Registrar Paras (r:1 w:1)
|
||||
// Storage: Paras ParaLifecycles (r:1 w:0)
|
||||
fn reserve() -> Weight {
|
||||
(43_636_000 as Weight)
|
||||
.saturating_add(T::DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
}
|
||||
// Storage: Registrar Paras (r:1 w:1)
|
||||
// Storage: Paras ParaLifecycles (r:1 w:1)
|
||||
// Storage: Configuration ActiveConfig (r:1 w:0)
|
||||
// Storage: ParasShared CurrentSessionIndex (r:1 w:0)
|
||||
// Storage: Paras ActionsQueue (r:1 w:1)
|
||||
// Storage: Paras UpcomingParasGenesis (r:0 w:1)
|
||||
fn register() -> Weight {
|
||||
(5_587_963_000 as Weight)
|
||||
.saturating_add(T::DbWeight::get().reads(5 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(4 as Weight))
|
||||
}
|
||||
// Storage: Registrar Paras (r:1 w:1)
|
||||
// Storage: Paras ParaLifecycles (r:1 w:1)
|
||||
// Storage: Configuration ActiveConfig (r:1 w:0)
|
||||
// Storage: ParasShared CurrentSessionIndex (r:1 w:0)
|
||||
// Storage: Paras ActionsQueue (r:1 w:1)
|
||||
// Storage: Paras UpcomingParasGenesis (r:0 w:1)
|
||||
fn force_register() -> Weight {
|
||||
(5_568_018_000 as Weight)
|
||||
.saturating_add(T::DbWeight::get().reads(5 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(4 as Weight))
|
||||
}
|
||||
// Storage: Registrar Paras (r:1 w:1)
|
||||
// Storage: Paras ParaLifecycles (r:1 w:1)
|
||||
// Storage: ParasShared CurrentSessionIndex (r:1 w:0)
|
||||
// Storage: Paras ActionsQueue (r:1 w:1)
|
||||
// Storage: Registrar PendingSwap (r:0 w:1)
|
||||
fn deregister() -> Weight {
|
||||
(76_644_000 as Weight)
|
||||
.saturating_add(T::DbWeight::get().reads(4 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(4 as Weight))
|
||||
}
|
||||
// Storage: Registrar Paras (r:1 w:0)
|
||||
// Storage: Registrar PendingSwap (r:1 w:1)
|
||||
// Storage: Paras ParaLifecycles (r:2 w:2)
|
||||
// Storage: ParasShared CurrentSessionIndex (r:1 w:0)
|
||||
// Storage: Paras ActionsQueue (r:1 w:1)
|
||||
// Storage: Crowdloan Funds (r:2 w:2)
|
||||
// Storage: Slots Leases (r:2 w:2)
|
||||
fn swap() -> Weight {
|
||||
(68_141_000 as Weight)
|
||||
.saturating_add(T::DbWeight::get().reads(10 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(8 as Weight))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
// Copyright 2017-2020 Parity Technologies (UK) Ltd.
|
||||
// This file is part of Polkadot.
|
||||
|
||||
// Polkadot is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// Polkadot is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
|
||||
//! Autogenerated weights for `runtime_common::slots`
|
||||
//!
|
||||
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0
|
||||
//! DATE: 2021-07-01, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
|
||||
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 128
|
||||
|
||||
// Executed Command:
|
||||
// target/release/polkadot
|
||||
// benchmark
|
||||
// --chain=kusama-dev
|
||||
// --steps=50
|
||||
// --repeat=20
|
||||
// --pallet=runtime_common::slots
|
||||
// --extrinsic=*
|
||||
// --execution=wasm
|
||||
// --wasm-execution=compiled
|
||||
// --heap-pages=4096
|
||||
// --header=./file_header.txt
|
||||
// --output=./runtime/kusama/src/weights/
|
||||
|
||||
#![allow(unused_parens)]
|
||||
#![allow(unused_imports)]
|
||||
|
||||
use frame_support::{traits::Get, weights::Weight};
|
||||
use sp_std::marker::PhantomData;
|
||||
|
||||
/// Weight functions for `runtime_common::slots`.
|
||||
pub struct WeightInfo<T>(PhantomData<T>);
|
||||
impl<T: frame_system::Config> runtime_common::slots::WeightInfo for WeightInfo<T> {
|
||||
fn force_lease() -> Weight {
|
||||
(92_502_000 as Weight)
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
}
|
||||
fn manage_lease_period_start(c: u32, t: u32) -> Weight {
|
||||
(0 as Weight)
|
||||
// Standard Error: 17_000
|
||||
.saturating_add((16_401_000 as Weight).saturating_mul(c as Weight))
|
||||
// Standard Error: 17_000
|
||||
.saturating_add((34_480_000 as Weight).saturating_mul(t as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(4 as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(c as Weight)))
|
||||
.saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(t as Weight)))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(c as Weight)))
|
||||
.saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(t as Weight)))
|
||||
}
|
||||
fn clear_all_leases() -> Weight {
|
||||
(194_756_000 as Weight)
|
||||
.saturating_add(T::DbWeight::get().reads(9 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(9 as Weight))
|
||||
}
|
||||
fn trigger_onboard() -> Weight {
|
||||
(41_785_000 as Weight)
|
||||
.saturating_add(T::DbWeight::get().reads(5 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(3 as Weight))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
// Copyright 2017-2021 Parity Technologies (UK) Ltd.
|
||||
// This file is part of Polkadot.
|
||||
|
||||
// Polkadot is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// Polkadot is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
|
||||
//! Autogenerated weights for `runtime_parachains::configuration`
|
||||
//!
|
||||
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
|
||||
//! DATE: 2021-09-17, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
|
||||
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 128
|
||||
|
||||
// Executed Command:
|
||||
// target/release/polkadot
|
||||
// benchmark
|
||||
// --chain=kusama-dev
|
||||
// --steps=50
|
||||
// --repeat=20
|
||||
// --pallet=runtime_parachains::configuration
|
||||
// --extrinsic=*
|
||||
// --execution=wasm
|
||||
// --wasm-execution=compiled
|
||||
// --heap-pages=4096
|
||||
// --header=./file_header.txt
|
||||
// --output=./runtime/kusama/src/weights/runtime_parachains_configuration.rs
|
||||
|
||||
|
||||
#![cfg_attr(rustfmt, rustfmt_skip)]
|
||||
#![allow(unused_parens)]
|
||||
#![allow(unused_imports)]
|
||||
|
||||
use frame_support::{traits::Get, weights::Weight};
|
||||
use sp_std::marker::PhantomData;
|
||||
|
||||
/// Weight functions for `runtime_parachains::configuration`.
|
||||
pub struct WeightInfo<T>(PhantomData<T>);
|
||||
impl<T: frame_system::Config> runtime_parachains::configuration::WeightInfo for WeightInfo<T> {
|
||||
// Storage: ParasShared CurrentSessionIndex (r:1 w:0)
|
||||
// Storage: Configuration PendingConfig (r:1 w:1)
|
||||
// Storage: Configuration ActiveConfig (r:1 w:0)
|
||||
fn set_config_with_block_number() -> Weight {
|
||||
(12_378_000 as Weight)
|
||||
.saturating_add(T::DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
// Storage: ParasShared CurrentSessionIndex (r:1 w:0)
|
||||
// Storage: Configuration PendingConfig (r:1 w:1)
|
||||
// Storage: Configuration ActiveConfig (r:1 w:0)
|
||||
fn set_config_with_u32() -> Weight {
|
||||
(12_384_000 as Weight)
|
||||
.saturating_add(T::DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
// Storage: ParasShared CurrentSessionIndex (r:1 w:0)
|
||||
// Storage: Configuration PendingConfig (r:1 w:1)
|
||||
// Storage: Configuration ActiveConfig (r:1 w:0)
|
||||
fn set_config_with_option_u32() -> Weight {
|
||||
(12_746_000 as Weight)
|
||||
.saturating_add(T::DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
// Storage: ParasShared CurrentSessionIndex (r:1 w:0)
|
||||
// Storage: Configuration PendingConfig (r:1 w:1)
|
||||
// Storage: Configuration ActiveConfig (r:1 w:0)
|
||||
fn set_config_with_weight() -> Weight {
|
||||
(12_563_000 as Weight)
|
||||
.saturating_add(T::DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
// Storage: Benchmark Override (r:0 w:0)
|
||||
fn set_hrmp_open_request_ttl() -> Weight {
|
||||
(2_000_000_000_000 as Weight)
|
||||
}
|
||||
// Storage: ParasShared CurrentSessionIndex (r:1 w:0)
|
||||
// Storage: Configuration PendingConfig (r:1 w:1)
|
||||
// Storage: Configuration ActiveConfig (r:1 w:0)
|
||||
fn set_config_with_balance() -> Weight {
|
||||
(12_644_000 as Weight)
|
||||
.saturating_add(T::DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
// Copyright 2017-2021 Parity Technologies (UK) Ltd.
|
||||
// This file is part of Polkadot.
|
||||
|
||||
// Polkadot is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// Polkadot is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
|
||||
//! Autogenerated weights for `runtime_parachains::paras`
|
||||
//!
|
||||
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
|
||||
//! DATE: 2021-09-21, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
|
||||
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 128
|
||||
|
||||
// Executed Command:
|
||||
// target/release/polkadot
|
||||
// benchmark
|
||||
// --chain=kusama-dev
|
||||
// --steps=50
|
||||
// --repeat=20
|
||||
// --pallet=runtime_parachains::paras
|
||||
// --extrinsic=*
|
||||
// --execution=wasm
|
||||
// --wasm-execution=compiled
|
||||
// --heap-pages=4096
|
||||
// --header=./file_header.txt
|
||||
// --output=./runtime/kusama/src/weights/runtime_parachains_paras.rs
|
||||
|
||||
|
||||
#![cfg_attr(rustfmt, rustfmt_skip)]
|
||||
#![allow(unused_parens)]
|
||||
#![allow(unused_imports)]
|
||||
|
||||
use frame_support::{traits::Get, weights::Weight};
|
||||
use sp_std::marker::PhantomData;
|
||||
|
||||
/// Weight functions for `runtime_parachains::paras`.
|
||||
pub struct WeightInfo<T>(PhantomData<T>);
|
||||
impl<T: frame_system::Config> runtime_parachains::paras::WeightInfo for WeightInfo<T> {
|
||||
// Storage: Paras CurrentCodeHash (r:1 w:1)
|
||||
// Storage: Paras CodeByHashRefs (r:1 w:1)
|
||||
// Storage: Paras PastCodeMeta (r:1 w:1)
|
||||
// Storage: Paras PastCodePruning (r:1 w:1)
|
||||
// Storage: Paras PastCodeHash (r:0 w:1)
|
||||
// Storage: Paras CodeByHash (r:0 w:1)
|
||||
fn force_set_current_code(c: u32, ) -> Weight {
|
||||
(0 as Weight)
|
||||
// Standard Error: 0
|
||||
.saturating_add((3_000 as Weight).saturating_mul(c as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(4 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(6 as Weight))
|
||||
}
|
||||
// Storage: Paras Heads (r:0 w:1)
|
||||
fn force_set_current_head(s: u32, ) -> Weight {
|
||||
(16_088_000 as Weight)
|
||||
// Standard Error: 0
|
||||
.saturating_add((1_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
// Storage: Configuration ActiveConfig (r:1 w:0)
|
||||
// Storage: Paras FutureCodeUpgrades (r:1 w:1)
|
||||
// Storage: Paras UpcomingUpgrades (r:1 w:1)
|
||||
// Storage: Paras UpgradeCooldowns (r:1 w:1)
|
||||
// Storage: System Digest (r:1 w:1)
|
||||
// Storage: Paras CodeByHashRefs (r:1 w:1)
|
||||
// Storage: Paras CodeByHash (r:0 w:1)
|
||||
// Storage: Paras FutureCodeHash (r:0 w:1)
|
||||
// Storage: Paras UpgradeRestrictionSignal (r:0 w:1)
|
||||
fn force_schedule_code_upgrade(c: u32, ) -> Weight {
|
||||
(0 as Weight)
|
||||
// Standard Error: 0
|
||||
.saturating_add((3_000 as Weight).saturating_mul(c as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(6 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(8 as Weight))
|
||||
}
|
||||
// Storage: Paras FutureCodeUpgrades (r:1 w:1)
|
||||
// Storage: Paras FutureCodeHash (r:1 w:1)
|
||||
// Storage: Paras CurrentCodeHash (r:1 w:1)
|
||||
// Storage: System Digest (r:1 w:1)
|
||||
// Storage: Paras PastCodeMeta (r:1 w:1)
|
||||
// Storage: Paras PastCodePruning (r:1 w:1)
|
||||
// Storage: Paras Heads (r:0 w:1)
|
||||
// Storage: Paras PastCodeHash (r:0 w:1)
|
||||
// Storage: Paras UpgradeGoAheadSignal (r:0 w:1)
|
||||
fn force_note_new_head(s: u32, ) -> Weight {
|
||||
(69_114_000 as Weight)
|
||||
// Standard Error: 0
|
||||
.saturating_add((1_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(6 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(9 as Weight))
|
||||
}
|
||||
// Storage: ParasShared CurrentSessionIndex (r:1 w:0)
|
||||
// Storage: Paras ActionsQueue (r:1 w:1)
|
||||
fn force_queue_action() -> Weight {
|
||||
(26_752_000 as Weight)
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user