mempool evm metadata cache (CON-342)#3567
Conversation
PR SummaryMedium Risk Overview The tx store LRU is replaced with a generic Smaller follow-ons: pending TTL mempool config fields are deprecated as no-ops, duplicate-tx cache stops truncating keys, Reviewed by Cursor Bugbot for commit bbb1078. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4da3006. Configure here.
| inner.failedTxs.Remove(txHash) | ||
| } else { | ||
| inner.failedTxs.Push(txHash, struct{}{}) | ||
| } |
There was a problem hiding this comment.
LRU evicts repeat-failure guard
Medium Severity
After a transaction fails in a block twice, Update marks the hash invalid in the LRU metadata cache and clears failedTxs, but ShouldReject only consults that cache. If LRU eviction drops the invalid marker, the same hash can pass early rejection and run CheckTx again, bypassing the intended one-retry limit for failed execution.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 4da3006. Configure here.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3567 +/- ##
==========================================
- Coverage 59.18% 58.38% -0.81%
==========================================
Files 2225 2152 -73
Lines 183625 175849 -7776
==========================================
- Hits 108677 102665 -6012
+ Misses 65154 64060 -1094
+ Partials 9794 9124 -670
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|


The reported issue indicated that
To achieve that, I have added caching of evm metadata after CheckTx - evm nonce, priority, requiredBalance and sender are all cached, so that at the next attempt to insert the given tx, we can quickly check if the tx has a chance to be inserted successfully, before even calling CheckTx.
To limit the increase in memory usage by cache, I have:
The expected increase in memory usage by cache should be <2x.
Note: mempool cache has changed its role - it is no longer a superset of mempool txs. The early rejection semantics is strictly stronger though, as described above.
Additionally I have deprecated unused mempool config fields, and fixed timeout on the BroadcastTxCommit rpc.