-
Notifications
You must be signed in to change notification settings - Fork 5k
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 Failed: known transaction #3669
Comments
Here are steps that I was able to take to reproduce this error: If you do the above steps, but with a different gas in step (5) (that is less than 1.1 * the gas price of the first tx) you'll see an error related the the gas price being too low. I investigated this when working on the retry tx feature. It seems the source of the errors reproduce by the steps above have to do with that fact that the nonce tracker's |
We should notify Infura (@maurycy) about this, since they probably shouldn't throw an error when a transaction is successfully broadcast. |
Lol, sorry about that @maurycy!! |
So I think the issue is that the tx in (2) is never mined (at least in the current members pool environment where there are tons of higher priced txs for miners to use instead). So, when you do (5), the account nonce is still that same as it was before sending (2). I assume MM keeps nonce locally for pending txs, but that state is wiped in (3). So in other words, I don't think those repo steps indicate an issue on our end. Is there another case where this has been repro'd? We have been seeing some slowdown processing sendRawTx recently, I'm working on a geth patch now to address that. I could see that slowdown leading to race conditions. IMO geth shouldn't really return an error in this case (since the tx is valid, IMO it should just return the hash), but we want to maintain compatibility with geth behavior. If I get time today I'll open a ticket with them to see what their thoughts are on changing this behavior. |
Thanks for checking that out, @ryanschneider. Maybe the problem was just that if the retry has all the same params (and same nonce), it would produce the same tx, and that's why it would be a duplicate. We should probably just treat a "Duplicate tx" response as a success, since it means this tx has been broadcast, so we can fix this on our end in that way. |
I'm seeing this on a geth light node on localhost:8545 |
Transaction never makes it on chain or to pending. It has to be canceled via a non-metamask client (e.g. mycrypto) or metamask stays wedged with pending transactions. |
@nyetwurk do you try canceling the transaction from within metamask? |
Yes. It doesn't work. I have to cancel it outside of metamask (e.g. myCrypto). |
From what I can tell using a light node as a reference, "Transaction Failed: known transaction" is printed when a transaction is stuck in the node's txpool and MM continuously tries to resend the transaction. Canceling the transaction outside of MM causes MM to notice the transaction is dropped, so it stops trying to resend it. |
this is what it looks like in txpool
|
I think I see the problem. I am using ledger nano with metamask and when I inspect the transaction it has the wrong from address, so the nonce is way off. |
ledger wrong address, same as #7845 |
https://sentry.io/metamask/metamask/issues/500528076/
Sometimes, on initial send of tx, we get a "Transaction Failed: known transaction" error. Investigation suggests that this is unlikely an error on our side. The transaction does make it onchain.
Hypothesis: Infura's has a sort of broadcast mechanism for sending txs to all of its nodes. Perhaps tx is being gossiped to a node before this broadcast, and the broadcast results in an error, which is returned to us.
Suggestion: Ignore this error on submit, and continue as everything is good. The tx will be confirmed
The text was updated successfully, but these errors were encountered: