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

Self-recovery of TxPool max capacity #6665

Merged
merged 1 commit into from
Feb 9, 2024

Conversation

marcindsobczak
Copy link
Contributor

Changes

  • if TxPool/BlobPool capacity is exceeded, remove 2 worst txs instead of 1 (when inserting new tx)

It will not be used in normal workflow - only if TxPool/BlobPool capacity will be exceeded, which is not expected, but rarely observed on devnet nodes

Types of changes

  • Bugfix (a non-breaking change that fixes an issue)
  • New feature (a non-breaking change that adds functionality)
  • Breaking change (a change that causes existing functionality not to work as expected)
  • Optimization
  • Refactoring
  • Documentation update
  • Build-related changes
  • Other: Description

Testing

Requires testing

  • Yes
  • No

If yes, did you write tests?

  • Yes
  • No

Copy link
Member

@LukaszRozmej LukaszRozmej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not remove in loop until under limit?

@marcindsobczak
Copy link
Contributor Author

Loop was my initial idea. Changed it to just double removal, because it will do a job as well and seems more secure - we will avoid potential long lock. And I expect that it will solve the problem at the very beginning, when capacity will be exceeded by 1 item above expected - so removing one should be enough to drop below max cap

@marcindsobczak
Copy link
Contributor Author

And out removed item will not be accurate (we will return only one removed item instead of 2), but it is just recovery option which will be used only in emergency, so IMO not worth to refactor a lot of code to address it

@marcindsobczak marcindsobczak merged commit 65b7db5 into master Feb 9, 2024
67 checks passed
@marcindsobczak marcindsobczak deleted the feature/txpool_cap_recovery branch February 9, 2024 13:15
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.

4 participants