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

Deprecate raw RuntimeDbWeight::reads_writes calls #378

Open
ggwpez opened this issue Mar 23, 2023 · 3 comments
Open

Deprecate raw RuntimeDbWeight::reads_writes calls #378

ggwpez opened this issue Mar 23, 2023 · 3 comments
Labels
D0-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder. I4-refactor Code needs refactoring.

Comments

@ggwpez
Copy link
Member

ggwpez commented Mar 23, 2023

We often use these functions in migrations to avoid writing benchmarks. This worked mostly fine with 1D weights but does not work for chromatic weights.

The public reads_writes, reads, writes functions should be deprecated and the weight templates need to find another way of accessing these constants.

@juangirini juangirini transferred this issue from paritytech/substrate Aug 24, 2023
@the-right-joyce the-right-joyce added I4-refactor Code needs refactoring. D0-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder. and removed I7-refactor labels Aug 25, 2023
@ybensacq
Copy link

@ggwpez the purpose of this task is just to deprecate the 3 functions ?

@ggwpez
Copy link
Member Author

ggwpez commented Nov 21, 2023

Not quite... we also need to come up with an alternative for weight templates since they have a legitimate use-case to access these constants. I dont have a good idea, but maybe you can start by just removing this thing?

pub struct OldWeight(pub u64);

If the contracts pallet depends on that then we copy it into it, but otherwise i hope we dont use it anywhere.

@kianenigma
Copy link
Contributor

kianenigma commented Oct 2, 2024

#3640 will partially address this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
D0-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder. I4-refactor Code needs refactoring.
Projects
Development

No branches or pull requests

4 participants