Skip to content

Score EnvelopePeerFailure correctly#9528

Open
0u-Y wants to merge 2 commits into
sigp:unstablefrom
0u-Y:score-envelope-peer-failure
Open

Score EnvelopePeerFailure correctly#9528
0u-Y wants to merge 2 commits into
sigp:unstablefrom
0u-Y:score-envelope-peer-failure

Conversation

@0u-Y

@0u-Y 0u-Y commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Issue Addressed

Closes #9525

Proposed Changes

EnvelopePeerFailure was added in #9362 but only logged, without reporting the peer. Since the envelope is requested from the same peer as the block, the failure is directly attributable to that peer.

This reports the peer via report_peer in both the range sync (chain.rs) and backfill sync (backfill_sync/mod.rs) paths. The error wraps envelope/block consistency violations (SlotMismatch, BuilderIndexMismatch, BlockHashMismatch), all of which EnvelopeError::penalize_peer() already classifies as peer faults, so PeerAction::LowToleranceError is used, consistent with how clearly attributable faults are scored elsewhere in chain.rs.

@0u-Y 0u-Y requested a review from jxs as a code owner June 24, 2026 02:49
debug!(?batch_id, ?msg, "Envelope peer failure");
let action = PeerAction::LowToleranceError;
debug!(?batch_id, msg, score_adjustment = %action, "Envelope peer failure");
network.report_peer(*peer_id, action, "envelope_peer_failure");

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.

you are reporting the wrong peer here. This is the peer that completed the batch, not the envelope peer. We should probably add the peer_id of the peer to EnvelopePeerFailure variant and penalize that peer instead.

debug!(?batch_id, msg, "Envelope peer failure");
let action = PeerAction::LowToleranceError;
debug!(?batch_id, msg, score_adjustment = %action, "Envelope peer failure");
network.report_peer(*peer_id, action, "envelope_peer_failure");

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.

same as above

@chong-he chong-he added waiting-on-author The reviewer has suggested changes and awaits thier implementation. gloas labels Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gloas 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