Free 30-min Web3 Consultation
Book Now
Smart Contract Security Audits
Learn More
Custom DeFi Protocol Development
Explore
Full-Stack Web3 dApp Development
View Services
Free 30-min Web3 Consultation
Book Now
Smart Contract Security Audits
Learn More
Custom DeFi Protocol Development
Explore
Full-Stack Web3 dApp Development
View Services
Free 30-min Web3 Consultation
Book Now
Smart Contract Security Audits
Learn More
Custom DeFi Protocol Development
Explore
Full-Stack Web3 dApp Development
View Services
Free 30-min Web3 Consultation
Book Now
Smart Contract Security Audits
Learn More
Custom DeFi Protocol Development
Explore
Full-Stack Web3 dApp Development
View Services
LABS
Guides

How to Debug Stalled Transactions

A developer guide to diagnosing and resolving stalled or pending blockchain transactions. Covers nonce issues, gas estimation, and network conditions with practical code examples.
Chainscore © 2026
introduction
INTRODUCTION

How to Debug Stalled Transactions

A systematic guide to diagnosing and resolving transactions that are stuck, pending, or dropped on EVM-compatible blockchains.

A stalled transaction is one that has been broadcast to the network but fails to be confirmed in a block. This can manifest as a transaction stuck on "Pending" in your wallet, or one that disappears from a block explorer's pending pool without a confirmation. Common causes include a nonce conflict, an insufficient gas price, or a revert that occurs during simulation but not in your wallet's interface. Debugging requires checking the transaction's status, its position in the mempool, and the state of your account.

The first diagnostic step is to look up your transaction hash (tx hash) on a block explorer like Etherscan or Blockscout. Check its status: if it shows Success or Failed, it has been mined. If it's absent, it may have been dropped. If it's shown as Pending, note the Nonce and Gas Price. Compare this nonce to your account's next nonce via the explorer's "Internal Transactions" tab or using a tool like cast nonce from Foundry. A nonce gap—where an earlier nonce is still pending—blocks all subsequent transactions.

If your transaction is pending with a low gas price, it may be outbid by newer transactions. Use the explorer to see the current base fee and priority fee trends. You can often accelerate the transaction by replacing-by-fee (RBF) if you initially enabled it, by submitting a new transaction with the same nonce and a higher gas price. For non-RBF chains or wallets, you may need to issue a speed-up transaction or a cancel transaction (sending a zero-ETH transfer to yourself with the same nonce and sufficient gas to replace the stalled one).

Transactions can also be dropped from the mempool if they are invalid, such as having a max fee per gas (maxFeePerGas) below the current base fee. Use the eth_estimateGas RPC call or a simulator like Tenderly to test if the transaction would revert. A common pitfall is an unexpected revert in a smart contract call that your wallet didn't catch. Simulating the exact call with the current state can reveal errors like insufficient funds, allowance, or failed condition checks before you resubmit.

For developers, tools like Foundry's cast and Hardhat offer direct insight. Commands like cast tx <txhash> fetch details, and cast publish <rawTx> can rebroadcast a signed transaction. To prevent future stalls, always estimate gas programmatically and implement gas estimation buffers. Monitor real-time base fees with services like Blocknative's Gas Platform and set dynamic gas parameters. Remember, a stuck transaction locks the nonce sequence, so debugging is essential for maintaining your application's transaction flow.

prerequisites
PREREQUISITES

How to Debug Stalled Transactions

Learn the essential tools and concepts needed to diagnose and resolve transactions that are stuck in the mempool or pending state on EVM-compatible blockchains.

