difftreelog
fix enable throttling
in: master
6 files changed
node/cli/src/command.rsdiffbeforeafterboth396 }396 }397 }397 }398 #[cfg(feature = "try-runtime")]398 #[cfg(feature = "try-runtime")]399 // embedded try-runtime cli will be removed soon.400 #[allow(deprecated)]399 Some(Subcommand::TryRuntime(cmd)) => {401 Some(Subcommand::TryRuntime(cmd)) => {400 use std::{future::Future, pin::Pin};402 use std::{future::Future, pin::Pin};401403pallets/inflation/src/lib.rsdiffbeforeafterboth727273 // The block number provider, which should be callable from `on_initialize` hook.73 // The block number provider, which should be callable from `on_initialize` hook.74 type OnInitializeBlockNumberProvider: BlockNumberProvider<BlockNumber = BlockNumberFor<Self>>;74 type OnInitializeBlockNumberProvider: BlockNumberProvider<75 BlockNumber = BlockNumberFor<Self>,76 >;757776 /// Number of blocks that pass between treasury balance updates due to inflation78 /// Number of blocks that pass between treasury balance updates due to inflationprimitives/common/src/constants.rsdiffbeforeafterboth232324use crate::types::{Balance, BlockNumber};24use crate::types::{Balance, BlockNumber};252526#[cfg(not(feature = "lookahead"))]26pub const MILLISECS_PER_BLOCK: u64 = 12000;27pub const MILLISECS_PER_BLOCK: u64 = 12000;28#[cfg(feature = "lookahead")]29pub const MILLISECS_PER_BLOCK: u64 = 3000;27pub const MILLISECS_PER_RELAY_BLOCK: u64 = 6000;30pub const MILLISECS_PER_RELAY_BLOCK: u64 = 6000;283129pub const SLOT_DURATION: u64 = MILLISECS_PER_BLOCK;32pub const SLOT_DURATION: u64 = MILLISECS_PER_BLOCK;runtime/common/config/pallets/mod.rsdiffbeforeafterboth21 traits::{ConstU32, ConstU64, Currency},21 traits::{ConstU32, ConstU64, Currency},22};22};23use sp_arithmetic::Perbill;23use sp_arithmetic::Perbill;24use sp_runtime::traits::{BlockNumberProvider, AccountIdConversion};24use sp_runtime::traits::{AccountIdConversion, BlockNumberProvider};25use up_common::{25use up_common::{26 constants::*,26 constants::*,27 types::{AccountId, Balance, BlockNumber},27 types::{AccountId, Balance, BlockNumber},111 type BlockNumber = BlockNumber;111 type BlockNumber = BlockNumber;112112113 fn current_block_number() -> Self::BlockNumber {113 fn current_block_number() -> Self::BlockNumber {114 use parity_scale_codec::Decode;114 use hex_literal::hex;115 use hex_literal::hex;115 use parity_scale_codec::Decode;116 use sp_io::storage;116 use sp_io::storage;117 // TODO: Replace with the following code after https://github.com/paritytech/polkadot-sdk/commit/3ea497b5a0fdda252f9c5a3c257cfaf8685f02fd lands117 // TODO: Replace with the following code after https://github.com/paritytech/polkadot-sdk/commit/3ea497b5a0fdda252f9c5a3c257cfaf8685f02fd lands118 // <cumulus_pallet_parachain_system::Pallet<Runtime>>::last_relay_block_number()118 // <cumulus_pallet_parachain_system::Pallet<Runtime>>::last_relay_block_number()runtime/common/config/parachain.rsdiffbeforeafterboth38 type ReservedDmpWeight = ReservedDmpWeight;38 type ReservedDmpWeight = ReservedDmpWeight;39 type ReservedXcmpWeight = ReservedXcmpWeight;39 type ReservedXcmpWeight = ReservedXcmpWeight;40 type XcmpMessageHandler = XcmpQueue;40 type XcmpMessageHandler = XcmpQueue;41 #[cfg(not(feature = "lookahead"))]41 type CheckAssociatedRelayNumber = cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases;42 type CheckAssociatedRelayNumber = cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases;43 #[cfg(feature = "lookahead")]44 type CheckAssociatedRelayNumber =45 cumulus_pallet_parachain_system::RelayNumberMonotonicallyIncreases;42}46}434744impl parachain_info::Config for Runtime {}48impl parachain_info::Config for Runtime {}454946impl cumulus_pallet_aura_ext::Config for Runtime {}50impl cumulus_pallet_aura_ext::Config for Runtime {}5152/// Maximum number of blocks simultaneously accepted by the Runtime, not yet included53/// into the relay chain.54#[cfg(feature = "lookahead")]55const UNINCLUDED_SEGMENT_CAPACITY: u32 = 3;56/// How many parachain blocks are processed by the relay chain per parent. Limits the57/// number of blocks authored per slot.58#[cfg(feature = "lookahead")]59const BLOCK_PROCESSING_VELOCITY: u32 = 2;60#[cfg(feature = "lookahead")]61pub type ConsensusHook = cumulus_pallet_aura_ext::FixedVelocityConsensusHook<62 Runtime,63 { MILLISECS_PER_RELAY_BLOCK as u32 },64 BLOCK_PROCESSING_VELOCITY,65 UNINCLUDED_SEGMENT_CAPACITY,66>;4767runtime/common/runtime_apis.rsdiffbeforeafterboth682 #[cfg(feature = "lookahead")]682 #[cfg(feature = "lookahead")]683 impl cumulus_primitives_aura::AuraUnincludedSegmentApi<Block> for Runtime {683 impl cumulus_primitives_aura::AuraUnincludedSegmentApi<Block> for Runtime {684 fn can_build_upon(684 fn can_build_upon(685 _included_hash: <Block as BlockT>::Hash,685 included_hash: <Block as BlockT>::Hash,686 _slot: cumulus_primitives_aura::Slot,686 slot: cumulus_primitives_aura::Slot,687 ) -> bool {687 ) -> bool {688 // FIXME: Limit velocity688 $crate::config::parachain::ConsensusHook::can_build_upon(included_hash, slot)689 true690 }689 }691 }690 }692691