Linea Fee&Gas Thread

Currently, Linea’s mainnet is now live. I am interested in Linea and specifically researching about tx cost.

I checked the official documentation and as far as I can see, none of your resources disclose any information about gas & fee. (Through the docs, I learn only the execution fee in L1 → L2 bridge situation and Manual vs Automatic Claiming explanation)

Also i learn from the [Architecture of Linea - Coordinator chapter] that “Coordinator is Linea’s consensus client”

To get a realistic idea of how to use it, I looked for a TX that had actually used the bridge.

I have two feedbacks.

  1. your bridge L1 → L2 is still taking longer than expected…
  2. use “Manual claiming” to move assets from L1 → L2, the first users to use Linea(L2) will not have any ether to claim. This is a very terrible UX.

Back to the main body, To check the tx cost, i could find the commonly txn type on etherscan:

  • ETH Transfer tx : 0x0cf00de98745d47a7314163a097305671dacef39a5f4f53ec07a2479aa91018a
    • 0.00003678 ETH (1.751742395 gwei * 21,000)
  • ERC-20 Transfer tx : 0x5fa46c04dd7c9f6324c3d2cc3993129735c89b8bad8051836616338993876927
    • 0.00006909 ETH (1.426200394 gwei * 48,436)

tx Cost = gas Price * gas Used, which is the same as the tx cost normally calculated by L1, Linea is zk-Rollup, and from what I hear, zk-Rollup has a very expensive proof gen/verify cost, which is why the prover fee should be included in the tx cost, but I’m wondering why it’s so cheap and how the fomulas are currently defined.

Thank you for reading it :slight_smile:

5 Likes

The Linea docs page has been updated… But I don’t think it’s explained well enough, can anyone help me? I’m still working on it.

1 Like

On a rollup, as the system has higher capacity than the L1 and can scale, there is --at least ideally-- no competition for access to the block: everybody will be included.

Because of this, in Linea, the base fee is constant and close to zero (because of how the Ethereum protocol works). On Linea, “Base Fee per Gas” = 0.000000007 Gwei, always

However, a transaction needs to pay the L1 cost: data availability and proof verification.
For this reason, a transaction must tip Linea’s sequencer (field “Max Priority Fee per Gas” of the transaction) enough to be included, so the sequencer can pay the L1

The minimum price to be included changes, as L1 gas price changes.

If you use MM, you will have correct prices. The value you need to look at is “Max Priority Fee per Gas”
The gas price paid is always the minimum value between “Max Priority Fee per Gas” + “Base Fee per Gas (0.000000007 gwei)” and “Max Fee per Gas”

If you set the price manually:

The calculation for the gas price you pay remains the same: minimum value between “Max Priority Fee per Gas” + “Base Fee per Gas (0.000000007 gwei)” and “Max Fee per Gas”

you can typically use

curl -s https://rpc.goerli.linea.build -X POST -H "Content-Type:application/json;" -d '{"id":1,"jsonrpc":"2.0","method":"eth_feeHistory","params":[1, "latest", [10]]}' | jq .result.reward and add a margin.

The important field is “Max Priority Fee per Gas”. A common error is a low “Max Priority Fee per Gas” and a high “Max Fee per Gas”. The value used for inclusion is “Max Priority Fee per Gas”
a low “Max Priority Fee per Gas” with a high “Max Fee per Gas” does not change anything. What is important is “Max Priority Fee per Gas”

4 Likes

Thank you for reply. however i haven’t understand it yet.

If you use MM, you will have correct prices. The value you need to look at is “Max Priority Fee per Gas”
The gas price paid is always the minimum value between “Max Priority Fee per Gas” + “Base Fee per Gas (0.000000007 gwei)” and “Max Fee per Gas”

What does mean ‘use MM’??

and why is the value of “maximum priority fee per gas” important? I don’t know how this differs from Linea, as the Ethereum fee model (EIP-1559) states that gasPrice is set by maxPriorityFeePerGas + baseFee and should not exceed MaxFeePerGas.

Additional, maxPriorityFeePerGas is a user-settable value in the metamask. The official Linea documentation recommends setting this value to 1.35.

MM=MetaMask

This was a copy paste answer from a post in the forum like channel for Linea on Consensys discord server. It was in part also an answer to the subject brought up by another user and then we turned it into an informative post as well, for future reference.

You are right about the 2nd part, the max priority fee was pointed out as important as there was an issue at that time which didn’t set the priority fee correctly, leading to stuck transactions.

3 Likes

Okay, thanks.

a transaction needs to pay the L1 cost: data availability and proof verification.

I’m wondering how exactly this is being calculated. I think Linea currently provides in Documentation is insufficient for this.

We don’t explicitly calculate the L1 data cost per transaction. But this is something we’re possibly going to change so that we can provide more costs savings for users for computationally intensive transactions.

1 Like

Oh Thank you very much!!! I get it now, I’ve been wondering about this for a while now. What you’re saying is that the Linea team is currently paying the L1 data fee??

1 Like

no I don’t think Linea team does I would need to check

2 Likes

I also think so. Good!!!