MyCryptoHQ / MyCrypto

MyCrypto is an open-source tool that allows you to manage your Ethereum accounts privately and securely. Developed by and for the community since 2015, we’re focused on building awesome products that put the power in people’s hands.
https://mycrypto.com
MIT License
1.37k stars 651 forks source link

Broadcast TX Not Mined or in Tx Pool but "Pending" w/ MyCrypto #2484

Closed robertandrewsmith closed 4 years ago

robertandrewsmith commented 5 years ago

I am having the same problem (as I did previously) with the most recent update of MyCrypto Windows 1.6.3 : generating and signing offline, then broadcasting online (using the same versions.)

The Tx appears to be "broadcast" and shows as pending in MyCrypto software, but not "pending" in either etherscan or etherchain ~ sent with 8 gwei and 21K gas.

Here's the Tx Hash: 0x81b0feca9e709c7b10c077e533c3946d21337a575414eb03897e02929b274796

Please help!

Is the problem still with the nonces both offline and online?

Also, is it correct that when I receive the Tx Hash that the Tx has been broadcast? OR is the Tx Hash generated before broadcast?

What is going on? I have been unable to use my Ethereum account for one month due to these problems.

tayvano commented 5 years ago

I would guess that it is almost certainly a nonce problem.

Go to your account your are sending to on Etherscan

Click the transaction hash of the most recent transaction (the top one on the list)

Click see more

Find the "nonce"

Add 1 to it (if it was 6, that would be 7)

Go back to your offline computer and the send page and use that number (eg 7) into the nonce field under advanced settings.

robertandrewsmith commented 5 years ago

I most certainly used a nonce that had not been used previously with this account. It is perhaps a problem with the MyCrypto software which had the same issue (tx generated and signed offline then broadcast online as pending but not showing up in the tx pool) in the previous version.

Any other ideas?

tayvano commented 5 years ago

The nonce not only has to be different than a previous nonce, but the next number in order.

Transactions have to be mined 1 2 3 4 5 6 7 8 etc.

It can't be 1 4 2

Nor can it be 1 5 7

I have no doubt that we could do something to improve this experience, especially offline where the nonce cannot be automatically pulled from the server, but it's unlikely to be an issue with our nodes as we have much more robust infrastructure than previously and the network isn't congested at this time.

You could manually try changing the network you are using to only use etherscan or Infura or MyCrypto's infrastructure via the ETH (Auto) selector in the top right.

However, I really suspect this is a nonce issue so that's unlikely to resolve it.

robertandrewsmith commented 5 years ago

Thank you VERY MUCH for the explanation about nonces It only took me perhaps ten hours over one month of failure before success today with failed troubleshooting with two of your staff! Incidentally, all of my nonces were in order. The issue was that I had skipped nonces used from failed send transactions (due to high network traffic) Today I incremented up one nonce from the last successful transaction.

BTW: Are the rules of ordering and incrementing nonces baked into the protocol or just the wallet software? If the latter please fix this. If the former, dear Lord, Ethereum can do better!!

tayvano commented 5 years ago

BTW: Are the rules of ordering and incrementing nonces baked into the protocol or just the wallet software? If the latter please fix this. If the former, dear Lord, Ethereum can do better!!

So typically we do a call getTransactionCount from the network in order to obtain the nonce. Obviously, this isn't possible when the computer is offline. @blurpesec may be able to shed more insight on how we also track the nonce locally to try to ensure nonces are in order and do increment.

And yes, we have to do better. This shit is insane. Not looking forward to the day gas prices go up again. 😒

robertandrewsmith commented 5 years ago

Insane - that's it! when broadcasting online MyCrypto software returns "success", then a message to check the tx status in the desktop app or with etherscan or etherchain. So tell me how MyCrypto broadcasts an offline signed tx (with a gap in the latest nonce - e.g. '5' when the last 3 nonces were 1 2 3) and then says success? Should nodes first check txs to see that the nonce was in order and incremented correctly before MyCrypto says success? Could MyCrypto return a message to the user about a "very bad nonce, bad nonce!" so that they are not tricked/lulled into thinking that something is wrong with the network instead of the construction of their transaction? Seem that there are already some failsafe design mechanisms in place with your software to prevent the user from making a mistake. At the very least you ought to educate and provide the user with a '?' or word bubble near or next to the nonce field so that while generating a tx offline they are made aware of the nonce rules! Again, I knew they needed to be ordered and higher, but did not know that I could NOT skip a number....These things are not obvious.

tayvano commented 5 years ago

Should they? Probably.

Do they? Nope.

As it stands, we return whatever message is returned to us from the node. If you were to use the same nonce, it would error. But it's okay if there is a gap in the nonce.

We should implement a nonce check on confirmation screen and warn the user if something isn't lining up.

+1 for explanation of nonce as well.

robertandrewsmith commented 5 years ago

The nonce not only has to be different than a previous nonce, but the next number in order. Transactions have to be mined 1 2 3 4 5 6 7 8 etc. It can't be 1 4 2 Nor can it be 1 5 7

No not totally true. TLDR, I lost money, so I have two ideas to improve UX/UI:

I am referencing, and I recently created Issue #2502 to prevent poorly constructed transactions with non-sequential nonces, or nonces with gaps from attempted broadcast, And I am referencing newly created Issue #2517 because with this wallet functionality, it might have been possible for me to prevent a transaction from being mined if I had the possibility to cancel it (and had not relied on your incomplete(quoted) response).

Please have a look at my issues proposed. It's as constructive as can be.
Best wishes,

robertandrewsmith

wtzb commented 4 years ago

Thank you so much for all your suggestions, including https://github.com/MyCryptoHQ/MyCrypto/issues/2502 and https://github.com/MyCryptoHQ/MyCrypto/issues/2517.

We are currently working on a brand new version of MyCrypto, which you can find here. Your feedback and the ideas you suggested are really appreciated. I will be adding these to our internal project management system, so we can see how we could fit these in the new version.

Again, thank you so much. Because of users like you, we continue to improve our product. I will be closing this issue here, together with https://github.com/MyCryptoHQ/MyCrypto/issues/2502 and https://github.com/MyCryptoHQ/MyCrypto/issues/2517, and put these in our internal management system so we'll have more eyes on this.

robertandrewsmith commented 4 years ago

As a user who only uses MyCrypto with an airgapped machine, I find it very worrisome and troubling that you close these issues but then point me to your always online beta version. It should be possible to accidentally create a tx with the wrong nonce on the airgapped machine BUT have MyCrypto standalone version on a connected machine check the nonce to see if it is correct BEFORE the tx is broadcast into the memory pool. IF the tx is incorrect, then it should fail in MyCrypto with the correct error message. Please reconsider re-opening this issue. Many thanks!