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 starting account number to genesis file #1217

Closed
sunnya97 opened this issue Jun 12, 2018 · 10 comments
Closed

Add starting account number to genesis file #1217

sunnya97 opened this issue Jun 12, 2018 · 10 comments
Assignees
Labels
C:genesis relating to chain genesis S:proposal accepted
Milestone

Comments

@sunnya97
Copy link
Member

So you can start at something other than 0. Also doesn't have to do a nil check every time. Requested in #1077

@sunnya97 sunnya97 self-assigned this Jun 12, 2018
@ebuchman
Copy link
Member

We should set this in InitChain

@ebuchman ebuchman added the core label Jun 19, 2018
@ebuchman
Copy link
Member

The relevant comment from #1077 I believe is:

Can we add an InitGenesis function to x/auth which takes an initial account number? I think we decided we wanted to start with a nonzero number so low-numbered accounts aren't specially valuable, this also makes the GetNextAccountNumber logic cleaner.

Do we really need to do this?

@ValarDragon
Copy link
Contributor

ValarDragon commented Sep 12, 2018

This would make sense if we were var-int encoding account numbers. We're not (AFAIK), so in the current system there isn't a need to do it.

I am actually in favor of var-int encoding these though, as the trade-off point where var-int encoding costs more than normal encoding is 2^56. We shouldn't expect more than 2^56 accounts, so I think var int encoding makes sense. (For reference, 2^56 is 72,057,594,037,927,936, or 72 quadrillion) Using var int encoding is basically just using an int. (Based on my amino knowledge) I can spin this out into a more well written issue / proposal though.

@jackzampolin
Copy link
Member

Going to close this cause we have moved from accounts to transactions for the genesis file per @alessio Please reopen if you feel I am wrong and direct all 🔥-> @jackzampolin

@ValarDragon
Copy link
Contributor

We require this in order to have replay protection under forking with the same chain id.

@sunnya97
Copy link
Member Author

Non-malicious hard forks should not have the same chain-id.

@ValarDragon
Copy link
Contributor

Ah your right. Though if we go with a proposal like #1653 this matters more, as it may be your main identifier. I also think that its preferrable to reduce the amount of changes one needs to make their local signing devices.

@rigelrozanski
Copy link
Contributor

If we do this we need to have a genesis check to ensure that no two account numbers are the same - this previously caused a headache of a bug

@rigelrozanski rigelrozanski added the C:genesis relating to chain genesis label Nov 30, 2018
@cwgoes
Copy link
Contributor

cwgoes commented Jan 16, 2019

Can we do this @sunnya97? Seems pretty trivial.

@jackzampolin
Copy link
Member

Closing as stale and not important.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:genesis relating to chain genesis S:proposal accepted
Projects
None yet
Development

No branches or pull requests

7 participants