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

wire, main, peer, netsync: utreexo header messages #226

Merged

Conversation

kcalvinalvin
Copy link
Contributor

@kcalvinalvin kcalvinalvin commented Nov 20, 2024

We introduce MsgUtreexoHeader and GetMsgUtreexoHeader messages that's used to communicate the positions of the leaves in the utreexo accumulator that are being spent in a given block.

@kcalvinalvin kcalvinalvin force-pushed the 2024-11-20-new-block-msg-format branch from ab8c984 to a56c6dd Compare November 22, 2024 08:20
@kcalvinalvin kcalvinalvin marked this pull request as ready for review November 22, 2024 08:20
@kcalvinalvin kcalvinalvin changed the title 2024 11 20 new block msg format wire, main, peer, netsync: new block msg format Nov 24, 2024
@kcalvinalvin kcalvinalvin changed the title wire, main, peer, netsync: new block msg format wire, main, peer, netsync: utreexo header messages Nov 24, 2024
Utreexo Header is a slice of uint64s that provide the positions of the
inputs that are included in the block. With this information, the
receiving node is able to figure out the hash positions it needs to
verify that the given positions exist.
MsgGetUtreexoHeader is needed to communicate to others that we want a
utreexo header at a given block.
This function adds code that handles sending over utreexo headers for
any nodes that request them.
Utreexo header messages are requested based off of the list of headers
that we've received from our peer. Once we have all the utreexo headers,
we then ask for the blocks.
Since we check for the entire invvect to see if a peer has a particular
tx or block, we can mistake that the peer doesn't have a tx or a block
when they do if the invtype has the utreexo flag.

Since having the utreexo flag doesn't change the underlying tx or the
block, it's better to not distinguish between the two when tracking if
the peer has a certain block/tx.
@kcalvinalvin kcalvinalvin force-pushed the 2024-11-20-new-block-msg-format branch from a56c6dd to c530b70 Compare November 27, 2024 04:52
@kcalvinalvin kcalvinalvin merged commit 8789b76 into utreexo:main Nov 27, 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