Conversation
We previously insisted that `reply_channel_range` messages were not overlapping: blocks content could not be split across multiple messages. This made it possible to implicitly figure out when sync was complete, so we re-purposed the previous `complete` field to a `full_information` field. We now revert that change to allow blocks to be split across multiple messages. An explicit flag is thus needed to signal that sync is complete. Fixes #804
|
LGTM. Should we consider adding an error TLV to cover the intent of |
|
LGTM! In retrospect not having an explicit |
We are restoring the previous behavior of using the `sync_complete` field to signal the end of a `channel_range_query` sync. The first step is to correctly set that field, before we can read it and interpret it to mark the end of sync. See lightning/bolts#826
|
Ack: this won't break anything worse than it is now. We might get upset and send an error if the final block is split, so I'll fix that now. |
We are restoring the previous behavior of using the `sync_complete` field to signal the end of a `channel_range_query` sync. The first step is to correctly set that field, before we can read it and interpret it to mark the end of sync. See lightning/bolts#826
We are restoring the previous behavior of using the `sync_complete` field to signal the end of a `channel_range_query` sync. The first step is to correctly set that field, before we can read it and interpret it to mark the end of sync. See lightning/bolts#826
|
Merging as agreed during the spec meeting (#840) |
| - MUST set `sync_complete` to `false` if this is not the final `reply_channel_range`. | ||
| - the final `reply_channel_range` message: | ||
| - MUST have `first_blocknum` plus `number_of_blocks` equal or greater than the `query_channel_range` `first_blocknum` plus `number_of_blocks`. | ||
| - MUST set `sync_complete` to `true`. |
There was a problem hiding this comment.
what is true/false in a byte typed value? 0x01 and 0x00?
There was a problem hiding this comment.
Probably worth opening a PR to fix it, but, yes.
There was a problem hiding this comment.
Of course, 0x01. Feel free to clarify if you feel it's needed.
We assume if they set this to 0 (which nobody did previously), they're using it as a modern flag and use it to indicate when they're finished. Otherwise, we count how many blocks they've sent and use that to determine whether they've finished. See: lightning/bolts#826 Signed-off-by: Rusty Russell <[email protected]> Changelog-Changed: Protocol: we use `sync_complete` for gossip range query replies, with detection for older spec nodes.
We assume if they set this to 0 (which nobody did previously), they're using it as a modern flag and use it to indicate when they're finished. Otherwise, we count how many blocks they've sent and use that to determine whether they've finished. See: lightning/bolts#826 Signed-off-by: Rusty Russell <[email protected]> Changelog-Changed: Protocol: we use `sync_complete` for gossip range query replies, with detection for older spec nodes.
We assume if they set this to 0 (which nobody did previously), they're using it as a modern flag and use it to indicate when they're finished. Otherwise, we count how many blocks they've sent and use that to determine whether they've finished. See: lightning/bolts#826 Signed-off-by: Rusty Russell <[email protected]> Changelog-Changed: Protocol: we use `sync_complete` for gossip range query replies, with detection for older spec nodes.
We assume if they set this to 0 (which nobody did previously), they're using it as a modern flag and use it to indicate when they're finished. Otherwise, we count how many blocks they've sent and use that to determine whether they've finished. See: lightning/bolts#826 Signed-off-by: Rusty Russell <[email protected]> Changelog-Changed: Protocol: we use `sync_complete` for gossip range query replies, with detection for older spec nodes.
We assume if they set this to 0 (which nobody did previously), they're using it as a modern flag and use it to indicate when they're finished. Otherwise, we count how many blocks they've sent and use that to determine whether they've finished. See: lightning/bolts#826 Signed-off-by: Rusty Russell <[email protected]> Changelog-Changed: Protocol: we use `sync_complete` for gossip range query replies, with detection for older spec nodes.
We previously insisted that
reply_channel_rangemessages were not overlapping: blocks content could not be split across multiple messages.This made it possible to implicitly figure out when sync was complete, so we re-purposed the previous
completefield to afull_informationfield.We now revert that change to allow blocks to be split across multiple messages. An explicit flag is thus needed to signal that sync is complete. AFAIK, no-one actually reads the
full_informationfield and use its info: so it's ok to re-purpose it.Implementations should probably deploy this in multiple phases:
sync_completefield: set it totrueonly in your lastreply_channel_rangesync_completereply_channel_rangeA safer approach would be to avoid re-using the
full_informationfield and instead introduce a new TLV field.Let me know if you think that's better.
Fixes #804