Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pallet-broker] Fix auto renew benchmarks #6505

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

seadanda
Copy link
Contributor

@seadanda seadanda commented Nov 15, 2024

Fix the broker pallet auto-renew benchmarks which have been broken since #4424, yielding Weightless due to some prices being set too low, as reported in #6474.

Upon further investigation it turned out that the auto-renew contribution to rotate_sale was always failing but the error was mapped. This is also fixed at the cost of a bit of setup overhead.

Fixes #6474

TODO:

  • Re-run weights

@seadanda seadanda added T2-pallets This PR/Issue is related to a particular pallet. T12-benchmarks This PR/Issue is related to benchmarking and weights. labels Nov 15, 2024
@seadanda seadanda self-assigned this Nov 15, 2024
@seadanda
Copy link
Contributor Author

/cmd prdoc --audience runtime_dev --bump minor

let region = Broker::<T>::do_purchase(caller.clone(), 10u32.into())
.map_err(|_| BenchmarkError::Weightless)?;
let region = Broker::<T>::do_purchase(caller.clone(), 10_000_000u32.into())
.expect("Offer not high enough for configuration.");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we advance to the fixed price phase, this is independent of the price adapter implementation and depends only on the config value set earlier in this file. Therefore it's better to unwrap here so the test fails, rather than always being mapped to Weightless.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T2-pallets This PR/Issue is related to a particular pallet. T12-benchmarks This PR/Issue is related to benchmarking and weights.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pallet broker: some benchmarks are weightless for kitchensink runtime. Resulting in substrate weight being 0
2 participants