-
Notifications
You must be signed in to change notification settings - Fork 358
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve variety of chains sync layer stable (#818)
- Loading branch information
1 parent
de3f407
commit d5afbdf
Showing
8 changed files
with
70 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity 0.8.24; | ||
|
||
import {Verifier} from "./Verifier.sol"; | ||
import {IVerifier} from "./chain-interfaces/IVerifier.sol"; | ||
|
||
/// @author Matter Labs | ||
/// @custom:security-contact [email protected] | ||
/// @notice Modified version of the main verifier contract for the testnet environment | ||
/// @dev This contract is used to skip the zkp verification for the testnet environment. | ||
/// If the proof is not empty, it will verify it using the main verifier contract, | ||
/// otherwise, it will skip the verification. | ||
contract TestnetVerifier is Verifier { | ||
constructor(uint256 _l1ChainId) { | ||
assert(_l1ChainId != 1); | ||
} | ||
|
||
/// @dev Verifies a zk-SNARK proof, skipping the verification if the proof is empty. | ||
/// @inheritdoc IVerifier | ||
function verify(uint256[] calldata _publicInputs, uint256[] calldata _proof) public view override returns (bool) { | ||
// We allow skipping the zkp verification for the test(net) environment | ||
// If the proof is not empty, verify it, otherwise, skip the verification | ||
if (_proof.length == 0) { | ||
return true; | ||
} | ||
|
||
return super.verify(_publicInputs, _proof); | ||
} | ||
} |