Skip to content
Snippets Groups Projects
Unverified Commit 475432f4 authored by José Molina Colmenero's avatar José Molina Colmenero Committed by GitHub
Browse files

pallet-collator-selection: correctly register weight in `new_session` (#5430)

The `pallet-collator-selection` is not correctly using the weight for
the
[new_session](https://github.com/blockdeep/pallet-collator-staking/blob/main/src/benchmarking.rs#L350-L353)
function.

The first parameter is the removed candidates, and the second one the
original number of candidates before the removal, but both values are
swapped.
parent 13d43bb7
No related merge requests found
Pipeline #492589 waiting for manual action with stages
in 1 hour, 17 minutes, and 59 seconds
......@@ -972,7 +972,7 @@ pub mod pallet {
let result = Self::assemble_collators();
frame_system::Pallet::<T>::register_extra_weight_unchecked(
T::WeightInfo::new_session(candidates_len_before, removed),
T::WeightInfo::new_session(removed, candidates_len_before),
DispatchClass::Mandatory,
);
Some(result)
......
# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0
# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json
title: "pallet-collator-selection: correctly register weight in `new_session`"
doc:
- audience: Runtime Dev
description: |
- Fixes an incorrect usage of the `WeightInfo` trait for `new_session`.
crates:
- name: pallet-collator-selection
bump: patch
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment