Skip to content

Allow to create snapshot in non-native format #1574

@amesgen

Description

@amesgen

Currently, the node always creates snapshots in the format corresponding to the chosen LedgerDB backend, ie in-memory (V2) or LMDB, with lsm-tree replacing LMDB in the near future.

It would be convenient for Mithril if the node could write snapshots directly in the format that Mithril would sign (which needs to be agreen upon by all Mithril signers). This is mostly to simplify Mithril deployment, as the Mithril signer would otherwise need to invoke some CLI tool (think snapshot-converter) or depend on this functionality via FFI.

In the future, the (WIP) canonical ledger state format would be the right tool for use here. Before that, the Haskell in-memory format (UTxO-HD V2) would be the closest approximation (as the LMDB/lsm-tree formats are even less portable).

Therefore, the goal of this ticket is to allow nodes using the on-disk backend to still create snapshots in the in-memory format (the UTxO-HD V2 one) on the fly. It seems sensible to still store the "native" on-disk version of snapshots, so these snapshots could be written to a separate directory (that is not considered when loading snapshots on startup).

As the UTxO map is stored in a separate file in the V2 in-memory format, converting to this format is easily possible with constant memory usage. The canonical ledger state format should also enable doing this (by having different files for different tables).

Original: #1424 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    🔖 Ready

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions