Skip to content

Reverting to Previous Blocks

Alexandra Roatis edited this page Apr 24, 2018 · 4 revisions

Version 0.1.12 and later versions of the kernel offer the command line option to revert to a previous block. This functionality is meant for removing from the database all blocks greater than the one given as parameter. The revert feature makes permanent changes to the database. If you are unsure about using it, back-up the database first.

Usage: 
   ./aion.sh -r [block_number]

When to revert to a previous block?

Failed database recovery

In case of data corruption, the kernel makes a few attempts at recovering the corrupted data. When in recovery mode, it will display messages informing the user of the recovery status, as follows:

INFO  CONS [main]: Corrupt world state at block #1100. Rebuilding from block #1000.
INFO  CONS [main]: Rebuilding block #1001.
INFO  CONS [main]: Rebuilding block #1002.
INFO  CONS [main]: Rebuilding block #1003.
...

If these recovery attempts fail, you can stop the kernel and attempt reverting to the block that the rebuild started from, in the example above block 1000. The reason the recovery was started from this block is that the database was able to find a correct world state for that block, i.e. uncorrupted data.

Clone this wiki locally