Pruning rules
- Do not try to prune an archive node. Archive nodes need to maintain ALL historic data by definition.
- Ensure there is at least 40 GB of storage space still available on the disk that will be pruned. Failures have been reported with ~25GB of free space.
- Parallax client is fully sync’d
- Parallax client has finished creating a snapshot that is at least 128 blocks old. This is true when “state snapshot generation” is no longer reported in the logs.
How pruning works
Pruning uses snapshots of the state database as an indicator to determine which nodes in the state trie can be kept and which ones are stale and can be discarded. The Parallax client identifies the target state trie based on a stored snapshot layer which has at least 128 block confirmations on top (for surviving reorgs) data that isn’t part of the target state trie or genesis state. The Parallax client prunes the database in three stages:- Iterating state snapshot: the Parallax client iterates the bottom-most snapshot layer and constructs a bloom filter set for identifying the target trie nodes.
- Pruning state data: the Parallax client deletes stale trie nodes from the database which are not in the bloom filter set.
- Compacting database: the Parallax client tidies up the new database to reclaim free space.
State pruning successful
appears (i.e. do not restart the Parallax client yet!). That message indicates that the pruning is complete and the client can be started.
Pruning command
For a normal Parallax node, the client should be stopped and the following command executed to start a offline state prune:Troubleshooting
Messages about “state snapshot generation” indicate that a snapshot is not fully generated. This suggests either the--datadir
is not correct or the Parallax client ran out of time to complete the snapshot generation and the pruning began before the snapshot was completed. In either case, the best course of action is to stop the client, run it normally again (no pruning) until the snapshot is definitely complete and at least 128 blocks exist on top of it, then try pruning again.