-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
code: -32602 message: "Invalid transaction envelope type: specified type 0x0 but including maxFeePerGas and maxPriorityFeePerGas requires type: 0x2 #11824
Comments
Same thing here, on both the Chrome and Firefox browser extensions: MetaMask - RPC Error: Invalid transaction envelope type: specified type "0x0" but including maxFeePerGas and maxPriorityFeePerGas requires type: "0x2" {code: -32602, message: "Invalid transaction envelope type: specified type …Gas and maxPriorityFeePerGas requires type: "0x2""} |
I also had this issue and would like to know how to resolve it. I missed a mint today, and would like to not miss any more in the future because of this error. |
@VexyCats @lydianblues @iObedson @citizen-lab Would any of you be able to share the dapps you are intereacting with when this happens? If you prefer, you can share privately by creating an issue with our customer support: https://metamask.zendesk.com/hc/en-us/requests/new If we can investigate one of these dapps, we will be able to diagnose the issue |
Oh, maybe this implies that it can happen with any dapp that does that... |
If you are experiencing this during local development, can you share the transaction parameters of the transaction that is causing this issue? |
@danjm this happened for my production dapp as well, but it seems, this doesn't happen to everyone because some of our users were able interact with our contract using eip 1559 tx. |
@hariesnurikhwan Which dapp is that? |
Ok, my case was a clone of Dapp University decentragram https://github.com/dappuniversity/decentragram |
I uninstalled metamask version 10.0.1 then install metamask version 9.8.4 and it works! (chrome and firefox) |
@iObedson Thanks for sharing the dapp you are using. I am pretty sure what is happening here is that web3.js is automatically adding a Then metamask is adding eip1559 gas fee properties, but these require type MetaMask should respect a type property if no other gas fee parameters are provided, and autoadd properties that align with a type. A fix to this will be made very soon. In the meantime, dapp developers looking to work around this issue can try the following if developing for EIP1559 compatible networks (mainnet, rinkeby, ropsten, goerli): add However, once MetaMask makes the fix I mention above, the error should go away. Note that because of the way web3.js currently works, your users might default to using non-EIP1559 gas properties (i.e. |
@danjm How does this work for methods that are not transactions? |
Question seems to have been solved by myself. You can just simply pass it into the .send() parameter when calling the function like this: |
@danjm How do I make my dapp compatible for both? |
@hariesnurikhwan You need detect whether the current network is EIP1559 compatible or not. To do so, you can make a call to get the latest block, and check if the block data has a If it has a |
We (web3js) are getting a patch put together. This was an oversight on our end due to complicated legacy code and tests. Sorry for any inconveniences. To mitigate this in the future we’ve been working on a ground up rewrite natively in TypeScript and it’s nearing a beta release. Hopefully in the future it will be much more maintainable. |
yes! for none techie this actually solve the problem. Thanks @nijuusanj |
👋 We've published a new release can you please test it out. We've ran it across multiple repos and the error reported above. It seems to have been fixed. https://github.com/ChainSafe/web3.js/releases/tag/v1.5.2-rc.0 Cc @danjm |
@iObedson I've tested this Dapp using |
thanks @GregTheGreek! |
Is passing the "type: '0x2'" parameter when calling the send function the recommended way to fix this issue (seems to work this way)? Once MetaMask issues a fix,I can still pass the type parameter, correct? Also, what was fixed in the web3 release referenced above? I thought that the issue was in MetaMask and not web3. Should I upgrade web3 to the latest version above in order to make sure to not encounter this problem in the future? Thank you. J |
Also still having this issue, tried downloading the recommended version of web3 and didn't fix. Passing 0x2 as the type seems to be the only way but then I receive an "Unknown processing time" notification from MetaMask, where it seems to think the transaction will take an extended amount of time. Edit: For context, I'm calling estimateGas which is giving me roughly what I'd expect. The transactionOptions are: {
from: wallet.address,
value: price,
gasLimit: gasEstimate,
type: "0x2",
} And the subsequent await contract.methods.mint().send(options) |
You can try this: metamask settings -> advanced -> reset account |
I just added type: "0x2" and my contract worked |
hey it seems that you support tx type fwiw, I think it would make sense if you also support |
@cbrzn Node and v8 will interpret both hex decimals as equivalent, so ya that should probably not be a strict check. example:
|
@GregTheGreek i might be totally out of place here (and sorry if I am, I haven't touched this codebase) but I think that's not the case because here the type is defined as string |
The initially raised issue was resolved in 2021, but the comment from 2 days describes a bug that was never sovled. I have opened a new ticket for the latter #18076 |
Describe the bug
Trying to send a simple ETH transfer from a dapp - dapp is suggesting a gas price based on pre-EIP-1559, yet metamask 10.0.0 is work EIP-1559
Steps to reproduce (REQUIRED)
Steps to reproduce the behavior, libraries used with version number, and/or any setup information to easily reproduce:
Send an eth transaction with a gas limit of say "30000", normal web3 sendTransaction with a value.
Expected behavior
To let the user send X amount of ETH to XYZ address.
Screenshots
If applicable, add screenshots to help explain your problem.
Browser details (please complete the following information):
Metamask 10.0.0
Additional context (Error Messages, etc.)
RPC Error: Invalid transaction envelope type: specified type "0x0" but including maxFeePerGas and maxPriorityFeePerGas requires type: "0x2" code: -32602
The text was updated successfully, but these errors were encountered: