Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding ZSTD compression to chitchat's Deltas. (#112)
The difficulty in this PR is coming from the fact that we need to observe the maximum transmissible unit, and due to the fact that we want to keep the simplficity of using the same `MessageDigest` object when sending and emitting messages. The solution I went for requires to compress things twice. When building our message object, we rely on a stream compressor that makes it possible to get an upperbound of the resulting payload after we insert an arbitrary serializable object. We then decompose the delta into as many mutations. I had to refactor the delta object, so that we have a proper bijection between a delta object and the list of mutations that were used to build it. The delta object hence encodes the order in which nodes, and values were inserted. The point there is to ensure that the actual serialization will yield the same size as the "simulated one" and hence respect the mtu. The code is a bit simpler that way too. Closes #72
- Loading branch information