lsps-plugin: add cln-lsps-policy plugin for LSPS2 fee policy management#9349
Open
Andezion wants to merge 1 commit into
Open
lsps-plugin: add cln-lsps-policy plugin for LSPS2 fee policy management#9349Andezion wants to merge 1 commit into
Andezion wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cln-lsps-servicecalls out to two internal RPC methods to make LSPS2 policydecisions -
lsps2-policy-getpolicyandlsps2-policy-getchannelcapacity-but no plugin in the repo registers them, so the service can't run standalone
This adds a new
cln-lsps-policybinary that implements both:lsps2-policy-getpolicy- returns the LSP's fee parameter menu(
Lsps2PolicyGetInfoResponse), built from configurable CLN options.lsps2-policy-getchannelcapacity- returns the channel capacity to openfor a given JIT-channel buy request (
Lsps2PolicyGetChannelCapacityResponse)All policy knods are exposed as plugin options with sensible defaults, so an
LSP operator can tune fees/limits without touching code:
lsps2-policy-min-fee-msatlsps2-policy-proportional-ppmlsps2-policy-valid-until-hourslsps2-policy-min-lifetimelsps2-policy-max-client-to-self-delaylsps2-policy-min-payment-size-msatlsps2-policy-max-payment-size-msatlsps2-policy-channel-capacity-msatValues are validated at startup (non-negative,
max > min, ppm in[0, 1_000_000]) so misconfiguration fails fast instead of silentlyproducing bad fee params
Test plan
cargo build- all three binaries (cln-lsps-client,cln-lsps-service,cln-lsps-policy) compile cleanlycargo test- 84 passed, 0 failed (no regressions in existinglsps-plugin test suite)
cln-lsps-service+cln-lsps-policytogether against a client and confirm
lsps2.get_info/lsps2.buysucceedImportant
26.06 FREEZE April 30th: Non-bugfix PRs not ready by this date will wait for 26.09.
RC1 is scheduled on May 14th
The final release is scheduled for June 1st.
Checklist
Before submitting the PR, ensure the following tasks are completed. If an item is not applicable to your PR, please mark it as checked:
tools/lightning-downgradeChangelog-None