From 0bb90f2d409cdb6b68a334748100b061cb9b5d1d Mon Sep 17 00:00:00 2001 From: Victor Allombert Date: Wed, 7 Aug 2024 14:10:32 +0200 Subject: [PATCH 1/3] Node: remove external RPC process experimental warning --- src/bin_node/node_run_command.ml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/bin_node/node_run_command.ml b/src/bin_node/node_run_command.ml index 0837e2b8e9fc..059a131a55b6 100644 --- a/src/bin_node/node_run_command.ml +++ b/src/bin_node/node_run_command.ml @@ -181,16 +181,6 @@ module Event = struct ~pp2:History_mode.pp ("stored_history_mode", History_mode.encoding) - let warn_external_rpc_process_usage = - declare_0 - ~section - ~name:"warn_external_rpc_process_usage" - ~msg: - "the external RPC process is enabled. This is an unstable feature that \ - should be use with care. Please report encountered issues if any." - ~level:Warning - () - let enable_http_cache_headers_for_local = declare_0 ~section @@ -707,8 +697,6 @@ let init_rpc (config : Config_file.t) (node : Node.t) internal_events = let* rpc_server = if config.rpc.external_listen_addrs = [] then return No_server else - (* Warn that the feature is experimental.*) - let*! () = Event.(emit warn_external_rpc_process_usage) () in (* Starts the node's local RPC server that aims to handle the RPCs forwarded by the rpc_process, if they cannot be processed by the rpc_process itself. *) -- GitLab From fb1a13e93bc90311eeff922538478bc60677bfee Mon Sep 17 00:00:00 2001 From: Victor Allombert Date: Wed, 7 Aug 2024 14:10:52 +0200 Subject: [PATCH 2/3] Doc: remove external process experimental notice --- docs/developer/rpc.rst | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/docs/developer/rpc.rst b/docs/developer/rpc.rst index b0009758f6ba..c2f48f50529e 100644 --- a/docs/developer/rpc.rst +++ b/docs/developer/rpc.rst @@ -6,16 +6,16 @@ Overview The Octez node provides a JSON/RPC interface. Note that it is an RPC interface, and it is JSON based, but it does not follow the “JSON-RPC” -protocol. +protocol. Some RPC calls are computationally intensive. They can slow down the node and even temporarily block synchronization with its peers and get the -node out of sync. +node out of sync. The JSON/RPC interface is not active by default mainly for security reasons. The operator should be explicit about exposing endpoints and possibly add a whitelist if necessary. -See :ref:`default_acl` for limiting access to certain RPCs. +See :ref:`default_acl` for limiting access to certain RPCs. Another reason is the potential performance impact. See :ref:`activating_rpc` section. @@ -24,10 +24,11 @@ activated in two different modes. - Local RPC server: this server operates in the same process as the Tezos node and serves data directly from the node. -- External RPC server (experimental feature): this server operates in a separate process and - forwards requests to the Local RPC server. However, some RPC requests - are handled directly by the External RPC server, which we refer to as - being handled locally. This mode prevents the node from blocking. +- External RPC server: this server operates in a separate process and + forwards requests to the Local RPC server. However, some RPC + requests are handled directly by the External RPC server, which we + refer to as being handled locally. This mode prevents the node from + blocking. .. figure:: images/rpc_intro.png :alt: Local and External RPC servers @@ -73,8 +74,9 @@ just want to explore the RPC interface on your own, you would run:: ./octez-node run --rpc-addr localhost -To run an External RPC server (experimental feature), use instead ``--external-rpc-addr`` -in the command line. Then an External RPC server is started at port ``18731``. +To run an External RPC server, use instead ``--external-rpc-addr`` in +the command line. Then an External RPC server is started at port +``18731``. :: @@ -121,7 +123,7 @@ format. For example, the previous RPC call, that does not require an input, would display on the standard output:: { "balance": "4000000000000" } - + When calling an RPC that requires an input through command line, you will be prompted to provide the JSON input in your default configured text editor. Alternatively, you can provide @@ -130,11 +132,11 @@ the JSON input using command :: octez-admin-client rpc post with - + Don't forget to quote the JSON according to your shell rules. -External RPC server (experimental feature) ------------------------------------------- +External RPC server +------------------- Thanks to this feature, the node won't experience slowdowns on computationally intensive RPC calls. This significantly reduces the load on the Tezos node and @@ -149,10 +151,6 @@ allows to run performance evaluations easily. Along with this benchmark framework, former results are stored in the dedicated :src:`devtools/benchmarks-tools/bench_RPS/results.json` file. -.. warning:: - It is not recommended to use External RPC server yet, as - it is still an experimental feature. - RPC versions ------------ @@ -178,7 +176,7 @@ Resto is responsible for the following: - Providing primitives to describe services. - Assembling the services into directories which are essentially maps of paths and methods to services. -- Spinning up a Cohttp server that serves the chosen directory. +- Spinning up a Cohttp server that serves the chosen directory. - Making requests to services as a client. The client automatically builds paths based on parameters to the service, assembles other HTTP details, and parses the response. @@ -206,5 +204,4 @@ calls with their input/output. A useful tool to manipulate JSON is `jq `_. To enable the logs for RPC-related components, prepend Tezos scripts -with ``TEZOS_LOG="*->debug"`` and ``COHTTP_DEBUG=true``. - +with ``TEZOS_LOG="*->debug"`` and ``COHTTP_DEBUG=true``. -- GitLab From 10f42453c6169ea3b9673cae869aa3efc99a6e93 Mon Sep 17 00:00:00 2001 From: Victor Allombert Date: Wed, 7 Aug 2024 14:15:42 +0200 Subject: [PATCH 3/3] Changelog: introduce external RPC process --- CHANGES.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index f1662917efb5..5a70931f8c8c 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -85,6 +85,10 @@ Node - Removed ParisB mempool plugin. (MR :gl:`!14031`) +- Introduced the external RPC process to reduce the load of the node + when answering heavy RPCs. This can be enabled using + ``--external-rpc-addr`` (MR :gl:`!9490`) + Client ------ -- GitLab