-
Notifications
You must be signed in to change notification settings - Fork 725
[Refactor] SaplingOperation: support for multisig, cold-staking, and OP_RETURN outputs #1967
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
[Refactor] SaplingOperation: support for multisig, cold-staking, and OP_RETURN outputs #1967
Conversation
1f4da22 to
67130a6
Compare
|
Rebased. |
furszy
left a comment
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.
Overall looking great, ACK 67130a65 .
The only minor thing that would add in every SendManyRecipient constructor is the nullopt member initialization for the member that is not used. Example, if it's being feed by a shielded addr, set the transparent optional to nullopt and vice versa.
Save them as either CTxOut (transparent outputs) or a tuple with sapling address, amount and memo (shielded outputs), instead of strings. This saves a redundant Encoding/Decoding operation while offering more flexibility (allowing for all possible kinds of transparent outputs).
67130a6 to
cf9d4df
Compare
|
Rebased on master and added initializer lists. |
furszy
left a comment
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 cf9d4df after rebase and merging..
Fuzzbawls
left a comment
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.
post-merge ACK cf9d4df
467b0d8 [Tests] Check delegations with sapling transactions (random-zebra) d412525 [RPC] Add fUseShielded parameter to delegatestake/rawdelegatestake (random-zebra) 847d278 [Trivial] Missing newline in delegatestake (random-zebra) 7440709 [Validation] Don't reject sapling txes with P2CS outputs (random-zebra) Pull request description: Enable pay-to-cold-staking outputs in shielded transactions. Add the option in `delegatestake`/`rawdelegatestake` to spend shielded funds directly to P2CS (without having to unshield them first). Add functional test. Based on top of - [x] #1964 - [x] #1967 - [x] #1969 Starts with `[Validation] Don't reject sapling txes with P2CS outputs` (461d4ea69ea21ea639ae639d4248b4ef28312429) ACKs for top commit: furszy: Looking good, ACK 467b0d8 Fuzzbawls: ACK 467b0d8 Tree-SHA512: 88752fe1550def605b90cc894d0666f5c37dd8f075566e976c8fbfaa6e088ee0c1bb028e1885411b739781fda6ebac12a5c99fc19a06f453e594441ee1e1b599
Refactor
SaplingOperation, abstracting the separation between shielded and transparent outputs insideSendManyRecipient.Instead of using strings for the internal representation, save the recipients as either
CTxOut(for transparent outputs) or a tuple comprising SaplingAddress, Amount and Memo (for sapling outputs).This has the following pros:
CTxOutcan be any kind of transaction output, we can easily integrate other use-cases.For example, in this PR we add support for multisig, P2CS and op_return outputs.