mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 23:29:12 +01:00
62ed1f92eftxgraph: check that DoWork finds optimal if given high budget (tests) (Pieter Wuille)f3c2fc867ftxgraph: add work limit to DoWork(), try optimal (feature) (Pieter Wuille)e96b00d99etxgraph: make number of acceptable iterations configurable (feature) (Pieter Wuille)cfe9958852txgraph: track amount of work done in linearization (preparation) (Pieter Wuille)6ba316eaa0txgraph: 1-or-2-tx split-off clusters are optimal (optimization) (Pieter Wuille)fad0eb091etxgraph: reset quality when merging clusters (bugfix) (Pieter Wuille) Pull request description: Part of #30289. Builds on top of #31553. So far, the `TxGraph::DoWork()` function took no parameters, and just made all clusters reach the "acceptable" internal quality level by performing a minimum number of improvement iterations on it, but: * Did not attempt to go beyond that. * Was broken, as the QualityLevel of optimal clusters that merge together was not being reset. Fix this by adding an argument to `DoWork()` to control how much work it is allowed to do right now, which will first be used to get all clusters to the acceptable level, and if more budget remains, use it to try to get some or all clusters optimal. The function will now return `true` if all clusters are known to be optimal (and thus no further work remains). This is verified in the tests, by remembering whether the graph is optimal, and if it is at the end of the simulation run, verify that the overall linearization cannot be improved further. ACKs for top commit: instagibbs: ACK62ed1f92efismaelsadeeq: Code review ACK62ed1f92efglozow: ACK62ed1f92efTree-SHA512: 5f57d4052e369f3444e72e724f04c02004e0f66e365faa59c9f145323e606508380fc97bb038b68783a62ae9c10757f1b628b3b00b2ce9a46161fca2d4336d73