Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
[frame/im-online] remove network state from heartbeats (#7309)
Browse files Browse the repository at this point in the history
* [frame/im-online] remove external_addresses from heartbeat

* new benchmarks

* format code

* Revert "format code"

This reverts commit 586ddaa.

* remove MaxPeerDataEncodingSize

* update lockfile for {"substrate"}

---------

Co-authored-by: parity-processbot <>
  • Loading branch information
melekes authored Jun 15, 2023
1 parent 7a54fd6 commit 0e614b0
Show file tree
Hide file tree
Showing 9 changed files with 292 additions and 308 deletions.
488 changes: 248 additions & 240 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions runtime/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,6 @@ parameter_types! {
pub const MaxAuthorities: u32 = 100_000;
pub const MaxKeys: u32 = 10_000;
pub const MaxPeerInHeartbeats: u32 = 10_000;
pub const MaxPeerDataEncodingSize: u32 = 1_000;
}

impl pallet_treasury::Config for Runtime {
Expand Down Expand Up @@ -703,7 +702,6 @@ impl pallet_im_online::Config for Runtime {
type WeightInfo = weights::pallet_im_online::WeightInfo<Runtime>;
type MaxKeys = MaxKeys;
type MaxPeerInHeartbeats = MaxPeerInHeartbeats;
type MaxPeerDataEncodingSize = MaxPeerDataEncodingSize;
}

parameter_types! {
Expand Down
26 changes: 11 additions & 15 deletions runtime/kusama/src/weights/pallet_im_online.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
//! Autogenerated weights for `pallet_im_online`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-05-25, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
//! HOSTNAME: `build-host`, CPU: `AMD EPYC 7601 32-Core Processor`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 1024

// Executed Command:
Expand Down Expand Up @@ -54,25 +54,21 @@ impl<T: frame_system::Config> pallet_im_online::WeightInfo for WeightInfo<T> {
/// Storage: ImOnline Keys (r:1 w:0)
/// Proof: ImOnline Keys (max_values: Some(1), max_size: Some(320002), added: 320497, mode: MaxEncodedLen)
/// Storage: ImOnline ReceivedHeartbeats (r:1 w:1)
/// Proof: ImOnline ReceivedHeartbeats (max_values: None, max_size: Some(10021032), added: 10023507, mode: MaxEncodedLen)
/// Proof: ImOnline ReceivedHeartbeats (max_values: None, max_size: Some(1028), added: 3503, mode: MaxEncodedLen)
/// Storage: ImOnline AuthoredBlocks (r:1 w:0)
/// Proof: ImOnline AuthoredBlocks (max_values: None, max_size: Some(56), added: 2531, mode: MaxEncodedLen)
/// The range of component `k` is `[1, 1000]`.
/// The range of component `e` is `[1, 100]`.
fn validate_unsigned_and_then_heartbeat(k: u32, e: u32, ) -> Weight {
fn validate_unsigned_and_then_heartbeat(k: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `361 + k * (32 ±0)`
// Estimated: `10024497 + e * (35 ±0) + k * (32 ±0)`
// Minimum execution time: 91_361_000 picoseconds.
Weight::from_parts(72_262_090, 0)
.saturating_add(Weight::from_parts(0, 10024497))
// Standard Error: 252
.saturating_add(Weight::from_parts(22_094, 0).saturating_mul(k.into()))
// Standard Error: 2_539
.saturating_add(Weight::from_parts(395_966, 0).saturating_mul(e.into()))
// Estimated: `321487 + k * (1761 ±0)`
// Minimum execution time: 122_811_000 picoseconds.
Weight::from_parts(134_566_517, 0)
.saturating_add(Weight::from_parts(0, 321487))
// Standard Error: 639
.saturating_add(Weight::from_parts(42_176, 0).saturating_mul(k.into()))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(1))
.saturating_add(Weight::from_parts(0, 35).saturating_mul(e.into()))
.saturating_add(Weight::from_parts(0, 32).saturating_mul(k.into()))
.saturating_add(Weight::from_parts(0, 1761).saturating_mul(k.into()))
}
}
2 changes: 0 additions & 2 deletions runtime/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,6 @@ parameter_types! {
pub const MaxAuthorities: u32 = 100_000;
pub const MaxKeys: u32 = 10_000;
pub const MaxPeerInHeartbeats: u32 = 10_000;
pub const MaxPeerDataEncodingSize: u32 = 1_000;
pub const RootSpendOriginMaxAmount: Balance = Balance::MAX;
pub const CouncilSpendOriginMaxAmount: Balance = Balance::MAX;
}
Expand Down Expand Up @@ -754,7 +753,6 @@ impl pallet_im_online::Config for Runtime {
type WeightInfo = weights::pallet_im_online::WeightInfo<Runtime>;
type MaxKeys = MaxKeys;
type MaxPeerInHeartbeats = MaxPeerInHeartbeats;
type MaxPeerDataEncodingSize = MaxPeerDataEncodingSize;
}

parameter_types! {
Expand Down
26 changes: 11 additions & 15 deletions runtime/polkadot/src/weights/pallet_im_online.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
//! Autogenerated weights for `pallet_im_online`
//!
//! 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-05-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
//! HOSTNAME: `build-host`, CPU: `AMD EPYC 7601 32-Core Processor`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("polkadot-dev"), DB CACHE: 1024

// Executed Command:
Expand Down Expand Up @@ -54,25 +54,21 @@ impl<T: frame_system::Config> pallet_im_online::WeightInfo for WeightInfo<T> {
/// Storage: ImOnline Keys (r:1 w:0)
/// Proof: ImOnline Keys (max_values: Some(1), max_size: Some(320002), added: 320497, mode: MaxEncodedLen)
/// Storage: ImOnline ReceivedHeartbeats (r:1 w:1)
/// Proof: ImOnline ReceivedHeartbeats (max_values: None, max_size: Some(10021032), added: 10023507, mode: MaxEncodedLen)
/// Proof: ImOnline ReceivedHeartbeats (max_values: None, max_size: Some(1028), added: 3503, mode: MaxEncodedLen)
/// Storage: ImOnline AuthoredBlocks (r:1 w:0)
/// Proof: ImOnline AuthoredBlocks (max_values: None, max_size: Some(56), added: 2531, mode: MaxEncodedLen)
/// The range of component `k` is `[1, 1000]`.
/// The range of component `e` is `[1, 100]`.
fn validate_unsigned_and_then_heartbeat(k: u32, e: u32, ) -> Weight {
fn validate_unsigned_and_then_heartbeat(k: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `361 + k * (32 ±0)`
// Estimated: `10024497 + e * (35 ±0) + k * (32 ±0)`
// Minimum execution time: 92_822_000 picoseconds.
Weight::from_parts(72_049_970, 0)
.saturating_add(Weight::from_parts(0, 10024497))
// Standard Error: 302
.saturating_add(Weight::from_parts(25_047, 0).saturating_mul(k.into()))
// Standard Error: 3_048
.saturating_add(Weight::from_parts(394_650, 0).saturating_mul(e.into()))
// Estimated: `321487 + k * (1761 ±0)`
// Minimum execution time: 125_307_000 picoseconds.
Weight::from_parts(220_092_525, 0)
.saturating_add(Weight::from_parts(0, 321487))
// Standard Error: 6_932
.saturating_add(Weight::from_parts(27_914, 0).saturating_mul(k.into()))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(1))
.saturating_add(Weight::from_parts(0, 35).saturating_mul(e.into()))
.saturating_add(Weight::from_parts(0, 32).saturating_mul(k.into()))
.saturating_add(Weight::from_parts(0, 1761).saturating_mul(k.into()))
}
}
2 changes: 0 additions & 2 deletions runtime/rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,6 @@ parameter_types! {
pub const MaxAuthorities: u32 = 100_000;
pub const MaxKeys: u32 = 10_000;
pub const MaxPeerInHeartbeats: u32 = 10_000;
pub const MaxPeerDataEncodingSize: u32 = 1_000;
}

type ApproveOrigin = EitherOfDiverse<
Expand Down Expand Up @@ -651,7 +650,6 @@ impl pallet_im_online::Config for Runtime {
type WeightInfo = weights::pallet_im_online::WeightInfo<Runtime>;
type MaxKeys = MaxKeys;
type MaxPeerInHeartbeats = MaxPeerInHeartbeats;
type MaxPeerDataEncodingSize = MaxPeerDataEncodingSize;
}

parameter_types! {
Expand Down
26 changes: 11 additions & 15 deletions runtime/rococo/src/weights/pallet_im_online.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
//! Autogenerated weights for `pallet_im_online`
//!
//! 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-05-31, 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: `build-host`, CPU: `AMD EPYC 7601 32-Core Processor`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("rococo-dev"), DB CACHE: 1024

// Executed Command:
Expand Down Expand Up @@ -56,25 +56,21 @@ impl<T: frame_system::Config> pallet_im_online::WeightInfo for WeightInfo<T> {
/// Storage: unknown `0x39e295d143ed41353167609a3d816584` (r:1 w:0)
/// Proof Skipped: unknown `0x39e295d143ed41353167609a3d816584` (r:1 w:0)
/// Storage: ImOnline ReceivedHeartbeats (r:1 w:1)
/// Proof: ImOnline ReceivedHeartbeats (max_values: None, max_size: Some(10021032), added: 10023507, mode: MaxEncodedLen)
/// Proof: ImOnline ReceivedHeartbeats (max_values: None, max_size: Some(1028), added: 3503, mode: MaxEncodedLen)
/// Storage: ImOnline AuthoredBlocks (r:1 w:0)
/// Proof: ImOnline AuthoredBlocks (max_values: None, max_size: Some(56), added: 2531, mode: MaxEncodedLen)
/// The range of component `k` is `[1, 1000]`.
/// The range of component `e` is `[1, 100]`.
fn validate_unsigned_and_then_heartbeat(k: u32, e: u32, ) -> Weight {
fn validate_unsigned_and_then_heartbeat(k: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `394 + k * (32 ±0)`
// Estimated: `10024497 + e * (35 ±0) + k * (32 ±0)`
// Minimum execution time: 92_998_000 picoseconds.
Weight::from_parts(75_068_960, 0)
.saturating_add(Weight::from_parts(0, 10024497))
// Standard Error: 361
.saturating_add(Weight::from_parts(24_450, 0).saturating_mul(k.into()))
// Standard Error: 3_641
.saturating_add(Weight::from_parts(386_239, 0).saturating_mul(e.into()))
// Estimated: `321487 + k * (1761 ±0)`
// Minimum execution time: 132_910_000 picoseconds.
Weight::from_parts(149_854_501, 0)
.saturating_add(Weight::from_parts(0, 321487))
// Standard Error: 3_317
.saturating_add(Weight::from_parts(61_141, 0).saturating_mul(k.into()))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(1))
.saturating_add(Weight::from_parts(0, 35).saturating_mul(e.into()))
.saturating_add(Weight::from_parts(0, 32).saturating_mul(k.into()))
.saturating_add(Weight::from_parts(0, 1761).saturating_mul(k.into()))
}
}
2 changes: 0 additions & 2 deletions runtime/westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,6 @@ parameter_types! {
pub const ImOnlineUnsignedPriority: TransactionPriority = TransactionPriority::max_value();
pub const MaxKeys: u32 = 10_000;
pub const MaxPeerInHeartbeats: u32 = 10_000;
pub const MaxPeerDataEncodingSize: u32 = 1_000;
}

impl pallet_im_online::Config for Runtime {
Expand All @@ -582,7 +581,6 @@ impl pallet_im_online::Config for Runtime {
type WeightInfo = weights::pallet_im_online::WeightInfo<Runtime>;
type MaxKeys = MaxKeys;
type MaxPeerInHeartbeats = MaxPeerInHeartbeats;
type MaxPeerDataEncodingSize = MaxPeerDataEncodingSize;
}

parameter_types! {
Expand Down
26 changes: 11 additions & 15 deletions runtime/westend/src/weights/pallet_im_online.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
//! Autogenerated weights for `pallet_im_online`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-05-25, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2023-05-30, 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: `build-host`, CPU: `AMD EPYC 7601 32-Core Processor`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westend-dev"), DB CACHE: 1024

// Executed Command:
Expand Down Expand Up @@ -54,25 +54,21 @@ impl<T: frame_system::Config> pallet_im_online::WeightInfo for WeightInfo<T> {
/// Storage: ImOnline Keys (r:1 w:0)
/// Proof: ImOnline Keys (max_values: Some(1), max_size: Some(320002), added: 320497, mode: MaxEncodedLen)
/// Storage: ImOnline ReceivedHeartbeats (r:1 w:1)
/// Proof: ImOnline ReceivedHeartbeats (max_values: None, max_size: Some(10021032), added: 10023507, mode: MaxEncodedLen)
/// Proof: ImOnline ReceivedHeartbeats (max_values: None, max_size: Some(1028), added: 3503, mode: MaxEncodedLen)
/// Storage: ImOnline AuthoredBlocks (r:1 w:0)
/// Proof: ImOnline AuthoredBlocks (max_values: None, max_size: Some(56), added: 2531, mode: MaxEncodedLen)
/// The range of component `k` is `[1, 1000]`.
/// The range of component `e` is `[1, 100]`.
fn validate_unsigned_and_then_heartbeat(k: u32, e: u32, ) -> Weight {
fn validate_unsigned_and_then_heartbeat(k: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `361 + k * (32 ±0)`
// Estimated: `10024497 + e * (35 ±0) + k * (32 ±0)`
// Minimum execution time: 92_017_000 picoseconds.
Weight::from_parts(73_188_461, 0)
.saturating_add(Weight::from_parts(0, 10024497))
// Standard Error: 316
.saturating_add(Weight::from_parts(23_357, 0).saturating_mul(k.into()))
// Standard Error: 3_193
.saturating_add(Weight::from_parts(392_783, 0).saturating_mul(e.into()))
// Estimated: `321487 + k * (1761 ±0)`
// Minimum execution time: 122_571_000 picoseconds.
Weight::from_parts(162_954_849, 0)
.saturating_add(Weight::from_parts(0, 321487))
// Standard Error: 8_676
.saturating_add(Weight::from_parts(11_122, 0).saturating_mul(k.into()))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(1))
.saturating_add(Weight::from_parts(0, 35).saturating_mul(e.into()))
.saturating_add(Weight::from_parts(0, 32).saturating_mul(k.into()))
.saturating_add(Weight::from_parts(0, 1761).saturating_mul(k.into()))
}
}

0 comments on commit 0e614b0

Please sign in to comment.