Error Handling Guide
RPC Connection Errors
Connection Refused
Error: Connection refused to RPC endpointCause: RPC endpoint is down or unreachable Solution:
- Check if RPC URL is correct
- Try alternative endpoint (Alchemy, Chainstack, Infura, or public RPC)
- Verify network connectivity
Timeout
Error: Request timed outCause: RPC node is slow or overloaded Solution:
- Increase timeout setting
- Switch to faster RPC provider
- Reduce request frequency
Rate Limited
Error: Too many requests (429)Cause: Exceeded RPC provider rate limits Solution:
- Reduce polling frequency
- Upgrade RPC tier (paid Alchemy, Chainstack, or Infura plans)
- Use multiple RPC endpoints
Mempool Access Errors
txpool_content Not Available
Error: txpool_content not supportedCause: Not all nodes support txpool methods Solution:
- Use Geth node with txpool enabled
- Try eth_pendingTransactions instead
- Use mock data for demo purposes
Empty Mempool
No pending transactions foundCause: Mempool is empty or access limited Solution:
- Normal during low activity periods
- Verify RPC supports mempool access
- Check if node is fully synced
Transaction Decoding Errors
Unknown Method Signature
Warning: Unknown method 0x12345678Cause: Method signature not in known ABI list Solution:
- Transaction will show as "Unknown" type
- Add ABI to decoder if needed
- Use Etherscan to look up contract ABI
Invalid Input Data
Error: Cannot decode input dataCause: Malformed or non-standard input Solution:
- Skip transaction, continue analysis
- Raw data still available
Gas Analysis Errors
No Sample Data
Warning: Insufficient data for gas analysisCause: Too few pending transactions Solution:
- Use default recommendations
- Wait for more mempool activity
- Reduce sample requirements
MEV Detection Errors
Pool Data Unavailable
Warning: Cannot fetch pool reservesCause: DEX subgraph or pool query failed Solution:
- MEV detection will have lower confidence
- Use estimated values
- Check subgraph health
Debugging
Enable Verbose Mode
python mempool_analyzer.py -v pendingCheck Connection
python mempool_analyzer.py statusTest RPC Endpoint
curl -X POST -H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' \
YOUR_RPC_URL