Skip to content

Commit

Permalink
fix: correctly check deadline and standardize ABI
Browse files Browse the repository at this point in the history
  • Loading branch information
reednaa committed Feb 16, 2024
1 parent 0a133e1 commit 2e222f9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/IncentivizedMessageEscrow.sol
Original file line number Diff line number Diff line change
Expand Up @@ -923,16 +923,16 @@ abstract contract IncentivizedMessageEscrow is IIncentivizedMessageEscrow, Bytes
* waste a lot of gas.
* There is no reliable way to block this function such that it can't be called twice after a message has been timed out
* since the content could we wrong or the proof may still exist.
* @param destinationIncentives The address of the source generalisedIncentives that emitted the original message
* @param implementationIdentifier The address of the source generalisedIncentives that emitted the original message
* @param sourceIdentifier The identifier for the source chain (where to send the message)
* @param originBlockNumber The block number when the message was originally emitted.
* Note that for some L2 this could be the block number of the underlying chain.
* Regardless: It is the same block number which generated themessage identifier.
* @param message Original Generalised Incentives messag
*/
function timeoutMessage(
bytes calldata destinationIncentives,
bytes32 sourceIdentifier,
bytes calldata implementationIdentifier,
uint256 originBlockNumber,
bytes calldata message
) external payable virtual {
Expand All @@ -958,7 +958,7 @@ abstract contract IncentivizedMessageEscrow is IIncentivizedMessageEscrow, Bytes

// Check that the deadline has passed AND that there is no opt out.
// This isn't a strong check but if a relayer is honest, then it can be used as a sanity check.
if (deadline != 0 && deadline <= block.timestamp) revert DeadlineNotPassed(deadline, uint64(block.timestamp));
if (deadline != 0 && deadline > block.timestamp) revert DeadlineNotPassed(deadline, uint64(block.timestamp));

// Reconstruct message
bytes memory receiveAckWithContext = bytes.concat(
Expand All @@ -976,7 +976,7 @@ abstract contract IncentivizedMessageEscrow is IIncentivizedMessageEscrow, Bytes
// Send the message
uint128 cost = _sendPacket(
sourceIdentifier,
destinationIncentives,
implementationIdentifier,
receiveAckWithContext
);

Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/IIncentivizedMessageEscrow.sol
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ interface IIncentivizedMessageEscrow is IMessageEscrowStructs, IMessageEscrowErr
function estimateAdditionalCost() external view returns(address asset, uint256 amount);

function timeoutMessage(
bytes calldata destinationIncentives,
bytes32 sourceIdentifier,
bytes calldata implementationIdentifier,
uint256 originBlockNumber,
bytes calldata message
) external payable;
Expand Down

0 comments on commit 2e222f9

Please sign in to comment.