Skip to content

Conversation

@vladjdk
Copy link
Member

@vladjdk vladjdk commented Sep 22, 2025

Description

This PR adds the tracking of priority transactions via TxTracker, a local queue. This is populated by checking for temporary rejections (such as in the case of nonce gaps or underpriced tx), and adding it to the TxTracker if that is the case. This is a separate state and worker that runs in a goroutine and periodically (initially after 10s) reevaluates its contents. No longer valid txs are dropped, newly valid txs are queued, and the rest remain in the local queue.

If the home directory is configured and not blank, then the contents of the TxTracker are journaled and persisted to disk (by default in ~/.evmd/data/txpool/transactions.rlp). This is picked up between node restarts so that those local txs are not lost.

This PR also adds the 4 new fields (locals, no-locals, journal, rejournal) that is used by TxTracker to toml.go and server flags under evm.mempool. The configureEVMMempool/GetLegacyPoolConfig helpers have also been updated to make use of the toml and/or cli flag values.

Closes: #500


Author Checklist

I have...

  • tackled an existing issue or discussed with a team member
  • left instructions on how to review the changes
  • targeted the main branch

@almk-dev almk-dev changed the title wip: set up local journal feat(mempool): Add TxTracker support for handling temporary rejections Oct 24, 2025
@almk-dev almk-dev changed the title feat(mempool): Add TxTracker support for handling temporary rejections feat(mempool): Add TxTracker support for handling temporary rejections Oct 24, 2025
@almk-dev almk-dev marked this pull request as ready for review October 27, 2025 16:01
@vladjdk
Copy link
Member Author

vladjdk commented Oct 28, 2025

Could you add more information in the PR about the different effects of this PR? (i.e. new config that's available, the fact that we save a new file to disk, etc.)

@vladjdk
Copy link
Member Author

vladjdk commented Oct 28, 2025

Could we add a system and integration test for this as well?

@vladjdk
Copy link
Member Author

vladjdk commented Oct 28, 2025

I think we can also merge the logic in for #494 (comment) to make this fully functional.

@codecov
Copy link

codecov bot commented Nov 4, 2025

Codecov Report

❌ Patch coverage is 52.97158% with 182 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.27%. Comparing base (381a354) to head (9c2e436).

Files with missing lines Patch % Lines
mempool/txpool/locals/journal.go 38.46% 44 Missing and 20 partials ⚠️
rpc/backend/call_tx.go 42.99% 44 Missing and 17 partials ⚠️
mempool/txpool/locals/tx_tracker.go 82.17% 11 Missing and 7 partials ⚠️
server/server_app_options.go 21.42% 7 Missing and 4 partials ⚠️
server/start.go 0.00% 11 Missing ⚠️
mempool/txpool/legacypool/legacypool.go 35.71% 7 Missing and 2 partials ⚠️
mempool/mempool.go 76.92% 3 Missing and 3 partials ⚠️
server/config/config.go 33.33% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #646      +/-   ##
==========================================
+ Coverage   65.19%   65.27%   +0.08%     
==========================================
  Files         317      320       +3     
  Lines       21612    21855     +243     
==========================================
+ Hits        14090    14266     +176     
- Misses       6358     6387      +29     
- Partials     1164     1202      +38     
Files with missing lines Coverage Δ
mempool/txpool/locals/errors.go 100.00% <100.00%> (ø)
rpc/backend/sign_tx.go 66.66% <ø> (+10.41%) ⬆️
server/config/opendb.go 0.00% <ø> (ø)
server/flags/flags.go 0.00% <ø> (ø)
server/config/config.go 49.54% <33.33%> (+2.83%) ⬆️
mempool/mempool.go 75.40% <76.92%> (-0.89%) ⬇️
mempool/txpool/legacypool/legacypool.go 84.07% <35.71%> (+1.36%) ⬆️
server/server_app_options.go 52.12% <21.42%> (-5.38%) ⬇️
server/start.go 0.00% <0.00%> (ø)
mempool/txpool/locals/tx_tracker.go 82.17% <82.17%> (ø)
... and 2 more

... and 1 file 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat]: support TxTracker to track priority transactions

3 participants