Increase the default `liquidity_offset_half_life` to six hours 2022-10-better-liq-halflife-docs
authorMatt Corallo <git@bluematt.me>
Wed, 5 Oct 2022 19:23:56 +0000 (19:23 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 11 Oct 2022 18:25:43 +0000 (18:25 +0000)
Even at relatively high payment volumes, decaying knowledge of each
individual channel every hour causes aggressive retrying of
channels as we quickly forget the state of a channel. Even with the
historical tracker, this isn't fully remedied, as we'll track the
history bounds with the decayed value.

Instead, we decay every six hours here, reducing how often we'll
retry a channel due to decay.

In addition to this, the decay likely needs to be substantially
more linear, as tracked in #1752.

lightning/src/routing/scoring.rs

index 8206a6b93cc9beee46da045a6e3d5dcc1e5d5085..fefdebfccd30f8b38966e58b7650e81ba06ec080 100644 (file)
@@ -422,7 +422,7 @@ pub struct ProbabilisticScoringParameters {
        /// liquidity bounds are 200,000 sats and 600,000 sats, after this amount of time the upper
        /// and lower liquidity bounds will be decayed to 100,000 and 800,000 sats.
        ///
-       /// Default value:  hour
+       /// Default value: 6 hours
        ///
        /// # Note
        ///
@@ -780,7 +780,7 @@ impl ProbabilisticScoringParameters {
                        base_penalty_msat: 0,
                        base_penalty_amount_multiplier_msat: 0,
                        liquidity_penalty_multiplier_msat: 0,
-                       liquidity_offset_half_life: Duration::from_secs(3600),
+                       liquidity_offset_half_life: Duration::from_secs(6 * 60 * 60),
                        liquidity_penalty_amount_multiplier_msat: 0,
                        historical_liquidity_penalty_multiplier_msat: 0,
                        historical_liquidity_penalty_amount_multiplier_msat: 0,
@@ -806,7 +806,7 @@ impl Default for ProbabilisticScoringParameters {
                        base_penalty_msat: 500,
                        base_penalty_amount_multiplier_msat: 8192,
                        liquidity_penalty_multiplier_msat: 30_000,
-                       liquidity_offset_half_life: Duration::from_secs(3600),
+                       liquidity_offset_half_life: Duration::from_secs(6 * 60 * 60),
                        liquidity_penalty_amount_multiplier_msat: 192,
                        historical_liquidity_penalty_multiplier_msat: 10_000,
                        historical_liquidity_penalty_amount_multiplier_msat: 64,