git.delta.rocks / unique-network / refs/commits / 700b0c8abd12

difftreelog

fix enable throttling

Yaroslav Bolyukin2023-10-16parent: #8c199c3.patch.diff
in: master

6 files changed

modifiednode/cli/src/command.rsdiffbeforeafterboth
396 }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};
401403
modifiedpallets/inflation/src/lib.rsdiffbeforeafterboth
7272
73 // 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 >;
7577
76 /// Number of blocks that pass between treasury balance updates due to inflation78 /// Number of blocks that pass between treasury balance updates due to inflation
modifiedprimitives/common/src/constants.rsdiffbeforeafterboth
2323
24use crate::types::{Balance, BlockNumber};24use crate::types::{Balance, BlockNumber};
2525
26#[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;
2831
29pub const SLOT_DURATION: u64 = MILLISECS_PER_BLOCK;32pub const SLOT_DURATION: u64 = MILLISECS_PER_BLOCK;
modifiedruntime/common/config/pallets/mod.rsdiffbeforeafterboth
21 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;
112112
113 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 lands
118 // <cumulus_pallet_parachain_system::Pallet<Runtime>>::last_relay_block_number()118 // <cumulus_pallet_parachain_system::Pallet<Runtime>>::last_relay_block_number()
modifiedruntime/common/config/parachain.rsdiffbeforeafterboth
38 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}
4347
44impl parachain_info::Config for Runtime {}48impl parachain_info::Config for Runtime {}
4549
46impl cumulus_pallet_aura_ext::Config for Runtime {}50impl cumulus_pallet_aura_ext::Config for Runtime {}
51
52/// Maximum number of blocks simultaneously accepted by the Runtime, not yet included
53/// 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 the
57/// 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>;
4767
modifiedruntime/common/runtime_apis.rsdiffbeforeafterboth
682 #[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 true
690 }689 }
691 }690 }
692691