From be06e4f71c682191cb1c177538d047a06e821782 Mon Sep 17 00:00:00 2001 From: m-lord-renkse <160488334+m-lord-renkse@users.noreply.github.com> Date: Wed, 20 Nov 2024 10:40:03 +0100 Subject: [PATCH 1/2] [EASY] Add instrumentation to update_events() (#3126) # Description It is very hard to debug via logs any issue related with the indexer. Added an instrumentation to differentiate the origin (contract) of the indexer. --- crates/shared/src/event_handling.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/shared/src/event_handling.rs b/crates/shared/src/event_handling.rs index 9534e513db..79b846d613 100644 --- a/crates/shared/src/event_handling.rs +++ b/crates/shared/src/event_handling.rs @@ -12,6 +12,7 @@ use { futures::{future, Stream, StreamExt, TryStreamExt}, std::sync::Arc, tokio::sync::Mutex, + tracing::Instrument, }; // We expect that there is never a reorg that changes more than the last n @@ -537,7 +538,12 @@ where S: EventStoring + Send + Sync, { async fn run_maintenance(&self) -> Result<()> { - self.lock().await.update_events().await + let mut inner = self.lock().await; + let address = inner.contract.get_events().filter.address; + inner + .update_events() + .instrument(tracing::info_span!("address", ?address)) + .await } fn name(&self) -> &str { From ee4a8ab0529cf98d15030409d25e59a76e4f8b65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Strug?= <47604705+mstrug@users.noreply.github.com> Date: Wed, 20 Nov 2024 12:12:47 +0100 Subject: [PATCH 2/2] Remove `crates` vscode extension dependency from devcontainer (#3132) # Description Devcontainer json definition file contains vscode extension dependency: `crates` which is deprecated. As this extension is only an utility for checking `Cargo.toml` dependency creates versions and is not needed for devcontainer to work on our codebase, we decided to drop that extension from our devcontainer json definition file. Anyone can still use `crates` or similar extension (like `dependi`) in devcontainer by installing it locally in vscode. Reference discussion: [link](https://cowservices.slack.com/archives/C0375NV72SC/p1731961303020439) # Changes Updated `devcontainer.json` file. ## How to test Open vscode from `services` folder and on popup window click option "Open in devcontainer" (docker daemon is required to operate). Wait for containers setup and validation by rust analyzer. --- .devcontainer/devcontainer.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index c4d49550c8..00c2bca3c9 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -41,8 +41,7 @@ ] }, "extensions": [ - "rust-lang.rust-analyzer", - "serayuzgur.crates" + "rust-lang.rust-analyzer" ] } },