Skip to content

Commit

Permalink
Improve wording
Browse files Browse the repository at this point in the history
  • Loading branch information
jlwllmr committed Sep 9, 2024
1 parent a2649b0 commit ad466d2
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions docs/developers/guides/gas/gas-fees.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@ Linea supports the [Ethereum EIP-1559 gas price model](https://ethereum.org/deve
total fee = units of gas used * (base fee + priority fee)
```

Using parameters in the [Linea source code](https://github.com/Consensys/linea-monorepo/blob/a001342170768a22988a29b2dca8601199c6e205/sdk/src/clients/blockchain/gas/LineaGasProvider.ts),
the formula can be rendered as:
```
total fee = gasLimit * (maxBaseFeePerGas + maxPriorityFeePerGas)
```

Linea fundamentally works exactly the same as Ethereum. The one difference is that **the base fee
is constant at 7 wei.** Blocks created by Linea use up to 24 million gas (less than 50% of the
maximum Linea block size of 61 million gas), and the fee decreases by 12.5% per block, effectively
Expand All @@ -32,16 +26,19 @@ components:
- **Layer 2 cost**: The execution fee; the cost of including your transaction on the Linea
sequencer, and calculated using a similar formula to Ethereum (as described above).
- **Layer 1 cost**: The cost of publishing your L2 transaction on Ethereum, which varies
based on the blob fee market, and is covered by the gas you pay on Linea.
based on the blob fee market.

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).

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

Please get in touch via the [Linea Discord](https://discord.gg/linea) if you intend to use
`linea_estimateGas` once it is available.
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),
Expand All @@ -52,9 +49,10 @@ You can use `eth_gasPrice` or `eth_feeHistory` to get the gas price, in wei, and
`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, contrasting with
`linea_estimateGas`, which also will return `baseFeePerGas` and `priorityFeePerGas` once available.
`eth_estimateGas` is therefore less precise and generally provides a higher estimate.
`eth_estimateGas` returns a total quantity of gas estimated for the transaction, whereas
`linea_estimateGas` will return `gasLimit`, `baseFeePerGas`, and `priorityFeePerGas` once available.
This makes it more precise; the gas quantity returned by`eth_estimateGas` is generally higher than
the `gasLimit` returned by `linea_estimateGas`.
:::

## `eth_gasPrice`
Expand Down

0 comments on commit ad466d2

Please sign in to comment.