Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
- ADD_CHAIN138_TO_LEDGER_LIVE: Ledger form done; public code review repo bis-innovations/LedgerLive; init/push commands - CONTRACT_DEPLOYMENT_RUNBOOK: Chain 138 gas price 1 gwei, 36-addr check, TransactionMirror workaround - CONTRACT_*: AddressMapper, MirrorManager deployed 2026-02-12; 36-address on-chain check - NEXT_STEPS_FOR_YOU: Ledger done; steps completable now (no LAN); run-completable-tasks-from-anywhere - MASTER_INDEX, OPERATOR_OPTIONAL, SMART_CONTRACTS_INVENTORY_SIMPLE: updates - LEDGER_BLOCKCHAIN_INTEGRATION_COMPLETE: bis-innovations/LedgerLive reference Co-authored-by: Cursor <cursoragent@cursor.com>
141 lines
3.3 KiB
Markdown
141 lines
3.3 KiB
Markdown
# Stuck Transactions Solution
|
|
|
|
**Last Updated:** 2026-01-31
|
|
**Document Version:** 1.0
|
|
**Status:** Active Documentation
|
|
|
|
---
|
|
|
|
**Date**: 2026-01-21
|
|
**Status**: ✅ **SOLUTION PROVIDED**
|
|
|
|
---
|
|
|
|
## Problem
|
|
|
|
Transactions appear as "pending" but are:
|
|
- ❌ NOT in blockchain state
|
|
- ❌ NOT in transaction pool
|
|
- ✅ Still reported by RPC as pending (nonce mismatch)
|
|
|
|
**Root Cause**: RPC node maintains transaction state in its internal database/memory beyond the transaction pool. This state persists even after clearing transaction pools.
|
|
|
|
---
|
|
|
|
## Solution: Skip Stuck Transactions
|
|
|
|
### Method 1: Use Next Nonce (Recommended)
|
|
|
|
**Current Status**:
|
|
- Latest nonce (confirmed): 13104
|
|
- Pending nonce (RPC reports): 13113
|
|
- Stuck transactions: 9 (nonces 13105-13113)
|
|
|
|
**Solution**: Use nonce **13113** (the pending nonce) for new transactions. This skips the stuck transactions.
|
|
|
|
### Example: Deploy with Next Nonce
|
|
|
|
```bash
|
|
# Get next nonce
|
|
NEXT_NONCE=$(cast rpc eth_getTransactionCount 0x4A666F96fC8764181194447A7dFdb7d471b301C8 pending --rpc-url http://192.168.11.211:8545 | tr -d '"' | xargs -I {} cast --to-dec {})
|
|
|
|
# Deploy with explicit nonce and gas price
|
|
cast send --rpc-url http://192.168.11.211:8545 \
|
|
--private-key $PRIVATE_KEY \
|
|
--nonce $NEXT_NONCE \
|
|
--gas-price 10000000000 \
|
|
--create <bytecode>
|
|
```
|
|
|
|
### Method 2: Clear RPC Database (If Needed)
|
|
|
|
If you need to completely reset the RPC state:
|
|
|
|
```bash
|
|
PROXMOX_USER=root RPC_HOST=192.168.11.11 bash scripts/clear-rpc-database-complete.sh
|
|
```
|
|
|
|
**Warning**: This requires RPC restart and may take 1-2 minutes.
|
|
|
|
---
|
|
|
|
## Verification
|
|
|
|
### Check if Transactions are Stuck
|
|
|
|
```bash
|
|
bash scripts/investigate-transaction-persistence.sh
|
|
```
|
|
|
|
This will show:
|
|
- Transactions NOT in blockchain
|
|
- Transactions NOT in txpool
|
|
- Confirmation they are stuck
|
|
|
|
### Get Next Nonce
|
|
|
|
```bash
|
|
bash scripts/skip-stuck-transactions.sh
|
|
```
|
|
|
|
This will show:
|
|
- Current nonce status
|
|
- Next nonce to use
|
|
- Example commands
|
|
|
|
---
|
|
|
|
## Best Practices
|
|
|
|
### 1. Always Use Explicit Gas Prices
|
|
|
|
```bash
|
|
# Good: Explicit gas price
|
|
cast send ... --gas-price 10000000000
|
|
|
|
# Bad: No gas price (may get stuck)
|
|
cast send ...
|
|
```
|
|
|
|
### 2. Monitor Transaction Status
|
|
|
|
```bash
|
|
# Check if transaction is confirmed
|
|
cast receipt <tx_hash> --rpc-url <rpc>
|
|
|
|
# Monitor until confirmed
|
|
bash scripts/check-transaction-status.sh <tx_hash>
|
|
```
|
|
|
|
### 3. Handle Stuck Transactions
|
|
|
|
If transactions get stuck:
|
|
1. Verify they're not in blockchain: `cast tx <hash> --rpc-url <rpc>`
|
|
2. Verify they're not in txpool: `cast rpc txpool_content --rpc-url <rpc>`
|
|
3. Use next nonce to skip: `bash scripts/skip-stuck-transactions.sh`
|
|
4. Deploy with explicit nonce and gas price
|
|
|
|
---
|
|
|
|
## Current Status
|
|
|
|
- **Stuck Transactions**: 9 (nonces 13105-13113)
|
|
- **Next Nonce to Use**: 13113
|
|
- **Blockchain State**: Clean (no stuck transactions in blocks)
|
|
- **Transaction Pool**: Clean (no stuck transactions in pool)
|
|
- **RPC State**: Reports pending (internal state only)
|
|
|
|
---
|
|
|
|
## Resolution
|
|
|
|
✅ **Solution Available**: Use next nonce (13113) to skip stuck transactions
|
|
✅ **Tools Created**: Scripts to investigate and skip stuck transactions
|
|
✅ **Documentation**: Complete guide for handling stuck transactions
|
|
|
|
**Action**: Use nonce 13113 for all new deployments. Stuck transactions (13105-13112) will be skipped automatically.
|
|
|
|
---
|
|
|
|
**Status**: Solution provided. Ready to proceed with deployments using next nonce.
|