Why is my L2 transaction nonce stuck and how can I clear it?
A stuck nonce on a Layer 2 network means the wallet has broadcast a transaction with a nonce value that is out of sequence, and no later transactions with higher nonces can be processed until the stuck one is either confirmed or replaced. The fix is to either speed up the transaction with a higher gas price, cancel it by sending a zero-value transaction to yourself with the same nonce, or - on some L2s - use a "force inclusion" mechanism to push the transaction directly to Ethereum mainnet. The exact steps depend on the rollup type and the wallet software you are using.
What a Nonce Is and Why It Gets Stuck
Every account on an Ethereum-compatible chain has a nonce counter. This is a sequential number that starts at 0 and increases by 1 for each transaction the account sends. L2 networks that inherit Ethereum's account model - including Optimistic Rollups (Optimism, Arbitrum, Base) and ZK Rollups (zkSync Era, Scroll, Polygon zkEVM) - use the same nonce system.
A nonce becomes stuck when a transaction is submitted with a nonce that is higher than expected, or when a transaction with a low nonce is stuck in a pending state (usually because the gas price was too low) and the wallet then sends a transaction with a higher nonce. The network will not process a transaction with nonce 5 until the transaction with nonce 4 has been confirmed or replaced. This creates a queue where all later transactions are blocked.
Common causes:
- Wallet software that does not correctly track pending nonces after a network hiccup.
- Manually overriding the nonce in a wallet like MetaMask and setting a value that skips a number.
- A transaction that was broadcast but never included in a block due to low gas.
- Using a hardware wallet with a stale nonce cache.
How to Identify a Stuck Nonce
Check the pending transaction in a block explorer for your L2. For Arbitrum, use Arbiscan; for Optimism, use Optimistic Etherscan; for Base, use Basescan; for zkSync Era, use zkSync Explorer. Look at your account's "Pending" or "Nonce" tab. If you see a transaction that has been pending longer than normal (over several minutes on most L2s) and your subsequent transactions are also pending, the low nonce is likely the cause.
Clearing a stuck nonce: general steps
The method works the same way on any EVM-compatible L2, with minor differences in gas mechanics.
1. Speed Up the Stuck Transaction
If the original transaction had a low gas price, you can re-submit it with a higher gas price. This is known as "replacing" the transaction. The new transaction must:
- Use the same nonce as the stuck one.
- Have a higher gas price (typically at least 10% higher, but some L2s enforce a minimum bump of 1 gwei).
- Be sent from the same address.
Most wallets (MetaMask, Rabby, Frame) offer a "Speed Up" button for pending transactions. If not, you can manually create a new transaction with the same nonce and higher gas.
On Optimistic Rollups, gas prices are typically low, so a small bump is often enough. On ZK Rollups, the gas price can be more volatile; check the current recommended gas on the block explorer.
2. Cancel the Stuck Transaction
Cancelling means sending a transaction to yourself (or to a burn address) with a value of 0 ETH and the same nonce, but with a higher gas price. This effectively replaces the stuck transaction with one that does nothing.
In MetaMask, there is a "Cancel" button for pending transactions. If it is not visible, you can:
- Go to "Settings" > "Advanced" > "Clear activity tab data" (this removes the pending transaction from the wallet's local view).
- Then send a new transaction with the same nonce manually. To do this in MetaMask, enable "Custom nonce" in advanced settings. Set the nonce to the stuck nonce, set the recipient to your own address, set value to 0, and set gas price higher than the original.
On some L2s, the cancellation may itself get stuck if the gas price is too low relative to network conditions. If that happens, repeat with a higher gas.
3. Use a Force Inclusion Mechanism (Optimistic Rollups Only)
On Optimistic Rollups like Arbitrum and Optimism, there is a "force inclusion" or "force withdrawal" feature that lets you push a transaction directly to Ethereum L1 if the sequencer is censoring or delaying your transaction. This is a last resort and is not meant for simple nonce jams.
For Arbitrum: You can call the forceInclusion function on the L1 inbox contract. This requires sending a transaction to the Arbitrum L1 bridge contract with the same nonce and data as your stuck L2 transaction. The transaction will then be included in the next batch on L1. This process takes hours (typically 24 hours on Arbitrum) and costs L1 gas.
For Optimism: The "force withdrawal" mechanism works similarly. You submit the L2 transaction data to the L1 L2OutputOracle contract. This also takes time (about 7 days for the challenge period) and is expensive.
Force inclusion is not available on ZK Rollups, where sequencer censorship is prevented by the validity proof architecture itself - a stuck nonce on a ZK rollup is almost always a wallet issue, not a sequencer issue.
Preventing Stuck Nonces
- Let the wallet manage nonces automatically. Only manually override if you understand the consequences.
- If a transaction is pending for more than a minute, do not send another transaction until the first one confirms or is cancelled.
- Use a wallet that shows your pending nonce queue clearly (e.g., Rabby, Frame).
- On networks with low block times (like Arbitrum Nova or Base), pending transactions usually clear within seconds. If they do not, the gas price is the likely culprit.
When to contact support
If you have tried speeding up and cancelling multiple times, and the nonce remains stuck for hours, the issue may be with the sequencer or the wallet's RPC connection. Try switching to a different RPC endpoint (e.g., from the public RPC to a free provider like Infura or Alchemy). If the problem persists across RPCs, check the L2's status page for sequencer delays. For most mainstream L2s, a stuck nonce that does not clear within a few minutes is unusual and may indicate a broader network issue.
Not financial advice. mycoin.hk publishes market data and general information about digital assets. Crypto assets are volatile and you can lose everything you put in. Nothing here is a recommendation to buy, sell or hold, and we make no price predictions.
Prices are sourced from third parties and may be delayed or wrong. Verify anything you intend to act on against a primary source.