Delayed Ethereum Transactions

R P
6 min readDec 8, 2017

--

During times of increased number of transactions causing congestion, such as now (Dec 7, 2017), an underpriced transaction may take an excessive amount of time to confirm/mine into the blockchain. You may have sent a transaction via MetaMask (MM) or another client only to still be waiting 24 hours+ without any confirmation. In that case, any further transactions are also being delayed. You may also have a difficult time even finding the pending transaction on blockchain explorers (via the transaction hash). Others may be waiting on a transfer out of a centralized exchange.

I’m hoping to explain why these delays may be happening and what possible steps can be taken to resolve the issue.

Basics

When you submit a transaction, part of the transaction’s parameters is the gas fee/gas price. An example price would be 50 Gigawei (GWei). This is the price you are willing to pay per computational unit your transaction incurs. This is not the same as “total gas,” which is the total amount of computational resources you are willing to pay for, at the aforementioned gas price. Analogy: You hire a lawyer for a case. Gas Price = $ per hour of work, whereas Total/Max gas = the maximum number of hours of work you will pay for (at the aforementioned price).

There is also a “nonce” associated with the transaction. Every time a transaction from your account is entered/mined into the blockchain, the nonce increases. It is a counter. There can be only one valid transaction per a nonce value per account. This helps defend against an attacker simply entering copies of a single valid signed transaction into the blockchain over and over, draining your account. If you send 0.5 ether to A, and you want to send another 0.5 ether to that same A, the nonce for the second transaction is different, and the data you are signing is also different so that A cannot resubmit your original transaction a hundred times…

The Rest of the Process

Once you create the transaction locally, you must broadcast it. This usually happens via a node provided by the wallet you are using and may be modifiable in the interface. Once the node broadcasts it to its peers, it will propagate the network and reach the miners. At that time, the transaction has to be mined into a block. How likely your transaction “makes it” depends on multiple parameters but one that is very important and controllable [by you] is the gas price. The more you are willing to pay per computational resource, the more the miner will make, and thus is more willing to include it into the block.

Blockchain explorers also utilize nodes to provide data to you. During this whole process, when the system is swamped in pending transactions, it may be more difficult to find your pending transaction. Thus, you may wonder if the transaction ever “reached” the network in the first place.

Potential Causes of Delay and Possible Solutions

Possible solutions depend on where the problem arises which is why I mentioned the basics above.

Centralized Exchange-related

If you are using an exchange such as Bittrex, the delay may be from the Ethereum network portion (e.g., if they didn’t pay a high enough gas price), or from some other part of their centralized system that you have no control over. Unfortunately, your solution likely depends on just waiting or getting a hold of them.

Non-Centralized Exchange-related

One of the most common reasons for the delay for a transaction you create yourself is you set the gas price too low. Please utilize a service such as ETH Gas Station to get an idea of an appropriate gas price before submitting your transaction. For setting the gas price:

Setting Gas Price in MEW
  • MM
Setting Gas Price in MM

If you are already waiting on a transaction that was “underpriced” (gas price too low), you can try to “replace” vs. “cancel” it. Remember, mined transactions cannot have the same nonce from the same account. What you have to do is send another transaction with the same nonce but with a higher [and appropriate] gas price. This will entice a miner to mine it, and then your pending/delayed transaction is no longer valid. Now, you can resubmit the original intended transaction with but a better gas price.

See the MEW page under “ ‘Replacing’ vs ‘Canceling’ Transactions. ” They also explain their terminology regarding “replace” vs “cancel.” Generate a transaction of 0 Ether to yourself with an appropriately high gas price.

From the MEW Github Page.
  • MM

AFAIK, there is no native and basic way to get MM to do this. What you have to do is reinstall MM (make sure you know your recovery seed, or you LOSE ALL YOUR FUNDS in the process) and then resubmit a transaction [i.e., doesn’t have to be the same exact transaction], but with an appropriate gas price. The alternative is export your private key into MEW, and then send a transaction that way with an appropriate gas price (please see the immediate section above re using MEW).

How to Export Private Key from MM

A non-gas price related point of delay maybe Node and Network Propagation Issues. For this, you can consider changing the node prior to submitting a transaction.

Changing the Node Utilized by MEW
  • MM

For MM, there are no preset alternatives on the Mainnet other than the one that is listed as “Main Ethereum Network.” Please look at this Reddit article for excellent guidance.

Another reason may be that the transaction that is delayed is behind another delayed earlier transaction with a lower nonce that could still be valid (for example: if you sent a transaction, and because of delays, you became frustrated and sent three more successively… each of these transactions may have a higher nonce than the previous because the wallet assumed you wanted all of them to be valid). Example: If your account’s next valid transaction has to be at nonce 66, and the first transaction was delayed, your successive transactions would have higher nonces (…, …, 69, 70…) because your wallet thinks you want all of those transactions to be valid and not replacements. Remember, the nonce has to increase with each mined transaction. If all the transactions were at the same nonce, only 1 could be valid, and the rest would be discarded. The wallet presumes you want all of them to be valid, so it plans ahead and increases the nonce each time. Now, this behavior may vary from wallet to wallet, but I find it typical of MM in my use. What this means is when the first transaction finally becomes valid (or another one you send in its place (see above re Cancel and Replace)), all the other subsequent transactions are still potentially valid and waiting in Ethereum to be mined. In an example bad case, you may send much more ether than you originally wanted. You would need to replace all of these transactions as well (see above regarding “replacing” an underpriced transaction).

Disclaimer: I do not claim to be an expert on Ethereum. I am an early adopter like you. I do not speak for the Ethereum Foundation. Do not hold me liable for any losses. The above recommendations are provided “as-is.” I give no warranties. Currently, blockchain technology is “forgive-less.”

--

--