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

[txservice] Support EIP-1559 transactions where possible. #601

Closed
jakekidd opened this issue Dec 9, 2021 · 0 comments
Closed

[txservice] Support EIP-1559 transactions where possible. #601

jakekidd opened this issue Dec 9, 2021 · 0 comments
Assignees

Comments

@jakekidd
Copy link
Contributor

jakekidd commented Dec 9, 2021

Right now we have hardcoded the type of all transactions to 0 (effectively making them legacy). This is to avoid the fact that - if gasPrice is defined and a chain does support EIP-1559 - ethers will set these values like so:

tx.maxFeePerGas = gasPrice; // AKA baseFee
tx.maxPriorityFeePerGas = gasPrice; // maxPriorityFeePerGas

According to sources below, this is what will effectively be paid in gas fees in EIP-1559:

min(gasFeeCap, baseFee + gasTipCap)

It's unclear where the gasFeeCap will come from exactly with ethers' converted transaction. So we need to manage the fee logic depending on whether the chain supports EIP-1559 or not.

Some important links:
ethers-io/ethers.js#1610
https://docs.ethers.io/v5/api/utils/transactions/#Transaction
https://docs.ethers.io/v5/api/providers/provider/#Provider-getGasPrice
https://docs.ethers.io/v5/api/providers/types/#providers-FeeData
https://docs.avax.network/learn/platform-overview/transaction-fees/
https://www.blocknative.com/blog/eip-1559-fees

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

No branches or pull requests

2 participants