From 6185b002dfb54c73881257913a830416f2e17a15 Mon Sep 17 00:00:00 2001
From: s0me0ne-unkn0wn <48632512+s0me0ne-unkn0wn@users.noreply.github.com>
Date: Sun, 18 Feb 2024 03:52:34 +0100
Subject: [PATCH] Remove unused `im-online` weights (#3373)

A follow-up of #2265. Removes weights no longer needed.
---
 polkadot/runtime/rococo/src/weights/mod.rs    |  1 -
 .../rococo/src/weights/pallet_im_online.rs    | 76 ------------------
 polkadot/runtime/westend/src/weights/mod.rs   |  1 -
 .../westend/src/weights/pallet_im_online.rs   | 77 -------------------
 4 files changed, 155 deletions(-)
 delete mode 100644 polkadot/runtime/rococo/src/weights/pallet_im_online.rs
 delete mode 100644 polkadot/runtime/westend/src/weights/pallet_im_online.rs

diff --git a/polkadot/runtime/rococo/src/weights/mod.rs b/polkadot/runtime/rococo/src/weights/mod.rs
index 0ba21ccf322..7328dca9393 100644
--- a/polkadot/runtime/rococo/src/weights/mod.rs
+++ b/polkadot/runtime/rococo/src/weights/mod.rs
@@ -23,7 +23,6 @@ pub mod pallet_bounties;
 pub mod pallet_child_bounties;
 pub mod pallet_conviction_voting;
 pub mod pallet_identity;
-pub mod pallet_im_online;
 pub mod pallet_indices;
 pub mod pallet_message_queue;
 pub mod pallet_multisig;
diff --git a/polkadot/runtime/rococo/src/weights/pallet_im_online.rs b/polkadot/runtime/rococo/src/weights/pallet_im_online.rs
deleted file mode 100644
index b866426de52..00000000000
--- a/polkadot/runtime/rococo/src/weights/pallet_im_online.rs
+++ /dev/null
@@ -1,76 +0,0 @@
-// Copyright (C) Parity Technologies (UK) Ltd.
-// This file is part of Polkadot.
-
-// Polkadot is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Polkadot is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Polkadot.  If not, see <http://www.gnu.org/licenses/>.
-
-//! Autogenerated weights for `pallet_im_online`
-//!
-//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
-//! DATE: 2023-05-31, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
-//! WORST CASE MAP SIZE: `1000000`
-//! 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:
-// ./target/production/polkadot
-// benchmark
-// pallet
-// --chain=rococo-dev
-// --steps=50
-// --repeat=20
-// --pallet=pallet_im_online
-// --extrinsic=*
-// --execution=wasm
-// --wasm-execution=compiled
-// --header=./file_header.txt
-// --output=./runtime/rococo/src/weights/
-
-#![cfg_attr(rustfmt, rustfmt_skip)]
-#![allow(unused_parens)]
-#![allow(unused_imports)]
-#![allow(missing_docs)]
-
-use frame_support::{traits::Get, weights::Weight};
-use core::marker::PhantomData;
-
-/// Weight functions for `pallet_im_online`.
-pub struct WeightInfo<T>(PhantomData<T>);
-impl<T: frame_system::Config> pallet_im_online::WeightInfo for WeightInfo<T> {
-	/// Storage: Session Validators (r:1 w:0)
-	/// Proof Skipped: Session Validators (max_values: Some(1), max_size: None, mode: Measured)
-	/// Storage: Session CurrentIndex (r:1 w:0)
-	/// Proof Skipped: Session CurrentIndex (max_values: Some(1), max_size: None, mode: Measured)
-	/// Storage: ImOnline Keys (r:1 w:0)
-	/// Proof: ImOnline Keys (max_values: Some(1), max_size: Some(320002), added: 320497, mode: MaxEncodedLen)
-	/// 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(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]`.
-	fn validate_unsigned_and_then_heartbeat(k: u32, ) -> Weight {
-		// Proof Size summary in bytes:
-		//  Measured:  `394 + k * (32 ±0)`
-		//  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, 1761).saturating_mul(k.into()))
-	}
-}
diff --git a/polkadot/runtime/westend/src/weights/mod.rs b/polkadot/runtime/westend/src/weights/mod.rs
index d8a2ae5d2da..f6a9008d718 100644
--- a/polkadot/runtime/westend/src/weights/mod.rs
+++ b/polkadot/runtime/westend/src/weights/mod.rs
@@ -24,7 +24,6 @@ pub mod pallet_conviction_voting;
 pub mod pallet_election_provider_multi_phase;
 pub mod pallet_fast_unstake;
 pub mod pallet_identity;
-pub mod pallet_im_online;
 pub mod pallet_indices;
 pub mod pallet_message_queue;
 pub mod pallet_multisig;
diff --git a/polkadot/runtime/westend/src/weights/pallet_im_online.rs b/polkadot/runtime/westend/src/weights/pallet_im_online.rs
deleted file mode 100644
index a83cd43804d..00000000000
--- a/polkadot/runtime/westend/src/weights/pallet_im_online.rs
+++ /dev/null
@@ -1,77 +0,0 @@
-// Copyright (C) Parity Technologies (UK) Ltd.
-// This file is part of Polkadot.
-
-// Polkadot is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Polkadot is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Polkadot.  If not, see <http://www.gnu.org/licenses/>.
-
-//! Autogenerated weights for `pallet_im_online`
-//!
-//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
-//! DATE: 2023-05-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
-//! WORST CASE MAP SIZE: `1000000`
-//! 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:
-// ./target/production/polkadot
-// benchmark
-// pallet
-// --chain=westend-dev
-// --steps=50
-// --repeat=20
-// --no-storage-info
-// --no-median-slopes
-// --no-min-squares
-// --pallet=pallet_im_online
-// --extrinsic=*
-// --execution=wasm
-// --wasm-execution=compiled
-// --header=./file_header.txt
-// --output=./runtime/westend/src/weights/
-
-#![cfg_attr(rustfmt, rustfmt_skip)]
-#![allow(unused_parens)]
-#![allow(unused_imports)]
-#![allow(missing_docs)]
-
-use frame_support::{traits::Get, weights::Weight};
-use core::marker::PhantomData;
-
-/// Weight functions for `pallet_im_online`.
-pub struct WeightInfo<T>(PhantomData<T>);
-impl<T: frame_system::Config> pallet_im_online::WeightInfo for WeightInfo<T> {
-	/// Storage: Session Validators (r:1 w:0)
-	/// Proof Skipped: Session Validators (max_values: Some(1), max_size: None, mode: Measured)
-	/// Storage: Session CurrentIndex (r:1 w:0)
-	/// Proof Skipped: Session CurrentIndex (max_values: Some(1), max_size: None, mode: Measured)
-	/// 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(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]`.
-	fn validate_unsigned_and_then_heartbeat(k: u32, ) -> Weight {
-		// Proof Size summary in bytes:
-		//  Measured:  `361 + k * (32 ±0)`
-		//  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, 1761).saturating_mul(k.into()))
-	}
-}
-- 
GitLab