HomePhabricator

Improve the performance of removeForBlock

Description

Improve the performance of removeForBlock

Summary:
This is inspired by bchn#1188, though most of the changes are irrelevant for us due to being already fixed by code changes. Also our mutex requirement is much better so some optimization are simply not worth it either.

In the end only a couple optimizations remain, bot in removeForBlock:

  • The removeConflicts call can be skipped for txs coming from the mempool that are guaranteed to not have any conflict
  • The whole mempool cleanup is needless if the mempool is empty, which is especially useful during IBD. An extra comment is added here to explain why the rolling fee feature can be skipped with no change in behavior.

Test Plan:

ninja all check-all

Run IBD.

Reviewers: #bitcoin_abc, sdulfari

Reviewed By: #bitcoin_abc, sdulfari

Subscribers: sdulfari

Differential Revision: https://reviews.bitcoinabc.org/D13214

Details

Provenance
FabienAuthored on Mar 1 2023, 14:44
FabienPushed on Mar 2 2023, 09:32
Reviewer
Restricted Project
Differential Revision
D13214: Improve the performance of removeForBlock
Parents
rABC5ec1b277b87e: [CI] Unbreak the cross builds
Branches
Unknown
Tags
Unknown