Skip to content

Commit

Permalink
sync request builders, OP_ZERO instead of OP_NONZERO, fix OP_EVAL_LOO…
Browse files Browse the repository at this point in the history
…P and add more tests, test unverified-linea with massive delay
  • Loading branch information
adraffy committed Oct 9, 2024
1 parent 408dbbc commit 5403a81
Show file tree
Hide file tree
Showing 24 changed files with 794 additions and 416 deletions.
10 changes: 7 additions & 3 deletions contracts/AbstractVerifier.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {IGatewayVerifier} from './IGatewayVerifier.sol';
import {IGatewayVerifier, CommitTooOld, CommitTooNew} from './IGatewayVerifier.sol';
import {IVerifierHooks} from './IVerifierHooks.sol';
import {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';

Expand Down Expand Up @@ -35,8 +35,12 @@ abstract contract AbstractVerifier is IGatewayVerifier, Ownable {
return _window;
}

function getHooks() external view returns (IVerifierHooks) {
return _hooks;
}

function _checkWindow(uint256 latest, uint256 got) internal view {
if (got + _window < latest) revert('too old');
if (got > latest) revert('too new');
if (got + _window < latest) revert CommitTooOld(latest, got, _window);
if (got > latest) revert CommitTooNew(latest, got);
}
}
Loading

0 comments on commit 5403a81

Please sign in to comment.