lnd/peer
Olaoluwa Osuntokun 335b75981f lncfg+peer+server: add protocol.onion-msg-relay-all to bypass channel gate
Add a new protocol option, protocol.onion-msg-relay-all, that controls
whether incoming onion messages are required to come from peers with a
fully open channel. The default is false, which preserves the existing
behavior: the channel-presence gate drops messages from peers with no
channel before the rate limiters are consulted, so a new no-cost
identity cannot burn any per-peer byte budget and saturate the global
bucket. Setting the flag to true skips the gate so that onion messages
from any peer are admitted into the per-peer + global IngressLimiter
pipeline.

The flag is plumbed through ProtocolOptions in both the default and
integration build variants of lncfg/protocol*.go, threaded into the
peer subsystem as peer.Config.OnionRelayAll, and wired by the server
from s.cfg.ProtocolOptions.OnionMsgRelayAll alongside the existing
OnionLimiter field. allowOnionMessage gains a relayAll bool parameter;
the gate check becomes "if \!relayAll && \!hasChannel { drop }" so the
semantics of hasChannel stay pure — it still means "this peer has a
channel" — and the policy toggle lives entirely in the caller's
configuration rather than being spread across gate-state and flag
state.

sample-lnd.conf gains a commented-out entry for the new option with
the default value and an operator-facing note that enabling it trades
the Sybil-resistance property of the gate for reachability to peers
with whom we have no channel.

A new TestAllowOnionMessageRelayAll unit test exercises the four
(hasChannel, relayAll) combinations at the helper level, including
the key new behavior — a peer with hasChannel=false being rejected
under relayAll=false and admitted into the limiter under
relayAll=true — and the nil-limiter path under relayAll=true, which
must still accept. The existing allowOnionMessage tests were
extended with the new parameter set to false so they continue to
assert the gate semantics unchanged.
2026-04-15 13:23:50 -07:00
..
brontide.go lncfg+peer+server: add protocol.onion-msg-relay-all to bypass channel gate 2026-04-15 13:23:50 -07:00
brontide_test.go peer: gate onion message ingress on having an open channel 2026-04-15 13:23:50 -07:00
chan_observer.go peer: fix MarkCoopBroadcasted to correctly use local parameter 2026-02-02 12:16:29 +01:00
daemon_adapters.go peer: conditionally create rbf coop close fsm based on feature bits 2025-03-18 11:44:20 -05:00
interfaces.go peer+lnwire: move LinkUpdater to lnwire 2024-03-06 11:59:19 -08:00
log.go multi: start updating various loggers to use the new v2 type 2024-10-22 17:03:55 +02:00
musig_chan_closer.go multi: add custom nonce rand support to MuSig2 sessions 2026-04-13 12:21:42 -07:00
musig_nonce_order_test.go lnwallet/chancloser: address lint and PR review feedback 2026-03-27 14:04:25 -07:00
onion_ratelimit.go lncfg+peer+server: add protocol.onion-msg-relay-all to bypass channel gate 2026-04-15 13:23:50 -07:00
onion_ratelimit_log_test.go peer: gate onion message ingress on having an open channel 2026-04-15 13:23:50 -07:00
onion_ratelimit_test.go lncfg+peer+server: add protocol.onion-msg-relay-all to bypass channel gate 2026-04-15 13:23:50 -07:00
ping_manager.go peer+lnd: add new CLI option to control if we D/C on slow pongs 2025-05-15 16:36:38 +02:00
ping_manager_test.go peer+lnd: add new CLI option to control if we D/C on slow pongs 2025-05-15 16:36:38 +02:00
setup_test.go multi: use MakeTestGraph everywhere for test graph creation 2025-05-22 14:14:42 +02:00
test_utils.go peer: add mock BestBlockView to test peer config 2026-03-24 11:49:48 +02:00