solana-labs / solana

Web-Scale Blockchain for fast, secure, scalable, decentralized apps and marketplaces.
https://solanalabs.com
Apache License 2.0
12.91k stars 4.13k forks source link

[zk-token-sdk] Discrete log computation can panic if `compression_batch_size` is set to 0 (ottersec #3) #33506

Closed samkim-crypto closed 10 months ago

samkim-crypto commented 11 months ago

Problem

The discrete log computation setting has an optimization parameter compression_batch_size, which specifies how fast the discrete log algorithm traverses a list of potential solutions for decryption. The default is set to 32.

If the compression_batch_size parameter is set to 0, the program panics.

Note: This is client side logic and does not impact on-chain programs.

Proposed Solution

Add a check on compression_batch_size in the discrete log logic so that the program errors gracefully.

samkim-crypto commented 10 months ago

Resolved by https://github.com/solana-labs/solana/pull/33699.