-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
[zk-token-proof] Enable proof program to be invoked as an inner call #33045
[zk-token-proof] Enable proof program to be invoked as an inner call #33045
Conversation
oof, ok. will we need a re-audit due to this? also if there's any way around modifying the proof program at this point, sooooo close to shipping v1.16, we should take it. or potentially defer this change to v1.17+ and deal with it in token22 in the meantime. |
Yes, sorry about the late changes. We can just add this to 1.17. The audit with token22 just started yesterday, so we can probably tell them to include this change as well... But there is this one WIP change #33042 that unfortunately must be backported... Currently, the |
How about just allowing the close instruction in CPI in 1.16? That's the only part that's needed for the new tx flow, and reduces the potential harm surface, unlike the rest of the proof program which has high compute needs. Otherwise, deferring to 1.17 isn't too bad |
Yeah that definitely sounds better for v1.16. For v1.17 would we even need to allow the rest of the instructions in CPI? |
I don't think so, but I'll defer to Sam on that one |
Okay, sounds good 🙏. I think we actually don't need CPI for verification instructions since they can always be included in the same transaction. CPI would only be useful for asynchronous execution of instructions, so just the close instruction would suffice. I will update the changes. |
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.
Looks good to me!
…r call (backport of #33045) (#33071) [zk-token-proof] Enable proof program to be invoked as an inner call (#33045) enable close context state account instruction to be invoked as an inner call (cherry picked from commit 01dbe49) Co-authored-by: samkim-crypto <[email protected]>
Problem
Currently, the ZK Token proof program contains a check that prevents other programs from invoking the proof program as an inner call. In the earlier version of the program, we did not vision the proof program from being invoked as an inner call, so this check made sense. However, with the way the program is set up, invocation of the proof program instructions can be useful in certain applications like in solana-labs/solana-program-library#3984. Additionally, invocation to
CloseContextState
instruction could allow the following application:Parallel execution of Token22 transfers:
tx_0
= [system::create_account, // create account for proof_0
zk_token_proof::create_proof_0, // initialize proof context account
token_2022::confidential_transfer, // token-2022 instruction
]
tx_1
= [system::create_account, // create account for proof_1
zk_token_proof::create_proof_1, // initialize proof context account
token_2022::confidential_transfer, // token-2022 instruction (duplicate of the instruction in
tx_0
]
CloseContextState
instruction to close down the proof accounts, allowing a confidential transfer to require only two asynchronous transactions.Summary of Changes
Remove the check that prevents the proof program from being invoked as an inner function.
Fixes #