core-lightning/gossipd
Rusty Russell 107fc8b9fb gossipd: fix crash when processing pending node_announcements.
When we process pending channel updates, it can cause the node_announcement
to be moved.  Then, we process a new node_announcement and go to delete
the old one, but it's already moved!

Do the obvious thing, and refresh gossmap if necessary each time around
the loop.

```
2024-05-17T02:56:12.701Z **BROKEN** gossipd: gossip_store: get delete entry offset 554921761/585584347 (version v24.02.1-151-g6e2ab02-modded)
2024-05-17T02:56:12.701Z **BROKEN** gossipd: backtrace: common/daemon.c:38 (send_backtrace) 0x55b4c962518b
2024-05-17T02:56:12.701Z **BROKEN** gossipd: backtrace: common/status.c:221 (status_failed) 0x55b4c962e83e
2024-05-17T02:56:12.701Z **BROKEN** gossipd: backtrace: gossipd/gossip_store.c:466 (gossip_store_get_with_hdr) 0x55b4c961b6e3
2024-05-17T02:56:12.701Z **BROKEN** gossipd: backtrace: gossipd/gossip_store.c:491 (check_msg_type) 0x55b4c961b75d
2024-05-17T02:56:12.701Z **BROKEN** gossipd: backtrace: gossipd/gossip_store.c:509 (gossip_store_set_flag) 0x55b4c961b8e0
2024-05-17T02:56:12.701Z **BROKEN** gossipd: backtrace: gossipd/gossip_store.c:561 (gossip_store_del) 0x55b4c961bb26
2024-05-17T02:56:12.701Z **BROKEN** gossipd: backtrace: gossipd/gossmap_manage.c:913 (process_node_announcement) 0x55b4c961c472
2024-05-17T02:56:12.701Z **BROKEN** gossipd: backtrace: gossipd/gossmap_manage.c:1111 (reprocess_queued_msgs) 0x55b4c961d6a6
2024-05-17T02:56:12.701Z **BROKEN** gossipd: backtrace: gossipd/gossmap_manage.c:670 (gossmap_manage_handle_get_txout_reply) 0x55b4c961d840
2024-05-17T02:56:12.702Z **BROKEN** gossipd: backtrace: gossipd/gossipd.c:585 (recv_req) 0x55b4c9619e6a
2024-05-17T02:56:12.702Z **BROKEN** gossipd: backtrace: common/daemon_conn.c:35 (handle_read) 0x55b4c9625436
2024-05-17T02:56:12.702Z **BROKEN** gossipd: backtrace: ccan/ccan/io/io.c:59 (next_plan) 0x55b4c96b8506
2024-05-17T02:56:12.702Z **BROKEN** gossipd: backtrace: ccan/ccan/io/io.c:407 (do_plan) 0x55b4c96b898d
2024-05-17T02:56:12.702Z **BROKEN** gossipd: backtrace: ccan/ccan/io/io.c:417 (io_ready) 0x55b4c96b8a26
2024-05-17T02:56:12.702Z **BROKEN** gossipd: backtrace: ccan/ccan/io/poll.c:453 (io_loop) 0x55b4c96ba315
2024-05-17T02:56:12.702Z **BROKEN** gossipd: backtrace: gossipd/gossipd.c:683 (main) 0x55b4c961a84c
2024-05-17T02:56:12.702Z **BROKEN** gossipd: backtrace: ../csu/libc-start.c:308 (__libc_start_main) 0x7f3931a3dd09
2024-05-17T02:56:12.702Z **BROKEN** gossipd: backtrace: (null):0 ((null)) 0x55b4c9616d39
2024-05-17T02:56:12.702Z **BROKEN** gossipd: backtrace: (null):0 ((null)) 0xffffffffffffffff
2024-05-17T02:56:12.702Z **BROKEN** gossipd: STATUS_FAIL_INTERNAL_ERROR: gossip_store: get delete entry offset 554921761/585584347
```

Reported-by: Vincenzo Palazzo
Fixes: https://github.com/ElementsProject/lightning/issues/7320
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-06-04 08:09:54 -05:00
..
test bolt12: allow first_node_id in blinded path to be a scid. 2024-05-12 19:11:43 -05:00
gossip_store_wire.csv gossipd: strip private updates from gossip_store on startup. 2024-01-31 14:47:33 +10:30
gossip_store.c gossipd: make extra-sure we don't put in redundant channel_announcement messages. 2024-05-23 20:23:36 +02:00
gossip_store.h gossipd: make extra-sure we don't put in redundant channel_announcement messages. 2024-05-23 20:23:36 +02:00
gossipd_peerd_wire.csv channeld: send channel updates and announcements via lightningd. 2022-02-08 11:15:52 +10:30
gossipd_wire.csv gossipd: don't validate UTXOs on our own channels. 2024-02-04 09:24:44 +10:30
gossipd.c logging: move noisy gossip recv message to TRACE 2024-05-08 21:05:49 -05:00
gossipd.h gossipd: remove routing.c and other unused functions. 2024-02-04 09:24:44 +10:30
gossmap_manage.c gossipd: fix crash when processing pending node_announcements. 2024-06-04 08:09:54 -05:00
gossmap_manage.h gossipd: simplify gossip store API. 2024-02-04 09:24:44 +10:30
Makefile common: remove type_to_string files altogther. 2024-03-20 13:51:48 +10:30
queries.c bitcoin/short_channel_id: pass by copy everywhere. 2024-03-20 13:51:48 +10:30
queries.h gossipd: remove routing.c and other unused functions. 2024-02-04 09:24:44 +10:30
seeker.c gossipd: be stricter with non-gossip_query nodes. 2024-03-31 12:32:05 +02:00
seeker.h gossipd: have seeker quert interfaces take an id, not a struct peer. 2024-02-04 09:24:44 +10:30
sigcheck.c common: remove type_to_string files altogther. 2024-03-20 13:51:48 +10:30
sigcheck.h gossipd: take signature checks out of routing.c 2024-02-04 09:24:44 +10:30
txout_failures.c gossipd: take txout failure cache out of routing.c 2024-02-04 09:24:44 +10:30
txout_failures.h gossipd: take txout failure cache out of routing.c 2024-02-04 09:24:44 +10:30