I don't have steps to reproduce this, but I think it might be an issue (from reading the code.)
A scuttlebutt RPC message has a 34 bit header, followed by a variable length body. When bytes are received over the socket, the current implementation of scuttlebutt-handshake assumes that it is a complete message in the byte buffer handed over by Vertx.
Depending on network conditions, application load, etc, this could theoretically be only part of a message in this buffer (or perhaps even 1 RPC response and a little bit of another.) Perhaps this could be re-implemented to make sure we buffer up full messages first before handing over the bytes to the receivedMessage method.
I don't have steps to reproduce this, but I think it might be an issue (from reading the code.)
A scuttlebutt RPC message has a 34 bit header, followed by a variable length body. When bytes are received over the socket, the current implementation of
scuttlebutt-handshake
assumes that it is a complete message in the byte buffer handed over by Vertx.https://github.com/ConsenSys/cava/blob/e8ea2b897a2ff0a0ed4ae9c47300583b0f0874dc/scuttlebutt-handshake/src/main/java/net/consensys/cava/scuttlebutt/handshake/vertx/SecureScuttlebuttVertxClient.java#L62
Depending on network conditions, application load, etc, this could theoretically be only part of a message in this buffer (or perhaps even 1 RPC response and a little bit of another.) Perhaps this could be re-implemented to make sure we buffer up full messages first before handing over the bytes to the
receivedMessage
method.