Follow-up of #8754: Harden remote signing no op #11292
🔴 PR Severity: CRITICAL
files API | 3 files | 213 lines changed
<details>
<summary>🔴 <strong>Critical</strong> (1 file)</summary>
lnwallet/rpcwallet/remote_signer_client_builder.go - lnwallet/ wallet/signing code; builds the remote signer client and governs no-op remote signer behavior</details>
<details>
<summary>🟡 <strong>Medium</strong> (1 file)</summary>
lncfg/remotesigner.go - lncfg/ configuration for the remote signer feature</details>
<details>
<summary>🟢 <strong>Low</strong> (1 file)</summary>
lnwallet/rpcwallet/remote_signer_client_test.go - test-only change</details>
Analysis
The highest-severity file touched is lnwallet/rpcwallet/remote_signer_client_builder.go, which falls under lnwallet/* (wallet operations/signing) and is classified CRITICAL. This PR hardens remote-signing logic to prevent silently creating a no-op remote signer when the node is configured as an outbound remote signer — a correctness issue in signing configuration that warrants expert review. File/line counts are well under the bump thresholds, so no further escalation applies.
---
<sub>To override, add a severity-override-{critical,high,medium,low} label.</sub>
<!-- pr-severity-bot -->
Nit: Consider adding a nil check to (w *WatchOnlyNode) IsSignerNode():
func (w *WatchOnlyNode) IsSignerNode() bool {
if w == nil {
return false
}
return w.ExperimentalEnable
}
While cfg.WatchOnlyNode is initialized in DefaultConfig(),guarding the receiver avoids a panic if WatchOnlyNode is ever left uninitialized or passed as nil in tests/callers.
Noticed one remaining call site in config.go that still reads ExperimentalEnable directly:
Could be nice to update that to cfg.WatchOnlyNode.IsSignerNode() as well to fully route all callers through the new helper.
@viktort-11, remember to re-request review from reviewers when ready
@viktort-11, remember to re-request review from reviewers when ready
@viktort-11, remember to re-request review from reviewers when ready
@viktort-11, remember to re-request review from reviewers when ready
i dont think that's needed
this should be make build with-rpc=1. rpc=1 isn't read by the Makefile, so following this command still produces a binary without the required subservers. also update the assertion in TestRemoteSignerClientBuilderErrorNamesBuildInstructions.
nit: can we use a sentinel error and require.ErrorIs here? the failure cases currently depend only on the diagnostic wording. wrap the sentinel in Build and check its identity here, keeping the substring checks for the missing tags and rebuild instructions.
One doc issue and one nit, otherwise good to go!
Point 7 of #10705 also asks about signer-side dependencies being unavailable, not just missing sub-servers. From what I can tell addDeps already fails loudly if a sub-server cannot get its dependencies, so this builder was the only reachable silent no-op path. Is that your read as well? If so, could the PR description (or the closing comment on #10705) say so explicitly, so we can treat item 7 as fully closed rather than half done?
Nice that the error now tells the operator about the build tags at runtime. docs/remote-signing.md does not mention anywhere that signer mode (watchonlynode.experimentalenable) needs the signrpc and walletrpc tags, so someone building from source only learns this after unlocking the wallet and watching lnd exit. Would it make sense to add a short note in the outbound signer section of the doc as part of this PR?
Only a few observations from my end (aided with Claude)
Good catch! Addressed.
Yes, your assumption is correct, addDeps will error. I'll edit the issue, so that it mentions only the sub-servers.
Added a paragraph for this in the docs/remote-signing.md doc 👍
Thanks for the reviews! I've addressed your feedback :pray:
LGTM!
Ack
Rebased on master
Rebased on mater again
yyforyongyu
ViktorT-11
This is a follow-up of #8754 tracked at #10705.
This PR resolves point 7 of the follow-up comment, and ensures that we never create a no-op remote signer in case the node is configured to act as an outbound remote signer:
https://github.com/lightningnetwork/lnd/issues/10705#issuecomment-4932249182