Skip to content

Zebra v5.0.0-rc.0 rollback utility build

Pre-release
Pre-release

Choose a tag to compare

@evan-forbes evan-forbes released this 03 Jun 15:59
4d2536f

Rollback utility build based on Zebra v5.0.0 with finalized-state rollback support.

Assets

The Linux x86_64 archive contains both binaries:

  • zebra - the standard Zebra node binary
  • zebra-rollback-state - standalone finalized-state rollback utility

Rollback performance

For modern v5 rollback targets, zebra-rollback-state no longer replays note
commitment trees from genesis when the removed block range did not change the
Sprout tree. It loads the target Sapling and Orchard roots from the existing
height-indexed state and rebuilds only the history tree from the active network
upgrade activation height.

If any rolled-back block contains Sprout commitments, rollback deliberately uses
the full tree rebuild path so the Sprout tip tree is reset to the target height
instead of being left at the pre-rollback tip.

Using zebra-rollback-state

Stop Zebra before rolling back the state database.

Download and unpack the archive:

curl -L -O https://github.com/valargroup/zebra/releases/download/v5.0.0-rc.0/zebra-v5.0.0-rc.0-x86_64-unknown-linux-gnu.tar.gz
curl -L -O https://github.com/valargroup/zebra/releases/download/v5.0.0-rc.0/zebra-v5.0.0-rc.0-x86_64-unknown-linux-gnu.tar.gz.sha256
sha256sum -c zebra-v5.0.0-rc.0-x86_64-unknown-linux-gnu.tar.gz.sha256
tar -xzf zebra-v5.0.0-rc.0-x86_64-unknown-linux-gnu.tar.gz

Preview the rollback plan without changing state:

./zebra-rollback-state \
  --network mainnet \
  --cache-dir "$HOME/.cache/zebra" \
  --height <HEIGHT> \
  --dry-run

Apply the rollback by omitting --dry-run:

./zebra-rollback-state \
  --network mainnet \
  --cache-dir "$HOME/.cache/zebra" \
  --height <HEIGHT>

Use --network testnet for Testnet. Pass the root Zebra cache directory,
usually $HOME/.cache/zebra on Linux, not the nested state/vN/mainnet or
state/vN/testnet directory.

To preserve rolled-back finalized blocks in the non-finalized backup cache, add:

--keep-rolled-back-blocks

Full help:

./zebra-rollback-state --help