A stalled transaction is a transaction that has been broadcast to the network but has not been included in a block. This can occur due to low gas prices, network congestion, or nonce issues. Before attempting to debug, you need a foundational understanding of the transaction lifecycle: a user signs and broadcasts a transaction, it enters the mempool (the network's pending transaction pool), and miners or validators eventually include it in a block. When this process halts, you must investigate the mempool state.

You will need access to a block explorer and an RPC endpoint. Block explorers like Etherscan, Arbiscan, or SnowTrace provide a user-friendly interface to check transaction status, gas parameters, and error messages. For programmatic debugging, you need a reliable RPC connection to a node provider (e.g., Alchemy, Infura, or a local node) to query the mempool and send raw transactions. Familiarity with using the eth namespace JSON-RPC methods is crucial.

Key tools for debugging include the Ethereum JavaScript libraries (ethers.js or web3.js) and command-line utilities. You will use these to perform actions like checking a transaction receipt with getTransactionReceipt, estimating gas with estimateGas, and fetching pending transactions from the mempool. Understanding the structure of a transaction—specifically the nonce, gasPrice or maxFeePerGas/maxPriorityFeePerGas (EIP-1559), and gasLimit—is non-negotiable for effective diagnosis.

A common cause of stalling is an incorrect nonce. The nonce is a sequential number that prevents replay attacks and ensures transaction order. If a transaction with a nonce of 5 is pending, the network will not process any subsequent transaction (nonce 6, 7, etc.) until it is resolved. You must know how to fetch the next correct nonce for an account using getTransactionCount, factoring in both confirmed and pending transactions.

Finally, you must understand gas mechanics. In a fee market, transactions compete for block space. A transaction with a maxPriorityFeePerGas set too low during network congestion may be ignored by validators. You should know how to use tools like the ETH Gas Station or your RPC provider's gas estimation API to get current network conditions and calculate appropriate fee parameters to replace or speed up a stalled transaction.

key-concepts
STALLED TRANSACTIONS

Key Concepts for Debugging

A transaction can get stuck for many reasons. These concepts help you diagnose the root cause and take corrective action.

01

Nonce Management

Every account has a nonce—a sequential transaction counter. A transaction with a nonce lower than the expected value will be queued but not executed. This is a common cause of "stuck" transactions. Use your wallet or a block explorer to check your account's next nonce. To resolve, you must either:

  • Wait for the pending transaction to finalize.
  • Send a new transaction with the same nonce and a higher gas price to replace it.
  • Use a tool to cancel it by sending a zero-ETH transaction to yourself with the same nonce.
02

Gas Price & Priority Fee

Transactions require sufficient gas price (base fee + priority fee) to be included in a block. If the network is congested or your fee is too low, miners/validators will ignore it. To debug:

  • Check current network conditions (e.g., Ethereum's base fee on Etherscan).
  • Compare your transaction's maxFeePerGas and maxPriorityFeePerGas against the market rate.
  • Use a gas estimator for the specific chain (e.g., Polygon Gas Station, ETH Gas Station). A transaction can be "speed up" by re-broadcasting it with a higher gas price and the same nonce.
04

Node & RPC Health

Your connection to the blockchain network matters. Issues with your RPC provider or local node can cause transactions to stall or appear lost.

  • Check RPC Latency: Use curl or a health endpoint to test response time.
  • Stuck in Mempool?: Query your provider's mempool (e.g., eth_getBlockByNumber with pending) to see if your transaction is visible.
  • Switch Providers: If a transaction isn't propagating, try broadcasting it through a public RPC (like Alchemy's or Infura's) or a different wallet.
  • Chain Reorganizations: On some chains, a reorg can temporarily orphan a transaction, causing it to disappear from pending status.
05

Chain-Specific Gotchas

Different blockchains have unique behaviors that can stall transactions.

  • EVM Chains (Ethereum, Arbitrum, etc.): Subject to nonce and gas rules.
  • Solana: Transactions have a recent blockhash and expire. If not confirmed quickly, they become invalid.
  • Polygon PoS: Check the Heimdall bridge if transferring from Ethereum; delays can occur there.
  • Layer 2s (Optimism, Base): Sequencer downtime can delay inclusion. Check the sequencer status page.
  • Cosmos SDK Chains: Requires correct account sequence number (similar to nonce) and may need manual incrementing after timeouts.
diagnostic-steps
STEP-BY-STEP DIAGNOSTIC PROCESS

How to Debug Stalled Transactions

A systematic guide to diagnosing and resolving failed or pending blockchain transactions, from checking basic status to advanced gas and contract debugging.

A stalled transaction—one that remains pending or fails—is a common developer hurdle. The diagnostic process begins with verifying the transaction's status using a block explorer like Etherscan or Arbiscan. Search for the transaction hash (txid). A status of Pending indicates it's in the mempool, while Failed shows execution reverted. If the transaction is absent, the node may not have broadcast it. Always confirm the network; a transaction sent to Ethereum Mainnet will not appear on Polygon.

For pending transactions, the issue is often related to gas. Check the current base fee on the network. If your maxPriorityFee or maxFeePerGas (for EIP-1559) is set too low, validators will deprioritize it. Use the explorer's Gas Tracker to see real-time recommendations. You can attempt to replace the transaction by sending a new one with the same nonce and a 10-30% higher gas price. Most wallets and libraries like Ethers.js (ethers.Provider.sendTransaction) or Web3.py support this via explicit nonce setting.

A Failed status requires inspecting the revert reason. Block explorers display a revert error if the contract uses standard Solidity require/revert statements. For custom errors or complex fails, use the transaction's internal trace. On Etherscan, click "Click to see More" and view the "State Changes" or use Tenderly's debugger for a step-by-step execution replay. Common failure points include insufficient token approval, slippage tolerance breaches on DEXs, or reaching a contract's mint limit.

Debugging requires local simulation. Use a forked mainnet environment with Hardhat or Foundry to replay the transaction. With Foundry's cast, run cast run <txhash> --rpc-url <your_rpc> to see a full trace. For Hardhat, use the network's hardhat_impersonateAccount to simulate the exact sender state. This isolates the issue from network congestion, allowing you to test fixes like adjusting msg.value, correcting function parameters, or increasing the gas limit for complex contract interactions.

Persistent failures may stem from dependency issues. A contract call might rely on a specific state set by a previous, also pending, transaction. Always check the sender's nonce sequence. Use eth_getTransactionCount to verify the expected nonce. If transactions are stuck in a queue, clear them by manually submitting transactions for all pending nonces with higher gas, or use a wallet's "Speed Up" or "Cancel" feature, which works by submitting a zero-ETH transaction to the problematic nonce.

Finally, implement preventative monitoring. Use transaction receipt listeners in your code (provider.once(txhash, (receipt) => { ... })) to catch failures programmatically. For production systems, integrate alerts from services like OpenZeppelin Defender or Tenderly to notify you of transaction reverts. Always estimate gas (eth_estimateGas) before sending, and build in retry logic with exponential backoff for nonce management and gas price adjustments to handle network volatility automatically.

DEBUG WORKFLOWS

Platform-Specific Tools and Commands

Ethereum, Polygon, Arbitrum

For EVM-based chains, use Tenderly and Etherscan to simulate and inspect transactions. The debug_traceTransaction RPC method is the most powerful tool for developers.

Key Commands:

bash
# Using cast (Foundry)
cast run <TX_HASH> --rpc-url <RPC_URL>

# Direct JSON-RPC call
curl <RPC_URL> -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"debug_traceTransaction","params":["0xtx_hash", {"tracer": "callTracer"}],"id":1}'

Workflow:

  1. Check gas and nonce on Etherscan.
  2. Simulate the exact transaction in Tenderly to see revert reasons.
  3. Use debug_traceTransaction to get a step-by-step execution trace, identifying the exact opcode where execution fails or runs out of gas.
EVM NETWORKS

Common Transaction Error Codes and Meanings

Decoding common RPC error codes and their root causes to diagnose stalled or failed transactions.

Error Code / Revert StringCommon CauseUser ActionSeverity

0x0 (Out of Gas)

Gas limit set too low for transaction execution.

Increase gas limit by 20-50% and retry.

High

"insufficient funds for gas * price + value"

Wallet balance is less than (gas limit * gas price) + send amount.

Fund wallet with native token or reduce transaction amount.

Critical

"execution reverted"

Smart contract logic failed (e.g., condition not met, invalid input).

Verify contract requirements and input parameters.

High

"nonce too low"

Submitted transaction nonce is lower than the current account nonce.

Fetch current nonce via eth_getTransactionCount and resubmit.

Medium

"replacement transaction underpriced"

New tx with same nonce has gas price too close to pending tx.

Set new gas price at least 10-12% higher than pending tx.

Medium

"intrinsic gas too low"

Gas limit does not cover the base cost of the transaction (21000 gas).

Set a higher gas limit, minimum 21000 for simple transfers.

High

"max fee per gas less than block base fee"

EIP-1559: maxFeePerGas is below the network's current base fee.

Check current base fee with a block explorer and increase maxFeePerGas.

Critical

"gas required exceeds allowance"

Contract call requires more gas than the limit provided for that specific call.

Estimate gas via eth_estimateGas and increase limit accordingly.

High

TROUBLESHOOTING

How to Debug Stalled Transactions

A stalled transaction is a common frustration in Web3 development. This guide covers the primary causes and step-by-step debugging techniques to resolve them.

A stalled transaction is one that has been broadcast to the network but remains in a pending state for an extended period without being confirmed or dropped. You can identify it by a transaction hash that shows as "pending" on a block explorer like Etherscan or Arbiscan for over 30 minutes.

Common indicators include:

  • Nonce gap: Your wallet shows a higher nonce for a later transaction than the pending one.
  • Stuck in mempool: The transaction is visible in the public mempool but not being picked up by validators.
  • 0 confirmations: The block explorer shows 0 confirmations indefinitely.

This typically happens due to low gas fees, network congestion, or a nonce conflict.

DEBUGGING STALLED TXS

Frequently Asked Questions

Common questions and solutions for developers dealing with pending or dropped transactions on EVM-compatible chains.

A transaction remains pending when it hasn't been included in a block. The most common causes are:

  • Insufficient gas price: Your maxPriorityFeePerGas or maxFeePerGas is too low relative to network demand. Check current gas prices on Etherscan or a gas tracker.
  • Nonce gap: If a previous transaction with a lower nonce is still pending, all subsequent transactions will stall. You must wait for or replace the earlier transaction.
  • Node issues: Your RPC provider may be out of sync or experiencing latency. Try switching to a public endpoint like Alchemy or Infura.

To resolve, you can either wait for network congestion to ease, speed up the transaction by re-submitting it with a higher gas price (using the same nonce), or cancel it by sending a zero-ETH transaction to yourself with a higher gas price.

conclusion
KEY TAKEAWAYS

Conclusion and Best Practices

Successfully debugging stalled transactions requires a systematic approach. This guide concludes with essential best practices to prevent issues and resolve them efficiently when they occur.

To prevent transactions from stalling in the first place, always simulate transactions before signing. Use tools like the eth_call RPC method, Tenderly's Simulation API, or Foundry's forge with the --broadcast flag in dry-run mode. This pre-execution check validates gas estimation, identifies potential reverts, and confirms state changes without spending gas. For complex interactions, especially in DeFi, simulate the entire transaction path, including dependent calls to oracles or liquidity pools.

When a transaction is already pending, your primary tools are gas management and transaction replacement. To accelerate a transaction, use the eth_maxPriorityFeePerGas parameter or resend it with a significantly higher maxFeePerGas (e.g., 30-50% more). For replacement, ensure the new transaction has the same nonce and a higher gas price. Most wallets and libraries like Ethers.js (replaceTransaction) or Web3.py (replace_transaction) provide methods for this. Always verify the original transaction hasn't been mined before attempting replacement to avoid double-spending.

For persistent issues, inspect the mempool and analyze contract logic. Use block explorers with mempool views (like Etherscan's Pending Tx page) or dedicated services like Blocknative to see competing transactions. If a transaction is consistently dropped, the contract may have a front-running bot, a strict deadline, or a dependency on an external state that has changed. Debugging requires examining the contract's require statements and event logs from similar successful transactions to identify the failing condition.

Adopt a defensive development and user workflow. Set explicit gas limits in your dApp's transaction calls, typically 1.2-1.5x the estimated gas. Implement robust error handling that catches common RPC errors like -32000 (nonce too low) or -32603 (execution reverted) and provides clear user feedback. For batch operations or complex DeFi interactions, consider using meta-transactions or gas sponsorship via protocols like Gelato or OpenZeppelin Defender to abstract gas complexity and improve reliability.

Finally, monitor and alert on transaction lifecycle events. Integrate webhook services from providers like Alchemy (via Webhooks) or Tenderly to get real-time notifications on transaction mined, dropped, or replaced. This is critical for backend services managing user transactions. By combining proactive simulation, strategic gas management, contract analysis, and systematic monitoring, you can minimize downtime and ensure a smooth user experience in your Web3 applications.

How to Debug Stalled Transactions on Ethereum | ChainScore Guides