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

Bug: when updating weights for pallet - only one file is being updated #98

Closed
mordamax opened this issue Aug 19, 2022 · 0 comments · Fixed by paritytech/pipeline-scripts#77
Assignees
Labels
bug Something isn't working

Comments

@mordamax
Copy link
Contributor

mordamax commented Aug 19, 2022

From the @shawntabrizi words in Matrix:
there are cases where the same pallet is used multiple times inside a blockchain, and when you specify a specific file name output, the two different pallet instances write to the same file, so only one file gets updated

https://github.com/paritytech/polkadot/tree/master/runtime/kusama/src/weights
notice thees files have not been updated for 11 months, while everything else was updated 18 days ago
image

you will notice the command is:

// --heap-pages=4096
// --header=./file_header.txt
// --output=./runtime/kusama/src/weights/

Where output does not list a file name

anyway, the solution i believe is to remove the file name from the output UNLESS there is :: in the pallet name, in which case we should specify a file name, and replace :: with _ as your script does
end of the day, this is something we need to fix in substrate to make the story better, but that will take longer
would like to make sure the scripts are updated in the meantime
https://github.com/paritytech/bench-bot/blob/master/bench.js#L492
Look at the logic here:

  // custom output file name so that pallets with path don't cause issues
  let outputFile = extra.includes("::")
      ? extra.replace("::", "_") + ".rs"
      : ""

Same here: https://github.com/paritytech/polkadot/blob/master/scripts/ci/run_benches_for_runtime.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant