Commit Graph

13754 Commits

Author SHA1 Message Date
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
ShahanaFarooqui
6a756256c0 plugins/clnrest: Adding pyproject.toml for Poetry install
Reference links:
https://github.com/ElementsProject/lightning/issues/6637
https://github.com/nix-community/poetry2nix

Changelog-Changed: Upgraded clnrest to poetry project.
2023-09-29 16:00:05 +09:30
Vincenzo Palazzo
7354a9ee1c lnprototest: bump to the new version
Thi commit includes the following change in lnprototest:

- cln: fix the check on the exit code (https://github.com/rustyrussell/lnprototest/pull/111)

Link: https://github.com/ElementsProject/lightning/issues/6727
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2023-09-29 12:57:57 +09:30
Vincenzo Palazzo
57ead06e3c ci: autopublish rust crates on tag event
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2023-09-28 14:00:59 +02:00
Vincenzo Palazzo
a51894f510 rust: fixes the dependencies build with the rustc 1.73.0
This commit is just bumping the Cargo.lock file to
fix the following build issue with the more
recent rust version.

cargo build --quiet --example cln-plugin-startup
error[E0635]: unknown feature `proc_macro_span_shrink`
  --> /home/vincent/.cargo/registry/src/index.crates.io-6f17d22bba15001f/proc-macro2-1.0.59/src/lib.rs:92:30
   |
92 |     feature(proc_macro_span, proc_macro_span_shrink)
   |                              ^^^^^^^^^^^^^^^^^^^^^^

For more information about this error, try `rustc --explain E0635`.
error: could not compile `proc-macro2` (lib) due to previous error

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2023-09-28 14:00:59 +02:00
Matt Whitlock
15b1ccb149 Makefile: use xargs -0 consistently
In its default mode, `xargs` interprets any whitespace as a delimiter,
and it interprets single and double quotes and backslashes specially.
This can play havoc when fed by tools that don't escape these special
characters in their output.

Fortunately, `xargs` (at least the GNU version of it) has a `-0` option
that changes the behavior so that only NUL characters act as delimiters,
and no other characters have any special meaning. Use this option
consistently to avoid any nasty surprises.

Note that `git-ls-files` has a `-z` option that causes it to terminate
filenames on output with a NUL character instead of a newline, and
`grep` has a `-z` option that causes it to operate on NUL-terminated
records rather than on lines. Use these options together with
`xargs -0`.

Note: This commit corrects an oversight introduced in
9d94687b0d.

Changelog-None
2023-09-27 13:01:39 +09:30
Christian Decker
4121941d92 pytest: Fix elementsd tests 2023-09-26 19:21:05 +02:00
Christian Decker
9a51418e82 gci: Update apt before installing
A stale apt-get cache could otherwise cause a test failure.
2023-09-26 19:21:05 +02:00
Christian Decker
d82d561593 gci: Print envvars and configuration when testing 2023-09-26 19:21:05 +02:00
Christian Decker
36494b6a51 gci: Only install one of elementsd or bitcoind
We were accidentally testing against `bitcoind` rather than
`elementsd` which meant we believed everything was find, when in
reality some tests broke. By only installing the required daemon we
ensure that such a mixup causes a CI failure.
2023-09-26 19:21:05 +02:00
Christian Decker
8ac63daf71 ci: Unbreak the liquid-regtest run on Github Actions 2023-09-26 19:21:05 +02:00
hMsats
dc16f3411b Only 3 question marks for 4 variables 2023-09-26 11:52:27 +02:00
Rusty Russell
577161a4fa renepay: remove custom debug, in favor of normal operations.
As a bonus, unit tests no longer leave files in /tmp.

Reported-by: https://github.com/whitslack
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-09-25 13:59:13 +09:30
Matt Whitlock
7c582944bd lightningd/test: use tmpdir_mkstemp() to create log file
Changelog-None
2023-09-25 13:59:13 +09:30
Matt Whitlock
2d904d3655 configure: recognize --disable-ub-sanitizer option
There was a typo in the `case` pattern. Now we recognize both forms.

Changelog-None
2023-09-25 13:58:59 +09:30
Vincenzo Palazzo
376e2f9997 lnprototest: included the last lnprototest fixes
This commit is upgrading lnprototest to patch some bugs
reported by Rusty.

Including:

- Support the Drop of the --developer flag at runtime (https://github.com/rustyrussell/lnprototest/pull/106)
- Fixing reorg issue in the ln helper function (https://github.com/rustyrussell/lnprototest/pull/107)

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2023-09-25 12:00:40 +09:30
Rusty Russell
39cb8d094e pyln-grpc-proto: regenerate after last patch.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-09-22 16:41:38 +09:30
daywalker90
10eeceabd5 add CHANNELD_AWAITING_SPLICE state to cln-rpc 2023-09-21 18:53:51 +02:00
Rusty Russell
9d94687b0d Makefile: don't fail find -delete if we run in parallel.
Use xargs rm -f which doesn't care if it's already deleted.

```
find contrib/pyln-grpc-proto/pyln/ -type f -name "*.py.bak" -delete
find contrib/pyln-grpc-proto/pyln/ -type f -name "*.py.bak" -delete
find: cannot delete ‘contrib/pyln-grpc-proto/pyln/grpc/node_pb2_grpc.py.bak’: No such file or directory
make: *** [Makefile:390: contrib/pyln-grpc-proto/pyln/grpc/node_pb2.py] Error 1
make: *** Waiting for unfinished jobs....
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-09-21 20:08:24 +09:30
Rusty Russell
3d3bf87b34 build: remove all trace of DEVELOPER.
If you previously configured with `--enable-developer` we turn that into `--enable-debugbuild`.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Removed: build: `--enable-developer` arg to configure (and DEVELOPER variables): use `./configure --enable-debugbuild` and `developer` setting at runtime.
2023-09-21 20:08:24 +09:30
Rusty Russell
6c15ea44dd pytest: use --developer instead of environment variable.
And we always enable it.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-09-21 20:08:24 +09:30
Rusty Russell
573ce14509 tools: remove DEVELOPER.
We can now always enable developer using --developer.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-09-21 20:08:24 +09:30
Rusty Russell
2bcae6fc76 plugins/renepay: remove DEVELOPER build-time, in favor of runtime.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-09-21 20:08:24 +09:30
Rusty Russell
3e124d9ec1 lightningd: remove #if DEVELOPER.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-09-21 20:08:24 +09:30
Rusty Russell
f725edad62 plugins: remove #if DEVELOPER.
And rename dev-only-option `use_shadow` to `dev_use_shadow`.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-09-21 20:08:24 +09:30
Rusty Russell
ef87999f9a common: add option for dev-only parameters.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-09-21 20:08:24 +09:30
Rusty Russell
de81a59b1e lightningd: mark explicitly what commands are dev-only.
And require --developer to use them.

Also refuse redirection to deprecated APIs if deprecated APIs are disabled! 

Changelog-Removed: `dev-sendcustommsg` (use `sendcustommsg`, which was added in v0.10.1)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-09-21 20:08:24 +09:30
Rusty Russell
1ecf31bae7 db: remove #if DEVELOPER in favor of runtime flag inside db struct.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-09-21 20:08:24 +09:30
Rusty Russell
af91c6fae3 closingd: remove #if DEVELOPER in favor of runtime flag.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-09-21 20:08:24 +09:30
Rusty Russell
60def0ead7 hsmd: remove #if DEVELOPER in favor of runtime flag.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-09-21 20:08:24 +09:30
Rusty Russell
1fc603ea6e gossipd: remove #if DEVELOPER in favor of runtime flag.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-09-21 20:08:24 +09:30
Rusty Russell
f2d8f37f1f channeld: remove #if DEVELOPER in favor of runtime flag.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-09-21 20:08:24 +09:30
Rusty Russell
01119fbe26 openingd: remove #if DEVELOPER in favor of runtime flag.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-09-21 20:08:24 +09:30
Rusty Russell
dba4af37f1 onchaind: remove #if DEVELOPER.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-09-21 20:08:24 +09:30
Rusty Russell
0ff91e65dc connectd: remove #if DEVELOPER
We still refuse to run dev commands if lightningd sends it to us
despite us not being in developer mode, but that's mainly paranoia.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-09-21 20:08:24 +09:30
Rusty Russell
91b5a3b323 bitcoin: remove DEVELOPER options.
Mainly removing the PSBT re-marshalling which hasn't had any issues in
recent libwally, and making dev_no_grind into the clearer
dev_no_signature_grind.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-09-21 20:08:24 +09:30
Rusty Russell
c5f6893e28 common: remove #if DEVELOPER.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-09-21 20:08:24 +09:30
Rusty Russell
dee94f215b common/bolt11: remove #if DEVELOPER.
We expose the dev handles directly for the test vectors to use.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-09-21 20:08:24 +09:30
Rusty Russell
a9f26b7d07 common/daemon.c: remove #ifdef DEVELOPER in favor of runtime flag.
Also requires us to expose memleak when !DEVELOPER, however we only
ever used the memleak tracking when the LIGHTNINGD_DEV_MEMLEAK
environment variable was set, so keep that.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-09-21 20:08:24 +09:30
Rusty Russell
67a391f8d0 lightningd: pass --developer down to plugins, subdaemons when it set.
They might need to know this before they do anything, so cmdline seems most
natural.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-09-21 20:08:24 +09:30
Rusty Russell
64ab7c0c1d lightningd: add --developer runtime option.
Currently it just defaults to the DEVELOPER compile option, but we'll
move over to this.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: Config: `--developer` enables developer options and changes default to be "disable deprecated APIs".
2023-09-21 20:08:24 +09:30
Rusty Russell
5882978147 lightningd: fix bogus unused var warning.
We check for list_empty, so it's always actually set.

```
lightningd/peer_control.c: In function ‘drop_to_chain’:
lightningd/peer_control.c:353:17: error: ‘tx’ may be used uninitialized [-Werror=maybe-uninitialized]
  353 |                 resolve_close_command(ld, channel, cooperative, tx);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lightningd/peer_control.c:341:36: note: ‘tx’ was declared here
  341 |                 struct bitcoin_tx *tx;
      |                                    ^~
cc1: all warnings being treated as errors
make: *** [Makefile:298: lightningd/peer_control.o] Error 1
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-09-21 20:08:24 +09:30
Rusty Russell
354907c2fd lnprototest: update to branch which supports --developer
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-09-21 20:08:24 +09:30
Rusty Russell
a0f4eb9a22 wallet/test: regenerate mocks to fix build.
Somehow broke in a rebase.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2023-09-21 15:52:44 +09:30
Dusty Daemon
0a5ef7f2e6 splice: Fixes from splice-out test
Added a test for splicing out that exposed some behavior and code glitches that are addressed in this commit.

Added test for splice gossip.

Also added documentation for how to do a splice out.

ChangeLog-Fixed: Added docs, testing, and some fixes related to splicing out, insufficent balance handling, and restarting during a splice.
2023-09-21 13:41:45 +09:30
ShahanaFarooqui
f60882feaf tests/runes: per restriction test cases 2023-09-21 13:31:34 +09:30
ShahanaFarooqui
91eb184141 lightningd/runes: Added last_time_check for validating rune for per restriction
Changelog-Added: runes: `per=Nsec/min/hour/msec/usec/nsec` for general ratelimiting
2023-09-21 13:31:34 +09:30
ShahanaFarooqui
3f95597a5e common: make json_add_timeabs full precision & renamed json_add_time
json_add_timeabs only printed in milliseconds and json_add_time outputs a string which is weird

Changelog-Changed: JSON-RPC time fields now have full nanosecond precision (i.e. 9 decimals not 3): `listfowards` `received_time` `resolved_time` `listpays`/`listsendpays` `created_at`.
2023-09-21 13:31:34 +09:30
ShahanaFarooqui
d745323f74 lightning/runes: added last_used in showrunes
Changelog-Added: JSON-RPC: `showrunes` new field `last_used`
2023-09-21 13:31:34 +09:30
ShahanaFarooqui
db55deae2a lightningd/runes: update last_used timestamp when a rune successfully used 2023-09-21 13:31:34 +09:30