From 0a2124e984fce16d3dc263a3cbf37d60454813af Mon Sep 17 00:00:00 2001 From: Albin Coquereau Date: Tue, 17 Oct 2023 17:54:53 +0200 Subject: [PATCH 1/6] Revert "changes: add entry for RPC version bumping" This reverts commit c5bf0e46ee4a9dd61d0e2d6e8d6f24e5f3cd8310. --- CHANGES.rst | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 87297d003e0d..1b16c34edb6f 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -36,16 +36,6 @@ Node - **Breaking change** Removed the deprecated ``endorsing_rights`` RPC, use ``attestation_rights`` instead. (MR :gl:`!9849`) -- Bump RPCs ``GET ../mempool/monitor_operations``, ``POST - ../helpers/preapply/operations``, ``GET ../blocks/``, ``GET - ../blocks//metadata``. and ``GET ../blocks//operations`` - default version to version ``1``. Version ``0`` can still be used with - ``?version=0`` argument. (MR :gl:`!9839`) - -- Bump RPC ``GET ../mempool/pending_operations`` default version to version - ``2``. Version ``0`` has been removed and version ``1`` can still be used - with ``?version=1`` argument. (MR :gl:`!9839`) - - Added metrics about distributed data base messages sent, broadcasted or received - **Breaking change** Removed the deprecated -- GitLab From 09cc62188f7ec4f0e2767a99901e50434f46a18f Mon Sep 17 00:00:00 2001 From: Albin Coquereau Date: Tue, 17 Oct 2023 17:55:03 +0200 Subject: [PATCH 2/6] Revert "tezt/tests: remove test for the RPC pending_operations version 0" This reverts commit 01eece62c2ade30d26edc4ca83512aca7a7ffbbb. --- tezt/tests/prevalidator.ml | 80 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/tezt/tests/prevalidator.ml b/tezt/tests/prevalidator.ml index 095bb0c4b0fe..7dc36fbbaa80 100644 --- a/tezt/tests/prevalidator.ml +++ b/tezt/tests/prevalidator.ml @@ -3570,6 +3570,85 @@ let get_refused_operation_hash_list_v0 mempool = let get_refused_operation_hash_list_v1 mempool = List.map get_hash JSON.(mempool |-> "refused" |> as_list) +(** This test tries to check the format of different versions of + pending_operations RPC. + + Scenario: + + + Node 1 activates a protocol + + + Inject operation on node_1 with low fees + + + Bake empty block to classify operation as refused + + + Get the hash of the operation using different versions of pending_operation RPC + and check that they are the same *) +let test_pending_operation_version = + Protocol.register_test + ~__FILE__ + ~title:"pending operation version" + ~tags:["mempool"; "pending_operations"; "version"] + @@ fun protocol -> + (* Step 1 *) + (* Initialise one node *) + let* node_1 = + Node.init + ~event_sections_levels:[("prevalidator", `Debug)] + [Synchronisation_threshold 0; Private_mode] + in + let* client_1 = Client.init ~endpoint:(Node node_1) () in + let* () = Client.activate_protocol_and_wait ~protocol client_1 in + Log.info "Activated protocol." ; + (* Step 2 *) + (* Inject refused operation *) + let* branch = Operation.Manager.get_branch client_1 in + + let* _ = + forge_and_inject_operation + ~branch + ~fee:10 + ~gas_limit:1040 + ~source:Constant.bootstrap1.public_key_hash + ~destination:Constant.bootstrap2.public_key_hash + ~counter:1 + ~signer:Constant.bootstrap1 + ~client:client_1 + in + (* Step 3 *) + (* Bake empty block to force operation to be classify as refused *) + let dummy_baking = wait_for_flush node_1 in + let* () = bake_empty_block ~protocol client_1 in + let* () = dummy_baking in + (* Step 4 *) + (* Get pending operations using different version of the RPC and check *) + let* mempool_v0 = + Client.RPC.call client_1 + @@ RPC.get_chain_mempool_pending_operations ~version:"0" () + in + let* mempool_v1 = + Client.RPC.call client_1 @@ RPC.get_chain_mempool_pending_operations () + in + let ophs_refused_v0 = get_refused_operation_hash_list_v0 mempool_v0 in + let ophs_refused_v1 = get_refused_operation_hash_list_v1 mempool_v1 in + try + if not (List.for_all2 String.equal ophs_refused_v0 ophs_refused_v1) then + Format.kasprintf + (Test.fail "%s") + "Refused operation hash list should have the same elements. Got : %a \ + (version 1) and %a (version 2)" + (Format.pp_print_list (fun ppf oph -> Format.fprintf ppf "%s" oph)) + ophs_refused_v0 + (Format.pp_print_list (fun ppf oph -> Format.fprintf ppf "%s" oph)) + ophs_refused_v1 ; + unit + with Invalid_argument _ -> + Format.kasprintf + (Test.fail "%s") + "Refused operation hash list should have the same number of elements. \ + Got : %d (version 1) and %d (version 2)" + (List.length ophs_refused_v0) + (List.length ophs_refused_v1) + (** This test tries to check that invalid operation can be injected on a local node with private/injection/operation RPC *) let force_operation_injection = @@ -3862,6 +3941,7 @@ let register ~protocols = refetch_failed_operation protocols ; ban_operation_and_check_validated protocols ; test_do_not_reclassify protocols ; + test_pending_operation_version protocols ; force_operation_injection protocols ; injecting_old_operation_fails protocols ; test_request_operations_peer protocols -- GitLab From 34d8cebe1234d1d29c3867feb8a601b3c38fbda8 Mon Sep 17 00:00:00 2001 From: Albin Coquereau Date: Tue, 17 Oct 2023 17:55:15 +0200 Subject: [PATCH 3/6] Revert "lib_shell_services: remove old pending_operations version 0" This reverts commit 5f4c3902a95da163dce916b51d817ea87dd0bf39. --- src/lib_shell_services/block_services.ml | 90 ++++++++++++++++++++++-- 1 file changed, 86 insertions(+), 4 deletions(-) diff --git a/src/lib_shell_services/block_services.ml b/src/lib_shell_services/block_services.ml index 58d7a673bc63..d9e144525fff 100644 --- a/src/lib_shell_services/block_services.ml +++ b/src/lib_shell_services/block_services.ml @@ -1308,7 +1308,87 @@ module Make (Proto : PROTO) (Next_proto : PROTO) = struct unprocessed : Next_proto.operation Operation_hash.Map.t; } - let pending_operations_encoding ~use_legacy_name ~use_validated = + let version_0_encoding = + conv + (fun { + validated; + refused; + outdated; + branch_refused; + branch_delayed; + unprocessed; + } -> + ( validated, + refused, + outdated, + branch_refused, + branch_delayed, + unprocessed )) + (fun ( validated, + refused, + outdated, + branch_refused, + branch_delayed, + unprocessed ) -> + { + validated; + refused; + outdated; + branch_refused; + branch_delayed; + unprocessed; + }) + (obj6 + (req + "applied" + (list + (conv + (fun (hash, (op : Next_proto.operation)) -> + ((hash, op.shell), op.protocol_data)) + (fun ((hash, shell), protocol_data) -> + (hash, {shell; protocol_data})) + (merge_objs + (merge_objs + (obj1 (req "hash" Operation_hash.encoding)) + (dynamic_size Operation.shell_header_encoding)) + (dynamic_size + Next_proto + .operation_data_encoding_with_legacy_attestation_name))))) + (req + "refused" + (Operation_hash.Map.encoding + (merge_objs + (dynamic_size + next_operation_encoding_with_legacy_attestation_name) + (obj1 (req "error" Tezos_rpc.Error.encoding))))) + (req + "outdated" + (Operation_hash.Map.encoding + (merge_objs + (dynamic_size + next_operation_encoding_with_legacy_attestation_name) + (obj1 (req "error" Tezos_rpc.Error.encoding))))) + (req + "branch_refused" + (Operation_hash.Map.encoding + (merge_objs + (dynamic_size + next_operation_encoding_with_legacy_attestation_name) + (obj1 (req "error" Tezos_rpc.Error.encoding))))) + (req + "branch_delayed" + (Operation_hash.Map.encoding + (merge_objs + (dynamic_size + next_operation_encoding_with_legacy_attestation_name) + (obj1 (req "error" Tezos_rpc.Error.encoding))))) + (req + "unprocessed" + (Operation_hash.Map.encoding + (dynamic_size + next_operation_encoding_with_legacy_attestation_name)))) + + let version_1_encoding ~use_legacy_name ~use_validated = let next_operation_encoding = if use_legacy_name then next_operation_encoding_with_legacy_attestation_name @@ -1390,10 +1470,10 @@ module Make (Proto : PROTO) (Next_proto : PROTO) = struct next_operation_encoding))))) let version_2_encoding = - pending_operations_encoding ~use_legacy_name:false ~use_validated:true + version_1_encoding ~use_legacy_name:false ~use_validated:true let version_1_encoding = - pending_operations_encoding ~use_legacy_name:true ~use_validated:false + version_1_encoding ~use_legacy_name:true ~use_validated:false (* This encoding should be always the one by default. *) let encoding = version_1_encoding @@ -1402,6 +1482,7 @@ module Make (Proto : PROTO) (Next_proto : PROTO) = struct mk_version_informations ~supported: [ + version_0; {version = Version_1; use_legacy_attestation_name = true}; {version = Version_2; use_legacy_attestation_name = false}; ] @@ -1495,7 +1576,8 @@ module Make (Proto : PROTO) (Next_proto : PROTO) = struct encoding_versioning ~encoding_name:"pending_operations" ~latest_encoding:(Version_2, version_2_encoding) - ~old_encodings:[(Version_1, version_1_encoding)] + ~old_encodings: + [(Version_0, version_0_encoding); (Version_1, version_1_encoding)] let pending_operations path = Tezos_rpc.Service.get_service -- GitLab From f5196555ed6c114e1072e100bbd9919fd815076a Mon Sep 17 00:00:00 2001 From: Albin Coquereau Date: Tue, 17 Oct 2023 17:55:26 +0200 Subject: [PATCH 4/6] Revert "tezt/tests: adapt rpc regression tests" This reverts commit 720fae90f9774a59bd7d138e9514d780451f8a55. --- tezt/tests/RPC_test.ml | 2 +- .../Alpha- (mode client) RPC regression tests- mempool.out | 4 ++-- .../Alpha- (mode proxy) RPC regression tests- mempool.out | 4 ++-- .../Nairobi- (mode client) RPC regression tests- mempool.out | 4 ++-- .../Nairobi- (mode proxy) RPC regression tests- mempool.out | 4 ++-- .../Oxford- (mode client) RPC regression tests- mempool.out | 4 ++-- .../Oxford- (mode proxy) RPC regression tests- mempool.out | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tezt/tests/RPC_test.ml b/tezt/tests/RPC_test.ml index 88b017c95705..c28d5f820ecc 100644 --- a/tezt/tests/RPC_test.ml +++ b/tezt/tests/RPC_test.ml @@ -856,7 +856,7 @@ let test_mempool _test_mode_tag protocol ?endpoint client = (* To test the monitor_operations rpc we use curl since the client does not support streaming RPCs yet. *) sf - "http://localhost:%d/chains/main/mempool/monitor_operations?validated=true&outdated=true&branch_delayed=true&refused=true&branch_refused=true" + "http://localhost:%d/chains/main/mempool/monitor_operations?applied=true&outdated=true&branch_delayed=true&refused=true&branch_refused=true" (get_client_port client) in let proc_monitor = diff --git a/tezt/tests/expected/RPC_test.ml/Alpha- (mode client) RPC regression tests- mempool.out b/tezt/tests/expected/RPC_test.ml/Alpha- (mode client) RPC regression tests- mempool.out index 99b4b751e744..2f86845d8870 100644 --- a/tezt/tests/expected/RPC_test.ml/Alpha- (mode client) RPC regression tests- mempool.out +++ b/tezt/tests/expected/RPC_test.ml/Alpha- (mode client) RPC regression tests- mempool.out @@ -1,5 +1,5 @@ -curl -s 'http://localhost:[PORT]/chains/main/mempool/monitor_operations?validated=true&outdated=true&branch_delayed=true&refused=true&branch_refused=true' +curl -s 'http://localhost:[PORT]/chains/main/mempool/monitor_operations?applied=true&outdated=true&branch_delayed=true&refused=true&branch_refused=true' [] [{"hash":"[OPERATION_HASH]","protocol":"ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"1000","counter":"1","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]","error":[{"kind":"branch","id":"proto.alpha.contract.counter_in_the_past","contract":"[PUBLIC_KEY_HASH]","expected":"2","found":"1"}]}] [{"hash":"[OPERATION_HASH]","protocol":"ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"1000","counter":"5","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]","error":[{"kind":"temporary","id":"proto.alpha.contract.counter_in_the_future","contract":"[PUBLIC_KEY_HASH]","expected":"1","found":"5"}]}] @@ -283,7 +283,7 @@ curl -s 'http://localhost:[PORT]/chains/main/mempool/monitor_operations?validate { "validated": [], "refused": [], "outdated": [], "branch_refused": [], "branch_delayed": [], "unprocessed": [] } -curl -s 'http://localhost:[PORT]/chains/main/mempool/monitor_operations?validated=true&outdated=true&branch_delayed=true&refused=true&branch_refused=true' +curl -s 'http://localhost:[PORT]/chains/main/mempool/monitor_operations?applied=true&outdated=true&branch_delayed=true&refused=true&branch_refused=true' [{"hash":"[OPERATION_HASH]","protocol":"ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"1000","counter":"1","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]"},{"hash":"[OPERATION_HASH]","protocol":"ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"0","counter":"1","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]","error":[{"kind":"permanent","id":"proto.alpha.prefilter.fees_too_low"}]},{"hash":"[OPERATION_HASH]","protocol":"ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"1000","counter":"1","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]","error":[{"kind":"branch","id":"proto.alpha.contract.counter_in_the_past","contract":"[PUBLIC_KEY_HASH]","expected":"2","found":"1"}]},{"hash":"[OPERATION_HASH]","protocol":"ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"1000","counter":"5","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]","error":[{"kind":"temporary","id":"proto.alpha.contract.counter_in_the_future","contract":"[PUBLIC_KEY_HASH]","expected":"1","found":"5"}]}] ./octez-client rpc get /chains/main/mempool/filter diff --git a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy) RPC regression tests- mempool.out b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy) RPC regression tests- mempool.out index 66a9f072bbd4..1b7ee2293d8c 100644 --- a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy) RPC regression tests- mempool.out +++ b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy) RPC regression tests- mempool.out @@ -1,5 +1,5 @@ -curl -s 'http://localhost:[PORT]/chains/main/mempool/monitor_operations?validated=true&outdated=true&branch_delayed=true&refused=true&branch_refused=true' +curl -s 'http://localhost:[PORT]/chains/main/mempool/monitor_operations?applied=true&outdated=true&branch_delayed=true&refused=true&branch_refused=true' [] [{"hash":"[OPERATION_HASH]","protocol":"ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"1000","counter":"1","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]","error":[{"kind":"branch","id":"proto.alpha.contract.counter_in_the_past","contract":"[PUBLIC_KEY_HASH]","expected":"2","found":"1"}]}] [{"hash":"[OPERATION_HASH]","protocol":"ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"1000","counter":"5","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]","error":[{"kind":"temporary","id":"proto.alpha.contract.counter_in_the_future","contract":"[PUBLIC_KEY_HASH]","expected":"1","found":"5"}]}] @@ -283,7 +283,7 @@ curl -s 'http://localhost:[PORT]/chains/main/mempool/monitor_operations?validate { "validated": [], "refused": [], "outdated": [], "branch_refused": [], "branch_delayed": [], "unprocessed": [] } -curl -s 'http://localhost:[PORT]/chains/main/mempool/monitor_operations?validated=true&outdated=true&branch_delayed=true&refused=true&branch_refused=true' +curl -s 'http://localhost:[PORT]/chains/main/mempool/monitor_operations?applied=true&outdated=true&branch_delayed=true&refused=true&branch_refused=true' [{"hash":"[OPERATION_HASH]","protocol":"ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"1000","counter":"1","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]"},{"hash":"[OPERATION_HASH]","protocol":"ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"0","counter":"1","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]","error":[{"kind":"permanent","id":"proto.alpha.prefilter.fees_too_low"}]},{"hash":"[OPERATION_HASH]","protocol":"ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"1000","counter":"1","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]","error":[{"kind":"branch","id":"proto.alpha.contract.counter_in_the_past","contract":"[PUBLIC_KEY_HASH]","expected":"2","found":"1"}]},{"hash":"[OPERATION_HASH]","protocol":"ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"1000","counter":"5","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]","error":[{"kind":"temporary","id":"proto.alpha.contract.counter_in_the_future","contract":"[PUBLIC_KEY_HASH]","expected":"1","found":"5"}]}] ./octez-client --mode proxy rpc get /chains/main/mempool/filter diff --git a/tezt/tests/expected/RPC_test.ml/Nairobi- (mode client) RPC regression tests- mempool.out b/tezt/tests/expected/RPC_test.ml/Nairobi- (mode client) RPC regression tests- mempool.out index 54995c5546ea..1c284f7fdfb4 100644 --- a/tezt/tests/expected/RPC_test.ml/Nairobi- (mode client) RPC regression tests- mempool.out +++ b/tezt/tests/expected/RPC_test.ml/Nairobi- (mode client) RPC regression tests- mempool.out @@ -1,5 +1,5 @@ -curl -s 'http://localhost:[PORT]/chains/main/mempool/monitor_operations?validated=true&outdated=true&branch_delayed=true&refused=true&branch_refused=true' +curl -s 'http://localhost:[PORT]/chains/main/mempool/monitor_operations?applied=true&outdated=true&branch_delayed=true&refused=true&branch_refused=true' [] [{"hash":"[OPERATION_HASH]","protocol":"PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"1000","counter":"1","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]","error":[{"kind":"branch","id":"proto.017-PtNairob.contract.counter_in_the_past","contract":"[PUBLIC_KEY_HASH]","expected":"2","found":"1"}]}] [{"hash":"[OPERATION_HASH]","protocol":"PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"1000","counter":"5","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]","error":[{"kind":"temporary","id":"proto.017-PtNairob.contract.counter_in_the_future","contract":"[PUBLIC_KEY_HASH]","expected":"1","found":"5"}]}] @@ -283,7 +283,7 @@ curl -s 'http://localhost:[PORT]/chains/main/mempool/monitor_operations?validate { "validated": [], "refused": [], "outdated": [], "branch_refused": [], "branch_delayed": [], "unprocessed": [] } -curl -s 'http://localhost:[PORT]/chains/main/mempool/monitor_operations?validated=true&outdated=true&branch_delayed=true&refused=true&branch_refused=true' +curl -s 'http://localhost:[PORT]/chains/main/mempool/monitor_operations?applied=true&outdated=true&branch_delayed=true&refused=true&branch_refused=true' [{"hash":"[OPERATION_HASH]","protocol":"PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"1000","counter":"1","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]"},{"hash":"[OPERATION_HASH]","protocol":"PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"0","counter":"1","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]","error":[{"kind":"permanent","id":"proto.017-PtNairob.prefilter.fees_too_low"}]},{"hash":"[OPERATION_HASH]","protocol":"PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"1000","counter":"1","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]","error":[{"kind":"branch","id":"proto.017-PtNairob.contract.counter_in_the_past","contract":"[PUBLIC_KEY_HASH]","expected":"2","found":"1"}]},{"hash":"[OPERATION_HASH]","protocol":"PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"1000","counter":"5","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]","error":[{"kind":"temporary","id":"proto.017-PtNairob.contract.counter_in_the_future","contract":"[PUBLIC_KEY_HASH]","expected":"1","found":"5"}]}] ./octez-client rpc get /chains/main/mempool/filter diff --git a/tezt/tests/expected/RPC_test.ml/Nairobi- (mode proxy) RPC regression tests- mempool.out b/tezt/tests/expected/RPC_test.ml/Nairobi- (mode proxy) RPC regression tests- mempool.out index f051edd78661..404d9388c50b 100644 --- a/tezt/tests/expected/RPC_test.ml/Nairobi- (mode proxy) RPC regression tests- mempool.out +++ b/tezt/tests/expected/RPC_test.ml/Nairobi- (mode proxy) RPC regression tests- mempool.out @@ -1,5 +1,5 @@ -curl -s 'http://localhost:[PORT]/chains/main/mempool/monitor_operations?validated=true&outdated=true&branch_delayed=true&refused=true&branch_refused=true' +curl -s 'http://localhost:[PORT]/chains/main/mempool/monitor_operations?applied=true&outdated=true&branch_delayed=true&refused=true&branch_refused=true' [] [{"hash":"[OPERATION_HASH]","protocol":"PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"1000","counter":"1","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]","error":[{"kind":"branch","id":"proto.017-PtNairob.contract.counter_in_the_past","contract":"[PUBLIC_KEY_HASH]","expected":"2","found":"1"}]}] [{"hash":"[OPERATION_HASH]","protocol":"PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"1000","counter":"5","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]","error":[{"kind":"temporary","id":"proto.017-PtNairob.contract.counter_in_the_future","contract":"[PUBLIC_KEY_HASH]","expected":"1","found":"5"}]}] @@ -283,7 +283,7 @@ curl -s 'http://localhost:[PORT]/chains/main/mempool/monitor_operations?validate { "validated": [], "refused": [], "outdated": [], "branch_refused": [], "branch_delayed": [], "unprocessed": [] } -curl -s 'http://localhost:[PORT]/chains/main/mempool/monitor_operations?validated=true&outdated=true&branch_delayed=true&refused=true&branch_refused=true' +curl -s 'http://localhost:[PORT]/chains/main/mempool/monitor_operations?applied=true&outdated=true&branch_delayed=true&refused=true&branch_refused=true' [{"hash":"[OPERATION_HASH]","protocol":"PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"1000","counter":"1","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]"},{"hash":"[OPERATION_HASH]","protocol":"PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"0","counter":"1","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]","error":[{"kind":"permanent","id":"proto.017-PtNairob.prefilter.fees_too_low"}]},{"hash":"[OPERATION_HASH]","protocol":"PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"1000","counter":"1","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]","error":[{"kind":"branch","id":"proto.017-PtNairob.contract.counter_in_the_past","contract":"[PUBLIC_KEY_HASH]","expected":"2","found":"1"}]},{"hash":"[OPERATION_HASH]","protocol":"PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"1000","counter":"5","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]","error":[{"kind":"temporary","id":"proto.017-PtNairob.contract.counter_in_the_future","contract":"[PUBLIC_KEY_HASH]","expected":"1","found":"5"}]}] ./octez-client --mode proxy rpc get /chains/main/mempool/filter diff --git a/tezt/tests/expected/RPC_test.ml/Oxford- (mode client) RPC regression tests- mempool.out b/tezt/tests/expected/RPC_test.ml/Oxford- (mode client) RPC regression tests- mempool.out index d2a757b95633..d2a7e1650d96 100644 --- a/tezt/tests/expected/RPC_test.ml/Oxford- (mode client) RPC regression tests- mempool.out +++ b/tezt/tests/expected/RPC_test.ml/Oxford- (mode client) RPC regression tests- mempool.out @@ -1,5 +1,5 @@ -curl -s 'http://localhost:[PORT]/chains/main/mempool/monitor_operations?validated=true&outdated=true&branch_delayed=true&refused=true&branch_refused=true' +curl -s 'http://localhost:[PORT]/chains/main/mempool/monitor_operations?applied=true&outdated=true&branch_delayed=true&refused=true&branch_refused=true' [] [{"hash":"[OPERATION_HASH]","protocol":"ProxfordSW2S7fvchT1Zgj2avb5UES194neRyYVXoaDGvF9egt8","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"1000","counter":"1","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]","error":[{"kind":"branch","id":"proto.018-Proxford.contract.counter_in_the_past","contract":"[PUBLIC_KEY_HASH]","expected":"2","found":"1"}]}] [{"hash":"[OPERATION_HASH]","protocol":"ProxfordSW2S7fvchT1Zgj2avb5UES194neRyYVXoaDGvF9egt8","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"1000","counter":"5","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]","error":[{"kind":"temporary","id":"proto.018-Proxford.contract.counter_in_the_future","contract":"[PUBLIC_KEY_HASH]","expected":"1","found":"5"}]}] @@ -283,7 +283,7 @@ curl -s 'http://localhost:[PORT]/chains/main/mempool/monitor_operations?validate { "validated": [], "refused": [], "outdated": [], "branch_refused": [], "branch_delayed": [], "unprocessed": [] } -curl -s 'http://localhost:[PORT]/chains/main/mempool/monitor_operations?validated=true&outdated=true&branch_delayed=true&refused=true&branch_refused=true' +curl -s 'http://localhost:[PORT]/chains/main/mempool/monitor_operations?applied=true&outdated=true&branch_delayed=true&refused=true&branch_refused=true' [{"hash":"[OPERATION_HASH]","protocol":"ProxfordSW2S7fvchT1Zgj2avb5UES194neRyYVXoaDGvF9egt8","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"1000","counter":"1","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]"},{"hash":"[OPERATION_HASH]","protocol":"ProxfordSW2S7fvchT1Zgj2avb5UES194neRyYVXoaDGvF9egt8","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"0","counter":"1","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]","error":[{"kind":"permanent","id":"proto.018-Proxford.prefilter.fees_too_low"}]},{"hash":"[OPERATION_HASH]","protocol":"ProxfordSW2S7fvchT1Zgj2avb5UES194neRyYVXoaDGvF9egt8","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"1000","counter":"1","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]","error":[{"kind":"branch","id":"proto.018-Proxford.contract.counter_in_the_past","contract":"[PUBLIC_KEY_HASH]","expected":"2","found":"1"}]},{"hash":"[OPERATION_HASH]","protocol":"ProxfordSW2S7fvchT1Zgj2avb5UES194neRyYVXoaDGvF9egt8","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"1000","counter":"5","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]","error":[{"kind":"temporary","id":"proto.018-Proxford.contract.counter_in_the_future","contract":"[PUBLIC_KEY_HASH]","expected":"1","found":"5"}]}] ./octez-client rpc get /chains/main/mempool/filter diff --git a/tezt/tests/expected/RPC_test.ml/Oxford- (mode proxy) RPC regression tests- mempool.out b/tezt/tests/expected/RPC_test.ml/Oxford- (mode proxy) RPC regression tests- mempool.out index 3b3bf43d637c..244ca0559e23 100644 --- a/tezt/tests/expected/RPC_test.ml/Oxford- (mode proxy) RPC regression tests- mempool.out +++ b/tezt/tests/expected/RPC_test.ml/Oxford- (mode proxy) RPC regression tests- mempool.out @@ -1,5 +1,5 @@ -curl -s 'http://localhost:[PORT]/chains/main/mempool/monitor_operations?validated=true&outdated=true&branch_delayed=true&refused=true&branch_refused=true' +curl -s 'http://localhost:[PORT]/chains/main/mempool/monitor_operations?applied=true&outdated=true&branch_delayed=true&refused=true&branch_refused=true' [] [{"hash":"[OPERATION_HASH]","protocol":"ProxfordSW2S7fvchT1Zgj2avb5UES194neRyYVXoaDGvF9egt8","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"1000","counter":"1","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]","error":[{"kind":"branch","id":"proto.018-Proxford.contract.counter_in_the_past","contract":"[PUBLIC_KEY_HASH]","expected":"2","found":"1"}]}] [{"hash":"[OPERATION_HASH]","protocol":"ProxfordSW2S7fvchT1Zgj2avb5UES194neRyYVXoaDGvF9egt8","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"1000","counter":"5","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]","error":[{"kind":"temporary","id":"proto.018-Proxford.contract.counter_in_the_future","contract":"[PUBLIC_KEY_HASH]","expected":"1","found":"5"}]}] @@ -283,7 +283,7 @@ curl -s 'http://localhost:[PORT]/chains/main/mempool/monitor_operations?validate { "validated": [], "refused": [], "outdated": [], "branch_refused": [], "branch_delayed": [], "unprocessed": [] } -curl -s 'http://localhost:[PORT]/chains/main/mempool/monitor_operations?validated=true&outdated=true&branch_delayed=true&refused=true&branch_refused=true' +curl -s 'http://localhost:[PORT]/chains/main/mempool/monitor_operations?applied=true&outdated=true&branch_delayed=true&refused=true&branch_refused=true' [{"hash":"[OPERATION_HASH]","protocol":"ProxfordSW2S7fvchT1Zgj2avb5UES194neRyYVXoaDGvF9egt8","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"1000","counter":"1","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]"},{"hash":"[OPERATION_HASH]","protocol":"ProxfordSW2S7fvchT1Zgj2avb5UES194neRyYVXoaDGvF9egt8","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"0","counter":"1","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]","error":[{"kind":"permanent","id":"proto.018-Proxford.prefilter.fees_too_low"}]},{"hash":"[OPERATION_HASH]","protocol":"ProxfordSW2S7fvchT1Zgj2avb5UES194neRyYVXoaDGvF9egt8","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"1000","counter":"1","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]","error":[{"kind":"branch","id":"proto.018-Proxford.contract.counter_in_the_past","contract":"[PUBLIC_KEY_HASH]","expected":"2","found":"1"}]},{"hash":"[OPERATION_HASH]","protocol":"ProxfordSW2S7fvchT1Zgj2avb5UES194neRyYVXoaDGvF9egt8","branch":"[BRANCH_HASH]","contents":[{"kind":"transaction","source":"[PUBLIC_KEY_HASH]","fee":"1000","counter":"5","gas_limit":"1040","storage_limit":"257","amount":"1000000","destination":"[PUBLIC_KEY_HASH]"}],"signature":"[SIGNATURE]","error":[{"kind":"temporary","id":"proto.018-Proxford.contract.counter_in_the_future","contract":"[PUBLIC_KEY_HASH]","expected":"1","found":"5"}]}] ./octez-client --mode proxy rpc get /chains/main/mempool/filter -- GitLab From 826288ff3f2b757e15c9d1e0376704f14b31ee70 Mon Sep 17 00:00:00 2001 From: Albin Coquereau Date: Tue, 17 Oct 2023 17:56:24 +0200 Subject: [PATCH 5/6] Revert "tezt/tests: update tests that use pending_operations" This reverts commit 7f1714591028a0c60921ff1dfe726c9bc46ff784. --- tezt/tests/baking.ml | 2 +- tezt/tests/double_bake.ml | 8 +- tezt/tests/monitor_operations.ml | 2 +- tezt/tests/node_event_level.ml | 24 ++--- tezt/tests/prevalidator.ml | 160 +++++++++++++++---------------- tezt/tests/stresstest_command.ml | 28 +++--- tezt/tests/tenderbake.ml | 2 +- 7 files changed, 112 insertions(+), 114 deletions(-) diff --git a/tezt/tests/baking.ml b/tezt/tests/baking.ml index be96a39a6170..9e8c85bf860e 100644 --- a/tezt/tests/baking.ml +++ b/tezt/tests/baking.ml @@ -659,7 +659,7 @@ let test_operation_pool_ordering let* mempool = Client.RPC.call client @@ RPC.get_chain_mempool_pending_operations () in - let mgmt_ops = JSON.get "validated" mempool in + let mgmt_ops = JSON.get "applied" mempool in let filename = Filename.temp_file "opool_" ".json" in let json = JSON.as_list mgmt_ops in diff --git a/tezt/tests/double_bake.ml b/tezt/tests/double_bake.ml index de4ab25f931d..6346c2ffab80 100644 --- a/tezt/tests/double_bake.ml +++ b/tezt/tests/double_bake.ml @@ -38,10 +38,10 @@ let is_operation_in_operations ops oph = let ops_list = ops |=> 2 |> as_list in List.exists (fun e -> e |-> "hash" |> as_string = oph) ops_list -let is_operation_in_validated_mempool mempool oph = +let is_operation_in_applied_mempool mempool oph = let open JSON in - let validated_list = as_list (mempool |-> "validated") in - List.exists (fun e -> e |-> "hash" |> as_string = oph) validated_list + let applied_list = as_list (mempool |-> "applied") in + List.exists (fun e -> e |-> "hash" |> as_string = oph) applied_list (* Matches events where the message is of the form: "double baking evidence injected ". @@ -96,7 +96,7 @@ let wait_for_denunciation_injection node client accuser = let* mempool = Client.RPC.call client @@ RPC.get_chain_mempool_pending_operations () in - if is_operation_in_validated_mempool mempool oph then return oph + if is_operation_in_applied_mempool mempool oph then return oph else Test.fail "the denunciation operation was rejected by the mempool" (* This tests aims to detect a double baking evidence with an diff --git a/tezt/tests/monitor_operations.ml b/tezt/tests/monitor_operations.ml index a2ff41e9fd99..1b0b672599ed 100644 --- a/tezt/tests/monitor_operations.ml +++ b/tezt/tests/monitor_operations.ml @@ -105,7 +105,7 @@ let monitor_operations = Constant.bootstrap2 Constant.bootstrap3 in - let* ophs = Node_event_level.get_validated_operation_hash_list client in + let* ophs = Node_event_level.get_applied_operation_hash_list client in (* Step 4 *) (* Bake a block *) let* () = Node_event_level.bake_wait_log node client in diff --git a/tezt/tests/node_event_level.ml b/tezt/tests/node_event_level.ml index 8feb467b48be..751dcd6e0764 100644 --- a/tezt/tests/node_event_level.ml +++ b/tezt/tests/node_event_level.ml @@ -119,14 +119,14 @@ let bake_wait_log ?level ?protocol ?mempool ?ignore_node_mempool node client = (* Get the hash of an operation from the json representing the operation. *) let get_hash op = JSON.(op |-> "hash" |> as_string) -(* Get the list of hashes of the mempool's validated operations (using +(* Get the list of hashes of the mempool's applied operations (using RPC get /chains/main/mempool/pending_operations that provides all the operations in the mempool). *) -let get_validated_operation_hash_list client = +let get_applied_operation_hash_list client = let* pending_ops = Client.RPC.call client @@ RPC.get_chain_mempool_pending_operations () in - return (List.map get_hash JSON.(pending_ops |-> "validated" |> as_list)) + return (List.map get_hash JSON.(pending_ops |-> "applied" |> as_list)) (* Assert that [json] represents an empty list. *) let check_json_is_empty_list ?(fail_msg = "") json = @@ -152,7 +152,7 @@ let check_json_is_empty_list ?(fail_msg = "") json = Scenario: - Step 1: Start a node with event_level:debug, activate the protocol. - Step 2: Inject a transfer operation, test RPCs. - 2a) pending_operations should contain one validated operation. + 2a) pending_operations should contain one applied operation. 2b) operations in block should be empty. - Step 3: Bake, test RPCs. 3a) pending_operations should be empty. @@ -181,13 +181,13 @@ let test_debug_level_misc = Constant.bootstrap2 in Log.info "Injection done." ; - Log.info "2a) pending_operations should contain one validated operation." ; - let* validated_ophs = get_validated_operation_hash_list client_1 in + Log.info "2a) pending_operations should contain one applied operation." ; + let* applied_ophs = get_applied_operation_hash_list client_1 in Log.info "RPC.get_mempool_pending_operations done." ; let oph1 = - match validated_ophs with + match applied_ophs with | [x] -> x - | _ -> Test.fail "Expected exactly one validated operation in mempool." + | _ -> Test.fail "Expected exactly one applied operation in mempool." in Log.info "Hash of injected operation: %s" oph1 ; Log.info "2b) operations in block should be empty." ; @@ -203,11 +203,11 @@ let test_debug_level_misc = let level = level + 1 in let* () = bake_wait_log ?level:(Some level) node_1 client_1 in Log.info "3a) pending_operations should be empty." ; - let* validated_ophs = get_validated_operation_hash_list client_1 in + let* applied_ophs = get_applied_operation_hash_list client_1 in Log.info "RPC.get_mempool_pending_operations done." ; - (match validated_ophs with + (match applied_ophs with | [] -> () - | _ -> Test.fail "List of validated operations in mempool should be empty.") ; + | _ -> Test.fail "List of applied operations in mempool should be empty.") ; Log.info "3b) operations in block should contain the previously pending operation." ; let* ops = Client.RPC.call client_1 @@ RPC.get_chain_block_operations () in @@ -222,7 +222,7 @@ let test_debug_level_misc = | _ -> Test.fail "Fourth list returned by RPC.operations should contain only \ - the previously validated operation.") + the previously applied operation.") | _ -> Test.fail "Fourth list returned by RPC.operations should contain exactly one \ diff --git a/tezt/tests/prevalidator.ml b/tezt/tests/prevalidator.ml index 7dc36fbbaa80..f9e3ea6c79b4 100644 --- a/tezt/tests/prevalidator.ml +++ b/tezt/tests/prevalidator.ml @@ -2747,9 +2747,9 @@ module Revamped = struct check_mempool ~validated:[oph3; oph5] ~refused:[oph2; oph4; oph6] client1 end -let check_operation_is_in_validated_mempool ops oph = +let check_operation_is_in_applied_mempool ops oph = let open JSON in - let ops_list = as_list (ops |-> "validated") in + let ops_list = as_list (ops |-> "applied") in let res = List.exists (fun e -> e |-> "hash" |> as_string = as_string oph) ops_list in @@ -2757,7 +2757,7 @@ let check_operation_is_in_validated_mempool ops oph = Test.fail "Operation %s was not found in the mempool" (JSON.encode oph) type mempool_count = { - validated : int; + applied : int; branch_delayed : int; branch_refused : int; refused : int; @@ -2768,18 +2768,17 @@ type mempool_count = { let count_mempool mempool = let open JSON in - let validated = as_list (mempool |-> "validated") |> List.length in + let applied = as_list (mempool |-> "applied") |> List.length in let branch_delayed = as_list (mempool |-> "branch_delayed") |> List.length in let branch_refused = as_list (mempool |-> "branch_refused") |> List.length in let refused = as_list (mempool |-> "refused") |> List.length in let outdated = as_list (mempool |-> "outdated") |> List.length in let unprocessed = as_list (mempool |-> "unprocessed") |> List.length in let total = - validated + branch_delayed + branch_refused + refused + outdated - + unprocessed + applied + branch_delayed + branch_refused + refused + outdated + unprocessed in { - validated; + applied; branch_delayed; branch_refused; refused; @@ -2790,7 +2789,7 @@ let count_mempool mempool = let pp_mempool_count fmt { - validated; + applied; branch_delayed; branch_refused; refused; @@ -2800,10 +2799,10 @@ let pp_mempool_count fmt } = Format.fprintf fmt - "total: %d - validated: %d, branch_delayed: %d, branch_refused: %d, \ - refused: %d, outdated: %d, unprocessed: %d" + "total: %d - applied: %d, branch_delayed: %d, branch_refused: %d, refused: \ + %d, outdated: %d, unprocessed: %d" total - validated + applied branch_delayed branch_refused refused @@ -3089,7 +3088,7 @@ let refetch_failed_operation = let* mempool_node_1 = Client.RPC.call client_1 @@ RPC.get_chain_mempool_pending_operations () in - check_operation_is_in_validated_mempool mempool_node_1 oph ; + check_operation_is_in_applied_mempool mempool_node_1 oph ; (* Step 5 *) (* Ensure that the mempool of node_2 is empty *) let* mempool_count_after_failed_fetch = @@ -3110,7 +3109,7 @@ let refetch_failed_operation = let* mempool_inject_on_node_2 = Client.RPC.call client_2 @@ RPC.get_chain_mempool_pending_operations () in - check_operation_is_in_validated_mempool mempool_inject_on_node_2 oph ; + check_operation_is_in_applied_mempool mempool_inject_on_node_2 oph ; unit let check_op_removed client op = @@ -3118,7 +3117,7 @@ let check_op_removed client op = Client.RPC.call client @@ RPC.get_chain_mempool_pending_operations () in let open JSON in - let ops_list = pending_ops |-> "validated" |> as_list in + let ops_list = pending_ops |-> "applied" |> as_list in let res = List.exists (fun e -> e |-> "hash" |> as_string = op) ops_list in if res then Test.fail "%s found after removal" op ; unit @@ -3145,7 +3144,7 @@ let bake_empty_block_and_wait_for_flush ~protocol ?(log = false) client node = waiter (* for functions [transfer_and_wait_for_injection], [wait_for_arrival], - and [get_validated_operation_hash_list] *) + and [get_applied_operation_hash_list] *) open Node_event_level (** Injects a transfer operation from [client] and waits for an operation @@ -3168,11 +3167,11 @@ let transfer_and_wait_for_arrival node client amount_int giver_key receiver_key let* () = wait_for in unit -(** Gets the list of hashes of the mempool's validated operations, +(** Gets the list of hashes of the mempool's applied operations, displays it, and returns it. *) -let get_and_log_validated client = - let* ophs = get_validated_operation_hash_list client in - Log.info "Validated operations in mempool:" ; +let get_and_log_applied client = + let* ophs = get_applied_operation_hash_list client in + Log.info "Applied operations in mempool:" ; List.iter (Log.info "- %s") ophs ; return ophs @@ -3181,34 +3180,34 @@ let get_and_log_validated client = of raising [invalid_arg] as using [List.for_all2] directly would do). We use a naive way to check both lists are equal because 1. performances for small lists does not matter and 2. the mempool - does not specify how operations previously validated will be validated + does not specify how operations previously applied will be applied again after banning one operation. *) let oph_list_equal l1 l2 = Int.equal (List.compare_lengths l1 l2) 0 && List.for_all (fun x -> List.mem x l2) l1 && List.for_all (fun x -> List.mem x l1) l2 -(** Gets the list of hashes of the mempool's validated operations, +(** Gets the list of hashes of the mempool's applied operations, and asserts that it is equal to the given list [expected_ophs]. *) -let check_validated_ophs_is client expected_ophs = - let* ophs = get_validated_operation_hash_list client in +let check_applied_ophs_is client expected_ophs = + let* ophs = get_applied_operation_hash_list client in if oph_list_equal ophs expected_ophs then ( - Log.info "Checking validated operations in mempool:" ; + Log.info "Checking applied operations in mempool:" ; List.iter (Log.info "- %s") ophs ; unit) else ( - Log.info "Expected validated operations:" ; + Log.info "Expected applied operations:" ; List.iter (Log.info "- %s") expected_ophs ; - Log.info "Actual validated operations:" ; + Log.info "Actual applied operations:" ; List.iter (Log.info "- %s") ophs ; Test.fail - "Wrong list of validated operations in mempool (use --info to see \ - expected and actual lists).") + "Wrong list of applied operations in mempool (use --info to see expected \ + and actual lists).") (** Test. - Aim: check that, when banning an operation that was validated in the - mempool, the other validated operations are correctly revalidated (in + Aim: check that, when banning an operation that was applied in the + mempool, the other applied operations are correctly reapplied (in the same order). Scenario: @@ -3216,16 +3215,16 @@ let check_validated_ophs_is client expected_ophs = - Step 2: Inject five operations (transfers from five different sources, injected by both nodes in alternance). - Step 3: Ban one of these operations from node_1 (arbitrarily, the third - in the list of validated operations in the mempool of node_1). - - Step 4: Check that validated operations in node_1 are still validated + in the list of applied operations in the mempool of node_1). + - Step 4: Check that applied operations in node_1 are still applied Note: the chosen operations are commutative, so that none of them - becomes branch_delayed instead of validated when one of them is banned. + becomes branch_delayed instead of applied when one of them is banned. *) -let ban_operation_and_check_validated = +let ban_operation_and_check_applied = Protocol.register_test ~__FILE__ - ~title:"mempool ban operation and check validated" + ~title:"mempool ban operation and check applied" ~tags:["mempool"; "node"] @@ fun protocol -> Log.info "Step 1: Start two nodes, connect them, activate the protocol." ; @@ -3286,28 +3285,27 @@ let ban_operation_and_check_validated = in Log.info "Step 3: Ban one of these operations from node_1 (arbitrarily, the third \ - in the list of validated operations in the mempool of node_1)." ; - let* validated_ophs = get_and_log_validated client_1 in - if not (Int.equal (List.compare_length_with validated_ophs 5) 0) then + in the list of applied operations in the mempool of node_1)." ; + let* applied_ophs = get_and_log_applied client_1 in + if not (Int.equal (List.compare_length_with applied_ophs 5) 0) then (* This could theoretically happen: we wait for each transfer to be present in the mempool as "pending", but not to be classified - as "validated". In practice, this does not seem to be a problem. *) + as "applied". In practice, this does not seem to be a problem. *) Test.fail - "Found only %d validated operations in node_1, expected 5." - (List.length validated_ophs) ; - let oph_to_ban = List.nth validated_ophs 2 in + "Found only %d applied operations in node_1, expected 5." + (List.length applied_ophs) ; + let oph_to_ban = List.nth applied_ophs 2 in Log.info "Operation to ban: %s" oph_to_ban ; let* _ = Client.RPC.call client_1 @@ RPC.post_chain_mempool_ban_operation ~data:(Data (`String oph_to_ban)) () in Log.info "Operation %s is now banned." oph_to_ban ; - Log.info - "Step 4: Check that validated operations in node_1 are still validated." ; - let expected_revalidated_ophs = - List.filter (fun oph -> not (String.equal oph_to_ban oph)) validated_ophs + Log.info "Step 4: Check that applied operations in node_1 are still applied." ; + let expected_reapplied_ophs = + List.filter (fun oph -> not (String.equal oph_to_ban oph)) applied_ophs in - let* () = check_validated_ophs_is client_1 expected_revalidated_ophs in + let* () = check_applied_ophs_is client_1 expected_reapplied_ophs in unit (** Waits for an event in [node] signaling the arrival in the mempool @@ -3336,13 +3334,13 @@ let set_filter_no_fee_requirement = ~minimal_nanotez_per_gas_unit:(0, 1) ~minimal_nanotez_per_byte:(0, 1) -(** Checks that arguments [validated] and [refused] are the number of operations +(** Checks that arguments [applied] and [refused] are the number of operations in the mempool of [client] with the corresponding classification, that both sets of operations are disjoint, and that there is no [branch_delayed], [branch_refused], or [unprocessed] operation. - If [log] is [true], also logs the hash and fee of all validated + If [log] is [true], also logs the hash and fee of all applied and refused operations. *) -let check_mempool_ops ?(log = false) client ~validated ~refused = +let check_mempool_ops ?(log = false) client ~applied ~refused = let name = Client.name client in let log_op = if log then fun classification hash fee -> @@ -3358,7 +3356,7 @@ let check_mempool_ops ?(log = false) client ~validated ~refused = Client.RPC.call client @@ RPC.get_chain_mempool_pending_operations () in let open JSON in - (* get (and log) validated and refused operations *) + (* get (and log) applied and refused operations *) let get_ophs_and_log_fees classification = List.map (fun op -> @@ -3367,15 +3365,15 @@ let check_mempool_ops ?(log = false) client ~validated ~refused = oph) (ops |-> classification |> as_list) in - let validated_ophs = get_ophs_and_log_fees "validated" in + let applied_ophs = get_ophs_and_log_fees "applied" in let refused_ophs = get_ophs_and_log_fees "refused" in - (* various checks about validated and refused operations *) + (* various checks about applied and refused operations *) Check.( (* Not using [List.compare_length_with] allows for a more informative error message. The lists are expected to be short anyway. *) - (List.length validated_ophs = validated) + (List.length applied_ophs = applied) int - ~error_msg:(name ^ ": found %L validated operation(s), expected %R.")) ; + ~error_msg:(name ^ ": found %L applied operation(s), expected %R.")) ; Check.( (List.length refused_ophs = refused) int @@ -3383,8 +3381,8 @@ let check_mempool_ops ?(log = false) client ~validated ~refused = List.iter (fun oph -> if List.mem oph refused_ophs then - Test.fail "%s: operation %s is both validated and refused" name oph) - validated_ophs ; + Test.fail "%s: operation %s is both applied and refused" name oph) + applied_ophs ; (* check that other classifications are empty *) List.iter (fun classification -> @@ -3442,15 +3440,15 @@ let iter2_p f l1 l2 = Lwt.join (List.map2 f l1 l2) - Step 2: In [node2]'s mempool filter configuration, set all fields [minimal_*] to 0, so that [node2] accepts operations with any fee. - Step 3: Inject two operations (transfers) in [node2] with respective - fees 1000 and 10 mutez. Check that both operations are [validated] in + fees 1000 and 10 mutez. Check that both operations are [applied] in [node2]'s mempool. - Step 4: Bake with an empty mempool for [node1] to force synchronization - with [node2]. Check that the mempool of [node1] has one validated and one + with [node2]. Check that the mempool of [node1] has one applied and one refused operation. Indeed, [node1] has the default filter config with [minimal_fees] at 100 mutez. - Step 5: In [node1]'s mempool filter configuration, set all fields [minimal_*] to 0. Inject a new operation with fee 5 in [node2], then - bake with an empty mempool. Check that [node1] contains two validated + bake with an empty mempool. Check that [node1] contains two applied operations (the ones with fee 1000 and 5) and one refused operation. Indeed, the operation with fee 10 would now be valid, but it has already been refused so it must not be revalidated. @@ -3460,13 +3458,13 @@ let iter2_p f l1 l2 = Lwt.join (List.map2 f l1 l2) filter used to determine which operations are included in the block does not share its configuration with the mempool's filter, so only the operation of fee 1000 is included. Check that [node1] contains one - validated operation (fee 5) and one refused operation (fee 10), and that - [node2] contains two validated operations. *) + applied operation (fee 5) and one refused operation (fee 10), and that + [node2] contains two applied operations. *) let test_do_not_reclassify = Protocol.register_test ~__FILE__ ~title:"mempool do not reclassify" - ~tags:["mempool"; "node"; "filter"; "refused"; "validated"] + ~tags:["mempool"; "node"; "filter"; "refused"; "applied"] @@ fun protocol -> let step_color = Log.Color.BG.blue in Log.info @@ -3493,8 +3491,8 @@ let test_do_not_reclassify = Log.info ~color:step_color "Step 3: Inject two operations (transfers) in [node2] with respective fees \ - 1000 and 10 mutez. Check that both operations are [validated] in \ - [node2]'s mempool." ; + 1000 and 10 mutez. Check that both operations are [applied] in [node2]'s \ + mempool." ; let waiter_arrival_node1 = wait_for_arrival node1 in let inject_transfer from_key ~fee = let waiter = wait_for_injection node2 in @@ -3515,26 +3513,26 @@ let test_do_not_reclassify = Log.info "Injected transfers in node2 with fees: %s." (String.concat "; " (List.map Int.to_string fees)) ; - let* () = check_mempool_ops ~log:true client2 ~validated:2 ~refused:0 in + let* () = check_mempool_ops ~log:true client2 ~applied:2 ~refused:0 in Log.info ~color:step_color "Step 4: Bake with an empty mempool for [node1] to force synchronization \ - with [node2]. Check that the mempool of [node1] has one validated and one \ + with [node2]. Check that the mempool of [node1] has one applied and one \ refused operation. Indeed, [node1] has the default filter config with \ [minimal_fees] at 100 mutez." ; let* () = bake_empty_block_and_wait_for_flush ~protocol ~log:true client1 node1 in let* () = waiter_arrival_node1 in - let* () = check_mempool_ops ~log:true client1 ~validated:1 ~refused:1 in + let* () = check_mempool_ops ~log:true client1 ~applied:1 ~refused:1 in Log.info ~color:step_color "Step 5: In [node1]'s mempool filter configuration, set all fields \ [minimal_*] to 0. Inject a new operation with fee 5 in [node2], then bake \ - with an empty mempool. Check that [node1] contains two validated \ - operations (the ones with fee 1000 and 5) and one refused operation. \ - Indeed, the operation with fee 10 would now be valid, but it has already \ - been refused so it must not be revalidated." ; + with an empty mempool. Check that [node1] contains two applied operations \ + (the ones with fee 1000 and 5) and one refused operation. Indeed, the \ + operation with fee 10 would now be valid, but it has already been refused \ + so it must not be revalidated." ; let* _ = set_filter_no_fee_requirement client1 in let* () = inject_transfer Constant.bootstrap3 ~fee:5 in let waiter_notify_3_valid_ops = wait_for_notify_n_valid_ops node1 3 in @@ -3542,10 +3540,10 @@ let test_do_not_reclassify = bake_empty_block_and_wait_for_flush ~protocol ~log:true client1 node1 in (* Wait for [node1] to receive a mempool containing 3 operations (the - number of [validated] operations in [node2]), among which will figure + number of [applied] operations in [node2]), among which will figure the operation with fee 10 that has already been [refused] in [node1]. *) let* () = waiter_notify_3_valid_ops in - let* () = check_mempool_ops ~log:true client1 ~validated:2 ~refused:1 in + let* () = check_mempool_ops ~log:true client1 ~applied:2 ~refused:1 in Log.info ~color:step_color "Step 6: Bake for [node1] (normally, i.e. without enforcing a given \ @@ -3554,12 +3552,12 @@ let test_do_not_reclassify = filter used to determine which operations are included in the block does \ not share its configuration with the mempool's filter, so only the \ operation of fee 1000 is included. Check that [node1] contains one \ - validated operation (fee 5) and one refused operation (fee 10), and that \ - [node2] contains 2 validated operations." ; + applied operation (fee 5) and one refused operation (fee 10), and that \ + [node2] contains 2 applied operations." ; let* () = bake_wait_log ~protocol node1 client1 in let* () = check_n_manager_ops_in_block ~log:true client1 1 in - let* () = check_mempool_ops ~log:true client1 ~validated:1 ~refused:1 in - let* () = check_mempool_ops ~log:true client2 ~validated:2 ~refused:0 in + let* () = check_mempool_ops ~log:true client1 ~applied:1 ~refused:1 in + let* () = check_mempool_ops ~log:true client2 ~applied:2 ~refused:0 in unit let get_refused_operation_hash_list_v0 mempool = @@ -3894,10 +3892,10 @@ let test_request_operations_peer = in let* _ = transfer_1 in let* oph = - let* ophs = get_validated_operation_hash_list client_1 in + let* ophs = get_applied_operation_hash_list client_1 in match ophs with | [oph] -> return oph - | _ -> Test.fail "Validated mempool should contain exactly one operation" + | _ -> Test.fail "Applied mempool should contain exactly one operation" in Log.info "%s" step4_msg ; let wait_mempool = wait_for_arrival_of_ophash oph node_2 in @@ -3939,7 +3937,7 @@ let register ~protocols = Revamped.test_mempool_config_operation_filtering protocols ; forge_pre_filtered_operation protocols ; refetch_failed_operation protocols ; - ban_operation_and_check_validated protocols ; + ban_operation_and_check_applied protocols ; test_do_not_reclassify protocols ; test_pending_operation_version protocols ; force_operation_injection protocols ; diff --git a/tezt/tests/stresstest_command.ml b/tezt/tests/stresstest_command.ml index d935fe0e4f31..da1866e26802 100644 --- a/tezt/tests/stresstest_command.ml +++ b/tezt/tests/stresstest_command.ml @@ -49,19 +49,19 @@ let wait_for_n_injections n node = do not expect to terminate. *) let non_terminating_process (_process : Process.t) = () -(** Check that the mempool contains [n] validated operations. Also - return these validated operations (which will usually be transactions +(** Check that the mempool contains [n] applied operations. Also + return these applied operations (which will usually be transactions injected by the transfer command). *) -let check_n_validated_operations_in_mempool n client = +let check_n_applied_operations_in_mempool n client = let* mempool_ops = Client.RPC.call client @@ RPC.get_chain_mempool_pending_operations () in - let validated_ops = JSON.(mempool_ops |-> "validated" |> as_list) in + let applied_ops = JSON.(mempool_ops |-> "applied" |> as_list) in Check.( - (List.length validated_ops = n) + (List.length applied_ops = n) int - ~error_msg:"Found %L validated operations in the mempool; expected %R.") ; - return validated_ops + ~error_msg:"Found %L applied operations in the mempool; expected %R.") ; + return applied_ops (** Check that the head block contains [n] manager operations. Also return these manager operations (which will usually be transactions @@ -82,7 +82,7 @@ let check_n_manager_operations_in_head n client = More precisely, this test checks that: - After letting the [stresstest] command run for a while on a - given head, the mempool contains exactly one validated operation by + given head, the mempool contains exactly one applied operation by each source account provided to the command. The same goes for manager operations included in the next baked block. (Note that this is true in a minimalist context where no operation injection @@ -211,7 +211,7 @@ let test_stresstest_sources_format = operations (check that they number [n_bootstraps_to_use] and the set of their sources is [expected_pkhs]). - Wait for [n_bootstraps_to_use] injections. - - Inspect the mempool's validated operations (check that they + - Inspect the mempool's applied operations (check that they number [n_bootstraps_to_use] and the set of their sources is [expected_pkhs]). *) let rec loop ~first_iteration ~repeat = @@ -254,7 +254,7 @@ let test_stresstest_sources_format = it [repeat] times. *) let* () = Lwt_unix.sleep 5. in let* ops = - check_n_validated_operations_in_mempool n_bootstraps_to_use client + check_n_applied_operations_in_mempool n_bootstraps_to_use client in check_pkhs ops ; if repeat <= 1 then unit @@ -265,7 +265,7 @@ let test_stresstest_sources_format = (** Run the [stresstest] command in an isolated node with an explicit parameter [transfers], that makes it stop after injecting this number of transfers. Then check that the mempool contains this many - validated operations, and bake a block and check that it also + applied operations, and bake a block and check that it also contains the same number of manager operations. *) let test_stresstest_n_transfers = Protocol.register_test @@ -293,7 +293,7 @@ let test_stresstest_n_transfers = (* Bake some blocks to reach required level for stresstest command. *) let* () = repeat 2 (fun () -> Client.bake_for_and_wait client) in let* () = Client.stresstest ~transfers:n_transfers ~source_aliases client in - let* _ = check_n_validated_operations_in_mempool n_transfers client in + let* _ = check_n_applied_operations_in_mempool n_transfers client in let* () = Client.bake_for_and_wait client in let* _ = check_n_manager_operations_in_head n_transfers client in unit @@ -323,7 +323,7 @@ let wait_for_n_arrivals n node = We check that after the initial command calls and after each subsequent baking, the mempool of the central node eventually - contains [n_nodes * n_bootstraps_per_node] validated operations. We + contains [n_nodes * n_bootstraps_per_node] applied operations. We also check that the baked blocks contain the same number of manager operations. *) let test_stresstest_multiple_nodes = @@ -439,7 +439,7 @@ let test_stresstest_multiple_nodes = for it [repeat] times. *) let* () = Lwt_unix.sleep 5. in let* _ = - check_n_validated_operations_in_mempool n_bootstraps_total central_client + check_n_applied_operations_in_mempool n_bootstraps_total central_client in if repeat <= 1 then unit else loop ~first_iteration:false ~repeat:(repeat - 1) diff --git a/tezt/tests/tenderbake.ml b/tezt/tests/tenderbake.ml index f173400cf704..a7975710e009 100644 --- a/tezt/tests/tenderbake.ml +++ b/tezt/tests/tenderbake.ml @@ -283,7 +283,7 @@ let test_manual_bake = in let op_hashes = JSON.( - pending_ops |-> "validated" |> as_list + pending_ops |-> "applied" |> as_list |> List.map (fun op -> op |-> "hash" |> as_string)) in Check.(list_mem string) -- GitLab From b570c2edfccb144c6db86c576c60799983ca1ac3 Mon Sep 17 00:00:00 2001 From: Albin Coquereau Date: Tue, 17 Oct 2023 17:56:34 +0200 Subject: [PATCH 6/6] Revert "shell: increase RPC default value" This reverts commit f502afc7c7db5255d9b74f7d950575bff0cef6ee. --- src/lib_shell_services/block_services.ml | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/lib_shell_services/block_services.ml b/src/lib_shell_services/block_services.ml index d9e144525fff..898acde03dab 100644 --- a/src/lib_shell_services/block_services.ml +++ b/src/lib_shell_services/block_services.ml @@ -797,7 +797,7 @@ module Make (Proto : PROTO) (Next_proto : PROTO) = struct mk_version_informations ~supported:[version_0; version_1] ~latest:Version_1 - ~default:Version_1 + ~default:Version_0 () let metadata_query = @@ -806,11 +806,8 @@ module Make (Proto : PROTO) (Next_proto : PROTO) = struct object method version = version end) - |+ field - "version" - (version_arg metadata_versions) - metadata_versions.default - (fun t -> t#version) + |+ field "version" (version_arg metadata_versions) Version_0 (fun t -> + t#version) |> seal let metadata = @@ -879,7 +876,7 @@ module Make (Proto : PROTO) (Next_proto : PROTO) = struct mk_version_informations ~supported:[version_0; version_1] ~latest:Version_1 - ~default:Version_1 + ~default:Version_0 () let force_operation_metadata_query = @@ -1154,7 +1151,7 @@ module Make (Proto : PROTO) (Next_proto : PROTO) = struct mk_version_informations ~supported:[version_0; version_1] ~latest:Version_1 - ~default:Version_1 + ~default:Version_0 () let operations_query = @@ -1487,7 +1484,7 @@ module Make (Proto : PROTO) (Next_proto : PROTO) = struct {version = Version_2; use_legacy_attestation_name = false}; ] ~latest:Version_2 - ~default:Version_2 + ~default:Version_1 () let pending_query = @@ -1621,7 +1618,7 @@ module Make (Proto : PROTO) (Next_proto : PROTO) = struct mk_version_informations ~supported:[version_0; version_1] ~latest:Version_1 - ~default:Version_1 + ~default:Version_0 () let mempool_query = @@ -1828,7 +1825,7 @@ module Make (Proto : PROTO) (Next_proto : PROTO) = struct let f = make_call0 S.raw_header ctxt in fun ?(chain = `Main) ?(block = `Head 0) () -> f chain block () () - let metadata ctxt ?(version = S.metadata_versions.default) = + let metadata ctxt ?(version = Version_0) = let open Lwt_result_syntax in let f = make_call0 S.metadata ctxt in fun ?(chain = `Main) ?(block = `Head 0) () -> -- GitLab