Add max dust exposure multiplier config knob
authorAlec Chen <alecchendev@gmail.com>
Mon, 19 Jun 2023 02:53:43 +0000 (21:53 -0500)
committerAlec Chen <alecchendev@gmail.com>
Fri, 7 Jul 2023 19:30:42 +0000 (14:30 -0500)
commitcfc7ec66f03a0eb9489af2c433597d9123d07ca3
tree9b5f11abca762b6ed3c4e1ca38b054a1f6184f99
parent89aa7ace6a53786d310386af403d33010f8cd05c
Add max dust exposure multiplier config knob

With fee rates rising dramatically in mid-April 2023, thresholds for
what is considered dust have risen, often exceeding our previous dust
exposure threshold of 5k sats. This causes all payments and HTLC
forwards between 5k sats and new dust thresholds to fail.

This commit changes our max dust exposure config knob from a fixed
upper limit to a `MaxDustHTLCExposure` enum with an additional variant
to allow setting our max dust exposure to a multiplier on the current
high priority feerate.

To remain backwards compatible we'll always write the fixed limit if
it's set, or its default value in its currently reserved TLV.

We also now write an odd TLV for the new enum, so that previous
versions can safely ignore it upon downgrading, while allowing us to
make use of the new type when it's written.
lightning/src/ln/channel.rs
lightning/src/ln/functional_test_utils.rs
lightning/src/ln/functional_tests.rs
lightning/src/ln/onion_route_tests.rs
lightning/src/util/config.rs
lightning/src/util/ser_macros.rs