-
Notifications
You must be signed in to change notification settings - Fork 992
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
Spend descriptions validation #2244
Conversation
…ate tree from the tx
d1879d2
to
694b949
Compare
@@ -161,6 +322,18 @@ where | |||
return Ok(false); | |||
} | |||
} | |||
|
|||
if !(self.valid_spend_descriptions_anchor(&shielded_tx)? | |||
&& self.valid_nullifiers_reveal(keys_changed, &shielded_tx)?) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case instead source != Address::Internal(Masp)
, should we add a check to verify that no shielded_spends
, nor shielded_converts
are attached to the Transaction
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this sounds good to me, thanks! (Maybe you can also add this to the Boundary Conditions
section in https://specs.namada.net/masp/ledger-integration ?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For simplicity's sake I'm addressing this in #2248
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, thanks!
* origin/grarco/spend-description-validation: Changelog #2244 Updates comment Fixes masp vp benchmark Fixes commitment tree validation in masp vp. Adds a workaround to update tree from the tx Updates the merkle tree anchor only if the tree changed Updates commitment tree anchor only once per block Refactors masp nullifiers check in a separate function Updates masp vp to validate note commitment tree and anchor Updates masp tx with note commitment tree and anchor
* origin/grarco/spend-description-validation: Changelog #2244 Updates comment Fixes masp vp benchmark Fixes commitment tree validation in masp vp. Adds a workaround to update tree from the tx Updates the merkle tree anchor only if the tree changed Updates commitment tree anchor only once per block Refactors masp nullifiers check in a separate function Updates masp vp to validate note commitment tree and anchor Updates masp tx with note commitment tree and anchor
Describe your changes
Addresses #1373.
Creates a note commitment tree in storage and modifies the masp tx to update this tree.
Changes
finalize_block
to update the anchor of this tree at the end of a block.Updates the masp VP to verify the changes made to the tree (also checks that the tree capacity is not exceeded) and the validity of the anchor for each spend description.
Indicate on which release or other PRs this topic is based on
Commit 39e00c5 of #2240
Checklist before merging to
draft