You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Though it is possible, it would not be very useful to ask for checksums without asking for timestamps too: the receiving node may have an older `channel_update` with a different checksum, asking for it would be useless. And if a `channel_update` checksum is actually 0 (which is quite unlikely) it will not be queried.
736
+
Though it is possible, it would not be very useful to ask for checksums without asking for timestamps/block heights too: the receiving node may have an older `channel_update` with a different checksum, asking for it would be useless. And if a `channel_update` checksum is actually 0 (which is quite unlikely) it will not be queried.
@@ -746,15 +747,21 @@ Though it is possible, it would not be very useful to ask for checksums without
746
747
747
748
1.`tlv_stream`: `reply_channel_range_tlvs`
748
749
2. types:
749
-
1. type: 1 (`timestamps_tlv`)
750
+
1. type: 1 (`timestamps_blockheights_tlv`)
750
751
2. data:
751
752
*[`byte`:`encoding_type`]
752
-
*[`...*byte`:`encoded_timestamps`]
753
+
*[`...*byte`:`encoded_timestamps_blockheights`]
753
754
1. type: 3 (`checksums_tlv`)
754
755
2. data:
755
756
*[`...*channel_update_checksums`:`checksums`]
756
757
757
-
For a single `channel_update`, timestamps are encoded as:
758
+
For the `timestamps_blockheights_tlv` field, the contents depends on whether the
759
+
associated channel update message is for a channel announced using
760
+
`channel_announcement` or `channel_announcement_2`.
761
+
762
+
If the channel was announced using `channel_announcement`, then the associated
763
+
update will be a `channel_update`, meaning that the contents will represent
764
+
timestamps and will be encoded as:
758
765
759
766
1. subtype: `channel_update_timestamps`
760
767
2. data:
@@ -765,18 +772,31 @@ Where:
765
772
*`timestamp_node_id_1` is the timestamp of the `channel_update` for `node_id_1`, or 0 if there was no `channel_update` from that node.
766
773
*`timestamp_node_id_2` is the timestamp of the `channel_update` for `node_id_2`, or 0 if there was no `channel_update` from that node.
767
774
768
-
For a single `channel_update`, checksums are encoded as:
775
+
If the channel was announced usig `channel_announcement_2`, then the associated
776
+
update is a `channel_update_2` and the contents will represent block heights and
777
+
will be encoded as:
778
+
779
+
1. subtype: `channel_update_blockheights`
780
+
2. data:
781
+
*[`u32`:`block_height_node_id_1`]
782
+
*[`u32`:`block_height_node_id_2`]
783
+
784
+
Where:
785
+
*`block_height_node_id_1` is the block height of the `channel_update_2` for `node_id_1`, or 0 if there was no `channel_update_2` from that node.
786
+
*`block_height_node_id_2` is the block height of the `channel_update_2` for `node_id_2`, or 0 if there was no `channel_update_2` from that node.
787
+
788
+
For a single `channel_update`/`_2`, checksums are encoded as:
769
789
770
790
1. subtype: `channel_update_checksums`
771
791
2. data:
772
792
*[`u32`:`checksum_node_id_1`]
773
793
*[`u32`:`checksum_node_id_2`]
774
794
775
795
Where:
776
-
*`checksum_node_id_1` is the checksum of the `channel_update` for `node_id_1`, or 0 if there was no `channel_update` from that node.
777
-
*`checksum_node_id_2` is the checksum of the `channel_update` for `node_id_2`, or 0 if there was no `channel_update` from that node.
796
+
*`checksum_node_id_1` is the checksum of the `channel_update`/`_2` for `node_id_1`, or 0 if there was no `channel_update`/`_2` from that node.
797
+
*`checksum_node_id_2` is the checksum of the `channel_update`/`_2` for `node_id_2`, or 0 if there was no `channel_update`/`_2` from that node.
778
798
779
-
The checksum of a `channel_update` is the CRC32C checksum as specified in [RFC3720](https://tools.ietf.org/html/rfc3720#appendix-B.4) of this `channel_update` without its `signature` and `timestamp` fields.
799
+
The checksum of a `channel_update`/`_2` is the CRC32C checksum as specified in [RFC3720](https://tools.ietf.org/html/rfc3720#appendix-B.4) of this `channel_update`/`_2` without its `signature` and `timestamp`/`block_height` fields.
780
800
781
801
This allows querying for channels within specific blocks.
782
802
@@ -799,6 +819,10 @@ The receiver of `query_channel_range`:
799
819
- MUST limit `number_of_blocks` to the maximum number of blocks whose
800
820
results could fit in `encoded_short_ids`
801
821
- MAY split block contents across multiple `reply_channel_range`.
822
+
- If the sender of `query_channel_range` has not advertised the
823
+
`option_taproot_gossip` feature bit then the response MUST only include
824
+
short channel IDs for channels announced with the `channel_announcement`
825
+
message.
802
826
- the first `reply_channel_range` message:
803
827
- MUST set `first_blocknum` less than or equal to the `first_blocknum` in `query_channel_range`
804
828
- MUST set `first_blocknum` plus `number_of_blocks` greater than `first_blocknum` in `query_channel_range`.
@@ -810,7 +834,7 @@ The receiver of `query_channel_range`:
810
834
- MUST set `sync_complete` to `true`.
811
835
812
836
If the incoming message includes `query_option`, the receiver MAY append additional information to its reply:
813
-
- if bit 0 in `query_option_flags` is set, the receiver MAY append a `timestamps_tlv` that contains `channel_update` timestamps for all `short_channel_id`s in `encoded_short_ids`
837
+
- if bit 0 in `query_option_flags` is set, the receiver MAY append a `timestamps_blockheights_tlv` that contains `channel_update`/`_2` timestamps for all `short_channel_id`s in `encoded_short_ids`
814
838
- if bit 1 in `query_option_flags` is set, the receiver MAY append a `checksums_tlv` that contains `channel_update` checksums for all `short_channel_id`s in `encoded_short_ids`
815
839
816
840
#### Rationale
@@ -834,6 +858,16 @@ The addition of timestamp and checksum fields allow a peer to omit querying for
834
858
*[`chain_hash`:`chain_hash`]
835
859
*[`u32`:`first_timestamp`]
836
860
*[`u32`:`timestamp_range`]
861
+
*[`gossip_timestamps_filter_tlvs`:`tlvs`]
862
+
863
+
1.`tlv_stream`: `gossip_timestamps_filter_tlvs`
864
+
2. types:
865
+
1. type: 2 (`first_block`)
866
+
2. data:
867
+
*[`u32`:`block_height`]
868
+
1. type: 4 (`block_height_range`)
869
+
2. data:
870
+
*[`u32`:`num_blocks`]
837
871
838
872
This message allows a node to constrain future gossip messages to
839
873
a specific range. A node which wants any gossip messages would have
@@ -852,20 +886,26 @@ The sender:
852
886
The receiver:
853
887
- SHOULD send all gossip messages whose `timestamp` is greater or
854
888
equal to `first_timestamp`, and less than `first_timestamp` plus
855
-
`timestamp_range`.
889
+
`timestamp_range`. This applies to the messages: `channel_announcement`,
890
+
`channel_update` and `node_announcement`.
856
891
- MAY wait for the next outgoing gossip flush to send these.
857
-
- SHOULD send gossip messages as it generates them regardless of `timestamp`.
892
+
- SHOULD send all gossip messages whose `block_height` is greater than or
893
+
equal to `first_block`, and less than `first_block` plus `num_blocks`.
894
+
- SHOULD send gossip messages as it generates them regardless of `timestamp`/`block_height`.
858
895
- Otherwise (relayed gossip):
859
896
- SHOULD restrict future gossip messages to those whose `timestamp`
860
897
is greater or equal to `first_timestamp`, and less than
861
-
`first_timestamp` plus `timestamp_range`.
862
-
- If a `channel_announcement` has no corresponding `channel_update`s:
863
-
- MUST NOT send the `channel_announcement`.
898
+
`first_timestamp` plus `timestamp_range` or whose `block_height` is
899
+
greater than or equal to `first_block`, and less than `first_block` plus
900
+
`num_blocks`.
901
+
- If a `channel_announcement`/`_2` has no corresponding `channel_update`/`_2`s:
902
+
- MUST NOT send the `channel_announcement`/`_2`.
864
903
- Otherwise:
865
904
- MUST consider the `timestamp` of the `channel_announcement` to be the `timestamp` of a corresponding `channel_update`.
866
-
- MUST consider whether to send the `channel_announcement` after receiving the first corresponding `channel_update`.
867
-
- If a `channel_announcement` is sent:
868
-
- MUST send the `channel_announcement` prior to any corresponding `channel_update`s and `node_announcement`s.
905
+
- MUST consider the `block_height` of the `channel_announcement_2` to be the height of the block it was mined in.
906
+
- MUST consider whether to send the `channel_announcement`/`_2` after receiving the first corresponding `channel_update`/`_2`.
907
+
- If a `channel_announcement`/`_2` is sent:
908
+
- MUST send the `channel_announcement`/`_2` prior to any corresponding `channel_update`/`_2`s and `node_announcement`/`_2`s.
0 commit comments