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

Commit 0e614b0

Browse files
authored
[frame/im-online] remove network state from heartbeats (#7309)
* [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 <>
1 parent 7a54fd6 commit 0e614b0

File tree

9 files changed

+292
-308
lines changed

9 files changed

+292
-308
lines changed

Cargo.lock

Lines changed: 248 additions & 240 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

runtime/kusama/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,6 @@ parameter_types! {
619619
pub const MaxAuthorities: u32 = 100_000;
620620
pub const MaxKeys: u32 = 10_000;
621621
pub const MaxPeerInHeartbeats: u32 = 10_000;
622-
pub const MaxPeerDataEncodingSize: u32 = 1_000;
623622
}
624623

625624
impl pallet_treasury::Config for Runtime {
@@ -703,7 +702,6 @@ impl pallet_im_online::Config for Runtime {
703702
type WeightInfo = weights::pallet_im_online::WeightInfo<Runtime>;
704703
type MaxKeys = MaxKeys;
705704
type MaxPeerInHeartbeats = MaxPeerInHeartbeats;
706-
type MaxPeerDataEncodingSize = MaxPeerDataEncodingSize;
707705
}
708706

709707
parameter_types! {

runtime/kusama/src/weights/pallet_im_online.rs

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
//! Autogenerated weights for `pallet_im_online`
1818
//!
1919
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
20-
//! DATE: 2023-05-25, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
20+
//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
2121
//! WORST CASE MAP SIZE: `1000000`
22-
//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
22+
//! HOSTNAME: `build-host`, CPU: `AMD EPYC 7601 32-Core Processor`
2323
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 1024
2424
2525
// Executed Command:
@@ -54,25 +54,21 @@ impl<T: frame_system::Config> pallet_im_online::WeightInfo for WeightInfo<T> {
5454
/// Storage: ImOnline Keys (r:1 w:0)
5555
/// Proof: ImOnline Keys (max_values: Some(1), max_size: Some(320002), added: 320497, mode: MaxEncodedLen)
5656
/// Storage: ImOnline ReceivedHeartbeats (r:1 w:1)
57-
/// Proof: ImOnline ReceivedHeartbeats (max_values: None, max_size: Some(10021032), added: 10023507, mode: MaxEncodedLen)
57+
/// Proof: ImOnline ReceivedHeartbeats (max_values: None, max_size: Some(1028), added: 3503, mode: MaxEncodedLen)
5858
/// Storage: ImOnline AuthoredBlocks (r:1 w:0)
5959
/// Proof: ImOnline AuthoredBlocks (max_values: None, max_size: Some(56), added: 2531, mode: MaxEncodedLen)
6060
/// The range of component `k` is `[1, 1000]`.
61-
/// The range of component `e` is `[1, 100]`.
62-
fn validate_unsigned_and_then_heartbeat(k: u32, e: u32, ) -> Weight {
61+
fn validate_unsigned_and_then_heartbeat(k: u32, ) -> Weight {
6362
// Proof Size summary in bytes:
6463
// Measured: `361 + k * (32 ±0)`
65-
// Estimated: `10024497 + e * (35 ±0) + k * (32 ±0)`
66-
// Minimum execution time: 91_361_000 picoseconds.
67-
Weight::from_parts(72_262_090, 0)
68-
.saturating_add(Weight::from_parts(0, 10024497))
69-
// Standard Error: 252
70-
.saturating_add(Weight::from_parts(22_094, 0).saturating_mul(k.into()))
71-
// Standard Error: 2_539
72-
.saturating_add(Weight::from_parts(395_966, 0).saturating_mul(e.into()))
64+
// Estimated: `321487 + k * (1761 ±0)`
65+
// Minimum execution time: 122_811_000 picoseconds.
66+
Weight::from_parts(134_566_517, 0)
67+
.saturating_add(Weight::from_parts(0, 321487))
68+
// Standard Error: 639
69+
.saturating_add(Weight::from_parts(42_176, 0).saturating_mul(k.into()))
7370
.saturating_add(T::DbWeight::get().reads(4))
7471
.saturating_add(T::DbWeight::get().writes(1))
75-
.saturating_add(Weight::from_parts(0, 35).saturating_mul(e.into()))
76-
.saturating_add(Weight::from_parts(0, 32).saturating_mul(k.into()))
72+
.saturating_add(Weight::from_parts(0, 1761).saturating_mul(k.into()))
7773
}
7874
}

runtime/polkadot/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,6 @@ parameter_types! {
655655
pub const MaxAuthorities: u32 = 100_000;
656656
pub const MaxKeys: u32 = 10_000;
657657
pub const MaxPeerInHeartbeats: u32 = 10_000;
658-
pub const MaxPeerDataEncodingSize: u32 = 1_000;
659658
pub const RootSpendOriginMaxAmount: Balance = Balance::MAX;
660659
pub const CouncilSpendOriginMaxAmount: Balance = Balance::MAX;
661660
}
@@ -754,7 +753,6 @@ impl pallet_im_online::Config for Runtime {
754753
type WeightInfo = weights::pallet_im_online::WeightInfo<Runtime>;
755754
type MaxKeys = MaxKeys;
756755
type MaxPeerInHeartbeats = MaxPeerInHeartbeats;
757-
type MaxPeerDataEncodingSize = MaxPeerDataEncodingSize;
758756
}
759757

760758
parameter_types! {

runtime/polkadot/src/weights/pallet_im_online.rs

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
//! Autogenerated weights for `pallet_im_online`
1818
//!
1919
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
20-
//! DATE: 2023-05-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
20+
//! DATE: 2023-05-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
2121
//! WORST CASE MAP SIZE: `1000000`
22-
//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
22+
//! HOSTNAME: `build-host`, CPU: `AMD EPYC 7601 32-Core Processor`
2323
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("polkadot-dev"), DB CACHE: 1024
2424
2525
// Executed Command:
@@ -54,25 +54,21 @@ impl<T: frame_system::Config> pallet_im_online::WeightInfo for WeightInfo<T> {
5454
/// Storage: ImOnline Keys (r:1 w:0)
5555
/// Proof: ImOnline Keys (max_values: Some(1), max_size: Some(320002), added: 320497, mode: MaxEncodedLen)
5656
/// Storage: ImOnline ReceivedHeartbeats (r:1 w:1)
57-
/// Proof: ImOnline ReceivedHeartbeats (max_values: None, max_size: Some(10021032), added: 10023507, mode: MaxEncodedLen)
57+
/// Proof: ImOnline ReceivedHeartbeats (max_values: None, max_size: Some(1028), added: 3503, mode: MaxEncodedLen)
5858
/// Storage: ImOnline AuthoredBlocks (r:1 w:0)
5959
/// Proof: ImOnline AuthoredBlocks (max_values: None, max_size: Some(56), added: 2531, mode: MaxEncodedLen)
6060
/// The range of component `k` is `[1, 1000]`.
61-
/// The range of component `e` is `[1, 100]`.
62-
fn validate_unsigned_and_then_heartbeat(k: u32, e: u32, ) -> Weight {
61+
fn validate_unsigned_and_then_heartbeat(k: u32, ) -> Weight {
6362
// Proof Size summary in bytes:
6463
// Measured: `361 + k * (32 ±0)`
65-
// Estimated: `10024497 + e * (35 ±0) + k * (32 ±0)`
66-
// Minimum execution time: 92_822_000 picoseconds.
67-
Weight::from_parts(72_049_970, 0)
68-
.saturating_add(Weight::from_parts(0, 10024497))
69-
// Standard Error: 302
70-
.saturating_add(Weight::from_parts(25_047, 0).saturating_mul(k.into()))
71-
// Standard Error: 3_048
72-
.saturating_add(Weight::from_parts(394_650, 0).saturating_mul(e.into()))
64+
// Estimated: `321487 + k * (1761 ±0)`
65+
// Minimum execution time: 125_307_000 picoseconds.
66+
Weight::from_parts(220_092_525, 0)
67+
.saturating_add(Weight::from_parts(0, 321487))
68+
// Standard Error: 6_932
69+
.saturating_add(Weight::from_parts(27_914, 0).saturating_mul(k.into()))
7370
.saturating_add(T::DbWeight::get().reads(4))
7471
.saturating_add(T::DbWeight::get().writes(1))
75-
.saturating_add(Weight::from_parts(0, 35).saturating_mul(e.into()))
76-
.saturating_add(Weight::from_parts(0, 32).saturating_mul(k.into()))
72+
.saturating_add(Weight::from_parts(0, 1761).saturating_mul(k.into()))
7773
}
7874
}

runtime/rococo/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,6 @@ parameter_types! {
551551
pub const MaxAuthorities: u32 = 100_000;
552552
pub const MaxKeys: u32 = 10_000;
553553
pub const MaxPeerInHeartbeats: u32 = 10_000;
554-
pub const MaxPeerDataEncodingSize: u32 = 1_000;
555554
}
556555

557556
type ApproveOrigin = EitherOfDiverse<
@@ -651,7 +650,6 @@ impl pallet_im_online::Config for Runtime {
651650
type WeightInfo = weights::pallet_im_online::WeightInfo<Runtime>;
652651
type MaxKeys = MaxKeys;
653652
type MaxPeerInHeartbeats = MaxPeerInHeartbeats;
654-
type MaxPeerDataEncodingSize = MaxPeerDataEncodingSize;
655653
}
656654

657655
parameter_types! {

runtime/rococo/src/weights/pallet_im_online.rs

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
//! Autogenerated weights for `pallet_im_online`
1818
//!
1919
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
20-
//! DATE: 2023-05-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
20+
//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
2121
//! WORST CASE MAP SIZE: `1000000`
22-
//! HOSTNAME: `bm5`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
22+
//! HOSTNAME: `build-host`, CPU: `AMD EPYC 7601 32-Core Processor`
2323
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("rococo-dev"), DB CACHE: 1024
2424
2525
// Executed Command:
@@ -56,25 +56,21 @@ impl<T: frame_system::Config> pallet_im_online::WeightInfo for WeightInfo<T> {
5656
/// Storage: unknown `0x39e295d143ed41353167609a3d816584` (r:1 w:0)
5757
/// Proof Skipped: unknown `0x39e295d143ed41353167609a3d816584` (r:1 w:0)
5858
/// Storage: ImOnline ReceivedHeartbeats (r:1 w:1)
59-
/// Proof: ImOnline ReceivedHeartbeats (max_values: None, max_size: Some(10021032), added: 10023507, mode: MaxEncodedLen)
59+
/// Proof: ImOnline ReceivedHeartbeats (max_values: None, max_size: Some(1028), added: 3503, mode: MaxEncodedLen)
6060
/// Storage: ImOnline AuthoredBlocks (r:1 w:0)
6161
/// Proof: ImOnline AuthoredBlocks (max_values: None, max_size: Some(56), added: 2531, mode: MaxEncodedLen)
6262
/// The range of component `k` is `[1, 1000]`.
63-
/// The range of component `e` is `[1, 100]`.
64-
fn validate_unsigned_and_then_heartbeat(k: u32, e: u32, ) -> Weight {
63+
fn validate_unsigned_and_then_heartbeat(k: u32, ) -> Weight {
6564
// Proof Size summary in bytes:
6665
// Measured: `394 + k * (32 ±0)`
67-
// Estimated: `10024497 + e * (35 ±0) + k * (32 ±0)`
68-
// Minimum execution time: 92_998_000 picoseconds.
69-
Weight::from_parts(75_068_960, 0)
70-
.saturating_add(Weight::from_parts(0, 10024497))
71-
// Standard Error: 361
72-
.saturating_add(Weight::from_parts(24_450, 0).saturating_mul(k.into()))
73-
// Standard Error: 3_641
74-
.saturating_add(Weight::from_parts(386_239, 0).saturating_mul(e.into()))
66+
// Estimated: `321487 + k * (1761 ±0)`
67+
// Minimum execution time: 132_910_000 picoseconds.
68+
Weight::from_parts(149_854_501, 0)
69+
.saturating_add(Weight::from_parts(0, 321487))
70+
// Standard Error: 3_317
71+
.saturating_add(Weight::from_parts(61_141, 0).saturating_mul(k.into()))
7572
.saturating_add(T::DbWeight::get().reads(5))
7673
.saturating_add(T::DbWeight::get().writes(1))
77-
.saturating_add(Weight::from_parts(0, 35).saturating_mul(e.into()))
78-
.saturating_add(Weight::from_parts(0, 32).saturating_mul(k.into()))
74+
.saturating_add(Weight::from_parts(0, 1761).saturating_mul(k.into()))
7975
}
8076
}

runtime/westend/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,6 @@ parameter_types! {
569569
pub const ImOnlineUnsignedPriority: TransactionPriority = TransactionPriority::max_value();
570570
pub const MaxKeys: u32 = 10_000;
571571
pub const MaxPeerInHeartbeats: u32 = 10_000;
572-
pub const MaxPeerDataEncodingSize: u32 = 1_000;
573572
}
574573

575574
impl pallet_im_online::Config for Runtime {
@@ -582,7 +581,6 @@ impl pallet_im_online::Config for Runtime {
582581
type WeightInfo = weights::pallet_im_online::WeightInfo<Runtime>;
583582
type MaxKeys = MaxKeys;
584583
type MaxPeerInHeartbeats = MaxPeerInHeartbeats;
585-
type MaxPeerDataEncodingSize = MaxPeerDataEncodingSize;
586584
}
587585

588586
parameter_types! {

runtime/westend/src/weights/pallet_im_online.rs

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
//! Autogenerated weights for `pallet_im_online`
1818
//!
1919
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
20-
//! DATE: 2023-05-25, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
20+
//! DATE: 2023-05-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
2121
//! WORST CASE MAP SIZE: `1000000`
22-
//! HOSTNAME: `bm5`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
22+
//! HOSTNAME: `build-host`, CPU: `AMD EPYC 7601 32-Core Processor`
2323
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westend-dev"), DB CACHE: 1024
2424
2525
// Executed Command:
@@ -54,25 +54,21 @@ impl<T: frame_system::Config> pallet_im_online::WeightInfo for WeightInfo<T> {
5454
/// Storage: ImOnline Keys (r:1 w:0)
5555
/// Proof: ImOnline Keys (max_values: Some(1), max_size: Some(320002), added: 320497, mode: MaxEncodedLen)
5656
/// Storage: ImOnline ReceivedHeartbeats (r:1 w:1)
57-
/// Proof: ImOnline ReceivedHeartbeats (max_values: None, max_size: Some(10021032), added: 10023507, mode: MaxEncodedLen)
57+
/// Proof: ImOnline ReceivedHeartbeats (max_values: None, max_size: Some(1028), added: 3503, mode: MaxEncodedLen)
5858
/// Storage: ImOnline AuthoredBlocks (r:1 w:0)
5959
/// Proof: ImOnline AuthoredBlocks (max_values: None, max_size: Some(56), added: 2531, mode: MaxEncodedLen)
6060
/// The range of component `k` is `[1, 1000]`.
61-
/// The range of component `e` is `[1, 100]`.
62-
fn validate_unsigned_and_then_heartbeat(k: u32, e: u32, ) -> Weight {
61+
fn validate_unsigned_and_then_heartbeat(k: u32, ) -> Weight {
6362
// Proof Size summary in bytes:
6463
// Measured: `361 + k * (32 ±0)`
65-
// Estimated: `10024497 + e * (35 ±0) + k * (32 ±0)`
66-
// Minimum execution time: 92_017_000 picoseconds.
67-
Weight::from_parts(73_188_461, 0)
68-
.saturating_add(Weight::from_parts(0, 10024497))
69-
// Standard Error: 316
70-
.saturating_add(Weight::from_parts(23_357, 0).saturating_mul(k.into()))
71-
// Standard Error: 3_193
72-
.saturating_add(Weight::from_parts(392_783, 0).saturating_mul(e.into()))
64+
// Estimated: `321487 + k * (1761 ±0)`
65+
// Minimum execution time: 122_571_000 picoseconds.
66+
Weight::from_parts(162_954_849, 0)
67+
.saturating_add(Weight::from_parts(0, 321487))
68+
// Standard Error: 8_676
69+
.saturating_add(Weight::from_parts(11_122, 0).saturating_mul(k.into()))
7370
.saturating_add(T::DbWeight::get().reads(4))
7471
.saturating_add(T::DbWeight::get().writes(1))
75-
.saturating_add(Weight::from_parts(0, 35).saturating_mul(e.into()))
76-
.saturating_add(Weight::from_parts(0, 32).saturating_mul(k.into()))
72+
.saturating_add(Weight::from_parts(0, 1761).saturating_mul(k.into()))
7773
}
7874
}

0 commit comments

Comments
 (0)