Don't remove nodes if there's no channel_update for a temp failure 2023-04-dont-ban-cln
authorMatt Corallo <git@bluematt.me>
Sun, 23 Apr 2023 16:17:29 +0000 (16:17 +0000)
committerMatt Corallo <git@bluematt.me>
Mon, 24 Apr 2023 18:52:05 +0000 (18:52 +0000)
commit67ad6c40f0e0f98548337e73bc1421699862a0a6
tree4e4d24fbc976c76e8260a382a4e65bede7965e16
parent3dcd490bbfafd25acef42a39137cb2ca2cd40229
Don't remove nodes if there's no channel_update for a temp failure

Previously, we were requiring any `UPDATE` onion errors to include
a `channel_update`, as the spec mandates[1]. If we see an onion
error which is missing one we treat it as a misbehaving node that
isn't behaving according to the spec and simply remove the node.

Sadly, it appears at least some versions of CLN are such nodes, and
opt to not include `channel_update` at all if they're returning a
`temporary_channel_failure`. This causes us to completely remove
CLN nodes from our graph after they fail to forward our HTLC.

While CLN is violating the spec here, there's not a lot of reason
to not allow it, so we go ahead and do so here, treating it simply
as any other failure by letting the scorer handle it.

[1] The spec says `Please note that the channel_update field is
mandatory in messages whose failure_code includes the UPDATE flag`
however doesn't repeat it in the requirements section so its not
crazy that someone missed it when implementing.
fuzz/src/router.rs
lightning/src/ln/onion_utils.rs
lightning/src/routing/gossip.rs