Downgrade rate limited log (#5381)

* Address review comments

* Downgrade log for by_root requests
This commit is contained in:
Pawan Dhananjay 2024-03-11 04:35:24 +05:30 committed by GitHub
parent f93844e63b
commit 54b1c229e1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 5 deletions

2
Cargo.lock generated
View File

@ -9960,7 +9960,7 @@ dependencies = [
[[package]] [[package]]
name = "yamux" name = "yamux"
version = "0.13.1" version = "0.13.1"
source = "git+https://github.com/sigp/rust-yamux.git#6689e227a48258a52347cd1d984adfc94afc6f7a" source = "git+https://github.com/sigp/rust-yamux.git#12a23aa0e34b7807c0c5f87f06b3438f7d6c2ed0"
dependencies = [ dependencies = [
"futures", "futures",
"instant", "instant",

View File

@ -310,11 +310,16 @@ where
Err(RateLimitedErr::TooLarge) => { Err(RateLimitedErr::TooLarge) => {
// we set the batch sizes, so this is a coding/config err for most protocols // we set the batch sizes, so this is a coding/config err for most protocols
let protocol = req.versioned_protocol().protocol(); let protocol = req.versioned_protocol().protocol();
if matches!(protocol, Protocol::BlocksByRange) if matches!(
|| matches!(protocol, Protocol::BlobsByRange) protocol,
{ Protocol::BlocksByRange
debug!(self.log, "By range request will never be processed"; "request" => %req, "protocol" => %protocol); | Protocol::BlobsByRange
| Protocol::BlocksByRoot
| Protocol::BlobsByRoot
) {
debug!(self.log, "Request too large to process"; "request" => %req, "protocol" => %protocol);
} else { } else {
// Other protocols shouldn't be sending large messages, we should flag the peer kind
crit!(self.log, "Request size too large to ever be processed"; "protocol" => %protocol); crit!(self.log, "Request size too large to ever be processed"; "protocol" => %protocol);
} }
// send an error code to the peer. // send an error code to the peer.