-
Notifications
You must be signed in to change notification settings - Fork 714
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
Sapling transaction primitive data. #1814
Sapling transaction primitive data. #1814
Conversation
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.
Looking pretty good. Code review ACK, modulo some notes and nits.
There is room for some cleanup due to the removal of the sigversion
parameter from the SignatureHash
, but it can be addressed in a followup PR.
Coming from zcash@291b191bd70b2afc285b71187c2f7eb85197f9f0
dbbad19
to
b4c8c8e
Compare
Great feedback!, PR updated. |
e2c2119
to
8cddca5
Compare
Updated removing the following commit: Instead of defining the SigVersion inside |
ada8e3d
to
0b77cfb
Compare
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.
The global flag to guard v2 txes looks good now.
But have found more instances where we try to access sapData
without first checking if it's initialized.
In GetShieldedSpendsHash
and GetShieldedOutputsHash
we should probably also check first the version of txTo
, and return early (maybe just UINT256_ZERO
, instead of the hash of an empty stream) if either IsSapling()
or hasSaplingData()
is false.
One more thing.
The hack in the unit test (a3eaeb0) can be removed now that the version serialization is properly guarded.
Requires Sapling transaction support in the future.
Transaction: GetDustThreshold method implemented. Transaction:hasSaplingData check is enough checking for vShieldedOutput and vShieldedSpend emptiness.
Now using Blake2b writer.
NOT_AN_INPUT constant.
0b77cfb
to
3219140
Compare
Done, updated based on the feedback. |
Looking good. |
done, assertion preventing possible future hard-to-discover segfaults implemented. |
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.
Nice. 🍻 ACK 2fff9ec
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.
utACK 2fff9ec
…rtup. 520d889 BugFix: g_IsSaplingActive flag wasn't being updated at startup. (furszy) Pull request description: Small bug introduced in #1814, the flag is set on every new tip but not initialized at startup. Discovered rebasing #1798 on top of master and running any sapling functional test. As `g_IsSaplingActive` is false at startup, the transaction hash is different, making the merkle tree hash different, failing in `VerifyDB`. ACKs for top commit: random-zebra: utACK 520d889 Fuzzbawls: utACK 520d889 Tree-SHA512: 609d0257a524aa85a12296ab827b0cd9dc640e60455801203d52709672e79cd9837f606743b976e5cc64d9f0659d81bd19b5bb6ec6b339fd01eebf44af58677e
Work coming from #1798. Decoupled commits related to the Sapling transaction primitive data and the new signature hash to make the review a little bit easier there. Plus, squashed some of them.
List of commits taken from #1798:
Primitive data:
Signature hash: