Skip to content

Commit

Permalink
Defer gas price computation for Linea which depends on the unsignedTx
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholaspai committed Jan 9, 2025
1 parent b9e4640 commit 866ddda
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 2 additions & 3 deletions api/_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ export const getRelayerFeeDetails = async (
},
tokenPrice: number,
relayerAddress: string,
gasPrice: sdk.utils.BigNumberish,
gasPrice?: sdk.utils.BigNumberish,
gasUnits?: sdk.utils.BigNumberish,
tokenGasCost?: sdk.utils.BigNumberish
): Promise<sdk.relayFeeCalculator.RelayerFeeDetails> => {
Expand Down Expand Up @@ -1972,9 +1972,8 @@ export function isContractCache(chainId: number, address: string) {

export function getCachedFillGasUsage(
deposit: Parameters<typeof buildDepositForSimulation>[0],
gasPrice: BigNumber,
gasPrice?: BigNumber,
overrides?: Partial<{
spokePoolAddress: string;
relayerAddress: string;
}>
) {
Expand Down
6 changes: 5 additions & 1 deletion api/limits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,11 @@ const handler = async (
),
getCachedTokenPrice(l1Token.address, "usd"),
getCachedLatestBlock(HUB_POOL_CHAIN_ID),
latestGasPriceCache(destinationChainId).get(),
// If Linea, then we will defer gas price estimation to the SDK in getCachedFillGasUsage because
// the priority fee depends upon the fill transaction calldata.
destinationChainId === CHAIN_IDs.LINEA
? undefined
: latestGasPriceCache(destinationChainId).get(),
]);
const tokenPriceUsd = ethers.utils.parseUnits(_tokenPriceUsd.toString());

Expand Down

0 comments on commit 866ddda

Please sign in to comment.