Repository navigation
p2p: Disconnect manual peers and not discourage all peers with the same address on getblocktxn msg corruption - #25257
Hidden character warning
maflcko wants to merge 1 commit into
Conversation
…dress on getblocktxn msg corruption
| void PeerManagerImpl::MaybeDisconnect(CNode& peer, std::string_view message) | ||
| { | ||
| if (peer.HasPermission(NetPermissionFlags::NoBan)) { | ||
| LogPrintLevel(BCLog::NET, BCLog::Level::Warning, "Not disconnecting noban peer %d!\n", peer.GetId()); |
There was a problem hiding this comment.
Working on the logging in this file right now and saw similar messages; this might be clearer
| LogPrintLevel(BCLog::NET, BCLog::Level::Warning, "Not disconnecting noban peer %d!\n", peer.GetId()); | |
| LogPrintLevel(BCLog::NET, BCLog::Level::Warning, "Not disconnecting misbehaving peer %d because it has noban permission\n", peer.GetId()); |
|
My primary issue with Misbehaving is actually neither of the things you bring up, but the fact that the scoring mechanism is arbitrary, and just introduces confusion. We should aim to have a protocol where all behavior is either OK or not OK, without hard-to-reason about levels in between. So I'm much more interested in seeing the scoring mechanism disappear than not using misbehaving/discouraging at all. Regarding the arguments you bring up:
|
|
Thanks for the extended reply.
It is probably more of an edge case, but I imagined a group sharing the same IP (for example a family with several connected devices). Though, I can also see how they can be seen as one entity.
I had the same thought, so I was about to add it back to make the changes smaller. Though, given that discouragement isn't useless, it may be best to close this patch and instead focus on removing the misbehaviour score. |
CGNAT is also a thing, and becoming more and more common :/ |
Misbehavinghas a lot of issues:nobanpermission flag.This is the first change in a series fixing the issues.
For reference, BIP 152 does not specify what should happen when the
getblocktxnmessage is corrupt[1]. However, disconnecting the remote peer seems preferable, to allow them to recover instead of stalling.[1]: https://en.bitcoin.it/wiki/BIP_0152#getblocktxn: