Repository navigation
fix: sendTransactionSync reports failure for transactions the node already accepted - #5377
Merged
Merged
Conversation
|
@mmv08 is attempting to deploy a commit to the Wevm Team on Vercel. A member of the Team first needs to authorize it. |
🦋 Changeset detectedLatest commit: b921029 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
mmv08
force-pushed
the
fix/sync-send-node-timeout
branch
from
November 2, 2026 13:37
efe1920 to
aa4c107
Compare
…already accepted When a node stops waiting for the receipt, `eth_sendRawTransactionSync` returns error code 4: the node has the transaction, and a later block can still include it (EIP-7966). With a local account, `sendTransactionSync` and `writeContractSync` treated this as a failed send: - They threw at once, so an app that retried could send the same transfer twice. - They freed the nonce, so the next transaction could reuse it and replace the first one. - `fallback` sent the transaction to the next node, which answered "nonce too low", and Viem lost the hash. Now, on code 4, Viem keeps the nonce and waits for the receipt until `timeout` runs out, using the hash in the error. If time runs out, the error names the hash. `fallback` returns the error instead of trying the next node. Code 4 means this only for `eth_sendRawTransactionSync`, so other methods still try the next node.
mmv08
force-pushed
the
fix/sync-send-node-timeout
branch
from
November 2, 2026 13:49
aa4c107 to
b921029
Compare
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a node stops waiting for the receipt,
eth_sendRawTransactionSyncreturns error code 4: the node has the transaction, and a later block can still include it (EIP-7966).With a local account,
sendTransactionSyncandwriteContractSynctreated this as a failed send:fallbacksent the transaction to the next node, which answered "nonce too low", and Viem lost the hash.Now, on code 4, Viem keeps the nonce and waits for the receipt until
timeoutruns out, using the hash in the error. If time runs out, the error names the hash.fallbackreturns the error instead of trying the next node. Code 4 means this only foreth_sendRawTransactionSync, so other methods still try the next node.