Pieter Wuille

Results 774 comments of Pieter Wuille

I have abstracted out the `std::next_permutation` logic into a separate `ExhaustiveLinearize()` function, and also added a comment that explains how the various functions/classes/tests are related.

Some changes: * As a result of dropping `Cleanup` in the base PR, `Trim` now reports which transactions it removed, as it becomes the caller's responsibility of destroying Refs.

* Add support for calling `AddTransaction` with a feerate whose size already violates the cluster size limit.

Rebased after merge of #31363, and on top of #32151.

Now ready for review, with #31444 merged.

@glozow Awesome, thanks. I've included your commit (with minor changes) in this PR, and added my own 64000-transactions-merged-together test to it.

@instagibbs Yes, exactly. The commit was still an improvement, as it would only stop once an aggregate-of-clusters-so-far would exceed the limit, rather than stopping when the sum of all-clusters-so-far would...

@instagibbs Done. Also expanded comments slightly, made unit test constant names a bit more consistent, and sprinkled some `graph->SanityCheck();` calls over the tests.

Would there be interest in adding a benchmark for the Trim() operation here, or rather in a follow-up?

@instagibbs @ismaelsadeeq See https://github.com/sipa/bitcoin/commit/0a8e1d6e39bd1ba6d3df149945b8dfd78e1fb7e6 It's the same scenario as the `txgraph_trim_huge` unit test (1000 chains of 64 reorged transactions each, merged together by 11 mempool transactions into one giant would-be...