| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Ouroboros.Consensus.Storage.LedgerDB.DiskPolicy
Synopsis
- data DiskPolicy = DiskPolicy {}
- defaultDiskPolicy :: SecurityParam -> DiskPolicy
Documentation
data DiskPolicy Source #
On-disk policy
We only write ledger states that are older than k blocks to disk (that is,
snapshots that are guaranteed valid). The on-disk policy determines how often
we write to disk and how many checkpoints we keep.
Constructors
| DiskPolicy | |
Fields
| |
Instances
defaultDiskPolicy :: SecurityParam -> DiskPolicy Source #
Default on-disk policy
We want to take a snapshot every 50k blocks or roughly every hour (72
minutes actually) when k = 2160 (for other values of k we scale
proportionally), but not more rapidly than 10 per hour (which is important
for bulk sync).
If users never leave their wallet running for long, however, this would mean
that we never take snapshots after syncing (until we get to 50k blocks).
So, on startup, we take a snapshot as soon as there are k blocks replayed.
This means that even if users frequently shut down their wallet, we still
take a snapshot roughly every k blocks. It does mean the possibility of
an extra unnecessary snapshot during syncing (if the node is restarted), but
that is not a big deal.