From 95dd0f5c2abeaa3702f4f1c8ca5f4a63f22b58f6 Mon Sep 17 00:00:00 2001 From: Albin Coquereau Date: Fri, 18 Aug 2023 16:54:33 +0200 Subject: [PATCH 1/5] alpha: remove endorsing_rights RPC --- src/proto_alpha/lib_plugin/RPC.ml | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/src/proto_alpha/lib_plugin/RPC.ml b/src/proto_alpha/lib_plugin/RPC.ml index f68aa41c113e..5583b0edd38b 100644 --- a/src/proto_alpha/lib_plugin/RPC.ml +++ b/src/proto_alpha/lib_plugin/RPC.ml @@ -3511,8 +3511,6 @@ module Attestation_rights = struct let attestation_path = RPC_path.(path / "attestation_rights") - let endorsing_path = RPC_path.(path / "endorsing_rights") - type attestation_rights_query = { levels : Raw_level.t list; cycle : Cycle.t option; @@ -3553,32 +3551,6 @@ module Attestation_rights = struct ~query:attestation_rights_query ~output:(list (encoding ~use_legacy_attestation_name:false)) attestation_path - - (* TODO: https://gitlab.com/tezos/tezos/-/issues/5156 - endorsing_rights RPC should be removed once the depreciation period - will be over *) - let endorsing_rights = - RPC_service.get_service - ~description: - "Deprecated: use `attestation_rights` instead.\n\ - Retrieves the delegates allowed to endorse a block.\n\ - By default, it gives the endorsing power for delegates that have at \ - least one endorsing slot for the next block.\n\ - Parameters `level` and `cycle` can be used to specify the (valid) \ - level(s) in the past or future at which the endorsing rights have \ - to be returned. Parameter `delegate` can be used to restrict the \ - results to the given delegates.\n\ - Parameter `consensus_key` can be used to restrict the results to \ - the given consensus_keys. \n\ - Returns the smallest endorsing slots and the endorsing power. Also \ - returns the minimal timestamp that corresponds to endorsing at the \ - given level. The timestamps are omitted for levels in the past, and \ - are only estimates for levels higher that the next block's, based \ - on the hypothesis that all predecessor blocks were baked at the \ - first round." - ~query:attestation_rights_query - ~output:(list (encoding ~use_legacy_attestation_name:true)) - endorsing_path end let attestation_rights_at_level ctxt level = @@ -3649,8 +3621,6 @@ module Attestation_rights = struct let register () = Registration.register0 ~chunked:true S.attestation_rights (fun ctxt q () -> - get_attestation_rights ctxt q) ; - Registration.register0 ~chunked:true S.endorsing_rights (fun ctxt q () -> get_attestation_rights ctxt q) let get ctxt ?(levels = []) ?cycle ?(delegates = []) ?(consensus_keys = []) -- GitLab From d9d5ad5f0b829d3eaad47e1fd16c3a8d23b036e3 Mon Sep 17 00:00:00 2001 From: Albin Coquereau Date: Mon, 21 Aug 2023 11:43:27 +0200 Subject: [PATCH 2/5] tezt/tests: adapt attestation_rights tests --- tezt/tests/light.ml | 8 ++-- tezt/tests/proxy.ml | 80 ++++++++++++++++++++------------- tezt/tests/proxy_server_test.ml | 29 ++++++------ 3 files changed, 68 insertions(+), 49 deletions(-) diff --git a/tezt/tests/light.ml b/tezt/tests/light.ml index b2ff211ac5af..aa1e1a28a16d 100644 --- a/tezt/tests/light.ml +++ b/tezt/tests/light.ml @@ -224,7 +224,7 @@ module NoUselessRpc = struct (["helpers"; "baking_rights"], [("all", "true")]); (["context"; "delegates"], []); (["context"; "nonces"; "3"], []); - (["helpers"; "endorsing_rights"], []); + (["helpers"; "attestation_rights"], []); (["votes"; "ballot_list"], []); (["votes"; "ballots"], []); (["votes"; "current_period"], []); @@ -235,8 +235,8 @@ module NoUselessRpc = struct ] in let paths = - if Protocol.(number protocol > number Nairobi) then - (["helpers"; "attestation_rights"], []) :: paths + if Protocol.(number protocol <= number Oxford) then + (["helpers"; "endorsing_rights"], []) :: paths else paths in Lwt_list.iter_s @@ -286,7 +286,7 @@ let test_compare_light = let tz_log = [("proxy_rpc", "debug"); ("light_mode", "debug"); ("proxy_getter", "debug")] in - check_equivalence ~tz_log alt_mode clients + check_equivalence ~protocol ~tz_log alt_mode clients let register_protocol_independent () = test_no_endpoint () ; diff --git a/tezt/tests/proxy.ml b/tezt/tests/proxy.ml index 0ee90bbf6909..ca970c36b5be 100644 --- a/tezt/tests/proxy.ml +++ b/tezt/tests/proxy.ml @@ -50,7 +50,7 @@ let init ~protocol () = This test checks that the proxy client creates its cache for RPC answers at most once for a given (chain, block) pair. *) -let test_cache_at_most_once ?query_string path = +let test_cache_at_most_once ?supports ?query_string path = Protocol.register_test ~__FILE__ ~title: @@ -58,6 +58,7 @@ let test_cache_at_most_once ?query_string path = "(Proxy) (%s) Cache at most once" (Client.rpc_path_query_to_string ?query_string path)) ~tags:["proxy"; "rpc"; "get"] + ?supports @@ fun protocol -> let* _, client = init ~protocol () in let env = @@ -124,6 +125,7 @@ let test_cache_at_most_once ~protocols = [ (["helpers"; "baking_rights"], []); (["helpers"; "baking_rights"], [("all", "true")]); + (["helpers"; "attestation_rights"], []); (["helpers"; "current_level"], []); (* FIXME: Same as above *) (* (["minimal_valid_time"], []); *) @@ -131,7 +133,6 @@ let test_cache_at_most_once ~protocols = (["context"; "constants"; "errors"], []); (["context"; "delegates"], []); (["context"; "nonces"; "3"], []); - (["helpers"; "endorsing_rights"], []); (["helpers"; "levels_in_current_cycle"], []); (["votes"; "current_period"], []); (["votes"; "successor_period"], []); @@ -147,6 +148,15 @@ let test_cache_at_most_once ~protocols = List.iter (fun (sub_path, query_string) -> test_cache_at_most_once + ~supports:Protocol.(Until_protocol (number Oxford)) + ~query_string + ("chains" :: "main" :: "blocks" :: "head" :: sub_path) + protocols) + ((["helpers"; "endorsing_rights"], []) :: paths) ; + List.iter + (fun (sub_path, query_string) -> + test_cache_at_most_once + ~supports:Protocol.(From_protocol 019) ~query_string ("chains" :: "main" :: "blocks" :: "head" :: sub_path) protocols) @@ -246,7 +256,7 @@ let paths = (["context"; "contracts"], []); (["context"; "delegates"], []); (["context"; "nonces"; "3"], []); - (["helpers"; "endorsing_rights"], []); + (["helpers"; "attestation_rights"], []); (["votes"; "current_period"], []); (["votes"; "successor_period"], []); (["votes"; "total_voting_power"], []); @@ -261,6 +271,11 @@ let paths = let test_context_suffix_no_rpc ~protocols = let iter l f = List.iter f l in iter protocols @@ fun protocol -> + let paths = + if Protocol.(number protocol <= number Oxford) then + (["helpers"; "endorsing_rights"], []) :: paths + else paths + in iter paths @@ fun (sub_path, query_string) -> test_context_suffix_no_rpc ~query_string @@ -493,37 +508,42 @@ module Location = struct (** Check the output of [rpc get] on a number on RPC between two clients are equivalent. One of them is a vanilla client ([--mode client]) while the other client uses an alternative mode ([--mode proxy]). *) - let check_equivalence ?tz_log alt_mode {vanilla; alternative} = + let check_equivalence ~protocol ?tz_log alt_mode {vanilla; alternative} = let alt_mode_string = alt_mode_to_string alt_mode in let compared = let add_rpc_path_prefix rpc_path = "chains" :: chain_id :: "blocks" :: block_id :: rpc_path in - [ - (add_rpc_path_prefix ["context"; "constants"], []); - (add_rpc_path_prefix ["context"; "constants"; "errors"], []); - (add_rpc_path_prefix ["context"; "delegates"], []); - (add_rpc_path_prefix ["context"; "nonces"; "3"], []); - (add_rpc_path_prefix ["helpers"; "baking_rights"], []); - (add_rpc_path_prefix ["helpers"; "baking_rights"], [("all", "true")]); - (add_rpc_path_prefix ["helpers"; "current_level"], []); - (add_rpc_path_prefix ["helpers"; "endorsing_rights"], []); - (add_rpc_path_prefix ["helpers"; "levels_in_current_cycle"], []); - (* The 2 following RPCs only exist on Alpha *) - (* (add_rpc_path_prefix ["helpers"; "validators"], []); *) - (* (add_rpc_path_prefix ["helpers"; "round"], []); *) - (add_rpc_path_prefix ["votes"; "current_period"], []); - (add_rpc_path_prefix ["votes"; "successor_period"], []); - (add_rpc_path_prefix ["votes"; "total_voting_power"], []); - (add_rpc_path_prefix ["votes"; "ballot_list"], []); - (add_rpc_path_prefix ["votes"; "ballots"], []); - (add_rpc_path_prefix ["votes"; "current_proposal"], []); - (add_rpc_path_prefix ["votes"; "current_period"], []); - (add_rpc_path_prefix ["votes"; "successor_period"], []); - (add_rpc_path_prefix ["votes"; "current_quorum"], []); - (add_rpc_path_prefix ["votes"; "listings"], []); - (add_rpc_path_prefix ["votes"; "proposals"], []); - ] + let compared = + [ + (add_rpc_path_prefix ["context"; "constants"], []); + (add_rpc_path_prefix ["context"; "constants"; "errors"], []); + (add_rpc_path_prefix ["context"; "delegates"], []); + (add_rpc_path_prefix ["context"; "nonces"; "3"], []); + (add_rpc_path_prefix ["helpers"; "baking_rights"], []); + (add_rpc_path_prefix ["helpers"; "baking_rights"], [("all", "true")]); + (add_rpc_path_prefix ["helpers"; "current_level"], []); + (add_rpc_path_prefix ["helpers"; "attestation_rights"], []); + (add_rpc_path_prefix ["helpers"; "levels_in_current_cycle"], []); + (* The 2 following RPCs only exist on Alpha *) + (* (add_rpc_path_prefix ["helpers"; "validators"], []); *) + (* (add_rpc_path_prefix ["helpers"; "round"], []); *) + (add_rpc_path_prefix ["votes"; "current_period"], []); + (add_rpc_path_prefix ["votes"; "successor_period"], []); + (add_rpc_path_prefix ["votes"; "total_voting_power"], []); + (add_rpc_path_prefix ["votes"; "ballot_list"], []); + (add_rpc_path_prefix ["votes"; "ballots"], []); + (add_rpc_path_prefix ["votes"; "current_proposal"], []); + (add_rpc_path_prefix ["votes"; "current_period"], []); + (add_rpc_path_prefix ["votes"; "successor_period"], []); + (add_rpc_path_prefix ["votes"; "current_quorum"], []); + (add_rpc_path_prefix ["votes"; "listings"], []); + (add_rpc_path_prefix ["votes"; "proposals"], []); + ] + in + if Protocol.(number protocol <= number Oxford) then + (add_rpc_path_prefix ["helpers"; "endorsing_rights"], []) :: compared + else compared in let perform (rpc_path, query_string) = let* vanilla_out, vanilla_err = @@ -604,7 +624,7 @@ module Location = struct let* node, alternative = init ~protocol () in let* vanilla = Client.init ~endpoint:(Node node) () in let clients = {vanilla; alternative} in - check_equivalence alt_mode clients + check_equivalence ~protocol alt_mode clients end module Equalable_String_set : Check.EQUALABLE with type t = String_set.t = diff --git a/tezt/tests/proxy_server_test.ml b/tezt/tests/proxy_server_test.ml index 0e9d660e2733..76afadd93d7f 100644 --- a/tezt/tests/proxy_server_test.ml +++ b/tezt/tests/proxy_server_test.ml @@ -204,7 +204,7 @@ let test_equivalence = let vanilla = Client.create ~endpoint:(Node node) () in let clients = {vanilla; alternative} in let tz_log = [("proxy_rpc", "debug"); ("proxy_getter", "debug")] in - check_equivalence ~tz_log alt_mode clients + check_equivalence ~protocol ~tz_log alt_mode clients let test_wrong_data_dir = Protocol.register_test @@ -286,22 +286,21 @@ let test_multi_protocols = protocol test, expected %%L instead of %%R" __LOC__)) in - let* () = - if Protocol.(number proto > number Nairobi) then ( - let* proto_attestation_rights = - RPC.Client.call client - @@ RPC.get_chain_block_helper_attestation_rights ?block () - in - check proto_attestation_rights ; - unit) - else unit - in - let* proto_endorsing_rights = + let* proto_attestation_rights = RPC.Client.call client - @@ RPC.get_chain_block_helper_endorsing_rights ?block () + @@ RPC.get_chain_block_helper_attestation_rights ?block () in - check proto_endorsing_rights ; - unit + check proto_attestation_rights ; + if Protocol.(number proto <= number Oxford) then ( + let* proto_endorsing_rights = + RPC.Client.call client + @@ RPC.get_chain_block_helper_endorsing_rights ?block () + (* TODO: https://gitlab.com/tezos/tezos/-/issues/6227 + This RPC helper should be removed once Oxford will be frozen. *) + in + check proto_endorsing_rights ; + unit) + else unit in (* Ensure the proxy serves a query to a block in [to_protocol] *) let* () = -- GitLab From 972c06dc041acdb07d426d6a1af74aed057b6bed Mon Sep 17 00:00:00 2001 From: Albin Coquereau Date: Mon, 21 Aug 2023 12:13:20 +0200 Subject: [PATCH 3/5] tezt/tests: adapt attestation_rights regression tests --- tezt/tests/RPC_test.ml | 31 +++++++++++-------- ...t) RPC regression tests- misc_protocol.out | 26 ---------------- ...t) RPC regression tests- misc_protocol.out | 26 ---------------- ...y) RPC regression tests- misc_protocol.out | 26 ---------------- ...r) RPC regression tests- misc_protocol.out | 26 ---------------- ...c) RPC regression tests- misc_protocol.out | 26 ---------------- ...t) RPC regression tests- misc_protocol.out | 26 ++++++++++++++++ ...t) RPC regression tests- misc_protocol.out | 26 ++++++++++++++++ ...y) RPC regression tests- misc_protocol.out | 26 ++++++++++++++++ ...r) RPC regression tests- misc_protocol.out | 26 ++++++++++++++++ ...c) RPC regression tests- misc_protocol.out | 26 ++++++++++++++++ 11 files changed, 148 insertions(+), 143 deletions(-) diff --git a/tezt/tests/RPC_test.ml b/tezt/tests/RPC_test.ml index 374fe0ade312..53851ebbf2e2 100644 --- a/tezt/tests/RPC_test.ml +++ b/tezt/tests/RPC_test.ml @@ -674,31 +674,36 @@ let test_misc_protocol _test_mode_tag protocol ?endpoint client = RPC.Client.call ?endpoint ~hooks client @@ RPC.get_chain_block_helper_current_level () in - let* _ = - RPC.Client.call ?endpoint ~hooks client - @@ RPC.get_chain_block_helper_endorsing_rights () - in - let* _ = - RPC.Client.call ?endpoint ~hooks client - @@ RPC.get_chain_block_helper_endorsing_rights - ~delegate:Constant.bootstrap4.public_key_hash - () - in let* () = - if Protocol.(number protocol > number Nairobi) then + if Protocol.(number protocol <= number Oxford) then let* _ = RPC.Client.call ?endpoint ~hooks client - @@ RPC.get_chain_block_helper_attestation_rights () + @@ RPC.get_chain_block_helper_endorsing_rights () + (* TODO: https://gitlab.com/tezos/tezos/-/issues/6227 + This RPC helper should be removed once Oxford will be frozen. *) in let* _ = RPC.Client.call ?endpoint ~hooks client - @@ RPC.get_chain_block_helper_attestation_rights + @@ RPC.get_chain_block_helper_endorsing_rights ~delegate:Constant.bootstrap4.public_key_hash () in unit else unit in + let* () = + let* _ = + RPC.Client.call ?endpoint ~hooks client + @@ RPC.get_chain_block_helper_attestation_rights () + in + let* _ = + RPC.Client.call ?endpoint ~hooks client + @@ RPC.get_chain_block_helper_attestation_rights + ~delegate:Constant.bootstrap4.public_key_hash + () + in + unit + in let* _ = RPC.Client.call ?endpoint ~hooks client @@ RPC.get_chain_block_helper_levels_in_current_cycle () diff --git a/tezt/tests/expected/RPC_test.ml/Alpha- (mode client) RPC regression tests- misc_protocol.out b/tezt/tests/expected/RPC_test.ml/Alpha- (mode client) RPC regression tests- misc_protocol.out index f9ed174d2328..1a611c1ac725 100644 --- a/tezt/tests/expected/RPC_test.ml/Alpha- (mode client) RPC regression tests- misc_protocol.out +++ b/tezt/tests/expected/RPC_test.ml/Alpha- (mode client) RPC regression tests- misc_protocol.out @@ -92,32 +92,6 @@ { "level": 1, "level_position": 0, "cycle": 0, "cycle_position": 0, "expected_commitment": false } -./octez-client rpc get /chains/main/blocks/head/helpers/endorsing_rights -[ { "level": 1, - "delegates": - [ { "delegate": "[PUBLIC_KEY_HASH]", - "first_slot": 11, "endorsing_power": 50, - "consensus_key": "[PUBLIC_KEY_HASH]" }, - { "delegate": "[PUBLIC_KEY_HASH]", - "first_slot": 4, "endorsing_power": 47, - "consensus_key": "[PUBLIC_KEY_HASH]" }, - { "delegate": "[PUBLIC_KEY_HASH]", - "first_slot": 2, "endorsing_power": 46, - "consensus_key": "[PUBLIC_KEY_HASH]" }, - { "delegate": "[PUBLIC_KEY_HASH]", - "first_slot": 1, "endorsing_power": 55, - "consensus_key": "[PUBLIC_KEY_HASH]" }, - { "delegate": "[PUBLIC_KEY_HASH]", - "first_slot": 0, "endorsing_power": 58, - "consensus_key": "[PUBLIC_KEY_HASH]" } ] } ] - -./octez-client rpc get '/chains/main/blocks/head/helpers/endorsing_rights?delegate=[PUBLIC_KEY_HASH]' -[ { "level": 1, - "delegates": - [ { "delegate": "[PUBLIC_KEY_HASH]", - "first_slot": 11, "endorsing_power": 50, - "consensus_key": "[PUBLIC_KEY_HASH]" } ] } ] - ./octez-client rpc get /chains/main/blocks/head/helpers/attestation_rights [ { "level": 1, "delegates": diff --git a/tezt/tests/expected/RPC_test.ml/Alpha- (mode light) RPC regression tests- misc_protocol.out b/tezt/tests/expected/RPC_test.ml/Alpha- (mode light) RPC regression tests- misc_protocol.out index 47236e0f11fc..2842623184f9 100644 --- a/tezt/tests/expected/RPC_test.ml/Alpha- (mode light) RPC regression tests- misc_protocol.out +++ b/tezt/tests/expected/RPC_test.ml/Alpha- (mode light) RPC regression tests- misc_protocol.out @@ -92,32 +92,6 @@ { "level": 1, "level_position": 0, "cycle": 0, "cycle_position": 0, "expected_commitment": false } -./octez-client --mode light rpc get /chains/main/blocks/head/helpers/endorsing_rights -[ { "level": 1, - "delegates": - [ { "delegate": "[PUBLIC_KEY_HASH]", - "first_slot": 11, "endorsing_power": 50, - "consensus_key": "[PUBLIC_KEY_HASH]" }, - { "delegate": "[PUBLIC_KEY_HASH]", - "first_slot": 4, "endorsing_power": 47, - "consensus_key": "[PUBLIC_KEY_HASH]" }, - { "delegate": "[PUBLIC_KEY_HASH]", - "first_slot": 2, "endorsing_power": 46, - "consensus_key": "[PUBLIC_KEY_HASH]" }, - { "delegate": "[PUBLIC_KEY_HASH]", - "first_slot": 1, "endorsing_power": 55, - "consensus_key": "[PUBLIC_KEY_HASH]" }, - { "delegate": "[PUBLIC_KEY_HASH]", - "first_slot": 0, "endorsing_power": 58, - "consensus_key": "[PUBLIC_KEY_HASH]" } ] } ] - -./octez-client --mode light rpc get '/chains/main/blocks/head/helpers/endorsing_rights?delegate=[PUBLIC_KEY_HASH]' -[ { "level": 1, - "delegates": - [ { "delegate": "[PUBLIC_KEY_HASH]", - "first_slot": 11, "endorsing_power": 50, - "consensus_key": "[PUBLIC_KEY_HASH]" } ] } ] - ./octez-client --mode light rpc get /chains/main/blocks/head/helpers/attestation_rights [ { "level": 1, "delegates": diff --git a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy) RPC regression tests- misc_protocol.out b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy) RPC regression tests- misc_protocol.out index 8de46241c28d..223c440ab9f9 100644 --- a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy) RPC regression tests- misc_protocol.out +++ b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy) RPC regression tests- misc_protocol.out @@ -92,32 +92,6 @@ { "level": 1, "level_position": 0, "cycle": 0, "cycle_position": 0, "expected_commitment": false } -./octez-client --mode proxy rpc get /chains/main/blocks/head/helpers/endorsing_rights -[ { "level": 1, - "delegates": - [ { "delegate": "[PUBLIC_KEY_HASH]", - "first_slot": 11, "endorsing_power": 50, - "consensus_key": "[PUBLIC_KEY_HASH]" }, - { "delegate": "[PUBLIC_KEY_HASH]", - "first_slot": 4, "endorsing_power": 47, - "consensus_key": "[PUBLIC_KEY_HASH]" }, - { "delegate": "[PUBLIC_KEY_HASH]", - "first_slot": 2, "endorsing_power": 46, - "consensus_key": "[PUBLIC_KEY_HASH]" }, - { "delegate": "[PUBLIC_KEY_HASH]", - "first_slot": 1, "endorsing_power": 55, - "consensus_key": "[PUBLIC_KEY_HASH]" }, - { "delegate": "[PUBLIC_KEY_HASH]", - "first_slot": 0, "endorsing_power": 58, - "consensus_key": "[PUBLIC_KEY_HASH]" } ] } ] - -./octez-client --mode proxy rpc get '/chains/main/blocks/head/helpers/endorsing_rights?delegate=[PUBLIC_KEY_HASH]' -[ { "level": 1, - "delegates": - [ { "delegate": "[PUBLIC_KEY_HASH]", - "first_slot": 11, "endorsing_power": 50, - "consensus_key": "[PUBLIC_KEY_HASH]" } ] } ] - ./octez-client --mode proxy rpc get /chains/main/blocks/head/helpers/attestation_rights [ { "level": 1, "delegates": diff --git a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_data_dir) RPC regression tests- misc_protocol.out b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_data_dir) RPC regression tests- misc_protocol.out index 0cfed372a466..c5ab77ab8002 100644 --- a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_data_dir) RPC regression tests- misc_protocol.out +++ b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_data_dir) RPC regression tests- misc_protocol.out @@ -92,32 +92,6 @@ { "level": 2, "level_position": 1, "cycle": 0, "cycle_position": 1, "expected_commitment": false } -./octez-client rpc get /chains/main/blocks/head/helpers/endorsing_rights -[ { "level": 2, - "delegates": - [ { "delegate": "[PUBLIC_KEY_HASH]", - "first_slot": 10, "endorsing_power": 50, - "consensus_key": "[PUBLIC_KEY_HASH]" }, - { "delegate": "[PUBLIC_KEY_HASH]", - "first_slot": 3, "endorsing_power": 50, - "consensus_key": "[PUBLIC_KEY_HASH]" }, - { "delegate": "[PUBLIC_KEY_HASH]", - "first_slot": 2, "endorsing_power": 65, - "consensus_key": "[PUBLIC_KEY_HASH]" }, - { "delegate": "[PUBLIC_KEY_HASH]", - "first_slot": 1, "endorsing_power": 50, - "consensus_key": "[PUBLIC_KEY_HASH]" }, - { "delegate": "[PUBLIC_KEY_HASH]", - "first_slot": 0, "endorsing_power": 41, - "consensus_key": "[PUBLIC_KEY_HASH]" } ] } ] - -./octez-client rpc get '/chains/main/blocks/head/helpers/endorsing_rights?delegate=[PUBLIC_KEY_HASH]' -[ { "level": 2, - "delegates": - [ { "delegate": "[PUBLIC_KEY_HASH]", - "first_slot": 1, "endorsing_power": 50, - "consensus_key": "[PUBLIC_KEY_HASH]" } ] } ] - ./octez-client rpc get /chains/main/blocks/head/helpers/attestation_rights [ { "level": 2, "delegates": diff --git a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_rpc) RPC regression tests- misc_protocol.out b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_rpc) RPC regression tests- misc_protocol.out index 0cfed372a466..c5ab77ab8002 100644 --- a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_rpc) RPC regression tests- misc_protocol.out +++ b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_rpc) RPC regression tests- misc_protocol.out @@ -92,32 +92,6 @@ { "level": 2, "level_position": 1, "cycle": 0, "cycle_position": 1, "expected_commitment": false } -./octez-client rpc get /chains/main/blocks/head/helpers/endorsing_rights -[ { "level": 2, - "delegates": - [ { "delegate": "[PUBLIC_KEY_HASH]", - "first_slot": 10, "endorsing_power": 50, - "consensus_key": "[PUBLIC_KEY_HASH]" }, - { "delegate": "[PUBLIC_KEY_HASH]", - "first_slot": 3, "endorsing_power": 50, - "consensus_key": "[PUBLIC_KEY_HASH]" }, - { "delegate": "[PUBLIC_KEY_HASH]", - "first_slot": 2, "endorsing_power": 65, - "consensus_key": "[PUBLIC_KEY_HASH]" }, - { "delegate": "[PUBLIC_KEY_HASH]", - "first_slot": 1, "endorsing_power": 50, - "consensus_key": "[PUBLIC_KEY_HASH]" }, - { "delegate": "[PUBLIC_KEY_HASH]", - "first_slot": 0, "endorsing_power": 41, - "consensus_key": "[PUBLIC_KEY_HASH]" } ] } ] - -./octez-client rpc get '/chains/main/blocks/head/helpers/endorsing_rights?delegate=[PUBLIC_KEY_HASH]' -[ { "level": 2, - "delegates": - [ { "delegate": "[PUBLIC_KEY_HASH]", - "first_slot": 1, "endorsing_power": 50, - "consensus_key": "[PUBLIC_KEY_HASH]" } ] } ] - ./octez-client rpc get /chains/main/blocks/head/helpers/attestation_rights [ { "level": 2, "delegates": diff --git a/tezt/tests/expected/RPC_test.ml/Nairobi- (mode client) RPC regression tests- misc_protocol.out b/tezt/tests/expected/RPC_test.ml/Nairobi- (mode client) RPC regression tests- misc_protocol.out index dee4a83c6cd7..9d5cab670056 100644 --- a/tezt/tests/expected/RPC_test.ml/Nairobi- (mode client) RPC regression tests- misc_protocol.out +++ b/tezt/tests/expected/RPC_test.ml/Nairobi- (mode client) RPC regression tests- misc_protocol.out @@ -116,5 +116,31 @@ "first_slot": 11, "endorsing_power": 50, "consensus_key": "[PUBLIC_KEY_HASH]" } ] } ] +./octez-client rpc get /chains/main/blocks/head/helpers/attestation_rights +[ { "level": 1, + "delegates": + [ { "delegate": "[PUBLIC_KEY_HASH]", + "first_slot": 11, "attestation_power": 50, + "consensus_key": "[PUBLIC_KEY_HASH]" }, + { "delegate": "[PUBLIC_KEY_HASH]", + "first_slot": 4, "attestation_power": 47, + "consensus_key": "[PUBLIC_KEY_HASH]" }, + { "delegate": "[PUBLIC_KEY_HASH]", + "first_slot": 2, "attestation_power": 46, + "consensus_key": "[PUBLIC_KEY_HASH]" }, + { "delegate": "[PUBLIC_KEY_HASH]", + "first_slot": 1, "attestation_power": 55, + "consensus_key": "[PUBLIC_KEY_HASH]" }, + { "delegate": "[PUBLIC_KEY_HASH]", + "first_slot": 0, "attestation_power": 58, + "consensus_key": "[PUBLIC_KEY_HASH]" } ] } ] + +./octez-client rpc get '/chains/main/blocks/head/helpers/attestation_rights?delegate=[PUBLIC_KEY_HASH]' +[ { "level": 1, + "delegates": + [ { "delegate": "[PUBLIC_KEY_HASH]", + "first_slot": 11, "attestation_power": 50, + "consensus_key": "[PUBLIC_KEY_HASH]" } ] } ] + ./octez-client rpc get /chains/main/blocks/head/helpers/levels_in_current_cycle { "first": 1, "last": 8 } diff --git a/tezt/tests/expected/RPC_test.ml/Nairobi- (mode light) RPC regression tests- misc_protocol.out b/tezt/tests/expected/RPC_test.ml/Nairobi- (mode light) RPC regression tests- misc_protocol.out index dbe782d8770f..91b7ce05765e 100644 --- a/tezt/tests/expected/RPC_test.ml/Nairobi- (mode light) RPC regression tests- misc_protocol.out +++ b/tezt/tests/expected/RPC_test.ml/Nairobi- (mode light) RPC regression tests- misc_protocol.out @@ -116,5 +116,31 @@ "first_slot": 11, "endorsing_power": 50, "consensus_key": "[PUBLIC_KEY_HASH]" } ] } ] +./octez-client --mode light rpc get /chains/main/blocks/head/helpers/attestation_rights +[ { "level": 1, + "delegates": + [ { "delegate": "[PUBLIC_KEY_HASH]", + "first_slot": 11, "attestation_power": 50, + "consensus_key": "[PUBLIC_KEY_HASH]" }, + { "delegate": "[PUBLIC_KEY_HASH]", + "first_slot": 4, "attestation_power": 47, + "consensus_key": "[PUBLIC_KEY_HASH]" }, + { "delegate": "[PUBLIC_KEY_HASH]", + "first_slot": 2, "attestation_power": 46, + "consensus_key": "[PUBLIC_KEY_HASH]" }, + { "delegate": "[PUBLIC_KEY_HASH]", + "first_slot": 1, "attestation_power": 55, + "consensus_key": "[PUBLIC_KEY_HASH]" }, + { "delegate": "[PUBLIC_KEY_HASH]", + "first_slot": 0, "attestation_power": 58, + "consensus_key": "[PUBLIC_KEY_HASH]" } ] } ] + +./octez-client --mode light rpc get '/chains/main/blocks/head/helpers/attestation_rights?delegate=[PUBLIC_KEY_HASH]' +[ { "level": 1, + "delegates": + [ { "delegate": "[PUBLIC_KEY_HASH]", + "first_slot": 11, "attestation_power": 50, + "consensus_key": "[PUBLIC_KEY_HASH]" } ] } ] + ./octez-client --mode light rpc get /chains/main/blocks/head/helpers/levels_in_current_cycle { "first": 1, "last": 8 } diff --git a/tezt/tests/expected/RPC_test.ml/Nairobi- (mode proxy) RPC regression tests- misc_protocol.out b/tezt/tests/expected/RPC_test.ml/Nairobi- (mode proxy) RPC regression tests- misc_protocol.out index 880834e7ea6c..66a74b8f74f2 100644 --- a/tezt/tests/expected/RPC_test.ml/Nairobi- (mode proxy) RPC regression tests- misc_protocol.out +++ b/tezt/tests/expected/RPC_test.ml/Nairobi- (mode proxy) RPC regression tests- misc_protocol.out @@ -116,5 +116,31 @@ "first_slot": 11, "endorsing_power": 50, "consensus_key": "[PUBLIC_KEY_HASH]" } ] } ] +./octez-client --mode proxy rpc get /chains/main/blocks/head/helpers/attestation_rights +[ { "level": 1, + "delegates": + [ { "delegate": "[PUBLIC_KEY_HASH]", + "first_slot": 11, "attestation_power": 50, + "consensus_key": "[PUBLIC_KEY_HASH]" }, + { "delegate": "[PUBLIC_KEY_HASH]", + "first_slot": 4, "attestation_power": 47, + "consensus_key": "[PUBLIC_KEY_HASH]" }, + { "delegate": "[PUBLIC_KEY_HASH]", + "first_slot": 2, "attestation_power": 46, + "consensus_key": "[PUBLIC_KEY_HASH]" }, + { "delegate": "[PUBLIC_KEY_HASH]", + "first_slot": 1, "attestation_power": 55, + "consensus_key": "[PUBLIC_KEY_HASH]" }, + { "delegate": "[PUBLIC_KEY_HASH]", + "first_slot": 0, "attestation_power": 58, + "consensus_key": "[PUBLIC_KEY_HASH]" } ] } ] + +./octez-client --mode proxy rpc get '/chains/main/blocks/head/helpers/attestation_rights?delegate=[PUBLIC_KEY_HASH]' +[ { "level": 1, + "delegates": + [ { "delegate": "[PUBLIC_KEY_HASH]", + "first_slot": 11, "attestation_power": 50, + "consensus_key": "[PUBLIC_KEY_HASH]" } ] } ] + ./octez-client --mode proxy rpc get /chains/main/blocks/head/helpers/levels_in_current_cycle { "first": 1, "last": 8 } diff --git a/tezt/tests/expected/RPC_test.ml/Nairobi- (mode proxy_server_data_dir) RPC regression tests- misc_protocol.out b/tezt/tests/expected/RPC_test.ml/Nairobi- (mode proxy_server_data_dir) RPC regression tests- misc_protocol.out index 6b0bc08d4e49..4ea3f3d1f912 100644 --- a/tezt/tests/expected/RPC_test.ml/Nairobi- (mode proxy_server_data_dir) RPC regression tests- misc_protocol.out +++ b/tezt/tests/expected/RPC_test.ml/Nairobi- (mode proxy_server_data_dir) RPC regression tests- misc_protocol.out @@ -116,5 +116,31 @@ "first_slot": 1, "endorsing_power": 50, "consensus_key": "[PUBLIC_KEY_HASH]" } ] } ] +./octez-client rpc get /chains/main/blocks/head/helpers/attestation_rights +[ { "level": 2, + "delegates": + [ { "delegate": "[PUBLIC_KEY_HASH]", + "first_slot": 10, "attestation_power": 50, + "consensus_key": "[PUBLIC_KEY_HASH]" }, + { "delegate": "[PUBLIC_KEY_HASH]", + "first_slot": 3, "attestation_power": 50, + "consensus_key": "[PUBLIC_KEY_HASH]" }, + { "delegate": "[PUBLIC_KEY_HASH]", + "first_slot": 2, "attestation_power": 65, + "consensus_key": "[PUBLIC_KEY_HASH]" }, + { "delegate": "[PUBLIC_KEY_HASH]", + "first_slot": 1, "attestation_power": 50, + "consensus_key": "[PUBLIC_KEY_HASH]" }, + { "delegate": "[PUBLIC_KEY_HASH]", + "first_slot": 0, "attestation_power": 41, + "consensus_key": "[PUBLIC_KEY_HASH]" } ] } ] + +./octez-client rpc get '/chains/main/blocks/head/helpers/attestation_rights?delegate=[PUBLIC_KEY_HASH]' +[ { "level": 2, + "delegates": + [ { "delegate": "[PUBLIC_KEY_HASH]", + "first_slot": 1, "attestation_power": 50, + "consensus_key": "[PUBLIC_KEY_HASH]" } ] } ] + ./octez-client rpc get /chains/main/blocks/head/helpers/levels_in_current_cycle { "first": 1, "last": 8 } diff --git a/tezt/tests/expected/RPC_test.ml/Nairobi- (mode proxy_server_rpc) RPC regression tests- misc_protocol.out b/tezt/tests/expected/RPC_test.ml/Nairobi- (mode proxy_server_rpc) RPC regression tests- misc_protocol.out index 6b0bc08d4e49..4ea3f3d1f912 100644 --- a/tezt/tests/expected/RPC_test.ml/Nairobi- (mode proxy_server_rpc) RPC regression tests- misc_protocol.out +++ b/tezt/tests/expected/RPC_test.ml/Nairobi- (mode proxy_server_rpc) RPC regression tests- misc_protocol.out @@ -116,5 +116,31 @@ "first_slot": 1, "endorsing_power": 50, "consensus_key": "[PUBLIC_KEY_HASH]" } ] } ] +./octez-client rpc get /chains/main/blocks/head/helpers/attestation_rights +[ { "level": 2, + "delegates": + [ { "delegate": "[PUBLIC_KEY_HASH]", + "first_slot": 10, "attestation_power": 50, + "consensus_key": "[PUBLIC_KEY_HASH]" }, + { "delegate": "[PUBLIC_KEY_HASH]", + "first_slot": 3, "attestation_power": 50, + "consensus_key": "[PUBLIC_KEY_HASH]" }, + { "delegate": "[PUBLIC_KEY_HASH]", + "first_slot": 2, "attestation_power": 65, + "consensus_key": "[PUBLIC_KEY_HASH]" }, + { "delegate": "[PUBLIC_KEY_HASH]", + "first_slot": 1, "attestation_power": 50, + "consensus_key": "[PUBLIC_KEY_HASH]" }, + { "delegate": "[PUBLIC_KEY_HASH]", + "first_slot": 0, "attestation_power": 41, + "consensus_key": "[PUBLIC_KEY_HASH]" } ] } ] + +./octez-client rpc get '/chains/main/blocks/head/helpers/attestation_rights?delegate=[PUBLIC_KEY_HASH]' +[ { "level": 2, + "delegates": + [ { "delegate": "[PUBLIC_KEY_HASH]", + "first_slot": 1, "attestation_power": 50, + "consensus_key": "[PUBLIC_KEY_HASH]" } ] } ] + ./octez-client rpc get /chains/main/blocks/head/helpers/levels_in_current_cycle { "first": 1, "last": 8 } -- GitLab From 26fc1e6e9d223147609ef4bc7c0644f5732f1adf Mon Sep 17 00:00:00 2001 From: Albin Coquereau Date: Fri, 18 Aug 2023 16:56:07 +0200 Subject: [PATCH 4/5] changes: add entry for endorsing_rights removal --- CHANGES.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index 90047775b624..8e06143e321f 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -33,6 +33,9 @@ Node ../helpers/scripts/simulate_operation`` default version to version ``1``. Version ``0`` can still be used with ``?version=0`` argument. (MR :gl:`!9840`) +- **Breaking change** Removed the deprecated ``endorsing_rights`` RPC, + use ``attestation_rights`` instead. (MR :gl:`!9849`) + Client ------ -- GitLab From 6010c856c5563780fb3b1dd0a4890ca9dc43d0d0 Mon Sep 17 00:00:00 2001 From: Albin Coquereau Date: Thu, 31 Aug 2023 09:53:00 +0200 Subject: [PATCH 5/5] tezt/tests: enable some helpers RPCs in proxy tests --- tezt/tests/proxy.ml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tezt/tests/proxy.ml b/tezt/tests/proxy.ml index ca970c36b5be..72546133a454 100644 --- a/tezt/tests/proxy.ml +++ b/tezt/tests/proxy.ml @@ -525,9 +525,8 @@ module Location = struct (add_rpc_path_prefix ["helpers"; "current_level"], []); (add_rpc_path_prefix ["helpers"; "attestation_rights"], []); (add_rpc_path_prefix ["helpers"; "levels_in_current_cycle"], []); - (* The 2 following RPCs only exist on Alpha *) - (* (add_rpc_path_prefix ["helpers"; "validators"], []); *) - (* (add_rpc_path_prefix ["helpers"; "round"], []); *) + (add_rpc_path_prefix ["helpers"; "validators"], []); + (add_rpc_path_prefix ["helpers"; "round"], []); (add_rpc_path_prefix ["votes"; "current_period"], []); (add_rpc_path_prefix ["votes"; "successor_period"], []); (add_rpc_path_prefix ["votes"; "total_voting_power"], []); -- GitLab