Skip to content

mempool cache fixes (CON-324)#3547

Merged
pompon0 merged 1 commit into
mainfrom
gprusak-tx-cache
Jun 4, 2026
Merged

mempool cache fixes (CON-324)#3547
pompon0 merged 1 commit into
mainfrom
gprusak-tx-cache

Conversation

@pompon0

@pompon0 pompon0 commented Jun 4, 2026

Copy link
Copy Markdown
Contributor
  • made mempool cache all executed txs, not just the ones already in mempool
  • made mempool cache txs which failed nonce/priority check
  • made priorityReservoir include txs which are pending when insterted, but become ready later

@pompon0 pompon0 requested review from sei-will and wen-coding June 4, 2026 08:09
@cursor

cursor Bot commented Jun 4, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes admission deduplication and priority-hint sampling in the mempool path, which can alter which txs are accepted or dropped under load.

Overview
Tightens mempool LRU cache and priority sampling so behavior matches the intended “seen tx” semantics.

Cache: Failed insert paths (duplicate, stale nonce, same-nonce rejection) now cache.Push the hash so CheckTx won’t keep re-admitting rejected txs. On block Update, every hash in TxResults is cached up front, including txs that never sat in byHash, so executed work is remembered even when the tx wasn’t in the pool.

Priority reservoir: priorityReservoir.Add moves out of Insert and runs only when a tx actually becomes ready—on nonce-chain promotion, non-EVM insert, or higher-priority same-nonce replacement—so pending EVM txs that later unlock still feed the drop-priority hint sampler.

Reviewed by Cursor Bugbot for commit 946c405. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedJun 4, 2026, 8:11 AM

@codecov

codecov Bot commented Jun 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.27%. Comparing base (1a1b8cd) to head (946c405).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3547      +/-   ##
==========================================
- Coverage   59.12%   58.27%   -0.86%     
==========================================
  Files        2218     2144      -74     
  Lines      183132   174564    -8568     
==========================================
- Hits       108285   101721    -6564     
+ Misses      65082    63781    -1301     
+ Partials     9765     9062     -703     
Flag Coverage Δ
sei-chain-pr 73.67% <100.00%> (?)
sei-db 70.41% <ø> (ø)
sei-db-state-db ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
sei-tendermint/internal/mempool/tx.go 92.95% <100.00%> (+0.09%) ⬆️

... and 74 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pompon0 pompon0 added this pull request to the merge queue Jun 4, 2026
Merged via the queue into main with commit 4513555 Jun 4, 2026
56 of 57 checks passed
@pompon0 pompon0 deleted the gprusak-tx-cache branch June 4, 2026 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants