From beb0c3322f3fb25d9859fcb6a41ef714e74b0b9d Mon Sep 17 00:00:00 2001 From: Daniel Wang <99078276+dantaik@users.noreply.github.com> Date: Sun, 29 Jan 2023 22:22:04 +0800 Subject: [PATCH] chore(protocol): improve ZKP verification handling (#13071) --- packages/protocol/contracts/L1/libs/LibProving.sol | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/protocol/contracts/L1/libs/LibProving.sol b/packages/protocol/contracts/L1/libs/LibProving.sol index 2b6d550032f..1e5daf765f5 100644 --- a/packages/protocol/contracts/L1/libs/LibProving.sol +++ b/packages/protocol/contracts/L1/libs/LibProving.sol @@ -247,12 +247,10 @@ library LibProving { // but a special prover can skip ZKP verification if the ZKP is empty. // TODO(daniel): remove this special address. - address specialProver = resolver.resolve("special_prover", true); - - for (uint256 i = 0; i < config.zkProofsPerBlock; ++i) { - if (msg.sender == specialProver && evidence.proofs[i].length == 0) { - // Skip ZKP verification - } else { + if (msg.sender == resolver.resolve("special_prover", true)) { + // Skip ZKP verification + } else { + for (uint256 i = 0; i < config.zkProofsPerBlock; ++i) { require( proofVerifier.verifyZKP({ verifierId: string(