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
Assignees
Labels
bug Something isn't working

Comments

@dahlia
Copy link
Contributor

dahlia 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 Something isn't working 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
Copy link
Contributor Author

dahlia 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 as completed in 9cec822 Apr 15, 2019
limebell added a commit to limebell/libplanet that referenced this issue Jul 7, 2021
OnedgeLee pushed a commit to OnedgeLee/libplanet that referenced this issue Jan 31, 2023
…netarium#189)

* INTERNAL: update configmap-versions.yaml

* INTERNAL: update kustomization.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant