Motivation
- I think it’s preferable to use stdlib data structures instead of depending on boost if we can achieve the same thing.
- Also see #28335 for further context/motivation. This PR simplifies that one.
Things done in this PR:
- Add a bench for
DisconnectedBlockTransactions
where we reorg and the new chain has {100%, 90%, 10%} of the same transactions. AFAIU in practice, it’s usually close to 100%. - Rewrite
DisconnectedBlockTransactions
as astd::list
+unordered_map
instead of a boost multi index container.- On my machine, the bench suggests the performance is very similar.
- Move
DisconnectedBlockTransactions
from txmempool.h to its own kernel/disconnected_transactions.h. This struct isn’t used by txmempool and doesn’t have much to do with txmempool. My guess is that it’s been living there for convenience since the boost includes are there.