Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add debug log when downscoring a peer for bad response. #14742

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

nalepae
Copy link
Contributor

@nalepae nalepae commented Dec 20, 2024

What type of PR is this?
Other

What does this PR do? Why is it needed?
We need to know, when a peer is disconnected for a "too many bad responses" reason, what were these bad responses.

Which issues(s) does this PR fix?

Acknowledgements

  • I have read CONTRIBUTING.md.
  • I have made an appropriate entry to CHANGELOG.md.
  • I have added a description to this PR with sufficient context for reviewers to understand this PR.

@nalepae nalepae requested a review from a team as a code owner December 20, 2024 11:25
@nalepae nalepae force-pushed the debug-log-on-downscore branch from d2aa446 to d24ecf6 Compare December 20, 2024 11:37
@nalepae nalepae force-pushed the debug-log-on-downscore branch from d24ecf6 to 7e71977 Compare December 20, 2024 11:43
Comment on lines +481 to +482
score := s.Peers().Scorers().BadResponsesScorer().Increment(info.ID)
return errors.Wrapf(err, "connect to peer %s - new bad responses score: %d", info.ID, score)
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we are using score only once would it not be better to just use the value?

Suggested change
score := s.Peers().Scorers().BadResponsesScorer().Increment(info.ID)
return errors.Wrapf(err, "connect to peer %s - new bad responses score: %d", info.ID, score)
return errors.Wrapf(err, "connect to peer %s - new bad responses score: %d", info.ID, s.Peers().Scorers().BadResponsesScorer().Increment(info.ID))

Comment on lines +211 to +212
score := s.p2p.Peers().Scorers().BadResponsesScorer().Increment(ib.blockPid)
log.WithError(err).WithFields(ib.logFields()).WithField("newBlockPidBadResponsesScore", score).Debug("Backfill batch failed to import")
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment as above

Comment on lines +340 to +343
score := q.blocksFetcher.p2p.Peers().Scorers().BadResponsesScorer().Increment(m.pid)
log.
WithFields(logrus.Fields{"pid": response.pid, "newBadResponsesScore": score}).
Debug("Peer is penalized for invalid blocks")
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above, etc

@saolyn saolyn changed the title Add debug log when downcoring a peer for bad response. Add debug log when downscoring a peer for bad response. Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants