You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I checked there isn't already an issue for the bug I encountered.
Viem Version
2.34.0
Current Behavior
The waitForTransactionReceipt function does not handle the scenario where a transaction is no longer found on the network (e.g., because it was replaced by a newer one with the same nonce and a higher gas price, or it was simply dropped from the mempool). Instead of rejecting the promise with a clear error
First Issue: The function cannot find transactions that have been replaced or dropped Second Issue: Regardless of the configuration (e.g., timeout, retryCount), the function's promise never settles (neither resolves nor rejects) if it cannot locate the transaction hash on the blockchain
Expected Behavior
waitForTransactionReceipt should detect replaced transactions or throw an error
Steps To Reproduce
This app has two buttons:
Send 1 wei to yourself — submits a self-transfer with intentionally tiny EIP-1559 fees so it stays pending.
Speed Up — resubmits the same nonce with higher fees, replacing the first transaction.
How to reproduce
Click Send 1 wei to yourself.
The tx uses maxFeePerGas = 2 and maxPriorityFeePerGas = 1 (wei), so it will not get mined on Sepolia. It remains pending indefinitely.
waitForTransactionReceipt for this tx never resolves with a receipt (by design), because the transaction won’t be included in a block.
After a short wait, click Speed Up.
The app sends a replacement tx with the same nonce and higher fees (roughly 2× the current estimateFeesPerGas values).
This replacement supersedes the first tx. You’ll see a receipt in the console only for the second (speed-up) transaction.
The original tx will never produce a receipt, because it was replaced before inclusion.
If you don’t click Speed Up, nothing will happen: the first tx stays pending forever and no receipt is printed.
Check existing issues
Viem Version
2.34.0
Current Behavior
The waitForTransactionReceipt function does not handle the scenario where a transaction is no longer found on the network (e.g., because it was replaced by a newer one with the same nonce and a higher gas price, or it was simply dropped from the mempool). Instead of rejecting the promise with a clear error
First Issue: The function cannot find transactions that have been replaced or dropped
Second Issue: Regardless of the configuration (e.g., timeout, retryCount), the function's promise never settles (neither resolves nor rejects) if it cannot locate the transaction hash on the blockchain
Expected Behavior
waitForTransactionReceipt should detect replaced transactions or throw an error
Steps To Reproduce
This app has two buttons:
How to reproduce
Click Send 1 wei to yourself.
maxFeePerGas = 2andmaxPriorityFeePerGas = 1(wei), so it will not get mined on Sepolia. It remains pending indefinitely.waitForTransactionReceiptfor this tx never resolves with a receipt (by design), because the transaction won’t be included in a block.After a short wait, click Speed Up.
2×the currentestimateFeesPerGasvalues).If you don’t click Speed Up, nothing will happen: the first tx stays pending forever and no receipt is printed.
Screen.Recording.2025-08-20.at.20.37.57.mp4
Link to Minimal Reproducible Example
https://github.com/Pasha8914/waitForTransactionReceipt-bug
Anything else?
No response