Skip to content

Commit

Permalink
commando: update removal version for rpcs
Browse files Browse the repository at this point in the history
We documented them as deprecated in v23.08 but unintentionally didn't deprecate them in the code. Thus we are starting their actual deprecation cycle from v24.08 release.

Updating removal version for commands `commando-rune`, `commando-listrunes`, and `commando-blacklist`

Changelog-None.
  • Loading branch information
ShahanaFarooqui authored and rustyrussell committed Jun 18, 2024
1 parent f5f2ab1 commit 35101c0
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 16 deletions.
6 changes: 3 additions & 3 deletions contrib/msggen/msggen/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3273,7 +3273,7 @@
"added": "v23.05",
"deprecated": [
"v23.08",
"v24.08"
"v25.02"
],
"rpc": "commando-blacklist",
"title": "Command to prevent a rune from working",
Expand Down Expand Up @@ -3415,7 +3415,7 @@
"added": "v23.05",
"deprecated": [
"v23.08",
"v24.05"
"v25.02"
],
"rpc": "commando-listrunes",
"title": "Command to list previously generated runes",
Expand Down Expand Up @@ -3712,7 +3712,7 @@
"additionalProperties": false,
"deprecated": [
"v23.08",
"v23.05"
"v25.02"
],
"rpc": "commando-rune",
"title": "Command to Authorize Remote Peer Access",
Expand Down
3 changes: 3 additions & 0 deletions doc/developers-guide/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ hidden: false
| plugin.nonumericids | Getmanifest Reply | v23.08 | v24.08 | Plugins must specify that they can accept non-numeric command ids (numeric ids are deprecated) |
| listchannels.include_private | Field(s) | v24.02 | v24.08 | `listchannels` including private channels (now use listpeerchannels which gives far more detail) |
| max-locktime-blocks | Config | v24.05 | v24.11 | --max-locktime-blocks is now set to 2016 in the BOLT 4 spec |
| commando-rune | Command | v23.08 | v25.02 | replaced with `lightning-createrune` |
| commando-listrunes | Command | v23.08 | v25.02 | replaced with `lightning-showrunes` |
| commando-blacklist | Command | v23.08 | v25.02 | replaced with `lightning-blacklistrune` |


Inevitably there are features which need to change: either to be generalized, or removed when they can no longer be supported.
Expand Down
2 changes: 1 addition & 1 deletion doc/schemas/lightning-commando-blacklist.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"added": "v23.05",
"deprecated": [
"v23.08",
"v24.08"
"v25.02"
],
"rpc": "commando-blacklist",
"title": "Command to prevent a rune from working",
Expand Down
2 changes: 1 addition & 1 deletion doc/schemas/lightning-commando-listrunes.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"added": "v23.05",
"deprecated": [
"v23.08",
"v24.05"
"v25.02"
],
"rpc": "commando-listrunes",
"title": "Command to list previously generated runes",
Expand Down
2 changes: 1 addition & 1 deletion doc/schemas/lightning-commando-rune.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"additionalProperties": false,
"deprecated": [
"v23.08",
"v23.05"
"v25.02"
],
"rpc": "commando-rune",
"title": "Command to Authorize Remote Peer Access",
Expand Down
6 changes: 6 additions & 0 deletions plugins/commando.c
Original file line number Diff line number Diff line change
Expand Up @@ -811,20 +811,26 @@ static const struct plugin_command commands[] = { {
"Create or restrict a rune",
"Takes an optional {rune} with optional {restrictions} and returns {rune}",
json_commando_rune,
"v23.08",
"v25.02",
},
{
"commando-listrunes",
"utility",
"List runes we have created earlier",
"Takes an optional {rune} and returns list of {rune}",
json_commando_listrunes,
"v23.08",
"v25.02",
},
{
"commando-blacklist",
"utility",
"Blacklist a rune or range of runes by unique id",
"Takes an optional {start} and an optional {end} and returns {blacklist} array containing {start}, {end}",
json_commando_blacklist,
"v23.08",
"v25.02",
},
};

Expand Down
2 changes: 1 addition & 1 deletion tests/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1149,7 +1149,7 @@ def test_cli(node_factory):

def test_cli_commando(node_factory):
l1, l2 = node_factory.line_graph(2, fundchannel=False,
opts={'log-level': 'io'})
opts={'log-level': 'io', 'allow-deprecated-apis': True})
rune = l2.rpc.commando_rune()['rune']

