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

Add a denom ++ address index in x/bank #9590

Closed
4 tasks
amaury1093 opened this issue Jun 28, 2021 · 1 comment · Fixed by #9611
Closed
4 tasks

Add a denom ++ address index in x/bank #9590

amaury1093 opened this issue Jun 28, 2021 · 1 comment · Fixed by #9611
Assignees
Labels

Comments

@amaury1093
Copy link
Contributor

amaury1093 commented Jun 28, 2021

Summary

We currently store balance's as address ++ denom. We should create another one which is denom ++ address

Problem Definition

#9393 adds a feature to query denom owners. The current implementation #9533 loops through all addresses, unmarshals each balance, and filters out balances whose denom doesn't match. This is an expensive operation.

This index is also desirable if bank is used for storing NFTs.

Proposal

  • Create a new index in x/bank denom ++ address
  • The value of that index can be empty (no need to duplicate the balance)
  • Modify DenomOwners logic to use this index

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@amaury1093
Copy link
Contributor Author

@alexanderbez I assigned you to this issue!

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

Successfully merging a pull request may close this issue.

4 participants