HomePhabricator

[avalanche] track avaresponse message faults via a dedicated counter instead of…

Description

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

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

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D18019

Details

Provenance
PiRKAuthored on Tue, Apr 29, 11:22
PiRKPushed on Tue, Apr 29, 17:48
Reviewer
Restricted Project
Differential Revision
D18019: [avalanche] track avaresponse message faults via a dedicated counter instead of using the misbehavior score
Parents
rABC2a5e0b3fff3d: p2p: Ignore version msgs after initial version msg
Branches
Unknown
Tags
Unknown