node-bench no-op block import (#5869)

* start to try and implement noop

* txs as input

* better comment

* Add transfer reaping

* rename to avoid filter matching

* Update base weights based on results

* fix priority

* fix logic on reaping transfer

* Update bin/node/bench/src/import.rs

Co-authored-by: Nikolay Volf <nikvolf@gmail.com>

* Update bin/node/bench/src/main.rs

Co-authored-by: Nikolay Volf <nikvolf@gmail.com>

* add back size type (in-progress)

* bring back size type with custom

* update comment

* nit

* block type then size

* Use `transfer_keep_alive`

Co-authored-by: Nikolay Volf <nikvolf@gmail.com>
This commit is contained in:
Shawn Tabrizi
2020-05-03 15:33:11 +02:00
committed by GitHub
parent 51db82bdb9
commit f37927d37d
6 changed files with 99 additions and 63 deletions
+8 -4
View File
@@ -56,6 +56,7 @@ use sp_inherents::{InherentData, CheckInherentsResult};
pub use sp_runtime::BuildStorage;
pub use pallet_timestamp::Call as TimestampCall;
pub use pallet_balances::Call as BalancesCall;
pub use frame_system::Call as SystemCall;
pub use pallet_contracts::Gas;
pub use frame_support::StorageValue;
pub use pallet_staking::StakerStatus;
@@ -119,14 +120,17 @@ parameter_types! {
pub const BlockHashCount: BlockNumber = 250;
/// We allow for 2 seconds of compute with a 6 second average block time.
pub const MaximumBlockWeight: Weight = 2_000_000_000_000;
pub const ExtrinsicBaseWeight: Weight = 10_000_000;
/// Executing 10,000 System remarks (no-op) txs takes ~1.26 seconds -> ~125 µs per tx
pub const ExtrinsicBaseWeight: Weight = 125_000_000;
pub const MaximumBlockLength: u32 = 5 * 1024 * 1024;
pub const Version: RuntimeVersion = VERSION;
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
pub const DbWeight: RuntimeDbWeight = RuntimeDbWeight {
read: 25_000_000, // ~25 µs
write: 100_000_000, // ~100 µs
read: 25_000_000, // ~25 µs @ 200,000 items
write: 100_000_000, // ~100 µs @ 200,000 items
};
/// Importing a block with 0 txs takes ~5 ms
pub const BlockExecutionWeight: Weight = 5_000_000_000;
}
impl frame_system::Trait for Runtime {
@@ -143,7 +147,7 @@ impl frame_system::Trait for Runtime {
type BlockHashCount = BlockHashCount;
type MaximumBlockWeight = MaximumBlockWeight;
type DbWeight = DbWeight;
type BlockExecutionWeight = ();
type BlockExecutionWeight = BlockExecutionWeight;
type ExtrinsicBaseWeight = ExtrinsicBaseWeight;
type MaximumBlockLength = MaximumBlockLength;
type AvailableBlockRatio = AvailableBlockRatio;