Skip to content

Penalize peer if missing blobs#6525

Closed
dapplion wants to merge 1 commit intosigp:unstablefrom
dapplion:penalize-missing-blobs
Closed

Penalize peer if missing blobs#6525
dapplion wants to merge 1 commit intosigp:unstablefrom
dapplion:penalize-missing-blobs

Conversation

@dapplion
Copy link
Copy Markdown
Collaborator

@dapplion dapplion commented Oct 21, 2024

Issue Addressed

During range sync, if a peer replies with empty blobs we do not downscore that peer. We should.

Proposed Changes

Downscore peer if we can't match block and data when constructing an RpcBlock

The PRs below also move these two variants into not being internal

@dapplion dapplion added the ready-for-review The code is ready for review label Oct 21, 2024
Error::InvalidBlobs { .. }
| Error::InvalidColumn { .. }
| Error::MissingBlobs
| Error::MissingCustodyColumns
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The category change makes sense but it doesn't look like we use this to determine peer penalty.

Related issue:
#4546

I think we'll need to handle BlockError::AvailabilityCheck in handle_failed_chain_segment:

fn handle_failed_chain_segment(&self, error: BlockError) -> Result<(), ChainSegmentFailed> {

Copy link
Copy Markdown
Member

@jxs jxs Oct 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems we use Jimmy, category() is called on:

BlockError::AvailabilityCheck(e)
if e.category() == AvailabilityCheckErrorCategory::Internal =>
{
// There errors indicate internal problems and should not downscore the peer
warn!(self.log, "Internal availability check failure"; "block_root" => ?block_root, "error" => ?e);
// Here we choose *not* to call `on_processing_failure` because this could result in a bad
// lookup state transition. This error invalidates both blob and block requests, and we don't know the
// state of both requests. Blobs may have already successfullly processed for example.
// We opt to drop the lookup instead.
Action::Drop
}
other => {
debug!(self.log, "Invalid lookup component"; "block_root" => ?block_root, "component" => ?R::response_type(), "error" => ?other);
let peer_id = request_state.on_processing_failure()?;
cx.report_peer(
peer_id,
PeerAction::MidToleranceError,
match R::response_type() {
ResponseType::Block => "lookup_block_processing_failure",
ResponseType::Blob => "lookup_blobs_processing_failure",
},
);
Action::Retry

with Lion's change Error::MissingBlobs and Error::MissingCustodyColumns are now reported as ErrorCategory::Malicious instead of ErrorCategory::Internal which makes it so that those nodes get reported via report_peer

@jimmygchen jimmygchen added waiting-on-author The reviewer has suggested changes and awaits thier implementation. and removed ready-for-review The code is ready for review labels Oct 22, 2024
@jimmygchen
Copy link
Copy Markdown
Member

This is now covered in #7352, closing.

@jimmygchen jimmygchen closed this May 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting-on-author The reviewer has suggested changes and awaits thier implementation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants