Skip to content

Commit 14d3c64

Browse files
committed
renepay: deprecate.
I think Eduardo and I stole all the best bits to make xpay and askrene. I simply enabled deprecations on all the renepay tests. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
1 parent 23d1a53 commit 14d3c64

6 files changed

Lines changed: 56 additions & 38 deletions

File tree

contrib/msggen/msggen/schema.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30938,6 +30938,8 @@
3093830938
"title": "Command for sending a payment to a BOLT11 invoice",
3093930939
"added": "v23.08",
3094030940
"description": [
30941+
"WARNING: Deprecated, scheduled for removal in v27.03",
30942+
"",
3094130943
"**renepay** is a new payment plugin based on Pickhardt-Richter optimization method for Multi-Path-Payments. This implementation has not been thoroughly tested and it should be used with caution.",
3094230944
"",
3094330945
"The response will occur when the payment fails or succeeds. Once a payment has succeeded, calls to **renepay** with the same *invstring* will not lead to a new payment attempt, but instead it will succeed immediately.",
@@ -31200,6 +31202,8 @@
3120031202
"title": "Command for quering the status of previous renepay attempts",
3120131203
"added": "v23.08",
3120231204
"description": [
31205+
"WARNING: Deprecated, scheduled for removal in v27.03",
31206+
"",
3120331207
"The **renepaystatus** RPC command queries the payment plugin **renepay** for the status of previous payment attempts.",
3120431208
"",
3120531209
"This command always succeeds."

doc/developers-guide/deprecated-features.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ privacy:
3131
| paystatus | Command | v26.06 | v27.03 | Uses internal pay structures, doesn't work with xpay, doesn't work across restarts. |
3232
| getroute | Command | v26.06 | v27.03 | Less flexible than `getroutes` which takes an actual fee budget and can do multiple paths at once. |
3333
| keysend | Command | v26.06 | v27.03 | Replaced by more powerful `xkeysend`. |
34+
| renepay | Command | v26.06 | v27.03 | Use `xpay` instead. |
35+
| renepaystatus | Command | v26.06 | v27.03 | Use `xpay` notifications and `listpays` or `listsendpays` instead. |
3436

3537
Inevitably there are features which need to change: either to be generalized, or removed when they can no longer be supported.
3638

doc/schemas/renepay.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
"title": "Command for sending a payment to a BOLT11 invoice",
66
"added": "v23.08",
77
"description": [
8+
"WARNING: Deprecated, scheduled for removal in v27.03",
9+
"",
810
"**renepay** is a new payment plugin based on Pickhardt-Richter optimization method for Multi-Path-Payments. This implementation has not been thoroughly tested and it should be used with caution.",
911
"",
1012
"The response will occur when the payment fails or succeeds. Once a payment has succeeded, calls to **renepay** with the same *invstring* will not lead to a new payment attempt, but instead it will succeed immediately.",

doc/schemas/renepaystatus.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
"title": "Command for quering the status of previous renepay attempts",
66
"added": "v23.08",
77
"description": [
8+
"WARNING: Deprecated, scheduled for removal in v27.03",
9+
"",
810
"The **renepaystatus** RPC command queries the payment plugin **renepay** for the status of previous payment attempts.",
911
"",
1012
"This command always succeeds."

plugins/renepay/main.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,11 +445,13 @@ static struct command_result *json_renepay(struct command *cmd, const char *buf,
445445
static const struct plugin_command commands[] = {
446446
{
447447
"renepaystatus",
448-
json_renepaystatus
448+
json_renepaystatus,
449+
"v26.06", "v27.03",
449450
},
450451
{
451452
"renepay",
452-
json_renepay
453+
json_renepay,
454+
"v26.06", "v27.03",
453455
},
454456
};
455457

tests/test_renepay.py

Lines changed: 42 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
def test_simple(node_factory):
2121
"""Testing simply paying a peer."""
22-
l1, l2 = node_factory.line_graph(2)
22+
l1, l2 = node_factory.line_graph(2, opts={'allow-deprecated-apis': True})
2323
inv = l2.rpc.invoice(123000, "test_renepay", "description")["bolt11"]
2424
details = l1.rpc.call("renepay", {"invstring": inv})
2525
assert details["status"] == "complete"
@@ -33,7 +33,7 @@ def test_direction_matters(node_factory):
3333
3,
3434
wait_for_announce=True,
3535
opts=[
36-
{},
36+
{'allow-deprecated-apis': True},
3737
{"fee-base": 2000, "fee-per-satoshi": 20, "cltv-delta": 20},
3838
{"fee-base": 3000, "fee-per-satoshi": 30, "cltv-delta": 30},
3939
],
@@ -53,7 +53,8 @@ def test_shadow_routing(node_factory):
5353
"""
5454
# We need l3 for random walk
5555
l1, l2, l3 = node_factory.line_graph(3, wait_for_announce=True,
56-
opts={'dev-allow-localhost': None})
56+
opts={'allow-deprecated-apis': True,
57+
'dev-allow-localhost': None})
5758

5859
amount = 10000
5960
total_amount = 0
@@ -77,7 +78,7 @@ def test_mpp(node_factory):
7778
Try paying 1.2M sats from 1 to 6.
7879
"""
7980
opts = [
80-
{"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 0, 'dev-allow-localhost': None},
81+
{"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 0, 'dev-allow-localhost': None, 'allow-deprecated-apis': True},
8182
]
8283
l1, l2, l3, l4, l5, l6 = node_factory.get_nodes(6, opts=opts * 6)
8384
node_factory.join_nodes(
@@ -97,7 +98,7 @@ def test_mpp(node_factory):
9798

9899
def test_errors(node_factory, bitcoind):
99100
opts = [
100-
{"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 0},
101+
{"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 0, 'allow-deprecated-apis': True},
101102
]
102103
l1, l2, l3, l4, l5, l6 = node_factory.get_nodes(6, opts=opts * 6)
103104
send_amount = Millisatoshi("21sat")
@@ -147,7 +148,7 @@ def test_errors(node_factory, bitcoind):
147148
@pytest.mark.openchannel("v1")
148149
@pytest.mark.openchannel("v2")
149150
def test_pay(node_factory):
150-
l1, l2 = node_factory.line_graph(2)
151+
l1, l2 = node_factory.line_graph(2, opts={'allow-deprecated-apis': True})
151152

152153
inv = l2.rpc.invoice(123000, "test_pay", "description")["bolt11"]
153154
before = int(time.time())
@@ -230,7 +231,7 @@ def test_amounts(node_factory):
230231
"""
231232
Check that the amount received matches the amount requested in the invoice.
232233
"""
233-
l1, l2 = node_factory.line_graph(2)
234+
l1, l2 = node_factory.line_graph(2, opts={'allow-deprecated-apis': True})
234235
inv = l2.rpc.invoice(Millisatoshi(123456), "test_pay_amounts", "description")[
235236
"bolt11"
236237
]
@@ -257,7 +258,7 @@ def test_limits(node_factory):
257258
- probability of success is too low.
258259
"""
259260
opts = [
260-
{"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 100},
261+
{"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 100, 'allow-deprecated-apis': True},
261262
]
262263
l1, l2, l3, l4, l5, l6 = node_factory.get_nodes(6, opts=opts * 6)
263264
node_factory.join_nodes(
@@ -365,7 +366,7 @@ def test_hardmpp(node_factory):
365366
we build the network capacities.
366367
"""
367368
opts = [
368-
{"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 0},
369+
{"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 0, 'allow-deprecated-apis': True},
369370
]
370371
l1, l2, l3, l4, l5, l6 = node_factory.get_nodes(6, opts=opts * 6)
371372
start_channels(
@@ -409,7 +410,7 @@ def test_hardmpp(node_factory):
409410

410411
@pytest.mark.flaky(reruns=2)
411412
def test_self_pay(node_factory):
412-
l1, l2 = node_factory.line_graph(2, wait_for_announce=True)
413+
l1, l2 = node_factory.line_graph(2, wait_for_announce=True, opts={'allow-deprecated-apis': True})
413414

414415
inv = l1.rpc.invoice(10000, "test", "test")["bolt11"]
415416
l1.rpc.call("renepay", {"invstring": inv})
@@ -443,6 +444,7 @@ def test_fee_allocation(node_factory):
443444
"fee-base": 1000,
444445
"fee-per-satoshi": 30000,
445446
"plugin": os.path.join(os.getcwd(), "tests/plugins/no_fail.py"),
447+
'allow-deprecated-apis': True,
446448
},
447449
]
448450
l1, l2, l3, l4 = node_factory.get_nodes(4, opts=opts * 4)
@@ -468,22 +470,24 @@ def test_htlc_max(node_factory):
468470
3----5----6
469471
"""
470472
opts = [
471-
{"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 0},
472-
{"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 0},
473-
{"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 0},
473+
{"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 0, 'allow-deprecated-apis': True},
474+
{"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 0, 'allow-deprecated-apis': True},
475+
{"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 0, 'allow-deprecated-apis': True},
474476
{
475477
"disable-mpp": None,
476478
"fee-base": 0,
477479
"fee-per-satoshi": 0,
478480
"htlc-maximum-msat": 500000000,
481+
'allow-deprecated-apis': True,
479482
},
480483
{
481484
"disable-mpp": None,
482485
"fee-base": 0,
483486
"fee-per-satoshi": 0,
484487
"htlc-maximum-msat": 500000000,
488+
'allow-deprecated-apis': True,
485489
},
486-
{"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 0},
490+
{"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 0, 'allow-deprecated-apis': True},
487491
]
488492
l1, l2, l3, l4, l5, l6 = node_factory.get_nodes(6, opts=opts)
489493
start_channels(
@@ -511,7 +515,7 @@ def test_previous_sendpays(node_factory, bitcoind):
511515
Check that renepay can complete a payment that already started
512516
"""
513517
opts = [
514-
{"disable-mpp": None, "fee-base": 1000, "fee-per-satoshi": 1000},
518+
{"disable-mpp": None, "fee-base": 1000, "fee-per-satoshi": 1000, 'allow-deprecated-apis': True},
515519
]
516520
l1, l2, l3, l4 = node_factory.line_graph(4, wait_for_announce=True, opts=opts * 4)
517521

@@ -605,12 +609,12 @@ def test_fees(node_factory):
605609
"""
606610
# made up some random fees for every node
607611
opts = [
608-
{"disable-mpp": None, "fee-base": 1000, "fee-per-satoshi": 100},
609-
{"disable-mpp": None, "fee-base": 2222, "fee-per-satoshi": 203},
610-
{"disable-mpp": None, "fee-base": 3333, "fee-per-satoshi": 300},
611-
{"disable-mpp": None, "fee-base": 2012, "fee-per-satoshi": 200},
612-
{"disable-mpp": None, "fee-base": 1010, "fee-per-satoshi": 100},
613-
{"disable-mpp": None, "fee-base": 1050, "fee-per-satoshi": 100},
612+
{"disable-mpp": None, "fee-base": 1000, "fee-per-satoshi": 100, 'allow-deprecated-apis': True},
613+
{"disable-mpp": None, "fee-base": 2222, "fee-per-satoshi": 203, 'allow-deprecated-apis': True},
614+
{"disable-mpp": None, "fee-base": 3333, "fee-per-satoshi": 300, 'allow-deprecated-apis': True},
615+
{"disable-mpp": None, "fee-base": 2012, "fee-per-satoshi": 200, 'allow-deprecated-apis': True},
616+
{"disable-mpp": None, "fee-base": 1010, "fee-per-satoshi": 100, 'allow-deprecated-apis': True},
617+
{"disable-mpp": None, "fee-base": 1050, "fee-per-satoshi": 100, 'allow-deprecated-apis': True},
614618
]
615619
nodes = node_factory.line_graph(len(opts), wait_for_announce=True, opts=opts)
616620
source = nodes[0]
@@ -637,7 +641,7 @@ def test_fees(node_factory):
637641

638642
def test_local_htlcmax0(node_factory):
639643
"""Testing a simple pay route when local channels have htlcmax=0."""
640-
l1, l2, l3 = node_factory.line_graph(3, wait_for_announce=True)
644+
l1, l2, l3 = node_factory.line_graph(3, wait_for_announce=True, opts={'allow-deprecated-apis': True})
641645
l1.rpc.setchannel(l2.info["id"], htlcmax=0)
642646
inv = l3.rpc.invoice(123000, "test_renepay", "description")["bolt11"]
643647
details = l1.rpc.call("renepay", {"invstring": inv})
@@ -655,22 +659,24 @@ def test_htlcmax0(node_factory):
655659
Tests the plugin when some routes have htlc_max=0.
656660
"""
657661
opts = [
658-
{"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 0},
659-
{"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 0},
660-
{"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 0},
662+
{"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 0, 'allow-deprecated-apis': True},
663+
{"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 0, 'allow-deprecated-apis': True},
664+
{"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 0, 'allow-deprecated-apis': True},
661665
{
662666
"disable-mpp": None,
663667
"fee-base": 0,
664668
"fee-per-satoshi": 0,
665669
"htlc-maximum-msat": 0,
670+
'allow-deprecated-apis': True,
666671
},
667672
{
668673
"disable-mpp": None,
669674
"fee-base": 0,
670675
"fee-per-satoshi": 0,
671676
"htlc-maximum-msat": 800000000,
677+
'allow-deprecated-apis': True,
672678
},
673-
{"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 0},
679+
{"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 0, 'allow-deprecated-apis': True},
674680
]
675681
l1, l2, l3, l4, l5, l6 = node_factory.get_nodes(6, opts=opts)
676682
start_channels(
@@ -693,7 +699,7 @@ def test_htlcmax0(node_factory):
693699

694700

695701
def test_concurrency(node_factory):
696-
l1, l2, l3 = node_factory.line_graph(3, wait_for_announce=True, opts=[{}, {}, {}])
702+
l1, l2, l3 = node_factory.line_graph(3, wait_for_announce=True, opts={'allow-deprecated-apis': True})
697703
inv = l3.rpc.invoice("1000sat", "test_renepay", "description")["bolt11"]
698704
p1 = subprocess.Popen(
699705
[
@@ -735,10 +741,10 @@ def test_privatechan(node_factory, bitcoind):
735741
Tests if a payment can get through a private channel.
736742
"""
737743
opts = [
738-
{"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 0},
739-
{"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 0},
740-
{"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 100},
741-
{"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 0},
744+
{"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 0, 'allow-deprecated-apis': True},
745+
{"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 0, 'allow-deprecated-apis': True},
746+
{"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 100, 'allow-deprecated-apis': True},
747+
{"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 0, 'allow-deprecated-apis': True},
742748
]
743749
l1, l2, l3, l4 = node_factory.get_nodes(4, opts=opts)
744750

@@ -771,7 +777,7 @@ def test_privatechan(node_factory, bitcoind):
771777
@unittest.skipIf(TEST_NETWORK == 'liquid-regtest', "broken for some reason")
772778
def test_hardmpp2(node_factory, bitcoind):
773779
"""Credits to @daywalker90 for this test case."""
774-
opts = {"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 10}
780+
opts = {"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 10, 'allow-deprecated-apis': True}
775781
l1, l2, l3 = node_factory.get_nodes(3, opts=opts)
776782
start_channels(
777783
[
@@ -797,7 +803,7 @@ def test_hardmpp2(node_factory, bitcoind):
797803

798804
def test_description(node_factory):
799805
"""Test the processing of the payment description interface."""
800-
l1, l2 = node_factory.line_graph(2)
806+
l1, l2 = node_factory.line_graph(2, opts={'allow-deprecated-apis': True})
801807

802808
# do not provide description in the command line, all payments should be
803809
# fine
@@ -840,7 +846,7 @@ def test_description(node_factory):
840846

841847
def test_offers(node_factory):
842848
l1, l2, l3 = node_factory.line_graph(3, wait_for_announce=True,
843-
opts={'dev-allow-localhost': None})
849+
opts={'dev-allow-localhost': None, 'allow-deprecated-apis': True})
844850
offer = l3.rpc.offer("1000sat", "test_renepay_offers")['bolt12']
845851
invoice = l1.rpc.fetchinvoice(offer)['invoice']
846852
response = l1.rpc.call("renepay", {"invstring": invoice})
@@ -849,14 +855,14 @@ def test_offers(node_factory):
849855

850856
def test_offer_selfpay(node_factory):
851857
"""We can fetch an pay our own offer"""
852-
l1 = node_factory.get_node()
858+
l1 = node_factory.get_node(options={'allow-deprecated-apis': True})
853859
offer = l1.rpc.offer(amount="2msat", description="test_offer_path_self")["bolt12"]
854860
inv = l1.rpc.fetchinvoice(offer)["invoice"]
855861
l1.rpc.call("renepay", {"invstring": inv})
856862

857863

858864
def test_unannounced(node_factory):
859-
l1, l2 = node_factory.line_graph(2, announce_channels=False)
865+
l1, l2 = node_factory.line_graph(2, announce_channels=False, opts={'allow-deprecated-apis': True})
860866
# BOLT-11 direct peer
861867
b11 = l2.rpc.invoice(
862868
"100sat", "test_renepay_unannounced", "test_renepay_unannounced"

0 commit comments

Comments
 (0)