Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

[pallet_collective] Benchmark fails with MaxProposals greater 255 #12433

Closed
Chralt98 opened this issue Oct 6, 2022 · 0 comments · Fixed by #12454
Closed

[pallet_collective] Benchmark fails with MaxProposals greater 255 #12433

Chralt98 opened this issue Oct 6, 2022 · 0 comments · Fixed by #12454
Labels
I5-tests Tests need fixing, improving or augmenting. Z1-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder Z6-mentor An easy task where a mentor is available. Please indicate in the issue who the mentor could be.

Comments

@Chralt98
Copy link

Chralt98 commented Oct 6, 2022

Hey valuable Substrate maintainers,

the current benchmark of pallet_collective fails on propose_proposed with DuplicateProposal, when the MaxProposals number is set greater than u8::MAX. This happens because the proposal hash inside the benchmark is generated based on the MaxProposals number and produces duplicated (non-unique) hashes after the number of 255 is reached.

let proposal: T::Proposal = SystemCall::<T>::remark { remark: vec![p as u8; b as usize] }.into();

The ProposalIndex is not u8 to allow more than 255 proposals.

@github-actions github-actions bot added the J2-unconfirmed Issue might be valid, but it’s not yet known. label Oct 6, 2022
@ggwpez ggwpez added I5-tests Tests need fixing, improving or augmenting. Z6-mentor An easy task where a mentor is available. Please indicate in the issue who the mentor could be. Z1-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder and removed J2-unconfirmed Issue might be valid, but it’s not yet known. labels Oct 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
I5-tests Tests need fixing, improving or augmenting. Z1-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder Z6-mentor An easy task where a mentor is available. Please indicate in the issue who the mentor could be.
Projects
Development

Successfully merging a pull request may close this issue.

2 participants