Closed ana-prdekalo closed 1 year ago
If you encounter an invalid RLP message, it is pretty likely that this indicates an error in the lower level of your implementation. I'm very sure geth does not send invalid messages, we would've noticed that in testing with other implementation and with our regression tests.
Yeah, that does make sense, I just wanted to double-check before going down the rabbit hole of chasing a bug that sometimes appears. These are always fun 🥲 It smells to me like I scr**ed up TCP Framing.
Thanks four your help!
Let me know what you find!
Sorry for the slow response, I'm working on this when I find time - so rarely 🥲 The issue was, for some reason, I thought that disconnect messages were not Snappy compressed 🤦♂️ Now everything works as expected :)
Hi,
I'm writing my own RLPX, implementation in Rust, I am able to send/receive P2P messages between my "code" and other peers. But I've noticed, that I'm receiving "weird" RLP-encoded packets from some peers.
Here is an example of a packet that is bothering me:
b"\x01\x01\0\x04"
. I have little to no experience with RLP encoding/decoding, and I'm using the fastrlp package, but I'm unable to parse this message. I've also tried decoding this via JS RLP CLI, but to no avail.And just looking at the packet, this looks malformed, as if the packet consists of 2 disconnect messages
x01x0
andx01x04
, so the first one would beDisconnect(DisconnectRequested
) and the other one would beDisconnect(TooManyPeers)
, but as if, for some reason, they are "mixed up".The strange thing is that this doesn't happen consistently, nor for all messages. I'm receiving and parsing "normal"
Disconnect
messages, as well asHello
, and ETH Status messages (this is what I've coded so far).My question is: is it normal to receive a packet like
b"\x01\x01\0\x04"
(or eg.b"\x01\x01\0\x10"
), or do I have an error somewhere in TCP/Framing level?