From 84eacaee26a62a5f0e503ccea90364e204d39e7d Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 10 Sep 2018 13:59:12 +0200 Subject: [PATCH 1/6] ping: First parameter is called 'id' not 'peerid', fix help The first argument of 'ping' was documented as 'peerid', however internally it is expected to be just 'id'. To avoid breaking the API, opt to fix the documentation. --- lightningd/ping.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lightningd/ping.c b/lightningd/ping.c index 3b7168a9bcd7..c533e96b096b 100644 --- a/lightningd/ping.c +++ b/lightningd/ping.c @@ -86,6 +86,6 @@ static void json_ping(struct command *cmd, static const struct json_command ping_command = { "ping", json_ping, - "Send {peerid} a ping of length {len} (default 128) asking for {pongbytes} (default 128)" + "Send peer {id} a ping of length {len} (default 128) asking for {pongbytes} (default 128)" }; AUTODATA(json_command, &ping_command); From cbac5ff19e21104f5a28bdee4c48ec16afad74d4 Mon Sep 17 00:00:00 2001 From: lisa neigut Date: Tue, 11 Sep 2018 13:54:29 -0700 Subject: [PATCH 2/6] ping: fix documentation in all remaining places {peerid} -> peer {id} --- lightningd/gossip_control.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lightningd/gossip_control.c b/lightningd/gossip_control.c index 1a9a01eccc8e..f75de7001807 100644 --- a/lightningd/gossip_control.c +++ b/lightningd/gossip_control.c @@ -457,7 +457,7 @@ static void json_dev_query_scids(struct command *cmd, static const struct json_command dev_query_scids_command = { "dev-query-scids", json_dev_query_scids, - "Query {peerid} for [scids]" + "Query peer {id} for [scids]" }; AUTODATA(json_command, &dev_query_scids_command); @@ -487,7 +487,7 @@ static void json_dev_send_timestamp_filter(struct command *cmd, static const struct json_command dev_send_timestamp_filter = { "dev-send-timestamp-filter", json_dev_send_timestamp_filter, - "Send {peerid} the timestamp filter {first} {range}" + "Send peer {id} the timestamp filter {first} {range}" }; AUTODATA(json_command, &dev_send_timestamp_filter); @@ -554,7 +554,7 @@ static void json_dev_query_channel_range(struct command *cmd, static const struct json_command dev_query_channel_range_command = { "dev-query-channel-range", json_dev_query_channel_range, - "Query {peerid} for short_channel_ids for {first} block + {num} blocks" + "Query peer {id} for short_channel_ids for {first} block + {num} blocks" }; AUTODATA(json_command, &dev_query_channel_range_command); From fdf67d62ba0e998abe35d32cc5b777fd2864fd3a Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 12 Sep 2018 09:14:28 +0930 Subject: [PATCH 3/6] CHANGELOG.md: update for 0.6.1 final. Signed-off-by: Rusty Russell --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0be26d6763eb..0e35234c1341 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). -## [0.6.1-rc1] - 2018-08-25: "Principled Opposition To Segwit" +## [0.6.1] - 2018-09-11: "Principled Opposition To Segwit" This release named by ZmnSCPxj. @@ -133,8 +133,8 @@ There predate the BOLT specifications, and are only of vague historic interest: 6. [0.5.1] - 2016-10-21 7. [0.5.2] - 2016-11-21: "Bitcoin Savings & Trust Daily Interest II" -[Unreleased]: https://github.com/ElementsProject/lightning/compare/v0.6...HEAD -[0.6.1-rc1]: https://github.com/ElementsProject/lightning/releases/tag/v0.6.1-rc1 +[Unreleased]: https://github.com/ElementsProject/lightning/compare/v0.6.1...HEAD +[0.6.1]: https://github.com/ElementsProject/lightning/releases/tag/v0.6.1 [0.6]: https://github.com/ElementsProject/lightning/releases/tag/v0.6 [0.5.2]: https://github.com/ElementsProject/lightning/releases/tag/v0.5.2-2016-11-21 [0.5.1]: https://github.com/ElementsProject/lightning/releases/tag/v0.5.1-2016-10-21 From fc02af12d03f8a829c3d3c996880faf72f603bf0 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 14 Sep 2018 08:13:12 +0930 Subject: [PATCH 4/6] wire: add onion_defs.h to bolt-check, update quote. Signed-off-by: Rusty Russell --- wire/Makefile | 3 ++- wire/onion_defs.h | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/wire/Makefile b/wire/Makefile index 35c7277e3020..86c7d88c06c0 100644 --- a/wire/Makefile +++ b/wire/Makefile @@ -4,7 +4,8 @@ wire-wrongdir: $(MAKE) -C .. wire-all -WIRE_HEADERS_NOGEN := wire/peer_wire.h \ +WIRE_HEADERS_NOGEN := wire/onion_defs.h \ + wire/peer_wire.h \ wire/wire.h \ wire/wire_sync.h \ wire/wire_io.h diff --git a/wire/onion_defs.h b/wire/onion_defs.h index 2902e8714983..3f1b9c614473 100644 --- a/wire/onion_defs.h +++ b/wire/onion_defs.h @@ -1,11 +1,12 @@ /* Macro definitions for constants used in BOLT #4 */ #ifndef LIGHTNING_WIRE_ONION_DEFS_H #define LIGHTNING_WIRE_ONION_DEFS_H +#include "config.h" /* BOLT #4: * - * The top byte of `failure-code` can be read as a set of flags: - * * 0x8000 (BADONION): unparsable onion, encrypted by previous node. + * The top byte of `failure_code` can be read as a set of flags: + * * 0x8000 (BADONION): unparsable onion encrypted by sending peer * * 0x4000 (PERM): permanent failure (otherwise transient) * * 0x2000 (NODE): node failure (otherwise channel) * * 0x1000 (UPDATE): new channel update enclosed From e8a7a7addbda182d65289c1b18868b94f2e7e008 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 14 Sep 2018 08:29:22 +0930 Subject: [PATCH 5/6] wire/Makefile: generate CSVs from specs based on BOLTVERSION. Not whatever happens to be lying around! Signed-off-by: Rusty Russell --- Makefile | 4 +++- wire/Makefile | 13 ++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 4ad9274a2e7e..f2324f8d2eb2 100644 --- a/Makefile +++ b/Makefile @@ -240,8 +240,10 @@ check-makefile: bolt-check/%: % bolt-precheck tools/check-bolt @[ ! -d .tmp.lightningrfc ] || tools/check-bolt .tmp.lightningrfc $< +LOCAL_BOLTDIR=.tmp.lightningrfc + bolt-precheck: - @rm -rf .tmp.lightningrfc; if [ ! -d $(BOLTDIR) ]; then echo Not checking BOLT references: BOLTDIR $(BOLTDIR) does not exist >&2; exit 0; fi; set -e; if [ -n "$(BOLTVERSION)" ]; then git clone -q $(BOLTDIR) .tmp.lightningrfc && cd .tmp.lightningrfc && git checkout -q $(BOLTVERSION); else cp -a $(BOLTDIR) .tmp.lightningrfc; fi + @rm -rf $(LOCAL_BOLTDIR); if [ ! -d $(BOLTDIR) ]; then echo Not checking BOLTs: BOLTDIR $(BOLTDIR) does not exist >&2; exit 0; fi; set -e; if [ -n "$(BOLTVERSION)" ]; then git clone -q $(BOLTDIR) $(LOCAL_BOLTDIR) && cd $(LOCAL_BOLTDIR) && git checkout -q $(BOLTVERSION); else cp -a $(BOLTDIR) $(LOCAL_BOLTDIR); fi check-source-bolt: $(ALL_TEST_PROGRAMS:%=bolt-check/%.c) diff --git a/wire/Makefile b/wire/Makefile index 86c7d88c06c0..ba939f64365a 100644 --- a/wire/Makefile +++ b/wire/Makefile @@ -26,12 +26,15 @@ ALL_OBJS += $(WIRE_OBJS) $(WIRE_ONION_OBJS) ALL_GEN_HEADERS += $(WIRE_GEN_HEADERS) # They may not have the bolts. -BOLT_EXTRACT=$(BOLTDIR)/tools/extract-formats.py -wire/gen_peer_wire_csv: FORCE - @set -e; if [ -f $(BOLT_EXTRACT) ]; then for f in $(BOLTDIR)/0[127]*.md $(BOLT_EXTRACT); do if [ $$f -nt $@ -o ! -f $@ ]; then $(BOLT_EXTRACT) --message-fields --message-types $(BOLTDIR)/0[127]*.md > $@; break; fi; done; fi +BOLT_EXTRACT=$(LOCAL_BOLTDIR)/tools/extract-formats.py -wire/gen_onion_wire_csv: FORCE - @set -e; if [ -f $(BOLT_EXTRACT) ]; then for f in $(BOLTDIR)/04*.md $(BOLT_EXTRACT); do if [ $$f -nt $@ -o ! -f $@ ]; then echo '#include ' > $@ && $(BOLT_EXTRACT) --message-fields --message-types $(BOLTDIR)/04*.md >> $@; break; fi; done; fi +ifeq ($(DEVELOPER),1) +wire/gen_peer_wire_csv: bolt-precheck + @set -e; if [ -d $(LOCAL_BOLTDIR) ]; then for f in $(LOCAL_BOLTDIR)/0[127]*.md $(BOLT_EXTRACT); do if [ $$f -nt $@ -o ! -f $@ ]; then $(BOLT_EXTRACT) --message-fields --message-types $(LOCAL_BOLTDIR)/0[127]*.md > $@; break; fi; done; fi + +wire/gen_onion_wire_csv: bolt-precheck + @set -e; if [ -f $(BOLT_EXTRACT) ]; then for f in $(LOCAL_BOLTDIR)/04*.md $(BOLT_EXTRACT); do if [ $$f -nt $@ -o ! -f $@ ]; then echo '#include ' > $@ && $(BOLT_EXTRACT) --message-fields --message-types $(LOCAL_BOLTDIR)/04*.md >> $@; break; fi; done; fi +endif wire/gen_peer_wire.h: $(WIRE_GEN) wire/gen_peer_wire_csv $(WIRE_GEN) --bolt --header $@ wire_type < wire/gen_peer_wire_csv > $@ From 10167eedd23b461b6da8347b8a6e3c2809a6271c Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 14 Sep 2018 08:29:40 +0930 Subject: [PATCH 6/6] wire/gen_peer_wire: Update to BOLTVERSION. Signed-off-by: Rusty Russell --- wire/gen_peer_wire_csv | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wire/gen_peer_wire_csv b/wire/gen_peer_wire_csv index 5c6e81450a2e..0e07d96131aa 100644 --- a/wire/gen_peer_wire_csv +++ b/wire/gen_peer_wire_csv @@ -34,6 +34,7 @@ open_channel,252,htlc_basepoint,33 open_channel,285,first_per_commitment_point,33 open_channel,318,channel_flags,1 open_channel,319,shutdown_len,2,option_upfront_shutdown_script +open_channel,321,shutdown_scriptpubkey,shutdown_len,option_upfront_shutdown_script accept_channel,33 accept_channel,0,temporary_channel_id,32 accept_channel,32,dust_limit_satoshis,8 @@ -50,6 +51,7 @@ accept_channel,171,delayed_payment_basepoint,33 accept_channel,204,htlc_basepoint,33 accept_channel,237,first_per_commitment_point,33 accept_channel,270,shutdown_len,2,option_upfront_shutdown_script +accept_channel,272,shutdown_scriptpubkey,shutdown_len,option_upfront_shutdown_script funding_created,34 funding_created,0,temporary_channel_id,32 funding_created,32,funding_txid,32 @@ -106,8 +108,8 @@ channel_reestablish,136 channel_reestablish,0,channel_id,32 channel_reestablish,32,next_local_commitment_number,8 channel_reestablish,40,next_remote_revocation_number,8 -channel_reestablish,48,your_last_per_commitment_secret,32,option-data-loss-protect -channel_reestablish,80,my_current_per_commitment_point,33,option-data-loss-protect +channel_reestablish,48,your_last_per_commitment_secret,32,option_data_loss_protect +channel_reestablish,80,my_current_per_commitment_point,33,option_data_loss_protect announcement_signatures,259 announcement_signatures,0,channel_id,32 announcement_signatures,32,short_channel_id,8