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

Compute MinPowerToOptIn in EndBlock and cache, instead of computing on-the-fly #1842

Open
p-offtermatt opened this issue May 1, 2024 · 0 comments · May be fixed by #1840
Open

Compute MinPowerToOptIn in EndBlock and cache, instead of computing on-the-fly #1842

p-offtermatt opened this issue May 1, 2024 · 0 comments · May be fixed by #1840
Assignees
Labels
S: ImprovingThings Improving things: Customer requests, performance improvements, reliability and usability scope: provider Issues related to the provider chain source: codereview To indicate an issue found during a code review.

Comments

@p-offtermatt
Copy link
Contributor

p-offtermatt commented May 1, 2024

The call to ComputeMinPowerToOptIn is expensive. It requires getting the list of all bonded validators and iterate twice over it. It might be better to cache the value in EndBlock when sending VSCPackets. Note that it also needs to be initialized during the migration as it might be needed in BeginBlock for proposals.

Originally posted by @mpoke in #1809 (comment)

@p-offtermatt p-offtermatt added S: ImprovingThings Improving things: Customer requests, performance improvements, reliability and usability source: codereview To indicate an issue found during a code review. and removed needs-triage labels May 1, 2024
@p-offtermatt p-offtermatt self-assigned this May 1, 2024
@mpoke mpoke added the scope: provider Issues related to the provider chain label May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S: ImprovingThings Improving things: Customer requests, performance improvements, reliability and usability scope: provider Issues related to the provider chain source: codereview To indicate an issue found during a code review.
Projects
Status: 📥 F2: Todo
2 participants