Skip to content
This repository was archived by the owner on Jan 21, 2025. It is now read-only.
This repository was archived by the owner on Jan 21, 2025. It is now read-only.

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

@mordamax

Description

@mordamax

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions