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

AppendValidator recreates full validator set index map on every usage #5779

Closed
0xKiwi opened this issue May 8, 2020 · 1 comment
Closed
Assignees
Labels
Enhancement New feature or request Priority: Low Low priority item

Comments

@0xKiwi
Copy link
Contributor

0xKiwi commented May 8, 2020

To add more validators to the state, we use AppendValidator which recreates the valIndexMap for the entire validator set each time it is used.

This is incredibly expensive during genesis state creation, and gets more expensive as more validators are added.

@nisdas
Copy link
Member

nisdas commented May 8, 2020

#5780 will help with this, by reducing the amount of time on map copies. However due to us having no way of tracking the map, our ability to reduce the amount map copies here is limited.

If we do need to improve it further we can track references to the map between all the states which share it like our other fields in the state. However that would be more involved to do and would clash with how we track fields in the state as this would be a non-state value. That would be the optimal solution here to reduce the amount of map copies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request Priority: Low Low priority item
Projects
None yet
Development

No branches or pull requests

3 participants