forked from cometbft/cometbft
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(mempool)!: stop accepting TXs in the mempool if we can't keep up …
…with reCheckTX (backport cometbft#3314) (cometbft#3338) This PR is a combination of ideas from @ValarDragon, @hvanz and @sergio-mena to alleviate nodes that, while not having their mempool full "officially", they have too many TXs lingering in the mempool which causes them to fall behind. The mechanism works as follows: * We mark when we start and end reChecking * If, by the time a new block is decided we are still running the previous `reCheckTx`, we declare the mempool as rechecktx-full * Otherwise, we declare the mempool as not rechecktx-full We have tested this and it fixes the failing nightlies that are blocking us from cutting `v1.0.0-rc1`. Some UTs need to be fixed, hence posting as draft for the moment. --- #### PR checklist - [ ] Tests written/updated - [x] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [ ] Updated relevant documentation (`docs/` or `spec/`) and code comments - [x] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec <hr>This is an automatic backport of pull request cometbft#3314 done by [Mergify](https://mergify.com). Co-authored-by: Sergio Mena <[email protected]> Co-authored-by: Andy Nogueira <[email protected]> Co-authored-by: Dev Ojha <[email protected]> Co-authored-by: hvanz <[email protected]> Co-authored-by: Hernán Vanzetto <[email protected]>
- Loading branch information
1 parent
6ecf14c
commit df1483c
Showing
13 changed files
with
54 additions
and
5 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
.changelog/unreleased/breaking-changes/3314-mempool-preupdate.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
- `[mempool]` Add to the `Mempool` interface a new method `PreUpdate()`. This method should be | ||
called before acquiring the mempool lock, to signal that a new update is coming. Also add to | ||
`ErrMempoolIsFull` a new field `RecheckFull`. | ||
([\#3314](https://github.com/cometbft/cometbft/pull/3314)) |
4 changes: 4 additions & 0 deletions
4
...og/unreleased/improvements/3314-mempool-update-consider-full-when-rechecking.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
- `[mempool]` Before updating the mempool, consider it as full if rechecking is still in progress. | ||
This will stop accepting transactions in the mempool if the node can't keep up with re-CheckTx. | ||
This improvement is implemented only in the v0 mempool. | ||
([\#3314](https://github.com/cometbft/cometbft/pull/3314)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters