Take into account size as well in weight limiting. (#7369)

* Take into account size as well in weight limiting.

* Fix logging.

* More logs.

* Remove randomized selection in provisioner

No longer supported by runtime.

* Fix and simplify weight calculation.

Random filtering of remote disputes got dropped.

* Make existing tests pass.

* Tests for size limiting.

* Fix provisioner.

* Remove rand dependency.

* Better default block length for tests.

* ".git/.scripts/commands/bench/bench.sh" runtime kusama runtime_parachains::paras_inherent

* ".git/.scripts/commands/bench/bench.sh" runtime polkadot runtime_parachains::paras_inherent

* ".git/.scripts/commands/bench/bench.sh" runtime westend runtime_parachains::paras_inherent

* Update runtime/parachains/src/paras_inherent/mod.rs

Co-authored-by: Tsvetomir Dimitrov <tsvetomir@parity.io>

* Update runtime/parachains/src/paras_inherent/mod.rs

Co-authored-by: Chris Sosnin <48099298+slumber@users.noreply.github.com>

* Add back missing line.

* Fix test.

* fmt fix.

* Add missing test annotation

---------

Co-authored-by: eskimor <eskimor@no-such-url.com>
Co-authored-by: command-bot <>
Co-authored-by: Tsvetomir Dimitrov <tsvetomir@parity.io>
Co-authored-by: Chris Sosnin <48099298+slumber@users.noreply.github.com>
This commit is contained in:
eskimor
2023-08-01 14:43:54 +02:00
committed by GitHub
parent 4980b64497
commit 367098bae5
13 changed files with 439 additions and 403 deletions
+5 -3
View File
@@ -32,6 +32,7 @@ use frame_support::{
weights::{Weight, WeightMeter},
};
use frame_support_test::TestRandomness;
use frame_system::limits;
use parity_scale_codec::Decode;
use primitives::{
AuthorityDiscoveryId, Balance, BlockNumber, CandidateHash, Moment, SessionIndex, UpwardMessage,
@@ -42,7 +43,7 @@ use sp_io::TestExternalities;
use sp_runtime::{
traits::{AccountIdConversion, BlakeTwo256, IdentityLookup},
transaction_validity::TransactionPriority,
BuildStorage, Permill,
BuildStorage, Perbill, Permill,
};
use std::{cell::RefCell, collections::HashMap};
@@ -81,10 +82,11 @@ where
parameter_types! {
pub const BlockHashCount: u32 = 250;
pub BlockWeights: frame_system::limits::BlockWeights =
pub static BlockWeights: frame_system::limits::BlockWeights =
frame_system::limits::BlockWeights::simple_max(
Weight::from_parts(4 * 1024 * 1024, u64::MAX),
);
pub static BlockLength: limits::BlockLength = limits::BlockLength::max_with_normal_ratio(u32::MAX, Perbill::from_percent(75));
}
pub type AccountId = u64;
@@ -92,7 +94,7 @@ pub type AccountId = u64;
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = BlockWeights;
type BlockLength = ();
type BlockLength = BlockLength;
type DbWeight = ();
type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall;