-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[token-client] Add interface to add additional compute budget for transactions #6121
[token-client] Add interface to add additional compute budget for transactions #6121
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.
Just one nit, then all good!
token/client/src/token.rs
Outdated
pub async fn process_ixs_with_additional_compute_budget<S: Signers>( | ||
&self, | ||
token_instructions: &[Instruction], | ||
additional_compute_budget: Option<u32>, |
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.
Is there a reason to make this an Option
rather than a normal u32
? If someone is using this function, we should probably force them to specify the additional compute budget
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.
Yeah looking at it now, I guess it is kind of weird. I wanted this function to be a more general version of process_ixs
which process_ixs
can invoke, but the name is misleading. I'll fix the syntax to take in a normal u32
.
Pull request has been modified.
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.
Sorry, just one more question. the other change looks good!
// additional compute budget required for `VerifyTransferWithFee` | ||
const TRANSFER_WITH_FEE_COMPUTE_BUDGET: u32 = 500_000; |
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.
Sorry I didn't catch this on the first review, but what about the other version of transfer with fee: confidential_transfer_transfer_with_fee_and_split_proofs
and the parallel version?
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.
Yeah, it seems like those don't seem to get caught on the CU limit. The split proofs (range proof, ciphertext validity proof, etc.) have smaller CUs since they are essentially chunks of the VerifyTransferWithFee
. Some of those exceed 200k limit, but the CU averaging seems to allow them to pass.
The VerifyTransferWithFee
is the culmination of all those split proofs and therefore, have huge CU requirement for which even the CU averaging is not sufficient to bring it down to 200k.
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.
I think it might be safe to allocate additional budget for those lighter instructions as well, but perhaps it could be done in a follow-up PR to unblock solana-labs/solana#34695 before the feature freeze.
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.
Ah ok, as long as the other ones work, then all good!
Problem
With the new activation of the feature
8pgXCMNXC8qyEFypuwpXyRxLXZdpM4Qo72gJ6k87A6wL - Native program should consume compute units
activated, the token-2022 tests seem to break downstream ci in the monorepo due to the token-2022 confidential transfer with fee instruction taking too many compute units.Summary of Changes
process_ixs_with_additional_compute_budget
, which adds an extra compute budget instruction to the transaction