Skip to content

Commit

Permalink
chore: make proof verification external to reduce codesize
Browse files Browse the repository at this point in the history
  • Loading branch information
LHerskind authored and just-mitch committed Feb 11, 2025
1 parent 8ced7a7 commit da391f8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion l1-contracts/src/core/RollupCore.sol
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ contract RollupCore is
// End of `isAcceptable`

// Start of verifying the proof
require(EpochProofLib.verifyEpochRootProof(rollupStore, _args), "proof is invalid");
require(ExtRollupLib.verifyEpochRootProof(rollupStore, _args), "proof is invalid");
// End of verifying the proof

interim.isFeeCanonical = address(this) == FEE_JUICE_PORTAL.canonicalRollup();
Expand Down
9 changes: 9 additions & 0 deletions l1-contracts/src/core/libraries/RollupLibs/ExtRollupLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Copyright 2024 Aztec Labs.
pragma solidity >=0.8.27;

import {RollupStore, SubmitEpochRootProofArgs} from "@aztec/core/interfaces/IRollup.sol";

import {BlockLog, RollupStore} from "@aztec/core/interfaces/IRollup.sol";
import {BlobLib} from "./BlobLib.sol";
import {EpochProofLib} from "./EpochProofLib.sol";
Expand All @@ -19,6 +21,13 @@ library ExtRollupLib {
ValidationLib.validateHeaderForSubmissionBase(_args, _blocks);
}

function verifyEpochRootProof(
RollupStore storage _rollupStore,
SubmitEpochRootProofArgs calldata _args
) external view returns (bool) {
return EpochProofLib.verifyEpochRootProof(_rollupStore, _args);
}

function getManaBaseFeeComponentsAt(
FeeHeader storage _parentFeeHeader,
L1FeeData memory _fees,
Expand Down
2 changes: 1 addition & 1 deletion l1-contracts/test/fees/FeeRollup.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ import {MinimalFeeModel} from "./MinimalFeeModel.sol";
// solhint-disable comprehensive-interface

contract FakeCanonical is IRewardDistributor {
uint256 public constant BLOCK_REWARD = 0; //50e18;
uint256 public constant BLOCK_REWARD = 50e18;
IERC20 public immutable UNDERLYING;

address public canonicalRollup;
Expand Down

0 comments on commit da391f8

Please sign in to comment.