Skip to content

feat(prot): adjust snapshot frequency [DO-61]

Ethan Reesor requested to merge DO-61-snapshot-frequency into main

Closes DO-61. Makes the frequency of snapshots adjustable via a cron-style configuration field. Snapshots may be captured immediately after a major block. When a major block is recorded, the next scheduled time is calculated from the snapshot frequency and the latest snapshot's block time; if the current block time is equal to or after the next scheduled time, a snapshot is captured. Therefore making the snapshot frequency greater than the major block frequency will not have the intended effect.

This will facilitate testing the staking app. With this change we can increase the frequency of major blocks to simulate accelerated time, without capturing an excessive number of snapshots.

I also replaced the cron library with one that is actively maintained and has better documentation.

Review Checklist

If any item is not complete, the merge request is not ready to be reviewed and must be marked Draft:.

  • The merge request title is in the format <change type>(<change scope>): <short description> [<task id>]
    • For example, feat(cli): add QR code generation [AC-123]
    • For details, see CONTRIBUTING.md
  • The description includes Closes <jira task ID> (or rarely Updates <jira task ID>)
  • The change is fully validated by tests that are run during CI
    • In most cases this means a test in "validate.sh"
    • In some cases, a Go test may be acceptable
    • Validation is not applicable to things like documentation updates
    • Purely UI/UX changes can be manually validated, such as changes to human-readable output
    • For all other changes, automated validation tests are an absolute requirement unless a maintainer specifically explains why they are not in a comment on this merge request
  • The change is marked with one of the validation labels

Merge Checklist

  • CI is passing
  • Merge conflicts are resolved
  • All discussions are resolved

Related to DO-61

Edited by Paul Snow

Merge request reports