lnd/discovery
Olaoluwa Osuntokun f7daa307dd
discovery: fix bug that can lead to sending invalid chan_ann msgs
Initially in lnd, we didn't store the extra TLV data that could be
dangling off of gossip messages. This was fixed initially in lnd v0.5
with this PR: https://github.com/lightningnetwork/lnd/pull/1825.

Within the PR, we incorrect set the `ExtraOpaqueData` (extra TLV blob)
of the `ChannelAnnouncement` to the value stored in `edge`, which is
actually our channel update. As 6-ish years ago we didn't yet have
anything that used the TLV gossip fields, this went unnoticed.

Fast forward to 2024, we shipped an experimental version of inbounbd
fees. This starts to store additional data in the `ExtraOpaqueData`
field, the TLV for the inbound fee. Initially, everything is valid when
the first `ChannelAnnouncement` is sent, but as soon as a user attempts
to set an inbound fee policy, we'd incorrectly swap in that new
serialized TLV for the _channel announcement_:
841e24399c (diff-1eda595bbebe495bd74a6a0431c46b66cb4e8b53beb311067c010feac2665dcbR2560).

Since we're just trying to generate a new `channel_update`, we don't
also regenerate the signature for the `channel_announcement` message. As
a result, we end up storing a `channel_announcement` with an invalid sig
on disk, continuing to broadcast that to peers.
2024-08-13 19:39:16 -07:00
..
bootstrapper.go multi: add SpewLogClosure to avoid code repetition 2024-07-25 22:18:49 +08:00
chan_series.go refactor: move various duties from ChannelRouter to graph.Builder 2024-07-15 15:56:33 +02:00
gossiper_test.go discovery: rename Gossiper graph dep 2024-07-15 15:56:33 +02:00
gossiper.go discovery: fix bug that can lead to sending invalid chan_ann msgs 2024-08-13 19:39:16 -07:00
log.go multi: add NewLogClosure in lnutils to avoid repetition 2024-07-25 21:25:23 +08:00
message_store_test.go discovery: use T.TempDir to create temporary test directory 2022-08-24 08:58:16 +08:00
message_store.go multi: wrap all errors 2024-04-11 15:04:03 +02:00
mock_test.go funding+peer: add support for new musig2 channel funding flow 2023-08-22 16:32:07 -07:00
reliable_sender_test.go multi: use btcd's btcec/v2 and btcutil modules 2022-03-09 19:02:37 +01:00
reliable_sender.go discovery+peer: add logs to reveal shutdown flow 2022-12-08 17:57:01 +08:00
sync_manager_test.go multi: start asking for update timestamps in QueryChannelRange 2023-12-11 09:12:04 +02:00
sync_manager.go multi: extract and pass through IsZombieChannel method 2023-12-11 09:12:05 +02:00
syncer_test.go multi: fix fmt.Errorf error wrapping 2024-02-27 11:13:40 +00:00
syncer.go multi: wrap all errors 2024-04-11 15:04:03 +02:00