mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
fix: remove single body response check (#3783)
This commit is contained in:
@ -119,11 +119,11 @@ where
|
|||||||
// Increment total downloaded metric
|
// Increment total downloaded metric
|
||||||
self.metrics.total_downloaded.increment(response_len as u64);
|
self.metrics.total_downloaded.increment(response_len as u64);
|
||||||
|
|
||||||
// Malicious peers often return a single block. Mark responses with single
|
// TODO: Malicious peers often return a single block even if it does not exceed the soft
|
||||||
// block when more than 1 were requested invalid.
|
// response limit (2MB). this could be penalized by checking if this block and the
|
||||||
// TODO: Instead of marking single block responses invalid, calculate
|
// next one exceed the soft response limit, if not then peer either does not have the next
|
||||||
// soft response size lower limit and use that for filtering.
|
// block or deliberately sent a single block.
|
||||||
if bodies.is_empty() || (request_len != 1 && response_len == 1) {
|
if bodies.is_empty() {
|
||||||
return Err(DownloadError::EmptyResponse)
|
return Err(DownloadError::EmptyResponse)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user