[bisq-network/bisq] Hash of ProtectedStoragePayload is non-deterministic (leading to duplication of elements in P2PDataStorage) (#3367)

Justin Carter notifications at github.com
Wed Oct 9 03:48:34 UTC 2019


@chimp1984 If you want to test wether or not _all_ instances are serializing the same way you must cache the bytes that came in from the network. Then you know how they were serialized by the peer that sent you the message.

[This] line(https://github.com/bisq-network/bisq/blob/master/p2p/src/main/java/bisq/network/p2p/network/Connection.java#L713) line:
```
protobuf.NetworkEnvelope proto = protobuf.NetworkEnvelope.parseDelimitedFrom(protoInputStream);
```

Would have to become something like (pseudo code)
```
sizeOfNextObject = readProtoSize(protoInputStream);
bytesForNextProtoObject = protoInputStream.readBytes(sizeOfNextObject);
protobuf.NetworkEnvelope proto = protobuf.NetworkEnvelope.parseFrom(bytesForNextObject);
proto.setOriginalBytes(bytesForNextProtoObject)
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/issues/3367#issuecomment-539812892
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20191008/bb77eb35/attachment.html>


More information about the bisq-github mailing list