diff --git a/src/gasPriceOracle/adapters/linea-viem.ts b/src/gasPriceOracle/adapters/linea-viem.ts index d97bf188..4eb897ae 100644 --- a/src/gasPriceOracle/adapters/linea-viem.ts +++ b/src/gasPriceOracle/adapters/linea-viem.ts @@ -10,6 +10,7 @@ import { PopulatedTransaction } from "ethers"; * compressed transaction size, layer 1 verification costs and capacity, gas price ratio between layer 1 and layer 2, * the transaction's gas usage, the minimum gas price on layer 2, * and a minimum margin (for error) for gas price estimation. + * Source: https://docs.linea.build/get-started/how-to/gas-fees#how-gas-works-on-linea * @dev Because the Linea priority fee is more volatile than the base fee, the base fee multiplier will be applied * to the priority fee. * @param provider diff --git a/test/GasPriceOracle.test.ts b/test/GasPriceOracle.test.ts index 9a483dba..d98a12ac 100644 --- a/test/GasPriceOracle.test.ts +++ b/test/GasPriceOracle.test.ts @@ -18,7 +18,7 @@ const dummyLogger = winston.createLogger({ const stdLastBaseFeePerGas = parseUnits("12", 9); const stdMaxPriorityFeePerGas = parseUnits("1", 9); // EIP-1559 chains only -const expectedLineaMaxFeePerGas = parseUnits("7", 9); +const expectedLineaMaxFeePerGas = BigNumber.from("7"); const ethersProviderChainIds = [1, 10, 137, 324, 8453, 42161, 534352, 59144]; const viemProviderChainIds = [59144]; @@ -142,6 +142,10 @@ describe("Gas Price Oracle", function () { expect(markedUpMaxPriorityFeePerGas).to.equal(1); expect(maxPriorityFeePerGas).to.equal(1); } + if (chainId === 324 || chainId === 534352) { + // Scroll and ZkSync use legacy pricing so priority fee should be 0. + expect(maxPriorityFeePerGas).to.equal(0); + } if (eip1559RawGasPriceFeedChainIds.includes(chainId)) { const chainKey = `GAS_PRICE_EIP1559_RAW_${chainId}`; delete process.env[chainKey]; diff --git a/test/utils/transport.ts b/test/utils/transport.ts index 660f15eb..5ffd7d59 100644 --- a/test/utils/transport.ts +++ b/test/utils/transport.ts @@ -20,8 +20,8 @@ export const makeCustomTransport = ( return BigInt(stdMaxPriorityFeePerGas.toString()); case "linea_estimateGas": return { - // Linea base fee is always 7 gwei - baseFeePerGas: BigInt(parseUnits("7", 9).toString()), + // Linea base fee is always 7 wei + baseFeePerGas: BigInt(7), priorityFeePerGas: BigInt(stdMaxPriorityFeePerGas.toString()), gasLimit: BigInt("0"), };