Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VLS Modifications to CLN v24.02 #106

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
b7b8e8d
cln_plugin: switch lifetimes of ConfigOption from static to non-static
daywalker90 Feb 19, 2024
ef40b2f
hsmd: increase the min version
vincenzopalazzo Feb 19, 2024
af41cd5
hsmd: remove deprecated init v2
vincenzopalazzo Feb 20, 2024
a708690
ci: Remove the alping compilation test
cdecker Feb 27, 2024
87f6ceb
gossmap: fix OpenBSD crash.
rustyrussell Feb 27, 2024
4b397e5
release: Update the CHANGELOG.md
cdecker Feb 13, 2024
5e42f46
release: Bump pyln package versions
cdecker Feb 13, 2024
8418989
release: Unbreak the Fedora build
cdecker Feb 16, 2024
ff44940
ci: add curl to setup.sh
ksedgwic Feb 14, 2023
0890f9b
gitignore VLS proxy daemons
ksedgwic May 9, 2023
5ebf7ee
tests: add PYTEST_MOREOPTS so users can extend the options
ksedgwic Nov 16, 2023
0edcca0
tests: add TEST_KEEPDIR to prevent cleanup of successful tests
ksedgwic Nov 21, 2023
403f02f
tests: add VLS to CLN integration suite
ksedgwic Nov 21, 2023
f98ec33
tests: integrate lssd
devrandom Oct 4, 2022
ef466af
tests: add call to preapproveinvoice in pay to inform signer
ksedgwic Jun 7, 2023
8a626aa
tests: add explicit preapprove{invoice,keysend} calls before sendpay
ksedgwic Jun 8, 2023
7a12e79
tests: disable flaky on test_splice, incompatible w/ pytest-timeout
ksedgwic Nov 16, 2023
feb80c5
tests: skip splicing / dual-funding tests when VLS_SKIP_SPLICE_TESTS
ksedgwic Nov 20, 2023
f0f1956
tests: skip test_reckless.py::test_disable_enable because no canned g…
ksedgwic Nov 20, 2023
1eeb68b
tests: skip tests incompatible with VLS
ksedgwic Nov 21, 2023
7ddd60a
tests: reevaluate: reenabled tests which pass
ksedgwic Nov 21, 2023
e0805ec
tests: Fix test_sign_and_send_psbt wrt VLS signatures
ksedgwic Nov 23, 2023
33d0cfd
fix: add rpc server port in integration test
king-11 Jan 23, 2024
10eb20b
tests: modify tests for VLS
ksedgwic Feb 15, 2024
ab0e0c0
tests: ugly workaround for test_pay unbalanced transfer error
ksedgwic Feb 16, 2024
5b23cc5
tests: skip test_gossip_not_dying because frequently fails
ksedgwic Feb 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/test_bookkeeper.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,7 @@ def test_bookkeeping_inspect_multifundchannel(node_factory, bitcoind):
assert bkpr_total_fee_msat == int(getblock_fee_btc * 100000000000)


@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd') and os.getenv('VLS_SKIP_SPLICE_TESTS') == '1', "test expected to fail before VLS dual-funding / splicing support")
@unittest.skipIf(TEST_NETWORK != 'regtest', "network fees hardcoded")
@pytest.mark.openchannel('v2')
def test_bookkeeping_inspect_mfc_dual_funded(node_factory, bitcoind):
Expand Down
1 change: 1 addition & 0 deletions tests/test_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,7 @@ def test_db_sanity_checks(bitcoind, node_factory):
assert l1.daemon.is_in_stderr('Wallet sanity check failed')


@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd'), "no such channel")
@unittest.skipIf(os.getenv('TEST_DB_PROVIDER', 'sqlite3') != 'sqlite3', "Canned db used")
@unittest.skipIf(not COMPAT, "needs COMPAT to convert obsolete db")
@unittest.skipIf(TEST_NETWORK != 'regtest', "The DB migration is network specific due to the chain var.")
Expand Down
1 change: 1 addition & 0 deletions tests/test_invoices.py
Original file line number Diff line number Diff line change
Expand Up @@ -960,6 +960,7 @@ def test_expiry_startup_crash(node_factory, bitcoind):
l1.start()


@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd'), "no such channel")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm... does CLN change the dbid? that will break things?

@unittest.skipIf(TEST_NETWORK != 'regtest', "The DB migration is network specific due to the chain var.")
@unittest.skipIf(os.getenv('TEST_DB_PROVIDER', 'sqlite3') != 'sqlite3', "This test is based on a sqlite3 snapshot")
def test_invoices_wait_db_migration(node_factory, bitcoind):
Expand Down
4 changes: 4 additions & 0 deletions tests/test_pay.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ def test_pay0(node_factory):
l1.rpc.waitsendpay(rhash)


@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd') and os.getenv('VLS_PERMISSIVE') != '1', "feerate above maximum: 880782 > 151000")
def test_pay_disconnect(node_factory, bitcoind):
"""If the remote node has disconnected, we fail payment, but can try again when it reconnects"""
l1, l2 = node_factory.line_graph(2, opts={'dev-max-fee-multiplier': 5,
Expand Down Expand Up @@ -1317,6 +1318,7 @@ def test_forward_different_fees_and_cltv(node_factory, bitcoind):
assert only_one(l3.rpc.listinvoices('test_forward_different_fees_and_cltv')['invoices'])['status'] == 'unpaid'

# This should work.
l1.rpc.preapproveinvoice(bolt11=inv['bolt11']) # let the signer know this payment is coming
l1.rpc.sendpay(route, rhash, payment_secret=inv['payment_secret'])
l1.rpc.waitsendpay(rhash)

Expand Down Expand Up @@ -1385,6 +1387,7 @@ def test_forward_pad_fees_and_cltv(node_factory, bitcoind):
# This should work.
inv = l3.rpc.invoice(4999999, 'test_forward_pad_fees_and_cltv', 'desc')
rhash = inv['payment_hash']
l1.rpc.preapproveinvoice(bolt11=inv['bolt11']) # let the signer know this payment is coming
l1.rpc.sendpay(route, rhash, payment_secret=inv['payment_secret'])
l1.rpc.waitsendpay(rhash)
assert only_one(l3.rpc.listinvoices('test_forward_pad_fees_and_cltv')['invoices'])['status'] == 'paid'
Expand Down Expand Up @@ -2319,6 +2322,7 @@ def test_setchannel_routing(node_factory, bitcoind):
assert decoded['routes'] == [[{'pubkey': l2.info['id'], 'short_channel_id': scid, 'fee_base_msat': 1337, 'fee_proportional_millionths': 137, 'cltv_expiry_delta': 6}]]

# This will fail.
l1.rpc.preapproveinvoice(bolt11=inv['bolt11']) # let the signer know this payment is coming
l1.rpc.sendpay(route_bad, inv['payment_hash'], payment_secret=inv['payment_secret'])
with pytest.raises(RpcError, match='WIRE_TEMPORARY_CHANNEL_FAILURE'):
l1.rpc.waitsendpay(inv['payment_hash'])
Expand Down
6 changes: 6 additions & 0 deletions tests/test_reckless.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ def test_search(node_factory):
assert 'found testplugpass in source: https://github.com/lightningd/plugins' in r.stdout


@unittest.skipIf(VALGRIND, "virtual environment triggers memleak detection")
@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd'), "no canned github server in gitlab CI")
def test_install(node_factory):
"""test search, git clone, and installation to folder."""
n = get_reckless_node(node_factory)
Expand All @@ -199,6 +201,7 @@ def test_install(node_factory):


@unittest.skipIf(VALGRIND, "virtual environment triggers memleak detection")
@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd'), "no canned github server in gitlab CI")
def test_poetry_install(node_factory):
"""test search, git clone, and installation to folder."""
n = get_reckless_node(node_factory)
Expand All @@ -218,6 +221,7 @@ def test_poetry_install(node_factory):


@unittest.skipIf(VALGRIND, "virtual environment triggers memleak detection")
@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd'), "no canned github server in gitlab CI")
def test_local_dir_install(node_factory):
"""Test search and install from local directory source."""
n = get_reckless_node(node_factory)
Expand Down Expand Up @@ -266,6 +270,8 @@ def test_disable_enable(node_factory):
assert test_plugin in n.rpc.plugin_list()['plugins']


@unittest.skipIf(VALGRIND, "virtual environment triggers memleak detection")
@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd'), "no canned github server in gitlab CI")
@unittest.skipIf(VALGRIND, "virtual environment triggers memleak detection")
def test_tag_install(node_factory):
"install a plugin from a specific commit hash or tag"
Expand Down
16 changes: 13 additions & 3 deletions tests/test_renepay.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,17 +186,21 @@ def test_pay(node_factory):
# Check payment of any-amount invoice.
for i in range(5):
label = "any{}".format(i)
inv2 = l2.rpc.invoice("any", label, "description")["bolt11"]
inv2x = l2.rpc.invoice("any", label, "description")
rhash = inv2x["payment_hash"]
inv2 = inv2x["bolt11"]
# Must provide an amount!
with pytest.raises(RpcError):
l1.rpc.call("renepay", {"invstring": inv2, "dev_use_shadow": False})

amt = random.randint(1000, 999999)
l1.rpc.preapprovekeysend(l2.info["id"], rhash, amt)
l1.rpc.call(
"renepay",
{
"invstring": inv2,
"dev_use_shadow": False,
"amount_msat": random.randint(1000, 999999),
"amount_msat": amt,
},
)

Expand Down Expand Up @@ -451,6 +455,7 @@ def test_fee_allocation(node_factory):
)

inv = l4.rpc.invoice("1500000sat", "inv", "description")
l1.rpc.preapprovekeysend(l4.info["id"], inv["payment_hash"], 1500000000 + 75000000)
l1.rpc.call("renepay", {"invstring": inv["bolt11"], "maxfee": "75000sat"})
l1.wait_for_htlcs()
invoice = only_one(l4.rpc.listinvoices("inv")["invoices"])
Expand Down Expand Up @@ -496,7 +501,8 @@ def test_htlc_max(node_factory):

inv = l6.rpc.invoice("1800000sat", "inv", "description")

l1.rpc.call("renepay", {"invstring": inv["bolt11"]})
l1.rpc.preapproveinvoice(bolt11=inv["bolt11"]) # let the signer know this payment is coming
l1.rpc.call("renepay", {'invstring': inv['bolt11']})
l1.wait_for_htlcs()
invoice = only_one(l6.rpc.listinvoices("inv")["invoices"])
assert invoice["amount_received_msat"] >= Millisatoshi("1800000sat")
Expand All @@ -514,6 +520,7 @@ def test_previous_sendpays(node_factory, bitcoind):
# First case, do not overpay a pending MPP payment
invstr = l3.rpc.invoice("100000sat", "inv1", "description")["bolt11"]
inv = l1.rpc.decode(invstr)
l1.rpc.preapproveinvoice(bolt11=invstr) # let the signer know this payment is coming
route = l1.rpc.call(
"getroute", {"id": inv["payee"], "amount_msat": "50000sat", "riskfactor": 10}
)
Expand All @@ -538,6 +545,7 @@ def test_previous_sendpays(node_factory, bitcoind):
# Second case, do not collide with failed sendpays
invstr = l3.rpc.invoice("100000sat", "inv2", "description")["bolt11"]
inv = l1.rpc.decode(invstr)
l1.rpc.preapproveinvoice(bolt11=invstr) # let the signer know this payment is coming
route = l1.rpc.call(
"getroute", {"id": inv["payee"], "amount_msat": "50000sat", "riskfactor": 10}
)
Expand Down Expand Up @@ -614,6 +622,7 @@ def test_fees(node_factory):

# check that once gossip is in sync, fees are paid correctly
invstr = dest.rpc.invoice("100000sat", "inv1", "description")["bolt11"]
source.rpc.preapproveinvoice(bolt11=invstr) # let the signer know this payment is coming
source.rpc.call("renepay", {"invstring": invstr})
invoice = only_one(dest.rpc.listinvoices("inv1")["invoices"])
assert invoice["amount_received_msat"] == Millisatoshi("100000sat")
Expand All @@ -626,6 +635,7 @@ def test_fees(node_factory):
nodes[3].rpc.setchannel(nodes[4].info["id"], 3000, 350, enforcedelay=0)

invstr = dest.rpc.invoice("150000sat", "inv2", "description")["bolt11"]
source.rpc.preapproveinvoice(bolt11=invstr) # let the signer know this payment is coming
source.rpc.call("renepay", {"invstring": invstr})
invoice = only_one(dest.rpc.listinvoices("inv2")["invoices"])
assert invoice["amount_received_msat"] == Millisatoshi("150000sat")
2 changes: 1 addition & 1 deletion tests/test_splicing_insane.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def wait_for_restart(l1, l2):
l1.daemon.wait_for_log(r'peer_in WIRE_CHANNEL_REESTABLISH')
l2.daemon.wait_for_log(r'peer_in WIRE_CHANNEL_REESTABLISH')


@unittest.skipIf(os.getenv('SUBDAEMON').startswith('hsmd:remote_hsmd') and os.getenv('VLS_SKIP_SPLICE_TESTS') == '1', "test expected to fail before VLS dual-funding / splicing support")
@pytest.mark.openchannel('v1')
@pytest.mark.openchannel('v2')
@unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need')
Expand Down