From 352494bf486a99fd1e28b84518eb4bc795cea1e3 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Mon, 30 Dec 2024 17:15:09 +0100 Subject: [PATCH 1/7] docs: Add pyproject.toml file --- docs/pyproject.toml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 docs/pyproject.toml diff --git a/docs/pyproject.toml b/docs/pyproject.toml new file mode 100644 index 000000000..7c8caec90 --- /dev/null +++ b/docs/pyproject.toml @@ -0,0 +1,17 @@ +[project] +name = "gl-docs" +version = "0.1.0" +description = "Add your description here" +readme = "README.md" +requires-python = ">=3.10" +dependencies = [ + "mkdocs>=1.6.1", + "mkdocs-material>=9.5.49", + "mkdocs-redirects>=1.2.2", + "mkdocs-material-extensions>=1.3.1", + "pymdown-extensions>=10.13", + "ghp-import>=2.1.0", + "pdoc>=15.0.1", + "cairosvg>=2.7.1", + "pillow>=11.0.0", +] From 153d3ef24b634db9a83c1aae139bdbfa8198bfd6 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Wed, 8 Jan 2025 11:57:00 +0100 Subject: [PATCH 2/7] fix(tests): Protect the `test_log_rpc` from concurrent tests The `nodelet` and the `plugin` were using an absolute path, which would get clobbered by concurrent tests, which can then lead to spurious fails. Using relative paths makes this much more stable. --- libs/gl-plugin/src/node/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/gl-plugin/src/node/mod.rs b/libs/gl-plugin/src/node/mod.rs index ac43fd51d..bbf7347a0 100644 --- a/libs/gl-plugin/src/node/mod.rs +++ b/libs/gl-plugin/src/node/mod.rs @@ -230,7 +230,9 @@ impl Node for PluginNodeServer { // log entries are produced while we're streaming the // backlog out, but do we care? use tokio::io::{AsyncBufReadExt, BufReader}; - let file = tokio::fs::File::open("/tmp/log").await?; + // The nodelet uses its CWD, but CLN creates a network + // subdirectory + let file = tokio::fs::File::open("../log").await?; let mut file = BufReader::new(file).lines(); tokio::spawn(async move { From d256758defa6f4ecb53b8ce716c186dea90877da Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Fri, 10 Jan 2025 14:02:12 +0100 Subject: [PATCH 3/7] tests: Add a quick check that `newaddr` works correctly --- libs/gl-testing/tests/test_grpc_web.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libs/gl-testing/tests/test_grpc_web.py b/libs/gl-testing/tests/test_grpc_web.py index be37a3550..ce9c1e936 100644 --- a/libs/gl-testing/tests/test_grpc_web.py +++ b/libs/gl-testing/tests/test_grpc_web.py @@ -47,6 +47,7 @@ def test_node_grpc_web(scheduler, node_grpc_web_proxy, clients): c = clients.new() c.register(configure=True) n = c.node() + _s = c.signer().run_in_thread() info = n.get_info() # Now extract the TLS certificates, so we can sign the payload. @@ -62,3 +63,8 @@ def test_node_grpc_web(scheduler, node_grpc_web_proxy, clients): req = clnpb.GetinfoRequest() info = web_client.call("Getinfo", req) print(info) + + # Ask for a new address + req = clnpb.NewaddrRequest() + addr = web_client.call("NewAddr", req) + print(addr) From 393a0897958389766ae0093782496006fd0f0b43 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Wed, 22 Jan 2025 14:09:04 +0100 Subject: [PATCH 4/7] ci: Fix the cln-version-manager tests --- pyproject.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index fb189dbb6..66624e20e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,9 @@ requires-python = ">=3.9" dependencies = [] [tool.uv] -package = false +dev-dependencies = [ + "pytest-timeout>=2.3.1", +] [tool.uv.workspace] members = [ From 3c5d20b38ba5941ebb3b9e9381d7bea6c3ad14c3 Mon Sep 17 00:00:00 2001 From: Peter Neuroth Date: Fri, 10 Jan 2025 13:06:30 +0100 Subject: [PATCH 5/7] lsp: Remove redundant `Promise` creation Previously, the deserialization logic called `Promise::new` twice, once in a temp variable and again for the final return. This commit removes the unused temorary assignement. Signed-off-by: Peter Neuroth --- libs/gl-client/src/lsps/lsps2/schema.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libs/gl-client/src/lsps/lsps2/schema.rs b/libs/gl-client/src/lsps/lsps2/schema.rs index f79e4bf61..09918b086 100644 --- a/libs/gl-client/src/lsps/lsps2/schema.rs +++ b/libs/gl-client/src/lsps/lsps2/schema.rs @@ -39,9 +39,7 @@ impl<'de> Deserialize<'de> for Promise { D: serde::Deserializer<'de>, { let str_repr = String::deserialize(deserializer)?; - let promise = Promise::new(str_repr.clone()); - Promise::new(str_repr.clone()) - .map_err(|_| D::Error::custom("promise exceeds max length")) + Promise::new(str_repr.clone()).map_err(|_| D::Error::custom("promise exceeds max length")) } } From abeb3db96789102830d4a2b03a80546b1016f30e Mon Sep 17 00:00:00 2001 From: Peter Neuroth Date: Fri, 10 Jan 2025 13:08:09 +0100 Subject: [PATCH 6/7] plugin: Remove unused import Signed-off-by: Peter Neuroth --- libs/gl-plugin/src/node/mod.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/libs/gl-plugin/src/node/mod.rs b/libs/gl-plugin/src/node/mod.rs index bbf7347a0..ca0f68b84 100644 --- a/libs/gl-plugin/src/node/mod.rs +++ b/libs/gl-plugin/src/node/mod.rs @@ -7,7 +7,6 @@ use crate::{stager, tramp}; use anyhow::{Context, Error, Result}; use base64::{engine::general_purpose, Engine as _}; use bytes::BufMut; -use gl_client::bitcoin::hashes::hex::ToHex; use gl_client::persist::State; use governor::{ clock::MonotonicClock, state::direct::NotKeyed, state::InMemoryState, Quota, RateLimiter, From 96df1472fc549f1aec47e27424242cc577a0ff00 Mon Sep 17 00:00:00 2001 From: Peter Neuroth Date: Fri, 10 Jan 2025 13:13:06 +0100 Subject: [PATCH 7/7] plugin: Allow dead code for `UdsConnectInfo` Cargo complaints about the unused fields in `UdsConnectInfo`. Currently the `UnixStream` in this file really seems to be unused but I assume that it is going to be needed in the future. Signed-off-by: Peter Neuroth --- libs/gl-plugin/src/unix.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/gl-plugin/src/unix.rs b/libs/gl-plugin/src/unix.rs index a163b833f..f00df4fce 100644 --- a/libs/gl-plugin/src/unix.rs +++ b/libs/gl-plugin/src/unix.rs @@ -22,6 +22,7 @@ impl Connected for UnixStream { } #[derive(Clone, Debug)] +#[allow(dead_code)] // TODO: Check if this is really needed. pub struct UdsConnectInfo { pub peer_addr: Option>, pub peer_cred: Option,