From a502356cb7696d4d153ad7afa7d91fe0406feb77 Mon Sep 17 00:00:00 2001 From: DeividasK Date: Fri, 2 Aug 2024 17:20:47 +0300 Subject: [PATCH] Rename to gas limit --- contracts/src/v0.8/keystone/KeystoneForwarder.sol | 6 +++--- contracts/src/v0.8/keystone/interfaces/IRouter.sol | 7 ++++++- .../v0.8/keystone/test/KeystoneForwarder_ReportTest.t.sol | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/contracts/src/v0.8/keystone/KeystoneForwarder.sol b/contracts/src/v0.8/keystone/KeystoneForwarder.sol index 9cb0525dd2b..e51c4a3d60a 100644 --- a/contracts/src/v0.8/keystone/KeystoneForwarder.sol +++ b/contracts/src/v0.8/keystone/KeystoneForwarder.sol @@ -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. @@ -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 diff --git a/contracts/src/v0.8/keystone/interfaces/IRouter.sol b/contracts/src/v0.8/keystone/interfaces/IRouter.sol index ad080639c73..6b9a9a4941f 100644 --- a/contracts/src/v0.8/keystone/interfaces/IRouter.sol +++ b/contracts/src/v0.8/keystone/interfaces/IRouter.sol @@ -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; @@ -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); } diff --git a/contracts/src/v0.8/keystone/test/KeystoneForwarder_ReportTest.t.sol b/contracts/src/v0.8/keystone/test/KeystoneForwarder_ReportTest.t.sol index c633ef10ef5..f3fb01e42b1 100644 --- a/contracts/src/v0.8/keystone/test/KeystoneForwarder_ReportTest.t.sol +++ b/contracts/src/v0.8/keystone/test/KeystoneForwarder_ReportTest.t.sol @@ -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" );