From 811a52eeb6f9ce9de639ada3fa6076fd9283f82e Mon Sep 17 00:00:00 2001 From: samkim-crypto Date: Fri, 27 Oct 2023 15:37:45 -0700 Subject: [PATCH] [zk-token-proof] Round compute units to nice numbers (#33910) round zk-token-proof compute units to nice numbers (cherry picked from commit b0bf24b6fc3b5b57032416643e2db169e8bd79ca) --- programs/zk-token-proof/src/lib.rs | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/programs/zk-token-proof/src/lib.rs b/programs/zk-token-proof/src/lib.rs index 3e43c564e70cef..0aa75c4ef5cff5 100644 --- a/programs/zk-token-proof/src/lib.rs +++ b/programs/zk-token-proof/src/lib.rs @@ -17,20 +17,20 @@ use { }; pub const CLOSE_CONTEXT_STATE_COMPUTE_UNITS: u64 = 3_300; -pub const VERIFY_ZERO_BALANCE_COMPUTE_UNITS: u64 = 6012; -pub const VERIFY_WITHDRAW_COMPUTE_UNITS: u64 = 112_454; -pub const VERIFY_CIPHERTEXT_CIPHERTEXT_EQUALITY_COMPUTE_UNITS: u64 = 7_943; -pub const VERIFY_TRANSFER_COMPUTE_UNITS: u64 = 219_290; -pub const VERIFY_TRANSFER_WITH_FEE_COMPUTE_UNITS: u64 = 407_121; -pub const VERIFY_PUBKEY_VALIDITY_COMPUTE_UNITS: u64 = 2_619; -pub const VERIFY_RANGE_PROOF_U64_COMPUTE_UNITS: u64 = 105_066; -pub const VERIFY_BATCHED_RANGE_PROOF_U64_COMPUTE_UNITS: u64 = 111_478; -pub const VERIFY_BATCHED_RANGE_PROOF_U128_COMPUTE_UNITS: u64 = 204_512; +pub const VERIFY_ZERO_BALANCE_COMPUTE_UNITS: u64 = 6_000; +pub const VERIFY_WITHDRAW_COMPUTE_UNITS: u64 = 110_000; +pub const VERIFY_CIPHERTEXT_CIPHERTEXT_EQUALITY_COMPUTE_UNITS: u64 = 8_000; +pub const VERIFY_TRANSFER_COMPUTE_UNITS: u64 = 219_000; +pub const VERIFY_TRANSFER_WITH_FEE_COMPUTE_UNITS: u64 = 407_000; +pub const VERIFY_PUBKEY_VALIDITY_COMPUTE_UNITS: u64 = 2_600; +pub const VERIFY_RANGE_PROOF_U64_COMPUTE_UNITS: u64 = 105_000; +pub const VERIFY_BATCHED_RANGE_PROOF_U64_COMPUTE_UNITS: u64 = 111_000; +pub const VERIFY_BATCHED_RANGE_PROOF_U128_COMPUTE_UNITS: u64 = 200_000; pub const VERIFY_BATCHED_RANGE_PROOF_U256_COMPUTE_UNITS: u64 = 368_000; -pub const VERIFY_CIPHERTEXT_COMMITMENT_EQUALITY_COMPUTE_UNITS: u64 = 6_424; -pub const VERIFY_GROUPED_CIPHERTEXT_2_HANDLES_VALIDITY_COMPUTE_UNITS: u64 = 6_440; -pub const VERIFY_BATCHED_GROUPED_CIPHERTEXT_2_HANDLES_VALIDITY_COMPUTE_UNITS: u64 = 12_575; -pub const VERIFY_FEE_SIGMA_COMPUTE_UNITS: u64 = 6_547; +pub const VERIFY_CIPHERTEXT_COMMITMENT_EQUALITY_COMPUTE_UNITS: u64 = 6_400; +pub const VERIFY_GROUPED_CIPHERTEXT_2_HANDLES_VALIDITY_COMPUTE_UNITS: u64 = 6_400; +pub const VERIFY_BATCHED_GROUPED_CIPHERTEXT_2_HANDLES_VALIDITY_COMPUTE_UNITS: u64 = 13_000; +pub const VERIFY_FEE_SIGMA_COMPUTE_UNITS: u64 = 6_500; fn process_verify_proof(invoke_context: &mut InvokeContext) -> Result<(), InstructionError> where