Skip to content
Open
Show file tree
Hide file tree
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
12 changes: 10 additions & 2 deletions massa-protocol-worker/src/handlers/block_handler/retrieval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,16 @@ impl RetrievalThread {
}
};
if !rest.is_empty() {
println!("Error: message not fully consumed");
return;
// A valid message prefix followed by trailing bytes must not
// tear down this long-lived shared retrieval thread (doing so
// would let a single peer deny block handling for everyone).
// Skip the malformed message and keep serving other peers.
warn!(
"peer {} sent a block message with {} unexpected trailing byte(s); ignoring it",
peer_id,
rest.len()
);
continue;
}
match message {
BlockMessage::DataRequest{block_id, block_info} => {
Expand Down
12 changes: 10 additions & 2 deletions massa-protocol-worker/src/handlers/operation_handler/retrieval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,16 @@ impl RetrievalThread {
}
};
if !rest.is_empty() {
println!("Error: message not fully consumed");
return;
// A valid message prefix followed by trailing bytes must not
// tear down this long-lived shared retrieval thread (doing so
// would let a single peer deny operation handling for everyone).
// Skip the malformed message and keep serving other peers.
warn!(
"peer {} sent an operation message with {} unexpected trailing byte(s); ignoring it",
peer_id,
rest.len()
);
continue;
}
match message {
OperationMessage::Operations(ops) => {
Expand Down
Loading