I’ve spent something like 15h this week already tweaking my CoinGrinder PR further. I did a complete rewrite since last week, restructuring the algorithm. Hoping that it’s gonna get some more review soon.
I’ve also spent a few hours on the rewrite of the coinselector_tests into the coinselection_tests suite. A bunch of the old tests broke when we introduced a bug fix. I have been pretty unhappy with the old tests for a while, due to a variety of issues including
  • duplication among the helper functions
  • UTXOs being created per their absolute values and therefore many tests using subtract_fee_from_output to allow reasoning about the expected amounts
  • Other UTXOs being created with a "fee" of zero, which leads to all sorts of unexpected outcomes, because the cost of spending a UTXO cannot ever be zero in production
  • Slow tests due to excessive repetitions both in cases of non-deterministic but also for determistic algorithms where that doesn’t make any sense
Anyway, I finally decided to try and replace the old tests completely. The new tests are based on building UTXOs from effective amounts rather than the absolute amounts. There are some helper functions that remove a lot of the boiler plate code. I’ve already removed 753 lines of code, but added 455 new lines with hopefully the same coverage. It would be nice to wrap an initial draft of that PR up by the end of the week.
I’ll be on the Optech Recap tomorrow again.
Finally I have been spending a couple hours on the Chaincode FOSS program.
Anyway, pretty good week so far.