package tezos-store

  1. Overview
  2. Docs

Legacy storage upgrade

The legacy store upgrade aims to migrate a storage using the LMDB backend (v0.0.4) to the new store representation (v0.0.5). This migration is available for any store running v0.0.4 with any history mode. The upgrade procedure is going to retrieve each the block and its associated data available in the old store, convert and store them in the new backend. It will preserve all the information originally contained in the LMDB store such as the current head, checkpoint, savepoint and caboose.

module Hardcoded : sig ... end

Module for handling values needed by the legacy upgrade. It exposes the cycle_length to allow upgrading supported_networks only. These values are mandatory as the new backend regroup blocks by cycles, something which was not available in the previous representation when the metadata of blocks is not fully available.

type Tezos_base__TzPervasives.error +=
  1. | Failed_to_convert_protocol of Tezos_crypto.Protocol_hash.t
type Tezos_base__TzPervasives.error +=
  1. | Failed_to_upgrade of string
val temporary_former_store_path : data_dir:string -> string

temporary_former_store_path ~data_dir returns the path of the preserved legacy store given a data_dir

raw_upgrade chain_name ~new_store ~old_store hm genesis is the low level upgrade procedure which performs the store upgrade given the direct paths to the new_store and old_store.

Warning This function is unsafe and is exposed for testing purposes.

val upgrade_0_0_4 : data_dir:string -> ?patch_context: (Tezos_context.Context.t -> (Tezos_context.Context.t, Tezos_error_monad.TzCore.error list) Stdlib.result Lwt.t) -> chain_name:Tezos_base.Distributed_db_version.Name.t -> Tezos_base.Genesis.t -> (unit, Tezos_error_monad.TzCore.error list) Stdlib.result Lwt.t

upgrade_0_0_4 ~data_dir ?patch_context ~chain_name genesis upgrades a store located in data_dir base on v.0.0.4 to a v0.0.5. It outputs information regarding the necessary actions in order to cleanely complete the upgrade. Here this case, the user must delete the old storage. Returns the message to display to the user.

val upgrade_0_0_5 : data_dir:string -> Tezos_base.Genesis.t -> (unit, Tezos_error_monad.TzCore.error list) Stdlib.result Lwt.t

upgrade_0_0_5 ~data_dir genesis upgrades a v0.0.5 store located in data_dir to the v0.0.6 format. This upgrade consists in removing the broken floating indexes of the former store and re-rewriting some fresh ones.

OCaml

Innovation. Community. Security.