Skip to content

Commit efbc46c

Browse files
committed
feat: add ReplacementMessageReceived msg from batcher
1 parent 728c838 commit efbc46c

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

batcher/aligned-batcher/src/connection.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use aligned_sdk::{
66
};
77
use futures_util::{stream::SplitSink, SinkExt};
88
use lambdaworks_crypto::merkle_tree::merkle::MerkleTree;
9-
use log::{error, info};
9+
use log::{error, debug};
1010
use serde::Serialize;
1111
use tokio::{net::TcpStream, sync::RwLock};
1212
use tokio_tungstenite::{
@@ -45,7 +45,7 @@ pub(crate) async fn send_batch_inclusion_data_responses(
4545
Ok(_) => (),
4646
}
4747

48-
info!("Response sent");
48+
debug!("Response sent");
4949
}
5050

5151
Ok(())

batcher/aligned-batcher/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -669,6 +669,8 @@ impl Batcher {
669669
if let Err(e) = old_sink.close().await {
670670
// we dont want to exit here, just log the error
671671
warn!("Error closing sink: {e:?}");
672+
} else {
673+
info!("Old websocket sink closed");
672674
}
673675
} else {
674676
warn!(
@@ -693,6 +695,10 @@ impl Batcher {
693695
"Replacement entry is valid, incrementing fee for sender: {:?}, nonce: {:?}, max_fee: {:?}",
694696
replacement_entry.sender, replacement_entry.nonced_verification_data.nonce, replacement_max_fee
695697
);
698+
send_message(
699+
ws_conn_sink.clone(),
700+
ResponseMessage::ReplacementMessageReceived,
701+
).await;
696702

697703
// remove the old entry and insert the new one
698704
// note that the entries are considered equal for the priority queue

batcher/aligned-sdk/src/core/types.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,8 @@ pub enum ResponseMessage {
366366
InvalidReplacementMessage,
367367
AddToBatchError,
368368
EthRpcError,
369-
InvalidPaymentServiceAddress(Address, Address)
369+
InvalidPaymentServiceAddress(Address, Address),
370+
ReplacementMessageReceived,
370371
}
371372

372373
#[derive(Debug, Clone, Copy)]

0 commit comments

Comments
 (0)