From 0282a02b49996112809b7f50544bf5b4fb54d299 Mon Sep 17 00:00:00 2001 From: akhercha Date: Fri, 1 Nov 2024 12:05:54 +0100 Subject: [PATCH] dev(better_theoros): --- rust/theoros/src/services/hyperlane/mod.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/rust/theoros/src/services/hyperlane/mod.rs b/rust/theoros/src/services/hyperlane/mod.rs index 6ae36d2..8922aba 100644 --- a/rust/theoros/src/services/hyperlane/mod.rs +++ b/rust/theoros/src/services/hyperlane/mod.rs @@ -63,6 +63,8 @@ impl HyperlaneService { } futures::future::join_all(futures).await; + // TODO: At the moment, we only process updates when ALL validators have signed a message. + // We should instead use a quorum method - if 66% have signed, consider it ok. for &nonce in &unsigned_nonces { if self.all_validators_signed_nonce(&validators_fetchers, nonce).await { if let Err(e) = self.store_event_updates(nonce).await { @@ -147,9 +149,16 @@ impl HyperlaneService { } // Send websocket notification - if let Err(e) = self.storage.feeds_updated_tx().send(NewUpdatesAvailableEvent::New) { - tracing::error!("😨 Failed to send websocket notification: {:?}", e); + match self.storage.feeds_updated_tx().send(NewUpdatesAvailableEvent::New) { + Ok(_) => { + tracing::debug!("πŸ•ΈοΈ [Websocket] πŸ”” Successfully sent websocket notification"); + } + Err(e) => { + // Only log as debug since this is expected when there are no subscribers + tracing::debug!("πŸ•ΈοΈ [Websocket] πŸ“ͺ No active websocket subscribers to receive notification: {}", e); + } } + Ok(()) } }