-
Notifications
You must be signed in to change notification settings - Fork 716
[Stacks v1 → v2 Upgrade] Import STX balances & vesting into Stacks 2.0 #2105
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
Conversation
f47315f to
73d8dc9
Compare
|
@kantai do you have any idea about this pox related test failure? Locally, |
|
The bitcoind tests additionally require setting |
d9af1c6 to
31328e1
Compare
kantai
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM! Though I think this may need to be opened against next, rather than master, because this would change the change consensus (the genesis block is different, so this would cause a chain split).
e20deb3 to
ab5d453
Compare
ab5d453 to
3a27c63
Compare
jcnelson
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
jcnelson
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to discuss whether or not all of the STX are minted in the genesis block and dolled out by the lockup contract (i.e. what's written now), versus having STX minted on-the-fly when the unlock height comes. I think it will have a painful impact on PoX if we do the former.
jcnelson
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there -- please change the .unwrap() to .expect() and make sure there's an open an issue describing how eagerly minting all the locked-up STX at boot-time effectively breaks PoX. Once these two tasks are done, then it LGTM.
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Closes #2086
Uses a rust build script to compress the STX balance and vesting contents from
chainstate.txtinto deflate streams. These are embedded in the binary usinginclude_bytes!(...). The binary is ~8MB larger. The compression and embedding is contained in a separate lib to make local dev less painful (rebuilds are not slowed down when making changes to the main src).This file contains the all STX balances and vesting entries from Stacks 1.0.
(Note: it also contains on-chain name metadata, but name related data is not handled in this PR).
Combined, there are nearly 400k entries from a Stacks 1.0 export. An
iterator<T>is used to alleviate boot memory usage issues. This PR includes a samplechainstate.txtfile with only 10s of entries, which loads instantaneously. When the final Stacks 1.0 migration PR is opened, it will commit the full ~20MBchainstate.txtfile.The initial token balances are emitted as STX mint events in the pseudo-genesis-block. Emitting the token vesting entry calls is still WIP -- may need to be done after PR #2109.