namada icon indicating copy to clipboard operation
namada copied to clipboard

State migration flow

Open grarco opened this issue 3 months ago • 0 comments

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 avatar Nov 26 '24 14:11 grarco