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

fix weight #5

Merged
merged 1 commit into from
Feb 24, 2023
Merged

fix weight #5

merged 1 commit into from
Feb 24, 2023

Conversation

RustNinja
Copy link

Update weight for set price info extrinsic
more about issue:
image

image

Problem
The weight defined for the dispatchable function set_updated_coin_infos represents a computation longer than one second (1^12 units of weight = 1 second of computation).

Solution: specify weight limit for extrinsic that related to 1 read and 1 write and less than one sec.

Copy link
Member

@ebma ebma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked the benchmarking code and saw that the weight is so high because they feed 5000 coin_infos with one call. see here.

So instead of changing these weights manually as you did here, I would prefer if you instead change the benchmark to not feed 5000 but maybe like 30 or 50 values in one call. This should reduce the weight significantly and hopefully enough to resolve the other issue

@RustNinja
Copy link
Author

ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants