Skip to content

Commit

Permalink
add linea ethers notes
Browse files Browse the repository at this point in the history
Signed-off-by: nicholaspai <[email protected]>
  • Loading branch information
nicholaspai committed Dec 27, 2024
1 parent bcd10bb commit 2d4caee
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/gasPriceOracle/adapters/linea.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,9 @@ import * as ethereum from "./ethereum";
import { GasPriceEstimateOptions } from "../oracle";

export function eip1559(provider: providers.Provider, opts: GasPriceEstimateOptions): Promise<GasPriceEstimate> {
// We use the legacy method to call `eth_gasPrice` which empirically returns a more accurate
// gas price estimate than `eth_maxPriorityFeePerGas` or ethersProvider.getFeeData in the EIP1559 "raw" or "bad"
// cases. Based on testing `eth_gasPrice` returns the closest price to the Linea-specific `linea_estimateGas`
// endpoint which the Viem Linea adapter queries.
return ethereum.legacy(provider, opts);
}

0 comments on commit 2d4caee

Please sign in to comment.