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

State migration flow #4097

Open
grarco opened this issue Nov 26, 2024 · 0 comments
Open

State migration flow #4097

grarco opened this issue Nov 26, 2024 · 0 comments
Labels
bug Something isn't working ledger

Comments

@grarco
Copy link
Contributor

grarco commented Nov 26, 2024

There's a small issue with the live migration that can be done with the command:

namadan ledger run --height $BLOCK_HEIGHT --path $PATH_TO_MIGRATION_JSON_FILE --hash $JSON_FILE_HASH

The command applies the migration at the end of the specified block and this could be a problem if the migration also requires a protocol update. In this case, the transactions included in the block would be processed by the updated protocol but on the old state, which could make them fail or even crash the node in some cases.

As suggested by @tzemanovic, there's another way to see that issue: the run-until command cannot apply a migration: if this were the case then we could use this command and apply the following logic:

  1. Run until the height before the specified one
  2. Execute the block at $HEIGHT-1 and, at the end of it, apply the migration file
  3. Skip to the next block height and halt (before executing the block)
  4. Relaunch the node with the update binaries
@grarco grarco added bug Something isn't working ledger labels Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ledger
Projects
None yet
Development

No branches or pull requests

1 participant