-
Notifications
You must be signed in to change notification settings - Fork 766
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
Unable to properly benchmark pallet_bounties
when ED is 0
#7009
Comments
pallet_bounties
in runtimes with existential deposit being 0pallet_bounties
when ED is 0
Generally, I write this code for such issues. (a lot of pallets had such issues in the past) #[cfg(feature = "runtime-benchmarks")]
const ED = 1;
#[cfg(not(feature = "runtime-benchmarks"))]
const ED = 0; But it's okay to report such issues and see if we can improve the benchmarks. |
Thanks for the reply! We were actually thinking in a such a workaround but did wanna to report it anyway as it should imply a simple fix (which is already on its way 😁) |
Hi @bkchr. Just wanted to mention that for the same reason some benchmarks fail in
In case you wanna include the fix in your PR or link another PR to this issue. |
I remember there is already a zero ed feature in pallet balances. You need to enable it. |
Yeah for |
Thanks to both of you @AurevoirXavier @bkchr |
Closes: #7009 --------- Co-authored-by: command-bot <>
Closes: paritytech#7009 --------- Co-authored-by: command-bot <>
Is there an existing issue?
Experiencing problems? Have you tried our Stack Exchange first?
Description of bug
We cannot properly benchmark
pallet_bounties
in the LAOS runtime, as all the following benchmarks fail:Upon investigation, we believe this issue may affect all runtimes where the existential deposit is set to 0, as is our case. This issue in LAOS outlines the root cause of this behavior, but I’ve included the relevant details below for easier tracking.
Concretely, this function is used in benchmarks to fund the treasury account.
If
ED
is 0, so isT::Currency::minimum_balance()
, resulting in the treasury's balance being initialized to 0 before benchmarks that require treasury funding.As a result, there is no budget available for bounties in the benchmark suite. Consequently, these lines remain unreachable, preventing bounties from getting the Funded status. While not all the failing benchmarks depend directly on the Funded status, they do rely on a flow where the bounty has successfully progressed through that stage, hence the failure.
Steps to reproduce
Set a runtime using
pallet_treasury
+pallet_bounties
asSpendFunds
where the existential deposit is 0 and try to benchmarkpallet_bounties
. LAOS is affected by this issue, so it may be used as reference as wellThe text was updated successfully, but these errors were encountered: