-
Notifications
You must be signed in to change notification settings - Fork 403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Explain gas pricing mechanism #769
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some feedback. Would prefer another review before merging.
- [`eth_gasPrice`](https://docs.infura.io/api/networks/linea/json-rpc-methods/eth_gasprice) | ||
- [`eth_feeHistory`](https://docs.infura.io/api/networks/linea/json-rpc-methods/eth_feehistory). | ||
|
||
## Gas pricing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question. This content reads like we're populating the Ethereum networks extraData
block field? Is this correct? Or is the extraData
block field for Linea being populated.
The gas price you retrieve using methods such as `linea_estimateGas` is based on the variable data | ||
cost of the previous block with a profitability multiplier applied. | ||
|
||
The first stage of returning gas price values with `linea_estimateGas` is to populate values in an | ||
object called `extraData`. The two most relevant values here are: | ||
- A `FIXED_COST` of 0.03 Gwei, which reflects infrastructure costs, and; | ||
- `VARIABLE_COST`, which is the cost per byte of data submitted to L1. | ||
|
||
These values are inserted into each block's `extraData` field—32 bytes available in every Ethereum | ||
block to store any data—and then used by the sequencer and Linea Besu nodes running the correct | ||
plugins to expose `linea_estimateGas`, in both cases with the same logic. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommend (assuming we're writing to Linea's extraData
):
The gas price returned by linea_estimateGas
is based on the
variable data cost of the previous block with a profitability multiplier applied.
Each Linea block's extraData
field is populated with the following gas price values that are used by linea_estimateGas to calculate the cost of a transaction:
- A FIXED_COST of 0.03 Gwei, which reflects infrastructure costs, and;
- VARIABLE_COST, which is the cost per byte of data submitted to L1.
:::note
The extraData
field is a 32-byte space used to store arbitrary data, such as metadata or
additional information relevant to the block.
With Linea it is used by the sequencer and Linea Besu nodes running the correct plugins
to expose linea_estimateGas
:::
The `linea_estimateGas` formula above essentially ensures that transactions are checked for | ||
profitability for inclusion in a block. However, the nonce order of transactions submitted from the | ||
same account takes precedence, so there may be occasions where less profitable transactions must be | ||
included first. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The `linea_estimateGas` formula above essentially ensures that transactions are checked for | |
profitability for inclusion in a block. However, the nonce order of transactions submitted from the | |
same account takes precedence, so there may be occasions where less profitable transactions must be | |
included first. | |
The `linea_estimateGas` formula above ensures that transactions are checked for | |
profitability for inclusion in a block. However, the nonce order of transactions submitted from the | |
same account takes precedence, so there may be occasions where less profitable transactions must be | |
included first. |
- At transaction selection stage: `1.0` | ||
|
||
:::note | ||
The RPC method and transaction pool values are configurable by node runners according to preference; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
node runners? Are we referring to RPC providers here?
Adds detail to the gas estimation guide that explains how the prices returned by
linea_estimateGas
are calculated, and touches on how this relates to transaction sequencing.Also amends callout in
linea_estimateGas
reference page to reflect its activation.