Skip to content

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

Closed
@amaury1093

Description

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions