diff --git a/src/proto_alpha/lib_protocol/TEZOS_PROTOCOL b/src/proto_alpha/lib_protocol/TEZOS_PROTOCOL index 967a974461a9ad22bb2c7d9bc86ad73cf7ee523c..74d825cef995def1ab5e14d975d2cd2fc9b8a6ca 100644 --- a/src/proto_alpha/lib_protocol/TEZOS_PROTOCOL +++ b/src/proto_alpha/lib_protocol/TEZOS_PROTOCOL @@ -109,6 +109,7 @@ "Stake_repr", "Carbonated_map_costs", "Carbonated_map", + "Staking_parameters_repr", "Raw_context_intf", "Raw_context", @@ -144,6 +145,7 @@ "Token", "Fees_storage", "Adaptive_inflation_storage", + "Delegate_staking_parameters", "Delegate_consensus_key", "Delegate_storage", "Delegate_sampler", diff --git a/src/proto_alpha/lib_protocol/alpha_context.ml b/src/proto_alpha/lib_protocol/alpha_context.ml index 844c28b7439f508c4daaf0f3f4d3c43b5597840b..f6fd7e0e4275e3647c651b42b7e00e2a6800a1ac 100644 --- a/src/proto_alpha/lib_protocol/alpha_context.ml +++ b/src/proto_alpha/lib_protocol/alpha_context.ml @@ -504,6 +504,8 @@ module Delegate = struct include Delegate_rewards module For_RPC = Adaptive_inflation_storage.For_RPC end + + module Staking_parameters = Delegate_staking_parameters end module Stake_distribution = struct diff --git a/src/proto_alpha/lib_protocol/alpha_context.mli b/src/proto_alpha/lib_protocol/alpha_context.mli index f4c7393f237cf6a4bd6d810e0b80b925bf1d7e57..3acfa6802f07ab9466badd1a142995a53d9536f1 100644 --- a/src/proto_alpha/lib_protocol/alpha_context.mli +++ b/src/proto_alpha/lib_protocol/alpha_context.mli @@ -2263,6 +2263,14 @@ module Delegate : sig val get_reward_coeff : t -> cycle:Cycle.t -> Q.t tzresult Lwt.t end end + + module Staking_parameters : sig + val register_update : + context -> + Signature.Public_key_hash.t -> + Staking_parameters_repr.t -> + context tzresult Lwt.t + end end (** This module re-exports definitions from {!Voting_period_repr} and diff --git a/src/proto_alpha/lib_protocol/apply.ml b/src/proto_alpha/lib_protocol/apply.ml index 3da6215c27e28cc08207d31e1a5318d4ff3a2985..0c579c9b19a8c3ff124c865fc93a4829ad987be9 100644 --- a/src/proto_alpha/lib_protocol/apply.ml +++ b/src/proto_alpha/lib_protocol/apply.ml @@ -47,6 +47,7 @@ type error += | Staking_for_nondelegate_while_costaking_disabled | Invalid_nonzero_transaction_amount of Tez.t | Invalid_unstake_request_amount of {requested_amount : Z.t} + | Invalid_staking_parameters_sender let () = register_error_kind @@ -285,7 +286,16 @@ let () = | Invalid_unstake_request_amount {requested_amount} -> Some requested_amount | _ -> None) - (fun requested_amount -> Invalid_unstake_request_amount {requested_amount}) + (fun requested_amount -> Invalid_unstake_request_amount {requested_amount}) ; + register_error_kind + `Permanent + ~id:"operations.invalid_staking_parameters_sender" + ~title:"Invalid staking parameters sender" + ~description:"The staking parameters can only be set by delegates." + ~pp:(fun ppf () -> Format.fprintf ppf "Invalid staking parameters sender") + Data_encoding.empty + (function Invalid_staking_parameters_sender -> Some () | _ -> None) + (fun () -> Invalid_staking_parameters_sender) open Apply_results open Apply_operation_result @@ -449,6 +459,35 @@ let apply_finalize_unstake ~ctxt ~sender ~amount ~destination ~before_operation in return (ctxt, result, []) +let apply_set_delegate_parameters ~ctxt ~delegate ~staking_over_baking_limit + ~baking_over_staking_edge ~before_operation = + let open Lwt_result_syntax in + let staking_over_baking_limit = Z.to_int32 staking_over_baking_limit in + let baking_over_staking_edge = Z.to_int32 baking_over_staking_edge in + let*? t = + Staking_parameters_repr.make + ~staking_over_baking_limit + ~baking_over_staking_edge + in + let* is_delegate = Contract.is_delegate ctxt delegate in + let*? () = error_unless is_delegate Invalid_staking_parameters_sender in + let* ctxt = Delegate.Staking_parameters.register_update ctxt delegate t in + let result = + Transaction_to_contract_result + { + storage = None; + lazy_storage_diff = None; + balance_updates = []; + ticket_receipt = []; + originated_contracts = []; + consumed_gas = Gas.consumed ~since:before_operation ~until:ctxt; + storage_size = Z.zero; + paid_storage_size_diff = Z.zero; + allocated_destination_contract = false; + } + in + return (ctxt, result, []) + let transfer_from_any_address ctxt sender destination amount = match sender with | Destination.Contract sender -> @@ -949,11 +988,36 @@ let apply_manager_operation : ~amount ~destination:pkh ~before_operation:ctxt_before_op - | ("default" | "stake" | "unstake" | "finalize_unstake"), _ -> + | ( "set_delegate_parameters", + Prim + ( _, + D_Pair, + [ + Int (_, staking_over_baking_limit); + Prim + ( _, + D_Pair, + [ + Int (_, baking_over_staking_edge); Prim (_, D_Unit, [], []); + ], + [] ); + ], + [] ) ) -> + apply_set_delegate_parameters + ~ctxt + ~delegate:source + ~staking_over_baking_limit + ~baking_over_staking_edge + ~before_operation:ctxt_before_op + | ( ( "default" | "stake" | "unstake" | "finalize_unstake" + | "set_delegate_parameters" ), + _ ) -> (* Only allow: - [unit] parameter to implicit accounts' default, stake, and finalize_unstake entrypoints; - - [nat] parameter to implicit accounts' unstake entrypoint. *) + - [nat] parameter to implicit accounts' unstake entrypoint; + - [pair nat nat unit] parameter to implicit accounts' + set_delegate_parameters entrypoint.*) tzfail (Script_interpreter.Bad_contract_parameter source_contract) | _ -> tzfail (Script_tc_errors.No_such_entrypoint entrypoint)) >|=? fun (ctxt, res, ops) -> (ctxt, Transaction_result res, ops) diff --git a/src/proto_alpha/lib_protocol/delegate_cycles.ml b/src/proto_alpha/lib_protocol/delegate_cycles.ml index 58f7a14e17742d460506ca43f9036214aae9c0d8..a3c979c34763e7ad8337f63f9cbdcf28e74e0b4e 100644 --- a/src/proto_alpha/lib_protocol/delegate_cycles.ml +++ b/src/proto_alpha/lib_protocol/delegate_cycles.ml @@ -232,6 +232,8 @@ let distribute_endorsing_rewards ctxt last_cycle unrevealed_nonces = let cycle_end ctxt last_cycle = Seed_storage.cycle_end ctxt last_cycle >>=? fun (ctxt, unrevealed_nonces) -> let new_cycle = Cycle_repr.add last_cycle 1 in + (* TODO #5807: is this the right place?? *) + Delegate_staking_parameters.activate ctxt ~new_cycle >>=? fun ctxt -> Delegate_sampler.select_new_distribution_at_cycle_end ctxt ~new_cycle >>=? fun ctxt -> Delegate_consensus_key.activate ctxt ~new_cycle >>=? fun ctxt -> diff --git a/src/proto_alpha/lib_protocol/delegate_staking_parameters.ml b/src/proto_alpha/lib_protocol/delegate_staking_parameters.ml new file mode 100644 index 0000000000000000000000000000000000000000..7982a66ac465f746bfb18f6095e64859a5c47c18 --- /dev/null +++ b/src/proto_alpha/lib_protocol/delegate_staking_parameters.ml @@ -0,0 +1,101 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2023 Nomadic Labs *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +let of_delegate ctxt delegate = + Storage.Contract.Staking_parameters.get ctxt (Contract_repr.Implicit delegate) + +let raw_pending_updates ctxt delegate = + Storage.Contract.Pending_staking_parameters.bindings + (ctxt, Contract_repr.Implicit delegate) + +let pending_updates ctxt delegate = + let open Lwt_syntax in + let* updates = raw_pending_updates ctxt delegate in + let updates = + List.sort (fun (c1, _) (c2, _) -> Cycle_repr.compare c1 c2) updates + in + return updates + +let raw_of_delegate_for_cycle ctxt delegate cycle = + let open Lwt_result_syntax in + let*! pendings = raw_pending_updates ctxt delegate in + let* active = of_delegate ctxt delegate in + let current_level = Raw_context.current_level ctxt in + let active_for_cycle = + List.fold_left + (fun (c1, active) (c2, update) -> + if Cycle_repr.(c1 < c2 && c2 <= cycle) then (c2, update) + else (c1, active)) + (current_level.cycle, active) + pendings + in + return active_for_cycle + +let of_delegate_for_cycle ctxt delegate cycle = + let open Lwt_result_syntax in + let* _, t = raw_of_delegate_for_cycle ctxt delegate cycle in + return t + +let register_update ctxt delegate t = + let open Lwt_result_syntax in + let update_cycle = + let current_level = Raw_context.current_level ctxt in + let preserved_cycles = Constants_storage.preserved_cycles ctxt in + Cycle_repr.add current_level.cycle (preserved_cycles + 1) + in + let*! ctxt = + Storage.Contract.Pending_staking_parameters.add + (ctxt, Contract_repr.Implicit delegate) + update_cycle + t + in + return ctxt + +let activate ctxt ~new_cycle = + let open Lwt_result_syntax in + Storage.Delegates.fold + ctxt + ~order:`Undefined + ~init:(ok ctxt) + ~f:(fun delegate ctxt -> + let*? ctxt in + let delegate = Contract_repr.Implicit delegate in + let* update = + Storage.Contract.Pending_staking_parameters.find + (ctxt, delegate) + new_cycle + in + match update with + | None -> return ctxt + | Some t -> + let*! ctxt = + Storage.Contract.Staking_parameters.add ctxt delegate t + in + let*! ctxt = + Storage.Contract.Pending_staking_parameters.remove + (ctxt, delegate) + new_cycle + in + return ctxt) diff --git a/src/proto_alpha/lib_protocol/delegate_staking_parameters.mli b/src/proto_alpha/lib_protocol/delegate_staking_parameters.mli new file mode 100644 index 0000000000000000000000000000000000000000..8e08af9ff6b1df1d6846d972150770e3af4db9a6 --- /dev/null +++ b/src/proto_alpha/lib_protocol/delegate_staking_parameters.mli @@ -0,0 +1,51 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2023 Nomadic Labs *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +val of_delegate : + Raw_context.t -> + Signature.Public_key_hash.t -> + Staking_parameters_repr.t tzresult Lwt.t + +val of_delegate_for_cycle : + Raw_context.t -> + Signature.Public_key_hash.t -> + Cycle_repr.t -> + Staking_parameters_repr.t tzresult Lwt.t + +val pending_updates : + Raw_context.t -> + Signature.Public_key_hash.t -> + (Cycle_repr.t * Staking_parameters_repr.t) list Lwt.t + +val register_update : + Raw_context.t -> + Signature.Public_key_hash.t -> + Staking_parameters_repr.t -> + Raw_context.t tzresult Lwt.t + +(** Maintenance of staking parameters at the beginning of cycle [new_cycle]. + This function iterates on all registered delegates. *) +val activate : + Raw_context.t -> new_cycle:Cycle_repr.t -> Raw_context.t tzresult Lwt.t diff --git a/src/proto_alpha/lib_protocol/dune b/src/proto_alpha/lib_protocol/dune index 68b91814b853ad25cbbb0580f14cdaaee2632a37..97c19e484dbfc29d8b1fa778c41c6401b8979c44 100644 --- a/src/proto_alpha/lib_protocol/dune +++ b/src/proto_alpha/lib_protocol/dune @@ -132,6 +132,7 @@ Stake_repr Carbonated_map_costs Carbonated_map + Staking_parameters_repr Raw_context_intf Raw_context Storage_costs @@ -162,6 +163,7 @@ Token Fees_storage Adaptive_inflation_storage + Delegate_staking_parameters Delegate_consensus_key Delegate_storage Delegate_sampler @@ -399,6 +401,7 @@ stake_repr.ml stake_repr.mli carbonated_map_costs.ml carbonated_map_costs.mli carbonated_map.ml carbonated_map.mli + staking_parameters_repr.ml staking_parameters_repr.mli raw_context_intf.ml raw_context.ml raw_context.mli storage_costs.ml storage_costs.mli @@ -429,6 +432,7 @@ token.ml token.mli fees_storage.ml fees_storage.mli adaptive_inflation_storage.ml adaptive_inflation_storage.mli + delegate_staking_parameters.ml delegate_staking_parameters.mli delegate_consensus_key.ml delegate_consensus_key.mli delegate_storage.ml delegate_storage.mli delegate_sampler.ml delegate_sampler.mli @@ -668,6 +672,7 @@ stake_repr.ml stake_repr.mli carbonated_map_costs.ml carbonated_map_costs.mli carbonated_map.ml carbonated_map.mli + staking_parameters_repr.ml staking_parameters_repr.mli raw_context_intf.ml raw_context.ml raw_context.mli storage_costs.ml storage_costs.mli @@ -698,6 +703,7 @@ token.ml token.mli fees_storage.ml fees_storage.mli adaptive_inflation_storage.ml adaptive_inflation_storage.mli + delegate_staking_parameters.ml delegate_staking_parameters.mli delegate_consensus_key.ml delegate_consensus_key.mli delegate_storage.ml delegate_storage.mli delegate_sampler.ml delegate_sampler.mli @@ -921,6 +927,7 @@ stake_repr.ml stake_repr.mli carbonated_map_costs.ml carbonated_map_costs.mli carbonated_map.ml carbonated_map.mli + staking_parameters_repr.ml staking_parameters_repr.mli raw_context_intf.ml raw_context.ml raw_context.mli storage_costs.ml storage_costs.mli @@ -951,6 +958,7 @@ token.ml token.mli fees_storage.ml fees_storage.mli adaptive_inflation_storage.ml adaptive_inflation_storage.mli + delegate_staking_parameters.ml delegate_staking_parameters.mli delegate_consensus_key.ml delegate_consensus_key.mli delegate_storage.ml delegate_storage.mli delegate_sampler.ml delegate_sampler.mli diff --git a/src/proto_alpha/lib_protocol/staking_parameters_repr.ml b/src/proto_alpha/lib_protocol/staking_parameters_repr.ml new file mode 100644 index 0000000000000000000000000000000000000000..5393f26bfb9bc3de2ff550e07a230f630ca158ed --- /dev/null +++ b/src/proto_alpha/lib_protocol/staking_parameters_repr.ml @@ -0,0 +1,73 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2023 Nomadic Labs *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type t = { + staking_over_baking_limit : int32; (* in 1/1_000_000th *) + baking_over_staking_edge : int32; (* as a portion of 1_000_000_000 *) +} + +let maximum_baking_over_staking_edge = + (* max is 1 expressed in portions of 1_000_000_000 *) + 1_000_000_000l + +type error += Invalid_staking_parameters + +let () = + register_error_kind + `Permanent + ~id:"operations.invalid_staking_parameters" + ~title:"Invalid parameters for staking parameters" + ~description:"The staking parameters are invalid." + ~pp:(fun ppf () -> Format.fprintf ppf "Invalid staking parameters") + Data_encoding.empty + (function Invalid_staking_parameters -> Some () | _ -> None) + (fun () -> Invalid_staking_parameters) + +let make ~staking_over_baking_limit ~baking_over_staking_edge = + if + Compare.Int32.(staking_over_baking_limit < 0l) + || Compare.Int32.(baking_over_staking_edge < 0l) + || Compare.Int32.( + baking_over_staking_edge > maximum_baking_over_staking_edge) + then Error () + else Ok {staking_over_baking_limit; baking_over_staking_edge} + +let encoding = + let open Data_encoding in + conv_with_guard + (fun {staking_over_baking_limit; baking_over_staking_edge} -> + (staking_over_baking_limit, baking_over_staking_edge)) + (fun (staking_over_baking_limit, baking_over_staking_edge) -> + Result.map_error + (fun () -> "Invalid staking parameters") + (make ~staking_over_baking_limit ~baking_over_staking_edge)) + (obj2 + (req "staking_over_baking_limit" int32) + (req "baking_over_staking_edge" int32)) + +let make ~staking_over_baking_limit ~baking_over_staking_edge = + match make ~staking_over_baking_limit ~baking_over_staking_edge with + | Error () -> Result_syntax.tzfail Invalid_staking_parameters + | Ok _ as ok -> ok diff --git a/src/proto_alpha/lib_protocol/staking_parameters_repr.mli b/src/proto_alpha/lib_protocol/staking_parameters_repr.mli new file mode 100644 index 0000000000000000000000000000000000000000..1e371c973c080b10717339cdf661d1da16696d54 --- /dev/null +++ b/src/proto_alpha/lib_protocol/staking_parameters_repr.mli @@ -0,0 +1,38 @@ +(*****************************************************************************) +(* *) +(* Open Source License *) +(* Copyright (c) 2023 Nomadic Labs *) +(* *) +(* Permission is hereby granted, free of charge, to any person obtaining a *) +(* copy of this software and associated documentation files (the "Software"),*) +(* to deal in the Software without restriction, including without limitation *) +(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) +(* and/or sell copies of the Software, and to permit persons to whom the *) +(* Software is furnished to do so, subject to the following conditions: *) +(* *) +(* The above copyright notice and this permission notice shall be included *) +(* in all copies or substantial portions of the Software. *) +(* *) +(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) +(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) +(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) +(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) +(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) +(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) +(* DEALINGS IN THE SOFTWARE. *) +(* *) +(*****************************************************************************) + +type t = private { + staking_over_baking_limit : int32; (* in 1/1_000_000th *) + baking_over_staking_edge : int32; (* as a portion of 1_000_000_000 *) +} + +type error += Invalid_staking_parameters + +val make : + staking_over_baking_limit:int32 -> + baking_over_staking_edge:int32 -> + t tzresult + +val encoding : t Data_encoding.t diff --git a/src/proto_alpha/lib_protocol/storage.ml b/src/proto_alpha/lib_protocol/storage.ml index 13ec99c65698a5948ad38a629e8b8104adcabc37..9eb6815ca16c35f17fc1f3cd499d4b34c66656b0 100644 --- a/src/proto_alpha/lib_protocol/storage.ml +++ b/src/proto_alpha/lib_protocol/storage.ml @@ -293,6 +293,23 @@ module Contract = struct (Make_index (Cycle_repr.Index)) (Signature.Public_key) + module Staking_parameters = + Indexed_context.Make_map + (Registered) + (struct + let name = ["staking_parameters"; "active"] + end) + (Staking_parameters_repr) + + module Pending_staking_parameters = + Make_indexed_data_storage + (Make_subcontext (Registered) (Indexed_context.Raw_context) + (struct + let name = ["staking_parameters"; "pendings"] + end)) + (Make_index (Cycle_repr.Index)) + (Staking_parameters_repr) + module Delegate = Indexed_context.Make_map (Registered) diff --git a/src/proto_alpha/lib_protocol/storage.mli b/src/proto_alpha/lib_protocol/storage.mli index 1d207dcf7c2c5b5da581435ae4b77f19585b1a17..e6c24e52e50dbc179d042bbd8c641f42bd4da8d4 100644 --- a/src/proto_alpha/lib_protocol/storage.mli +++ b/src/proto_alpha/lib_protocol/storage.mli @@ -161,6 +161,18 @@ module Contract : sig and type value = Signature.Public_key_hash.t and type t := Raw_context.t + module Staking_parameters : + Indexed_data_storage + with type key = Contract_repr.t + and type value = Staking_parameters_repr.t + and type t := Raw_context.t + + module Pending_staking_parameters : + Indexed_data_storage + with type key = Cycle_repr.t + and type value = Staking_parameters_repr.t + and type t := Raw_context.t * Contract_repr.t + (** All contracts (implicit and originated) that are delegated, if any *) module Delegated : Data_set_storage