aligned_layer icon indicating copy to clipboard operation
aligned_layer copied to clipboard

bug: pre-verification of proofs can DoS the batcher

Open Oppen opened this issue 11 months ago • 0 comments

From cantina issue #45. Transcript of description:

Batcher service's can be DoSed as in proof submission pipeline computationally expensive ZK proof verification is performed before any user validation checks.

Currently in handle_submit_proof_msg in aligned-batcher/src/lib.rs, the sequence of operations are

Basic message validation (chain ID, service address, signature)
ZK proof verification (expensive) if pre-verification is enabled (which is enabled by default)
User balance/ nonce checks
This sequence allows malicious actors to:

Submit arbitrarily many proofs without having sufficient locked funds
Force the batcher to perform expensive ZK proof verification
Consume significant CPU and Memory resources at no cost
Degrade/ deny service to legitimate users

We need to move that verification to the last step before accepting a batch, after balance checks. We may also need to use some queue to limit parallel proofs being verified to avoid unbounded memory use. Finding a way of charging for this may also help.

Oppen avatar Jan 16 '25 18:01 Oppen