Only disable channels ~10 min after disconnect, rather than one 2023-04-fewer-disables
authorMatt Corallo <git@bluematt.me>
Mon, 17 Apr 2023 23:09:11 +0000 (23:09 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 18 Apr 2023 04:31:52 +0000 (04:31 +0000)
commit89e063b793ee3f1d33536e1157434db33d81e06b
treed7e34a3ef1f85e6cdb9ef55430020700bf059211
parent6e7000c5e7d246585d876e65a1aa8106fa948f7a
Only disable channels ~10 min after disconnect, rather than one

We correctly send out a gossip channel disable update after one
full time tick being down (1-2 minutes). This is pretty nice in
that it avoids nodes trying to route through our nodes too often
if they're down. Other nodes have a much longer time window,
causing them to have much less aggressive channel disables. Sadly,
at one minute it's not super uncommon for tor nodes to get disabled
(once a day or so on two nodes I looked at), and this causes the
lightning terminal scorer to consider the LDK node unstable (even
though it's the one doing the disabling - so is online). This
causes user frustration and makes LDK look bad (even though it's
probably failing fewer payments).

Given this, and future switches to block-based `channel_update`
timestamp fields, it makes sense to go ahead and switch to delaying
channel disable announcements for 10 minutes. This puts us more in
line with other implementations and reduces gossip spam, at the
cost of less reliable payments.

Fixes #2175, at least the currently visible parts.
lightning/src/ln/channel.rs
lightning/src/ln/channelmanager.rs
lightning/src/ln/functional_tests.rs
lightning/src/ln/onion_route_tests.rs