Skip to content

Add sanity checks for weird SnapshotPolicyArgs configurations#1903

Open
fraser-iohk wants to merge 12 commits intoamesgen/predictable-snapshotsfrom
fraser-iohk/snapshot-config-sanity-checks
Open

Add sanity checks for weird SnapshotPolicyArgs configurations#1903
fraser-iohk wants to merge 12 commits intoamesgen/predictable-snapshotsfrom
fraser-iohk/snapshot-config-sanity-checks

Conversation

@fraser-iohk
Copy link
Copy Markdown
Contributor

As discussed in #1853, we want node operators to be warned if they configure their node in a way that is likely to be broken i.e. if they disable the snapshot rate limiting, or set the number of on-disk snapshots to 0, or set a snapshot interval that isn't a clean divisor of the epoch length (which is required for Mithril). This PR implements sanity checks similar to the existing ones for the SnapshotPolicyArgs and traces warnings to the user if these guidelines are ignored.

@geo2a geo2a force-pushed the amesgen/predictable-snapshots branch 6 times, most recently from 6258cef to 74d1d62 Compare April 13, 2026 15:09
@geo2a geo2a force-pushed the amesgen/predictable-snapshots branch 2 times, most recently from 096896d to 7be6ea5 Compare April 15, 2026 11:16
amesgen added 4 commits April 15, 2026 13:18
Superseded by the rework of the snapshot policy for predictable snapshots, with
dedicated new tests

LedgerDB: implement predictable snapshotting
It is no longer needed by the predictable snapshotting logic.
@geo2a geo2a force-pushed the amesgen/predictable-snapshots branch from 7be6ea5 to f6f2731 Compare April 15, 2026 11:18
fraser-iohk and others added 5 commits April 15, 2026 15:09
- tryTakeSnapshot: now accepts a `Time` argument. The argument specifies the time at which the snapshot should be taken
- LedgerDBEnv: rename ldbLastSnapshotWrite to ldbLastSnapshotRequestedAt. Track the request time rather than the time a snapshot actually finished.
- implTryTakeSnapshot: add a `delay` argument. How long should we block before actually taking the snapshot after determining the slots to snapshot
- add `cdbSnapshotDelayRNG` and use this to determine how long we should wait before taking a snapshot
- add orphan `NoThunks` `StdGen` instance
- add `cdbsSnapshotDelayRNG to `ChainDbSpecificArgs`
- add `onDiskSnapshotDelayRange` to `SnapshotPolicy` to allow configuration of the delay between a snapshot being requested and being taken
- add LedgerDB snapshot delay trace events. Use these events in the test suite to ensure we don't add blocks while snapshots are occurring (and therefore make an accurate number of snapshots).
- add a test ensuring that blocks can be added while a snapshot is enqueued
- ledgerDbMaintenaceThread -> ledgerDbMaintenanceThread
This commit brings back the fix from #1814, which synchronises the process of taking a ledger state snapshot and copying of blocks into the immutable DB.
@geo2a geo2a force-pushed the amesgen/predictable-snapshots branch 2 times, most recently from ed82f15 to eb8f8ce Compare April 16, 2026 07:42
@geo2a geo2a force-pushed the amesgen/predictable-snapshots branch from eb8f8ce to cbda1fb Compare April 16, 2026 08:11
@geo2a geo2a force-pushed the amesgen/predictable-snapshots branch from c6d09eb to b1e2b2b Compare April 16, 2026 08:47
@geo2a geo2a self-assigned this Apr 17, 2026
@geo2a geo2a moved this to 🏗 In progress in Consensus Team Backlog Apr 17, 2026
@geo2a geo2a force-pushed the fraser-iohk/snapshot-config-sanity-checks branch from 671f2d9 to b2395be Compare April 17, 2026 08:14
@geo2a geo2a force-pushed the amesgen/predictable-snapshots branch 3 times, most recently from d181bb5 to 6c2bc63 Compare April 17, 2026 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🏗 In progress

Development

Successfully merging this pull request may close these issues.

3 participants