Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The op store should ingest only op data. Hashes should be computed when data arrives so that we aren't trusting somebody else to do our hashing. The rest of this PR is consequences from trying to achieve that.
Within the op store, we want to be able to store more fields than the op contains. Like
stored_at
which I'm using on the gossip PR for incremental sync. That means we need to keep the op data model and the model the op store uses internally as separate types.The big fiddle here was that I couldn't use the hash function that was added with the fetch queue inside the mem op store without destroying the DHT tests. Those need predictable IDs to get the ops into different parts of the DHT to test the location logic. I could spend time trying to find op data that places the ops in the right locations but predictable IDs seemed so much simpler for testing. So I'm just using the first 32 bytes of the op data as the id. If there isn't enough op data, then pad with 0.