Closed lucksus closed 4 years ago
See for getting u8 to work: https://github.com/holochain/holochain-rust/compare/low-level-receipts
Similarly - if you want the hashing to be consistent, I believe the problem lies in the level at which you are hashing.
On the worker side, if you hash the already serialized binary data (optimally changing the outgoing queue to have already serialized data and respective hashes), then on the server side, do the hashing before deserializing the data, then obviously they should match.
@neonphog, @zippy, implemented both your change requests.
@neonphog, implemented those suggestions as well :)
PR summary
This intends to make the channel between nodes and the Sim2h server resilient against data/connection loss on the level of Lib3hMessages. (in the direction: Sim2hWorker -> Sim2h server)
This resilience is actually an assumption that code in core holds, but that wasn't met by the Sim2h/Sim2hWorker implementation yet. A connection dropped just after a message was sent would leave the disconnected node without track of that lost message. It would continue to function after a reconnect, but the message sent before would be lost, if it wasn't received by the server before the disconnect.
With this PR we add a receipt message type
WireMessage::Ack(u64)
that the Sim2h server sends back, including a hash of the processed message. The Sim2hWorker now only sends one message at a time and waits for the receipt before sending the next one. If a receipt is not received within 10 seconds, it will resend the message.testing/benchmarking notes
( if any manual testing or benchmarking was/should be done, add notes and/or screenshots here )
followups
changelog
documentation