lsp_plugin: rename cmds and opts to fit convention
What changed, and why it matters
This commit simply renames configuration options and internal command names in the LSPS (Lightning Service Provider Specification) plugin to follow the project's naming convention. 'dev-' prefixed names are changed to 'experimental-' prefixes, and some internal RPC command names are updated. There is no security fix or vulnerability here—it's a cleanup and consistency change.
No security action needed. This is a non-security refactoring commit. Reviewers may verify that all references to the old option/command names have been updated consistently across documentation and other plugins.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit renames developer/undocumented options from ‘dev-’ to ‘experimental-’ to match Core Lightning’s convention where ‘experimental-’ is used for documented options and ‘dev-’ for undocumented ones. It also renames internal RPC commands in the lsps2 policy plugin from ‘dev-lsps2-getpolicy’/’dev-lsps2-getchannelcapacity’ to ‘lsps2-policy-getpolicy’/’lsps2-policy-getchannelcapacity’. Corresponding test files are updated to use the new names. No functional behavior changes.
Changed components
plugins/lsps-plugin/src/client.rsplugins/lsps-plugin/src/lsps2/handler.rsplugins/lsps-plugin/src/lsps2/mod.rstests/plugins/lsps2_policy.pytests/test_cln_lsps.pyInspect captured patch +37 / −35
diff --git a/plugins/lsps-plugin/src/client.rs b/plugins/lsps-plugin/src/client.rs
index 1037bf55..fafa36c4 100644
--- a/plugins/lsps-plugin/src/client.rs
+++ b/plugins/lsps-plugin/src/client.rs
@@ -30,7 +30,7 @@ use std::str::FromStr as _;
/// An option to enable this service.
const OPTION_ENABLED: options::FlagConfigOption = options::ConfigOption::new_flag(
- "dev-lsps-client-enabled",
+ "experimental-lsps-client",
"Enables an LSPS client on the node.",
);
diff --git a/plugins/lsps-plugin/src/lsps2/handler.rs b/plugins/lsps-plugin/src/lsps2/handler.rs
index 4b2d4f84..c8e7168a 100644
--- a/plugins/lsps-plugin/src/lsps2/handler.rs
+++ b/plugins/lsps-plugin/src/lsps2/handler.rs
@@ -95,10 +95,10 @@ impl ClnApi for ClnApiRpc {
params: &Lsps2PolicyGetInfoRequest,
) -> AnyResult<Lsps2PolicyGetInfoResponse> {
let mut rpc = self.create_rpc().await?;
- rpc.call_raw("dev-lsps2-getpolicy", params)
+ rpc.call_raw("lsps2-policy-getpolicy", params)
.await
.map_err(anyhow::Error::new)
- .with_context(|| "calling dev-lsps2-getpolicy")
+ .with_context(|| "calling lsps2-policy-getpolicy")
}
async fn lsps2_getchannelcapacity(
@@ -106,10 +106,10 @@ impl ClnApi for ClnApiRpc {
params: &Lsps2PolicyGetChannelCapacityRequest,
) -> AnyResult<Lsps2PolicyGetChannelCapacityResponse> {
let mut rpc = self.create_rpc().await?;
- rpc.call_raw("dev-lsps2-getchannelcapacity", params)
+ rpc.call_raw("lsps2-policy-getchannelcapacity", params)
.await
.map_err(anyhow::Error::new)
- .with_context(|| "calling dev-lsps2-getchannelcapacity")
+ .with_context(|| "calling lsps2-policy-getchannelcapacity")
}
async fn cln_getinfo(&self, params: &GetinfoRequest) -> AnyResult<GetinfoResponse> {
@@ -185,7 +185,7 @@ impl<A: ClnApi> Lsps2GetInfoHandler<A> {
}
}
-/// The RequestHandler calls the internal rpc command `dev-lsps2-getinfo`. It
+/// The RequestHandler calls the internal rpc command `lsps2-policy-getinfo`. It
/// expects a plugin has registered this command and manages policies for the
/// LSPS2 service.
#[async_trait]
diff --git a/plugins/lsps-plugin/src/lsps2/mod.rs b/plugins/lsps-plugin/src/lsps2/mod.rs
index 2b98aa1d..60d8ebf5 100644
--- a/plugins/lsps-plugin/src/lsps2/mod.rs
+++ b/plugins/lsps-plugin/src/lsps2/mod.rs
@@ -5,13 +5,13 @@ pub mod handler;
pub mod model;
pub const OPTION_ENABLED: options::FlagConfigOption = options::ConfigOption::new_flag(
- "dev-lsps2-service-enabled",
+ "experimental-lsps2-service",
"Enables lsps2 for the LSP service",
);
pub const OPTION_PROMISE_SECRET: options::StringConfigOption =
options::ConfigOption::new_str_no_default(
- "dev-lsps2-promise-secret",
+ "experimental-lsps2-promise-secret",
"A 64-character hex string that is the secret for promises",
);
diff --git a/tests/plugins/lsps2_policy.py b/tests/plugins/lsps2_policy.py
index 9294bbec..d71fc670 100755
--- a/tests/plugins/lsps2_policy.py
+++ b/tests/plugins/lsps2_policy.py
@@ -10,8 +10,8 @@ from datetime import datetime, timedelta, timezone
plugin = Plugin()
-@plugin.method("dev-lsps2-getpolicy")
-def lsps2_getpolicy(request):
+@plugin.method("lsps2-policy-getpolicy")
+def lsps2_policy_getpolicy(request):
"""Returns an opening fee menu for the LSPS2 plugin."""
now = datetime.now(timezone.utc)
@@ -42,8 +42,8 @@ def lsps2_getpolicy(request):
}
-@plugin.method("dev-lsps2-getchannelcapacity")
-def lsps2_getchannelcapacity(request, init_payment_size, scid, opening_fee_params):
+@plugin.method("lsps2-policy-getchannelcapacity")
+def lsps2_policy_getchannelcapacity(request, init_payment_size, scid, opening_fee_params):
"""Returns an opening fee menu for the LSPS2 plugin."""
return {"channel_capacity_msat": 100000000}
diff --git a/tests/test_cln_lsps.py b/tests/test_cln_lsps.py
index 290a3e29..b353c513 100644
--- a/tests/test_cln_lsps.py
+++ b/tests/test_cln_lsps.py
@@ -22,7 +22,14 @@ def test_lsps_service_disabled(node_factory):
@unittest.skipUnless(RUST, 'RUST is not enabled')
def test_lsps0_listprotocols(node_factory):
l1, l2 = node_factory.get_nodes(
- 2, opts=[{"dev-lsps-client-enabled": None}, {"dev-lsps-service-enabled": None}]
+ 2,
+ opts=[
+ {"experimental-lsps-client": None},
+ {
+ "experimental-lsps2-service": None,
+ "experimental-lsps2-promise-secret": "0" * 64,
+ },
+ ],
)
# We don't need a channel to query for lsps services
@@ -36,11 +43,10 @@ def test_lsps2_enabled(node_factory):
l1, l2 = node_factory.get_nodes(
2,
opts=[
- {"dev-lsps-client-enabled": None},
+ {"experimental-lsps-client": None},
{
- "dev-lsps-service-enabled": None,
- "dev-lsps2-service-enabled": None,
- "dev-lsps2-promise-secret": "0" * 64,
+ "experimental-lsps2-service": None,
+ "experimental-lsps2-promise-secret": "0" * 64,
},
],
)
@@ -57,14 +63,13 @@ def test_lsps2_getinfo(node_factory):
l1, l2 = node_factory.get_nodes(
2,
opts=[
- {"dev-lsps-client-enabled": None},
+ {"experimental-lsps-client": None},
{
- "dev-lsps-service-enabled": None,
- "dev-lsps2-service-enabled": None,
- "dev-lsps2-promise-secret": "0" * 64,
+ "experimental-lsps2-service": None,
+ "experimental-lsps2-promise-secret": "0" * 64,
"plugin": plugin,
},
- ],
+ ]
)
node_factory.join_nodes([l1, l2], fundchannel=False)
@@ -80,14 +85,13 @@ def test_lsps2_buy(node_factory):
l1, l2 = node_factory.get_nodes(
2,
opts=[
- {"dev-lsps-client-enabled": None},
+ {"experimental-lsps-client": None},
{
- "dev-lsps-service-enabled": None,
- "dev-lsps2-service-enabled": None,
- "dev-lsps2-promise-secret": "0" * 64,
+ "experimental-lsps2-service": None,
+ "experimental-lsps2-promise-secret": "0" * 64,
"plugin": plugin,
},
- ],
+ ]
)
# We don't need a channel to query for lsps services
@@ -123,11 +127,10 @@ def test_lsps2_buyjitchannel_no_mpp_var_invoice(node_factory, bitcoind):
l1, l2, l3 = node_factory.get_nodes(
3,
opts=[
- {"dev-lsps-client-enabled": None},
+ {"experimental-lsps-client": None},
{
- "dev-lsps-service-enabled": None,
- "dev-lsps2-service-enabled": None,
- "dev-lsps2-promise-secret": "00" * 32,
+ "experimental-lsps2-service": None,
+ "experimental-lsps2-promise-secret": "0" * 64,
"plugin": plugin,
"fee-base": 0, # We are going to deduct our fee anyways,
"fee-per-satoshi": 0, # We are going to deduct our fee anyways,
@@ -199,11 +202,10 @@ def test_lsps2_non_approved_zero_conf(node_factory, bitcoind):
l1, l2, l3 = node_factory.get_nodes(
3,
opts=[
- {"dev-lsps-client-enabled": None},
+ {"experimental-lsps-client": None},
{
- "dev-lsps-service-enabled": None,
- "dev-lsps2-service-enabled": None,
- "dev-lsps2-promise-secret": "00" * 32,
+ "experimental-lsps2-service": None,
+ "experimental-lsps2-promise-secret": "0" * 64,
"plugin": plugin,
"fee-base": 0, # We are going to deduct our fee anyways,
"fee-per-satoshi": 0, # We are going to deduct our fee anyways,
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.