Skip to content

Commit

Permalink
fix(RelayFeeCalculator): Return maxFeePerGas rather than tokenGasCost…
Browse files Browse the repository at this point in the history
… / nativeGasCost

If we divide `tokenGasCost / nativeGasCost` then we'll get the L1GasCost + L2GasPrice components for the gas price for OpStack, because OpStack adds this L1GasCost component to the full total gas cost.

The SDK should return the `gasPrice = baseFee + priorityFee` to help with debugging against the API, for example against this PR across-protocol/frontend#1335
  • Loading branch information
nicholaspai committed Jan 3, 2025
1 parent c5076d4 commit 35e2140
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/relayFeeCalculator/chain-queries/baseQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export class QueryBase implements QueryInterface {
return {
nativeGasCost, // Units: gas
tokenGasCost, // Units: wei (nativeGasCost * wei/gas)
gasPrice: tokenGasCost.div(nativeGasCost), // Units: wei/gas
gasPrice: BigNumber.from(gasPrice.toString()), // Units: wei/gas, does not include l1GasCost for OP stack chains
};
}

Expand Down

0 comments on commit 35e2140

Please sign in to comment.