From fe26ad21e5c5c31494707b5f9a84ef45f6738ebe Mon Sep 17 00:00:00 2001 From: Thomas Letan Date: Mon, 9 Sep 2024 11:52:20 +0200 Subject: [PATCH] EVM Node: Fix the `octez_evm_node_head` metrics for the RPC node MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Prior the this changeset, the metrics is only set in the `apply_blueprint` routine, something the RPC mode never calls. We propose to add it to the main event loop of the RPC mode as well. We don’t fix its companion `octez_evm_node_confirmed_head` for now, as it’s less interesting for the RPC mode (it does not influence the behavior of the RPC mode). --- etherlink/CHANGES_NODE.md | 6 ++++++ etherlink/bin_node/lib_dev/rpc.ml | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/etherlink/CHANGES_NODE.md b/etherlink/CHANGES_NODE.md index c8a9e845dc60..3b55a583924a 100644 --- a/etherlink/CHANGES_NODE.md +++ b/etherlink/CHANGES_NODE.md @@ -10,6 +10,12 @@ the `patch` commands. More precisely, patching the state `N` affects the replay of block `N+1`. (!14809) +### Bug fixes + +#### Metrics + +- Fix `octez_evm_node_head` for the RPC mode. (!14849) + ## Version 0.2 (2024-09-05) This release introduces a number of quality of life improvements for operators diff --git a/etherlink/bin_node/lib_dev/rpc.ml b/etherlink/bin_node/lib_dev/rpc.ml index 8304ac33d6f4..8a2a9d599b4a 100644 --- a/etherlink/bin_node/lib_dev/rpc.ml +++ b/etherlink/bin_node/lib_dev/rpc.ml @@ -66,10 +66,11 @@ let main ~data_dir ~evm_node_endpoint ~(config : Configuration.t) = ~time_between_blocks ~evm_node_endpoint ~next_blueprint_number - @@ fun number blueprint -> + @@ fun (Qty number) blueprint -> let* () = when_ (Option.is_some blueprint.kernel_upgrade) @@ fun () -> - Evm_ro_context.preload_kernel_from_level ctxt number + Evm_ro_context.preload_kernel_from_level ctxt (Qty number) in + Metrics.set_level ~level:number ; Blueprints_watcher.notify blueprint ; return_unit -- GitLab