Skip to content

Commit

Permalink
Merge branch 'main' into alpha-4
Browse files Browse the repository at this point in the history
  • Loading branch information
dantaik authored Jun 30, 2023
2 parents 4cb7367 + 9d7bc39 commit dc2e975
Show file tree
Hide file tree
Showing 3 changed files with 1,702 additions and 1,070 deletions.
32 changes: 22 additions & 10 deletions packages/protocol/contracts/L1/libs/LibProving.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { IProverPool } from "../ProverPool.sol";
import { LibMath } from "../../libs/LibMath.sol";
import { LibUtils } from "./LibUtils.sol";
import { TaikoData } from "../../L1/TaikoData.sol";
import { LibBytesUtils } from "../../thirdparty/LibBytesUtils.sol";

library LibProving {
using LibMath for uint256;
Expand Down Expand Up @@ -199,18 +200,29 @@ library LibProving {
}
}

if (
!LibBytesUtils.equal(
LibBytesUtils.slice(evidence.proof, 0, 32),
bytes.concat(bytes16(0), bytes16(instance))
)
) {
revert L1_INVALID_PROOF();
}

if (
!LibBytesUtils.equal(
LibBytesUtils.slice(evidence.proof, 32, 32),
bytes.concat(
bytes16(0), bytes16(uint128(uint256(instance)))
)
)
) {
revert L1_INVALID_PROOF();
}

(bool verified, bytes memory ret) = resolver.resolve(
LibUtils.getVerifierName(evidence.verifierId), false
).staticcall(
bytes.concat(
bytes16(0),
bytes16(instance), // left 16 bytes of the given instance
bytes16(0),
bytes16(uint128(uint256(instance))), // right 16 bytes of
// the given instance
evidence.proof
)
);
).staticcall(evidence.proof);

if (
!verified
Expand Down
Loading

0 comments on commit dc2e975

Please sign in to comment.