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

Transaction type isn't 2 (EIP-1559) by default #4348

Open
tab00 opened this issue Aug 30, 2023 · 4 comments
Open

Transaction type isn't 2 (EIP-1559) by default #4348

tab00 opened this issue Aug 30, 2023 · 4 comments
Assignees
Labels
investigate Under investigation and may be a bug. v6 Issues regarding v6

Comments

@tab00
Copy link

tab00 commented Aug 30, 2023

Ethers Version

6.7.1

Search Terms

No response

Describe the Problem

If I don't explicitly specify fee data in a transaction then the transaction that happens is of type 0 (legacy).

Default should be type 2 (EIP-1559).

I experienced this on Avalanche Fuji testnet.

Code Snippet

await wallet.sendTransaction({ to: wallet2.address, value: ethers.parseUnits("0.00001", "ether") })

feeData = await ethers.provider.getFeeData()
delete feeData.gasPrice
await wallet.sendTransaction({ to: wallet2.address, value: ethers.parseUnits("0.00002", "ether"), ...feeData })

Contract ABI

No response

Errors

No response

Environment

No response

Environment (Other)

No response

@tab00 tab00 added investigate Under investigation and may be a bug. v6 Issues regarding v6 labels Aug 30, 2023
@tab00
Copy link
Author

tab00 commented Aug 30, 2023

I commented in #3587 a while ago but didn't get a reponse.

@logan272
Copy link

Same issue, i've migrated to ethers.js@v6, and the default transaction type is legacy instead of EIP-1559.

@ricmoo
Copy link
Member

ricmoo commented Jan 30, 2024

It will use the network to derive the type. If there is abaseFee in the block, it will use EIP-1559. Which network and which provider are you on?

@logan272
Copy link

logan272 commented Jan 30, 2024

Sorry for the confusion. The default transaction type set by etherjs@v6 is actually EIP-1559. However, in my case, the wallet connected to my dApp does not support the EIP-1559 transaction type. As a result, the wallet omits the type in the transaction overrides.

Unfortunately, all transactions made with a wallet that does not support EIP-1559 have failed. Upon investigating the transaction data, I discovered that the issue lies in the incorrect estimation of the Gas Limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigate Under investigation and may be a bug. v6 Issues regarding v6
Projects
None yet
Development

No branches or pull requests

3 participants