Step-by-step guide to integrate the experimental EVM mempool in your Cosmos SDK chain
app/app.go
to include the EVM mempool:
NewApp
constructor:
EVMMempoolConfig
struct provides several configuration options for customizing the mempool behavior:
PriorityNonceMempool
for Cosmos transactions by default. You can customize the priority calculation:
ExtMempool
interface (mempool/mempool.go
).
Key Methods:
Insert(ctx, tx)
: Routes transactions to appropriate poolsSelect(ctx, filter)
: Returns unified iterator over all transactionsRemove(tx)
: Handles transaction removal with EVM-specific logicInsertInvalidNonce(txBytes)
: Queues nonce-gapped EVM transactions locallymempool/check_tx.go
).
Special Handling: On ErrNonceGap
for EVM transactions:
mempool/txpool/
).
Key Features:
vm.StateDB
interface for Cosmos state compatibilityBroadcastTxFn
callback for transaction promotiongas_tip_cap
or min(gas_tip_cap, gas_fee_cap - base_fee)
(fee_amount / gas_limit) - base_fee
txpool_status
: Get pending and queued transaction countstxpool_content
: View all transactions in the pooltxpool_inspect
: Get human-readable transaction summariestxpool_contentFrom
: View transactions from specific addressestxpool_*
methods return “method not found”.
Solution: Set the global mempool for RPC access: