From 002dc60b33c2678e48e725d5bdf9c5b884e6f8ed Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 19 Jun 2024 10:06:42 +0930 Subject: [PATCH] Gossip: BOLT catch, remove initial_routing_sync. Everyone sends a gossip_timestamp_filter message these days to start gossip. Signed-off-by: Rusty Russell --- Makefile | 2 +- common/features.c | 9 --------- common/features.h | 2 -- connectd/multiplex.c | 26 ++++---------------------- 4 files changed, 5 insertions(+), 34 deletions(-) diff --git a/Makefile b/Makefile index 01a153bbb..962055e4e 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ CCANDIR := ccan # Where we keep the BOLT RFCs BOLTDIR := ../bolts/ -DEFAULT_BOLTVERSION := fce8bab931674a81a9ea895c9e9162e559e48a65 +DEFAULT_BOLTVERSION := fc687e8c7638a65c9120777025ae5ae53e4e622f # Can be overridden on cmdline. BOLTVERSION := $(DEFAULT_BOLTVERSION) diff --git a/common/features.c b/common/features.c index 17e95ab3c..41daa4055 100644 --- a/common/features.c +++ b/common/features.c @@ -31,9 +31,6 @@ static const struct feature_style feature_styles[] = { { OPT_DATA_LOSS_PROTECT, .copy_style = { [INIT_FEATURE] = FEATURE_REPRESENT, [NODE_ANNOUNCE_FEATURE] = FEATURE_REPRESENT } }, - { OPT_INITIAL_ROUTING_SYNC, - .copy_style = { [INIT_FEATURE] = FEATURE_REPRESENT_AS_OPTIONAL, - [NODE_ANNOUNCE_FEATURE] = FEATURE_DONT_REPRESENT } }, { OPT_UPFRONT_SHUTDOWN_SCRIPT, .copy_style = { [INIT_FEATURE] = FEATURE_REPRESENT, [NODE_ANNOUNCE_FEATURE] = FEATURE_REPRESENT } }, @@ -404,12 +401,6 @@ int features_unsupported(const struct feature_set *our_features, const u8 *their_features, enum feature_place p) { - /* BIT 2 would logically be "compulsory initial_routing_sync", but - * that does not exist, so we special case it. */ - if (feature_is_set(their_features, - COMPULSORY_FEATURE(OPT_INITIAL_ROUTING_SYNC))) - return COMPULSORY_FEATURE(OPT_INITIAL_ROUTING_SYNC); - return all_supported_features(our_features, their_features, p); } diff --git a/common/features.h b/common/features.h index 0474ed00d..554304fef 100644 --- a/common/features.h +++ b/common/features.h @@ -103,7 +103,6 @@ struct feature_set *feature_set_dup(const tal_t *ctx, * * | Bits | Name |... * | 0/1 | `option_data_loss_protect` |... ASSUMED ... - * | 3 | `initial_routing_sync` |... I ... * | 4/5 | `option_upfront_shutdown_script` |... IN ... * | 6/7 | `gossip_queries` |... * | 8/9 | `var_onion_optin` |... ASSUMED ... @@ -123,7 +122,6 @@ struct feature_set *feature_set_dup(const tal_t *ctx, * | 50/51 | `option_zeroconf` | ... IN ... */ #define OPT_DATA_LOSS_PROTECT 0 -#define OPT_INITIAL_ROUTING_SYNC 2 #define OPT_UPFRONT_SHUTDOWN_SCRIPT 4 #define OPT_GOSSIP_QUERIES 6 #define OPT_VAR_ONION 8 diff --git a/connectd/multiplex.c b/connectd/multiplex.c index 1fd4dab0e..81d5a52b0 100644 --- a/connectd/multiplex.c +++ b/connectd/multiplex.c @@ -265,28 +265,10 @@ void setup_peer_gossip_store(struct peer *peer, * - MUST NOT relay any gossip messages it did not generate itself, * unless explicitly requested. */ - if (feature_negotiated(our_features, their_features, OPT_GOSSIP_QUERIES)) { - peer->gs.gossip_timer = NULL; - peer->gs.active = false; - peer->gs.off = 1; - return; - } - - peer->gs.gossip_timer = gossip_stream_timer(peer); - peer->gs.active = !peer->daemon->dev_suppress_gossip; - peer->gs.timestamp_min = 0; - peer->gs.timestamp_max = UINT32_MAX; - - /* We still respect this old bit, though spec part was removed. */ - if (feature_offered(their_features, OPT_INITIAL_ROUTING_SYNC)) - peer->gs.off = 1; - else { - /* During tests, particularly, we find that the gossip_store - * moves fast, so make sure it really does start at the end. */ - peer->gs.off - = find_gossip_store_end(peer->daemon->gossip_store_fd, - peer->daemon->gossip_store_end); - } + peer->gs.gossip_timer = NULL; + peer->gs.active = false; + peer->gs.off = 1; + return; } /* We're happy for the kernel to batch update and gossip messages, but a