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

blockchain, main, wire, indexers: change MsgUtreexoTx serialization #219

Merged

Conversation

kcalvinalvin
Copy link
Contributor

Biggest changes:

1: MsgUtreexoTx now includes the LeafDatas and the Proof directly instead of having UData as a field.
2: Each TxIn's OutPoint.Index now also encodes if the OutPoint being addressed is confirmed or not.
3: The count of the LeafData is no longer written. The count is implied by the len(TxIn) and if each LeafData is confirmed or not.
4: Various code changes to account for the fact that there's LeafDatas that are for unconfirmed TxIns exist within the slice of LeafDatas.

The code for reconstructing a single leaf is refactored out into a
separate function so it can be re-used by other callers.
ReconstructLeafDatas reconstructs the leafdatas based on the given
TxIns. Handy for callers outside the blockchain package.
Reduce the duplicate code by calling ReconstructLeafDatas from
VerifyUData.
relayUtreexoTx is changed to generate leafhashes by reconstructing
compact udatas instead of just erroring out and failing. This has
resulted in utreexo nodes not seeing the entire mempool which is fixed
in this commit.
Skip the serialization of unconfirmed txIns to save on bandwidth.
Since some leaves are just there to indicate that txIns are unconfirmed,
they are not able to be hashed. We skip over these leaves with this
commit.
The unconfirmed leafdatas were being hashed which resulted in the
verification failing since that leafhash doesn't exist in the
accumulator. This commit addresses that.
Utreexo txs get put into the orphan pool but since the udata is no
longer included in the tx, we need to keep track of it separately. This
commit addresses that.
@kcalvinalvin kcalvinalvin merged commit d45a16a into utreexo:main Nov 19, 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