Skip to content

waved: allow notls/no-macaroons on mainnet behind an opt-in flag - #998

Merged
Roasbeef merged 1 commit into
mainfrom
mainnet-insecure-override
Jul 20, 2026
Merged

waved: allow notls/no-macaroons on mainnet behind an opt-in flag#998
Roasbeef merged 1 commit into
mainfrom
mainnet-insecure-override

Conversation

@Roasbeef

Copy link
Copy Markdown
Member

Motivation

The mainnet instance currently can't start with --rpc.notls and
--rpc.no-macaroons. validateRPCSecurity refuses both on mainnet TCP
listeners so that a stray flag can't silently expose an unauthenticated,
plaintext RPC surface on real funds.

That guard assumes the daemon terminates its own transport security. It
isn't true for our release deployment, where waved sits behind a proxy
that terminates TLS and enforces authentication before any traffic
reaches the listener. For that topology the guard is a false positive
that blocks startup outright. The rationale for external TLS termination
is tracked in the lightning-infra issue.

This PR

Adds an --allow-insecure-mainnet opt-in that lifts the mainnet-TCP
refusal for both rpc.notls and rpc.no-macaroons:

  • Off by default — the guard still stands for anyone who hasn't
    deliberately opted out. This mirrors the existing --allow-mainnet
    safety-flag pattern.
  • When set — both options are permitted on mainnet TCP listeners,
    and the refusal error now names the flag so an operator who hits it
    knows the escape hatch exists.

Testing

TestConfigValidateMainnetInsecureRPC covers the matrix: each option
refused by default, and each (plus both together) accepted once the
override is set.

Companion

Paired with the server-side change in lumos, which adds the same
--allow-insecure-mainnet opt-in for its client and admin RPC guards.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the allow-insecure-mainnet configuration option and CLI flag, which permits running mainnet TCP listeners without TLS or macaroons when transport security is handled externally. It updates the validation logic to respect this override and adds corresponding unit tests to verify the behavior. I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

The daemon refuses rpc.notls and rpc.no-macaroons on mainnet TCP
listeners so a stray flag can't silently stand up an unauthenticated,
plaintext RPC surface on real funds. That guard assumes the daemon
terminates its own transport security, which isn't true for deployments
that front waved with a proxy that terminates TLS and enforces auth
before traffic ever reaches the listener. For those operators the guard
is a false positive that blocks startup outright.

In this commit, we add an allow-insecure-mainnet escape hatch. The flag
is off by default, so the guard still stands for everyone who hasn't
deliberately opted out; when set, it lifts the mainnet-TCP refusal for
both options. The lightning-infra tracking issue carries the rationale
for why external TLS termination is the deployment model here.
@Roasbeef
Roasbeef force-pushed the mainnet-insecure-override branch from 26e38d4 to 6b4cf14 Compare July 20, 2026 17:59
@Roasbeef Roasbeef added the backport-v0.1.x-branch Backport this merged PR to v0.1.x-branch label Jul 20, 2026
@Roasbeef
Roasbeef merged commit 0445c93 into main Jul 20, 2026
20 checks passed
@github-actions

Copy link
Copy Markdown

Successfully created backport PR for v0.1.x-branch:

Roasbeef added a commit that referenced this pull request Jul 20, 2026
[v0.1.x-branch] Backport #998: waved: allow notls/no-macaroons on mainnet behind an opt-in flag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-v0.1.x-branch Backport this merged PR to v0.1.x-branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant