Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Revert consensus related data on CLI "revert" command #10962

Closed
3 tasks done
davxy opened this issue Mar 2, 2022 · 3 comments
Closed
3 tasks done

Revert consensus related data on CLI "revert" command #10962

davxy opened this issue Mar 2, 2022 · 3 comments
Assignees
Labels
I3-bug The node fails to follow expected behavior. U2-some_time_soon Issue is worth doing soon.

Comments

@davxy
Copy link
Member

davxy commented Mar 2, 2022

The CLI has a command to revert the node state at most down to the last finalized block.

Example to revert 3 blocks:

$ node-template revert --dev --base-path mydata --pruning archive -- 3

Currently, the "revert" procedure is limited to the state and leaves by just forwarding the call to the backend revert routine.

The backend revert procedure has the following constraints:

  • rollback is started from the local chain "best" block
  • the state for the given block should exist. In other words, the state has not been wiped because of the pruning policy previously adopted to run the node).

The current limited scope may leave some of the node's auxiliary structures in an inconsistent state, e.g. because some aux data is referencing something that has been removed.

The focus of this issue is to properly revert the node state by also reverting all the auxiliary structures that somehow may be influenced by the state revert procedure.

Examples of such structures are:

@davxy davxy self-assigned this Mar 2, 2022
@davxy
Copy link
Member Author

davxy commented Mar 2, 2022

@andresilva @bkchr

@andresilva andresilva added I3-bug The node fails to follow expected behavior. U2-some_time_soon Issue is worth doing soon. Z2-medium Can be fixed by a coder with good Rust knowledge but little knowledge of the codebase. labels Mar 2, 2022
@rphmeier
Copy link
Contributor

rphmeier commented Mar 6, 2022

States related to parachains management (to investigate).

Doable, but this is going to get very, very involved.

@the-right-joyce the-right-joyce removed the Z2-medium Can be fixed by a coder with good Rust knowledge but little knowledge of the codebase. label Apr 26, 2022
@davxy
Copy link
Member Author

davxy commented Apr 27, 2022

Follow up for Polkadot specific tasks paritytech/polkadot#5396

@davxy davxy closed this as completed Apr 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
I3-bug The node fails to follow expected behavior. U2-some_time_soon Issue is worth doing soon.
Projects
Status: done
Development

No branches or pull requests

4 participants