Page MenuHomePhabricator

[avalanche] track avaresponse message faults via a dedicated counter instead of using the misbehavior score
ClosedPublic

Authored by PiRK on Tue, Apr 29, 11:31.

Details

Summary

Use a dedicated CNode::m_avalanche_message_fault_score member variable to track repeated avaresponse message faults, and call Misbehaving(*peer, 100) when that score reaches a threshold instead of incrementing the misbehavior score by 2 directly.

In a case in which the only source of misbehavior is the avaresponse faults, the behavior is unchanged. If the misbehavior score is incremented for other reasons, now we are a bit more tolerant of network faults.

This prepares the codebase for a following diff (core#29575) in which we will stop tracking the misbehavior score, and calling Misbehaving will immediately trigger discouragement.

Depends on D18021

Test Plan

ninja all check-all

Event Timeline

PiRK requested review of this revision.Tue, Apr 29, 11:31
Fabien requested changes to this revision.Tue, Apr 29, 14:05
Fabien added a subscriber: Fabien.
Fabien added inline comments.
src/net.h
667 ↗(On Diff #53749)

Let's convert to doxygen comments please since you're touching it, and the same for the new counter

This revision now requires changes to proceed.Tue, Apr 29, 14:05
This revision is now accepted and ready to land.Tue, Apr 29, 16:18