From a5554f830818052060ceb62bc8d4b42b8074bf15 Mon Sep 17 00:00:00 2001 From: Vincenzo Palazzo Date: Tue, 5 May 2026 19:43:52 +0200 Subject: [PATCH 1/3] fix: default message padding to false --- CHANGELOG.md | 4 ++-- doc/lightningd-config.5.md | 6 +++--- lightningd/lightningd.c | 9 +++++---- lightningd/options.c | 2 +- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 997852b8d432..1c9930ed89fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,8 +26,8 @@ This release is named by @Chand-ra. ### Added - - Protocol: we now pad all peer messages to make them the same length (excluding LND < v21 and current Eclair). ([#8893], [#9022]) - - Config: `message-padding` option can be set to `false` to disable it for all peers. ([#9068]) + - Protocol: peer message padding can make messages uniform length, but is disabled by default for compatibility. ([#8893], [#9022]) + - Config: `message-padding=true` enables peer message padding for all peers. ([#9068]) - JSON-RPC: `bkpr-report` allows flexible summaries of bookkeeper income. ([#8937]) - Config: `bkpr-currency` option to record conversion rate at each bookkeeper event. ([#8937]) - JSON-RPC: `currencyconvert` and `currencyrate` via the new plugin `cln-currencyrate` ([#8842], [#8937]) diff --git a/doc/lightningd-config.5.md b/doc/lightningd-config.5.md index e85a1a19ce26..cd2f2f8be9d1 100644 --- a/doc/lightningd-config.5.md +++ b/doc/lightningd-config.5.md @@ -709,9 +709,9 @@ all DNS lookups, to avoid leaking information. * **message-padding**=*BOOL* - Normally `connectd` will send extra bytes to peers to make messages -uniform length. Some implementations don't accept these extra bytes: -if we can't detect them, this option sets to `false` will disable it. + If `message-padding=true`, connectd will send extra bytes to peers to make +messages uniform length. This defaults to false because some deployed +implementations reject the no-reply pings used for padding. * **tor-service-password**=*PASSWORD* diff --git a/lightningd/lightningd.c b/lightningd/lightningd.c index 3e21caa69482..5923fca51ef7 100644 --- a/lightningd/lightningd.c +++ b/lightningd/lightningd.c @@ -373,10 +373,11 @@ static struct lightningd *new_lightningd(const tal_t *ctx) ld->fronting_nodes = tal_arr(ld, struct node_id, 0); - /*~ connectd usually uses "no-reply" pings to fill out messages - * where needed to make them uniform length. Some implementations - * don't like it, so it can be disabled. */ - ld->message_padding = true; + /*~ connectd can use "no-reply" pings to fill out messages where needed + * to make them uniform length. Deployed implementations can reject those + * pings, so default to compatibility; operators can opt in with + * --message-padding=true. */ + ld->message_padding = false; return ld; } diff --git a/lightningd/options.c b/lightningd/options.c index b724b200a089..11636d1e0478 100644 --- a/lightningd/options.c +++ b/lightningd/options.c @@ -1671,7 +1671,7 @@ static void register_opts(struct lightningd *ld) clnopt_witharg("--message-padding", OPT_SHOWBOOL, opt_set_bool_arg, opt_show_bool, &ld->message_padding, - "If true (the default), pad all messages to peers to make them equal length"); + "If true, pad messages to peers to make them equal length (default: false)"); dev_register_opts(ld); } From b52bea4dfda17fec5522e59692ff6c67f92d1114 Mon Sep 17 00:00:00 2001 From: Vincenzo Palazzo Date: Tue, 5 May 2026 19:46:57 +0200 Subject: [PATCH 2/3] chore: add changelog metadata Changelog-Changed: message-padding defaults to false for compatibility. From 7a10523369de1bff13da962ec603ce331e285359 Mon Sep 17 00:00:00 2001 From: Vincenzo Palazzo Date: Tue, 5 May 2026 20:05:55 +0200 Subject: [PATCH 3/3] fix: avoid generated grpc files in source checks --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 61c86087a645..72df38ac9ad9 100644 --- a/Makefile +++ b/Makefile @@ -584,8 +584,8 @@ LOCAL_BOLTDIR=.tmp.lightningrfc bolt-precheck: @[ -d $(BOLTDIR) ] || exit 0; set -e; if [ -z "$(BOLTVERSION)" ]; then rm -rf $(LOCAL_BOLTDIR); ln -sf $(BOLTDIR) $(LOCAL_BOLTDIR); exit 0; fi; [ "$$(git -C $(LOCAL_BOLTDIR) rev-list --max-count=1 HEAD 2>/dev/null)" != "$(BOLTVERSION)" ] || exit 0; rm -rf $(LOCAL_BOLTDIR) && git clone -q $(BOLTDIR) $(LOCAL_BOLTDIR) && cd $(LOCAL_BOLTDIR) && git checkout -q $(BOLTVERSION) -PYSRC=$(shell git ls-files "*.py" | grep -v /text.py) -RUSTSRC=$(shell git ls-files "*.rs") +PYSRC=$(filter-out $(PYTHON_GENERATED),$(shell git ls-files "*.py" | grep -v /text.py)) +RUSTSRC=$(filter-out $(CLN_GRPC_GENALL),$(shell git ls-files "*.rs")) check-source-bolt: $(ALL_NONGEN_SRCFILES:%=bolt-check/%) $(PYSRC:%=bolt-check-py/%) $(RUSTSRC:%=bolt-check-rs/%)