Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mempool: evict expired transactions regardless of current mempool size #515

Merged
merged 3 commits into from Jan 12, 2021

Conversation

pinheadmz
Copy link
Member

@pinheadmz pinheadmz commented Sep 16, 2020

Port of bcoin-org/bcoin#997 with explanation here

(see also #514 )

Addresses #430 -- solution 4

Summary: We already have logic to remove "old" transactions from the mempool, but that logic is never executed unless the mempool is full. This PR checks for and evicts old transactions every time a new transaction is added to the mempool.

@coveralls
Copy link

coveralls commented Sep 16, 2020

Pull Request Test Coverage Report for Build 480586213

  • 9 of 9 (100.0%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.2%) to 59.597%

Files with Coverage Reduction New Missed Lines %
lib/covenants/rules.js 1 67.45%
Totals Coverage Status
Change from base Build 480546966: 0.2%
Covered Lines: 19509
Relevant Lines: 30510

💛 - Coveralls

@pinheadmz pinheadmz added this to the v2.3.0 milestone Sep 17, 2020
@chjj
Copy link
Contributor

chjj commented Nov 22, 2020

Is there perf overhead here? Inserting everything into a heap is going to be costly.

@pinheadmz
Copy link
Member Author

Is there perf overhead here? Inserting everything into a heap is going to be costly.

@chjj thanks for taking a look, I refactored the patch so we just screen and evict expired mempool entries before getting to the Heap, but still before checking overall mempool size for excess and returning false.

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.

None yet

3 participants