Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewStateBloomFromDisk ¶
NewStateBloomFromDisk loads the state bloom from the given file. In this case the assumption is held the bloom filter is complete.
func RecoverPruning ¶
RecoverPruning will resume the pruning procedure during the system restart. This function is used in this case: user tries to prune state data, but the system was interrupted midway because of crash or manual-kill. In this case if the bloom filter for filtering active state is already constructed, the pruning can be resumed. What's more if the bloom filter is constructed, the pruning **has to be resumed**. Otherwise a lot of dangling nodes may be left in the disk.
Types ¶
type Config ¶
type Config struct { Datadir string // The directory of the state database BloomSize uint64 // The Megabytes of memory allocated to bloom-filter Threads int // The maximum number of threads spawned in dumpRawTrieDescendants and removeOtherRoots CleanCacheSize int // The Megabytes of clean cache size used in dumpRawTrieDescendants }
Config includes all the configurations for pruning.
type Pruner ¶
type Pruner struct {
// contains filtered or unexported fields
}
Pruner is an offline tool to prune the stale state with the help of the snapshot. The workflow of pruner is very simple:
- iterate the snapshot, reconstruct the relevant state
- iterate the database, delete all other state entries which don't belong to the target state and the genesis state
It can take several hours(around 2 hours for mainnet) to finish the whole pruning work. It's recommended to run this offline tool periodically in order to release the disk usage and improve the disk read performance to some extent.