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

Nakamoto: 2.5/3.0 Node should migrate from 2.4.x chainstate #4454

Closed
kantai opened this issue Feb 29, 2024 · 7 comments
Closed

Nakamoto: 2.5/3.0 Node should migrate from 2.4.x chainstate #4454

kantai opened this issue Feb 29, 2024 · 7 comments

Comments

@kantai
Copy link
Member

kantai commented Feb 29, 2024

The Nakamoto stacks-node should be able to migrate from 2.4.x chainstates.

@jcnelson
Copy link
Member

Just wanted to say, this is a lot more reasonable (and a lot less scary) than what I thought was being suggesting earlier. It had sounded like we were going to do away with genesis sync altogether, which would have been much more difficult if not impossible to work with to recover from SIP-011-type catastrophes like the 2.1 --> 2.4 transition (which I don't think could be safely achieved without a genesis sync).

That said, we made the decision early on in next to treat the 2.5 schema as a breaking change, so it's an open question how much work will be required to implement and test a migration path that we can be proud of.

@kantai
Copy link
Member Author

kantai commented Feb 29, 2024

Just wanted to say, this is a lot more reasonable (and a lot less scary) than what I thought was being suggesting earlier. It had sounded like we were going to do away with genesis sync altogether, which would have been much more difficult if not impossible to work with to recover from SIP-011-type catastrophes like the 2.1 --> 2.4 transition (which I don't think could be safely achieved without a genesis sync).

Oh yeah -- that's not what I am suggesting. The ability to do genesis syncs is very important, I agree. I think it's just much easier on the network to not require them on updates.

That said, we made the decision early on in next to treat the 2.5 schema as a breaking change, so it's an open question how much work will be required to implement and test a migration path that we can be proud of.

Yes -- I agree, this requires some investigation. I think it's possible that its still not that much yet -- NakamotoBlocks are using entirely new tables after all. There are some new columns, etc. elsewhere, but I think that we should be able to enumerate them.

@jcnelson
Copy link
Member

I think it's just much easier on the network to not require them on updates.

Yes, 100% agreed. I'd be in favor of making chainstate backwards-compatibility a requirement going forward for all releases, including hard forks. We'll want to spend some time thinking about how best to test this, but I have a few ideas (e.g. we could save a bunch of chainstate snapshots from legacy nodes for just this purpose in order to verify that all previous snapshots migrate to the latest schemas, for example).

@cylewitruk cylewitruk self-assigned this Mar 6, 2024
@zone117x
Copy link
Member

zone117x commented Mar 6, 2024

Thanks @cylewitruk, this will save an enormous amount of time across the ecosystem

@cylewitruk
Copy link
Member

cylewitruk commented Mar 6, 2024

I'm going to wrap up what I'm currently working on with proptest and then I'll jump on this in a couple of days ^^

@jcnelson @kantai If there are any hints/tips/gotcha's you'd like to drop here before I get started, it might save some time later. Thinking mostly about new columns which may need to be derived in some way -- if you know how they should be derived, etc. Or if new columns can have some default value. I think you get what I'm after.. :)

@ASuciuX
Copy link
Contributor

ASuciuX commented Mar 17, 2024

I tried to run replay-block with the latest next (commit), as I did before on the 99,990-100k blocks, and it crashes. I think something was added for newer blocks to create the signers signature, but the code runs with previous blocks the same way and it throws as that field doesn’t exist.

computer@debian:~/Desktop/profiling/asuciux-core/target/release$ hyperfine -w 3 -r 10 "./stacks-inspect-d3f1a3164-17-mar replay-block ~/chainstate range 99990 100000" --show-output

Benchmark 1: ./stacks-inspect-d3f1a3164-17-mar replay-block ~/chainstate range 99990 100000
Will check 10 blocks
Checked 0...
thread 'main' panicked at stackslib/src/main.rs:1578:6:
called `Result::unwrap()` on an `Err` value: SqliteError(SqliteFailure(Error { code: Unknown, extended_code: 1 }, Some("no such table: main.vote_for_aggregate_key")))
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Error: Command terminated with non-zero exit code: 101. Use the '-i'/'--ignore-failure' option if you want to ignore this. Alternatively, use the '--show-output' option to debug what went wrong. 

@saralab saralab moved this from Status: 🆕 New to Status: 📋 Backlog in Stacks Core Eng Mar 18, 2024
@saralab saralab moved this from Status: 📋 Backlog to Status: 💻 In Progress in Stacks Core Eng Mar 18, 2024
@saralab saralab added the 2.5 label Mar 19, 2024
@saralab saralab assigned jcnelson and unassigned cylewitruk Mar 22, 2024
@saralab saralab moved this from Status: 💻 In Progress to Status: In Review in Stacks Core Eng Apr 2, 2024
@saralab saralab moved this from Status: In Review to Status: ✅ Done in Stacks Core Eng Apr 9, 2024
@saralab saralab closed this as completed Apr 16, 2024
@blockstack-devops
Copy link
Contributor

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@stacks-network stacks-network locked as resolved and limited conversation to collaborators Oct 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Status: Status: ✅ Done
Development

No branches or pull requests

7 participants