Conversation
…within on tx promoted hook instead of directly within legacypool
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1060 +/- ##
==========================================
- Coverage 64.11% 62.23% -1.89%
==========================================
Files 331 331
Lines 23303 23840 +537
==========================================
- Hits 14941 14837 -104
- Misses 6946 7293 +347
- Partials 1416 1710 +294
🚀 New features to boost your workflow:
|
Greptile SummaryThis PR introduces Key changes:
Confidence Score: 3/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[configureEVMMempool] --> B{GetShouldOperateExclusively?}
B -- true --> C[KrakatoaMempool]
B -- false --> D[ExperimentalEVMMempool]
C --> E[SetInsertTxHandler]
C --> F[SetReapTxsHandler]
C --> G[SetPrepareProposal\nNoCheckTxVerifier]
C --> H[SetMempool]
C --> I[NOT SetCheckTxHandler]
D --> J[SetCheckTxHandler]
D --> K[SetPrepareProposal\napp verifier]
D --> L[SetMempool]
D --> M[NOT SetInsertTxHandler/ReapTxs]
C --> N[KrakatoaMempool.InsertAsync]
N --> O{EVM tx?}
O -- yes --> P[evmInsertQueue async]
O -- no --> Q[cosmosInsertQueue async\n⚠️ errors silently dropped]
C --> R[VMKeeperI.SetEvmMempool\nNotifiedMempool interface]
D --> R
|
| var ErrQueueFull = errors.New("queue full") | ||
|
|
||
| // New creates a new queue. | ||
| func New[Tx any](insert func(txs []*Tx) []error, maxSize int, logger log.Logger) *Queue[Tx] { |
There was a problem hiding this comment.
the name of this mock was wrong (missing the I on the interface)
| // The transactions can also be pre-filtered by the dynamic fee components to | ||
| // reduce allocations and load on downstream subsystems. | ||
| func (pool *LegacyPool) Pending(ctx context.Context, height *big.Int, filter txpool.PendingFilter) map[common.Address][]*txpool.LazyTransaction { | ||
| func (pool *LegacyPool) Rechecked(ctx context.Context, height *big.Int, filter txpool.PendingFilter) map[common.Address][]*txpool.LazyTransaction { |
There was a problem hiding this comment.
the ExperimentalEVMMempool calls Pending and the KrakataoMempool calls Rechecked.
| // enough for the miner and other APIs to handle large batches of transactions; | ||
| // and supports pulling up the entire transaction when really needed. | ||
| type LazyTransaction struct { | ||
| Pool LazyResolver // Transaction resolver to pull the real transaction up |
There was a problem hiding this comment.
unused and made the filterAndWrapTxs helper have an extra param, so I removed it
There was a problem hiding this comment.
moved all krakatoa specific features into here. there is a bit of code duplication between this and the experimental evm mempool still. if we think it is worth breaking the common pieces out into more helper functions or a shared embedded struct, I can address in another pr
There was a problem hiding this comment.
all of the mempool tests were specific to krakatoa, so moved them to krakatoa_mempool_test.go
|
|
||
| // RemoveTx removes a tx from the tx tracker and does not record any metrics as | ||
| // it exits the tracker. | ||
| func (txt *txTracker) RemoveTx(hash common.Hash) { |
| // handler for InsertTx, since the ABCI handler obfuscates the error's | ||
| // returned via codes, and we would like to have the full error to | ||
| // return to clients. | ||
| err := b.Mempool.Insert(b.Application.GetContextForCheckTx(txBytes), cosmosTx) |
There was a problem hiding this comment.
internally the mempool will use the context on the rechecker to run any validation that is happening during insert tx, so there is no need to specifically get the check context
Description
This PR adds a flag
evm.mempool.operate-exclusivelythat will enable theKrakatoaMempoolfeatures. These features have been pulled out of theExperimentalEVMMempooland into their own struct inkrakatoa_mempool.go.Mempool related system and integration tests now run two copies, they run once on the
ExperimentalEVMMempool+ CometBFTfloodmempool, and once on theKrakatoaMempool+ CometBFTappmempool.One slight modification was made to the
ExperimentalEVMMempoolthough, when interacting with thelegacypool, both mempools use the lifecycle hooks instead of directly modifying thelegacypool. TheExperimentalEVMMempoolcalls theBroadcastTxFnwhen a tx is promoted via theonTxPromotedhook, instead of passing theBroadcastTxFninto thelegacypoolitself.Closes: STACK-2091
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
mainbranch