|
| 1 | +--- |
| 2 | +title: Troubleshooting Transactions |
| 3 | +slug: /troubleshooting-transactions |
| 4 | +description: Guide to diagnosing and resolving transaction issues on Base. |
| 5 | +--- |
| 6 | + |
| 7 | +## Transaction Not Being Included |
| 8 | + |
| 9 | +If your transaction is pending for longer than expected, check the following: |
| 10 | + |
| 11 | +### Max Fee Too Low |
| 12 | + |
| 13 | +If your `maxFeePerGas` is lower than the current base fee, your transaction will remain pending until the base fee drops to your specified level. |
| 14 | + |
| 15 | +**Solution**: The `maxFeePerGas` must cover both the base fee and your priority fee. Since the base fee can change with each block, set `maxFeePerGas` high enough to remain valid even if the base fee rises while your transaction is pending. A common approach is: |
| 16 | + |
| 17 | +``` |
| 18 | +maxFeePerGas = baseFee * 2 + maxPriorityFeePerGas |
| 19 | +``` |
| 20 | + |
| 21 | +This formula (used by [ethers.js](https://github.com/ethers-io/ethers.js/blob/98c49d091eb84a9146dfba8476f18e4c3e3d1d31/src.ts/providers/abstract-provider.ts#L945-L950)) provides headroom for the base fee to double before your transaction becomes unexecutable. You only pay the actual base fee at inclusion time, not the maximum. |
| 22 | + |
| 23 | +<Note> |
| 24 | +Base has a [minimum base fee](/base-chain/network-information/network-fees#minimum-base-fee). Transactions with `maxFeePerGas` below this value will never be included, since the base fee cannot drop below the minimum. |
| 25 | +</Note> |
| 26 | + |
| 27 | +### Priority Fee Too Low |
| 28 | + |
| 29 | +During periods of high demand, transactions compete for block space through priority fees. If your priority fee is too low relative to other transactions, yours may be delayed. |
| 30 | + |
| 31 | +**Solution**: Most users simply wait for congestion to subside. For time-sensitive transactions, use `eth_maxPriorityFeePerGas` to get a priority fee estimate that can outbid enough recent transactions to be included. |
| 32 | + |
| 33 | +<Note> |
| 34 | +If [DA throttling](https://docs.optimism.io/chain-operators/guides/configuration/batcher#batcher-sequencer-throttling) is currently in effect, there's no RPC endpoint that calculates priority fee estimates with throttling in mind. During DA throttling, even transactions with high priority fees may be delayed as the sequencer limits L2 transactions to manage its L1 data availability throughput. |
| 35 | +</Note> |
| 36 | + |
| 37 | +### Nonce Gap |
| 38 | + |
| 39 | +If you have a pending transaction with nonce N, all transactions with nonce N+1 or higher will queue behind it, regardless of their fees. |
| 40 | + |
| 41 | +**Solution**: Either wait for the pending transaction to be included, or replace it by submitting a new transaction with the same nonce and a higher fee (at least 10% higher `maxPriorityFeePerGas` and `maxFeePerGas`). |
| 42 | + |
| 43 | +### Nonce Too Low |
| 44 | + |
| 45 | +If you submit a transaction with a nonce that has already been used, it will be rejected. |
| 46 | + |
| 47 | +**Solution**: Query your current nonce using `eth_getTransactionCount` with the `pending` tag to get the next available nonce. |
| 48 | + |
| 49 | +## Transaction Rejected |
| 50 | + |
| 51 | +### Gas Limit Exceeds Maximum |
| 52 | + |
| 53 | +Ethereum enforces a [transaction gas limit cap](https://eips.ethereum.org/EIPS/eip-7825) of **16,777,216 gas**. Base plans to match this limit in a future upgrade, but currently enforces a [per-transaction gas maximum](/base-chain/network-information/block-building#per-transaction-gas-maximum) of **25,000,000 gas**. Transactions specifying a higher gas limit are rejected by the mempool before inclusion. |
| 54 | + |
| 55 | +**Error**: `exceeds maximum per-transaction gas limit` |
| 56 | + |
| 57 | +**Solution**: Reduce the gas limit to 16,777,216 or below. If your transaction genuinely requires more gas, you'll need to break it into multiple transactions. |
| 58 | + |
| 59 | +## Transaction Included But Failed |
| 60 | + |
| 61 | +If your transaction was included in a block but shows a failed status: |
| 62 | + |
| 63 | +### Out of Gas |
| 64 | + |
| 65 | +The transaction ran out of gas during execution. |
| 66 | + |
| 67 | +**Solution**: Increase the gas limit. Use `eth_estimateGas` to get a gas estimate, then add a buffer (e.g., 20%) to account for variability. |
| 68 | + |
| 69 | +### Reverted by Contract |
| 70 | + |
| 71 | +The contract execution encountered a revert condition. |
| 72 | + |
| 73 | +**Solution**: Check the transaction on [Basescan](https://basescan.org) to see the revert reason. Common causes include failed require statements, arithmetic errors, or invalid state transitions. |
| 74 | + |
| 75 | +## Slow Confirmation |
| 76 | + |
| 77 | +### Understanding Confirmation Times |
| 78 | + |
| 79 | +Base produces blocks every 2 seconds, but [Flashblocks](/base-chain/flashblocks/apps) provide preconfirmations every 200ms. |
| 80 | + |
| 81 | +| Confirmation Level | Time | Description | |
| 82 | +|-------------------|------|-------------| |
| 83 | +| Flashblock preconfirmation | ~200ms | Transaction included in a preconfirmation | |
| 84 | +| L2 block inclusion | ~2s | Transaction included in a sealed L2 block | |
| 85 | +| L1 batch inclusion | ~2m | Transaction posted to Ethereum | |
| 86 | +| L1 finality | ~20m | Ethereum batch is finalized | |
| 87 | + |
| 88 | +See [Transaction Finality](/base-chain/network-information/transaction-finality) for more details. |
| 89 | + |
| 90 | +### Using Flashblocks for Faster Confirmations |
| 91 | + |
| 92 | +To get the fastest possible confirmation, use a Flashblocks-aware RPC endpoint: |
| 93 | + |
| 94 | +| Network | Flashblocks RPC | |
| 95 | +|---------|-----------------| |
| 96 | +| Mainnet | `https://mainnet-preconf.base.org` | |
| 97 | +| Sepolia | `https://sepolia-preconf.base.org` | |
| 98 | + |
| 99 | +These endpoints return transaction receipts as soon as a transaction is included in a Flashblock, rather than waiting for the full L2 block. |
| 100 | + |
| 101 | +## Debugging Tools |
| 102 | + |
| 103 | +- **[Basescan](https://basescan.org)**: View transaction status, logs, and revert reasons |
| 104 | +- **[Tenderly](https://tenderly.co)**: Simulate and debug transactions |
| 105 | +- **`eth_call`**: Test contract calls without submitting a transaction |
| 106 | +- **`eth_estimateGas`**: Estimate gas usage before submitting |
| 107 | + |
| 108 | +## Getting Help |
| 109 | + |
| 110 | +If you're still experiencing issues, reach out in the `#developer-chat` channel in the [Base Discord](https://base.org/discord). |
0 commit comments