Skip to content

Commit

Permalink
Rename to gas limit
Browse files Browse the repository at this point in the history
  • Loading branch information
DeividasK committed Aug 2, 2024
1 parent e2a5b03 commit a502356
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
6 changes: 3 additions & 3 deletions contracts/src/v0.8/keystone/KeystoneForwarder.sol
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ contract KeystoneForwarder is OwnerIsCreator, ITypeAndVersion, IRouter {
if (s_transmissions[transmissionId].transmitter != address(0)) revert AlreadyAttempted(transmissionId);

s_transmissions[transmissionId].transmitter = transmitter;
s_transmissions[transmissionId].gasProvided = uint88(gasLimit);
s_transmissions[transmissionId].gasLimit = uint88(gasLimit);

// Making this an external call to be able to catch reverts from the _callWithExactGas function
// and avoid having to inline the entire function here.
Expand Down Expand Up @@ -177,12 +177,12 @@ contract KeystoneForwarder is OwnerIsCreator, ITypeAndVersion, IRouter {
}

/// @notice Get transmitter of a given report or 0x0 if it wasn't transmitted yet
function getTransmissionGasProvided(
function getTransmissionGasLimit(
address receiver,
bytes32 workflowExecutionId,
bytes2 reportId
) external view returns (uint256) {
return s_transmissions[getTransmissionId(receiver, workflowExecutionId, reportId)].gasProvided;
return s_transmissions[getTransmissionId(receiver, workflowExecutionId, reportId)].gasLimit;
}

/// @notice Get delivery status of a given report
Expand Down
7 changes: 6 additions & 1 deletion contracts/src/v0.8/keystone/interfaces/IRouter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ interface IRouter {
// Ensures that the minimum gas requested by the user is available during
// the transmission attempt. If the transmission fails (indicated by a
// `false` success state), it can be retried with an increased gas limit.
uint88 gasProvided;
uint88 gasLimit;
}

function addForwarder(address forwarder) external;
Expand Down Expand Up @@ -52,5 +52,10 @@ interface IRouter {
bytes32 workflowExecutionId,
bytes2 reportId
) external view returns (TransmissionState);
function getTransmissionGasLimit(
address receiver,
bytes32 workflowExecutionId,
bytes2 reportId
) external view returns (uint256);
function isForwarder(address forwarder) external view returns (bool);
}
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ contract KeystoneForwarder_ReportTest is BaseTest {
);

assertEq(
s_forwarder.getTransmissionGasProvided(address(s_receiver), executionId, reportId),
s_forwarder.getTransmissionGasLimit(address(s_receiver), executionId, reportId),
137_398,
"transmission gas limit mismatch"
);
Expand Down

0 comments on commit a502356

Please sign in to comment.