← Back to Pull requests

multi: allow partial channel policy updates #11528

Closed
unknown closed this pull request without merging on Nov 14, 2026 03:40 UTC
View on GitHub
unknown unknown commented on Nov 06, 2026 01:49 UTC
Author

UpdateChannelPolicy can't tell an unset base_fee_msat, fee_rate/fee_rate_ppm or time_lock_delta from zero, so lncli updatechanpolicy requires all three on every call and its help shows a misleading (default: 0).

Design

Making these fields "unset means keep" by default would break existing clients. Proto3 doesn't put zero values on the wire, so today's request for a zero base fee looks the same as an omitted one. The change is therefore opt-in:

partial_update (new PartialPolicyUpdate message) has one bool each for base_fee_msat, fee_rate and time_lock_delta. When it is set, only the marked fields are applied and an unmarked field keeps its current value.
fee_rate covers fee_rate/fee_rate_ppm (both zero sets the rate to 0).
A marked time_lock_delta goes through the usual validation, so zero is rejected.
Without partial_update, behaviour is unchanged.
In a partial update, a non-zero value in an unmarked field is rejected instead of silently ignored.
With create_missing_edge, a recreated edge has no current value, so an unmarked field takes the default policy.

A separate message is used instead of proto3 optional, as suggested in https://github.com/lightningnetwork/lnd/pull/10499#issuecomment-3881539876, because optional would turn the generated Go fields into pointers and break lnrpc consumers such as lndclient at compile time.

lncli

updatechanpolicy always sends a partial update, so each field can be set on its own. The policy flags are now parsed explicitly, which drops (default: 0) from the help and rejects invalid input instead of treating it as zero.

Individual fields are set with the flags. Positional values are only accepted when all three fields are set, and an argument left over after the policy values and one channel point is an error.

An older lnd ignores partial_update. It still rejects a call without time_lock_delta, but a call with it and a missing fee field would reset that fee to 0. For that case lncli checks the lnd version via GetInfo first and refuses below 0.21.99.

Tests

Unit tests for the request conversion (including the legacy zero-value cases), the manager's kept fields and the CLI parsing.
New itest update_channel_policy_partial, which also checks over gRPC that a legacy request still applies a zero base fee.

Supersedes #10500, whose *_specified defaults would have kept existing clients' fee values unchanged.

Diff: 308 lines (+231 / -77) across 3 files Reviewer: saubyk Review duration: 11631m
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.40) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 308 lines diff across 3 files
0.40
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
56%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.343
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #11528"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 56.8% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 40.2% (MEDIUM) · Higher = larger blast radius
40.2%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 56.8% · Lower = rushed or shallow review
56.8%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 17.4% · Safe to merge
17.4%