Skip to content

Commit

Permalink
FUN-1247 (refactor): Move Functions Coordinator duplicate request ID …
Browse files Browse the repository at this point in the history
…check earlier (#12018)
  • Loading branch information
justinkaseman authored Feb 15, 2024
1 parent 9ed2161 commit fd94ff5
Show file tree
Hide file tree
Showing 10 changed files with 223 additions and 82 deletions.
68 changes: 35 additions & 33 deletions contracts/gas-snapshots/functions.gas-snapshot
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
ChainSpecificUtil__getCurrentTxL1GasFees_Arbitrum:test__getCurrentTxL1GasFees_SuccessWhenArbitrumGoerli() (gas: 14805978)
ChainSpecificUtil__getCurrentTxL1GasFees_Arbitrum:test__getCurrentTxL1GasFees_SuccessWhenArbitrumMainnet() (gas: 14805956)
ChainSpecificUtil__getCurrentTxL1GasFees_Arbitrum:test__getCurrentTxL1GasFees_SuccessWhenArbitrumSepolia() (gas: 14805972)
ChainSpecificUtil__getCurrentTxL1GasFees_Base:test__getCurrentTxL1GasFees_SuccessWhenBaseGoerli() (gas: 14817392)
ChainSpecificUtil__getCurrentTxL1GasFees_Base:test__getCurrentTxL1GasFees_SuccessWhenBaseMainnet() (gas: 14817369)
ChainSpecificUtil__getCurrentTxL1GasFees_Base:test__getCurrentTxL1GasFees_SuccessWhenBaseSepolia() (gas: 14817341)
ChainSpecificUtil__getCurrentTxL1GasFees_Optimism:test__getCurrentTxL1GasFees_SuccessWhenOptimismGoerli() (gas: 14817292)
ChainSpecificUtil__getCurrentTxL1GasFees_Optimism:test__getCurrentTxL1GasFees_SuccessWhenOptimismMainnet() (gas: 14817281)
ChainSpecificUtil__getCurrentTxL1GasFees_Optimism:test__getCurrentTxL1GasFees_SuccessWhenOptimismSepolia() (gas: 14817325)
ChainSpecificUtil__getCurrentTxL1GasFees_Arbitrum:test__getCurrentTxL1GasFees_SuccessWhenArbitrumGoerli() (gas: 14859450)
ChainSpecificUtil__getCurrentTxL1GasFees_Arbitrum:test__getCurrentTxL1GasFees_SuccessWhenArbitrumMainnet() (gas: 14859428)
ChainSpecificUtil__getCurrentTxL1GasFees_Arbitrum:test__getCurrentTxL1GasFees_SuccessWhenArbitrumSepolia() (gas: 14859444)
ChainSpecificUtil__getCurrentTxL1GasFees_Base:test__getCurrentTxL1GasFees_SuccessWhenBaseGoerli() (gas: 14870866)
ChainSpecificUtil__getCurrentTxL1GasFees_Base:test__getCurrentTxL1GasFees_SuccessWhenBaseMainnet() (gas: 14870843)
ChainSpecificUtil__getCurrentTxL1GasFees_Base:test__getCurrentTxL1GasFees_SuccessWhenBaseSepolia() (gas: 14870815)
ChainSpecificUtil__getCurrentTxL1GasFees_Optimism:test__getCurrentTxL1GasFees_SuccessWhenOptimismGoerli() (gas: 14870766)
ChainSpecificUtil__getCurrentTxL1GasFees_Optimism:test__getCurrentTxL1GasFees_SuccessWhenOptimismMainnet() (gas: 14870755)
ChainSpecificUtil__getCurrentTxL1GasFees_Optimism:test__getCurrentTxL1GasFees_SuccessWhenOptimismSepolia() (gas: 14870799)
FunctionsBilling_Constructor:test_Constructor_Success() (gas: 14812)
FunctionsBilling_DeleteCommitment:test_DeleteCommitment_RevertIfNotRouter() (gas: 13282)
FunctionsBilling_DeleteCommitment:test_DeleteCommitment_Success() (gas: 15897)
FunctionsBilling_EstimateCost:test_EstimateCost_RevertsIfGasPriceAboveCeiling() (gas: 32458)
FunctionsBilling_EstimateCost:test_EstimateCost_Success() (gas: 53807)
FunctionsBilling_EstimateCost:test_EstimateCost_SuccessLowGasPrice() (gas: 53910)
FunctionsBilling_EstimateCost:test_EstimateCost_RevertsIfGasPriceAboveCeiling() (gas: 32414)
FunctionsBilling_EstimateCost:test_EstimateCost_Success() (gas: 53763)
FunctionsBilling_EstimateCost:test_EstimateCost_SuccessLowGasPrice() (gas: 53866)
FunctionsBilling_GetAdminFee:test_GetAdminFee_Success() (gas: 18226)
FunctionsBilling_GetConfig:test_GetConfig_Success() (gas: 23671)
FunctionsBilling_GetConfig:test_GetConfig_Success() (gas: 23693)
FunctionsBilling_GetDONFee:test_GetDONFee_Success() (gas: 15792)
FunctionsBilling_GetWeiPerUnitLink:test_GetWeiPerUnitLink_Success() (gas: 31773)
FunctionsBilling_OracleWithdraw:test_OracleWithdraw_RevertIfInsufficientBalance() (gas: 70128)
Expand All @@ -24,45 +24,43 @@ FunctionsBilling_OracleWithdraw:test_OracleWithdraw_SuccessTransmitterWithBalanc
FunctionsBilling_OracleWithdrawAll:test_OracleWithdrawAll_RevertIfNotOwner() (gas: 13296)
FunctionsBilling_OracleWithdrawAll:test_OracleWithdrawAll_SuccessPaysTransmittersWithBalance() (gas: 147278)
FunctionsBilling_UpdateConfig:test_UpdateConfig_RevertIfNotOwner() (gas: 18974)
FunctionsBilling_UpdateConfig:test_UpdateConfig_Success() (gas: 38251)
FunctionsBilling_UpdateConfig:test_UpdateConfig_Success() (gas: 38273)
FunctionsBilling__DisperseFeePool:test__DisperseFeePool_RevertIfNotSet() (gas: 8810)
FunctionsBilling__FulfillAndBill:test__FulfillAndBill_RevertIfInvalidCommitment() (gas: 13302)
FunctionsBilling__FulfillAndBill:test__FulfillAndBill_Success() (gas: 180763)
FunctionsBilling__StartBilling:test__FulfillAndBill_HasUniqueGlobalRequestId() (gas: 398400)
FunctionsClient_Constructor:test_Constructor_Success() (gas: 7573)
FunctionsClient_FulfillRequest:test_FulfillRequest_MaximumGas() (gas: 497786)
FunctionsClient_FulfillRequest:test_FulfillRequest_MinimumGas() (gas: 198990)
FunctionsClient_HandleOracleFulfillment:test_HandleOracleFulfillment_RevertIfNotRouter() (gas: 14623)
FunctionsClient_HandleOracleFulfillment:test_HandleOracleFulfillment_Success() (gas: 22923)
FunctionsClient__SendRequest:test__SendRequest_RevertIfInvalidCallbackGasLimit() (gas: 55059)
FunctionsCoordinator_Constructor:test_Constructor_Success() (gas: 12006)
FunctionsCoordinator_GetDONPublicKey:test_GetDONPublicKey_RevertIfEmpty() (gas: 15334)
FunctionsCoordinator_GetDONPublicKey:test_GetDONPublicKey_Success() (gas: 106506)
FunctionsCoordinator_GetDONPublicKey:test_GetDONPublicKey_RevertIfEmpty() (gas: 15356)
FunctionsCoordinator_GetDONPublicKey:test_GetDONPublicKey_Success() (gas: 106528)
FunctionsCoordinator_GetThresholdPublicKey:test_GetThresholdPublicKey_RevertIfEmpty() (gas: 15313)
FunctionsCoordinator_GetThresholdPublicKey:test_GetThresholdPublicKey_Success() (gas: 656362)
FunctionsCoordinator_SetDONPublicKey:test_SetDONPublicKey_RevertNotOwner() (gas: 20364)
FunctionsCoordinator_SetDONPublicKey:test_SetDONPublicKey_Success() (gas: 101285)
FunctionsCoordinator_SetDONPublicKey:test_SetDONPublicKey_Success() (gas: 101307)
FunctionsCoordinator_SetThresholdPublicKey:test_SetThresholdPublicKey_RevertNotOwner() (gas: 13892)
FunctionsCoordinator_SetThresholdPublicKey:test_SetThresholdPublicKey_Success() (gas: 651054)
FunctionsCoordinator_StartRequest:test_StartRequest_RevertIfNotRouter() (gas: 22703)
FunctionsCoordinator_StartRequest:test_StartRequest_Success() (gas: 108848)
FunctionsCoordinator_StartRequest:test_StartRequest_Success() (gas: 108804)
FunctionsCoordinator__IsTransmitter:test__IsTransmitter_SuccessFound() (gas: 18957)
FunctionsCoordinator__IsTransmitter:test__IsTransmitter_SuccessNotFound() (gas: 19690)
FunctionsRequest_DEFAULT_BUFFER_SIZE:test_DEFAULT_BUFFER_SIZE() (gas: 246)
FunctionsRequest_EncodeCBOR:test_EncodeCBOR_Success() (gas: 223)
FunctionsRequest_REQUEST_DATA_VERSION:test_REQUEST_DATA_VERSION() (gas: 225)
FunctionsRouter_Constructor:test_Constructor_Success() (gas: 12007)
FunctionsRouter_Fulfill:test_Fulfill_RequestNotProcessedCostExceedsCommitment() (gas: 167477)
FunctionsRouter_Fulfill:test_Fulfill_RequestNotProcessedInsufficientGas() (gas: 157808)
FunctionsRouter_Fulfill:test_Fulfill_RequestNotProcessedCostExceedsCommitment() (gas: 169845)
FunctionsRouter_Fulfill:test_Fulfill_RequestNotProcessedInsufficientGas() (gas: 160176)
FunctionsRouter_Fulfill:test_Fulfill_RequestNotProcessedInvalidCommitment() (gas: 38115)
FunctionsRouter_Fulfill:test_Fulfill_RequestNotProcessedInvalidRequestId() (gas: 35238)
FunctionsRouter_Fulfill:test_Fulfill_RequestNotProcessedSubscriptionBalanceInvariant() (gas: 175953)
FunctionsRouter_Fulfill:test_Fulfill_RequestNotProcessedSubscriptionBalanceInvariant() (gas: 178321)
FunctionsRouter_Fulfill:test_Fulfill_RevertIfNotCommittedCoordinator() (gas: 28086)
FunctionsRouter_Fulfill:test_Fulfill_RevertIfPaused() (gas: 151496)
FunctionsRouter_Fulfill:test_Fulfill_SuccessClientNoLongerExists() (gas: 321059)
FunctionsRouter_Fulfill:test_Fulfill_SuccessFulfilled() (gas: 334680)
FunctionsRouter_Fulfill:test_Fulfill_SuccessUserCallbackReverts() (gas: 2510006)
FunctionsRouter_Fulfill:test_Fulfill_SuccessUserCallbackRunsOutOfGas() (gas: 540441)
FunctionsRouter_Fulfill:test_Fulfill_RevertIfPaused() (gas: 153883)
FunctionsRouter_Fulfill:test_Fulfill_SuccessClientNoLongerExists() (gas: 321333)
FunctionsRouter_Fulfill:test_Fulfill_SuccessFulfilled() (gas: 334954)
FunctionsRouter_Fulfill:test_Fulfill_SuccessUserCallbackReverts() (gas: 2510380)
FunctionsRouter_Fulfill:test_Fulfill_SuccessUserCallbackRunsOutOfGas() (gas: 540815)
FunctionsRouter_GetAdminFee:test_GetAdminFee_Success() (gas: 17983)
FunctionsRouter_GetAllowListId:test_GetAllowListId_Success() (gas: 12904)
FunctionsRouter_GetConfig:test_GetConfig_Success() (gas: 37159)
Expand Down Expand Up @@ -91,15 +89,15 @@ FunctionsRouter_SendRequest:test_SendRequest_RevertIfInvalidCallbackGasLimit() (
FunctionsRouter_SendRequest:test_SendRequest_RevertIfInvalidDonId() (gas: 25082)
FunctionsRouter_SendRequest:test_SendRequest_RevertIfNoSubscription() (gas: 29132)
FunctionsRouter_SendRequest:test_SendRequest_RevertIfPaused() (gas: 34291)
FunctionsRouter_SendRequest:test_SendRequest_Success() (gas: 286243)
FunctionsRouter_SendRequest:test_SendRequest_Success() (gas: 286199)
FunctionsRouter_SendRequestToProposed:test_SendRequestToProposed_RevertIfConsumerNotAllowed() (gas: 65887)
FunctionsRouter_SendRequestToProposed:test_SendRequestToProposed_RevertIfEmptyData() (gas: 36012)
FunctionsRouter_SendRequestToProposed:test_SendRequestToProposed_RevertIfIncorrectDonId() (gas: 29896)
FunctionsRouter_SendRequestToProposed:test_SendRequestToProposed_RevertIfInvalidCallbackGasLimit() (gas: 57533)
FunctionsRouter_SendRequestToProposed:test_SendRequestToProposed_RevertIfInvalidDonId() (gas: 27503)
FunctionsRouter_SendRequestToProposed:test_SendRequestToProposed_RevertIfNoSubscription() (gas: 35717)
FunctionsRouter_SendRequestToProposed:test_SendRequestToProposed_RevertIfPaused() (gas: 40810)
FunctionsRouter_SendRequestToProposed:test_SendRequestToProposed_Success() (gas: 292812)
FunctionsRouter_SendRequestToProposed:test_SendRequestToProposed_Success() (gas: 292746)
FunctionsRouter_SendRequestToProposed:test_SendRequest_RevertIfInsufficientSubscriptionBalance() (gas: 193512)
FunctionsRouter_SetAllowListId:test_SetAllowListId_Success() (gas: 30688)
FunctionsRouter_SetAllowListId:test_UpdateConfig_RevertIfNotOwner() (gas: 13403)
Expand Down Expand Up @@ -146,7 +144,7 @@ FunctionsSubscriptions_OnTokenTransfer:test_OnTokenTransfer_RevertIfCallerIsNoCa
FunctionsSubscriptions_OnTokenTransfer:test_OnTokenTransfer_RevertIfCallerIsNoSubscription() (gas: 42404)
FunctionsSubscriptions_OnTokenTransfer:test_OnTokenTransfer_RevertIfCallerIsNotLink() (gas: 13441)
FunctionsSubscriptions_OnTokenTransfer:test_OnTokenTransfer_RevertIfPaused() (gas: 47347)
FunctionsSubscriptions_OnTokenTransfer:test_OnTokenTransfer_Success(uint96) (runs: 256, μ: 81598, ~: 81598)
FunctionsSubscriptions_OnTokenTransfer:test_OnTokenTransfer_Success() (gas: 81490)
FunctionsSubscriptions_OracleWithdraw:test_OracleWithdraw_RevertIfAmountMoreThanBalance() (gas: 20745)
FunctionsSubscriptions_OracleWithdraw:test_OracleWithdraw_RevertIfBalanceInvariant() (gas: 189)
FunctionsSubscriptions_OracleWithdraw:test_OracleWithdraw_RevertIfNoAmount() (gas: 15638)
Expand Down Expand Up @@ -208,12 +206,12 @@ FunctionsTermsOfServiceAllowList_BlockSender:test_BlockSender_Success() (gas: 96
FunctionsTermsOfServiceAllowList_Constructor:test_Constructor_Success() (gas: 12253)
FunctionsTermsOfServiceAllowList_GetAllAllowedSenders:test_GetAllAllowedSenders_Success() (gas: 19199)
FunctionsTermsOfServiceAllowList_GetAllowedSendersCount:test_GetAllowedSendersCount_Success() (gas: 12995)
FunctionsTermsOfServiceAllowList_GetAllowedSendersInRange:test_GetAllowedSendersInRange_RevertIfAllowedSendersIsEmpty() (gas: 12184656)
FunctionsTermsOfServiceAllowList_GetAllowedSendersInRange:test_GetAllowedSendersInRange_RevertIfAllowedSendersIsEmpty() (gas: 12237753)
FunctionsTermsOfServiceAllowList_GetAllowedSendersInRange:test_GetAllowedSendersInRange_RevertIfEndIsAfterLastAllowedSender() (gas: 16571)
FunctionsTermsOfServiceAllowList_GetAllowedSendersInRange:test_GetAllowedSendersInRange_RevertIfStartIsAfterEnd() (gas: 13301)
FunctionsTermsOfServiceAllowList_GetAllowedSendersInRange:test_GetAllowedSendersInRange_Success() (gas: 20448)
FunctionsTermsOfServiceAllowList_GetBlockedSendersCount:test_GetBlockedSendersCount_Success() (gas: 12931)
FunctionsTermsOfServiceAllowList_GetBlockedSendersInRange:test_GetBlockedSendersInRange_RevertIfAllowedSendersIsEmpty() (gas: 12184660)
FunctionsTermsOfServiceAllowList_GetBlockedSendersInRange:test_GetBlockedSendersInRange_RevertIfAllowedSendersIsEmpty() (gas: 12237757)
FunctionsTermsOfServiceAllowList_GetBlockedSendersInRange:test_GetBlockedSendersInRange_RevertIfEndIsAfterLastAllowedSender() (gas: 16549)
FunctionsTermsOfServiceAllowList_GetBlockedSendersInRange:test_GetBlockedSendersInRange_RevertIfStartIsAfterEnd() (gas: 13367)
FunctionsTermsOfServiceAllowList_GetBlockedSendersInRange:test_GetBlockedSendersInRange_Success() (gas: 18493)
Expand All @@ -230,6 +228,10 @@ FunctionsTermsOfServiceAllowList_UpdateConfig:test_UpdateConfig_Success() (gas:
Gas_AcceptTermsOfService:test_AcceptTermsOfService_Gas() (gas: 84702)
Gas_AddConsumer:test_AddConsumer_Gas() (gas: 79131)
Gas_CreateSubscription:test_CreateSubscription_Gas() (gas: 73419)
Gas_FulfillRequest_DuplicateRequestID:test_FulfillRequest_DuplicateRequestID_MaximumGas() (gas: 20695)
Gas_FulfillRequest_DuplicateRequestID:test_FulfillRequest_DuplicateRequestID_MinimumGas() (gas: 20135)
Gas_FulfillRequest_Success:test_FulfillRequest_Success_MaximumGas() (gas: 498083)
Gas_FulfillRequest_Success:test_FulfillRequest_Success_MinimumGas() (gas: 199286)
Gas_FundSubscription:test_FundSubscription_Gas() (gas: 38546)
Gas_SendRequest:test_SendRequest_MaximumGas() (gas: 979631)
Gas_SendRequest:test_SendRequest_MinimumGas() (gas: 157578)
5 changes: 5 additions & 0 deletions contracts/src/v0.8/functions/dev/v1_X/FunctionsBilling.sol
Original file line number Diff line number Diff line change
Expand Up @@ -372,4 +372,9 @@ abstract contract FunctionsBilling is Routable, IFunctionsBilling {

// Overriden in FunctionsCoordinator.sol
function _onlyOwner() internal view virtual;

// Used in FunctionsCoordinator.sol
function _isExistingRequest(bytes32 requestId) internal view returns (bool) {
return s_requestCommitments[requestId] != bytes32(0);
}
}
50 changes: 37 additions & 13 deletions contracts/src/v0.8/functions/dev/v1_X/FunctionsCoordinator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,9 @@ contract FunctionsCoordinator is OCR2Base, IFunctionsCoordinator, FunctionsBilli
return s_transmitters;
}

/// @dev Report hook called within OCR2Base.sol
function _report(
uint256 /*initialGas*/,
address /*transmitter*/,
uint8 /*signerCount*/,
address[MAX_NUM_ORACLES] memory /*signers*/,
function _beforeTransmit(
bytes calldata report
) internal override {
) internal view override returns (bool shouldStop, DecodedReport memory decodedReport) {
(
bytes32[] memory requestIds,
bytes[] memory results,
Expand All @@ -152,15 +147,44 @@ contract FunctionsCoordinator is OCR2Base, IFunctionsCoordinator, FunctionsBilli
revert ReportInvalid("Fields must be equal length");
}

for (uint256 i = 0; i < numberOfFulfillments; ++i) {
if (_isExistingRequest(requestIds[i])) {
// If there is an existing request, validate report
// Leave shouldStop to default, false
break;
}
if (i == numberOfFulfillments - 1) {
// If the last fulfillment on the report does not exist, then all are duplicates
// Indicate that it's safe to stop to save on the gas of validating the report
shouldStop = true;
}
}

return (
shouldStop,
DecodedReport({
requestIds: requestIds,
results: results,
errors: errors,
onchainMetadata: onchainMetadata,
offchainMetadata: offchainMetadata
})
);
}

/// @dev Report hook called within OCR2Base.sol
function _report(DecodedReport memory decodedReport) internal override {
uint256 numberOfFulfillments = uint8(decodedReport.requestIds.length);

// Bounded by "MaxRequestBatchSize" on the Job's ReportingPluginConfig
for (uint256 i = 0; i < numberOfFulfillments; ++i) {
FunctionsResponse.FulfillResult result = FunctionsResponse.FulfillResult(
_fulfillAndBill(
requestIds[i],
results[i],
errors[i],
onchainMetadata[i],
offchainMetadata[i],
decodedReport.requestIds[i],
decodedReport.results[i],
decodedReport.errors[i],
decodedReport.onchainMetadata[i],
decodedReport.offchainMetadata[i],
uint8(numberOfFulfillments) // will not exceed "MaxRequestBatchSize" on the Job's ReportingPluginConfig
)
);
Expand All @@ -172,7 +196,7 @@ contract FunctionsCoordinator is OCR2Base, IFunctionsCoordinator, FunctionsBilli
result == FunctionsResponse.FulfillResult.FULFILLED ||
result == FunctionsResponse.FulfillResult.USER_CALLBACK_ERROR
) {
emit OracleResponse(requestIds[i], msg.sender);
emit OracleResponse(decodedReport.requestIds[i], msg.sender);
}
}
}
Expand Down
35 changes: 20 additions & 15 deletions contracts/src/v0.8/functions/dev/v1_X/ocr/OCR2Base.sol
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ abstract contract OCR2Base is ConfirmedOwner, OCR2Abstract {
// i.e. the address the oracle actually sends transactions to the contract from
address[] internal s_transmitters;

struct DecodedReport {
bytes32[] requestIds;
bytes[] results;
bytes[] errors;
bytes[] onchainMetadata;
bytes[] offchainMetadata;
}

/*
* Config logic
*/
Expand Down Expand Up @@ -238,18 +246,9 @@ abstract contract OCR2Base is ConfirmedOwner, OCR2Abstract {
/**
* @dev hook called after the report has been fully validated
* for the extending contract to handle additional logic, such as oracle payment
* @param initialGas the amount of gas before validation
* @param transmitter the address of the account that submitted the report
* @param signers the addresses of all signing accounts
* @param report serialized report
* @param decodedReport decodedReport
*/
function _report(
uint256 initialGas,
address transmitter,
uint8 signerCount,
address[MAX_NUM_ORACLES] memory signers,
bytes calldata report
) internal virtual;
function _report(DecodedReport memory decodedReport) internal virtual;

// The constant-length components of the msg.data sent to transmit.
// See the "If we wanted to call sam" example on for example reasoning
Expand Down Expand Up @@ -283,6 +282,10 @@ abstract contract OCR2Base is ConfirmedOwner, OCR2Abstract {
if (msg.data.length != expected) revert ReportInvalid("calldata length mismatch");
}

function _beforeTransmit(
bytes calldata report
) internal virtual returns (bool shouldStop, DecodedReport memory decodedReport);

/**
* @notice transmit is called to post a new report to the contract
* @param report serialized report, which the signatures are signing.
Expand All @@ -299,7 +302,11 @@ abstract contract OCR2Base is ConfirmedOwner, OCR2Abstract {
bytes32[] calldata ss,
bytes32 rawVs // signatures
) external override {
uint256 initialGas = gasleft(); // This line must come first
(bool shouldStop, DecodedReport memory decodedReport) = _beforeTransmit(report);

if (shouldStop) {
return;
}

{
// reportContext consists of:
Expand Down Expand Up @@ -328,7 +335,6 @@ abstract contract OCR2Base is ConfirmedOwner, OCR2Abstract {
}

address[MAX_NUM_ORACLES] memory signed;
uint8 signerCount = 0;

{
// Verify signatures attached to report
Expand All @@ -342,10 +348,9 @@ abstract contract OCR2Base is ConfirmedOwner, OCR2Abstract {
if (o.role != Role.Signer) revert ReportInvalid("address not authorized to sign");
if (signed[o.index] != address(0)) revert ReportInvalid("non-unique signature");
signed[o.index] = signer;
signerCount += 1;
}
}

_report(initialGas, msg.sender, signerCount, signed, report);
_report(decodedReport);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ contract FunctionsSubscriptions_OnTokenTransfer is FunctionsClientSetup {
s_linkToken.transferAndCall(address(s_functionsRouter), totalSupplyJuels, abi.encode(invalidSubscriptionId));
}

function test_OnTokenTransfer_Success(uint96 fundingAmount) public {
function test_OnTokenTransfer_Success() public {
// Funding amount must be less than LINK total supply
uint256 totalSupplyJuels = 1_000_000_000 * 1e18;
// Some of the total supply is already in the subscription account
Expand Down
Loading

0 comments on commit fd94ff5

Please sign in to comment.