-
Notifications
You must be signed in to change notification settings - Fork 349
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
Fix weight generation for pallet-asset-manager #3078
Conversation
WASM runtime size check:Compared to target branchMoonbase runtime: 2260 KB (no changes) ✅ Moonbeam runtime: 2248 KB (no changes) ✅ Moonriver runtime: 2240 KB (no changes) ✅ Compared to latest release (runtime-3300)Moonbase runtime: 2260 KB (+232 KB compared to latest release) Moonbeam runtime: 2248 KB (+252 KB compared to latest release) Moonriver runtime: 2240 KB (+248 KB compared to latest release) |
Coverage Report@@ Coverage Diff @@
## master ahmad-fix-weights-asset-manager +/- ##
==================================================================
Coverage 74.58% 74.58% 0.00%
Files 375 375
Lines 95682 95682
==================================================================
Hits 71356 71356
Misses 24326 24326
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ahmadkaouk can you explain the issue? The CI benchmarks check was passing.
@RomarQ I’ve added a description of the issue in the PR. The problem is that the compilation fails after the weights are generated. To address this, we should consider adding an extra step in the CI benchmark check to compile the runtime with the generated weights. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure whether this is the right approach to remove the loop, but it looks in sync with the definition and fix the benchmark.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be fine since we are no longer using num_assets_weight_hint
;
What does it do?
This PR fix an issue with weight generation for the pallet-asset-manager caused by changes introduced in #2908.
The functions
change_existing_asset_type
andremove_existing_asset_type
in theWeightInfo
trait are not supposed to accept arguments, as indicated by their signatures:But since we're using this syntax
le x in 5..100
in the benchmark scenarios, this generates the following code:Which does not match the signature in the trait.