can/should update payoutSats > DUST safety constraint
Currently there is a safety constraint that asserts payoutSats > Dust
. This looks obviously wrong since logically it should be >=
.
The source of this off-by-one constraint is here:
- Initial assertion at the end of the constraints chain is:
longSats < MAX_SATS
- which is not very useful. So it is replaced with the constraint (this is the root of the problem):
longSats < payoutSats
- Later in the constraints chain, there is a calculation:
longSats = max(DUST, longSatsUnsafe)
In order to establish the strictest possible constraints for the "longSats < payoutSats" constraint in context of this calculation, we use the largest possible value for "longSats" yielding:
DUST < payoutSats
- Which in the context of
payoutSats
propagates into the reverse constraint:
payoutSats > DUST
If the original constraint is set to payoutSats >= Dust
, then it resolves this apparent bug. However that also propagates to the rest of the chain of constraints which needs to be done before making an isolated change. Will update when I have time or when this becomes an important issue.