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

BlockChain<T>.GetStates() returns significantly slow if the height is too high #189

Closed
dahlia opened this issue Apr 10, 2019 · 1 comment

Comments

Projects
None yet
1 participant
@dahlia
Copy link
Member

commented Apr 10, 2019

BlockChain<T>.GetStates(A) where A is nonexistent (i.e., never used) returns significantly slow if the height is enough high. Currently IStore.GetBlockStates() returns only a set of updated states, not a complete set of existent accounts. This means that BlockChain<T>.GetStates(A) needs to descend to the bottom (i.e., the genesis block) in order to determine if A is nonexistent.

@dahlia dahlia added the bug label Apr 10, 2019

@dahlia dahlia changed the title BlockChain<T>.GetStates(A) where A is nonexistent returns significantly slow if the height is enough high BlockChain<T>.GetStates(A) where A is nonexistent returns significantly slow if the height is too high Apr 10, 2019

@dahlia dahlia changed the title BlockChain<T>.GetStates(A) where A is nonexistent returns significantly slow if the height is too high BlockChain<T>.GetStates() returns significantly slow if the height is too high Apr 12, 2019

@dahlia

This comment has been minimized.

Copy link
Member Author

commented Apr 12, 2019

It seems to happen even if a request address is existent. The current implementation compares two sets (more exactly, intended to be a set but represented as IEnumerable<Address>) by arbitrarily ordered sequences:

if (states.Keys.SequenceEqual(addresses))

@dahlia dahlia self-assigned this Apr 12, 2019

dahlia added a commit to dahlia/libplanet that referenced this issue Apr 12, 2019

dahlia added a commit to dahlia/libplanet that referenced this issue Apr 12, 2019

dahlia added a commit to dahlia/libplanet that referenced this issue Apr 12, 2019

dahlia added a commit to dahlia/libplanet that referenced this issue Apr 12, 2019

dahlia added a commit to dahlia/libplanet that referenced this issue Apr 12, 2019

@dahlia dahlia closed this in 9cec822 Apr 15, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.