From 85b96b7c9e52f32376d1f2e708105984e0717812 Mon Sep 17 00:00:00 2001 From: renancloudwalk <53792026+renancloudwalk@users.noreply.github.com> Date: Mon, 17 Jun 2024 12:18:06 -0300 Subject: [PATCH] chore: executions restart the heartbeat (#1129) --- src/eth/consensus/mod.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/eth/consensus/mod.rs b/src/eth/consensus/mod.rs index 536362da5..c3139ce1f 100644 --- a/src/eth/consensus/mod.rs +++ b/src/eth/consensus/mod.rs @@ -206,7 +206,7 @@ impl Consensus { transaction_execution_queue: Arc::new(Mutex::new(Vec::new())), importer_config, role: RwLock::new(Role::Follower), - heartbeat_timeout: Duration::from_millis(rand::thread_rng().gen_range(1200..1500)), // Adjust as needed + heartbeat_timeout: Duration::from_millis(rand::thread_rng().gen_range(250..350)), // Adjust as needed my_address: my_address.clone(), grpc_address, reset_heartbeat_signal: tokio::sync::Notify::new(), @@ -664,13 +664,14 @@ impl AppendEntryService for AppendEntryServiceImpl { ) -> Result, Status> { let executions = request.into_inner().executions; //TODO Process the transaction executions here - for execution in executions { - println!("Received transaction execution: {:?}", execution); - } + tracing::info!(executions = executions.len(), "appending executions"); + + let consensus = self.consensus.lock().await; + consensus.reset_heartbeat_signal.notify_waiters(); Ok(Response::new(AppendTransactionExecutionsResponse { status: StatusCode::AppendSuccess as i32, - message: "Transaction Executions appended successfully".into(), + message: "transaction Executions appended successfully".into(), last_committed_block_number: 0, })) }