1
0
mirror of https://github.com/lightning/bolts.git synced 2024-11-19 01:50:03 +01:00
Commit Graph

122 Commits

Author SHA1 Message Date
Dimitris Apostolou
3476c9b25a Fix typos 2019-09-26 06:12:41 +00:00
sstone
c8e53fe5bf BOTL 7: fixup: clarify when to reply with a node_announcement
Do not reply with a node_announcement if the query includes an optional query flag that does not request it.
The current wording could be interpreted as "always follow with node announcements whenever
you reply with a channel announcements" which defeats the point of using query flags (if you want the node
announcements just set the corresponding bits).
2019-09-16 22:36:59 +02:00
sstone
30485af1df Define a feature bit for extended gossip queries 2019-09-16 22:36:59 +02:00
Fabrice Drouin
2f3514fe75 TLV Formatting changes
We use the more tool-friendly `...*` description for TLV extensions.
Checksums are now serialized as raw arrays, as using zlib compression here would not help.
2019-09-16 22:36:59 +02:00
sstone
2ba49eb467 Fixup: address review comments 2019-09-16 22:36:59 +02:00
Rusty Russell
9d6f969722 BOLT 7: fixup: specify exactly which version of CRC32.
This is the one in SSE4, FWIW, and the iSCSI RFC contains test
vectors.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-09-16 22:36:59 +02:00
Rusty Russell
62dcf0fced BOLT 7: fixup: add missing encoding_type in checksums_tlv.
Since some can be zero (missing updates), it's probably worth
doing the compression thing optionally.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-09-16 22:36:59 +02:00
Rusty Russell
420d740311 BOLT 7: fix up TLV formatting for modern parser.
Formatting changes only.

This make tools/extract-formats.py work (well, it misses some stuff
until the tlv-testcases merge, but then it's OK).

We use `tlvs` (for tlv stream), and we refer to TLV records as "being
included" rather than re-using the TLV name.

We even use subtypes for the pairs of checksums and timestamps.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-09-16 22:36:59 +02:00
sstone
fc44a58a93 BOLT7: query_channel_range: allow requesting timestamps & checksums (folded)
Nodes that support extended queries will append an additional extended query flag to
their `query_channel_range` queries. If the receiver supports extended queries and
understands this flag, it will append the required additional data to its
`reply_channel_range` message.

There is currently only one type of additional data: one timestamp and one checksum
per `channel_update`.
The checksum is a CRC32 checksum computed over the `channel_update`
with `timestamp` and `signature` omitted.

Along with query_short_channel_ids extension, this can be used to
avoid querying `channel_updates` that are older than the ones you
already have, or that are newer but don't include new information.
2019-09-16 22:36:59 +02:00
sstone
0b5ba0cd4e BOLT7: query_short_channel_ids: allow requesting specific information (folded)
Nodes can append additional data to their `query_short_channel_ids`
messages, which consists in one flag per short channel id and
specifies what they would like to receive (`node_announcement`,
`channel_announcement`, or/and one `channel_update` or both).
2019-09-16 22:36:59 +02:00
ueno
aba7a8fe46 BOLT7: channel_update after exchange funding_locked (#657)
If a node sends its own `channel_update` to a peer node before receiving a `funding_lock`, the peer node may discard because it has not `short_channel_id` yet.
2019-09-02 20:09:59 +00:00
Ugam Kamat
1810eaf4c8 BOLT #7: Correct indentation typo in channel_update message (#649) 2019-07-23 09:27:29 +02:00
ueno
11650d7ebe BOLT7: (announcement_signatures) Fail channel if short_channel_id not correct. (#635) 2019-07-23 09:25:59 +02:00
Conner Fromknecht
e9ad0fd6a4 BOLT07: correct gossip_timestamp_range to gossip_timstamp_filter (#648) 2019-07-19 09:30:49 +02:00
Ugam Kamat
1db481ffeb BOLT #7: receiving node requirements related to timestamp for channel_update message (#621)
Clarify timestamp requirements for channel_update messages.
2019-07-16 09:24:26 +02:00
Hiroki Gondo
ea588805c7 BOLT 7: move the rational of short_channel_id to the definition (#636) 2019-07-11 09:33:42 +02:00
Rusty Russell
6f6ea63233 BOLT 1,2,4,7: remove pubkey fundamental type in favor of point.
And remove `secret` and `preimage` types in favor of open-coding.

Agreed-at: http://www.erisian.com.au/meetbot/lightning-dev/2019/lightning-dev.2019-07-08-20.05.html

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-07-09 00:48:46 +00:00
Rusty Russell
6639cef095 Spec: use explicit types, not just bytelengths for fields.
It's trivial to make types->lengths, but not so much the other way.

The types I used here are the ones I found useful in implementation, and
I think add some clarity, though we can certainly argue about them.

There's no normative changes to the spec in here.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-07-09 00:48:46 +00:00
Hiroki Gondo
f47e7e50f3 BOLT 7: fix the requirements of channel_update. 2019-01-07 19:47:24 +00:00
Hiroki Gondo
32d0c65063 BOLT 7: fix hashed data range in the node_announcement.
currently the `alias` is not the last field.
2019-01-07 19:40:35 +00:00
Hiroki Gondo
971ee2ade9 BOLT 7: delete duplicate line. 2019-01-07 20:18:19 +01:00
Rusty Russell
4c12ae8a27 BOLT #7: don't accidentially wumbo the channel_update.
Reported-by: @roasbeef
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-11-29 04:25:04 +00:00
Rusty Russell
3b4165d12a fixup! BOLT 7: Push the sending of announcements_signatures back a little 2018-11-29 04:15:54 +00:00
Matt Corallo
d093c5e50c BOLT 7: Push the sending of announcements_signatures back a little
Technically this change may result in channels_announcements only
coming from one end. However, because c-lightning already implements
announcement_signatures in this way, in practice this will improve
reliability of channel_announcements.

[ After much bikeshedding, wording rewritten but same effect -- RR ]

Closes #468
Closes: #474
2018-11-29 04:15:54 +00:00
ZmnSCPxj
67b96de4ec 07-routing-gossip.md: Describe standard human-readable format for short channel ID. 2018-11-27 00:05:16 +08:00
lisa neigut
57dad8161b routing gossip: remove fixup statement
per rusty, this is left over from a previous editing
pass and can be removed.
2018-10-29 00:17:36 +00:00
lisa neigut
5a1dafb67f routing gossip: fixup final/endpoint nomenclature weirdness
'final' and 'endpoint' node don't make much sense out of
context of a payment (in the former case) or when referring to
a non-channel party node. this fixes this
2018-10-29 00:17:36 +00:00
lisa neigut
b4be990550 routing gossip: attempt to make timestamping mechanism for
channel_announcement clearer
2018-10-29 00:17:36 +00:00
lisa neigut
bae8f9c2c6 routing gossip: remove errant tick 2018-10-29 00:17:36 +00:00
lisa neigut
35cee93cee routing gossip: make channel_update singular 2018-10-29 00:17:36 +00:00
lisa neigut
74167366bb routing gossip, query message: attempt to clarify description of
`query_short_channel_ids`
2018-10-29 00:17:36 +00:00
lisa neigut
d88e58db90 routing gossip: add missing 'a' 2018-10-29 00:17:36 +00:00
lisa neigut
772e8b854a routing gossip: specify where gossip_queries is flagged on 2018-10-29 00:17:36 +00:00
lisa neigut
7d2c4d5542 routing gossip: re-order initial sync & rebroadcast so it matches table of contents 2018-10-29 00:17:36 +00:00
lisa neigut
b73c77ffe9 routing gosisp: use semi-colon, not colon 2018-10-29 00:17:36 +00:00
lisa neigut
1c6a00778e routing gossip: have Initial Sync be in present tense 2018-10-29 00:17:36 +00:00
lisa neigut
2427bdca7b routing-gossip: add clarifying statement to Initial Sync section
The Initial Sync section is hard to parse, as is, because it's presented
without context. This adds a small clarifying statement, in particular
highlighting where the mode is triggered from (init message features)
and what in particular is being synced (gossip messages)
2018-10-29 00:17:36 +00:00
lisa neigut
620b033dd6 routing gossip: clarify what 'redundant' means 2018-10-29 00:17:36 +00:00
lisa neigut
80eed319ab gossip: add additional clarification for 'discard'
It's unclear what it means to `discard` a channel.
This add a clarification that it's related to route-finding.
2018-10-18 05:17:26 +00:00
Matt Corallo
8516beb2c4 Remove padding within node_announcement address data
This optional padding makes it very difficulty to deserialize
node_announcements into internal structs for storage and then
reconstruct the original node_announcement, plus are unused on the
network today and no known implementations construct
node_announcement messages with them.
2018-09-17 19:44:11 +00:00
Matt Corallo
2b253f7a61 Correct fee calculation in BOLT 7
The fee calculation in BOLT 7 appears to imply that proprtional
fees must be paid on the incoming amount, not the to_forward amount

This is inconsistent with what is actually implemented in the
field (which uses amount_to_forward) and also would make
pathfinding more complicated as the fee would depend on itself,
making calculation no longer simple.
2018-09-04 00:38:40 +00:00
Rusty Russell
0bb2739133 BOLT 7: advise against spamming with channel_updates.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-08-24 23:42:56 +02:00
Rusty Russell
b6ae60d241 BOLT 7: add maximum capacity field.
This helps lite nodes a little, but also gives a way of advertising a
lesser capacity than implied onchain.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-08-24 23:42:56 +02:00
Rusty Russell
0891374d47 BOLT 7: split flags field in channel_update.
This is not a semantic change: only the lower two bits were defined.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-08-24 23:42:56 +02:00
ueno
3f2c747955 fix typos 2018-08-07 00:07:42 +00:00
Hajime Yamaguchi
a9195a84d0 BOLT 3/BOLT 7: Fix broken links. 2018-08-07 00:07:26 +00:00
Rusty Russell
fd9da9b95e BOLT 7: Add compressed (zlib) encoding.
[ Note: in retrospect, adding this in the initial draft without its
  own feature bit was a mistake.  It was a premature optimization,
  adds complexity and removes the ability to disable it if a problem
  is found without disabling gossip_queries entirely.  However, it
  is already deployed as-is. --RR ]
  
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-06-28 00:21:23 +00:00
Rusty Russell
f6312d9a70 BOLT 7: query_messages option.
[ This was a joint effort by many people, with iterations not
  indicated in this final commit: thanks to all who reviewed and
  polished!  Particularly: @jimpo @cdecker @sstone @ZmnSCPxj ]

This enables three new functions:

1. query_short_channel_ids: they will send channel_announcement /
   channel_update / node_announcement followed by reply_short_channel_ids_done.
2. query_channel_range: they will send one or more reply_channel_range
   with the short_channel_ids in these blocks.
3. gossip_timestamp_filter: filters what gossip they send.

It also changes behavior: we no longer send a `channel_announcement`
until we have at least one `channel_update`.  The announcement is
fairly useless without an update already, but this in particular
enables reasonable timestamp filtering (channel_announcement does not
have an explicit timestamp).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-06-28 00:21:23 +00:00
Rusty Russell
aab92b15b7 BOLT #7: introduce term "gossip messages" to refer to channel_announcement/channel_update/node_announcement.
This makes discussing them simpler for the next patch.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-06-28 00:21:23 +00:00
ueno
f5f123c02c BOLT 0: fix ordering of chain_hash 2018-04-16 13:25:30 -07:00