rusk
rusk copied to clipboard
node: Implement checkpoints for recovery procedures
Summary
In scenarios similar to the one outlined in https://github.com/dusk-network/rusk/issues/1093, it is essential to have the ability to revert to either the "last epoch" or the most recent "valid" finalized state.
Possible solution design or implementation
Currently, we have a function called try_revert
, that supports reversion to a single target - LastFinalized
. However, this function can be expanded to enable reversion to additional historical checkpoints.
Together with that, we have to either automatically detect&resolve any unrecoverable state or allow the reversion via CLI.
See also #970
This should solve the persistence error popping up when improperly shutting down the node:
Error: PersistenceError(Custom { kind: InvalidData, error: "Invalid index file ""/opt/dusk/rusk/state/246607761c6c6a5b9791c08cbb38e1692eacee015b074864358e5c230f66d480/index"": context error: pointer out of bounds: base 0x7ffcbc0cad08 offset -68 not in range 0x5603bfdda080..0x5603bfdda0
Depends on #1516
Superseded by #1684