Tracepoints can be useful for coin selection as they would allow us to observe what is being selected, selection parameters, and calculation results. So this PR adds 4 new tracepoints:
- After
SelectCoins
returns in order to observe theSelectionResult
- After the first
CreateTransactionInternal
to observe the created transaction - Prior to the second
CreateTransactionInternal
to notify that the optimistic avoid partial spends selection is occurring - After the second
CreateTransactionInternal
to observe the created transaction and inform which solution is being used.
This PR also adds an algorithm enum to SelectionResult
so that the first tracepoint will be able to report which algorithm was used to produce that result.
The primary use case for these tracepoints is in running coin selection simulations. The script I use to run these simulations use these tracepoints in order to gather data on the algorithm used and the calculated waste.