Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

[token-2022] Remove unnecessary split proof generation logic #7164

Merged

Conversation

samkim-crypto
Copy link
Contributor

@samkim-crypto samkim-crypto commented Aug 17, 2024

Problem

Currently, the token-client handles to create confidential transfer instructions that require split zkp's always generate the proof data. However, this is wasteful in that if all of the proofs are pre-verified using a context-state account or already generated and stored in a record account, then there is no need to generate the split proofs.

Summary of Changes

Update the client logic so that for the special case of when the proof accounts are all Some(...), we skip proof generation.

@samkim-crypto samkim-crypto marked this pull request as ready for review August 19, 2024 08:21
Copy link
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

.iter()
.all(|proof_account| proof_account.is_some())
{
// is all proofs come from accounts, then skip proof generation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
// is all proofs come from accounts, then skip proof generation
// if all proofs come from accounts, then skip proof generation

@samkim-crypto samkim-crypto merged commit 6570d6e into solana-labs:master Aug 19, 2024
31 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants