vielite's blog

QA-03: BlockSync Processes Invalid Peer Data Without Penalty

March 31, 2026
3 min read
Table of Contents
monad-qa-03-invalid-peer-data-without-penalty

Summary

BlockSync performs expensive validation on headers and payloads received from peers, but it does not score, quarantine, or deprioritize peers that repeatedly send invalid data.

Details

Unexpected or malicious responses still trigger verification work. When validation fails, the node increments metrics and retries with another peer, but the offender remains fully eligible for future selection.

2025-09-monad/bft/monad-blocksync/src/blocksync.rs
if Self::verify_block_headers(block_range, block_headers.as_slice()) {
entry.remove();
self.metrics.blocksync_events.headers_response_successful += 1;
} else {
debug!(?sender, ?block_range, "blocksync: headers response verifcation failed");
assert!(sender.is_some());
self.metrics.blocksync_events.headers_validation_failed += 1;
// headers response from peer is invalid, re-request after timeout
}
2025-09-monad/bft/monad-blocksync/src/blocksync.rs
fn pick_peer(
self_node_id: &NodeId<CertificateSignaturePubKey<ST>>,
current_epoch: Epoch,
val_epoch_map: &ValidatorsEpochMapping<VTF, SCT>,
override_peers: &[NodeId<CertificateSignaturePubKey<ST>>],
rng: &mut ChaCha8Rng,
) -> NodeId<CertificateSignaturePubKey<ST>> {

Impact

An attacker can repeatedly feed invalid responses and force CPU and bandwidth expenditure while remaining in the candidate set for retries.

Recommendation

Introduce lightweight peer scoring with temporary penalties for invalid responses.