Skip to content

Commit

Permalink
fix: relayer proxy hub finalize propagate (#5022)
Browse files Browse the repository at this point in the history
* fix: add finalizeAndPropagate func to call from gelato

* fix: cooledDown for propagate
  • Loading branch information
liu-zhipeng authored Oct 17, 2023
1 parent a45598a commit a350212
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,30 @@ contract RelayerProxyHub is RelayerProxy {
lastProposeAggregateRootAt = block.timestamp;
}

/**
* @notice Wraps the `finalizeAndPropagate` function
* @param _connectors Array of connectors: should match exactly the array of `connectors` in storage;
* @param _fees Array of fees in native token for an AMB if required
* @param _encodedData Array of encodedData: extra params for each AMB if required
* @param _proposedAggregateRoot The aggregate root to be proposed.
* @param _endOfDispute The timestamp when the dispute period ends.
*/
function finalizeAndPropagate(
address[] calldata _connectors,
uint256[] calldata _fees,
bytes[] memory _encodedData,
bytes32 _proposedAggregateRoot,
uint256 _endOfDispute
) external onlyRelayer nonReentrant {
if (!_propagateCooledDown()) {
revert RelayerProxyHub__propagateCooledDown_notCooledDown(block.timestamp, lastPropagateAt + propagateCooldown);
}

_finalizeAndPropagate(_connectors, _fees, _encodedData, _proposedAggregateRoot, _endOfDispute);

lastPropagateAt = block.timestamp;
}

/**
* @notice Wraps the `finalizeAndPropagate` function
* @param _connectors Array of connectors: should match exactly the array of `connectors` in storage;
Expand Down

0 comments on commit a350212

Please sign in to comment.