Unify code paths of create_inherent and enter (#7137)

* Remove redundant enter call.

* Remove optionality in dispute signature checking

* Make enter_inner and create_inherent the same.

* Remove redundant metric.

* Unification: enter and create_inherent.

* Remove `enter_inner` function.

* Remove dead code.

* Remove redundant import.

* Remove dead code in disputes.

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

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

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

* Merge fix.

* Fix tests.

* Remove obsolete comment.

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

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

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

* Review remarks, fixes.

* Guide updates.

* Fmt.

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

---------

Co-authored-by: eskimor <eskimor@no-such-url.com>
Co-authored-by: command-bot <>
This commit is contained in:
eskimor
2023-06-14 10:57:06 +02:00
committed by GitHub
parent e71c541ede
commit 596a9ccd02
13 changed files with 676 additions and 1550 deletions
@@ -17,24 +17,26 @@
//! Autogenerated weights for `runtime_parachains::paras_inherent`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-05-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2023-06-02, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `bm5`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
//! HOSTNAME: `bm3`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westend-dev"), DB CACHE: 1024
// Executed Command:
// ./target/production/polkadot
// target/production/polkadot
// benchmark
// pallet
// --chain=westend-dev
// --steps=50
// --repeat=20
// --pallet=runtime_parachains::paras_inherent
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --heap-pages=4096
// --json-file=/var/lib/gitlab-runner/builds/zyw4fam_/0/parity/mirrors/polkadot/.git/.artifacts/bench.json
// --pallet=runtime_parachains::paras_inherent
// --chain=westend-dev
// --header=./file_header.txt
// --output=./runtime/westend/src/weights/runtime_parachains_paras_inherent.rs
// --output=./runtime/westend/src/weights/
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
@@ -53,6 +55,10 @@ impl<T: frame_system::Config> runtime_parachains::paras_inherent::WeightInfo for
/// Proof: System ParentHash (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen)
/// Storage: ParasShared CurrentSessionIndex (r:1 w:0)
/// Proof Skipped: ParasShared CurrentSessionIndex (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: ParaScheduler AvailabilityCores (r:1 w:1)
/// Proof Skipped: ParaScheduler AvailabilityCores (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: ParasShared ActiveValidatorKeys (r:1 w:0)
/// Proof Skipped: ParasShared ActiveValidatorKeys (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: Babe AuthorVrfRandomness (r:1 w:0)
/// Proof: Babe AuthorVrfRandomness (max_values: Some(1), max_size: Some(33), added: 528, mode: MaxEncodedLen)
/// Storage: ParaSessionInfo Sessions (r:1 w:0)
@@ -61,8 +67,6 @@ impl<T: frame_system::Config> runtime_parachains::paras_inherent::WeightInfo for
/// Proof Skipped: ParasDisputes Disputes (max_values: None, max_size: None, mode: Measured)
/// Storage: ParasDisputes BackersOnDisputes (r:1 w:1)
/// Proof Skipped: ParasDisputes BackersOnDisputes (max_values: None, max_size: None, mode: Measured)
/// Storage: ParaScheduler AvailabilityCores (r:1 w:1)
/// Proof Skipped: ParaScheduler AvailabilityCores (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: ParasDisputes Included (r:1 w:1)
/// Proof Skipped: ParasDisputes Included (max_values: None, max_size: None, mode: Measured)
/// Storage: ParaSessionInfo AccountKeys (r:1 w:0)
@@ -73,12 +77,12 @@ impl<T: frame_system::Config> runtime_parachains::paras_inherent::WeightInfo for
/// Proof: Staking ActiveEra (max_values: Some(1), max_size: Some(13), added: 508, mode: MaxEncodedLen)
/// Storage: Staking ErasRewardPoints (r:1 w:1)
/// Proof Skipped: Staking ErasRewardPoints (max_values: None, max_size: None, mode: Measured)
/// Storage: ParaInherent OnChainVotes (r:1 w:1)
/// Proof Skipped: ParaInherent OnChainVotes (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: ParasDisputes Frozen (r:1 w:0)
/// Proof Skipped: ParasDisputes Frozen (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: ParaInclusion PendingAvailability (r:2 w:1)
/// Proof Skipped: ParaInclusion PendingAvailability (max_values: None, max_size: None, mode: Measured)
/// Storage: ParasShared ActiveValidatorKeys (r:1 w:0)
/// Proof Skipped: ParasShared ActiveValidatorKeys (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: Paras Parachains (r:1 w:0)
/// Proof Skipped: Paras Parachains (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: ParaInclusion PendingAvailabilityCommitments (r:1 w:1)
@@ -91,8 +95,6 @@ impl<T: frame_system::Config> runtime_parachains::paras_inherent::WeightInfo for
/// Proof Skipped: Hrmp HrmpChannelDigests (max_values: None, max_size: None, mode: Measured)
/// Storage: Paras FutureCodeUpgrades (r:1 w:0)
/// Proof Skipped: Paras FutureCodeUpgrades (max_values: None, max_size: None, mode: Measured)
/// Storage: ParaInherent OnChainVotes (r:1 w:1)
/// Proof Skipped: ParaInherent OnChainVotes (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: ParaScheduler SessionStartBlock (r:1 w:0)
/// Proof Skipped: ParaScheduler SessionStartBlock (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: ParaScheduler ParathreadQueue (r:1 w:1)
@@ -112,11 +114,11 @@ impl<T: frame_system::Config> runtime_parachains::paras_inherent::WeightInfo for
// Proof Size summary in bytes:
// Measured: `50518`
// Estimated: `56458 + v * (23 ±0)`
// Minimum execution time: 755_127_000 picoseconds.
Weight::from_parts(279_514_953, 0)
// Minimum execution time: 787_742_000 picoseconds.
Weight::from_parts(323_859_708, 0)
.saturating_add(Weight::from_parts(0, 56458))
// Standard Error: 27_909
.saturating_add(Weight::from_parts(48_567_316, 0).saturating_mul(v.into()))
// Standard Error: 23_358
.saturating_add(Weight::from_parts(48_375_660, 0).saturating_mul(v.into()))
.saturating_add(T::DbWeight::get().reads(27))
.saturating_add(T::DbWeight::get().writes(15))
.saturating_add(Weight::from_parts(0, 23).saturating_mul(v.into()))
@@ -127,18 +129,20 @@ impl<T: frame_system::Config> runtime_parachains::paras_inherent::WeightInfo for
/// Proof: System ParentHash (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen)
/// Storage: ParasShared CurrentSessionIndex (r:1 w:0)
/// Proof Skipped: ParasShared CurrentSessionIndex (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: Babe AuthorVrfRandomness (r:1 w:0)
/// Proof: Babe AuthorVrfRandomness (max_values: Some(1), max_size: Some(33), added: 528, mode: MaxEncodedLen)
/// Storage: ParaScheduler AvailabilityCores (r:1 w:1)
/// Proof Skipped: ParaScheduler AvailabilityCores (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: ParasDisputes Frozen (r:1 w:0)
/// Proof Skipped: ParasDisputes Frozen (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: ParasShared ActiveValidatorKeys (r:1 w:0)
/// Proof Skipped: ParasShared ActiveValidatorKeys (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: Paras Parachains (r:1 w:0)
/// Proof Skipped: Paras Parachains (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: Babe AuthorVrfRandomness (r:1 w:0)
/// Proof: Babe AuthorVrfRandomness (max_values: Some(1), max_size: Some(33), added: 528, mode: MaxEncodedLen)
/// Storage: ParaInherent OnChainVotes (r:1 w:1)
/// Proof Skipped: ParaInherent OnChainVotes (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: ParasDisputes Frozen (r:1 w:0)
/// Proof Skipped: ParasDisputes Frozen (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: ParaInclusion PendingAvailability (r:2 w:1)
/// Proof Skipped: ParaInclusion PendingAvailability (max_values: None, max_size: None, mode: Measured)
/// Storage: Paras Parachains (r:1 w:0)
/// Proof Skipped: Paras Parachains (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: ParaInclusion PendingAvailabilityCommitments (r:1 w:1)
/// Proof Skipped: ParaInclusion PendingAvailabilityCommitments (max_values: None, max_size: None, mode: Measured)
/// Storage: ParaSessionInfo AccountKeys (r:1 w:0)
@@ -157,8 +161,6 @@ impl<T: frame_system::Config> runtime_parachains::paras_inherent::WeightInfo for
/// Proof Skipped: Hrmp HrmpChannelDigests (max_values: None, max_size: None, mode: Measured)
/// Storage: Paras FutureCodeUpgrades (r:1 w:0)
/// Proof Skipped: Paras FutureCodeUpgrades (max_values: None, max_size: None, mode: Measured)
/// Storage: ParaInherent OnChainVotes (r:1 w:1)
/// Proof Skipped: ParaInherent OnChainVotes (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: ParasDisputes Disputes (r:1 w:0)
/// Proof Skipped: ParasDisputes Disputes (max_values: None, max_size: None, mode: Measured)
/// Storage: ParaScheduler SessionStartBlock (r:1 w:0)
@@ -183,8 +185,8 @@ impl<T: frame_system::Config> runtime_parachains::paras_inherent::WeightInfo for
// Proof Size summary in bytes:
// Measured: `42352`
// Estimated: `48292`
// Minimum execution time: 316_856_000 picoseconds.
Weight::from_parts(324_523_000, 0)
// Minimum execution time: 356_545_000 picoseconds.
Weight::from_parts(362_497_000, 0)
.saturating_add(Weight::from_parts(0, 48292))
.saturating_add(T::DbWeight::get().reads(25))
.saturating_add(T::DbWeight::get().writes(16))
@@ -195,18 +197,20 @@ impl<T: frame_system::Config> runtime_parachains::paras_inherent::WeightInfo for
/// Proof: System ParentHash (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen)
/// Storage: ParasShared CurrentSessionIndex (r:1 w:0)
/// Proof Skipped: ParasShared CurrentSessionIndex (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: Babe AuthorVrfRandomness (r:1 w:0)
/// Proof: Babe AuthorVrfRandomness (max_values: Some(1), max_size: Some(33), added: 528, mode: MaxEncodedLen)
/// Storage: ParaScheduler AvailabilityCores (r:1 w:1)
/// Proof Skipped: ParaScheduler AvailabilityCores (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: ParasDisputes Frozen (r:1 w:0)
/// Proof Skipped: ParasDisputes Frozen (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: ParasShared ActiveValidatorKeys (r:1 w:0)
/// Proof Skipped: ParasShared ActiveValidatorKeys (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: Paras Parachains (r:1 w:0)
/// Proof Skipped: Paras Parachains (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: Babe AuthorVrfRandomness (r:1 w:0)
/// Proof: Babe AuthorVrfRandomness (max_values: Some(1), max_size: Some(33), added: 528, mode: MaxEncodedLen)
/// Storage: ParaInherent OnChainVotes (r:1 w:1)
/// Proof Skipped: ParaInherent OnChainVotes (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: ParasDisputes Frozen (r:1 w:0)
/// Proof Skipped: ParasDisputes Frozen (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: ParaInclusion PendingAvailability (r:2 w:1)
/// Proof Skipped: ParaInclusion PendingAvailability (max_values: None, max_size: None, mode: Measured)
/// Storage: Paras Parachains (r:1 w:0)
/// Proof Skipped: Paras Parachains (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: ParaInclusion PendingAvailabilityCommitments (r:1 w:1)
/// Proof Skipped: ParaInclusion PendingAvailabilityCommitments (max_values: None, max_size: None, mode: Measured)
/// Storage: ParaSessionInfo AccountKeys (r:1 w:0)
@@ -225,9 +229,7 @@ impl<T: frame_system::Config> runtime_parachains::paras_inherent::WeightInfo for
/// Proof Skipped: Hrmp HrmpChannelDigests (max_values: None, max_size: None, mode: Measured)
/// Storage: Paras FutureCodeUpgrades (r:1 w:0)
/// Proof Skipped: Paras FutureCodeUpgrades (max_values: None, max_size: None, mode: Measured)
/// Storage: ParaInherent OnChainVotes (r:1 w:1)
/// Proof Skipped: ParaInherent OnChainVotes (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: ParasDisputes Disputes (r:2 w:0)
/// Storage: ParasDisputes Disputes (r:1 w:0)
/// Proof Skipped: ParasDisputes Disputes (max_values: None, max_size: None, mode: Measured)
/// Storage: ParaScheduler SessionStartBlock (r:1 w:0)
/// Proof Skipped: ParaScheduler SessionStartBlock (max_values: Some(1), max_size: None, mode: Measured)
@@ -256,12 +258,12 @@ impl<T: frame_system::Config> runtime_parachains::paras_inherent::WeightInfo for
// Proof Size summary in bytes:
// Measured: `42387`
// Estimated: `48327`
// Minimum execution time: 5_544_322_000 picoseconds.
Weight::from_parts(805_988_490, 0)
// Minimum execution time: 5_733_399_000 picoseconds.
Weight::from_parts(975_216_648, 0)
.saturating_add(Weight::from_parts(0, 48327))
// Standard Error: 43_249
.saturating_add(Weight::from_parts(47_856_057, 0).saturating_mul(v.into()))
.saturating_add(T::DbWeight::get().reads(29))
// Standard Error: 56_805
.saturating_add(Weight::from_parts(47_900_476, 0).saturating_mul(v.into()))
.saturating_add(T::DbWeight::get().reads(28))
.saturating_add(T::DbWeight::get().writes(15))
}
/// Storage: ParaInherent Included (r:1 w:1)
@@ -270,18 +272,20 @@ impl<T: frame_system::Config> runtime_parachains::paras_inherent::WeightInfo for
/// Proof: System ParentHash (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen)
/// Storage: ParasShared CurrentSessionIndex (r:1 w:0)
/// Proof Skipped: ParasShared CurrentSessionIndex (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: Babe AuthorVrfRandomness (r:1 w:0)
/// Proof: Babe AuthorVrfRandomness (max_values: Some(1), max_size: Some(33), added: 528, mode: MaxEncodedLen)
/// Storage: ParaScheduler AvailabilityCores (r:1 w:1)
/// Proof Skipped: ParaScheduler AvailabilityCores (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: ParasDisputes Frozen (r:1 w:0)
/// Proof Skipped: ParasDisputes Frozen (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: ParasShared ActiveValidatorKeys (r:1 w:0)
/// Proof Skipped: ParasShared ActiveValidatorKeys (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: Paras Parachains (r:1 w:0)
/// Proof Skipped: Paras Parachains (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: Babe AuthorVrfRandomness (r:1 w:0)
/// Proof: Babe AuthorVrfRandomness (max_values: Some(1), max_size: Some(33), added: 528, mode: MaxEncodedLen)
/// Storage: ParaInherent OnChainVotes (r:1 w:1)
/// Proof Skipped: ParaInherent OnChainVotes (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: ParasDisputes Frozen (r:1 w:0)
/// Proof Skipped: ParasDisputes Frozen (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: ParaInclusion PendingAvailability (r:2 w:1)
/// Proof Skipped: ParaInclusion PendingAvailability (max_values: None, max_size: None, mode: Measured)
/// Storage: Paras Parachains (r:1 w:0)
/// Proof Skipped: Paras Parachains (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: ParaInclusion PendingAvailabilityCommitments (r:1 w:1)
/// Proof Skipped: ParaInclusion PendingAvailabilityCommitments (max_values: None, max_size: None, mode: Measured)
/// Storage: ParaSessionInfo AccountKeys (r:1 w:0)
@@ -300,9 +304,7 @@ impl<T: frame_system::Config> runtime_parachains::paras_inherent::WeightInfo for
/// Proof Skipped: Hrmp HrmpChannelDigests (max_values: None, max_size: None, mode: Measured)
/// Storage: Paras FutureCodeUpgrades (r:1 w:0)
/// Proof Skipped: Paras FutureCodeUpgrades (max_values: None, max_size: None, mode: Measured)
/// Storage: ParaInherent OnChainVotes (r:1 w:1)
/// Proof Skipped: ParaInherent OnChainVotes (max_values: Some(1), max_size: None, mode: Measured)
/// Storage: ParasDisputes Disputes (r:2 w:0)
/// Storage: ParasDisputes Disputes (r:1 w:0)
/// Proof Skipped: ParasDisputes Disputes (max_values: None, max_size: None, mode: Measured)
/// Storage: ParaScheduler SessionStartBlock (r:1 w:0)
/// Proof Skipped: ParaScheduler SessionStartBlock (max_values: Some(1), max_size: None, mode: Measured)
@@ -334,10 +336,10 @@ impl<T: frame_system::Config> runtime_parachains::paras_inherent::WeightInfo for
// Proof Size summary in bytes:
// Measured: `42414`
// Estimated: `48354`
// Minimum execution time: 33_537_056_000 picoseconds.
Weight::from_parts(33_702_104_000, 0)
// Minimum execution time: 33_300_445_000 picoseconds.
Weight::from_parts(33_593_061_000, 0)
.saturating_add(Weight::from_parts(0, 48354))
.saturating_add(T::DbWeight::get().reads(31))
.saturating_add(T::DbWeight::get().reads(30))
.saturating_add(T::DbWeight::get().writes(15))
}
}