From 87e7f446b3c635cbed8f75a2cc09ca0059692e79 Mon Sep 17 00:00:00 2001 From: Julien Tesson Date: Mon, 5 Jun 2023 22:20:12 +0200 Subject: [PATCH 1/4] Proto/AI: add expected_rewards RPC --- .../adaptive_inflation_services.ml | 73 ++++++++++++++++++- .../adaptive_inflation_services.mli | 14 ++++ 2 files changed, 86 insertions(+), 1 deletion(-) diff --git a/src/proto_alpha/lib_protocol/adaptive_inflation_services.ml b/src/proto_alpha/lib_protocol/adaptive_inflation_services.ml index ae51999b4504..d2e7954bb15e 100644 --- a/src/proto_alpha/lib_protocol/adaptive_inflation_services.ml +++ b/src/proto_alpha/lib_protocol/adaptive_inflation_services.ml @@ -25,6 +25,54 @@ open Alpha_context +type expected_rewards = { + baking_reward_fixed_portion : Tez.t; + baking_reward_bonus_per_slot : Tez.t; + endorsing_reward_per_slot : Tez.t; + liquidity_baking_subsidy : Tez.t; + seed_nonce_revelation_tip : Tez.t; + vdf_revelation_tip : Tez.t; +} + +let expected_rewards_encoding : expected_rewards Data_encoding.t = + let open Data_encoding in + conv + (fun { + baking_reward_fixed_portion; + baking_reward_bonus_per_slot; + endorsing_reward_per_slot; + liquidity_baking_subsidy; + seed_nonce_revelation_tip; + vdf_revelation_tip; + } -> + ( baking_reward_fixed_portion, + baking_reward_bonus_per_slot, + endorsing_reward_per_slot, + liquidity_baking_subsidy, + seed_nonce_revelation_tip, + vdf_revelation_tip )) + (fun ( baking_reward_fixed_portion, + baking_reward_bonus_per_slot, + endorsing_reward_per_slot, + liquidity_baking_subsidy, + seed_nonce_revelation_tip, + vdf_revelation_tip ) -> + { + baking_reward_fixed_portion; + baking_reward_bonus_per_slot; + endorsing_reward_per_slot; + liquidity_baking_subsidy; + seed_nonce_revelation_tip; + vdf_revelation_tip; + }) + (obj6 + (req "baking_reward_fixed_portion" Tez.encoding) + (req "baking_reward_bonus_per_slot" Tez.encoding) + (req "endorsing_reward_per_slot" Tez.encoding) + (req "liquidity_baking_subsidy" Tez.encoding) + (req "seed_nonce_revelation_tip" Tez.encoding) + (req "vdf_revelation_tip" Tez.encoding)) + module S = struct open Data_encoding @@ -86,6 +134,13 @@ module S = struct ~query:RPC_query.empty ~output:(Data_encoding.option Cycle.encoding) RPC_path.(context_path / "adaptive_inflation_launch_cycle") + + let expected_rewards = + RPC_service.get_service + ~description:"Returns the expected rewards for the provided block" + ~query:RPC_query.empty + ~output:expected_rewards_encoding + RPC_path.(path / "expected_rewards") end let q_to_float_string q = @@ -123,6 +178,17 @@ let current_yearly_rate_value ~formatter ctxt = let f = Q.(mul f (100 // 1)) in return (formatter f) +let collect_expected_rewards ~ctxt = + let open Alpha_context.Delegate.Rewards in + { + baking_reward_fixed_portion = baking_reward_fixed_portion ctxt; + baking_reward_bonus_per_slot = baking_reward_bonus_per_slot ctxt; + endorsing_reward_per_slot = endorsing_reward_per_slot ctxt; + liquidity_baking_subsidy = liquidity_baking_subsidy ctxt; + seed_nonce_revelation_tip = seed_nonce_revelation_tip ctxt; + vdf_revelation_tip = vdf_revelation_tip ctxt; + } + let register () = let open Services_registration in let open Lwt_result_syntax in @@ -139,7 +205,9 @@ let register () = let* f = current_rewards_per_minute ctxt in return (Tez.of_mutez_exn (Q.to_int64 f))) ; register0 ~chunked:false S.launch_cycle (fun ctxt () () -> - Adaptive_inflation.launch_cycle ctxt) + Adaptive_inflation.launch_cycle ctxt) ; + register0 ~chunked:false S.expected_rewards (fun ctxt () () -> + return @@ collect_expected_rewards ~ctxt) let total_supply ctxt block = RPC_context.make_call0 S.total_supply ctxt block () () @@ -158,3 +226,6 @@ let current_rewards_per_minute ctxt block = let launch_cycle ctxt block = RPC_context.make_call0 S.launch_cycle ctxt block () () + +let expected_rewards ctxt block = + RPC_context.make_call0 S.expected_rewards ctxt block () () diff --git a/src/proto_alpha/lib_protocol/adaptive_inflation_services.mli b/src/proto_alpha/lib_protocol/adaptive_inflation_services.mli index bf9af6235016..5d71a23686cf 100644 --- a/src/proto_alpha/lib_protocol/adaptive_inflation_services.mli +++ b/src/proto_alpha/lib_protocol/adaptive_inflation_services.mli @@ -25,6 +25,17 @@ open Alpha_context +type expected_rewards = { + baking_reward_fixed_portion : Tez.t; + baking_reward_bonus_per_slot : Tez.t; + endorsing_reward_per_slot : Tez.t; + liquidity_baking_subsidy : Tez.t; + seed_nonce_revelation_tip : Tez.t; + vdf_revelation_tip : Tez.t; +} + +val expected_rewards_encoding : expected_rewards Data_encoding.t + val total_supply : 'a #RPC_context.simple -> 'a -> Tez.t shell_tzresult Lwt.t val total_frozen_stake : @@ -42,4 +53,7 @@ val current_rewards_per_minute : val launch_cycle : 'a #RPC_context.simple -> 'a -> Cycle.t option shell_tzresult Lwt.t +val expected_rewards : + 'a #RPC_context.simple -> 'a -> expected_rewards shell_tzresult Lwt.t + val register : unit -> unit -- GitLab From a993d1b6365eb5e6cf388567d3d275e07e00cca5 Mon Sep 17 00:00:00 2001 From: Julien Tesson Date: Wed, 7 Jun 2023 17:17:53 +0200 Subject: [PATCH 2/4] Proto/delegate_rewards: expose `reward_from_constants` --- src/proto_alpha/lib_protocol/alpha_context.ml | 6 +++++- src/proto_alpha/lib_protocol/alpha_context.mli | 4 +--- src/proto_alpha/lib_protocol/delegate_rewards.ml | 2 +- src/proto_alpha/lib_protocol/delegate_rewards.mli | 5 ++--- src/proto_alpha/lib_protocol/test/helpers/context.ml | 12 ++++++------ .../test/helpers/liquidity_baking_machine.ml | 2 +- .../integration/consensus/test_double_endorsement.ml | 2 +- .../test/integration/consensus/test_participation.ml | 2 +- .../lib_protocol/test/integration/test_constants.ml | 3 +-- .../test/unit/test_adaptive_inflation.ml | 4 ++-- 10 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/proto_alpha/lib_protocol/alpha_context.ml b/src/proto_alpha/lib_protocol/alpha_context.ml index 4651916dc507..f7e302b37e08 100644 --- a/src/proto_alpha/lib_protocol/alpha_context.ml +++ b/src/proto_alpha/lib_protocol/alpha_context.ml @@ -502,7 +502,11 @@ module Delegate = struct module Rewards = struct include Delegate_rewards - module For_RPC = Adaptive_inflation_storage.For_RPC + + module For_RPC = struct + include Delegate_rewards.For_RPC + include Adaptive_inflation_storage.For_RPC + end end module Staking_parameters = Delegate_staking_parameters diff --git a/src/proto_alpha/lib_protocol/alpha_context.mli b/src/proto_alpha/lib_protocol/alpha_context.mli index 29fb401c72f3..c77f949a0bad 100644 --- a/src/proto_alpha/lib_protocol/alpha_context.mli +++ b/src/proto_alpha/lib_protocol/alpha_context.mli @@ -2229,7 +2229,7 @@ module Delegate : sig val vdf_revelation_tip : t -> Tez.t - module Internal_for_tests : sig + module For_RPC : sig type reward_kind = | Baking_reward_fixed_portion | Baking_reward_bonus_per_slot @@ -2246,9 +2246,7 @@ module Delegate : sig coeff * reward_from_constants csts ~reward_kind]. *) val reward_from_constants : ?coeff:Q.t -> Constants.Parametric.t -> reward_kind:reward_kind -> Tez.t - end - module For_RPC : sig (** [get_reward_coeff ctxt cycle] reads the reward coeff for the given cycle from the storage. Returns [Q.one] if the given cycle is not between [current_cycle] and diff --git a/src/proto_alpha/lib_protocol/delegate_rewards.ml b/src/proto_alpha/lib_protocol/delegate_rewards.ml index b19f87406ce7..047ecbe19c01 100644 --- a/src/proto_alpha/lib_protocol/delegate_rewards.ml +++ b/src/proto_alpha/lib_protocol/delegate_rewards.ml @@ -138,7 +138,7 @@ let seed_nonce_revelation_tip ctxt = let vdf_revelation_tip ctxt = reward_from_context ~ctxt ~reward_kind:Vdf_revelation_tip -module Internal_for_tests = struct +module For_RPC = struct include M let reward_from_constants ?(coeff = Q.one) diff --git a/src/proto_alpha/lib_protocol/delegate_rewards.mli b/src/proto_alpha/lib_protocol/delegate_rewards.mli index b595c3cee251..147464458177 100644 --- a/src/proto_alpha/lib_protocol/delegate_rewards.mli +++ b/src/proto_alpha/lib_protocol/delegate_rewards.mli @@ -37,8 +37,7 @@ val seed_nonce_revelation_tip : Raw_context.t -> Tez_repr.t val vdf_revelation_tip : Raw_context.t -> Tez_repr.t -(* For testing purposes *) -module Internal_for_tests : sig +module For_RPC : sig type reward_kind = | Baking_reward_fixed_portion | Baking_reward_bonus_per_slot @@ -52,7 +51,7 @@ module Internal_for_tests : sig given parameters in [csts]. The (optional) value [coeff] is a multiplicative factor applied to the rewards (default = 1). It verifies [reward_from_constants ~coeff csts ~reward_kind = - coeff * reward_from_constants csts ~reward_kind]. *) + coeff * reward_from_constants csts ~reward_kind].*) val reward_from_constants : ?coeff:Q.t -> Constants_parametric_repr.t -> diff --git a/src/proto_alpha/lib_protocol/test/helpers/context.ml b/src/proto_alpha/lib_protocol/test/helpers/context.ml index efa5c710e73d..5fa502f6e5e3 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/context.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/context.ml @@ -205,7 +205,7 @@ let default_test_constants = let get_baking_reward_fixed_portion ctxt = get_constants ctxt >>=? fun {Constants.parametric = csts; _} -> return - (Delegate.Rewards.Internal_for_tests.reward_from_constants + (Delegate.Rewards.For_RPC.reward_from_constants csts ~reward_kind:Baking_reward_fixed_portion) @@ -213,7 +213,7 @@ let get_bonus_reward ctxt ~endorsing_power = get_constants ctxt >>=? fun {Constants.parametric = {consensus_threshold; _} as csts; _} -> let baking_reward_bonus_per_slot = - Delegate.Rewards.Internal_for_tests.reward_from_constants + Delegate.Rewards.For_RPC.reward_from_constants csts ~reward_kind:Baking_reward_bonus_per_slot in @@ -223,7 +223,7 @@ let get_bonus_reward ctxt ~endorsing_power = let get_endorsing_reward ctxt ~expected_endorsing_power = get_constants ctxt >>=? fun {Constants.parametric = csts; _} -> let endorsing_reward_per_slot = - Delegate.Rewards.Internal_for_tests.reward_from_constants + Delegate.Rewards.For_RPC.reward_from_constants csts ~reward_kind:Endorsing_reward_per_slot in @@ -234,7 +234,7 @@ let get_endorsing_reward ctxt ~expected_endorsing_power = let get_liquidity_baking_subsidy ctxt = get_constants ctxt >>=? fun {Constants.parametric = csts; _} -> return - (Delegate.Rewards.Internal_for_tests.reward_from_constants + (Delegate.Rewards.For_RPC.reward_from_constants csts ~reward_kind:Liquidity_baking_subsidy) @@ -247,14 +247,14 @@ let get_adaptive_inflation_launch_cycle ctxt = let get_seed_nonce_revelation_tip ctxt = get_constants ctxt >>=? fun {Constants.parametric = csts; _} -> return - (Delegate.Rewards.Internal_for_tests.reward_from_constants + (Delegate.Rewards.For_RPC.reward_from_constants csts ~reward_kind:Seed_nonce_revelation_tip) let get_vdf_revelation_tip ctxt = get_constants ctxt >>=? fun {Constants.parametric = csts; _} -> return - (Delegate.Rewards.Internal_for_tests.reward_from_constants + (Delegate.Rewards.For_RPC.reward_from_constants csts ~reward_kind:Vdf_revelation_tip) diff --git a/src/proto_alpha/lib_protocol/test/helpers/liquidity_baking_machine.ml b/src/proto_alpha/lib_protocol/test/helpers/liquidity_baking_machine.ml index e1fa246720ac..a3e8ca8b75bd 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/liquidity_baking_machine.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/liquidity_baking_machine.ml @@ -381,7 +381,7 @@ let default_subsidy = let open Tezos_protocol_alpha_parameters in let c = Default_parameters.constants_test in Tez.to_mutez - @@ Delegate.Rewards.Internal_for_tests.reward_from_constants + @@ Delegate.Rewards.For_RPC.reward_from_constants c ~reward_kind:Liquidity_baking_subsidy diff --git a/src/proto_alpha/lib_protocol/test/integration/consensus/test_double_endorsement.ml b/src/proto_alpha/lib_protocol/test/integration/consensus/test_double_endorsement.ml index 605112dffa9e..8965fd55cc9d 100644 --- a/src/proto_alpha/lib_protocol/test/integration/consensus/test_double_endorsement.ml +++ b/src/proto_alpha/lib_protocol/test/integration/consensus/test_double_endorsement.ml @@ -119,7 +119,7 @@ let test_valid_double_endorsement_evidence () = - baking_reward_fixed_portion for baking and, - half of the frozen_deposits for including the evidence *) let baking_reward = - Delegate.Rewards.Internal_for_tests.reward_from_constants + Delegate.Rewards.For_RPC.reward_from_constants csts.parametric ~reward_kind:Baking_reward_fixed_portion in diff --git a/src/proto_alpha/lib_protocol/test/integration/consensus/test_participation.ml b/src/proto_alpha/lib_protocol/test/integration/consensus/test_participation.ml index 366978870f44..1a8375fb12d1 100644 --- a/src/proto_alpha/lib_protocol/test/integration/consensus/test_participation.ml +++ b/src/proto_alpha/lib_protocol/test/integration/consensus/test_participation.ml @@ -138,7 +138,7 @@ let test_participation_rpc () = in let allowed_missed_slots = expected_cycle_activity - minimal_cycle_activity in let endorsing_reward_per_slot = - Alpha_context.Delegate.Rewards.Internal_for_tests.reward_from_constants + Alpha_context.Delegate.Rewards.For_RPC.reward_from_constants csts.parametric ~reward_kind:Endorsing_reward_per_slot in diff --git a/src/proto_alpha/lib_protocol/test/integration/test_constants.ml b/src/proto_alpha/lib_protocol/test/integration/test_constants.ml index aa4c07a207f0..b348d4c1ec9e 100644 --- a/src/proto_alpha/lib_protocol/test/integration/test_constants.ml +++ b/src/proto_alpha/lib_protocol/test/integration/test_constants.ml @@ -179,8 +179,7 @@ let test_sc_rollup_max_commitment_storage_size () = let liquidity_baking_subsidy_param () = let constants = Default_parameters.constants_mainnet in let get_reward = - Protocol.Alpha_context.Delegate.Rewards.Internal_for_tests - .reward_from_constants + Protocol.Alpha_context.Delegate.Rewards.For_RPC.reward_from_constants constants in let baking_reward_bonus_per_slot = diff --git a/src/proto_alpha/lib_protocol/test/unit/test_adaptive_inflation.ml b/src/proto_alpha/lib_protocol/test/unit/test_adaptive_inflation.ml index 9ccf5e6521a4..4362b4307844 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_adaptive_inflation.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_adaptive_inflation.ml @@ -37,11 +37,11 @@ open Alpha_context let test_reward_coefficient () = let csts = Default_parameters.constants_test in let default = - Delegate.Rewards.Internal_for_tests.( + Delegate.Rewards.For_RPC.( reward_from_constants csts ~reward_kind:Baking_reward_fixed_portion) in let default_times_4 = - Delegate.Rewards.Internal_for_tests.( + Delegate.Rewards.For_RPC.( reward_from_constants ~coeff:(Q.of_int 4) csts -- GitLab From 9ac142cbbfc076790936a7906ad23697157e4028 Mon Sep 17 00:00:00 2001 From: Lucas Randazzo Date: Fri, 9 Jun 2023 11:27:01 +0200 Subject: [PATCH 3/4] Proto/Alpha: extract Cycle.---> --- src/proto_alpha/lib_protocol/alpha_context.mli | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/proto_alpha/lib_protocol/alpha_context.mli b/src/proto_alpha/lib_protocol/alpha_context.mli index c77f949a0bad..e16241b44d3d 100644 --- a/src/proto_alpha/lib_protocol/alpha_context.mli +++ b/src/proto_alpha/lib_protocol/alpha_context.mli @@ -275,6 +275,8 @@ module Cycle : sig val to_int32 : cycle -> int32 + val ( ---> ) : cycle -> cycle -> cycle list + module Map : Map.S with type key = cycle end -- GitLab From b4343d36e9d08b9b0b9b0072d0f3cee215a6a44e Mon Sep 17 00:00:00 2001 From: Julien Tesson Date: Tue, 6 Jun 2023 20:51:47 +0200 Subject: [PATCH 4/4] Proto/adaptive_inflation_services: rewards for future cycles --- .../adaptive_inflation_services.ml | 87 +++++++++++++++---- .../adaptive_inflation_services.mli | 5 +- 2 files changed, 76 insertions(+), 16 deletions(-) diff --git a/src/proto_alpha/lib_protocol/adaptive_inflation_services.ml b/src/proto_alpha/lib_protocol/adaptive_inflation_services.ml index d2e7954bb15e..201bb542705a 100644 --- a/src/proto_alpha/lib_protocol/adaptive_inflation_services.ml +++ b/src/proto_alpha/lib_protocol/adaptive_inflation_services.ml @@ -26,6 +26,7 @@ open Alpha_context type expected_rewards = { + cycle : Cycle.t; baking_reward_fixed_portion : Tez.t; baking_reward_bonus_per_slot : Tez.t; endorsing_reward_per_slot : Tez.t; @@ -38,6 +39,7 @@ let expected_rewards_encoding : expected_rewards Data_encoding.t = let open Data_encoding in conv (fun { + cycle; baking_reward_fixed_portion; baking_reward_bonus_per_slot; endorsing_reward_per_slot; @@ -45,19 +47,22 @@ let expected_rewards_encoding : expected_rewards Data_encoding.t = seed_nonce_revelation_tip; vdf_revelation_tip; } -> - ( baking_reward_fixed_portion, + ( cycle, + baking_reward_fixed_portion, baking_reward_bonus_per_slot, endorsing_reward_per_slot, liquidity_baking_subsidy, seed_nonce_revelation_tip, vdf_revelation_tip )) - (fun ( baking_reward_fixed_portion, + (fun ( cycle, + baking_reward_fixed_portion, baking_reward_bonus_per_slot, endorsing_reward_per_slot, liquidity_baking_subsidy, seed_nonce_revelation_tip, vdf_revelation_tip ) -> { + cycle; baking_reward_fixed_portion; baking_reward_bonus_per_slot; endorsing_reward_per_slot; @@ -65,7 +70,8 @@ let expected_rewards_encoding : expected_rewards Data_encoding.t = seed_nonce_revelation_tip; vdf_revelation_tip; }) - (obj6 + (obj7 + (req "cycle" Cycle.encoding) (req "baking_reward_fixed_portion" Tez.encoding) (req "baking_reward_bonus_per_slot" Tez.encoding) (req "endorsing_reward_per_slot" Tez.encoding) @@ -137,9 +143,11 @@ module S = struct let expected_rewards = RPC_service.get_service - ~description:"Returns the expected rewards for the provided block" + ~description: + "Returns the expected rewards for the provided block and the next five \ + cycles" ~query:RPC_query.empty - ~output:expected_rewards_encoding + ~output:(Data_encoding.list expected_rewards_encoding) RPC_path.(path / "expected_rewards") end @@ -179,15 +187,64 @@ let current_yearly_rate_value ~formatter ctxt = return (formatter f) let collect_expected_rewards ~ctxt = - let open Alpha_context.Delegate.Rewards in - { - baking_reward_fixed_portion = baking_reward_fixed_portion ctxt; - baking_reward_bonus_per_slot = baking_reward_bonus_per_slot ctxt; - endorsing_reward_per_slot = endorsing_reward_per_slot ctxt; - liquidity_baking_subsidy = liquidity_baking_subsidy ctxt; - seed_nonce_revelation_tip = seed_nonce_revelation_tip ctxt; - vdf_revelation_tip = vdf_revelation_tip ctxt; - } + let open Lwt_result_syntax in + let open Delegate.Rewards in + let ctxt_cycle = (Level.current ctxt).cycle in + let csts = (Constants.all ctxt).parametric in + let reward_of_cycle cycle = + if Cycle.(cycle = ctxt_cycle) then + return + { + cycle; + baking_reward_fixed_portion = baking_reward_fixed_portion ctxt; + baking_reward_bonus_per_slot = baking_reward_bonus_per_slot ctxt; + endorsing_reward_per_slot = endorsing_reward_per_slot ctxt; + liquidity_baking_subsidy = liquidity_baking_subsidy ctxt; + seed_nonce_revelation_tip = seed_nonce_revelation_tip ctxt; + vdf_revelation_tip = vdf_revelation_tip ctxt; + } + else + (* This coeff is correct only when applied to Cycle lesser than + [preserved_cycles] after the current context, otherwise the coeff will + not be set and thus we get the default values. *) + let open Delegate.Rewards.For_RPC in + let* coeff = get_reward_coeff ctxt ~cycle in + return + { + cycle; + baking_reward_fixed_portion = + reward_from_constants + ~coeff + csts + ~reward_kind:Baking_reward_fixed_portion; + baking_reward_bonus_per_slot = + reward_from_constants + ~coeff + csts + ~reward_kind:Baking_reward_bonus_per_slot; + endorsing_reward_per_slot = + reward_from_constants + ~coeff + csts + ~reward_kind:Endorsing_reward_per_slot; + liquidity_baking_subsidy = + reward_from_constants + ~coeff + csts + ~reward_kind:Liquidity_baking_subsidy; + seed_nonce_revelation_tip = + reward_from_constants + ~coeff + csts + ~reward_kind:Seed_nonce_revelation_tip; + vdf_revelation_tip = + reward_from_constants ~coeff csts ~reward_kind:Vdf_revelation_tip; + } + in + let queried_cycles = + Cycle.(ctxt_cycle ---> add ctxt_cycle csts.preserved_cycles) + in + List.map_es reward_of_cycle queried_cycles let register () = let open Services_registration in @@ -207,7 +264,7 @@ let register () = register0 ~chunked:false S.launch_cycle (fun ctxt () () -> Adaptive_inflation.launch_cycle ctxt) ; register0 ~chunked:false S.expected_rewards (fun ctxt () () -> - return @@ collect_expected_rewards ~ctxt) + collect_expected_rewards ~ctxt) let total_supply ctxt block = RPC_context.make_call0 S.total_supply ctxt block () () diff --git a/src/proto_alpha/lib_protocol/adaptive_inflation_services.mli b/src/proto_alpha/lib_protocol/adaptive_inflation_services.mli index 5d71a23686cf..81b8b5a488ff 100644 --- a/src/proto_alpha/lib_protocol/adaptive_inflation_services.mli +++ b/src/proto_alpha/lib_protocol/adaptive_inflation_services.mli @@ -26,6 +26,7 @@ open Alpha_context type expected_rewards = { + cycle : Cycle.t; baking_reward_fixed_portion : Tez.t; baking_reward_bonus_per_slot : Tez.t; endorsing_reward_per_slot : Tez.t; @@ -53,7 +54,9 @@ val current_rewards_per_minute : val launch_cycle : 'a #RPC_context.simple -> 'a -> Cycle.t option shell_tzresult Lwt.t +(** Returns the list of expected rewards for the current cycle and for the next + [preserved_cycles] cycles. *) val expected_rewards : - 'a #RPC_context.simple -> 'a -> expected_rewards shell_tzresult Lwt.t + 'a #RPC_context.simple -> 'a -> expected_rewards list shell_tzresult Lwt.t val register : unit -> unit -- GitLab