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

[Feature]: Bulk add genesis accounts #21340

Closed
Reecepbcups opened this issue Aug 18, 2024 · 2 comments · Fixed by #21372
Closed

[Feature]: Bulk add genesis accounts #21340

Reecepbcups opened this issue Aug 18, 2024 · 2 comments · Fixed by #21372
Assignees

Comments

@Reecepbcups
Copy link
Member

Reecepbcups commented Aug 18, 2024

Summary

Protocols need an easy way to add / airdrop bulk account allocations into the genesis file. appd genesis add-genesis-account ... is far to slow (~100 accounts per 8-10 seconds). By bringing in a bulk command to read a JSON file, it drastically reduces the time to build a genesis. (In my case from 15 - 20 hours estimate for 250k accounts, down to ~4 seconds).

Problem Definition

  • Creating large genesis files is impracticable and difficult if you have more than 5k accounts
  • As the interchain grows, making better UX to distribute network tokens is important to allow developers without having to write complex scripts.
  • The SDK improves UX for new chains coming up who want to distribute tokens to a subset of large network participants (i.e. CosmosHub, Osmosis)
  • There are no disadvantages other than re-working the AddGenesisAccounts method in genutilstypes

Proposed Feature

A bulk-add-genesis-accounts command should be added that allows reading from a file format. An account balance cache should be added on read to reduce the excessive calls to saving genesis state when it can be done in memory.

An example I've built and used (with limited scope to fit our specific needs) is found here: https://github.com/CryptoDungeon/dungeonchain/blob/main/cmd/dungeond/fast_add_genesis_airdrop.go

The GenesisAccount struct should not be the format, but this gives the idea for what a format would look like. An address, sdk.Coins array, and other info such as vesting would be put here. Then a developer can just take a JSON (or csv?) file and load it in quickly.

@Reecepbcups
Copy link
Member Author

Reecepbcups commented Aug 18, 2024

If this is something desired please assign me & I will take it on :)
If not, I understand as well.

@tac0turtle
Copy link
Member

tac0turtle commented Aug 19, 2024

This sounds good. It makes sense to add it. Just a heads up we deprecated existing vesting accounts so they can not be created any longer. New vesting accounts need to be done through a vesting account via x/accounts. Would love to review a pr if you have time thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🥳 Done
Development

Successfully merging a pull request may close this issue.

2 participants