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

Bank module supports the function of dynamically adding blacklist #5371

Closed
4 tasks
dreamer-zq opened this issue Dec 6, 2019 · 5 comments
Closed
4 tasks

Comments

@dreamer-zq
Copy link
Collaborator

Summary

Members of the blacklist should support dynamic addition and deletion, but should not be fixed when the network is started, so for users who use cosmos-sdk to develop other applications, the scalability is not very good.

Problem Definition

The custody account of each module of the system may be dynamically generated. If you need to add to the blacklist list, if you want the bank module to introduce the function of dynamically adding a blacklist

Proposal

The bank module provides interfaces that can be dynamically added and removed. The blacklist requires persistent storage.

For Admin Use

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

Right now the blacklist is solely intended for module accounts which are known at compile-time and are static. We never intended to support dynamic capabilities because you cannot dynamically generate module accounts post-chain-start.

That being said, can you please list some specific uses cases where we'd want to blacklist accounts dynamically?

@dreamer-zq
Copy link
Collaborator Author

Scenario 1: We have implemented a uniswap protocol, using an account model as a liquidity pool (which is relatively simple), and each two types of tokens that need to be exchanged require a dynamically produced independent liquidity pool. If it is impossible to control other users to directly transfer funds to the liquidity pool, it will affect the ratio of these two tokens, causing errors in the conversion ratio.

Scenario 2: Use the port in the IBC module to generate the relevant escrow account for recording the locked tokens. My understanding is to facilitate the tracking of the total amount of tokens transferred through the port. The transfer will also cause the port to transfer the total amount of tokens, although there is no major harm.

The above case about the dynamic blacklist function may not be very appropriate, but I think that applications developed based on cosmos-sdk in the future may have more use cases

@alexanderbez
Copy link
Contributor

alexanderbez commented Dec 11, 2019

@zhiqiang-bianjie understood. I can see how this will be beneficial. I propose we update NewBaseKeeper by removing the blacklistedAddrs param and instead have a BaseKeeper#SetBlacklistAddress.

Then, BaseKeeper#SetBlacklistAddress will be called under two cases:

  1. At network initialization (e.g. module accounts)
  2. In the state-machine/modules where this needs to happen dynamically (e.g. liquidity token-pair pools)

@alexanderbez alexanderbez added this to the SDK Roadmap milestone Dec 11, 2019
@jgimeno jgimeno assigned jgimeno and unassigned jgimeno Mar 5, 2020
@clevinson clevinson modified the milestones: SDK Roadmap, v0.39 Apr 30, 2020
@alexanderbez
Copy link
Contributor

We may have to kick this out to 0.40.

@alexanderbez alexanderbez modified the milestones: v0.39, v0.40 Jun 19, 2020
@github-actions
Copy link
Contributor

github-actions bot commented Jul 5, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

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

No branches or pull requests

5 participants