mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-08 01:05:47 +00:00
penalize blob peer on invalid blobs
This commit is contained in:
@@ -855,8 +855,13 @@ impl<T: BeaconChainTypes> BlockLookups<T> {
|
|||||||
)
|
)
|
||||||
| BlockError::AvailabilityCheck(AvailabilityCheckError::Kzg(_))
|
| BlockError::AvailabilityCheck(AvailabilityCheckError::Kzg(_))
|
||||||
| BlockError::BlobValidation(_) => {
|
| BlockError::BlobValidation(_) => {
|
||||||
warn!(self.log, "Availability check failed"; "root" => %root, "error" => ?e, "peer_id" => %peer_id);
|
warn!(self.log, "Blob validation failure"; "root" => %root, "peer_id" => %peer_id);
|
||||||
|
if let Ok(blob_peer) = request_ref.processing_peer(ResponseType::Blob) {
|
||||||
|
cx.report_peer(
|
||||||
|
blob_peer.to_peer_id(),
|
||||||
|
PeerAction::MidToleranceError,
|
||||||
|
"single_blob_failure",
|
||||||
|
);
|
||||||
// Try it again if possible.
|
// Try it again if possible.
|
||||||
retry_request_after_failure(
|
retry_request_after_failure(
|
||||||
request_ref,
|
request_ref,
|
||||||
@@ -865,6 +870,9 @@ impl<T: BeaconChainTypes> BlockLookups<T> {
|
|||||||
cx,
|
cx,
|
||||||
&self.log,
|
&self.log,
|
||||||
)
|
)
|
||||||
|
} else {
|
||||||
|
ShouldRemoveLookup::False
|
||||||
|
}
|
||||||
}
|
}
|
||||||
other => {
|
other => {
|
||||||
warn!(self.log, "Peer sent invalid block in single block lookup"; "root" => %root, "error" => ?other, "peer_id" => %peer_id);
|
warn!(self.log, "Peer sent invalid block in single block lookup"; "root" => %root, "error" => ?other, "peer_id" => %peer_id);
|
||||||
@@ -1053,8 +1061,6 @@ impl<T: BeaconChainTypes> BlockLookups<T> {
|
|||||||
// ambiguity.
|
// ambiguity.
|
||||||
cx.report_peer(peer_id, PeerAction::MidToleranceError, "parent_request_err");
|
cx.report_peer(peer_id, PeerAction::MidToleranceError, "parent_request_err");
|
||||||
// Try again if possible
|
// Try again if possible
|
||||||
//TODO(sean) I don't see why we want to retry here, because this block is invalid and has
|
|
||||||
// passed block root validation, so querying again by block root will yield the same result.
|
|
||||||
parent_lookup.block_processing_failed();
|
parent_lookup.block_processing_failed();
|
||||||
parent_lookup.blob_processing_failed();
|
parent_lookup.blob_processing_failed();
|
||||||
self.request_parent_block_and_blobs(parent_lookup, cx);
|
self.request_parent_block_and_blobs(parent_lookup, cx);
|
||||||
|
|||||||
Reference in New Issue
Block a user