Link Search Menu Expand Document

Scorex GitHub

PR #396 fixing PeerConnectionHandler
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 : 1. ByteString is received 2. if BS length is less than message length, keep on reading next BS as we have not enough bytes yet 3. 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.
Created At 2021-05-15 14:33:48 +0000 UTC