Skip to content

Commit

Permalink
optimize transmit path wrt getNativeUSD() (#12598)
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanRHall authored Mar 26, 2024
1 parent 7292d46 commit e753637
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/few-swans-wonder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

small gas fix
5 changes: 5 additions & 0 deletions contracts/.changeset/six-donuts-reply.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@chainlink/contracts": patch
---

small gas fix
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ contract AutomationRegistry2_3 is AutomationRegistryBase2_3, OCR2Abstract, Chain

{
BillingTokenPaymentParams memory billingTokenParams;
uint256 nativeUSD = _getNativeUSD(hotVars);
for (uint256 i = 0; i < report.upkeepIds.length; i++) {
if (upkeepTransmitInfo[i].earlyChecksPassed) {
if (i == 0 || upkeepTransmitInfo[i].upkeep.billingToken != upkeepTransmitInfo[i - 1].upkeep.billingToken) {
Expand All @@ -189,7 +190,7 @@ contract AutomationRegistry2_3 is AutomationRegistryBase2_3, OCR2Abstract, Chain
l1CostWei: (l1Fee * upkeepTransmitInfo[i].calldataWeight) / transmitVars.totalCalldataWeight,
fastGasWei: report.fastGasWei,
linkUSD: report.linkUSD,
nativeUSD: _getNativeUSD(hotVars),
nativeUSD: nativeUSD,
billingToken: upkeepTransmitInfo[i].upkeep.billingToken,
billingTokenParams: billingTokenParams,
isTransaction: true
Expand Down
Loading

0 comments on commit e753637

Please sign in to comment.