# Invalid peer id.
Expand Down
26 changes: 19 additions & 7 deletions tests/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2669,7 +2669,7 @@ def test_plugin_shutdown(node_factory):

def test_commando(node_factory, executor):
l1, l2 = node_factory.line_graph(2, fundchannel=False,
opts={'log-level': 'io'})
opts={'log-level': 'io', 'allow-deprecated-apis': True})

rune = l1.rpc.commando_rune()['rune']

Expand Down Expand Up @@ -2765,7 +2765,9 @@ def test_commando(node_factory, executor):


def test_commando_rune(node_factory):
l1, l2 = node_factory.line_graph(2, fundchannel=False)
l1, l2 = node_factory.line_graph(2, fundchannel=False, opts={
'allow-deprecated-apis': True,
})

rune1 = l1.rpc.commando_rune()
assert rune1['rune'] == 'OSqc7ixY6F-gjcigBfxtzKUI54uzgFSA6YfBQoWGDV89MA=='
Expand Down Expand Up @@ -2904,7 +2906,9 @@ def test_commando_rune(node_factory):


def test_commando_listrunes(node_factory):
l1 = node_factory.get_node()
l1 = node_factory.get_node(options={
'allow-deprecated-apis': True,
})
rune = l1.rpc.commando_rune()
assert rune == {
'rune': 'OSqc7ixY6F-gjcigBfxtzKUI54uzgFSA6YfBQoWGDV89MA==',
Expand Down Expand Up @@ -2944,7 +2948,9 @@ def test_commando_listrunes(node_factory):


def test_commando_rune_pay_amount(node_factory):
l1, l2 = node_factory.line_graph(2)
l1, l2 = node_factory.line_graph(2, opts={
'allow-deprecated-apis': True,
})

# This doesn't really work, since amount_msat is illegal if invoice
# includes an amount, and runes aren't smart enough to decode bolt11!
Expand Down Expand Up @@ -2996,7 +3002,9 @@ def test_commando_rune_pay_amount(node_factory):


def test_commando_blacklist(node_factory):
l1, l2 = node_factory.get_nodes(2)
l1, l2 = node_factory.get_nodes(2, opts={
'allow-deprecated-apis': True,
})

l2.connect(l1)
rune0 = l1.rpc.commando_rune()
Expand Down Expand Up @@ -3079,7 +3087,9 @@ def test_commando_blacklist(node_factory):
@pytest.mark.slow_test
def test_commando_stress(node_factory, executor):
"""Stress test to slam commando with many large queries"""
nodes = node_factory.get_nodes(5)
nodes = node_factory.get_nodes(5, opts={
'allow-deprecated-apis': True,
})

rune = nodes[0].rpc.commando_rune()['rune']
for n in nodes[1:]:
Expand Down Expand Up @@ -3115,7 +3125,9 @@ def test_commando_stress(node_factory, executor):

def test_commando_badrune(node_factory):
"""Test invalid UTF-8 encodings in rune: used to make us kill the offers plugin which implements decode, as it gave bad utf8!"""
l1 = node_factory.get_node()
l1 = node_factory.get_node(options={
'allow-deprecated-apis': True,
})
l1.rpc.decode('5zi6-ugA6hC4_XZ0R7snl5IuiQX4ugL4gm9BQKYaKUU9gCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl')
rune = l1.rpc.commando_rune(restrictions="readonly")

Expand Down
4 changes: 3 additions & 1 deletion tests/test_runes.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@


def test_createrune(node_factory):
l1 = node_factory.get_node()
l1 = node_factory.get_node(options={
'allow-deprecated-apis': True,
})

# l1's master rune secret is edb8893c04fdeef8f5f06ed70edef309a5c83f20624594e136e392504a270c40
rune1 = l1.rpc.createrune()
Expand Down
4 changes: 3 additions & 1 deletion tests/test_wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -1679,7 +1679,9 @@ def test_upgradewallet(node_factory, bitcoind):

def test_hsmtool_makerune(node_factory):
"""Test we can make a valid rune before the node really exists"""
l1 = node_factory.get_node(start=False)
l1 = node_factory.get_node(start=False, options={
'allow-deprecated-apis': True,
})

# get_node() creates a secret, but in usual case we generate one.
hsm_path = os.path.join(l1.daemon.lightning_dir, TEST_NETWORK, "hsm_secret")
Expand Down

0 comments on commit 35101c0

Please sign in to comment.