Mempool state is now an enum of InIbd/AfterIbd#2010
Merged
ImplOfAnImpl merged 1 commit intomasterfrom Feb 12, 2026
Merged
Conversation
…ke higher-level mempool object an enum, so that tx pool and orphans pool only come to existence once it's out of ibd.
OBorce
approved these changes
Feb 12, 2026
Base automatically changed from
p2p_check_block_existence_in_separate_cs_call
to
master
February 12, 2026 12:30
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, even though mempool is not supposed to accept transactions during initial block download, this is not enforced on the type level, so every time a new tip is received during ibd,
TxPoolhas to be explicitly reset, just in case. This creates useless and potentially significant overhead, because resettingTxPoolrequires a few calls to chainstate, which may be particularly slow during ibd due to chainstate being under stress. Additionally, in order to check for ibd, mempool has to first call chainstate as well.In this PR:
ChainstateEvent::NewTipnow also contains theis_initial_block_downloadflag, so that the mempool doesn't have to call chainstate for this;InIbdandAfterIbd. The latter is the "normal" mempool and the former is a temporary state that contains settings and also tracks the current best block id (needed by the implementation ofMempoolInterface).