+
Skip to content

[WIP]wire: Update the utreexo messages flow #581

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Davidson-Souza
Copy link
Member

@Davidson-Souza Davidson-Souza commented Jul 17, 2025

What is the purpose of this pull request?

  • Bug fix
  • Documentation update
  • New feature
  • Test
  • Other:

Which crates are being modified?

  • floresta-chain
  • floresta-cli
  • floresta-common
  • floresta-compact-filters
  • floresta-electrum
  • floresta-watch-only
  • floresta-wire
  • floresta
  • florestad
  • Other:

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

This PR moves the block processing logic to node.rs, and reuse it over
SyncNode and RunningNode. Then, makes these functions ask for a `Block`
and `UData` separably.

This will be useful when implementing the new utreexo p2p flow, since
now proofs are downloaded separably from blocks.

I've also removed some mempool stuff, I'll open a new PR fixing this.
@Davidson-Souza Davidson-Souza added enhancement New feature or request chore Cleaning, refactoring, reducing complexity code quality Generally improves code readability and maintainability performance This is a performance-related issue labels Jul 17, 2025
@Davidson-Souza Davidson-Souza added this to the v0.9.0 milestone Jul 17, 2025
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Cleaning, refactoring, reducing complexity code quality Generally improves code readability and maintainability enhancement New feature or request performance This is a performance-related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载