How to speed up or cancel pending transactions with MetaMask

How to speed up or cancel pending transactions with MetaMask

Untitled - 3

img

When we submit a transaction on the blockchain, we usually pay a gas fee in the blockchain's native token.

This fee tends to be adjusted automatically based on market conditions, i.e. the demand for block space on the blockchain itself, but it can also be adjusted manually by bidding on the network for faster processing if a transaction is stuck for an extended period of time our deal.

In this article, we explain how to speed up stuck transactions that have been pending for a long time, or cancel transactions entirely.

How to Speed ​​Up Blockchain Transactions with MetaMask

After sending a transaction on MetaMask, a new transaction will be added to the queue. After adding it to the queue, we will see two buttons - speed up and cancel.

img

Click on the transaction and view the transaction details on the blockchain explorer before clicking the Speed ​​Up button.

img

​ Example transaction details on Etherscan.io

Note that the "Estimated Confirmation Duration" will show approximately how long it will take for the transaction to be confirmed on the blockchain.

Usually, if a transaction is sent with a market fee, it will be settled quickly. However, if it's taking too long due to a sudden spike in network utilization, then we may want to speed things up when needed.

Clicking the "Speed ​​Up" button allows us to resubmit the same transaction but with a higher gas fee, which should allow the transaction to process faster.

We'll want to send a transaction with a gas fee so that it gets processed within the next few blocks. To do this, use a service like Blocknative's gas estimator.

img

​ Blocknative gas estimator

The Blocknative gas estimator allows us to see the recommended preferred fee and maximum fee settings (we don't have EIP-559), as well as the probability that the transaction will be completed within the next block (i.e. 15 seconds).

For more details, we can also check out their Heat map on the same page, which shows the average gas price for a specific time of day.

img

Make sure to check these resources before we send higher priority transactions to avoid paying too much gas.

How to cancel a transaction using MetaMask

The easiest way to cancel a trade is to select "cancel" instead of "speed up" in the trade window above.

However, transaction cancellation can only be done while the transaction is still pending on the network. If the transaction has been confirmed by the blockchain, it is irreversible.
A more advanced way to cancel a transaction is to use a custom nonce,

Go to MetaMask's Advanced settings and enable custom transaction nonces.

img

Also, enable the gas control configuration in Advanced and override the default gas settings.

img

With both options turned on, send a new transaction. In our example, we will send a 0 ETH transaction to ourselves.

img

Paste our existing public address into the search box.

img

Enter 0 ETH.

Look for pending transactions on the blockchain on our account and determine two things:

  • The nonce of the transaction (73 here)
  • gas fee and highest priority fee (60 and 1.5 here)

img

Enter the same custom Nonce field as the pending transaction.

img

Adjust the gas by clicking the Market button.

img

Select "Advanced" and make sure to use a higher gas fee than the last transaction.

img

Click Save, then Confirm to send the transaction.

These steps allow the blockchain to receive our cancellation request faster than the original pending transaction due to the higher gas amount.

Generally speaking, for these transactions to succeed, it is best to set a maximum fee that is at least 25% to 30% higher than the transaction we cancel.

Source:https://medium.com/stakingbits/how-to-speed-up-or-cancel-a-pending-transaction-with-metamask-4de3e8b08ea4

about

ChinaDeFi - ChinaDeFi.com is a research-driven DeFi innovation organization, and we are also a blockchain development team. Every day, from nearly 900 pieces of content from more than 500 high-quality information sources around the world, we look for content that is more in-depth and systematic, and synchronizes to the Chinese market at the fastest speed to provide decision-making auxiliary materials.

Layer 2 Daoist - Welcome blockchain technology enthusiasts and research analysts who are interested in Layer 2 to contact Gavin (WeChat: chinadefi) to discuss the landing opportunities brought by Layer 2. Please pay attention to our WeChat public account "Decentralized Financial Community" .

img

Guess you like

Origin blog.csdn.net/chinadefi/article/details/123844011