From 5586bc8f08dffcd9d4ca731d269f20de2b18a49e Mon Sep 17 00:00:00 2001 From: Bastian Gruber Date: Wed, 17 Apr 2024 15:43:36 -0300 Subject: [PATCH] fix: remove storage request for handling echo and ready --- .../src/double_echo/mod.rs | 56 ++++++------------- 1 file changed, 16 insertions(+), 40 deletions(-) diff --git a/crates/topos-tce-broadcast/src/double_echo/mod.rs b/crates/topos-tce-broadcast/src/double_echo/mod.rs index cc983faea..112c7e5a7 100644 --- a/crates/topos-tce-broadcast/src/double_echo/mod.rs +++ b/crates/topos-tce-broadcast/src/double_echo/mod.rs @@ -233,26 +233,14 @@ impl DoubleEcho { validator_id: ValidatorId, signature: Signature, ) { - match self.validator_store.get_certificate(&certificate_id) { - Err(storage_error) => error!( - "Unable to get the Certificate {} due to {:?}", - &certificate_id, storage_error - ), - Ok(Some(_)) => debug!( - "Certificate {} already delivered, ignoring echo", - &certificate_id - ), - Ok(None) => { - let _ = self - .task_manager_message_sender - .send(DoubleEchoCommand::Echo { - validator_id, - certificate_id, - signature, - }) - .await; - } - } + let _ = self + .task_manager_message_sender + .send(DoubleEchoCommand::Echo { + validator_id, + certificate_id, + signature, + }) + .await; } pub async fn handle_ready( @@ -261,25 +249,13 @@ impl DoubleEcho { validator_id: ValidatorId, signature: Signature, ) { - match self.validator_store.get_certificate(&certificate_id) { - Err(storage_error) => error!( - "Unable to get the Certificate {} due to {:?}", - &certificate_id, storage_error - ), - Ok(Some(_)) => debug!( - "Certificate {} already delivered, ignoring echo", - &certificate_id - ), - Ok(None) => { - let _ = self - .task_manager_message_sender - .send(DoubleEchoCommand::Ready { - validator_id, - certificate_id, - signature, - }) - .await; - } - } + let _ = self + .task_manager_message_sender + .send(DoubleEchoCommand::Ready { + validator_id, + certificate_id, + signature, + }) + .await; } }