Skip to content
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

feat: Add support for linea_estimateGas #2518

Closed
wants to merge 1 commit into from

Conversation

wantedsystem
Copy link
Contributor

@wantedsystem wantedsystem commented Jul 22, 2024

Linea, a layer 2 blockchain, supports the Ethereum EIP-1559 gas price model, known for making transaction fees more predictable. Unlike the base Ethereum layer, Linea aims to offer a more stable and cost-effective approach to handling transaction fees. For detailed information, you can visit Linea's Gas Fees Documentation.

To further enhance the efficiency of transaction fee calculations, Linea has introduced a new RPC method designed to provide the best gas price estimates. This new method is documented in detail here.

The introduction of this new RPC method necessitates changes in how web3 libraries calculate gas prices. Traditionally, these libraries used the eth_gasPrice method. Linea's update shifts this approach to utilize the newly introduced linea_estimateGas method.

Detailed summary

  • Added linea_estimateGas RPC method to calculate accurate gas price on Linea network
  • Updated linea and lineaTestnet definitions to override fee calculation using linea_estimateGas
  • Added lineaEstimateGas and lineaEstimateFeesPerGas actions to calculate gas and fees
  • Updated types and imports related to fee calculation on Linea network

PR-Codex overview

The focus of this PR is to enhance the gas estimation and fee calculation process for the linea chain.

Detailed summary

  • Added lineaEstimateFeesPerGas and lineaEstimateGas functions
  • Defined LineaEstimateGasRpcSchema and related types
  • Updated linea and lineaSepolia chain definitions
  • Improved fee calculation and priority fee handling

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Copy link

changeset-bot bot commented Jul 22, 2024

⚠️ No Changeset found

Latest commit: 2ffcda5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this file meant to be empty?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no it's a merge issue i created a new PR : #2525

Copy link
Contributor Author

@wantedsystem wantedsystem Jul 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can close this one

*/
{
Method: 'linea_estimateGas'
Parameters?: any
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does Linea have the same parameters as eth_estimateGas (e.g. eth_call parameters, but optional)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants