Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(bolt-sidecar): log unexpected websocket messages #680

Merged
merged 2 commits into from
Jan 15, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions bolt-sidecar/src/api/commitments/firewall/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use tokio_tungstenite::{
tungstenite::{self, Message},
MaybeTlsStream, WebSocketStream,
};
use tracing::{error, info, trace, warn};
use tracing::{debug, error, info, trace, warn};
use uuid::Uuid;

use crate::{
Expand Down Expand Up @@ -222,7 +222,22 @@ impl Future for CommitmentRequestProcessor {
warn!(?rpc_url, "websocket connection closed by server");
return Poll::Ready(InterruptReason::ConnectionClosed);
}
Ok(_) => {} // ignore other message types
Ok(Message::Binary(data)) => {
debug!(
?rpc_url,
bytes_len = data.len(),
"received unexpected binary message"
);
}
Ok(Message::Ping(_)) => {
trace!(?rpc_url, "received ping message");
}
Ok(Message::Pong(_)) => {
trace!(?rpc_url, "received pong message");
}
Ok(Message::Frame(_)) => {
debug!(?rpc_url, "received unexpected raw frame");
}
Err(e) => {
error!(?e, ?rpc_url, "error reading message from websocket connection");
}
Expand Down