Skip to content

Commit b06db3f

Browse files
committed
BOLTs: catchup with "Drop the required channel_update in failure onions".
Not much difference for us. Signed-off-by: Rusty Russell <[email protected]>
1 parent 8f0ff20 commit b06db3f

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ CCANDIR := ccan
2626

2727
# Where we keep the BOLT RFCs
2828
BOLTDIR := ../bolts/
29-
DEFAULT_BOLTVERSION := 5dd9d9cd5fa9bc928c0fd47602ee84b7a15822a9
29+
DEFAULT_BOLTVERSION := 93b7ee031b50acd59967a105f1326176a37628f9
3030
# Can be overridden on cmdline.
3131
BOLTVERSION := $(DEFAULT_BOLTVERSION)
3232

lightningd/peer_htlcs.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,18 @@ static void rcvd_htlc_reply(struct subd *subd, const u8 *msg, const int *fds UNU
525525
}
526526

527527
if (tal_count(failmsg)) {
528-
/* It's our job to append the channel_update */
528+
/* BOLT #4:
529+
* The `channel_update` field used to be mandatory in messages
530+
* whose `failure_code` includes the `UPDATE` flag. However,
531+
* because nodes applying an update contained in the onion to
532+
* their gossip data is a massive fingerprinting
533+
* vulnerability, the `channel_update` field is no longer
534+
* mandatory and nodes are expected to transition away from
535+
* including it. Nodes which do not provide a `channel_update`
536+
* are expected to set the `channel_update` `len` field to
537+
* zero.
538+
*/
539+
/* We still append the channel_update (if we have one!) FIXME: provide an option? */
529540
if (fromwire_peektype(failmsg) & UPDATE) {
530541
const u8 *update = channel_update_for_error(tmpctx, hout->key.channel);
531542
towire(&failmsg, update, tal_bytelen(update));

wire/onion_defs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* * 0x8000 (BADONION): unparsable onion encrypted by sending peer
1111
* * 0x4000 (PERM): permanent failure (otherwise transient)
1212
* * 0x2000 (NODE): node failure (otherwise channel)
13-
* * 0x1000 (UPDATE): new channel update enclosed
13+
* * 0x1000 (UPDATE): channel forwarding parameter was violated
1414
*/
1515
#define BADONION 0x8000
1616
#define PERM 0x4000

0 commit comments

Comments
 (0)