Skip to content

[Utility][Persistence][Savepoints/Rollbacks] Implement Snapshots - Persist SavePoints #567

@deblasis

Description

@deblasis

Objective

Implement a deterministic way to create a snapshot of the "World State" (technically a persisted version of what in the Design Document is referred as savepoint).

Origin Document

#493 and #562

Goals

  • When a snapshot creation is triggered, the node should pause the normal operation (use state-machine and bus to coordinate with all the modules)
  • When the snapshot is completed (OK or KO), normal operation should resume (the node should sync to catch up with what happened while it was snapshotting)
  • Implement a way to provide feedback to the caller (RPC->CLI) about the progress and status of the operation
    • The same mechanism can be used for rollbacks and polled by the CLI right after the create snapshot (or rollback to snapshot) command is triggered
  • The last valid/persisted height should be used as datasource for the snapshot
  • The snapshot should be saved to the filesystem into a folder that's defined in Persistence configuration but we should keep an open mind regarding the future introduction of multiple destination types that are filesystem-like (Tor, FTP, S3, etc.). Using a simple abstraction should be enough for now, see related tickets for the whole context.
  • The snapshot should be compressed
  • The snapshot should be named meaningfully (append at least the height it refers to using a standardized naming convention that we'll have to put in the various documentation as well)

Deliverable

  • A PR with implementation tending to the goals above
  • Tests

Non-goals / Non-deliverables

General issue deliverables

  • Update the appropriate CHANGELOG(s)
  • Update any relevant local/global README(s)
  • Update relevant source code tree explanations
  • Add or update any relevant or supporting mermaid diagrams

Testing Methodology

  • Task specific tests or benchmarks: make ...
  • New tests or benchmarks: make ...
  • All tests: make test_all
  • LocalNet: verify a LocalNet is still functioning correctly by following the instructions at docs/development/README.md

Creator: @deblasis
Co-Owners: @Olshansk

Metadata

Metadata

Assignees

Labels

coreCore infrastructure - protocol relatedpersistencePersistence specific changesutilityUtility specific changes

Type

No type

Projects

Status

Backlog

Relationships

None yet

Development

No branches or pull requests

Issue actions