Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ contract InputVerification {
* @param signer The signer address of the coprocessor that has already rejected.
*/
error CoprocessorAlreadyRejected(uint256 zkProofId, address txSender, address signer);
error VerifyProofNotRequested(uint256 zkProofId);
error NotCoprocessorSigner(address signerAddress);
error NotCoprocessorTxSender(address txSenderAddress);
error CoprocessorSignerDoesNotMatchTxSender(address signerAddress, address txSenderAddress);

bool alreadyVerifiedRevert;
bool alreadyRejectedRevert;
bool verifyProofNotRequestedRevert;
bool otherRevert;
ConfigErrorMode configErrorMode;

Expand All @@ -37,9 +39,10 @@ contract InputVerification {
CoprocessorSignerDoesNotMatchTxSender
}

constructor(bool _alreadyVerifiedRevert, bool _alreadyRejectedRevert, bool _otherRevert) {
constructor(bool _alreadyVerifiedRevert, bool _alreadyRejectedRevert, bool _verifyProofNotRequestedRevert, bool _otherRevert) {
alreadyVerifiedRevert = _alreadyVerifiedRevert;
alreadyRejectedRevert = _alreadyRejectedRevert;
verifyProofNotRequestedRevert = _verifyProofNotRequestedRevert;
otherRevert = _otherRevert;
}

Expand Down Expand Up @@ -71,6 +74,10 @@ contract InputVerification {
revert("Other revert");
}

if (verifyProofNotRequestedRevert) {
revert VerifyProofNotRequested(zkProofId);
}

if (alreadyVerifiedRevert) {
revert CoprocessorAlreadyVerified(zkProofId, msg.sender, msg.sender);
}
Expand All @@ -84,6 +91,9 @@ contract InputVerification {
if (configErrorMode == ConfigErrorMode.NotCoprocessorTxSender) {
revert NotCoprocessorTxSender(msg.sender);
}
if (verifyProofNotRequestedRevert) {
revert VerifyProofNotRequested(zkProofId);
}
if (otherRevert) {
revert("Other revert");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,17 @@ where
);
self.remove_proof_by_id(txn_request.0).await?;
return Ok(());
} else if let Some(InputVerificationErrors::VerifyProofNotRequested(_)) =
e.as_error_resp().and_then(|payload| {
payload.as_decoded_interface_error::<InputVerificationErrors>()
})
{
warn!(
zk_proof_id = txn_request.0,
"Verify proof was not requested, removing from DB"
);
self.remove_proof_by_id(txn_request.0).await?;
return Ok(());
} else if let Some(non_retryable_config_error) =
try_extract_non_retryable_config_error(&e)
{
Expand Down
Loading
Loading