From 4a7c7c493ee921b44b5ee101e0815b04866d0c05 Mon Sep 17 00:00:00 2001 From: Steve Degosserie <723552+stiiifff@users.noreply.github.com> Date: Mon, 23 Feb 2026 16:12:20 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=94=A8=20Add=20missing=20imports,?= =?UTF-8?q?=20and=20temporarily=20remove=20Identity=20pallet's=20benchmark?= =?UTF-8?q?=20helper=20method.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ethereum-client/src/benchmarking/util.rs | 3 ++- .../src/benchmarking.rs | 3 +-- .../external-validators/src/benchmarking.rs | 1 - .../outbound-queue-v2/src/benchmarking.rs | 3 +++ .../pallets/system-v2/src/benchmarking.rs | 1 + operator/pallets/system/src/benchmarking.rs | 2 ++ .../primitives/snowbridge/core/src/lib.rs | 1 + operator/runtime/mainnet/src/configs/mod.rs | 21 ++++++++++--------- operator/runtime/stagenet/src/configs/mod.rs | 21 ++++++++++--------- operator/runtime/testnet/src/configs/mod.rs | 21 ++++++++++--------- 10 files changed, 43 insertions(+), 34 deletions(-) diff --git a/operator/pallets/ethereum-client/src/benchmarking/util.rs b/operator/pallets/ethereum-client/src/benchmarking/util.rs index 44403226..4c5cb31f 100644 --- a/operator/pallets/ethereum-client/src/benchmarking/util.rs +++ b/operator/pallets/ethereum-client/src/benchmarking/util.rs @@ -2,10 +2,11 @@ // SPDX-FileCopyrightText: 2023 Snowfork use crate::{ decompress_sync_committee_bits, Config, CurrentSyncCommittee, Pallet as EthereumBeaconClient, - Update, ValidatorsRoot, Vec, + Update, ValidatorsRoot, }; use snowbridge_beacon_primitives::PublicKeyPrepared; use sp_core::H256; +use alloc::vec::Vec; pub fn participant_pubkeys( update: &Update, diff --git a/operator/pallets/external-validators-rewards/src/benchmarking.rs b/operator/pallets/external-validators-rewards/src/benchmarking.rs index 4b84bc3f..154c7d0b 100644 --- a/operator/pallets/external-validators-rewards/src/benchmarking.rs +++ b/operator/pallets/external-validators-rewards/src/benchmarking.rs @@ -23,8 +23,7 @@ use crate::Pallet as ExternalValidatorsRewards; use { crate::types::BenchmarkHelper, frame_benchmarking::{account, v2::*, BenchmarkError}, - frame_support::traits::{Currency, EnsureOrigin}, - sp_std::prelude::*, + frame_support::traits::Currency, }; const SEED: u32 = 0; diff --git a/operator/pallets/external-validators/src/benchmarking.rs b/operator/pallets/external-validators/src/benchmarking.rs index 14c4df6b..b4f81073 100644 --- a/operator/pallets/external-validators/src/benchmarking.rs +++ b/operator/pallets/external-validators/src/benchmarking.rs @@ -27,7 +27,6 @@ use { pallet_session::{self as session, SessionManager}, rand::{RngCore, SeedableRng}, sp_runtime::{codec, traits::Convert}, - sp_std::prelude::*, }; const SEED: u32 = 0; diff --git a/operator/pallets/outbound-queue-v2/src/benchmarking.rs b/operator/pallets/outbound-queue-v2/src/benchmarking.rs index 1a498da6..8375f992 100644 --- a/operator/pallets/outbound-queue-v2/src/benchmarking.rs +++ b/operator/pallets/outbound-queue-v2/src/benchmarking.rs @@ -21,6 +21,9 @@ use crate::Pallet as OutboundQueue; )] mod benchmarks { use super::*; + use alloc::vec; + use alloc::boxed::Box; + use alloc::vec::Vec; /// Build `Upgrade` message with `MaxMessagePayloadSize`, in the worst-case. fn build_message() -> (Message, OutboundMessage) { diff --git a/operator/pallets/system-v2/src/benchmarking.rs b/operator/pallets/system-v2/src/benchmarking.rs index b2571f8f..a0f967ca 100644 --- a/operator/pallets/system-v2/src/benchmarking.rs +++ b/operator/pallets/system-v2/src/benchmarking.rs @@ -15,6 +15,7 @@ use xcm::prelude::*; #[benchmarks] mod benchmarks { use super::*; + use alloc::vec::Vec; #[benchmark] fn register_token() -> Result<(), BenchmarkError> { diff --git a/operator/pallets/system/src/benchmarking.rs b/operator/pallets/system/src/benchmarking.rs index e8c0f6dd..625c397c 100644 --- a/operator/pallets/system/src/benchmarking.rs +++ b/operator/pallets/system/src/benchmarking.rs @@ -15,6 +15,8 @@ use xcm::prelude::*; #[benchmarks] mod benchmarks { use super::*; + use alloc::vec::Vec; + use alloc::boxed::Box; #[benchmark] fn upgrade() -> Result<(), BenchmarkError> { diff --git a/operator/primitives/snowbridge/core/src/lib.rs b/operator/primitives/snowbridge/core/src/lib.rs index a10b0889..87dc0fb5 100644 --- a/operator/primitives/snowbridge/core/src/lib.rs +++ b/operator/primitives/snowbridge/core/src/lib.rs @@ -23,6 +23,7 @@ pub use polkadot_parachain_primitives::primitives::{ pub use ringbuffer::{RingBufferMap, RingBufferMapImpl}; pub use sp_core::U256; +use alloc::vec; use alloc::vec::Vec; use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; use frame_support::{traits::Contains, BoundedVec}; diff --git a/operator/runtime/mainnet/src/configs/mod.rs b/operator/runtime/mainnet/src/configs/mod.rs index 16f66caa..e7ad43be 100644 --- a/operator/runtime/mainnet/src/configs/mod.rs +++ b/operator/runtime/mainnet/src/configs/mod.rs @@ -657,17 +657,18 @@ impl pallet_identity::Config for Runtime { type UsernameDeposit = UsernameDeposit; type UsernameGracePeriod = UsernameGracePeriod; - #[cfg(feature = "runtime-benchmarks")] - fn benchmark_helper(message: &[u8]) -> (Vec, Vec) { - let public = sp_io::crypto::ecdsa_generate(0.into(), None); - let eth_signer: Self::SigningPublicKey = public.into(); - let hash_msg = sp_io::hashing::keccak_256(message); - let signature = Self::OffchainSignature::new( - sp_io::crypto::ecdsa_sign_prehashed(0.into(), &public, &hash_msg).unwrap(), - ); + // TODO: Replace by Identity pallet's BenchmarkHelper when available (stable2506). + // #[cfg(feature = "runtime-benchmarks")] + // fn benchmark_helper(message: &[u8]) -> (Vec, Vec) { + // let public = sp_io::crypto::ecdsa_generate(0.into(), None); + // let eth_signer: Self::SigningPublicKey = public.into(); + // let hash_msg = sp_io::hashing::keccak_256(message); + // let signature = Self::OffchainSignature::new( + // sp_io::crypto::ecdsa_sign_prehashed(0.into(), &public, &hash_msg).unwrap(), + // ); - (eth_signer.encode(), signature.encode()) - } + // (eth_signer.encode(), signature.encode()) + // } } parameter_types! { diff --git a/operator/runtime/stagenet/src/configs/mod.rs b/operator/runtime/stagenet/src/configs/mod.rs index 66272a1f..90122b2c 100644 --- a/operator/runtime/stagenet/src/configs/mod.rs +++ b/operator/runtime/stagenet/src/configs/mod.rs @@ -656,17 +656,18 @@ impl pallet_identity::Config for Runtime { type UsernameDeposit = UsernameDeposit; type UsernameGracePeriod = UsernameGracePeriod; - #[cfg(feature = "runtime-benchmarks")] - fn benchmark_helper(message: &[u8]) -> (Vec, Vec) { - let public = sp_io::crypto::ecdsa_generate(0.into(), None); - let eth_signer: Self::SigningPublicKey = public.into(); - let hash_msg = sp_io::hashing::keccak_256(message); - let signature = Self::OffchainSignature::new( - sp_io::crypto::ecdsa_sign_prehashed(0.into(), &public, &hash_msg).unwrap(), - ); + // TODO: Replace by Identity pallet's BenchmarkHelper when available (stable2506). + // #[cfg(feature = "runtime-benchmarks")] + // fn benchmark_helper(message: &[u8]) -> (Vec, Vec) { + // let public = sp_io::crypto::ecdsa_generate(0.into(), None); + // let eth_signer: Self::SigningPublicKey = public.into(); + // let hash_msg = sp_io::hashing::keccak_256(message); + // let signature = Self::OffchainSignature::new( + // sp_io::crypto::ecdsa_sign_prehashed(0.into(), &public, &hash_msg).unwrap(), + // ); - (eth_signer.encode(), signature.encode()) - } + // (eth_signer.encode(), signature.encode()) + // } } parameter_types! { diff --git a/operator/runtime/testnet/src/configs/mod.rs b/operator/runtime/testnet/src/configs/mod.rs index 67c1fc29..02ec4a31 100644 --- a/operator/runtime/testnet/src/configs/mod.rs +++ b/operator/runtime/testnet/src/configs/mod.rs @@ -659,17 +659,18 @@ impl pallet_identity::Config for Runtime { type UsernameDeposit = UsernameDeposit; type UsernameGracePeriod = UsernameGracePeriod; - #[cfg(feature = "runtime-benchmarks")] - fn benchmark_helper(message: &[u8]) -> (Vec, Vec) { - let public = sp_io::crypto::ecdsa_generate(0.into(), None); - let eth_signer: Self::SigningPublicKey = public.into(); - let hash_msg = sp_io::hashing::keccak_256(message); - let signature = Self::OffchainSignature::new( - sp_io::crypto::ecdsa_sign_prehashed(0.into(), &public, &hash_msg).unwrap(), - ); + // TODO: Replace by Identity pallet's BenchmarkHelper when available (stable2506). + // #[cfg(feature = "runtime-benchmarks")] + // fn benchmark_helper(message: &[u8]) -> (Vec, Vec) { + // let public = sp_io::crypto::ecdsa_generate(0.into(), None); + // let eth_signer: Self::SigningPublicKey = public.into(); + // let hash_msg = sp_io::hashing::keccak_256(message); + // let signature = Self::OffchainSignature::new( + // sp_io::crypto::ecdsa_sign_prehashed(0.into(), &public, &hash_msg).unwrap(), + // ); - (eth_signer.encode(), signature.encode()) - } + // (eth_signer.encode(), signature.encode()) + // } } parameter_types! {