Problem: false positive peer bans, ie. peers are getting banned even though they communicate properly.
Explanation:
Logic of this whole incoming data deserialization is as follows :
ByteString is received
if BS length is less than message length, keep on reading next BS as we have not enough bytes yet
otherwise try to deserialize it into a message
The bug is caused by the fact that we are testing for magic and grabbing msgCode before checking the length, which means it fails (incorrectly) at time when not enough bytes is read to be able to deserialize it into a message.
Fix outcome:
No bans happen now and more peers are connected, tested on Ergo.
Problem: false positive peer bans, ie. peers are getting banned even though they communicate properly.
Explanation: Logic of this whole incoming data deserialization is as follows :
The bug is caused by the fact that we are testing for
magic
and grabbingmsgCode
before checking the length, which means it fails (incorrectly) at time when not enough bytes is read to be able to deserialize it into a message.Fix outcome: No bans happen now and more peers are connected, tested on Ergo.