Ethereum is currently facing a backlog of transactions, leaving some transactions unprocessed for hours or even days. This article explains how transfers can get stuck and how to release them.

Fixed gas price

There are many ways to determine the optimal gas value when sending ethereum transactions. Ethgasstation. Info such as web site provides an overview of gas usage, www.etherscan.io/txsPending provides information about the current trading pool.

The latter website is particularly useful because it organizes transaction listings through gas prices. You can check it out by clicking on the GasPrice bar. The resulting list is also roughly how miners view transactions, so if you choose a gas price accordingly to ensure that your transaction is in the first few pages, you may have a very short transaction confirmation time.

But what if your trade isn’t confirmed? It might be blocked and need to be released.

Understand blocking transactions

Before explaining how to release blocking trades, it is important to first understand why a trade is blocked. Ethereum is a blockchain: it consists of many blocks, each containing multiple transactions, one after the other, all linked into the blockchain, as shown below:

– Simplified view of Ethereum’s blockchain –

(The structure of individual blocks and chains is actually quite complex, but the diagram provides enough information to understand this article.)

The idea that blocks are created by miners through a process known as “mining” is well known, but it is unclear to many how transactions are selected to be included in a particular block. To explore this process in more detail, let’s look at the creation of the sample block 1434 below.

One of the many elements of Ethereum beyond blockchain

trading

Once block 1433 is excavated, mining of Block 1434 begins. Block 1434 starts empty:

– Block 1434 initial miner status –

The miner will select multiple trades from the trading pool and insert them into block 1434 to start mining:

– Fill blocks before mining –

Once block 1434 is successfully mined, it becomes part of the blockchain and removes the related transaction from the trading pool:

– Dig block 1434: Already mined trades are removed from the trading pool –

(Again, this is a simple explanation of what really happened.)

One obvious question is “how do miners choose which transactions to include in their blocks?” The answer is money.

Each transaction submitted to Ethereum is accompanied by a number that represents the transaction fee the submitter is willing to pay to the miner, the gas price. When a miner checks the trading pool and sees two identical deals, it will choose the one with the high gas price because it will make the miner more money when he mines.

(Another simplification: The total amount of money paid by the submitter to the miner is actually the gas price multiplied by the amount of gas used and the amount of gas used depends on the complexity of the contract in which the transaction is invoked. Keep in mind that deals with high gas values are more attractive to miners).

When the volume of transactions entering the trading pool exceeds the volume that can be included in the next block, it means that those transactions with lower gas prices are excluded from the block. If the number of transactions with high gas prices in the trading pool reaches or exceeds the capacity of each block, the possible transactions with low gas prices will not be selected. At this point, the low gas price trade is blocked.

Handling blocking transactions

If the volume of transactions submitted to Ethereum drops, blocked transactions are automatically unblocked, otherwise manual intervention is required to release the transactions.

The release transaction requires that the gas price of the transaction be raised so that when the miner selects a transaction for the block, the transaction will be higher on the transaction list. To do that, the deal must be broadcast again at a higher gas price. For example, here is a transaction that is blocked because gas prices are low:

Type:                   Pending transaction
From:                   0xED96dD3Be847b387217EF9DE5B20D8392A6cdf40
To:                     0xa34C6BCAe6F46ac6470443CCea67d937f6060c7E
Nonce:                  1
Gas limit:              21000
Gas price:              1 GWei
Value:                  0.005 Ether
Copy the code

Notice that the gas price is now 1 GWei. Resubmit to cover previous transaction at higher gas price (10 GWei) :

Type:                   Pending transaction
From:                   0xED96dD3Be847b387217EF9DE5B20D8392A6cdf40
To:                     0xa34C6BCAe6F46ac6470443CCea67d937f6060c7E
Nonce:                  1
Gas limit:              21000
Gas price:              10 GWei
Value:                  0.005 Ether
Copy the code

Note that the “From” address and the “Nonce” value are the same for both transactions. These two values can be used to uniquely identify a transaction, allowing the transaction to be overridden. And gas prices have changed accordingly.

Or, the deal may need to be cancelled. Ethereum has no mechanism for removing transactions from the trading pool, but can overwrite transactions with different information, such as a zero value transferred back to the sender, which has a similar effect. But it’s still a trade, and it still needs to be mined. Resubmit the above transaction to cancel the transaction as shown below:

Type:                   Pending transaction
From:                   0xED96dD3Be847b387217EF9DE5B20D8392A6cdf40
To:                     0xED96dD3Be847b387217EF9DE5B20D8392A6cdf40
Nonce:                  1
Gas limit:              21000
Gas price:              60 GWei
Value:                  0
Copy the code

Notice that the “To” address is changed To the “From” address and the “Value” is changed To 0.

When the transaction is replaced, the new gas price is 10% higher than the original gas value, so changing 20GWei to 1GWei is not a success and the original transaction will still remain in the trading pool.

Release blocking transactions with Ethereal

Ethereal is a command line tool that allows you to perform generic Ethereum activities using standard Geth or Parity storage. Ethereal contains commands to release blocking transactions.

To install Ethereal, install Go first. Check to see if you have Go installed and its version:

go version

If you have already installed Go, you will see a release report, such as:

Go version go1.8.1 Linux/amd64

If you don’t have Go installed, you can install it using the package manager on your computer or by following the instructions on the following web page: golang.org/doc/install

Once Go is installed, you can install Ethereal with the following command:

go get -u github.com/wealdtech/ethereal

Verify that Ethereal is available and you can see the account that sent the blocking transaction by running the following command:

ethereal account list

And make sure the accounts you want to see are on the list.

To check the status of the transaction, run the Ethereal Transaction Info command, for example, to query the blocked transaction mentioned in the previous section:

ethereal transaction info --transaction=0xec08e7609d80f233fd92cc41068ea0dd6da5d9c05263d45b0a5eee6e20f96194
Copy the code

In order to increase the gas price of the transaction without changing other parameters, trade with the changed gas price, for example, increase the gas price to 10 Gwei:

ethereal transaction up --transaction=0xec08e7609d80f233fd92cc41068ea0dd6da5d9c05263d45b0a5eee6e20f96194 --gasprice=10gwei --passphrase=secret
Copy the code

Where passphrase is the command to unlock the account that sent blocking transactions.

To cancel a transaction that is not included in the block, the transaction is cancelled by changing the gas price.

ethereal transaction cancel --transaction=0xc04116457f8f420bb13d770ffbb233501f193ba7c57cd1e4bc2ec02804a8df6a --gasprice=60gwei --passphrase=secret
Copy the code

Using Ethereal gives you the ability to release blocked transactions and ensure that transactions can go through in a timely manner even when the Ethereum network is busy.

Orinoco/release-stucK-ethereum-transactions-1390149F297d https://medium.com/ @GM.orinoco/RELEase-stuck-ethereum-transactions-1390149F297d Liu Yanan & Elisa articles: the etheric fang lovers (https://ethfans.org/ajian1984/articles/900)Copy the code