diff --git a/packages/protocol/contracts/L1/libs/LibProving.sol b/packages/protocol/contracts/L1/libs/LibProving.sol index 695c935afad..029f8e469a6 100644 --- a/packages/protocol/contracts/L1/libs/LibProving.sol +++ b/packages/protocol/contracts/L1/libs/LibProving.sol @@ -7,11 +7,13 @@ pragma solidity ^0.8.18; import {AddressResolver} from "../../common/AddressResolver.sol"; +import {LibMath} from "../../libs/LibMath.sol"; import {LibTokenomics} from "./LibTokenomics.sol"; import {LibUtils} from "./LibUtils.sol"; import {TaikoData} from "../../L1/TaikoData.sol"; library LibProving { + using LibMath for uint256; using LibUtils for TaikoData.State; event BlockProven( @@ -160,9 +162,16 @@ library LibProving { fc.blockHash = evidence.blockHash; fc.signalRoot = evidence.signalRoot; fc.gasUsed = evidence.gasUsed; - fc.provenAt = uint64(block.timestamp); fc.prover = evidence.prover; + if (evidence.prover == address(1)) { + fc.provenAt = uint64( + block.timestamp.max(blk.proposedAt + config.proofTimeTarget) + ); + } else { + fc.provenAt = uint64(block.timestamp); + } + if (evidence.prover != address(0) && evidence.prover != address(1)) { uint256[9] memory inputs; diff --git a/packages/protocol/test/TaikoL1Oracle.t.sol b/packages/protocol/test/TaikoL1Oracle.t.sol index 634661e2451..28e03a935ad 100644 --- a/packages/protocol/test/TaikoL1Oracle.t.sol +++ b/packages/protocol/test/TaikoL1Oracle.t.sol @@ -569,7 +569,11 @@ contract TaikoL1OracleTest is TaikoL1TestBase { if (realproof != 0) assertEq(lastVerifiedBlockIdNow, lastVerifiedBlockId); - vm.warp(block.timestamp + conf.systemProofCooldownPeriod); + vm.warp( + block.timestamp + + conf.proofTimeTarget + + conf.systemProofCooldownPeriod + ); verifyBlock(Carol, 1); lastVerifiedBlockIdNow = L1.getStateVariables().lastVerifiedBlockId;