-
Notifications
You must be signed in to change notification settings - Fork 451
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
BreachOfProtocol
on network id mismatch
#7727
Comments
@arnetheduck yes this seems to be the case, from the docs you sent there aren't any descriptions of when the different disconnection messages should be used. |
Well, the linked spec says about
I read that as a category of errors relating to structural protocol/encoding issues rather than valid data with mismatching higher-level interpretation. A breach of protcol would effectively be a bug in the implementation or malicious behavior whereas a network id mismatch is a benign issue that happens in a normally operating network with honest peers. Sure, the spec doesn't say this out loud but UselessPeer is what we get from other impls in this case. |
The chain number could be considered part of the encoding though, if we use version id x on chain y then this message is malformed. |
I mean, it ultimately doesn't matter greatly tbh, except for some penalty time which probably only affects testnets practically - I noted that nethermind sends a different value than other clients in this particular case while looking into why there were so many protocol breaches from nethermind but not from others, to make sure nimbus is indeed not sending actual malformed messages that nethermind can't read. In other words, it's "normal" that we encounter peers on different chains - it would not be normal for nimbus to send malformed messages. Feel free to close this issue if you're not planning to change it, I don't think it's worth that much.
This would be a very unusual protocol, if "well-formed message with unknown version" is treated the same as "malformed message" - the reason to have a version field to begin with is to allow the consuming side to treat it gracefully rather than as a protocol breach. Nitpicking, this is a "well-formed message whose content I cannot interpret" (assuming the RLP is valid and the message follows all other formulaic constraints). Anyway. |
It's unclear to me what it should be since the spec is so vague. Do you know if other clients send |
other clients send UselessPeer on network id mismatch, yes. |
@arnetheduck I implemented a PR for this, could you check if it works? Also how can I reproduce your test? |
In RLPx,
BreachOfProtocol
is used for malformed messages (invalid RLP) and other protocol violations.However, when testing nimbus with nethermind it appears we're receiving it on networkid mismatch, ie when connecting a mainnet node to a holesky nethermind and vice versa. Normally, one would have expected a
UselessPeer
error.nethermind/src/Nethermind/Nethermind.Network.Stats/Model/DisconnectReason.cs
Line 98 in 82c78e7
Is this intentional?
The text was updated successfully, but these errors were encountered: