Commit Graph

1056 Commits

Author SHA1 Message Date
Rusty Russell
ea0d00e677 topology: don't show private nodes in listnodes.
This breaks our tests a bit, which assumed we can always see ourselves
even if we don't have a proper channel.

Usually we would deprecate this first, but it's unlikely to break
anyone since it's a bit obscure that this worked at all.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Changed: JSON-RPC: `listnodes` no longer shows private (peer) nodes: use listpeers
2023-12-14 09:16:56 +10:30
Rusty Russell
1d9a6d1efa pyln-testing: when waiting for active channel, make sure remote has sent fee info.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-12-14 09:16:56 +10:30
Rusty Russell
c3f33eb6dd listpeerchannels: show gossip updates.
This is redundant if it's a public channel, but vital if it's not.  Publishing unconditionally makes
it easier for gossmap: we create a local modification all the time, even if redundant (and we can
have the actual capacity ceiling accurate in this case, since we know it for local channels).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

Changelog-Added: JSON-RPC: `listpeerchannels` now shows gossip update contents (even if channel unannounced).
2023-12-14 09:16:56 +10:30
Alex Myers
b0377d2323 misc: Add Alex's gpg key
Changelog-None
2023-12-11 18:46:43 +01:00
ShahanaFarooqui
f89e91332f misc: Add Shahana's gpg key
Changelog-None
2023-12-11 18:46:31 +01:00
Alex Myers
9585b7c238 startup_regtest: test for clnrest dependencies before writing config 2023-12-05 20:31:42 -06:00
Alex Myers
66e2bf2947 startup_regtest: configure clnrest and generate rune
This allows use of clnrest + websocket in the regtest environment.
If clnrest starts up, a rune is generated and provided along with
the connection info.

Also uses the snap installed bitcoind path if appropriate.

Format of the start_ln output is:
Commands:
	l1-cli, l1-log,
	l2-cli, l2-log,
	bt-cli, stop_ln, fund_nodes
Node Info:
	l1 rest: https://127.0.0.1:3110  rune: "lgkWSp0PQK-pkbElLpjcNVQnX7yfEjouJaJHjLuW8w89OA=="
	l2 rest: https://127.0.0.1:3111  rune: "sUqGqkevGYG2r1e_JUiz8Me00GhtTv5-IuGk4o9Beyc9OQ=="

Changelog-None
2023-12-05 20:31:42 -06:00
niftynei
5a29baafdd startup-regtest: fund_nodes make balanced, funded channels
Changelog-Changed: startup_regtest.sh: `fund_nodes` will now make balanced channels
2023-12-05 01:02:43 -06:00
niftynei
a1cecf044c startup-regtest: flag every use as developer
Now that 'developer' isn't a compile time flag, let's always use it
when using the startup regtest nodes.

Should always make gossip + polling bitcoind fast
2023-12-05 01:02:43 -06:00
niftynei
8476a15a44 startup-regtest: add ability to set bitcoin-bin + lightning-dir
We were using similar variables for different things (directories vs binary).

Update this to separate them out, while also adding ability to use a different directory
for lightning nodes

Changelog-Changed: startup_regtest.sh PATH_TO_LIGHTNING + PATH_TO_BITCOIN are no more. Use LIGHTNING_BIN and BITCOIN_DIR
2023-12-05 01:02:43 -06:00
Peter Neuroth
84f22066f2 misc: Add peter's gpg key
Signed-off-by: Peter Neuroth <pet.v.ne@gmail.com>

Changelog-None
2023-11-29 12:56:45 +01:00
Tony Aldon
672477c95c poetry: add requests dependency for clnrest tests in contrib/pyln-testing
`poetry update` did not change the poetry.lock file for contrib/pyln-testing
because it already has `requests`.
2023-11-16 09:07:07 +01:00
Christian Decker
94f4d75006 msggen: Add Wait method to managed API
Fixes #6792

Changelog-Added: Cln-RPC: Add `wait` system to cln-rpc and cln-grpc.
2023-11-16 09:02:33 +01:00
Christian Decker
bdfd2d5fda msggen: Add FetchInvoice method to Rust and grpc bindings
Closes #6844

Changelog-Added: Cln-RPC: Add `fetchinvoice` method to cln-rpc and cln-grpc.
2023-11-16 09:02:33 +01:00
Peter Neuroth
02ca226f88 CHANGELOG.md: Update for 23.11rc1
Update changelog, pyln versions, clnrest version and poetry.lock.

Signed-off-by: Peter Neuroth <pet.v.ne@gmail.com>
2023-11-03 14:49:12 +01:00
Peter Neuroth
b135ba2224 reprobuild: Upgrade rust version
We need to upgrade the rust version of the ubuntu docker images as
time-core v0.1.2 needs a version newer than 1.67.0

Signed-off-by: Peter Neuroth <pet.v.ne@gmail.com>
2023-11-02 19:52:46 +01:00
Peter Neuroth
1546127b23 docker: Add fix for broken setuptools installation
The fedora image installs a setuptools version that can not be upgraded
via pip. A fix is to remove the files manually and reinstall it via pip.

Signed-off-by: Peter Neuroth <pet.v.ne@gmail.com>
2023-11-02 19:52:46 +01:00
niftynei
ecb8d9d71f dual-fund: add new open-commit-ready state
From the spec:

	Once peers are ready to exchange commitment signatures, they must remember
	the details of the funding transaction to allow resuming the signatures
	exchange if a disconnection happens.

Basically this means we add channels to the database before we've gotten
commitments for them; it's nice that there's now a state for commitments
recevied but we now save the channel prior to that.

This commit makes it possible to track the pre-commit-rcvd but not quite
open-init state.
2023-11-02 19:32:05 +10:30
Rusty Russell
2482fd4427 pytest: detect RBF more reliably
```
2023-10-30T20:52:48.0652403Z [gw2] [ 63%] FAILED tests/test_closing.py::test_onchain_timeout[True]
...
...
bitcoind.generate_block(4)
        bitcoind.generate_block(1, wait_for_mempool=txid1)
>       l1.mine_txid_or_rbf(txid2)

tests/test_closing.py:1987: 
```

Turns out that the DEBUG-level "no feechange" RBF can happen, as we can actually
call the RBF routine before we even broadcast the first one:


```
2023-10-30T21:07:42.2201798Z lightningd-1 2023-10-30T20:49:44.184Z DEBUG   022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-chan#1: RBF onchain txid 14aa9c78fbcbff01faf96d3e734eba52355437078a67f46b8fbca9e72d1494e5 (fee 121sat) with txid 14aa9c78fbcbff01faf96d3e734eba52355437078a67f46b8fbca9e72d1494e5 (fee 121sat)
2023-10-30T21:07:42.2214788Z lightningd-1 2023-10-30T20:49:44.185Z DEBUG   022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-chan#1: RBF 02000000000101e37ffb981f28875509cd0069de2b457763cb252c9372725c1d8ba813c493b09e030000000005000000019b920d0000000000160014071c49cad2f420f3c805f9f6b98a57269cb1415003473044022007fff5174a0ea980ad158a4893cf9dcbc87dba1edf28adf8379bd7cdca6d8d1e02201b55b50e79446e580b4c53c6894f6c0384a36fd228a553f975c38cb128e454fd01004b632102f1d7d753e58aa4a0b3f245775f5588ac0f02f072d1854c5d846c3d1bac0738bb6755b27521033dbabb9463042008146aa9e5be6bc3fb48cfb3ead4bb1876f1c1a73159cc56a068ac00000000->02000000000101e37ffb981f28875509cd0069de2b457763cb252c9372725c1d8ba813c493b09e030000000005000000019b920d0000000000160014071c49cad2f420f3c805f9f6b98a57269cb1415003473044022007fff5174a0ea980ad158a4893cf9dcbc87dba1edf28adf8379bd7cdca6d8d1e02201b55b50e79446e580b4c53c6894f6c0384a36fd228a553f975c38cb128e454fd01004b632102f1d7d753e58aa4a0b3f245775f5588ac0f02f072d1854c5d846c3d1bac0738bb6755b27521033dbabb9463042008146aa9e5be6bc3fb48cfb3ead4bb1876f1c1a73159cc56a068ac00000000
2023-10-30T21:07:42.2230434Z lightningd-1 2023-10-30T20:49:44.196Z DEBUG   lightningd: sendrawtransaction: 02000000000101e37ffb981f28875509cd0069de2b457763cb252c9372725c1d8ba813c493b09e030000000005000000019b920d0000000000160014071c49cad2f420f3c805f9f6b98a57269cb1415003473044022007fff5174a0ea980ad158a4893cf9dcbc87dba1edf28adf8379bd7cdca6d8d1e02201b55b50e79446e580b4c53c6894f6c0384a36fd228a553f975c38cb128e454fd01004b632102f1d7d753e58aa4a0b3f245775f5588ac0f02f072d1854c5d846c3d1bac0738bb6755b27521033dbabb9463042008146aa9e5be6bc3fb48cfb3ead4bb1876f1c1a73159cc56a068ac00000000
...
2023-10-30T21:07:42.2258455Z lightningd-1 2023-10-30T20:49:44.250Z DEBUG   plugin-bcli: sendrawtx exit 0 (bitcoin-cli -regtest -datadir=/tmp/ltests-b6i5i0cl/test_onchain_timeout_1/lightning-1/ -rpcport=43613 -rpcuser=... -stdinrpcpass sendrawtransaction 02000000000101e37ffb981f28875509cd0069de2b457763cb252c9372725c1d8ba813c493b09e030000000005000000019b920d0000000000160014071c49cad2f420f3c805f9f6b98a57269cb1415003473044022007fff5174a0ea980ad158a4893cf9dcbc87dba1edf28adf8379bd7cdca6d8d1e02201b55b50e79446e580b4c53c6894f6c0384a36fd228a553f975c38cb128e454fd01004b632102f1d7d753e58aa4a0b3f245775f5588ac0f02f072d1854c5d846c3d1bac0738bb6755b27521033dbabb9463042008146aa9e5be6bc3fb48cfb3ead4bb1876f1c1a73159cc56a068ac00000000 0) 
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-11-01 14:11:28 +10:30
Rusty Russell
1d677bcba7 addpsbtoutput: allow command to specify output address.
Default is still to generate it.

Changelog-None: Introduced this release anyway.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-11-01 14:11:28 +10:30
Lagrang3
12d8ab6451
Remove error from startup_regtest when loading wallet
startup_regtest now checks if wallet directory exists before creating
the default wallet, then it will check if wallet is loaded before
attempting to load it. This prevents unnecessary errors during the
execution of this bash script.

[ Squashed fixup: `regtest: restore double quotes on PATH_TO_BITCOIN` -- RR ]
2023-10-31 12:57:54 +10:30
Rusty Russell
f2162bf202 lightningd: add ordering and pagination to listforwards.
Changelog-Added: JSON-RPC: `listforwards` new parameters `index`, `start` and `limit`.
2023-10-28 15:48:26 +10:30
Rusty Russell
1d8af90b56 listforwards: add created_index and updated_index fields.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: `listforwards` fields `created_index` (old: `id`) and `updated_index`.
2023-10-28 15:48:26 +10:30
Rusty Russell
c70a326f1f lightningd: add ordering and pagination to listsendpays.
Changelog-Added: JSON-RPC: `listsendpays` new parameters `index`, `start` and `limit`.
2023-10-28 15:48:26 +10:30
Rusty Russell
00ac1a9475 listsendpays: add created_index and updated_index fields.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: `sendpay`, `listsendpays`, `delpay` new fields `created_index` (old: `id`) and `updated_index`.
2023-10-28 15:48:26 +10:30
Aditya Sharma
b0c603581f doc/lightning-decode.7: Update the doc 2023-10-27 16:05:28 +10:30
Christian Decker
5c29cc6ef6 pyln: Add missing upgrade-version target to pyln-grpc 2023-10-26 15:51:07 +02:00
Chris Guida
88ac2dcb7e add test, update schemas, fix warning_custom_fallbacks 2023-10-26 19:11:17 +10:30
Chris Guida
fc4b2f864e add invoices-onchain-fallback config option and warnings
Changelog-Added: Config: `invoices-onchain-fallback` to automatically add an onchain p2tr address to invoices, and allow that for payment.
2023-10-26 19:11:17 +10:30
niftynei
411bb2884a fallback: json add fallback cleanup
Expand to handle P2TR addresses, use the common script encoding utility
function instead of reimplementing it.
2023-10-26 19:11:17 +10:30
Rusty Russell
95f20a3978 lightningd, pyln-testing: do extra checks to make sure check *cannot* write to db.
Put an assertion inside db.c, and run every command we do (in testing) through
a `check` variant.

I inserted a deliberate bug (made addpsbtoutput call wallet_get_newindex()
before returning when running `check`, and indeed, backtrace as expected.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-10-26 12:59:55 +10:30
Peter Neuroth
d032a17f75 pyln: Add datastoreusage command
Signed-off-by: Peter Neuroth <pet.v.ne@gmail.com>
2023-10-26 12:58:04 +10:30
Peter Neuroth
833b7b4baa grpc: Add datastoreusage command
Signed-off-by: Peter Neuroth <pet.v.ne@gmail.com>
2023-10-26 12:58:04 +10:30
Peter Neuroth
1b5dc2e055 msggen: Add datastoreusage command
Signed-off-by: Peter Neuroth <pet.v.ne@gmail.com>
2023-10-26 12:58:04 +10:30
Rusty Russell
075f79033a pyln-testing: fix LihgtningNode.openchannel()
`[False]` is considered True in Python, so this flake fix didn't work.

```
>>> if [False]:
...     print('x')
... 
x
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-10-25 07:00:05 +10:30
Rusty Russell
dfe207d503 pytest: test for accepting even unknown messages.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-10-24 11:50:57 +10:30
Vincenzo Palazzo
dd7393e6bb proto: update the bitstring dep
This is an alternative version to [1] that
update only the necessary information around our codebase
to upgrade the bitstring package.

This upgrade is necessary for the user of our package that
will find conflics in their codebase about packages version.

[1] https://github.com/ElementsProject/lightning/pull/6585

Co-Developed-by: @dni
Chanegelog-None
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2023-10-24 11:49:32 +10:30
Peter Neuroth
d89d4d5a3c grpc: Regenerate proto stubs
Hopefully this will fix the ci.

Signed-off-by: Peter Neuroth <pet.v.ne@gmail.com>
2023-10-24 10:24:52 +10:30
Christian Decker
dfea5fbe6d grpc: Add WaitBlockHeight method to grpc interface 2023-10-24 10:24:52 +10:30
Christian Decker
394e926cb7 rs: Fix up grpc conversions 2023-10-24 10:24:52 +10:30
Rusty Russell
6a67615274 pyln-testing: make disconnects continue after restart.
We truncate the file on stop(), but don't re-created it on start().

We didn't notice it before, but the net

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-10-23 15:48:50 +10:30
Michael Schmoock
8ac9c73ea8 pytests: make pay helper able to route (optionaly)
This makes the pay helper function being able to route
a payment using the optional `route` paramter that defaults to `False`.

I added this, as some plugins maintained their own version of `pay` that
needed routed payment helper.

Changelog-None
2023-10-17 14:53:53 +10:30
Tony Aldon
1a46b37609 contrib: add developer option to config file in startup_regtest.sh.
Without `developer` option, after compiling CLN and sourcing
`contrib/startup_regtest.sh`, if we try to start 2 nodes on regtest
running the command `start_ln` we get the following error:

```
lightningd: Config file /tmp/l1-regtest/config line 6: dev-fast-gossip: requires --developer
...
lightningd: Config file /tmp/l2-regtest/config line 6: dev-fast-gossip: requires --developer
```

Changelog-None
2023-10-10 23:04:31 +10:30
Rusty Russell
176a58f9e0 pytest: wean many tests off the assumption that listchannels shows private channels.
We will be changing this, or at least deprecating it, so get our
tests ready.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-10-04 08:02:33 +10:30
Dusty Daemon
bc9333ac1e addpsbtoutput: New onchain command for PSBT output
Also added splice_out tests that use the new PSBT command.

ChangeLog-Added: New `addpsbtoutput` command for creating a PSBT that can receive funds to the on-chain wallet.
2023-10-03 10:12:39 +02:00
Rusty Russell
5b9b056853 doc: introduce new state DUALOPEND_OPEN_COMMITTED.
This is the variant of DUALOPEND_OPEN_INIT which you see once
the channel is in the db: we'll be adding it next, but to reduce
clutter the docs are added as a separate commit.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-10-02 11:41:19 +10:30
Rusty Russell
57a3680449 contrib/pyln-grpc-proto/ regenerate.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-10-02 11:41:19 +10:30
Christian Decker
9afcec0404 lnproto: Fix up the lnprototest docker image 2023-09-29 16:00:05 +09:30
Christian Decker
1242012efb gen: Update generated files 2023-09-29 16:00:05 +09:30
ShahanaFarooqui
4301030a12 plugins/clnrest: Updated clnrest install command in Docker images and CI
We do not need explicit clnrest dependencies installation for clnrest
because `poetry install` will also install clnrest libraries.
2023-09-29 16:00:05 +09:30