mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-15 20:09:18 +01:00
Doc: update bolts to assume gossip_queries under the new meaning.
Everyone understands gossip_queries now, but peers leave it unset to indicate they have nothing useful to say. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
65ef909bd3
commit
06cf5ac841
6 changed files with 11 additions and 24 deletions
2
Makefile
2
Makefile
|
@ -26,7 +26,7 @@ CCANDIR := ccan
|
|||
|
||||
# Where we keep the BOLT RFCs
|
||||
BOLTDIR := ../bolts/
|
||||
DEFAULT_BOLTVERSION := e042c615efb5139a0bfdca0c6391c3c13df70418
|
||||
DEFAULT_BOLTVERSION := fce8bab931674a81a9ea895c9e9162e559e48a65
|
||||
# Can be overridden on cmdline.
|
||||
BOLTVERSION := $(DEFAULT_BOLTVERSION)
|
||||
|
||||
|
|
|
@ -157,11 +157,8 @@ static const struct dependency feature_deps[] = {
|
|||
/* BOLT #9:
|
||||
* Name | Description | Context | Dependencies |
|
||||
*...
|
||||
* `gossip_queries_ex` | ... | ... | `gossip_queries` |
|
||||
*...
|
||||
* `basic_mpp` | ... | ... | `payment_secret` |
|
||||
*/
|
||||
{ OPT_GOSSIP_QUERIES_EX, OPT_GOSSIP_QUERIES },
|
||||
{ OPT_BASIC_MPP, OPT_PAYMENT_SECRET },
|
||||
};
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ struct feature_set *feature_set_dup(const tal_t *ctx,
|
|||
* | 0/1 | `option_data_loss_protect` |... ASSUMED ...
|
||||
* | 3 | `initial_routing_sync` |... I ...
|
||||
* | 4/5 | `option_upfront_shutdown_script` |... IN ...
|
||||
* | 6/7 | `gossip_queries` |... IN ...
|
||||
* | 6/7 | `gossip_queries` |...
|
||||
* | 8/9 | `var_onion_optin` |... ASSUMED ...
|
||||
* | 10/11 | `gossip_queries_ex` |... IN ...
|
||||
* | 12/13 | `option_static_remotekey` |... ASSUMED ...
|
||||
|
|
|
@ -262,7 +262,6 @@ void setup_peer_gossip_store(struct peer *peer,
|
|||
/* BOLT #7:
|
||||
*
|
||||
* A node:
|
||||
* - if the `gossip_queries` feature is negotiated:
|
||||
* - MUST NOT relay any gossip messages it did not generate itself,
|
||||
* unless explicitly requested.
|
||||
*/
|
||||
|
@ -278,17 +277,7 @@ void setup_peer_gossip_store(struct peer *peer,
|
|||
peer->gs.timestamp_min = 0;
|
||||
peer->gs.timestamp_max = UINT32_MAX;
|
||||
|
||||
/* BOLT #7:
|
||||
*
|
||||
* - upon receiving an `init` message with the
|
||||
* `initial_routing_sync` flag set to 1:
|
||||
* - SHOULD send gossip messages for all known channels and
|
||||
* nodes, as if they were just received.
|
||||
* - if the `initial_routing_sync` flag is set to 0, OR if the
|
||||
* initial sync was completed:
|
||||
* - SHOULD resume normal operation, as specified in the
|
||||
* following [Rebroadcasting](#rebroadcasting) section.
|
||||
*/
|
||||
/* 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 {
|
||||
|
|
|
@ -1303,7 +1303,7 @@ struct gossmap *gossmap_manage_get_gossmap(struct gossmap_manage *gm)
|
|||
}
|
||||
|
||||
/* BOLT #7:
|
||||
* - if the `gossip_queries` feature is negotiated:
|
||||
* A node:
|
||||
* - MUST NOT relay any gossip messages it did not generate itself,
|
||||
* unless explicitly requested.
|
||||
*/
|
||||
|
|
|
@ -73,7 +73,7 @@ bool query_short_channel_ids(struct daemon *daemon,
|
|||
struct tlv_query_short_channel_ids_tlvs *tlvs;
|
||||
/* BOLT #7:
|
||||
*
|
||||
* 1. type: 261 (`query_short_channel_ids`) (`gossip_queries`)
|
||||
* 1. type: 261 (`query_short_channel_ids`)
|
||||
* 2. data:
|
||||
* * [`chain_hash`:`chain_hash`]
|
||||
* * [`u16`:`len`]
|
||||
|
@ -82,10 +82,6 @@ bool query_short_channel_ids(struct daemon *daemon,
|
|||
const size_t reply_overhead = 32 + 2;
|
||||
size_t max_encoded_bytes = 65535 - 2 - reply_overhead;
|
||||
|
||||
/* Can't query if they don't have gossip_queries_feature */
|
||||
if (!peer->gossip_queries_feature)
|
||||
return false;
|
||||
|
||||
/* BOLT #7:
|
||||
* - MAY include an optional `query_flags`. If so:
|
||||
* - MUST set `encoding_type`, as for `encoded_short_ids`.
|
||||
|
@ -98,10 +94,15 @@ bool query_short_channel_ids(struct daemon *daemon,
|
|||
/* BOLT #7:
|
||||
*
|
||||
* The sender:
|
||||
* - SHOULD NOT send this to a peer which does not offer `gossip_queries`.
|
||||
* - MUST NOT send `query_short_channel_ids` if it has sent a previous
|
||||
* `query_short_channel_ids` to this peer and not received
|
||||
* `reply_short_channel_ids_end`.
|
||||
*/
|
||||
/* Don't query if they have no useful gossip */
|
||||
if (!peer->gossip_queries_feature)
|
||||
return false;
|
||||
|
||||
if (peer->scid_query_outstanding)
|
||||
return false;
|
||||
|
||||
|
@ -419,7 +420,7 @@ static size_t max_entries(enum query_option_flags query_option_flags)
|
|||
{
|
||||
/* BOLT #7:
|
||||
*
|
||||
* 1. type: 264 (`reply_channel_range`) (`gossip_queries`)
|
||||
* 1. type: 264 (`reply_channel_range`)
|
||||
* 2. data:
|
||||
* * [`chain_hash`:`chain_hash`]
|
||||
* * [`u32`:`first_blocknum`]
|
||||
|
|
Loading…
Add table
Reference in a new issue