Skip to content

Commit

Permalink
Update gas estimation page
Browse files Browse the repository at this point in the history
  • Loading branch information
jlwllmr committed Sep 30, 2024
1 parent 65b72c2 commit a2ab6cf
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions docs/developers/guides/gas/gas-fees.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,27 @@ components:
These two resource costs are abstracted by the rollup and covered by the recommended L2 gas price
and gas used.

Learn more about [gas on Linea](./gas-on-linea.mdx).
> Learn more about [gas on Linea](./gas-on-linea.mdx).
:::info
A new API for estimating gas on Linea, `linea_estimateGas`, will be activated soon. See our
`linea_estimateGas` is the recommended method for estimating gas on Linea. See our
[reference page](../../reference/api/linea-estimategas.mdx) for more information.

If you intend to use `linea_estimateGas` once it is available, you want to find out more, or you
have further questions, please get in touch on [Discord](https://discord.gg/linea).
:::

Linea supports [`eth_estimateGas`](https://docs.infura.io/api/networks/linea/json-rpc-methods/eth_estimategas),
Linea also supports [`eth_estimateGas`](https://docs.infura.io/api/networks/linea/json-rpc-methods/eth_estimategas),
[`eth_gasPrice`](https://docs.infura.io/api/networks/linea/json-rpc-methods/eth_gasprice), and
[`eth_feeHistory`](https://docs.infura.io/api/networks/linea/json-rpc-methods/eth_feehistory).

You can use `eth_gasPrice` or `eth_feeHistory` to get the gas price, in wei, and you can use
`eth_estimateGas` to find out how many units of gas a specific transaction will need.

:::note
`eth_estimateGas` returns a total quantity of gas estimated for the transaction, whereas
`linea_estimateGas` will return `gasLimit`, `baseFeePerGas`, and `priorityFeePerGas` once available,
providing a more precise estimate.
:::
## [`linea_estimateGas`](../../reference/api/linea-estimategas.mdx)

`linea_estimateGas` is the recommended method for estimating gas on Linea. It returns `gasLimit`,
`baseFeePerGas`, and `priorityFeePerGas`, and therefore provides a more precise gas estimate than
the alternatives.

It can also help prevent transactions from being rejected due to exceeding [module limits](../../../architecture/stack/trace-expansion-proving/prover-limits.mdx).

See the [reference page](../../reference/api/linea-estimategas.mdx) for usage.

## `eth_gasPrice`

Expand Down

0 comments on commit a2ab6cf

Please sign in to comment.