From bb5a5409dd64935b116cc4fc2a38d6d91e38a3e6 Mon Sep 17 00:00:00 2001 From: gui Date: Wed, 13 Nov 2024 16:33:56 +0900 Subject: [PATCH 1/4] fix benchmark --- substrate/frame/staking/src/benchmarking.rs | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/substrate/frame/staking/src/benchmarking.rs b/substrate/frame/staking/src/benchmarking.rs index 96bd3860542f..905f830f91d7 100644 --- a/substrate/frame/staking/src/benchmarking.rs +++ b/substrate/frame/staking/src/benchmarking.rs @@ -975,20 +975,22 @@ mod benchmarks { ) -> Result<(), BenchmarkError> { // number of nominator intention. let n = MaxNominators::::get(); + create_validators_with_nominators_for_era::( + v, + n, + MaxNominationsOf::::get() as usize, + false, + None, + )?; + + let targets; #[block] { - create_validators_with_nominators_for_era::( - v, - n, - MaxNominationsOf::::get() as usize, - false, - None, - )?; + // default bounds are unbounded. + targets = >::get_npos_targets(DataProviderBounds::default()); } - // default bounds are unbounded. - let targets = >::get_npos_targets(DataProviderBounds::default()); assert_eq!(targets.len() as u32, v); Ok(()) From 7889e77039a7828836de753a1922909adb9c3b2e Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Wed, 13 Nov 2024 07:40:10 +0000 Subject: [PATCH 2/4] Update from gui1117 running command 'prdoc --audience runtime_dev --bump patch' --- prdoc/pr_6463.prdoc | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 prdoc/pr_6463.prdoc diff --git a/prdoc/pr_6463.prdoc b/prdoc/pr_6463.prdoc new file mode 100644 index 000000000000..9c4787540a49 --- /dev/null +++ b/prdoc/pr_6463.prdoc @@ -0,0 +1,8 @@ +title: Fix staking benchmark +doc: +- audience: Runtime Dev + description: 'Fix staking benchmark, error was introduced when migrating to v2: + https://github.com/paritytech/polkadot-sdk/pull/6025' +crates: +- name: pallet-staking + bump: patch From 31b0ab5e23cac344fb8906ab87dc7c80d1efdb85 Mon Sep 17 00:00:00 2001 From: gui Date: Wed, 13 Nov 2024 18:40:19 +0900 Subject: [PATCH 3/4] trigger CI --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 6c0dfbb2e7e4..fad71aa135a8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@
![SDK Logo](./docs/images/Polkadot_Logo_Horizontal_Pink_White.png#gh-dark-mode-only) + ![SDK Logo](./docs/images/Polkadot_Logo_Horizontal_Pink_Black.png#gh-light-mode-only) # Polkadot SDK From 913a60602fc51cf63b0eae9fcbd845d6dc5b137f Mon Sep 17 00:00:00 2001 From: gui Date: Wed, 13 Nov 2024 18:40:22 +0900 Subject: [PATCH 4/4] Revert "trigger CI" This reverts commit 31b0ab5e23cac344fb8906ab87dc7c80d1efdb85. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index fad71aa135a8..6c0dfbb2e7e4 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@
![SDK Logo](./docs/images/Polkadot_Logo_Horizontal_Pink_White.png#gh-dark-mode-only) - ![SDK Logo](./docs/images/Polkadot_Logo_Horizontal_Pink_Black.png#gh-light-mode-only) # Polkadot SDK