-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Nonce increment when transaction failed #9040
Comments
If you specify a gas, you should know what you do. Just use estimateGas for that. Just like specifying a gas price too low... the transaction will never be broadcasted, still, the nonce is incremented. If you wish to have a better nonce handling, you should manage it in your Dapp. |
The issue here is not about gas amount, but rather about nonce increment. Why parity does increment the nonce when in fact there was no previous transaction? Also it can be not only gas issue but another issue when transaction has been failed for some reason and not posted. |
Also, |
can't replicate this on kovan. |
@gituser Could you please provide a concrete example (with rpc or a web3 script) that could allow us to reproduce the behavior? Happy to reopen then. |
You want me to provide you with RPC call how to send transaction? It's all described in the issue description, re-read it. Or you just want to get rid of another issue on github's tracker? Simply try to send transaction with gas=20000 or specify value bigger than your current balance and then try to create another transaction with good value, it will never be picked up, because there will be a gap in nonce. Why close the issue without trying to reproduce it? I've written exact steps how to reproduce the issue. First with low gas value:
if account has balance of 1 ETH try to send 2 ETH:
After any of these actions above try to send another legitimate transaction and it will be stuck because of the gap in nonce. |
Also, I've just tested on newest parity release and the bug is still there on Ropsten, I'm pretty sure on Kovan it should be there too. |
The reason I ask is not to bother you :) Sometimes users introduce mistake in their RPC/script and call it a bug. Since @seunlanlege gave it a try and couldn't reproduce, that's a good enough reason to ask you some more info ;) Thanks for providing them, we'll check on Ropsten. |
Sure, it's non-standard behavior, but software should be able to handle such use-cases and not break, don't you think? |
closed via #10051 |
Summary
When you try to send a transaction with gas less than 21000 or (if you specify amount of the transaction bigger than your actual address balance) it fails, but nonce still increments, thus all future transactions will be forever in the queue, until someone fills the nonce gap between that last successful transaction and the one in the queue or restarts the parity.
Here is how to reproduce:
nonce
is 10)nonce
will be 12 and thus transaction will stay in the pool, until you send transaction withnonce=11
I think nonce shouldn't be incremented if transaction has failed due to low gas or any other error when there is no resulting hash.
The text was updated successfully, but these errors were encountered: