Page MenuHomePhabricator

Mempool Update Cut-Through Optimization
ClosedPublic

Authored by PiRK on Nov 23 2022, 08:38.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC921fe3f989c5: Mempool Update Cut-Through Optimization
Summary

Often when we're updating mempool entries we update entries that we
ultimately end up removing the updated entries shortly thereafter. This
patch makes it so that we filter for such entries a bit earlier in
processing, which yields a mild improvement for these cases, and is
negligible overhead otherwise.

Increase limitancestorcount in tournament RPC test to showcase improved algorithm

This is a backport of core#21464

Notes:

  • I did not see a significant gain for this functional test. If there is any improvement, it is less than the usual variability (+- 10 seconds for a test that takes 220 seconds).
  • the policy/mempool.h include is needed for DEFAULT_ANCESTOR_LIMIT and DEFAULT_ANCESTOR_SIZE_LIMIT
Test Plan

ninja && ninja check check-functional-extended

Event Timeline

PiRK requested review of this revision.Nov 23 2022, 08:38
Fabien added inline comments.
test/functional/mempool_updatefromblock.py
21

Where does the value comes from ?

test/functional/mempool_updatefromblock.py
21

This value is needed because the test creates 200 chained transactions that will all go back to the mempool when invalidateblock is called at the end of the test.

What I find surprising is that raising this limit from the default (50) was not already needed prior to this diff. It seems that before, the chained tx limit was not applied in case of a reorg. So this diff changes behavior significantly.

This revision is now accepted and ready to land.Nov 23 2022, 20:20
This revision was automatically updated to reflect the committed changes.