Skip to content

Conversation

@davecgh
Copy link
Member

@davecgh davecgh commented Dec 19, 2025

This is rebased on #3591.

Currently, the logic that accumulates the persistent and transient ban scores incorrectly logs debug messages alleging whitelisted peers are misbehaving due to perfectly normal accumulation of the decaying transient ban score.

Also, it currently logs the overall ban score whenever it is over the warning threshold even when the score is not increasing. There isn't anything incorrect about that behavior, and the comments even correctly call out that is what it is intended to do, but it also not very useful.

This modifies the logic to address the aforementioned and takes the opportunity to simplify the code a bit.

In particular, it now treats whitelisted peers the same as all other peers in terms of tracking the ban score and warning for misbehavior whenever the score exceeds the warning threshold. However, when the ban score exceeds the ban threshold, whitelisted peers are exempted.

The misbehavior warning messages that are shown once the ban score exceeds the warning threshold will now include the additional detail that the peer is whitelisted when that is the case.

Finally, there is no longer any logging when the ban score is not increasing.

@davecgh davecgh added this to the 2.2.0 milestone Dec 19, 2025
Copy link
Member

@jrick jrick left a comment

Choose a reason for hiding this comment

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

ok with nit

@davecgh davecgh force-pushed the server_simplify_and_correct_banscore_logging branch from 3422c05 to f367a3d Compare December 19, 2025 21:13
Currently, the logic that accumulates the persistent and transient ban
scores incorrectly logs debug messages alleging whitelisted peers are
misbehaving due to perfectly normal accumulation of the decaying
transient ban score.

Also, it currently logs the overall ban score whenever it is over the
warning threshold even when the score is not increasing.  There isn't
anything incorrect about that behavior, and the comments even correctly
call out that is what it is intended to do, but it also not very useful.

This modifies the logic to address the aforementioned and takes the
opportunity to simplify the code a bit.

In particular, it now treats whitelisted peers the same as all other
peers in terms of tracking the ban score and warning for misbehavior
whenever the score exceeds the warning threshold.  However, when the ban
score exceeds the ban threshold, whitelisted peers are exempted.

The misbehavior warning messages that are shown once the ban score
exceeds the warning threshold will now include the additional detail
that the peer is whitelisted when that is the case.

Finally, there is no longer any logging when the ban score is not
increasing.
@davecgh davecgh force-pushed the server_simplify_and_correct_banscore_logging branch from f367a3d to ac9eb0a Compare December 22, 2025 21:21
@davecgh davecgh merged commit ac9eb0a into decred:master Dec 22, 2025
34 checks passed
@davecgh davecgh deleted the server_simplify_and_correct_banscore_logging branch December 22, 2025 21:30
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.

3 participants