-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Check existing issues
- I checked there isn't already an issue for the bug I encountered.
Describe the bug
When using a fallback provider, and one of the RPCs is not properly responding, if the TX is confirmed, it works.
However, if the TX is out of gas (and thus reverted) or just reverted, it keeps on confirming and never confirms.
It should, instead, return and error.
Transport Working Example:
transports: {
[baseSepolia.id]: fallback([
http('https://sepolia.base.org'),
http('https://base-sepolia-rpc.publicnode.com'),
]),
},
Transport BUG Example (fails on 'out of gas' or reverted TXs, but works on succeeded TXs):
transports: {
[baseSepolia.id]: fallback([
http('https://sepolia.base.org'),
http('https://rpc.notadegen.com/base/sepolia),
]),
},
This example RPC was a previously working RPC that is not working anymore.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/usewaitfortransactionreceipt-wagmi-bug
Steps To Reproduce
- Connect using any wallet.
- Set baseSepolia as chain.
- Choose a non EOA address.
- Choose any valid / invalid data (depends if you want to test succeeded or failed TXs).
- Send the TX.
- Optionally lower the max gas per TX on the wallet to force "out of gas".
It will work on succeeded TXs, and will never change from "pending" on reverted TXs.
However, changing the RPCs to all working RPCs will make it work.
What Wagmi package(s) are you using?
wagmi
Wagmi Package(s) Version(s)
2.19.5
Viem Version
2.44.4
TypeScript Version
No response
Anything else?
Also, I noticed that the returned information from useWaitForTransactionReceipt is different when a TX is out of gas and a transaction reverts but not because out of gas. This is confusing, as the way to check for that is not homogeneous.