multi: allow partial channel policy updates #11528
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
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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
saubyk
UpdateChannelPolicycan't tell an unsetbase_fee_msat,fee_rate/fee_rate_ppmortime_lock_deltafrom zero, solncli updatechanpolicyrequires 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(newPartialPolicyUpdatemessage) has one bool each forbase_fee_msat,fee_rateandtime_lock_delta. When it is set, only the marked fields are applied and an unmarked field keeps its current value.fee_ratecoversfee_rate/fee_rate_ppm(both zero sets the rate to 0).A marked
time_lock_deltagoes 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, becauseoptionalwould turn the generated Go fields into pointers and break lnrpc consumers such as lndclient at compile time.lncli
updatechanpolicyalways 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 withouttime_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 viaGetInfofirst 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
*_specifieddefaults would have kept existing clients' fee values unchanged.