diff --git a/Cargo.lock b/Cargo.lock index 93012742..fa299ba6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2407,7 +2407,7 @@ dependencies = [ "pallet-assets", "pallet-authority-discovery", "pallet-authorship", - "pallet-babe 4.0.0-dev", + "pallet-babe", "pallet-bags-list", "pallet-balances", "pallet-base-fee", @@ -2431,20 +2431,18 @@ dependencies = [ "pallet-evm-precompile-sha3fips", "pallet-evm-precompile-simple", "pallet-fast-unstake", - "pallet-grandpa 4.0.0-dev", + "pallet-grandpa", "pallet-hotfix-sufficients", "pallet-identity", - "pallet-im-online 4.0.0-dev", + "pallet-im-online", "pallet-indices", "pallet-insecure-randomness-collective-flip", "pallet-membership", "pallet-mmr", "pallet-multisig", "pallet-nomination-pools", - "pallet-nomination-pools-benchmarking", "pallet-nomination-pools-runtime-api", "pallet-offences", - "pallet-offences-benchmarking", "pallet-preimage", "pallet-proxy", "pallet-ranked-collective", @@ -2526,7 +2524,7 @@ dependencies = [ "mmr-rpc", "node-primitives", "pallet-evm 6.0.0-dev", - "pallet-im-online 4.0.0-dev", + "pallet-im-online", "pallet-timestamp", "pallet-transaction-payment", "pallet-transaction-payment-rpc", @@ -2617,7 +2615,7 @@ dependencies = [ "pallet-assets", "pallet-authority-discovery", "pallet-authorship", - "pallet-babe 4.0.0-dev", + "pallet-babe", "pallet-bags-list", "pallet-balances", "pallet-base-fee", @@ -2641,20 +2639,18 @@ dependencies = [ "pallet-evm-precompile-sha3fips", "pallet-evm-precompile-simple", "pallet-fast-unstake", - "pallet-grandpa 4.0.0-dev", + "pallet-grandpa", "pallet-hotfix-sufficients", "pallet-identity", - "pallet-im-online 4.0.0-dev", + "pallet-im-online", "pallet-indices", "pallet-insecure-randomness-collective-flip", "pallet-membership", "pallet-mmr", "pallet-multisig", "pallet-nomination-pools", - "pallet-nomination-pools-benchmarking", "pallet-nomination-pools-runtime-api", "pallet-offences", - "pallet-offences-benchmarking", "pallet-preimage", "pallet-proxy", "pallet-ranked-collective", @@ -2665,7 +2661,6 @@ dependencies = [ "pallet-root-testing", "pallet-scheduler", "pallet-session 4.0.0-dev", - "pallet-session-benchmarking", "pallet-staking 4.0.0-dev", "pallet-staking-runtime-api", "pallet-state-trie-migration", @@ -2732,7 +2727,7 @@ dependencies = [ "pallet-assets", "pallet-authority-discovery", "pallet-authorship", - "pallet-babe 4.0.0-dev", + "pallet-babe", "pallet-bags-list", "pallet-balances", "pallet-base-fee", @@ -2756,10 +2751,10 @@ dependencies = [ "pallet-evm-precompile-sha3fips", "pallet-evm-precompile-simple", "pallet-fast-unstake", - "pallet-grandpa 4.0.0-dev", + "pallet-grandpa", "pallet-hotfix-sufficients", "pallet-identity", - "pallet-im-online 4.0.0-dev", + "pallet-im-online", "pallet-indices", "pallet-insecure-randomness-collective-flip", "pallet-membership", @@ -2769,7 +2764,6 @@ dependencies = [ "pallet-nomination-pools-benchmarking", "pallet-nomination-pools-runtime-api", "pallet-offences", - "pallet-offences-benchmarking", "pallet-preimage", "pallet-proxy", "pallet-ranked-collective", @@ -2780,7 +2774,6 @@ dependencies = [ "pallet-root-testing", "pallet-scheduler", "pallet-session 4.0.0-dev", - "pallet-session-benchmarking", "pallet-staking 4.0.0-dev", "pallet-staking-runtime-api", "pallet-state-trie-migration", @@ -5700,30 +5693,6 @@ dependencies = [ "sp-std", ] -[[package]] -name = "pallet-babe" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "pallet-authorship", - "pallet-session 4.0.0-dev (git+https://github.com/paritytech/polkadot-sdk.git?branch=release-polkadot-v1.1.0)", - "pallet-timestamp", - "parity-scale-codec", - "scale-info", - "sp-application-crypto", - "sp-consensus-babe", - "sp-core", - "sp-io", - "sp-runtime", - "sp-session", - "sp-staking", - "sp-std", -] - [[package]] name = "pallet-bags-list" version = "4.0.0-dev" @@ -6222,29 +6191,6 @@ dependencies = [ "sp-std", ] -[[package]] -name = "pallet-grandpa" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "pallet-authorship", - "pallet-session 4.0.0-dev (git+https://github.com/paritytech/polkadot-sdk.git?branch=release-polkadot-v1.1.0)", - "parity-scale-codec", - "scale-info", - "sp-application-crypto", - "sp-consensus-grandpa", - "sp-core", - "sp-io", - "sp-runtime", - "sp-session", - "sp-staking", - "sp-std", -] - [[package]] name = "pallet-hotfix-sufficients" version = "1.0.0" @@ -6305,26 +6251,6 @@ dependencies = [ "sp-std", ] -[[package]] -name = "pallet-im-online" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "pallet-authorship", - "parity-scale-codec", - "scale-info", - "sp-application-crypto", - "sp-core", - "sp-io", - "sp-runtime", - "sp-staking", - "sp-std", -] - [[package]] name = "pallet-indices" version = "4.0.0-dev" @@ -6474,30 +6400,6 @@ dependencies = [ "sp-std", ] -[[package]] -name = "pallet-offences-benchmarking" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/polkadot-sdk.git?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" -dependencies = [ - "frame-benchmarking", - "frame-election-provider-support", - "frame-support", - "frame-system", - "log", - "pallet-babe 4.0.0-dev (git+https://github.com/paritytech/polkadot-sdk.git?branch=release-polkadot-v1.1.0)", - "pallet-balances", - "pallet-grandpa 4.0.0-dev (git+https://github.com/paritytech/polkadot-sdk.git?branch=release-polkadot-v1.1.0)", - "pallet-im-online 4.0.0-dev (git+https://github.com/paritytech/polkadot-sdk.git?branch=release-polkadot-v1.1.0)", - "pallet-offences", - "pallet-session 4.0.0-dev (git+https://github.com/paritytech/polkadot-sdk.git?branch=release-polkadot-v1.1.0)", - "pallet-staking 4.0.0-dev (git+https://github.com/paritytech/polkadot-sdk.git?branch=release-polkadot-v1.1.0)", - "parity-scale-codec", - "scale-info", - "sp-runtime", - "sp-staking", - "sp-std", -] - [[package]] name = "pallet-preimage" version = "4.0.0-dev" @@ -6610,7 +6512,7 @@ dependencies = [ "log", "pallet-balances", "pallet-esg", - "pallet-im-online 4.0.0-dev", + "pallet-im-online", "pallet-offences", "pallet-session 4.0.0-dev", "pallet-staking 4.0.0-dev", @@ -6737,7 +6639,7 @@ dependencies = [ "pallet-bags-list", "pallet-balances", "pallet-esg", - "pallet-im-online 4.0.0-dev", + "pallet-im-online", "pallet-offences", "pallet-reward", "pallet-session 4.0.0-dev", @@ -6771,7 +6673,6 @@ dependencies = [ "pallet-authorship", "pallet-session 4.0.0-dev (git+https://github.com/paritytech/polkadot-sdk.git?branch=release-polkadot-v1.1.0)", "parity-scale-codec", - "rand_chacha 0.2.2", "scale-info", "serde", "sp-application-crypto", diff --git a/frame/esg/src/benchmarking.rs b/frame/esg/src/benchmarking.rs index eb6fdc0d..db537927 100644 --- a/frame/esg/src/benchmarking.rs +++ b/frame/esg/src/benchmarking.rs @@ -2,7 +2,8 @@ use crate::{Pallet as Esg, *}; use frame_benchmarking::{account, benchmarks, whitelisted_caller}; -use frame_support::{inherent::Vec, WeakBoundedVec}; +use frame_support::WeakBoundedVec; +use sp_std::vec::Vec; use frame_system::RawOrigin; benchmarks! { diff --git a/frame/reward/src/benchmarking.rs b/frame/reward/src/benchmarking.rs index 10338033..8cc5455e 100644 --- a/frame/reward/src/benchmarking.rs +++ b/frame/reward/src/benchmarking.rs @@ -5,6 +5,7 @@ use frame_benchmarking::whitelisted_caller; use crate::Pallet as Reward; use frame_benchmarking::v2::*; use frame_system::RawOrigin as SystemOrigin; +use sp_std::vec; #[benchmarks] mod benchmarks { diff --git a/frame/reward/src/lib.rs b/frame/reward/src/lib.rs index ef2dc1e7..ad895a39 100644 --- a/frame/reward/src/lib.rs +++ b/frame/reward/src/lib.rs @@ -33,6 +33,7 @@ mod tests; pub mod weights; pub use weights::WeightInfo; + #[frame_support::pallet] pub mod pallet { use super::*; diff --git a/frame/staking/src/benchmarking.rs b/frame/staking/src/benchmarking.rs index ce5c3552..bac643a3 100644 --- a/frame/staking/src/benchmarking.rs +++ b/frame/staking/src/benchmarking.rs @@ -551,76 +551,76 @@ benchmarks! { assert_eq!(UnappliedSlashes::::get(&era).len(), (MAX_SLASHES - s) as usize); } - payout_stakers_dead_controller { - let n in 0 .. T::MaxNominatorRewardedPerValidator::get() as u32; - let (validator, nominators) = create_validator_with_nominators::( - n, - T::MaxNominatorRewardedPerValidator::get() as u32, - true, - true, - RewardDestination::Controller, - )?; - - let current_era = CurrentEra::::get().unwrap(); - // set the commission for this particular era as well. - >::insert(current_era, validator.clone(), >::validators(&validator)); - - let caller = whitelisted_caller(); - let validator_controller = >::get(&validator).unwrap(); - let balance_before = T::Currency::free_balance(&validator_controller); - for (_, controller) in &nominators { - let balance = T::Currency::free_balance(controller); - ensure!(balance.is_zero(), "Controller has balance, but should be dead."); - } - }: payout_stakers(RawOrigin::Signed(caller), validator, current_era) - verify { - let balance_after = T::Currency::free_balance(&validator_controller); - ensure!( - balance_before < balance_after, - "Balance of validator controller should have increased after payout.", - ); - for (_, controller) in &nominators { - let balance = T::Currency::free_balance(controller); - ensure!(!balance.is_zero(), "Payout not given to controller."); - } - } - - payout_stakers_alive_staked { - let n in 0 .. T::MaxNominatorRewardedPerValidator::get() as u32; - let (validator, nominators) = create_validator_with_nominators::( - n, - T::MaxNominatorRewardedPerValidator::get() as u32, - false, - true, - RewardDestination::Staked, - )?; - - let current_era = CurrentEra::::get().unwrap(); - // set the commission for this particular era as well. - >::insert(current_era, validator.clone(), >::validators(&validator)); - - let caller = whitelisted_caller(); - let balance_before = T::Currency::free_balance(&validator); - let mut nominator_balances_before = Vec::new(); - for (stash, _) in &nominators { - let balance = T::Currency::free_balance(stash); - nominator_balances_before.push(balance); - } - }: payout_stakers(RawOrigin::Signed(caller), validator.clone(), current_era) - verify { - let balance_after = T::Currency::free_balance(&validator); - ensure!( - balance_before < balance_after, - "Balance of validator stash should have increased after payout.", - ); - for ((stash, _), balance_before) in nominators.iter().zip(nominator_balances_before.iter()) { - let balance_after = T::Currency::free_balance(stash); - ensure!( - balance_before < &balance_after, - "Balance of nominator stash should have increased after payout.", - ); - } - } + // payout_stakers_dead_controller { + // let n in 0 .. T::MaxNominatorRewardedPerValidator::get() as u32; + // let (validator, nominators) = create_validator_with_nominators::( + // n, + // T::MaxNominatorRewardedPerValidator::get() as u32, + // true, + // true, + // RewardDestination::Controller, + // )?; + + // let current_era = CurrentEra::::get().unwrap(); + // // set the commission for this particular era as well. + // >::insert(current_era, validator.clone(), >::validators(&validator)); + + // let caller = whitelisted_caller(); + // let validator_controller = >::get(&validator).unwrap(); + // let balance_before = T::Currency::free_balance(&validator_controller); + // for (_, controller) in &nominators { + // let balance = T::Currency::free_balance(controller); + // ensure!(balance.is_zero(), "Controller has balance, but should be dead."); + // } + // }: payout_stakers(RawOrigin::Signed(caller), validator, current_era) + // verify { + // let balance_after = T::Currency::free_balance(&validator_controller); + // ensure!( + // balance_before < balance_after, + // "Balance of validator controller should have increased after payout.", + // ); + // for (_, controller) in &nominators { + // let balance = T::Currency::free_balance(controller); + // ensure!(!balance.is_zero(), "Payout not given to controller."); + // } + // } + + // payout_stakers_alive_staked { + // let n in 0 .. T::MaxNominatorRewardedPerValidator::get() as u32; + // let (validator, nominators) = create_validator_with_nominators::( + // n, + // T::MaxNominatorRewardedPerValidator::get() as u32, + // false, + // true, + // RewardDestination::Staked, + // )?; + + // let current_era = CurrentEra::::get().unwrap(); + // // set the commission for this particular era as well. + // >::insert(current_era, validator.clone(), >::validators(&validator)); + + // let caller = whitelisted_caller(); + // let balance_before = T::Currency::free_balance(&validator); + // let mut nominator_balances_before = Vec::new(); + // for (stash, _) in &nominators { + // let balance = T::Currency::free_balance(stash); + // nominator_balances_before.push(balance); + // } + // }: payout_stakers(RawOrigin::Signed(caller), validator.clone(), current_era) + // verify { + // let balance_after = T::Currency::free_balance(&validator); + // ensure!( + // balance_before < balance_after, + // "Balance of validator stash should have increased after payout.", + // ); + // for ((stash, _), balance_before) in nominators.iter().zip(nominator_balances_before.iter()) { + // let balance_after = T::Currency::free_balance(stash); + // ensure!( + // balance_before < &balance_after, + // "Balance of nominator stash should have increased after payout.", + // ); + // } + // } rebond { let l in 1 .. T::MaxUnlockingChunks::get() as u32; @@ -721,56 +721,56 @@ benchmarks! { assert!(validators.len() == v as usize); } - #[extra] - payout_all { - let v in 1 .. 10; - let n in 0 .. 100; - create_validators_with_nominators_for_era::( - v, - n, - MaxNominationsOf::::get() as usize, - false, - None, - )?; - // Start a new Era - let new_validators = Staking::::try_trigger_new_era(SessionIndex::one(), true).unwrap(); - assert!(new_validators.len() == v as usize); - - let current_era = CurrentEra::::get().unwrap(); - let mut points_total = 0; - let mut points_individual = Vec::new(); - let mut payout_calls_arg = Vec::new(); - - for validator in new_validators.iter() { - points_total += 10; - points_individual.push((validator.clone(), 10)); - payout_calls_arg.push((validator.clone(), current_era)); - } - - // Give Era Points - let reward = EraRewardPoints:: { - total: points_total, - individual: points_individual.into_iter().collect(), - }; - - ErasRewardPoints::::insert(current_era, reward); - - // Create reward pool - let total_payout = T::Currency::minimum_balance() * 1000u32.into(); - >::insert(current_era, total_payout); - - let caller: T::AccountId = whitelisted_caller(); - let origin = RawOrigin::Signed(caller); - let calls: Vec<_> = payout_calls_arg.iter().map(|arg| - Call::::payout_stakers { validator_stash: arg.0.clone(), era: arg.1 }.encode() - ).collect(); - }: { - for call in calls { - as Decode>::decode(&mut &*call) - .expect("call is encoded above, encoding must be correct") - .dispatch_bypass_filter(origin.clone().into())?; - } - } + // #[extra] + // payout_all { + // let v in 1 .. 10; + // let n in 0 .. 100; + // create_validators_with_nominators_for_era::( + // v, + // n, + // MaxNominationsOf::::get() as usize, + // false, + // None, + // )?; + // // Start a new Era + // let new_validators = Staking::::try_trigger_new_era(SessionIndex::one(), true).unwrap(); + // assert!(new_validators.len() == v as usize); + + // let current_era = CurrentEra::::get().unwrap(); + // let mut points_total = 0; + // let mut points_individual = Vec::new(); + // let mut payout_calls_arg = Vec::new(); + + // for validator in new_validators.iter() { + // points_total += 10; + // points_individual.push((validator.clone(), 10)); + // payout_calls_arg.push((validator.clone(), current_era)); + // } + + // // Give Era Points + // let reward = EraRewardPoints:: { + // total: points_total, + // individual: points_individual.into_iter().collect(), + // }; + + // ErasRewardPoints::::insert(current_era, reward); + + // // Create reward pool + // let total_payout = T::Currency::minimum_balance() * 1000u32.into(); + // >::insert(current_era, total_payout); + + // let caller: T::AccountId = whitelisted_caller(); + // let origin = RawOrigin::Signed(caller); + // let calls: Vec<_> = payout_calls_arg.iter().map(|arg| + // Call::::payout_stakers { validator_stash: arg.0.clone(), era: arg.1 }.encode() + // ).collect(); + // }: { + // for call in calls { + // as Decode>::decode(&mut &*call) + // .expect("call is encoded above, encoding must be correct") + // .dispatch_bypass_filter(origin.clone().into())?; + // } + // } #[extra] do_slash { @@ -979,35 +979,35 @@ mod tests { }); } - #[test] - fn create_validator_with_nominators_works() { - ExtBuilder::default().build_and_execute(|| { - let n = 10; - - let (validator_stash, nominators) = create_validator_with_nominators::( - n, - <::MaxNominatorRewardedPerValidator as Get<_>>::get(), - false, - false, - RewardDestination::Staked, - ) - .unwrap(); - - assert_eq!(nominators.len() as u32, n); - - let current_era = CurrentEra::::get().unwrap(); - - let original_free_balance = Balances::free_balance(&validator_stash); - assert_ok!(Staking::payout_stakers( - RuntimeOrigin::signed(1337), - validator_stash, - current_era - )); - let new_free_balance = Balances::free_balance(&validator_stash); - - assert!(original_free_balance < new_free_balance); - }); - } + // #[test] + // fn create_validator_with_nominators_works() { + // ExtBuilder::default().build_and_execute(|| { + // let n = 10; + + // let (validator_stash, nominators) = create_validator_with_nominators::( + // n, + // <::MaxNominatorRewardedPerValidator as Get<_>>::get(), + // false, + // false, + // RewardDestination::Staked, + // ) + // .unwrap(); + + // assert_eq!(nominators.len() as u32, n); + + // let current_era = CurrentEra::::get().unwrap(); + + // let original_free_balance = Balances::free_balance(&validator_stash); + // assert_ok!(::payout_stakers( + // RuntimeOrigin::signed(1337), + // validator_stash, + // current_era + // )); + // let new_free_balance = Balances::free_balance(&validator_stash); + + // assert!(original_free_balance < new_free_balance); + // }); + // } #[test] fn add_slashing_spans_works() { diff --git a/runtime/firechain-mainnet-runtime/Cargo.toml b/runtime/firechain-mainnet-runtime/Cargo.toml index 3c9c4af0..537663e2 100644 --- a/runtime/firechain-mainnet-runtime/Cargo.toml +++ b/runtime/firechain-mainnet-runtime/Cargo.toml @@ -87,10 +87,8 @@ pallet-membership = { workspace = true } pallet-mmr = { workspace = true } pallet-multisig = { workspace = true } pallet-nomination-pools = { workspace = true } -pallet-nomination-pools-benchmarking = { workspace = true, optional = true } pallet-nomination-pools-runtime-api = { workspace = true } pallet-offences = { workspace = true } -pallet-offences-benchmarking = { workspace = true, optional = true } pallet-preimage = { workspace = true } pallet-proxy = { workspace = true } pallet-insecure-randomness-collective-flip = { workspace = true } @@ -140,7 +138,6 @@ default = ["std"] runtime-wasm = [] with-tracing = ["frame-executive/with-tracing"] std = [ - "pallet-offences-benchmarking?/std", "pallet-election-provider-support-benchmarking?/std", "frame-system-benchmarking?/std", "frame-election-provider-support/std", @@ -175,7 +172,6 @@ std = [ "pallet-multisig/std", "pallet-nomination-pools/std", "pallet-nomination-pools-runtime-api/std", - "pallet-nomination-pools-benchmarking?/std", "pallet-identity/std", "pallet-scheduler/std", "node-primitives/std", @@ -187,7 +183,6 @@ std = [ "pallet-insecure-randomness-collective-flip/std", "sp-std/std", "pallet-session/std", - "pallet-session-benchmarking?/std", "sp-api/std", "sp-runtime/std", "sp-staking/std", @@ -267,8 +262,6 @@ runtime-benchmarks = [ "pallet-membership/runtime-benchmarks", "pallet-mmr/runtime-benchmarks", "pallet-multisig/runtime-benchmarks", - "pallet-nomination-pools-benchmarking/runtime-benchmarks", - "pallet-offences-benchmarking/runtime-benchmarks", "pallet-preimage/runtime-benchmarks", "pallet-proxy/runtime-benchmarks", "pallet-scheduler/runtime-benchmarks", @@ -276,7 +269,6 @@ runtime-benchmarks = [ "pallet-referenda/runtime-benchmarks", "pallet-recovery/runtime-benchmarks", "pallet-remark/runtime-benchmarks", - "pallet-session-benchmarking/runtime-benchmarks", "pallet-staking/runtime-benchmarks", "pallet-state-trie-migration/runtime-benchmarks", "pallet-sudo/runtime-benchmarks", diff --git a/runtime/firechain-mainnet-runtime/src/lib.rs b/runtime/firechain-mainnet-runtime/src/lib.rs index 71fbfc44..2ce37bb5 100644 --- a/runtime/firechain-mainnet-runtime/src/lib.rs +++ b/runtime/firechain-mainnet-runtime/src/lib.rs @@ -1814,8 +1814,6 @@ mod benches { [pallet_membership, TechnicalMembership] [pallet_mmr, Mmr] [pallet_multisig, Multisig] - [pallet_nomination_pools, NominationPoolsBench::] - [pallet_offences, OffencesBench::] [pallet_preimage, Preimage] [pallet_proxy, Proxy] [pallet_ranked_collective, RankedCollective] @@ -1823,7 +1821,6 @@ mod benches { [pallet_recovery, Recovery] [pallet_remark, Remark] [pallet_scheduler, Scheduler] - [pallet_session, SessionBench::] [pallet_staking, Staking] [pallet_state_trie_migration, StateTrieMigration] [pallet_sudo, Sudo] @@ -1835,6 +1832,7 @@ mod benches { [pallet_vesting, Vesting] [pallet_evm, EVM] [pallet_esg, EsgScore] + [pallet_reward, Reward] ); } @@ -2431,12 +2429,9 @@ impl_runtime_apis! { // Trying to add benchmarks directly to the Session Pallet caused cyclic dependency // issues. To get around that, we separated the Session benchmarks into its own crate, // which is why we need these two lines below. - use pallet_session_benchmarking::Pallet as SessionBench; - use pallet_offences_benchmarking::Pallet as OffencesBench; use pallet_election_provider_support_benchmarking::Pallet as EPSBench; use frame_system_benchmarking::Pallet as SystemBench; use baseline::Pallet as BaselineBench; - use pallet_nomination_pools_benchmarking::Pallet as NominationPoolsBench; let mut list = Vec::::new(); list_benchmarks!(list, extra); @@ -2449,24 +2444,19 @@ impl_runtime_apis! { fn dispatch_benchmark( config: frame_benchmarking::BenchmarkConfig ) -> Result, sp_runtime::RuntimeString> { - use frame_benchmarking::{baseline, Benchmarking, BenchmarkBatch, TrackedStorageKey}; + use frame_benchmarking::{baseline, Benchmarking, BenchmarkBatch}; + use frame_support::traits::TrackedStorageKey; // Trying to add benchmarks directly to the Session Pallet caused cyclic dependency // issues. To get around that, we separated the Session benchmarks into its own crate, // which is why we need these two lines below. - use pallet_session_benchmarking::Pallet as SessionBench; - use pallet_offences_benchmarking::Pallet as OffencesBench; use pallet_election_provider_support_benchmarking::Pallet as EPSBench; use frame_system_benchmarking::Pallet as SystemBench; use baseline::Pallet as BaselineBench; - use pallet_nomination_pools_benchmarking::Pallet as NominationPoolsBench; - impl pallet_session_benchmarking::Config for Runtime {} - impl pallet_offences_benchmarking::Config for Runtime {} impl pallet_election_provider_support_benchmarking::Config for Runtime {} impl frame_system_benchmarking::Config for Runtime {} impl baseline::Config for Runtime {} - impl pallet_nomination_pools_benchmarking::Config for Runtime {} use frame_support::traits::WhitelistedStorageKeys; let mut whitelist: Vec = AllPalletsWithSystem::whitelisted_storage_keys(); diff --git a/runtime/firechain-qa-runtime/Cargo.toml b/runtime/firechain-qa-runtime/Cargo.toml index e9fbe5ff..3cea3739 100644 --- a/runtime/firechain-qa-runtime/Cargo.toml +++ b/runtime/firechain-qa-runtime/Cargo.toml @@ -87,10 +87,9 @@ pallet-membership = { workspace = true } pallet-mmr = { workspace = true } pallet-multisig = { workspace = true } pallet-nomination-pools = { workspace = true } -pallet-nomination-pools-benchmarking = { workspace = true, optional = true } pallet-nomination-pools-runtime-api = { workspace = true } pallet-offences = { workspace = true } -pallet-offences-benchmarking = { workspace = true, optional = true } +# pallet-offences-benchmarking = { workspace = true, optional = true } pallet-preimage = { workspace = true } pallet-proxy = { workspace = true } pallet-insecure-randomness-collective-flip = { workspace = true } @@ -100,7 +99,7 @@ pallet-referenda = { workspace = true } pallet-remark = { workspace = true } pallet-root-testing = { workspace = true } pallet-session = { workspace = true, features = ["historical"] } -pallet-session-benchmarking = { workspace = true, optional = true } +# pallet-session-benchmarking = { workspace = true, optional = true } pallet-staking = { workspace = true } pallet-staking-runtime-api = { workspace = true } pallet-state-trie-migration = { workspace = true } @@ -140,7 +139,6 @@ substrate-wasm-builder = { workspace = true, optional = true } default = ["std"] with-tracing = ["frame-executive/with-tracing"] std = [ - "pallet-offences-benchmarking?/std", "pallet-election-provider-support-benchmarking?/std", "frame-system-benchmarking?/std", "frame-election-provider-support/std", @@ -175,7 +173,6 @@ std = [ "pallet-multisig/std", "pallet-nomination-pools/std", "pallet-nomination-pools-runtime-api/std", - "pallet-nomination-pools-benchmarking?/std", "pallet-identity/std", "pallet-scheduler/std", "node-primitives/std", @@ -187,7 +184,6 @@ std = [ "pallet-insecure-randomness-collective-flip/std", "sp-std/std", "pallet-session/std", - "pallet-session-benchmarking?/std", "sp-api/std", "sp-runtime/std", "sp-staking/std", @@ -268,8 +264,6 @@ runtime-benchmarks = [ "pallet-membership/runtime-benchmarks", "pallet-mmr/runtime-benchmarks", "pallet-multisig/runtime-benchmarks", - "pallet-nomination-pools-benchmarking/runtime-benchmarks", - "pallet-offences-benchmarking/runtime-benchmarks", "pallet-preimage/runtime-benchmarks", "pallet-proxy/runtime-benchmarks", "pallet-scheduler/runtime-benchmarks", @@ -277,7 +271,6 @@ runtime-benchmarks = [ "pallet-referenda/runtime-benchmarks", "pallet-recovery/runtime-benchmarks", "pallet-remark/runtime-benchmarks", - "pallet-session-benchmarking/runtime-benchmarks", "pallet-staking/runtime-benchmarks", "pallet-state-trie-migration/runtime-benchmarks", "pallet-sudo/runtime-benchmarks", diff --git a/runtime/firechain-qa-runtime/src/lib.rs b/runtime/firechain-qa-runtime/src/lib.rs index 95b3a627..877d3624 100644 --- a/runtime/firechain-qa-runtime/src/lib.rs +++ b/runtime/firechain-qa-runtime/src/lib.rs @@ -1810,8 +1810,6 @@ mod benches { [pallet_membership, TechnicalMembership] [pallet_mmr, Mmr] [pallet_multisig, Multisig] - [pallet_nomination_pools, NominationPoolsBench::] - [pallet_offences, OffencesBench::] [pallet_preimage, Preimage] [pallet_proxy, Proxy] [pallet_ranked_collective, RankedCollective] @@ -1820,7 +1818,6 @@ mod benches { [pallet_remark, Remark] [pallet_reward, Reward] [pallet_scheduler, Scheduler] - [pallet_session, SessionBench::] [pallet_staking, Staking] [pallet_state_trie_migration, StateTrieMigration] [pallet_sudo, Sudo] @@ -1832,6 +1829,7 @@ mod benches { [pallet_vesting, Vesting] [pallet_evm, EVM] [pallet_esg,EsgScore] + [pallet_reward, Reward] ); } @@ -2428,12 +2426,9 @@ impl_runtime_apis! { // Trying to add benchmarks directly to the Session Pallet caused cyclic dependency // issues. To get around that, we separated the Session benchmarks into its own crate, // which is why we need these two lines below. - use pallet_session_benchmarking::Pallet as SessionBench; - use pallet_offences_benchmarking::Pallet as OffencesBench; use pallet_election_provider_support_benchmarking::Pallet as EPSBench; use frame_system_benchmarking::Pallet as SystemBench; use baseline::Pallet as BaselineBench; - use pallet_nomination_pools_benchmarking::Pallet as NominationPoolsBench; let mut list = Vec::::new(); list_benchmarks!(list, extra); @@ -2446,24 +2441,19 @@ impl_runtime_apis! { fn dispatch_benchmark( config: frame_benchmarking::BenchmarkConfig ) -> Result, sp_runtime::RuntimeString> { - use frame_benchmarking::{baseline, Benchmarking, BenchmarkBatch, TrackedStorageKey}; + use frame_benchmarking::{baseline, Benchmarking, BenchmarkBatch}; + use frame_support::traits::TrackedStorageKey; // Trying to add benchmarks directly to the Session Pallet caused cyclic dependency // issues. To get around that, we separated the Session benchmarks into its own crate, // which is why we need these two lines below. - use pallet_session_benchmarking::Pallet as SessionBench; - use pallet_offences_benchmarking::Pallet as OffencesBench; use pallet_election_provider_support_benchmarking::Pallet as EPSBench; use frame_system_benchmarking::Pallet as SystemBench; use baseline::Pallet as BaselineBench; - use pallet_nomination_pools_benchmarking::Pallet as NominationPoolsBench; - impl pallet_session_benchmarking::Config for Runtime {} - impl pallet_offences_benchmarking::Config for Runtime {} impl pallet_election_provider_support_benchmarking::Config for Runtime {} impl frame_system_benchmarking::Config for Runtime {} impl baseline::Config for Runtime {} - impl pallet_nomination_pools_benchmarking::Config for Runtime {} use frame_support::traits::WhitelistedStorageKeys; let mut whitelist: Vec = AllPalletsWithSystem::whitelisted_storage_keys(); diff --git a/runtime/firechain-thunder-runtime/Cargo.toml b/runtime/firechain-thunder-runtime/Cargo.toml index f70c8ba7..853fd833 100644 --- a/runtime/firechain-thunder-runtime/Cargo.toml +++ b/runtime/firechain-thunder-runtime/Cargo.toml @@ -80,7 +80,6 @@ pallet-nomination-pools = { workspace = true } pallet-nomination-pools-benchmarking = { workspace = true, optional = true } pallet-nomination-pools-runtime-api = { workspace = true } pallet-offences = { workspace = true } -pallet-offences-benchmarking = { workspace = true, optional = true } pallet-preimage = { workspace = true } pallet-proxy = { workspace = true } pallet-insecure-randomness-collective-flip = { workspace = true } @@ -90,7 +89,6 @@ pallet-referenda = { workspace = true } pallet-remark = { workspace = true} pallet-root-testing = { workspace = true } pallet-session = { workspace = true, features = [ "historical" ] } -pallet-session-benchmarking = { workspace = true, optional = true } pallet-staking = { workspace = true} pallet-staking-runtime-api = { workspace = true } pallet-state-trie-migration = { workspace = true } @@ -130,7 +128,6 @@ default = ["std"] runtime-wasm = [] #with-tracing = ["frame-executive/with-tracing"] std = [ - "pallet-offences-benchmarking?/std", "pallet-election-provider-support-benchmarking?/std", "frame-system-benchmarking?/std", "frame-election-provider-support/std", @@ -177,7 +174,6 @@ std = [ "pallet-insecure-randomness-collective-flip/std", "sp-std/std", "pallet-session/std", - "pallet-session-benchmarking?/std", "sp-api/std", "sp-runtime/std", "sp-staking/std", @@ -257,8 +253,6 @@ runtime-benchmarks = [ "pallet-membership/runtime-benchmarks", "pallet-mmr/runtime-benchmarks", "pallet-multisig/runtime-benchmarks", - "pallet-nomination-pools-benchmarking/runtime-benchmarks", - "pallet-offences-benchmarking/runtime-benchmarks", "pallet-preimage/runtime-benchmarks", "pallet-proxy/runtime-benchmarks", "pallet-scheduler/runtime-benchmarks", @@ -266,7 +260,6 @@ runtime-benchmarks = [ "pallet-referenda/runtime-benchmarks", "pallet-recovery/runtime-benchmarks", "pallet-remark/runtime-benchmarks", - "pallet-session-benchmarking/runtime-benchmarks", "pallet-staking/runtime-benchmarks", "pallet-state-trie-migration/runtime-benchmarks", "pallet-sudo/runtime-benchmarks", diff --git a/runtime/firechain-thunder-runtime/src/lib.rs b/runtime/firechain-thunder-runtime/src/lib.rs index 37af2a80..2e85330b 100644 --- a/runtime/firechain-thunder-runtime/src/lib.rs +++ b/runtime/firechain-thunder-runtime/src/lib.rs @@ -1815,8 +1815,6 @@ mod benches { [pallet_membership, TechnicalMembership] [pallet_mmr, Mmr] [pallet_multisig, Multisig] - [pallet_nomination_pools, NominationPoolsBench::] - [pallet_offences, OffencesBench::] [pallet_preimage, Preimage] [pallet_proxy, Proxy] [pallet_ranked_collective, RankedCollective] @@ -1824,7 +1822,6 @@ mod benches { [pallet_recovery, Recovery] [pallet_remark, Remark] [pallet_scheduler, Scheduler] - [pallet_session, SessionBench::] [pallet_staking, Staking] [pallet_state_trie_migration, StateTrieMigration] [pallet_sudo, Sudo] @@ -1836,6 +1833,7 @@ mod benches { [pallet_vesting, Vesting] [pallet_evm, EVM] [pallet_esg, EsgScore] + [pallet_reward, Reward] ); } @@ -2431,12 +2429,10 @@ impl_runtime_apis! { // Trying to add benchmarks directly to the Session Pallet caused cyclic dependency // issues. To get around that, we separated the Session benchmarks into its own crate, // which is why we need these two lines below. - use pallet_session_benchmarking::Pallet as SessionBench; - use pallet_offences_benchmarking::Pallet as OffencesBench; use pallet_election_provider_support_benchmarking::Pallet as EPSBench; use frame_system_benchmarking::Pallet as SystemBench; use baseline::Pallet as BaselineBench; - use pallet_nomination_pools_benchmarking::Pallet as NominationPoolsBench; + let mut list = Vec::::new(); list_benchmarks!(list, extra); @@ -2449,24 +2445,22 @@ impl_runtime_apis! { fn dispatch_benchmark( config: frame_benchmarking::BenchmarkConfig ) -> Result, sp_runtime::RuntimeString> { - use frame_benchmarking::{baseline, Benchmarking, BenchmarkBatch, TrackedStorageKey}; + use frame_benchmarking::{baseline, Benchmarking, BenchmarkBatch}; + use frame_support::traits::TrackedStorageKey; // Trying to add benchmarks directly to the Session Pallet caused cyclic dependency // issues. To get around that, we separated the Session benchmarks into its own crate, // which is why we need these two lines below. - use pallet_session_benchmarking::Pallet as SessionBench; - use pallet_offences_benchmarking::Pallet as OffencesBench; + use pallet_election_provider_support_benchmarking::Pallet as EPSBench; use frame_system_benchmarking::Pallet as SystemBench; use baseline::Pallet as BaselineBench; - use pallet_nomination_pools_benchmarking::Pallet as NominationPoolsBench; - impl pallet_session_benchmarking::Config for Runtime {} - impl pallet_offences_benchmarking::Config for Runtime {} + + impl pallet_election_provider_support_benchmarking::Config for Runtime {} impl frame_system_benchmarking::Config for Runtime {} impl baseline::Config for Runtime {} - impl pallet_nomination_pools_benchmarking::Config for Runtime {} use frame_support::traits::WhitelistedStorageKeys; let mut whitelist: Vec = AllPalletsWithSystem::whitelisted_storage_keys();