From d4baad264ef6d7896c01d08601f6dc251c63f9a2 Mon Sep 17 00:00:00 2001 From: Sylvain Ribstein Date: Tue, 23 Jun 2020 15:52:33 +0200 Subject: [PATCH 1/9] migration: expose Storage.Make_index --- src/proto_alpha/lib_protocol/storage.mli | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/proto_alpha/lib_protocol/storage.mli b/src/proto_alpha/lib_protocol/storage.mli index 4ec426976050..f79d2eabd14e 100644 --- a/src/proto_alpha/lib_protocol/storage.mli +++ b/src/proto_alpha/lib_protocol/storage.mli @@ -44,6 +44,20 @@ module Block_priority : sig val init : Raw_context.t -> int -> Raw_context.t tzresult Lwt.t end +module Make_index (H : Storage_description.INDEX) : sig + type t = H.t + + val path_length : int + + val to_path : t -> string list -> string list + + val of_path : string list -> t option + + type 'a ipath = 'a * t + + val args : ('a, t, 'a ipath) Storage_description.args +end + module Roll : sig (** Storage from this submodule must only be accessed through the module `Roll`. *) -- GitLab From 476592a33c9ec2bc527a42046dd7f1c78fdef744 Mon Sep 17 00:00:00 2001 From: Sylvain Ribstein Date: Tue, 5 Jan 2021 09:47:07 +0100 Subject: [PATCH 2/9] migration: add migration helper fct --- src/proto_alpha/lib_protocol/init_storage.ml | 58 ++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/src/proto_alpha/lib_protocol/init_storage.ml b/src/proto_alpha/lib_protocol/init_storage.ml index 1c312c5f2564..0495f8d2949d 100644 --- a/src/proto_alpha/lib_protocol/init_storage.ml +++ b/src/proto_alpha/lib_protocol/init_storage.ml @@ -24,6 +24,64 @@ (* *) (*****************************************************************************) +module Migrate_from_008_to_009 = struct + let rec path_remove_prefix = function + | (h1 :: t1, h2 :: t2) when String.(equal h1 h2) -> + path_remove_prefix (t1, t2) + | ([], t2) -> + return t2 + | (_, _) -> + (*can't happens because the path have been digged starting with that + prefix *) + assert false + + let fold_keys (type t) ~index ~init ~f ~index_path ctxt = + let (module Index : Storage_functors.INDEX with type t = t) = index in + let rec dig len path acc = + if Compare.Int.(len <= 0) then + path_remove_prefix (index_path, path) + >>=? fun key_path -> + match Index.of_path key_path with + | None -> + (* can't happens as the path have been digged and can't be false *) + assert false + | Some value -> + f path value acc + else + Raw_context.fold ctxt path ~init:(Ok acc) ~f:(fun k acc -> + Lwt.return acc + >>=? fun acc -> + match k with `Dir k | `Key k -> dig (len - 1) k acc) + in + dig Index.path_length index_path init + + let migrate_indexed_storage (type t) ctxt ~from_index ~to_index ~index_path = + let (module To_index : Storage_functors.INDEX with type t = t) = + to_index + in + let tmp_index_path = + let rev_path = List.rev index_path in + List.rev (("tmp_" ^ List.hd rev_path) :: List.tl rev_path) + in + fold_keys + ~index:from_index + ~init:(ctxt, false) + ~f:(fun old_path value (ctxt, _has_value) -> + let new_path = tmp_index_path @ To_index.to_path value [] in + Raw_context.copy ctxt ~from:old_path ~to_:new_path + >>=? fun ctxt -> return (ctxt, true)) + ~index_path + ctxt + >>=? fun (ctxt, has_value) -> + if has_value then + Raw_context.remove_rec ctxt index_path + >>= fun ctxt -> + Raw_context.copy ctxt tmp_index_path index_path + >>=? fun ctxt -> + Raw_context.remove_rec ctxt tmp_index_path >>= fun ctxt -> return ctxt + else return ctxt +end + (* This is the genesis protocol: initialise the state *) let prepare_first_block ctxt ~typecheck ~level ~timestamp ~fitness = Raw_context.prepare_first_block ~level ~timestamp ~fitness ctxt -- GitLab From 5ac8087aea10201696ee42c80c0b65a33fd86b8a Mon Sep 17 00:00:00 2001 From: Sylvain Ribstein Date: Tue, 6 Oct 2020 09:30:13 +0200 Subject: [PATCH 3/9] Protocol/Contracts: flat hierarchy --- src/proto_alpha/lib_protocol/contract_repr.ml | 27 ++++--------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/src/proto_alpha/lib_protocol/contract_repr.ml b/src/proto_alpha/lib_protocol/contract_repr.ml index 1fd9d0c5d43c..f3d6ebd4b5ff 100644 --- a/src/proto_alpha/lib_protocol/contract_repr.ml +++ b/src/proto_alpha/lib_protocol/contract_repr.ml @@ -191,36 +191,19 @@ let rpc_arg = module Index = struct type t = contract - let path_length = 7 + let path_length = 1 let to_path c l = let raw_key = Data_encoding.Binary.to_bytes_exn encoding c in let (`Hex key) = Hex.of_bytes raw_key in - let (`Hex index_key) = Hex.of_bytes (Raw_hashes.blake2b raw_key) in - String.sub index_key 0 2 :: String.sub index_key 2 2 - :: String.sub index_key 4 2 :: String.sub index_key 6 2 - :: String.sub index_key 8 2 :: String.sub index_key 10 2 :: key :: l + key :: l let of_path = function - | [] - | [_] - | [_; _] - | [_; _; _] - | [_; _; _; _] - | [_; _; _; _; _] - | [_; _; _; _; _; _] - | _ :: _ :: _ :: _ :: _ :: _ :: _ :: _ :: _ -> - None - | [index1; index2; index3; index4; index5; index6; key] -> + | [key] -> let raw_key = Hex.to_bytes (`Hex key) in - let (`Hex index_key) = Hex.of_bytes (Raw_hashes.blake2b raw_key) in - assert (Compare.String.(String.sub index_key 0 2 = index1)) ; - assert (Compare.String.(String.sub index_key 2 2 = index2)) ; - assert (Compare.String.(String.sub index_key 4 2 = index3)) ; - assert (Compare.String.(String.sub index_key 6 2 = index4)) ; - assert (Compare.String.(String.sub index_key 8 2 = index5)) ; - assert (Compare.String.(String.sub index_key 10 2 = index6)) ; Data_encoding.Binary.of_bytes encoding raw_key + | _ -> + None let rpc_arg = rpc_arg -- GitLab From c8a848e17e5c076fc4267f37144e4b076c5e36cf Mon Sep 17 00:00:00 2001 From: Sylvain Ribstein Date: Tue, 5 Jan 2021 09:49:00 +0100 Subject: [PATCH 4/9] migration: migrate contracts to flatten index --- src/proto_alpha/lib_protocol/contract_repr.ml | 41 +++++++++++++++++++ .../lib_protocol/contract_repr.mli | 2 + src/proto_alpha/lib_protocol/init_storage.ml | 31 ++++++++++++++ 3 files changed, 74 insertions(+) diff --git a/src/proto_alpha/lib_protocol/contract_repr.ml b/src/proto_alpha/lib_protocol/contract_repr.ml index f3d6ebd4b5ff..02dd7440c7e9 100644 --- a/src/proto_alpha/lib_protocol/contract_repr.ml +++ b/src/proto_alpha/lib_protocol/contract_repr.ml @@ -188,6 +188,47 @@ let rpc_arg = ~destruct () +module Index_008 = struct + type t = contract + + let path_length = 7 + + let to_path c l = + let raw_key = Data_encoding.Binary.to_bytes_exn encoding c in + let (`Hex key) = Hex.of_bytes raw_key in + let (`Hex index_key) = Hex.of_bytes (Raw_hashes.blake2b raw_key) in + String.sub index_key 0 2 :: String.sub index_key 2 2 + :: String.sub index_key 4 2 :: String.sub index_key 6 2 + :: String.sub index_key 8 2 :: String.sub index_key 10 2 :: key :: l + + let of_path = function + | [] + | [_] + | [_; _] + | [_; _; _] + | [_; _; _; _] + | [_; _; _; _; _] + | [_; _; _; _; _; _] + | _ :: _ :: _ :: _ :: _ :: _ :: _ :: _ :: _ -> + None + | [index1; index2; index3; index4; index5; index6; key] -> + let raw_key = Hex.to_bytes (`Hex key) in + let (`Hex index_key) = Hex.of_bytes (Raw_hashes.blake2b raw_key) in + assert (Compare.String.(String.sub index_key 0 2 = index1)) ; + assert (Compare.String.(String.sub index_key 2 2 = index2)) ; + assert (Compare.String.(String.sub index_key 4 2 = index3)) ; + assert (Compare.String.(String.sub index_key 6 2 = index4)) ; + assert (Compare.String.(String.sub index_key 8 2 = index5)) ; + assert (Compare.String.(String.sub index_key 10 2 = index6)) ; + Data_encoding.Binary.of_bytes encoding raw_key + + let rpc_arg = rpc_arg + + let encoding = encoding + + let compare = compare +end + module Index = struct type t = contract diff --git a/src/proto_alpha/lib_protocol/contract_repr.mli b/src/proto_alpha/lib_protocol/contract_repr.mli index 53935e460bbb..bc49c917926a 100644 --- a/src/proto_alpha/lib_protocol/contract_repr.mli +++ b/src/proto_alpha/lib_protocol/contract_repr.mli @@ -77,4 +77,6 @@ val origination_nonce_encoding : origination_nonce Data_encoding.t val rpc_arg : contract RPC_arg.arg +module Index_008 : Storage_description.INDEX with type t = t + module Index : Storage_description.INDEX with type t = t diff --git a/src/proto_alpha/lib_protocol/init_storage.ml b/src/proto_alpha/lib_protocol/init_storage.ml index 0495f8d2949d..b1b9ea8e560a 100644 --- a/src/proto_alpha/lib_protocol/init_storage.ml +++ b/src/proto_alpha/lib_protocol/init_storage.ml @@ -119,6 +119,37 @@ let prepare_first_block ctxt ~typecheck ~level ~timestamp ~fitness = *) let balance_updates = [] in Storage.Pending_migration_balance_updates.init ctxt balance_updates + >>=? fun ctxt -> + let contract_index_008 = + ( module Storage.Make_index (Contract_repr.Index_008) + : Storage_functors.INDEX + with type t = Contract_repr.t ) + in + let contract_index = + ( module Storage.Make_index (Contract_repr.Index) + : Storage_functors.INDEX + with type t = Contract_repr.t ) + in + Migrate_from_008_to_009.migrate_indexed_storage + ctxt + ~from_index:contract_index_008 + ~to_index:contract_index + ~index_path:["contracts"; "index"] + >>=? fun ctxt -> + Storage.Contract.fold + ~init:(ok ctxt) + ~f:(fun contract ctxt -> + Lwt.return ctxt + >>=? fun ctxt -> + Migrate_from_008_to_009.migrate_indexed_storage + ~from_index:contract_index_008 + ~to_index:contract_index + ~index_path: + ( ["contracts"; "index"] + @ Contract_repr.Index.to_path contract [] + @ ["delegated"] ) + ctxt) + ctxt let prepare ctxt ~level ~predecessor_timestamp ~timestamp ~fitness = Raw_context.prepare ~level ~predecessor_timestamp ~timestamp ~fitness ctxt -- GitLab From 1b853fcfa60f5426055a70d4a6c2e07daee0156c Mon Sep 17 00:00:00 2001 From: Sylvain Ribstein Date: Tue, 6 Oct 2020 09:50:47 +0200 Subject: [PATCH 5/9] Protocol/Big_maps: flat hierarchy --- src/proto_alpha/lib_protocol/storage.ml | 40 +------------------------ 1 file changed, 1 insertion(+), 39 deletions(-) diff --git a/src/proto_alpha/lib_protocol/storage.ml b/src/proto_alpha/lib_protocol/storage.ml index cf1d39cabde9..2555d65e99c3 100644 --- a/src/proto_alpha/lib_protocol/storage.ml +++ b/src/proto_alpha/lib_protocol/storage.ml @@ -337,45 +337,7 @@ module Big_map = struct let init ctxt = init ctxt Lazy_storage_kind.Big_map.Id.init end - module Index = struct - (* After flat storage, just use module Index = Lazy_storage_kind.Big_map.Id *) - - include Lazy_storage_kind.Big_map.Id - - let path_length = 6 + path_length - - let to_path c l = - let raw_key = Data_encoding.Binary.to_bytes_exn encoding c in - let (`Hex index_key) = Hex.of_bytes (Raw_hashes.blake2b raw_key) in - String.sub index_key 0 2 :: String.sub index_key 2 2 - :: String.sub index_key 4 2 :: String.sub index_key 6 2 - :: String.sub index_key 8 2 :: String.sub index_key 10 2 :: to_path c l - - let of_path = function - | [] - | [_] - | [_; _] - | [_; _; _] - | [_; _; _; _] - | [_; _; _; _; _] - | [_; _; _; _; _; _] - | _ :: _ :: _ :: _ :: _ :: _ :: _ :: _ :: _ -> - None - | index1 :: index2 :: index3 :: index4 :: index5 :: index6 :: tail -> - of_path tail - |> Option.map (fun c -> - let raw_key = Data_encoding.Binary.to_bytes_exn encoding c in - let (`Hex index_key) = - Hex.of_bytes (Raw_hashes.blake2b raw_key) - in - assert (Compare.String.(String.sub index_key 0 2 = index1)) ; - assert (Compare.String.(String.sub index_key 2 2 = index2)) ; - assert (Compare.String.(String.sub index_key 4 2 = index3)) ; - assert (Compare.String.(String.sub index_key 6 2 = index4)) ; - assert (Compare.String.(String.sub index_key 8 2 = index5)) ; - assert (Compare.String.(String.sub index_key 10 2 = index6)) ; - c) - end + module Index = Lazy_storage_kind.Big_map.Id module Indexed_context = Make_indexed_subcontext -- GitLab From 3fea1fb54aa83237b33be6d6f95e53815c22c0cc Mon Sep 17 00:00:00 2001 From: Sylvain Ribstein Date: Tue, 5 Jan 2021 09:56:15 +0100 Subject: [PATCH 6/9] migration: migrate big maps to flatten index --- src/proto_alpha/lib_protocol/init_storage.ml | 16 +++++++++ src/proto_alpha/lib_protocol/storage.ml | 38 ++++++++++++++++++++ src/proto_alpha/lib_protocol/storage.mli | 4 +++ 3 files changed, 58 insertions(+) diff --git a/src/proto_alpha/lib_protocol/init_storage.ml b/src/proto_alpha/lib_protocol/init_storage.ml index b1b9ea8e560a..70fc9c8c754a 100644 --- a/src/proto_alpha/lib_protocol/init_storage.ml +++ b/src/proto_alpha/lib_protocol/init_storage.ml @@ -150,6 +150,22 @@ let prepare_first_block ctxt ~typecheck ~level ~timestamp ~fitness = @ ["delegated"] ) ctxt) ctxt + >>=? fun ctxt -> + let bigmap_index_008 = + ( module Storage.Make_index (Storage.Big_map.Index_008) + : Storage_functors.INDEX + with type t = Storage.Big_map.id ) + in + let bigmap_index = + ( module Storage.Make_index (Storage.Big_map.Index) + : Storage_functors.INDEX + with type t = Storage.Big_map.id ) + in + Migrate_from_008_to_009.migrate_indexed_storage + ctxt + ~from_index:bigmap_index_008 + ~to_index:bigmap_index + ~index_path:["big_maps"; "index"] let prepare ctxt ~level ~predecessor_timestamp ~timestamp ~fitness = Raw_context.prepare ~level ~predecessor_timestamp ~timestamp ~fitness ctxt diff --git a/src/proto_alpha/lib_protocol/storage.ml b/src/proto_alpha/lib_protocol/storage.ml index 2555d65e99c3..8199f09f158f 100644 --- a/src/proto_alpha/lib_protocol/storage.ml +++ b/src/proto_alpha/lib_protocol/storage.ml @@ -339,6 +339,44 @@ module Big_map = struct module Index = Lazy_storage_kind.Big_map.Id + module Index_008 = struct + include Lazy_storage_kind.Big_map.Id + + let path_length = 6 + path_length + + let to_path c l = + let raw_key = Data_encoding.Binary.to_bytes_exn encoding c in + let (`Hex index_key) = Hex.of_bytes (Raw_hashes.blake2b raw_key) in + String.sub index_key 0 2 :: String.sub index_key 2 2 + :: String.sub index_key 4 2 :: String.sub index_key 6 2 + :: String.sub index_key 8 2 :: String.sub index_key 10 2 :: to_path c l + + let of_path = function + | [] + | [_] + | [_; _] + | [_; _; _] + | [_; _; _; _] + | [_; _; _; _; _] + | [_; _; _; _; _; _] + | _ :: _ :: _ :: _ :: _ :: _ :: _ :: _ :: _ -> + None + | index1 :: index2 :: index3 :: index4 :: index5 :: index6 :: tail -> + of_path tail + |> Option.map (fun c -> + let raw_key = Data_encoding.Binary.to_bytes_exn encoding c in + let (`Hex index_key) = + Hex.of_bytes (Raw_hashes.blake2b raw_key) + in + assert (Compare.String.(String.sub index_key 0 2 = index1)) ; + assert (Compare.String.(String.sub index_key 2 2 = index2)) ; + assert (Compare.String.(String.sub index_key 4 2 = index3)) ; + assert (Compare.String.(String.sub index_key 6 2 = index4)) ; + assert (Compare.String.(String.sub index_key 8 2 = index5)) ; + assert (Compare.String.(String.sub index_key 10 2 = index6)) ; + c) + end + module Indexed_context = Make_indexed_subcontext (Make_subcontext (Registered) (Raw_context) diff --git a/src/proto_alpha/lib_protocol/storage.mli b/src/proto_alpha/lib_protocol/storage.mli index f79d2eabd14e..e536fb7fd3b8 100644 --- a/src/proto_alpha/lib_protocol/storage.mli +++ b/src/proto_alpha/lib_protocol/storage.mli @@ -237,6 +237,10 @@ end module Big_map : sig type id = Lazy_storage_kind.Big_map.Id.t + module Index_008 : Storage_description.INDEX with type t = id + + module Index : Storage_description.INDEX with type t = id + module Next : sig val incr : Raw_context.t -> (Raw_context.t * id) tzresult Lwt.t -- GitLab From 3a26faf25c6929a6b858c3bd4a59e189adf2952a Mon Sep 17 00:00:00 2001 From: Ilias Garnier Date: Mon, 25 May 2020 08:47:01 +0200 Subject: [PATCH 7/9] Protocol/Rolls: flat hierarchy --- src/proto_alpha/lib_protocol/roll_repr.ml | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/proto_alpha/lib_protocol/roll_repr.ml b/src/proto_alpha/lib_protocol/roll_repr.ml index 74b47360b2ac..3ad3bcb0b181 100644 --- a/src/proto_alpha/lib_protocol/roll_repr.ml +++ b/src/proto_alpha/lib_protocol/roll_repr.ml @@ -42,20 +42,11 @@ let to_int32 v = v module Index = struct type t = roll - let path_length = 3 + let path_length = 1 - let to_path roll l = - (Int32.to_string @@ Int32.logand roll (Int32.of_int 0xff)) - :: ( Int32.to_string - @@ Int32.logand (Int32.shift_right_logical roll 8) (Int32.of_int 0xff) - ) - :: Int32.to_string roll :: l + let to_path roll l = Int32.to_string roll :: l - let of_path = function - | _ :: _ :: s :: _ -> - Int32.of_string_opt s - | _ -> - None + let of_path = function s :: _ -> Int32.of_string_opt s | _ -> None let rpc_arg = rpc_arg -- GitLab From 1e7c3cacd1021b41f86964c2b5e125807db022d7 Mon Sep 17 00:00:00 2001 From: Sylvain Ribstein Date: Tue, 5 Jan 2021 10:36:27 +0100 Subject: [PATCH 8/9] migration: migrate rolls to flatten index --- src/proto_alpha/lib_protocol/init_storage.ml | 41 ++++++++++++++++++++ src/proto_alpha/lib_protocol/roll_repr.ml | 25 ++++++++++++ src/proto_alpha/lib_protocol/roll_repr.mli | 2 + src/proto_alpha/lib_protocol/storage.mli | 3 ++ 4 files changed, 71 insertions(+) diff --git a/src/proto_alpha/lib_protocol/init_storage.ml b/src/proto_alpha/lib_protocol/init_storage.ml index 70fc9c8c754a..e95f73a1ea40 100644 --- a/src/proto_alpha/lib_protocol/init_storage.ml +++ b/src/proto_alpha/lib_protocol/init_storage.ml @@ -166,6 +166,47 @@ let prepare_first_block ctxt ~typecheck ~level ~timestamp ~fitness = ~from_index:bigmap_index_008 ~to_index:bigmap_index ~index_path:["big_maps"; "index"] + >>=? fun ctxt -> + let rolls_index_008 = + ( module Storage.Make_index (Roll_repr.Index_008) + : Storage_functors.INDEX + with type t = Roll_repr.t ) + in + let rolls_index = + (module Storage.Make_index (Roll_repr.Index) : Storage_functors.INDEX + with type t = Roll_repr.t ) + in + let snapshot_rolls_index_008 = + let (module Rolls_index_008) = rolls_index_008 in + ( module Storage_functors.Pair + (Storage.Roll.Snapshoted_owner_index) + (Rolls_index_008) : Storage_functors.INDEX + with type t = (Cycle_repr.t * int) * Roll_repr.t ) + in + let snapshot_rolls_index = + let (module Rolls_index) = rolls_index in + ( module Storage_functors.Pair + (Storage.Roll.Snapshoted_owner_index) + (Rolls_index) : Storage_functors.INDEX + with type t = (Cycle_repr.t * int) * Roll_repr.t ) + in + Migrate_from_008_to_009.migrate_indexed_storage + ctxt + ~from_index:rolls_index_008 + ~to_index:rolls_index + ~index_path:["rolls"; "index"] + >>=? fun ctxt -> + Migrate_from_008_to_009.migrate_indexed_storage + ctxt + ~from_index:snapshot_rolls_index_008 + ~to_index:snapshot_rolls_index + ~index_path:["rolls"; "owner"; "snapshot"] + >>=? fun ctxt -> + Migrate_from_008_to_009.migrate_indexed_storage + ctxt + ~from_index:rolls_index_008 + ~to_index:rolls_index + ~index_path:["rolls"; "owner"; "current"] let prepare ctxt ~level ~predecessor_timestamp ~timestamp ~fitness = Raw_context.prepare ~level ~predecessor_timestamp ~timestamp ~fitness ctxt diff --git a/src/proto_alpha/lib_protocol/roll_repr.ml b/src/proto_alpha/lib_protocol/roll_repr.ml index 3ad3bcb0b181..5af663463bc3 100644 --- a/src/proto_alpha/lib_protocol/roll_repr.ml +++ b/src/proto_alpha/lib_protocol/roll_repr.ml @@ -39,6 +39,31 @@ let rpc_arg = RPC_arg.like RPC_arg.int32 "roll" let to_int32 v = v +module Index_008 = struct + type t = roll + + let path_length = 3 + + let to_path roll l = + (Int32.to_string @@ Int32.logand roll (Int32.of_int 0xff)) + :: ( Int32.to_string + @@ Int32.logand (Int32.shift_right_logical roll 8) (Int32.of_int 0xff) + ) + :: Int32.to_string roll :: l + + let of_path = function + | _ :: _ :: s :: _ -> + Int32.of_string_opt s + | _ -> + None + + let rpc_arg = rpc_arg + + let encoding = encoding + + let compare = compare +end + module Index = struct type t = roll diff --git a/src/proto_alpha/lib_protocol/roll_repr.mli b/src/proto_alpha/lib_protocol/roll_repr.mli index cb792b0128e7..c3ddd19cf617 100644 --- a/src/proto_alpha/lib_protocol/roll_repr.mli +++ b/src/proto_alpha/lib_protocol/roll_repr.mli @@ -41,4 +41,6 @@ val to_int32 : roll -> Int32.t val ( = ) : roll -> roll -> bool +module Index_008 : Storage_description.INDEX with type t = roll + module Index : Storage_description.INDEX with type t = roll diff --git a/src/proto_alpha/lib_protocol/storage.mli b/src/proto_alpha/lib_protocol/storage.mli index e536fb7fd3b8..28866035fff0 100644 --- a/src/proto_alpha/lib_protocol/storage.mli +++ b/src/proto_alpha/lib_protocol/storage.mli @@ -62,6 +62,9 @@ module Roll : sig (** Storage from this submodule must only be accessed through the module `Roll`. *) + module Snapshoted_owner_index : + Storage_functors.INDEX with type t = Cycle_repr.t * int + module Owner : Indexed_data_snapshotable_storage with type key = Roll_repr.t -- GitLab From aa80c8b235eb59949570873c664dd4b013caf4c7 Mon Sep 17 00:00:00 2001 From: Sylvain Ribstein Date: Thu, 28 Jan 2021 14:23:15 +0100 Subject: [PATCH 9/9] tez/regression: reset regression test --- tezt/_regressions/rpc/alpha.delegates.out | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tezt/_regressions/rpc/alpha.delegates.out b/tezt/_regressions/rpc/alpha.delegates.out index 9488b536100b..ba15ba124239 100644 --- a/tezt/_regressions/rpc/alpha.delegates.out +++ b/tezt/_regressions/rpc/alpha.delegates.out @@ -37,13 +37,13 @@ false ./tezos-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]' Fatal error: Command failed : Storage error: - Missing key 'contracts/index/63/cb/4c/cb/6c/4c/0000b443c2c85e0aeb6a4c0a37783f4d8251a956e8ad/balance'. + Missing key 'contracts/index/0000b443c2c85e0aeb6a4c0a37783f4d8251a956e8ad/balance'. ./tezos-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/balance' Fatal error: Command failed : Storage error: - Missing key 'contracts/index/63/cb/4c/cb/6c/4c/0000b443c2c85e0aeb6a4c0a37783f4d8251a956e8ad/balance'. + Missing key 'contracts/index/0000b443c2c85e0aeb6a4c0a37783f4d8251a956e8ad/balance'. ./tezos-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/deactivated' @@ -52,7 +52,7 @@ false ./tezos-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/delegated_balance' Fatal error: Command failed : Storage error: - Missing key 'contracts/index/63/cb/4c/cb/6c/4c/0000b443c2c85e0aeb6a4c0a37783f4d8251a956e8ad/balance'. + Missing key 'contracts/index/0000b443c2c85e0aeb6a4c0a37783f4d8251a956e8ad/balance'. ./tezos-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/delegated_contracts' @@ -67,7 +67,7 @@ Fatal error: ./tezos-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/grace_period' Fatal error: Command failed : Storage error: - Missing key 'contracts/index/63/cb/4c/cb/6c/4c/0000b443c2c85e0aeb6a4c0a37783f4d8251a956e8ad/delegate_desactivation'. + Missing key 'contracts/index/0000b443c2c85e0aeb6a4c0a37783f4d8251a956e8ad/delegate_desactivation'. ./tezos-client rpc get '/chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]/staking_balance' -- GitLab