Skip to content
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

main, netsync, peer: full partial tx support #98

Merged

Conversation

kcalvinalvin
Copy link
Contributor

On tx propagation, a utreexo node may not need the entire proof as some may be cached. This new way of propagating txs is based off of utreexo/utreexo#77 and allows a utreexo node to only ask for the proof hashes it is missing.

Utreexo proof hash invs are always paired with the tx invs and the code
change is made to handle this. Each utreexo tx is also queued
immediately instead of getting pushed back into the queue to avoid
sending multiple tx invs to utreexo peers. This is done on purpose so
that there isn't any confusion on which utreexo proof hash inv is for
which tx. Multiple txs will be supported via a different wire message in
the future.
For utreexo nodes, add in the utreexo proof hash invs when propagating
tx invs. With these, the utreexo nodes are able to ask for only the
proof hashes it needs.
Utreexo peers will send utreexo proof hash invs along with a tx inv so
that the receiving node can ask for only the hashes it needs. The change
here adds support for handling those utreexo proof hash invs for the
node receiving the utreexo proof hash inv.
On getdata, utreexo nodes will attach utreexo proof hash invs to
indicate the positions of the hashes it needs to verify the tx. The code
change here handles this and only sends out the proof hashes the peer
asked for.
@kcalvinalvin kcalvinalvin force-pushed the 2023-12-26-full-partial-tx-support branch from 6d225b9 to 75b3c09 Compare January 2, 2024 07:05
For rbf, the utreexo proof that was needed was nothing since the proof
is already cached. However, the removeTransaction that was being called
before the replacement was uncaching the already cached proof, leading
to ingestion failure. To handle this, there's a flag introduced to
removeTransaction to opt out of removing the utreexo proof for a given
tx.
@kcalvinalvin kcalvinalvin merged commit 7b3ca60 into utreexo:main Jan 2, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant