[WIP]wire: Update the utreexo messages flow #581
Draft
+747
−604
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.
What is the purpose of this pull request?
Which crates are being modified?
Description
Until now, utreexo proofs were sent along with a block. When
downloading a block, you would request for a utreexo block, which,
has the actual block + some utreexo data. While this works (and
is simpler to implement), it doesn't allow for proof caching on the
requester-side.
For that reason, we've changed the message flow to separate blocks
and proofs. A client will request a block, look at which UTXOs were
spent there, filter for what they have in cache, and then request
proof and leaf data they don't have.
This commit implements this in floresta. It won't, however, cache
stuff. Rather, we ask for all the inputs that weren't created on
the same block. A UTXO cache is a TODO.
Notes to the reviewers
I still have to figure out the best way to integrate those changes for
ChainSelector
. The changes are also fairly untested. Opening a PR for conceptual review and ideas.This is currently base on #518