diff --git a/.rustfmt.toml b/.rustfmt.toml new file mode 100644 index 00000000..4bfbfddb --- /dev/null +++ b/.rustfmt.toml @@ -0,0 +1,3 @@ +imports_granularity = 'Module' +comment_width = 80 +wrap_comments = true diff --git a/Cargo.lock b/Cargo.lock index 9d3e5ed5..b54a8520 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,18 +4,30 @@ version = 3 [[package]] name = "addr2line" -version = "0.22.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" +checksum = "f5fb1d8e4442bd405fdfd1dacb42792696b0cf9cb15882e5d097b742a676d375" dependencies = [ "gimli", ] [[package]] -name = "adler" -version = "1.0.2" +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + +[[package]] +name = "ahash" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +checksum = "72832d73be48bac96a5d7944568f305d829ed55b0ce3b483647089dfaf6cf704" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] [[package]] name = "aho-corasick" @@ -32,6 +44,18 @@ version = "0.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0eb452e0d760aaeb2339812aef595b287a782b10ccb9a09ec9fefddf809f1ca" +[[package]] +name = "allocator-api2" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + [[package]] name = "android_log-sys" version = "0.2.0" @@ -45,56 +69,163 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8619b80c242aa7bd638b5c7ddd952addeecb71f69c75e33f1d47b2804f8f883a" dependencies = [ "android_log-sys", - "env_logger", + "env_logger 0.10.2", "log", "once_cell", ] +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + [[package]] name = "anstyle-query" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" +checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anyhow" -version = "1.0.86" +version = "1.0.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" + +[[package]] +name = "as-any" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b8a30a44e99a1c83ccb2a6298c563c888952a1c9134953db26876528f84c93a" + +[[package]] +name = "async-stream" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" +dependencies = [ + "async-stream-impl", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-stream-impl" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] [[package]] name = "async-trait" -version = "0.1.80" +version = "0.1.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" +checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.79", +] + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi 0.1.19", + "libc", + "winapi", ] [[package]] name = "autocfg" -version = "1.3.0" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "axum" +version = "0.6.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" +dependencies = [ + "async-trait", + "axum-core", + "bitflags 1.3.2", + "bytes", + "futures-util", + "http", + "http-body", + "hyper", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "sync_wrapper", + "tower", + "tower-layer", + "tower-service", +] + +[[package]] +name = "axum-core" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http", + "http-body", + "mime", + "rustversion", + "tower-layer", + "tower-service", +] + +[[package]] +name = "backoff" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "b62ddb9cb1ec0a098ad4bbf9344d0713fa193ae1a80af55febcff2627b6a00c1" +dependencies = [ + "futures-core", + "getrandom", + "instant", + "pin-project-lite", + "rand", + "tokio", +] [[package]] name = "backtrace" -version = "0.3.72" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17c6a35df3749d2e8bb1b7b21a976d82b15548788d2735b9d82f329268f71a11" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", "miniz_oxide", "object", "rustc-demangle", + "windows-targets 0.52.6", ] [[package]] @@ -109,6 +240,21 @@ version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "base64-compat" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a8d4d2746f89841e49230dd26917df1876050f95abafafbe34f47cb534b88d7" +dependencies = [ + "byteorder", +] + [[package]] name = "bdk" version = "1.0.0-alpha.11" @@ -167,6 +313,15 @@ version = "0.10.0-beta" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98f7eed2b2781a6f0b5c903471d48e15f56fb4e1165df8a9a2337fd1a59d45ea" +[[package]] +name = "beef" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" +dependencies = [ + "serde", +] + [[package]] name = "bip39" version = "2.0.0" @@ -178,6 +333,12 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + [[package]] name = "bitcoin" version = "0.30.2" @@ -187,6 +348,7 @@ dependencies = [ "bech32 0.9.1", "bitcoin-private", "bitcoin_hashes 0.12.0", + "bitcoinconsensus", "hex_lit", "secp256k1 0.27.0", "serde", @@ -217,6 +379,17 @@ dependencies = [ "bech32 0.8.1", ] +[[package]] +name = "bitcoin-consensus-derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d56036c7fe1f5c0b097b7bb69da9bcc60cce90589cbf2cc907670a420033a55d" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "bitcoin-internals" version = "0.2.0" @@ -232,6 +405,17 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73290177011694f38ec25e165d0387ab7ea749a4b81cd4c80dae5988229f7a57" +[[package]] +name = "bitcoin-push-decoder" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee01fc59f06261a3727830dc61fd87f9f9ae503194d7aea0306a2535a9a06a3d" +dependencies = [ + "bitcoin 0.30.2", + "hex", + "log", +] + [[package]] name = "bitcoin_hashes" version = "0.11.0" @@ -259,6 +443,16 @@ dependencies = [ "serde", ] +[[package]] +name = "bitcoinconsensus" +version = "0.20.2-0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54505558b77e0aa21b2491a7b39cbae9db22ac8b1bc543ef4600edb762306f9c" +dependencies = [ + "cc", + "libc", +] + [[package]] name = "bitcoincore-rpc" version = "0.17.0" @@ -293,9 +487,28 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" + +[[package]] +name = "block-buffer" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bolt-derive" +version = "0.3.1" +source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer?branch=main#4e2fda4a3ab25dca51f0edf2c2ca7e1fbefe5ee7" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] [[package]] name = "bumpalo" @@ -311,19 +524,19 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.6.0" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" +checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" [[package]] name = "cc" -version = "1.0.99" +version = "1.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96c51067fd44124faa7f870b4b1c969379ad32b2ba805aa959430ceaa384f695" +checksum = "9540e661f81799159abee814118cc139a2004b3a3aa3ea37724a1b66530b90e0" dependencies = [ "jobserver", "libc", - "once_cell", + "shlex", ] [[package]] @@ -334,9 +547,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "cfg_aliases" -version = "0.1.1" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "chrono" @@ -344,13 +557,89 @@ version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ + "android-tzdata", + "iana-time-zone", "num-traits", + "serde", + "windows-targets 0.52.6", +] + +[[package]] +name = "chunked-buffer" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa622bd314835eb026b776af471344d0dba94705c937900656a31d0407e53689" + +[[package]] +name = "ciborium" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" +dependencies = [ + "ciborium-io", + "ciborium-ll", + "serde", +] + +[[package]] +name = "ciborium-io" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" + +[[package]] +name = "ciborium-ll" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" +dependencies = [ + "ciborium-io", + "half", +] + +[[package]] +name = "clap" +version = "3.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" +dependencies = [ + "atty", + "bitflags 1.3.2", + "clap_derive", + "clap_lex", + "indexmap 1.9.3", + "once_cell", + "strsim 0.10.0", + "termcolor", + "textwrap", +] + +[[package]] +name = "clap_derive" +version = "3.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008" +dependencies = [ + "heck", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "clap_lex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +dependencies = [ + "os_str_bytes", ] [[package]] name = "clightning-testing" version = "0.1.0" -source = "git+https://github.com/laanwj/cln4rust.git#c0744fa90dd5fc711198e55e80e06d549e9f94b5" +source = "git+https://github.com/laanwj/cln4rust.git#a20c7a2729b0d5e70aee46b97dcaaa297c88334a" dependencies = [ "anyhow", "bitcoincore-rpc", @@ -364,7 +653,7 @@ dependencies = [ [[package]] name = "clightningrpc" version = "0.3.0-beta.8" -source = "git+https://github.com/laanwj/cln4rust.git#c0744fa90dd5fc711198e55e80e06d549e9f94b5" +source = "git+https://github.com/laanwj/cln4rust.git#a20c7a2729b0d5e70aee46b97dcaaa297c88334a" dependencies = [ "clightningrpc-common", "serde", @@ -384,7 +673,7 @@ dependencies = [ [[package]] name = "clightningrpc-conf" version = "0.0.3" -source = "git+https://github.com/laanwj/cln4rust.git?branch=master#c0744fa90dd5fc711198e55e80e06d549e9f94b5" +source = "git+https://github.com/laanwj/cln4rust.git?branch=master#a20c7a2729b0d5e70aee46b97dcaaa297c88334a" dependencies = [ "albert_stream", "indexmap 1.9.3", @@ -401,6 +690,31 @@ dependencies = [ "winapi", ] +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "cpufeatures" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" +dependencies = [ + "libc", +] + [[package]] name = "crossbeam-channel" version = "0.5.13" @@ -416,83 +730,205 @@ version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + [[package]] name = "ctrlc" -version = "3.4.4" +version = "3.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "672465ae37dc1bc6380a6547a8883d5dd397b0f1faaad4f265726cc7042a5345" +checksum = "90eeab0aa92f3f9b4e87f258c72b139c207d251f9cbc1080a0086b86a8870dd3" dependencies = [ - "nix", - "windows-sys 0.52.0", + "nix 0.29.0", + "windows-sys 0.59.0", ] [[package]] -name = "deranged" -version = "0.3.11" +name = "darling" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ - "powerfmt", + "darling_core", + "darling_macro", ] [[package]] -name = "dyn-clone" -version = "1.0.17" +name = "darling_core" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim 0.11.1", + "syn 2.0.79", +] [[package]] -name = "env_logger" -version = "0.10.2" +name = "darling_macro" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ - "log", - "regex", + "darling_core", + "quote", + "syn 2.0.79", ] [[package]] -name = "equivalent" -version = "1.0.1" +name = "delegate" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "35c47a31748d9cfa641f6cccb3608385fafe261ba36054f3d40d5a3ca11eb1af" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] [[package]] -name = "errno" -version = "0.3.9" +name = "digest" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" dependencies = [ - "libc", - "windows-sys 0.52.0", + "generic-array", ] [[package]] -name = "fastrand" -version = "2.1.0" +name = "dirs" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" +dependencies = [ + "dirs-sys", +] [[package]] -name = "filelock-rs" -version = "0.1.0-beta.2" +name = "dirs-sys" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6427c04067bba5e8ceb9a2826fe30568c7d615ff560b4a6fec7a626b528057b" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" dependencies = [ "libc", + "redox_users", + "winapi", ] [[package]] -name = "form_urlencoded" -version = "1.2.1" +name = "dyn-clone" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" -dependencies = [ - "percent-encoding", -] +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" [[package]] -name = "futures" +name = "either" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" + +[[package]] +name = "encoding_rs" +version = "0.8.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "env_logger" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "env_logger" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" +dependencies = [ + "log", + "regex", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "fastrand" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" + +[[package]] +name = "fern" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9f0c14694cbd524c8720dd69b0e3179344f04ebb5f90f2e4a440c6ea3b2f1ee" +dependencies = [ + "colored", + "log", +] + +[[package]] +name = "filelock-rs" +version = "0.1.0-beta.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6427c04067bba5e8ceb9a2826fe30568c7d615ff560b4a6fec7a626b528057b" +dependencies = [ + "libc", +] + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures" version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" @@ -547,7 +983,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.79", ] [[package]] @@ -589,6 +1025,16 @@ dependencies = [ "byteorder", ] +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + [[package]] name = "getrandom" version = "0.2.15" @@ -602,9 +1048,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.29.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" +checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" [[package]] name = "git2" @@ -612,13 +1058,42 @@ version = "0.18.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "232e6a7bfe35766bf715e55a88b39a700596c0ccfd88cd3680b4cdb40d66ef70" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "libc", "libgit2-sys", "log", "url", ] +[[package]] +name = "h2" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap 2.5.0", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "half" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" +dependencies = [ + "cfg-if", + "crunchy", +] + [[package]] name = "hashbrown" version = "0.12.3" @@ -627,9 +1102,51 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.14.5" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashbrown" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "heapmon" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf84b8972db62c05ac874852a5b78521626f9ab0de3a8dd5a2a49b7c90cef562" +dependencies = [ + "backtrace", + "chrono", + "fern", + "log", + "once_cell", + "regex", +] + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] [[package]] name = "hermit-abi" @@ -637,6 +1154,12 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +[[package]] +name = "hermit-abi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" + [[package]] name = "hex" version = "0.4.3" @@ -655,6 +1178,142 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3011d1213f159867b13cfd6ac92d2cd5f1345762c63be3554e84092d85a50bbd" +[[package]] +name = "home" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "http" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "http-range-header" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "add0ab9360ddbd88cfeb3bd9574a1d85cfdfa14db10b3e21d3700dbc4328758f" + +[[package]] +name = "httparse" +version = "1.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "hyper" +version = "0.14.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" +dependencies = [ + "futures-util", + "http", + "hyper", + "log", + "rustls", + "rustls-native-certs", + "tokio", + "tokio-rustls", +] + +[[package]] +name = "hyper-timeout" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" +dependencies = [ + "hyper", + "pin-project-lite", + "tokio", + "tokio-io-timeout", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "idna" version = "0.5.0" @@ -677,12 +1336,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.6" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" dependencies = [ "equivalent", - "hashbrown 0.14.5", + "hashbrown 0.14.2", ] [[package]] @@ -691,7 +1350,7 @@ version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fddf93031af70e75410a2511ec04d49e758ed2f26dad3404a934e0fb45cc12a" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "dyn-clone", "fxhash", "newline-converter", @@ -702,17 +1361,41 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "instant" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "ipnet" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "187674a687eed5fe42285b40c6291f9a01517d415fad1c3cbc6a9f778af7fcd4" + [[package]] name = "is-terminal" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" +checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" dependencies = [ - "hermit-abi", + "hermit-abi 0.4.0", "libc", "windows-sys 0.52.0", ] +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.11" @@ -721,18 +1404,18 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jobserver" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" dependencies = [ "wasm-bindgen", ] @@ -749,23 +1432,108 @@ dependencies = [ ] [[package]] -name = "lampo-bitcoind" -version = "0.1.0" +name = "jsonrpc-async" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a20e8e4ed08ee58717113cbf277b1ecef5cd9554d3e48c114de338289727d466" dependencies = [ - "bitcoincore-rpc", - "lampo-common", - "log", + "async-trait", + "base64-compat", + "serde", + "serde_derive", + "serde_json", + "tokio", ] [[package]] -name = "lampo-c-ffi" -version = "0.1.0" +name = "jsonrpsee" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9579d0ca9fb30da026bac2f0f7d9576ec93489aeb7cd4971dd5b4617d82c79b2" dependencies = [ - "android_logger", - "lampo-bitcoind", - "lampo-common", - "lampo-core-wallet", - "lampo-jsonrpc", + "jsonrpsee-core", + "jsonrpsee-server", + "jsonrpsee-types", + "tokio", +] + +[[package]] +name = "jsonrpsee-core" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "776d009e2f591b78c038e0d053a796f94575d66ca4e77dd84bfc5e81419e436c" +dependencies = [ + "anyhow", + "async-trait", + "beef", + "futures-util", + "hyper", + "jsonrpsee-types", + "parking_lot", + "rand", + "rustc-hash", + "serde", + "serde_json", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "jsonrpsee-server" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cc7c6d1a2c58f6135810284a390d9f823d0f508db74cd914d8237802de80f98" +dependencies = [ + "futures-util", + "http", + "hyper", + "jsonrpsee-core", + "jsonrpsee-types", + "pin-project", + "route-recognizer", + "serde", + "serde_json", + "soketto", + "thiserror", + "tokio", + "tokio-stream", + "tokio-util", + "tower", + "tracing", +] + +[[package]] +name = "jsonrpsee-types" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3266dfb045c9174b24c77c2dfe0084914bb23a6b2597d70c9dc6018392e1cd1b" +dependencies = [ + "anyhow", + "beef", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "lampo-bitcoind" +version = "0.1.0" +dependencies = [ + "bitcoincore-rpc", + "lampo-common", + "log", +] + +[[package]] +name = "lampo-c-ffi" +version = "0.1.0" +dependencies = [ + "android_logger", + "lampo-bitcoind", + "lampo-common", + "lampo-core-wallet", + "lampo-jsonrpc", "lampod", "libc", "log", @@ -859,6 +1627,20 @@ dependencies = [ "tokio", ] +[[package]] +name = "lampo-vls" +version = "0.1.0" +dependencies = [ + "hex", + "lampo-common", + "log", + "triggered", + "url", + "vls-core", + "vls-persist", + "vls-proxy", +] + [[package]] name = "lampod" version = "0.0.1" @@ -894,9 +1676,9 @@ dependencies = [ [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "lexopt" @@ -906,9 +1688,9 @@ checksum = "baff4b617f7df3d896f97fe922b64817f6cd9a756bb81d40f8883f2f66dcb401" [[package]] name = "libc" -version = "0.2.155" +version = "0.2.159" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" [[package]] name = "libgit2-sys" @@ -928,16 +1710,26 @@ version = "0.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3af92c55d7d839293953fcd0fda5ecfe93297cfde6ffbdec13b41d99c0ba6607" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "libc", "redox_syscall 0.4.1", ] +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.6.0", + "libc", +] + [[package]] name = "libz-sys" -version = "1.1.18" +version = "1.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c15da26e5af7e25c90b37a2d75cdbf940cf4a55316de9d84c679c9b8bfabf82e" +checksum = "d2d16453e800a8cf6dd2fc3eb4bc99b786a9b90c663b8559a5b1a041bf89e472" dependencies = [ "cc", "libc", @@ -953,6 +1745,7 @@ checksum = "5fd92d4aa159374be430c7590e169b4a6c0fb79018f5bc4ea1bffde536384db3" dependencies = [ "bitcoin 0.30.2", "hex-conservative", + "regex", ] [[package]] @@ -1021,6 +1814,36 @@ dependencies = [ "lightning", ] +[[package]] +name = "lightning-storage-server" +version = "0.3.1" +source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer?branch=main#4e2fda4a3ab25dca51f0edf2c2ca7e1fbefe5ee7" +dependencies = [ + "anyhow", + "async-trait", + "bitcoin_hashes 0.11.0", + "ciborium", + "clap", + "ctrlc", + "dirs", + "fern", + "futures", + "hex", + "itertools", + "log", + "prost", + "redb", + "secp256k1 0.27.0", + "serde", + "thiserror", + "time", + "tokio", + "tonic", + "tonic-build", + "triggered", + "url", +] + [[package]] name = "linux-raw-sys" version = "0.4.14" @@ -1039,21 +1862,60 @@ dependencies = [ [[package]] name = "log" -version = "0.4.21" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" + +[[package]] +name = "lru" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a83fb7698b3643a0e34f9ae6f2e8f0178c0fd42f8b59d493aa271ff3a5bf21" +dependencies = [ + "hashbrown 0.14.2", +] + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + +[[package]] +name = "matchit" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" [[package]] name = "memchr" -version = "2.7.2" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "memoffset" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +dependencies = [ + "autocfg", +] + +[[package]] +name = "mime" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "miniscript" -version = "11.0.0" +version = "11.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86a23dd3ad145a980e231185d114399f25a0a307d2cd918010ddda6334323df9" +checksum = "3127e10529a57a8f7fa9b1332c4c2f72baadaca6777798f910dff3c922620b14" dependencies = [ "bech32 0.10.0-beta", "bitcoin 0.31.2", @@ -1063,24 +1925,31 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.7.3" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" dependencies = [ - "adler", + "adler2", ] [[package]] name = "mio" -version = "0.8.11" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ + "hermit-abi 0.3.9", "libc", "wasi", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] +[[package]] +name = "multimap" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" + [[package]] name = "newline-converter" version = "0.3.0" @@ -1092,11 +1961,24 @@ dependencies = [ [[package]] name = "nix" -version = "0.28.0" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" +dependencies = [ + "bitflags 1.3.2", + "cfg-if", + "libc", + "memoffset", + "pin-utils", +] + +[[package]] +name = "nix" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" +checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cfg-if", "cfg_aliases", "libc", @@ -1104,9 +1986,9 @@ dependencies = [ [[package]] name = "ntest" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41cd16a2e6992865367e7ca50cd6953d09daaed93641421168733a1274afadd6" +checksum = "fb183f0a1da7a937f672e5ee7b7edb727bf52b8a52d531374ba8ebb9345c0330" dependencies = [ "ntest_test_cases", "ntest_timeout", @@ -1114,9 +1996,9 @@ dependencies = [ [[package]] name = "ntest_test_cases" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "197eff6c12b80ff5de6173e438fa3c1340a9e708118c1626e690f65aee1e5332" +checksum = "16d0d3f2a488592e5368ebbe996e7f1d44aa13156efad201f5b4d84e150eaa93" dependencies = [ "proc-macro2", "quote", @@ -1125,9 +2007,9 @@ dependencies = [ [[package]] name = "ntest_timeout" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef492b5cf80f90c050b287e747228a1fa6517e9d754f364b5a7e0e038e49a25f" +checksum = "fcc7c92f190c97f79b4a332f5e81dcf68c8420af2045c936c9be0bc9de6f63b5" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -1135,12 +2017,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "num-conv" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" - [[package]] name = "num-traits" version = "0.2.19" @@ -1150,16 +2026,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi", - "libc", -] - [[package]] name = "numtoa" version = "0.1.0" @@ -1168,9 +2034,9 @@ checksum = "b8f8bdf33df195859076e54ab11ee78a1b208382d3a26ec40d142ffc1ecc49ef" [[package]] name = "object" -version = "0.35.0" +version = "0.36.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8ec7ab813848ba4522158d5517a6093db1ded27575b070f4177b8d12b41db5e" +checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" dependencies = [ "memchr", ] @@ -1181,6 +2047,24 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +[[package]] +name = "opaque-debug" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "os_str_bytes" +version = "6.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" + [[package]] name = "parking_lot" version = "0.12.3" @@ -1199,9 +2083,9 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.1", + "redox_syscall 0.5.6", "smallvec", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -1210,6 +2094,36 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +[[package]] +name = "petgraph" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +dependencies = [ + "fixedbitset", + "indexmap 2.5.0", +] + +[[package]] +name = "pin-project" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + [[package]] name = "pin-project-lite" version = "0.2.14" @@ -1224,9 +2138,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "popol" @@ -1247,40 +2161,125 @@ dependencies = [ ] [[package]] -name = "powerfmt" -version = "0.2.0" +name = "ppv-lite86" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] [[package]] -name = "ppv-lite86" -version = "0.2.17" +name = "prettyplease" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86" +dependencies = [ + "proc-macro2", + "syn 1.0.109", +] [[package]] name = "proc-macro-crate" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" dependencies = [ "toml_edit", ] +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + [[package]] name = "proc-macro2" -version = "1.0.85" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] +[[package]] +name = "prost" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-build" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "119533552c9a7ffacc21e099c24a0ac8bb19c2a2a3f363de84cd9b844feab270" +dependencies = [ + "bytes", + "heck", + "itertools", + "lazy_static", + "log", + "multimap", + "petgraph", + "prettyplease", + "prost", + "prost-types", + "regex", + "syn 1.0.109", + "tempfile", + "which", +] + +[[package]] +name = "prost-derive" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" +dependencies = [ + "anyhow", + "itertools", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "prost-types" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" +dependencies = [ + "prost", +] + [[package]] name = "quote" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -1333,6 +2332,15 @@ dependencies = [ "getrandom", ] +[[package]] +name = "redb" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd7f82ecd6ba647a39dd1a7172b8a1cd9453c0adee6da20cb553d83a9a460fa5" +dependencies = [ + "libc", +] + [[package]] name = "redox_syscall" version = "0.4.1" @@ -1344,11 +2352,11 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.1" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +checksum = "355ae415ccd3a04315d3f8246e86d67689ea74d88d915576e1589a351062a13b" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", ] [[package]] @@ -1357,16 +2365,36 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "20145670ba436b55d91fc92d25e71160fbfbdd57831631c8d7d36377a476f1cb" +[[package]] +name = "redox_users" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" +dependencies = [ + "getrandom", + "libredox 0.1.3", + "thiserror", +] + [[package]] name = "regex" -version = "1.10.5" +version = "1.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" +checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" dependencies = [ "aho-corasick", "memchr", - "regex-automata", - "regex-syntax", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", ] [[package]] @@ -1377,46 +2405,188 @@ checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", - "regex-syntax", + "regex-syntax 0.8.4", ] [[package]] name = "regex-syntax" -version = "0.8.4" +version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] -name = "rustc-demangle" -version = "0.1.24" +name = "regex-syntax" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] -name = "rustix" -version = "0.38.34" +name = "reqwest" +version = "0.11.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" dependencies = [ - "bitflags 2.5.0", - "errno", + "base64 0.21.7", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-rustls", + "ipnet", + "js-sys", + "log", + "mime", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "system-configuration", + "tokio", + "tokio-rustls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "webpki-roots", + "winreg", +] + +[[package]] +name = "ring" +version = "0.17.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +dependencies = [ + "cc", + "cfg-if", + "getrandom", + "libc", + "spin", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "route-recognizer" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afab94fb28594581f62d981211a9a4d53cc8130bbcbbb89a0440d9b8e81a7746" + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustix" +version = "0.38.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" +dependencies = [ + "bitflags 2.6.0", + "errno", "libc", "linux-raw-sys", "windows-sys 0.52.0", ] +[[package]] +name = "rustls" +version = "0.21.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" +dependencies = [ + "log", + "ring", + "rustls-webpki", + "sct", +] + +[[package]] +name = "rustls-native-certs" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" +dependencies = [ + "openssl-probe", + "rustls-pemfile", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64 0.21.7", +] + +[[package]] +name = "rustls-webpki" +version = "0.101.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" + [[package]] name = "ryu" version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +[[package]] +name = "schannel" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b" +dependencies = [ + "windows-sys 0.59.0", +] + [[package]] name = "scopeguard" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "sct" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "secp256k1" version = "0.27.0" @@ -1459,38 +2629,149 @@ dependencies = [ "cc", ] +[[package]] +name = "security-framework" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" +dependencies = [ + "bitflags 2.6.0", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "serde" -version = "1.0.203" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" dependencies = [ "serde_derive", ] +[[package]] +name = "serde_bolt" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bffab210d8357b433ffab5b3fd39d56f7fddb5eb36c84039fa455933ef05209f" +dependencies = [ + "bitcoin 0.30.2", + "bitcoin-consensus-derive", + "chunked-buffer", + "hex", +] + [[package]] name = "serde_derive" -version = "1.0.203" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.79", ] [[package]] name = "serde_json" -version = "1.0.117" +version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" +checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" dependencies = [ - "indexmap 2.2.6", + "indexmap 2.5.0", "itoa", + "memchr", "ryu", "serde", ] +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_with" +version = "3.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ad483d2ab0149d5a5ebcd9972a3852711e0153d863bf5a5d0391d28883c4a20" +dependencies = [ + "base64 0.22.1", + "chrono", + "hex", + "serde", + "serde_derive", + "serde_json", + "serde_with_macros", + "time", +] + +[[package]] +name = "serde_with_macros" +version = "3.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65569b702f41443e8bc8bbb1c5779bd0450bbe723b56198980e80ec45780bce2" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.79", +] + +[[package]] +name = "serde_yaml" +version = "0.9.34+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" +dependencies = [ + "indexmap 2.5.0", + "itoa", + "ryu", + "serde", + "unsafe-libyaml", +] + +[[package]] +name = "sha-1" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" +dependencies = [ + "block-buffer", + "cfg-if", + "cpufeatures", + "digest", + "opaque-debug", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + [[package]] name = "shlex" version = "1.3.0" @@ -1531,6 +2812,40 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "soketto" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d1c5305e39e09653383c2c7244f2f78b3bcae37cf50c64cb4789c9f5096ec2" +dependencies = [ + "base64 0.13.1", + "bytes", + "futures", + "http", + "httparse", + "log", + "rand", + "sha-1", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + [[package]] name = "syn" version = "1.0.109" @@ -1543,132 +2858,500 @@ dependencies = [ ] [[package]] -name = "syn" -version = "2.0.66" +name = "syn" +version = "2.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "tempfile" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" +dependencies = [ + "cfg-if", + "fastrand", + "once_cell", + "rustix", + "windows-sys 0.59.0", +] + +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "termion" +version = "2.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4648c7def6f2043b2568617b9f9b75eae88ca185dbc1f1fda30e95a85d49d7d" +dependencies = [ + "libc", + "libredox 0.0.2", + "numtoa", + "redox_termios", +] + +[[package]] +name = "termion" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "417813675a504dfbbf21bfde32c03e5bf9f2413999962b479023c02848c1c7a5" +dependencies = [ + "libc", + "libredox 0.0.2", + "numtoa", + "redox_termios", +] + +[[package]] +name = "tests" +version = "0.1.0" +dependencies = [ + "lampo-common", + "lampo-testing", + "log", + "ntest", + "serde_json", + "tokio", +] + +[[package]] +name = "textwrap" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" + +[[package]] +name = "thiserror" +version = "1.0.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + +[[package]] +name = "thread_local" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "time" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a561bf4617eebd33bca6434b988f39ed798e527f51a1e797d0ee4f61c0a38376" +dependencies = [ + "itoa", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" + +[[package]] +name = "time-macros" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d967f99f534ca7e495c575c62638eebc2898a8c84c119b89e250477bc4ba16b2" +dependencies = [ + "time-core", +] + +[[package]] +name = "tinyvec" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.40.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.52.0", +] + +[[package]] +name = "tokio-io-timeout" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" +dependencies = [ + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-macros" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + +[[package]] +name = "tokio-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "tokio-stream" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" +dependencies = [ + "bytes", + "futures-core", + "futures-io", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_datetime" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" + +[[package]] +name = "toml_edit" +version = "0.22.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" +dependencies = [ + "indexmap 2.5.0", + "toml_datetime", + "winnow", +] + +[[package]] +name = "tonic" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3082666a3a6433f7f511c7192923fa1fe07c69332d3c6a2e6bb040b569199d5a" +dependencies = [ + "async-stream", + "async-trait", + "axum", + "base64 0.21.7", + "bytes", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-timeout", + "percent-encoding", + "pin-project", + "prost", + "rustls-pemfile", + "tokio", + "tokio-rustls", + "tokio-stream", + "tower", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tonic-build" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6fdaae4c2c638bb70fe42803a26fbd6fc6ac8c72f5c59f67ecc2a2dcabf4b07" +dependencies = [ + "prettyplease", + "proc-macro2", + "prost-build", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "indexmap 1.9.3", + "pin-project", + "pin-project-lite", + "rand", + "slab", + "tokio", + "tokio-util", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-http" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140" +dependencies = [ + "base64 0.21.7", + "bitflags 2.6.0", + "bytes", + "futures-core", + "futures-util", + "http", + "http-body", + "http-range-header", + "mime", + "pin-project-lite", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "tracing" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", ] [[package]] -name = "tempfile" -version = "3.10.1" +name = "tracing-appender" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "3566e8ce28cc0a3fe42519fc80e6b4c943cc4c8cef275620eb8dac2d3d4e06cf" dependencies = [ - "cfg-if", - "fastrand", - "rustix", - "windows-sys 0.52.0", + "crossbeam-channel", + "thiserror", + "time", + "tracing-subscriber", ] [[package]] -name = "termion" -version = "2.0.3" +name = "tracing-attributes" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4648c7def6f2043b2568617b9f9b75eae88ca185dbc1f1fda30e95a85d49d7d" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ - "libc", - "libredox", - "numtoa", - "redox_termios", + "proc-macro2", + "quote", + "syn 2.0.79", ] [[package]] -name = "termion" -version = "3.0.0" +name = "tracing-core" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "417813675a504dfbbf21bfde32c03e5bf9f2413999962b479023c02848c1c7a5" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ - "libc", - "libredox", - "numtoa", - "redox_termios", + "once_cell", + "valuable", ] [[package]] -name = "tests" -version = "0.1.0" +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" dependencies = [ - "lampo-common", - "lampo-testing", "log", - "ntest", - "serde_json", - "tokio", + "once_cell", + "tracing-core", ] [[package]] -name = "time" -version = "0.3.36" +name = "tracing-subscriber" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ - "deranged", - "num-conv", - "powerfmt", - "serde", - "time-core", + "matchers", + "once_cell", + "regex", + "sharded-slab", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", ] [[package]] -name = "time-core" +name = "triggered" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" - -[[package]] -name = "tinyvec" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" -dependencies = [ - "tinyvec_macros", -] +checksum = "ce148eae0d1a376c1b94ae651fc3261d9cb8294788b962b7382066376503a2d1" [[package]] -name = "tinyvec_macros" -version = "0.1.1" +name = "try-lock" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] -name = "tokio" -version = "1.38.0" +name = "txoo" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" +checksum = "5675f1c4ed9845d91baa88cc10aff641867ed17b32440f9e26cd04c086610ba0" dependencies = [ - "backtrace", - "bytes", - "libc", - "mio", - "num_cpus", - "parking_lot", - "pin-project-lite", - "signal-hook-registry", - "socket2", - "windows-sys 0.48.0", + "async-trait", + "bitcoin 0.30.2", + "hyper", + "hyper-rustls", + "log", + "serde", + "serde_bolt", + "serde_yaml", + "url", ] [[package]] -name = "toml_datetime" -version = "0.6.6" +name = "txoo-bitcoind-client" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" +checksum = "f6a2765d35bcdbcc5b213fe7460c3cbd59d339ca8d47539a2a14b561af945cfc" +dependencies = [ + "async-trait", + "bitcoin 0.30.2", + "hex", + "jsonrpc-async", + "log", + "reqwest", + "serde", + "serde_json", + "tokio", + "txoo", + "url", +] [[package]] -name = "toml_edit" -version = "0.21.1" +name = "typenum" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" -dependencies = [ - "indexmap 2.2.6", - "toml_datetime", - "winnow", -] +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unicode-bidi" @@ -1687,9 +3370,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "unicode-normalization" @@ -1702,33 +3385,235 @@ dependencies = [ [[package]] name = "unicode-segmentation" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" [[package]] name = "unicode-width" -version = "0.1.13" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" + +[[package]] +name = "unsafe-libyaml" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" + +[[package]] +name = "untrusted" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.0" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna", "percent-encoding", ] +[[package]] +name = "uuid" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" +dependencies = [ + "getrandom", +] + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + [[package]] name = "vcpkg" version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "vls-common" +version = "0.12.0" +source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer?branch=main#4e2fda4a3ab25dca51f0edf2c2ca7e1fbefe5ee7" +dependencies = [ + "hex", +] + +[[package]] +name = "vls-core" +version = "0.12.0" +source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer?branch=main#4e2fda4a3ab25dca51f0edf2c2ca7e1fbefe5ee7" +dependencies = [ + "ahash", + "anyhow", + "backtrace", + "bitcoin 0.30.2", + "bitcoin-consensus-derive", + "bitcoin-push-decoder", + "bolt-derive", + "env_logger 0.9.3", + "hashbrown 0.13.2", + "hex", + "itertools", + "lightning", + "lightning-invoice", + "log", + "scopeguard", + "serde", + "serde_bolt", + "serde_derive", + "serde_with", + "tracing", + "txoo", + "vls-common", +] + +[[package]] +name = "vls-frontend" +version = "0.12.0" +source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer?branch=main#4e2fda4a3ab25dca51f0edf2c2ca7e1fbefe5ee7" +dependencies = [ + "async-trait", + "lightning-storage-server", + "log", + "tokio", + "triggered", + "txoo-bitcoind-client", + "url", + "vls-core", +] + +[[package]] +name = "vls-persist" +version = "0.12.0" +source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer?branch=main#4e2fda4a3ab25dca51f0edf2c2ca7e1fbefe5ee7" +dependencies = [ + "hex", + "log", + "redb", + "serde", + "serde_json", + "serde_with", + "tempfile", + "tracing", + "uuid", + "vls-core", +] + +[[package]] +name = "vls-protocol" +version = "0.12.0" +source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer?branch=main#4e2fda4a3ab25dca51f0edf2c2ca7e1fbefe5ee7" +dependencies = [ + "as-any", + "bitcoin-consensus-derive", + "bolt-derive", + "hex", + "log", + "serde_bolt", + "txoo", + "vls-core", +] + +[[package]] +name = "vls-protocol-client" +version = "0.12.0" +source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer?branch=main#4e2fda4a3ab25dca51f0edf2c2ca7e1fbefe5ee7" +dependencies = [ + "anyhow", + "async-trait", + "bit-vec", + "delegate", + "log", + "vls-core", + "vls-protocol", + "vls-protocol-signer", +] + +[[package]] +name = "vls-protocol-signer" +version = "0.12.0" +source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer?branch=main#4e2fda4a3ab25dca51f0edf2c2ca7e1fbefe5ee7" +dependencies = [ + "bit-vec", + "log", + "vls-core", + "vls-protocol", +] + +[[package]] +name = "vls-proxy" +version = "0.12.0" +source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer?branch=main#4e2fda4a3ab25dca51f0edf2c2ca7e1fbefe5ee7" +dependencies = [ + "anyhow", + "as-any", + "async-stream", + "async-trait", + "backoff", + "base64 0.21.7", + "clap", + "ctrlc", + "dirs", + "fern", + "futures", + "heapmon", + "hex", + "http", + "hyper", + "jsonrpsee", + "lightning-storage-server", + "log", + "lru", + "nix 0.26.4", + "prost", + "serde", + "thiserror", + "time", + "tokio", + "tokio-stream", + "toml", + "tonic", + "tonic-build", + "tower", + "tower-http", + "tracing", + "tracing-appender", + "tracing-subscriber", + "triggered", + "txoo-bitcoind-client", + "url", + "vls-core", + "vls-frontend", + "vls-persist", + "vls-protocol", + "vls-protocol-client", + "vls-protocol-signer", +] + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -1737,34 +3622,47 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.79", "wasm-bindgen-shared", ] +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1772,22 +3670,50 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.79", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" + +[[package]] +name = "web-sys" +version = "0.3.70" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki-roots" +version = "0.25.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" + +[[package]] +name = "which" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix", +] [[package]] name = "winapi" @@ -1805,12 +3731,30 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +[[package]] +name = "winapi-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +dependencies = [ + "windows-sys 0.59.0", +] + [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.6", +] + [[package]] name = "windows-sys" version = "0.48.0" @@ -1826,7 +3770,16 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", ] [[package]] @@ -1846,18 +3799,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -1868,9 +3821,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -1880,9 +3833,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -1892,15 +3845,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -1910,9 +3863,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -1922,9 +3875,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -1934,9 +3887,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -1946,19 +3899,50 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.5.40" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" dependencies = [ "memchr", ] +[[package]] +name = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.79", +] + [[package]] name = "zeroize" version = "1.8.1" diff --git a/Cargo.toml b/Cargo.toml index 67e3169b..472de849 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,6 +9,8 @@ members = [ "lampo-client", "lampo-c-ffi", "lampo-core-wallet", + "lampo-vls", + "lampo-testing", "tests/tests", ] @@ -23,5 +25,6 @@ default-members = [ "lampo-client", "lampo-c-ffi", "lampo-core-wallet", + "lampo-vls", ] resolver = "2" diff --git a/Makefile b/Makefile index fc7b7746..2c51ed7a 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ default: fmt $(CC) build fmt: - $(CC) fmt --all + $(CC) +nightly fmt --all # $(CC) clippy --workspace check: diff --git a/lampo-bitcoind/src/lib.rs b/lampo-bitcoind/src/lib.rs index 25cc7fda..513715bf 100644 --- a/lampo-bitcoind/src/lib.rs +++ b/lampo-bitcoind/src/lib.rs @@ -9,19 +9,17 @@ use std::time::Duration; use bitcoincore_rpc::bitcoin::hashes::Hash; use bitcoincore_rpc::bitcoin::ScriptBuf; use bitcoincore_rpc::bitcoincore_rpc_json::GetTxOutResult; -use bitcoincore_rpc::Client; -use bitcoincore_rpc::RpcApi; +use bitcoincore_rpc::{Client, RpcApi}; -use lampo_common::backend::{deserialize, serialize}; -use lampo_common::backend::{Backend, TxResult}; -use lampo_common::backend::{Block, BlockData, BlockHash}; +use lampo_common::backend::{ + deserialize, serialize, Backend, Block, BlockData, BlockHash, TxResult, +}; use lampo_common::bitcoin::absolute::Height; use lampo_common::bitcoin::{Transaction, Txid}; -use lampo_common::error; use lampo_common::event::onchain::OnChainEvent; use lampo_common::event::Event; use lampo_common::handler::Handler; -use lampo_common::json; +use lampo_common::{error, json}; pub struct BitcoinCore { inner: Client, @@ -343,7 +341,8 @@ impl Backend for BitcoinCore { else { unreachable!() }; - // SAFETY: the outpoint should be always present otherwise we are looking inside the wrong tx + // SAFETY: the outpoint should be always present otherwise we are looking inside + // the wrong tx let outpoint = tx .vout .iter() @@ -466,12 +465,13 @@ impl Backend for BitcoinCore { // bitcoind wallet for our transaction. // // This is the only place where we can query because otherwise we can - // confuse ldk when we send a new best block with height X and a Confirmed transaction - // event at height Y, where Y > X. In this way ldk think that a reorgs happens. + // confuse ldk when we send a new best block with height X and a Confirmed + // transaction event at height Y, where Y > X. In this way + // ldk think that a reorgs happens. // - // The reorgs do not happen commonly, it is only that the bitcoind wallet is able - // to answer quickly while the lampo wallet is still looking - // for external transaction inside the blocks. + // The reorgs do not happen commonly, it is only that the bitcoind wallet is + // able to answer quickly while the lampo wallet is still + // looking for external transaction inside the blocks. let _ = self.process_transactions(); } else if self.best_height.borrow().lt(&height.into()) { log::trace!(target: "bitcoind", "New best block at height {height}, out current best block is {}", self.best_height.borrow()); diff --git a/lampo-c-ffi/src/lib.rs b/lampo-c-ffi/src/lib.rs index c98e0573..7a7b6fab 100644 --- a/lampo-c-ffi/src/lib.rs +++ b/lampo-c-ffi/src/lib.rs @@ -1,8 +1,7 @@ //! Exposing C FFI for interact with Lampo API //! and build easly a node. use std::cell::Cell; -use std::sync::Arc; -use std::sync::Mutex; +use std::sync::{Arc, Mutex}; use lampo_bitcoind::BitcoinCore; use lampo_common::backend::Backend; @@ -204,8 +203,8 @@ pub extern "C" fn new_lampod(conf_path: *const libc::c_char) -> *mut LampoDaemon Box::into_raw(lampod) } -/// Add a JSON RPC 2.0 Sever that listen on a unixsocket, and return a error code -/// < 0 is an error happens, or 0 is all goes well. +/// Add a JSON RPC 2.0 Sever that listen on a unixsocket, and return a error +/// code < 0 is an error happens, or 0 is all goes well. #[no_mangle] pub extern "C" fn lampo_last_errror() -> *const libc::c_char { let value = LAST_ERR.lock().unwrap().take(); @@ -214,8 +213,8 @@ pub extern "C" fn lampo_last_errror() -> *const libc::c_char { } null!() } -/// Add a JSON RPC 2.0 Sever that listen on a unixsocket, and return a error code -/// < 0 is an error happens, or 0 is all goes well. +/// Add a JSON RPC 2.0 Sever that listen on a unixsocket, and return a error +/// code < 0 is an error happens, or 0 is all goes well. #[no_mangle] pub extern "C" fn add_jsonrpc_on_unixsocket(lampod: *mut LampoDaemon) -> i64 { use lampo_jsonrpc::JSONRPCv2; diff --git a/lampo-cli/src/args.rs b/lampo-cli/src/args.rs index 30c05d71..0f5d5254 100644 --- a/lampo-cli/src/args.rs +++ b/lampo-cli/src/args.rs @@ -2,8 +2,7 @@ use std::collections::HashMap; use radicle_term as term; -use lampo_common::error; -use lampo_common::json; +use lampo_common::{error, json}; #[derive(Debug)] pub struct LampoCliArgs { diff --git a/lampo-cli/src/main.rs b/lampo-cli/src/main.rs index 25f77f5b..cdcf4005 100644 --- a/lampo-cli/src/main.rs +++ b/lampo-cli/src/main.rs @@ -6,8 +6,7 @@ use radicle_term as term; use lampo_client::errors::Error; use lampo_client::UnixClient; -use lampo_common::error; -use lampo_common::json; +use lampo_common::{error, json}; use crate::args::LampoCliArgs; diff --git a/lampo-common/src/backend.rs b/lampo-common/src/backend.rs index c77fdae8..2a3000c9 100644 --- a/lampo-common/src/backend.rs +++ b/lampo-common/src/backend.rs @@ -46,14 +46,18 @@ pub trait Backend { fn is_lightway(&self) -> bool; - /// You must follow this step if: you are not providing full blocks to LDK, i.e. if you're using BIP 157/158 or Electrum as your chain backend + /// You must follow this step if: you are not providing full blocks to LDK, + /// i.e. if you're using BIP 157/158 or Electrum as your chain backend /// - /// What it's used for: if you are not providing full blocks, LDK uses this object to tell you what transactions and outputs to watch for on-chain. + /// What it's used for: if you are not providing full blocks, LDK uses this + /// object to tell you what transactions and outputs to watch for on-chain. fn watch_utxo(&self, txid: &Txid, script: &Script); - /// You must follow this step if: you are not providing full blocks to LDK, i.e. if you're using BIP 157/158 or Electrum as your chain backend + /// You must follow this step if: you are not providing full blocks to LDK, + /// i.e. if you're using BIP 157/158 or Electrum as your chain backend /// - /// What it's used for: if you are not providing full blocks, LDK uses this object to tell you what transactions and outputs to watch for on-chain. + /// What it's used for: if you are not providing full blocks, LDK uses this + /// object to tell you what transactions and outputs to watch for on-chain. fn register_output(&self, output: WatchedOutput) -> Option<(usize, Transaction)>; fn get_header<'a>( diff --git a/lampo-common/src/event.rs b/lampo-common/src/event.rs index a7ee985a..7495b7cc 100644 --- a/lampo-common/src/event.rs +++ b/lampo-common/src/event.rs @@ -23,7 +23,8 @@ impl Default for Emitter { } impl Emitter { - /// Emit an event to all subscribers and drop subscribers who can't receive it. + /// Emit an event to all subscribers and drop subscribers who can't receive + /// it. pub fn emit(&self, event: T) { self.subscribers .lock() diff --git a/lampo-common/src/keys.rs b/lampo-common/src/keys.rs index 8f220f39..fbcb6075 100644 --- a/lampo-common/src/keys.rs +++ b/lampo-common/src/keys.rs @@ -1,4 +1,5 @@ -use std::{sync::Arc, time::SystemTime}; +use std::sync::Arc; +use std::time::SystemTime; use bitcoin::secp256k1::{Secp256k1, SecretKey}; use lightning::sign::{InMemorySigner, NodeSigner, OutputSpender, SignerProvider}; @@ -12,7 +13,8 @@ pub struct LampoKeys { impl LampoKeys { pub fn new(seed: [u8; 32]) -> Self { - // Fill in random_32_bytes with secure random data, or, on restart, reload the seed from disk. + // Fill in random_32_bytes with secure random data, or, on restart, reload the + // seed from disk. let start_time = SystemTime::now() .duration_since(SystemTime::UNIX_EPOCH) .unwrap(); @@ -28,7 +30,8 @@ impl LampoKeys { #[cfg(debug_assertions)] pub fn with_channel_keys(seed: [u8; 32], channels_keys: String) -> Self { - // Fill in random_32_bytes with secure random data, or, on restart, reload the seed from disk. + // Fill in random_32_bytes with secure random data, or, on restart, reload the + // seed from disk. let start_time = SystemTime::now() .duration_since(SystemTime::UNIX_EPOCH) .unwrap(); diff --git a/lampo-common/src/lib.rs b/lampo-common/src/lib.rs index 0a6d7d6e..62dbff48 100644 --- a/lampo-common/src/lib.rs +++ b/lampo-common/src/lib.rs @@ -11,10 +11,10 @@ pub mod wallet; pub mod ldk { pub use lightning::*; - pub use lightning_background_processor as processor; - pub use lightning_invoice as invoice; - pub use lightning_net_tokio as net; - pub use lightning_persister as persister; + pub use { + lightning_background_processor as processor, lightning_invoice as invoice, + lightning_net_tokio as net, lightning_persister as persister, + }; } pub mod error { @@ -44,7 +44,8 @@ pub mod btc_rpc { #[derive(Debug, Serialize, Deserialize)] pub struct MinimumMempoolFee { - /// Minimum fee rate in BTC/kB for tx to be accepted. Is the maximum of minrelaytxfee and minimum mempool fee + /// Minimum fee rate in BTC/kB for tx to be accepted. Is the maximum of + /// minrelaytxfee and minimum mempool fee pub mempoolminfee: f32, } } diff --git a/lampo-common/src/model/close_channel.rs b/lampo-common/src/model/close_channel.rs index 74ba8c4d..94a93210 100644 --- a/lampo-common/src/model/close_channel.rs +++ b/lampo-common/src/model/close_channel.rs @@ -36,8 +36,8 @@ pub mod request { /// This converts hex to bytes array. /// Stolen from https://stackoverflow.com/a/52992629 /// It takes two values every in each iteration from the hex - /// then convert the formed hexdecimal digit to u8, collects it in a vector - /// and return it (redix = 16 for hexadecimal) + /// then convert the formed hexdecimal digit to u8, collects it in a + /// vector and return it (redix = 16 for hexadecimal) fn decode_hex(&self, s: &str) -> Result, ParseIntError> { (0..s.len()) .step_by(2) diff --git a/lampo-common/src/model/connect.rs b/lampo-common/src/model/connect.rs index 2f5fff1f..e387cb5b 100644 --- a/lampo-common/src/model/connect.rs +++ b/lampo-common/src/model/connect.rs @@ -1,5 +1,6 @@ //! Connect Model -use std::{net::SocketAddr, str::FromStr}; +use std::net::SocketAddr; +use std::str::FromStr; use serde::{Deserialize, Serialize}; diff --git a/lampo-core-wallet/src/lib.rs b/lampo-core-wallet/src/lib.rs index 09cff55b..3d56cd83 100644 --- a/lampo-core-wallet/src/lib.rs +++ b/lampo-core-wallet/src/lib.rs @@ -3,13 +3,8 @@ use std::ops::Not; use std::sync::Arc; use bdk::bitcoin::Amount; -use bdk::keys::bip39::Language; -use bdk::keys::bip39::Mnemonic; -use bdk::keys::bip39::WordCount; -use bdk::keys::DerivableKey; -use bdk::keys::ExtendedKey; -use bdk::keys::GeneratableKey; -use bdk::keys::GeneratedKey; +use bdk::keys::bip39::{Language, Mnemonic, WordCount}; +use bdk::keys::{DerivableKey, ExtendedKey, GeneratableKey, GeneratedKey}; use bdk::template::Bip84; use bdk::KeychainKind; use bitcoin_hashes::hex::HexIterator; @@ -18,15 +13,13 @@ use bitcoincore_rpc::{Auth, Client, RpcApi}; #[cfg(debug_assertions)] use crate::bitcoin::PrivateKey; -use lampo_common::bitcoin; use lampo_common::bitcoin::consensus::Decodable; use lampo_common::conf::{LampoConf, Network}; -use lampo_common::error; -use lampo_common::json; use lampo_common::json::Deserialize; use lampo_common::keys::LampoKeys; use lampo_common::model::response::{NewAddress, Utxo}; use lampo_common::wallet::WalletManager; +use lampo_common::{bitcoin, error, json}; pub struct CoreWalletManager { rpc: Client, @@ -57,7 +50,8 @@ impl CoreWalletManager { .ok_or(error::anyhow!("impossible cast the private key"))?; let ldk_keys = LampoKeys::new(xprv.private_key.secret_bytes()); - // Create a BDK wallet structure using BIP 84 descriptor ("m/84h/1h/0h/0" and "m/84h/1h/0h/1") + // Create a BDK wallet structure using BIP 84 descriptor ("m/84h/1h/0h/0" and + // "m/84h/1h/0h/1") let wallet = bdk::Wallet::new( Bip84(xprv, KeychainKind::External), Some(Bip84(xprv, KeychainKind::Internal)), diff --git a/lampo-jsonrpc/src/lib.rs b/lampo-jsonrpc/src/lib.rs index fa75968a..38b20c13 100644 --- a/lampo-jsonrpc/src/lib.rs +++ b/lampo-jsonrpc/src/lib.rs @@ -3,11 +3,9 @@ use std::cell::{Cell, RefCell}; use std::collections::HashMap; use std::io; -use std::io::ErrorKind; -use std::io::{Read, Write}; +use std::io::{ErrorKind, Read, Write}; use std::os::fd::AsRawFd; -use std::os::unix::net::UnixListener; -use std::os::unix::net::UnixStream; +use std::os::unix::net::{UnixListener, UnixStream}; use std::sync::Arc; use std::thread::JoinHandle; @@ -144,7 +142,8 @@ impl JSONRPCv2 { // Put this inside the unfinish queue let Ok(requ) = serde_json::from_slice::>(&buff) else { log::warn!(target: "jsonrpc", "looks like that the json is not fully read ` {}`", String::from_utf8(buff.to_vec()).unwrap()); - // Usually this mean that we was too fast in reading and the sender too low + // Usually this mean that we was too fast in reading and the sender too + // low continue; }; log::trace!(target: "jsonrpc", "request {:?}", requ); @@ -311,19 +310,20 @@ impl Drop for JSONRPCv2 { #[cfg(test)] mod tests { - use std::{ - io::Write, os::unix::net::UnixStream, path::Path, str::FromStr, sync::Arc, time::Duration, - }; + use std::io::Write; + use std::os::unix::net::UnixStream; + use std::path::Path; + use std::str::FromStr; + use std::sync::Arc; + use std::time::Duration; use lampo_common::logger; use ntest::timeout; use serde_json::Value; - use crate::{ - command::Context, - json_rpc2::{Id, Request, Response}, - JSONRPCv2, - }; + use crate::command::Context; + use crate::json_rpc2::{Id, Request, Response}; + use crate::JSONRPCv2; struct DummyCtx; diff --git a/lampo-testing/src/lib.rs b/lampo-testing/src/lib.rs index e770da39..0850720b 100644 --- a/lampo-testing/src/lib.rs +++ b/lampo-testing/src/lib.rs @@ -29,12 +29,8 @@ use lampod::actions::handler::LampoHandler; use lampod::chain::WalletManager; use lampod::jsonrpc::channels::json_list_channels; use lampod::jsonrpc::inventory::get_info; -use lampod::jsonrpc::offchain::json_decode_invoice; -use lampod::jsonrpc::offchain::json_invoice; -use lampod::jsonrpc::offchain::json_offer; -use lampod::jsonrpc::offchain::json_pay; -use lampod::jsonrpc::onchain::json_funds; -use lampod::jsonrpc::onchain::json_new_addr; +use lampod::jsonrpc::offchain::{json_decode_invoice, json_invoice, json_offer, json_pay}; +use lampod::jsonrpc::onchain::{json_funds, json_new_addr}; use lampod::jsonrpc::open_channel::json_open_channel; use lampod::jsonrpc::peer_control::json_connect; use lampod::jsonrpc::CommandHandler; diff --git a/lampo-vls/Cargo.toml b/lampo-vls/Cargo.toml new file mode 100644 index 00000000..8214a58e --- /dev/null +++ b/lampo-vls/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "lampo-vls" +version = "0.1.0" +edition = "2021" + +[dependencies] +lampo-common = { path = "../lampo-common" } +vls-core = { git = "https://gitlab.com/lightning-signer/validating-lightning-signer", branch = "main" } +vls-proxy = { git = "https://gitlab.com/lightning-signer/validating-lightning-signer", branch = "main" } +vls-persist = { git = "https://gitlab.com/lightning-signer/validating-lightning-signer", branch = "main" } +log = "*" +hex = "*" +url = "*" +triggered = "0.1" diff --git a/lampo-vls/src/lib.rs b/lampo-vls/src/lib.rs new file mode 100644 index 00000000..dd34f840 --- /dev/null +++ b/lampo-vls/src/lib.rs @@ -0,0 +1,144 @@ +mod remote_signer; +mod signer_adapter; + +use std::fs; +use std::str::FromStr; +use std::sync::Arc; + +use lightning_signer::lightning::sign::SignerProvider; +use lightning_signer::node::{NodeConfig, NodeServices}; +use lightning_signer::persist::fs::FileSeedPersister; +use lightning_signer::policy::simple_validator::SimpleValidatorFactory; +use lightning_signer::signer::derive::KeyDerivationStyle; +use lightning_signer::signer::multi_signer::MultiSigner; +use lightning_signer::signer::ClockStartingTimeFactory; +use lightning_signer::util::clock::StandardClock; +use lightning_signer::util::loopback::LoopbackSignerKeysInterface; +use remote_signer::build_remote; +use triggered::Listener; +use vls_persist::kvv::redb::RedbKVVStore; +use vls_persist::kvv::{JsonFormat, KVVPersister}; +use vls_proxy::nodefront::SignerFront; +use vls_proxy::vls_frontend::frontend::FileSourceFactory; +use vls_proxy::vls_frontend::Frontend; +use vls_proxy::vls_protocol_client::{DynSigner, SpendableKeysInterface}; + +use lampo_common::bitcoin::secp256k1::PublicKey; +use lampo_common::bitcoin::{Address, ScriptBuf}; +use lampo_common::conf::LampoConf; +use lampo_common::error; + +use crate::signer_adapter::Adapter; + +pub type InnerSpendableInterface = Arc>; + +pub enum VLSSignerKind { + Remote, + InProcess, +} + +/// VLS Key Manager Builder - This is ensuring that given a +/// VLS signer kind, we are able to create the signer type, +/// but at the same time hiding the complexity of the code +/// under a builder patter. +pub struct VLSKeyManagerBuilder { + kind: VLSSignerKind, + config: Arc, +} + +impl VLSKeyManagerBuilder { + pub fn new(kind: VLSSignerKind, config: Arc) -> error::Result { + Ok(Self { kind, config }) + } + + pub async fn build(self, listner: Listener) -> error::Result { + let signer: InnerSpendableInterface = match self.kind { + VLSSignerKind::InProcess => build_in_process(self.config, listner).await?, + VLSSignerKind::Remote => build_remote(self.config).await?, + }; + Ok(signer) + } +} + +async fn build_in_process( + config: Arc, + listner: Listener, +) -> error::Result { + let node_id_path = format!("{}/node_id", config.path()); + let signer_path = format!("{}/signer", config.path()); + let persister = RedbKVVStore::new(&signer_path); + let persister = Arc::new(KVVPersister(persister, JsonFormat)); + let seed_persister = Arc::new(FileSeedPersister::new(&signer_path)); + let validator_factory = Arc::new(SimpleValidatorFactory::new()); + let starting_time_factory = ClockStartingTimeFactory::new(); + let clock = Arc::new(StandardClock()); + let services = NodeServices { + validator_factory, + starting_time_factory, + persister, + clock, + trusted_oracle_pubkeys: Vec::new(), + }; + // FIXME use Node directly - requires rework of LoopbackSignerKeysInterface in + // the rls crate + let signer = Arc::new(MultiSigner::new(services)); + + let source_factory = Arc::new(FileSourceFactory::new(config.path(), config.network)); + let frontend = Frontend::new( + Arc::new(SignerFront { + signer: Arc::clone(&signer), + external_persist: None, + }), + source_factory, + // FIXME: pass down the bitcoin URL + url::Url::parse("").unwrap(), + listner, + ); + frontend.start(); + + let signer = if let Ok(node_id_hex) = fs::read_to_string(node_id_path.clone()) { + let node_id = PublicKey::from_str(&node_id_hex)?; + assert!(signer.get_node(&node_id).is_ok()); + + let manager = LoopbackSignerKeysInterface { node_id, signer }; + + // FIXME: change when we generate a sweep address + let shutdown_scriptpubkey: ScriptBuf = manager.get_shutdown_scriptpubkey().unwrap().into(); + let shutdown_address = Address::from_script(&shutdown_scriptpubkey, config.network) + .expect("shutdown script must be convertible to address"); + Adapter { + inner: manager, + sweep_address: shutdown_address, + } + } else { + let node_config = NodeConfig { + network: config.network, + key_derivation_style: KeyDerivationStyle::Ldk, + use_checkpoints: true, + allow_deep_reorgs: false, + }; + let (node_id, _seed) = signer.new_node(node_config, seed_persister).unwrap(); + fs::write(node_id_path, node_id.to_string()).expect("write node_id"); + let node = signer.get_node(&node_id).unwrap(); + + let manager = LoopbackSignerKeysInterface { node_id, signer }; + + let shutdown_scriptpubkey: ScriptBuf = manager.get_shutdown_scriptpubkey().unwrap().into(); + let shutdown_address = Address::from_script(&shutdown_scriptpubkey, config.network) + .expect("shutdown script must be convertible to address"); + log::info!( + "adding shutdown address {} to allowlist for {}", + shutdown_address, + hex::encode(&node_id.serialize()) + ); + node.add_allowlist(&vec![shutdown_address.to_string()]) + .expect("add to allowlist"); + + Adapter { + inner: manager, + // FIXME: add a real sweep address + sweep_address: shutdown_address, + } + }; + Ok(Arc::new(signer)) +} diff --git a/lampo-vls/src/remote_signer.rs b/lampo-vls/src/remote_signer.rs new file mode 100644 index 00000000..56daf940 --- /dev/null +++ b/lampo-vls/src/remote_signer.rs @@ -0,0 +1,11 @@ +use std::sync::Arc; + +use lampo_common::conf::LampoConf; +use lampo_common::error; + +use crate::InnerSpendableInterface; + +/// Create the VLS remote signer +pub async fn build_remote(config: Arc) -> error::Result { + unimplemented!() +} diff --git a/lampo-vls/src/signer_adapter.rs b/lampo-vls/src/signer_adapter.rs new file mode 100644 index 00000000..e87587c0 --- /dev/null +++ b/lampo-vls/src/signer_adapter.rs @@ -0,0 +1,145 @@ +use lightning_signer::util::loopback::LoopbackSignerKeysInterface; +use vls_proxy::vls_protocol_client::{DynSigner, SpendableKeysInterface}; + +use lampo_common::bitcoin::bech32::u5; +use lampo_common::bitcoin::consensus::encode::serialize_hex; +use lampo_common::bitcoin::secp256k1::PublicKey; +use lampo_common::bitcoin::{Address, ScriptBuf, Transaction, TxOut}; +use lampo_common::error; +use lampo_common::ldk::ln::msgs::{DecodeError, UnsignedGossipMessage}; +use lampo_common::ldk::ln::script::ShutdownScript; +use lampo_common::ldk::sign::{ + EntropySource, KeyMaterial, NodeSigner, Recipient, SignerProvider, SpendableOutputDescriptor, +}; +use lampo_common::secp256k1::ecdh::SharedSecret; +use lampo_common::secp256k1::ecdsa::{RecoverableSignature, Signature}; +use lampo_common::secp256k1::{Scalar, Secp256k1}; + +pub struct Adapter { + pub(crate) inner: LoopbackSignerKeysInterface, + pub(crate) sweep_address: Address, +} + +impl SignerProvider for Adapter { + type EcdsaSigner = DynSigner; + + fn generate_channel_keys_id( + &self, + inbound: bool, + channel_value_satoshis: u64, + user_channel_id: u128, + ) -> [u8; 32] { + self.inner + .generate_channel_keys_id(inbound, channel_value_satoshis, user_channel_id) + } + + fn derive_channel_signer( + &self, + channel_value_satoshis: u64, + channel_keys_id: [u8; 32], + ) -> Self::EcdsaSigner { + let inner = self + .inner + .derive_channel_signer(channel_value_satoshis, channel_keys_id); + DynSigner { + inner: Box::new(inner), + } + } + + fn read_chan_signer(&self, reader: &[u8]) -> Result { + let inner = self.inner.read_chan_signer(reader)?; + + Ok(DynSigner::new(inner)) + } + + fn get_destination_script(&self, channel_keys_id: [u8; 32]) -> Result { + self.inner.get_destination_script(channel_keys_id) + } + + fn get_shutdown_scriptpubkey(&self) -> Result { + self.inner.get_shutdown_scriptpubkey() + } +} + +impl EntropySource for Adapter { + fn get_secure_random_bytes(&self) -> [u8; 32] { + self.inner.get_secure_random_bytes() + } +} + +impl NodeSigner for Adapter { + fn sign_bolt12_invoice( + &self, + invoice: &lightning_signer::invoice::bolt12::UnsignedBolt12Invoice, + ) -> Result { + self.inner.sign_bolt12_invoice(invoice) + } + + fn sign_bolt12_invoice_request( + &self, + invoice_request: &lampo_common::ldk::offers::invoice_request::UnsignedInvoiceRequest, + ) -> Result { + self.inner.sign_bolt12_invoice_request(invoice_request) + } + + fn get_inbound_payment_key_material(&self) -> KeyMaterial { + self.inner.get_inbound_payment_key_material() + } + + fn get_node_id(&self, recipient: Recipient) -> Result { + match recipient { + Recipient::Node => {} + Recipient::PhantomNode => panic!("phantom node not supported"), + } + Ok(self.inner.node_id.clone()) + } + + fn ecdh( + &self, + recipient: Recipient, + other_key: &PublicKey, + tweak: Option<&Scalar>, + ) -> Result { + self.inner.ecdh(recipient, other_key, tweak) + } + + fn sign_invoice( + &self, + hrp_bytes: &[u8], + invoice_data: &[u5], + recipient: Recipient, + ) -> Result { + self.inner.sign_invoice(hrp_bytes, invoice_data, recipient) + } + + fn sign_gossip_message(&self, msg: UnsignedGossipMessage) -> Result { + self.inner.sign_gossip_message(msg) + } +} + +impl SpendableKeysInterface for Adapter { + fn spend_spendable_outputs( + &self, + descriptors: &[&SpendableOutputDescriptor], + outputs: Vec, + change_destination_script: ScriptBuf, + feerate_sat_per_1000_weight: u32, + _: &Secp256k1, + ) -> error::Result { + let tx = self + .inner + .spend_spendable_outputs( + descriptors, + outputs, + change_destination_script, + feerate_sat_per_1000_weight, + ) + .map_err(|()| error::anyhow!("failed in spend_spendable_outputs"))?; + log::info!("spend spendable {}", serialize_hex(&tx)); + Ok(tx) + } + + fn get_sweep_address(&self) -> Address { + self.sweep_address.clone() + } +} diff --git a/lampod-cli/src/main.rs b/lampod-cli/src/main.rs index dc9ac947..96277b30 100644 --- a/lampod-cli/src/main.rs +++ b/lampod-cli/src/main.rs @@ -1,35 +1,27 @@ #[allow(dead_code)] mod args; -use std::env; -use std::io; use std::path::PathBuf; use std::str::FromStr; use std::sync::Arc; use std::thread::JoinHandle; +use std::{env, io}; use radicle_term as term; use lampo_bitcoind::BitcoinCore; use lampo_common::backend::Backend; use lampo_common::conf::LampoConf; -use lampo_common::error; -use lampo_common::logger; +use lampo_common::{error, logger}; use lampo_core_wallet::CoreWalletManager; -use lampo_jsonrpc::Handler; -use lampo_jsonrpc::JSONRPCv2; +use lampo_jsonrpc::{Handler, JSONRPCv2}; use lampod::chain::WalletManager; -use lampod::jsonrpc::channels::json_close_channel; -use lampod::jsonrpc::channels::json_list_channels; +use lampod::jsonrpc::channels::{json_close_channel, json_list_channels}; use lampod::jsonrpc::inventory::get_info; -use lampod::jsonrpc::offchain::json_decode_invoice; -use lampod::jsonrpc::offchain::json_invoice; -use lampod::jsonrpc::offchain::json_keysend; -use lampod::jsonrpc::offchain::json_offer; -use lampod::jsonrpc::offchain::json_pay; -use lampod::jsonrpc::onchain::json_estimate_fees; -use lampod::jsonrpc::onchain::json_funds; -use lampod::jsonrpc::onchain::json_new_addr; +use lampod::jsonrpc::offchain::{ + json_decode_invoice, json_invoice, json_keysend, json_offer, json_pay, +}; +use lampod::jsonrpc::onchain::{json_estimate_fees, json_funds, json_new_addr}; use lampod::jsonrpc::open_channel::json_open_channel; use lampod::jsonrpc::peer_control::json_connect; use lampod::jsonrpc::CommandHandler; diff --git a/lampod/Cargo.toml b/lampod/Cargo.toml index 12ec6743..194b0c0c 100644 --- a/lampod/Cargo.toml +++ b/lampod/Cargo.toml @@ -11,7 +11,7 @@ lampo-common = { path = "../lampo-common" } lampo-jsonrpc = { path = "../lampo-jsonrpc" } lampo-client = { path = "../lampo-client" } log = "0.4.17" -time = "0.3.13" +time = "0.3" futures = "0.3.28" crossbeam-channel = "0.5.8" once_cell = "1.17.1" diff --git a/lampod/src/actions/handler.rs b/lampod/src/actions/handler.rs index 1dfb221f..695a77fd 100644 --- a/lampod/src/actions/handler.rs +++ b/lampod/src/actions/handler.rs @@ -2,17 +2,13 @@ use std::cell::RefCell; use std::sync::Arc; -use lampo_common::chan; -use lampo_common::error; use lampo_common::error::Ok; use lampo_common::event::ln::LightningEvent; use lampo_common::event::{Emitter, Event, Subscriber}; use lampo_common::handler::Handler as EventHandler; -use lampo_common::json; -use lampo_common::ldk; -use lampo_common::model::response::PaymentHop; -use lampo_common::model::response::PaymentState; +use lampo_common::model::response::{PaymentHop, PaymentState}; use lampo_common::types::ChannelState; +use lampo_common::{chan, error, json, ldk}; use lampo_jsonrpc::json_rpc2::Request; use crate::chain::{LampoChainManager, WalletManager}; @@ -62,8 +58,9 @@ impl LampoHandler { } /// Call any method supported by the lampod configuration. This includes - /// a lot of handler code. This function serves as a broker pattern in some ways, - /// but it may also function as a chain of responsibility pattern in certain cases. + /// a lot of handler code. This function serves as a broker pattern in some + /// ways, but it may also function as a chain of responsibility pattern + /// in certain cases. pub fn call( &self, method: &str, diff --git a/lampod/src/chain/blockchain.rs b/lampod/src/chain/blockchain.rs index 081a8904..12414df6 100644 --- a/lampod/src/chain/blockchain.rs +++ b/lampod/src/chain/blockchain.rs @@ -2,16 +2,15 @@ use std::collections::HashMap; use std::sync::Arc; use lampo_common::backend::Backend; -use lampo_common::bitcoin; use lampo_common::bitcoin::blockdata::constants::ChainHash; use lampo_common::bitcoin::Transaction; -use lampo_common::ldk; use lampo_common::ldk::chain::chaininterface::{ BroadcasterInterface, ConfirmationTarget, FeeEstimator, }; use lampo_common::ldk::chain::Filter; use lampo_common::ldk::routing::utxo::UtxoLookup; use lampo_common::wallet::WalletManager; +use lampo_common::{bitcoin, ldk}; #[derive(Clone)] pub struct LampoChainManager { diff --git a/lampod/src/chain/mod.rs b/lampod/src/chain/mod.rs index f00d8ef7..0b76438b 100644 --- a/lampod/src/chain/mod.rs +++ b/lampod/src/chain/mod.rs @@ -1,4 +1,5 @@ -//! Chain module implementation that contains all the code related to the blockchain communication. +//! Chain module implementation that contains all the code related to the +//! blockchain communication. mod blockchain; pub use lampo_common::bitcoin::Network; diff --git a/lampod/src/command.rs b/lampod/src/command.rs index 0e238274..0143d0b2 100644 --- a/lampod/src/command.rs +++ b/lampod/src/command.rs @@ -1,8 +1,7 @@ //! All the Lampo Node Events that the node is able to react to use crossbeam_channel as chan; -use lampo_common::error; -use lampo_common::json; +use lampo_common::{error, json}; use lampo_jsonrpc::json_rpc2::Request; use crate::ln::peer_event::PeerCommand; diff --git a/lampod/src/handler/external_handler.rs b/lampod/src/handler/external_handler.rs index c620b681..388f6d6a 100644 --- a/lampod/src/handler/external_handler.rs +++ b/lampod/src/handler/external_handler.rs @@ -1,8 +1,7 @@ //! External Handler are the core part of the Lampo Implementation //! becauuse it can be really anythings. -use lampo_common::error; -use lampo_common::json; +use lampo_common::{error, json}; use lampo_jsonrpc::json_rpc2::Request; pub trait ExternalHandler { diff --git a/lampod/src/jsonrpc.rs b/lampod/src/jsonrpc.rs index 94b031bd..8c6cc5e4 100644 --- a/lampod/src/jsonrpc.rs +++ b/lampod/src/jsonrpc.rs @@ -10,13 +10,12 @@ use std::cell::RefCell; use std::sync::Arc; use lampo_common::conf::LampoConf; -use lampo_common::error; -use lampo_common::json; +use lampo_common::{error, json}; use lampo_jsonrpc::command::Context; -use lampo_jsonrpc::json_rpc2; -use lampo_jsonrpc::Handler; +use lampo_jsonrpc::{json_rpc2, Handler}; -use crate::{handler::external_handler::ExternalHandler, LampoDaemon}; +use crate::handler::external_handler::ExternalHandler; +use crate::LampoDaemon; #[macro_export] macro_rules! rpc_error { diff --git a/lampod/src/jsonrpc/channels.rs b/lampod/src/jsonrpc/channels.rs index 4567302a..0c86deb7 100644 --- a/lampod/src/jsonrpc/channels.rs +++ b/lampod/src/jsonrpc/channels.rs @@ -2,15 +2,12 @@ use lampo_common::event::ln::LightningEvent; use lampo_common::event::Event; use lampo_common::handler::Handler; use lampo_common::json; -use lampo_common::model::request; -use lampo_common::model::response; -use lampo_jsonrpc::errors::Error; -use lampo_jsonrpc::errors::RpcError; +use lampo_common::model::{request, response}; +use lampo_jsonrpc::errors::{Error, RpcError}; use crate::ln::events::ChannelEvents; -use crate::rpc_error; -use crate::LampoDaemon; +use crate::{rpc_error, LampoDaemon}; pub fn json_list_channels(ctx: &LampoDaemon, request: &json::Value) -> Result { log::info!("call for `list_channels` with request {:?}", request); @@ -32,7 +29,8 @@ pub fn json_close_channel(ctx: &LampoDaemon, request: &json::Value) -> Result 1 { // check the channel_id if it is not none, if it is return an error - // and if it is not none then we need to have the channel_id that needs to be shut + // and if it is not none then we need to have the channel_id that needs to be + // shut if request.channel_id.is_none() { return Err(rpc_error!("Channels > 1, provide `channel_id`")); } else { diff --git a/lampod/src/jsonrpc/offchain.rs b/lampod/src/jsonrpc/offchain.rs index 15cae5f8..ad7f79c4 100644 --- a/lampod/src/jsonrpc/offchain.rs +++ b/lampod/src/jsonrpc/offchain.rs @@ -6,17 +6,12 @@ use lampo_common::conf::Network; use lampo_common::event::ln::LightningEvent; use lampo_common::event::Event; use lampo_common::handler::Handler; -use lampo_common::ldk; use lampo_common::ldk::offers::offer; use lampo_common::ldk::offers::offer::Amount; -use lampo_common::model::request::GenerateInvoice; -use lampo_common::model::request::GenerateOffer; -use lampo_common::model::request::KeySend; -use lampo_common::model::request::Pay; +use lampo_common::model::request::{DecodeInvoice, GenerateInvoice, GenerateOffer, KeySend, Pay}; use lampo_common::model::response; -use lampo_common::model::response::PayResult; -use lampo_common::model::response::{Invoice, InvoiceInfo}; -use lampo_common::{json, model::request::DecodeInvoice}; +use lampo_common::model::response::{Invoice, InvoiceInfo, PayResult}; +use lampo_common::{json, ldk}; use lampo_jsonrpc::errors::{Error, RpcError}; use crate::LampoDaemon; diff --git a/lampod/src/jsonrpc/peer_control.rs b/lampod/src/jsonrpc/peer_control.rs index 1756bd98..9e7fa397 100644 --- a/lampod/src/jsonrpc/peer_control.rs +++ b/lampod/src/jsonrpc/peer_control.rs @@ -3,7 +3,8 @@ use lampo_common::json; use lampo_common::model::Connect; use lampo_jsonrpc::errors::Error; -use crate::{ln::events::PeerEvents, LampoDaemon}; +use crate::ln::events::PeerEvents; +use crate::LampoDaemon; pub fn json_connect(ctx: &LampoDaemon, request: &json::Value) -> Result { log::info!("call for `connect` with request `{:?}`", request); diff --git a/lampod/src/lib.rs b/lampod/src/lib.rs index 490c0e19..54e70c3f 100644 --- a/lampod/src/lib.rs +++ b/lampod/src/lib.rs @@ -28,20 +28,17 @@ use tokio::runtime::Runtime; use lampo_common::backend::Backend; use lampo_common::bitcoin::absolute::Height; use lampo_common::conf::LampoConf; -use lampo_common::error; -use lampo_common::json; use lampo_common::ldk::events::Event; use lampo_common::ldk::processor::{BackgroundProcessor, GossipSync}; use lampo_common::ldk::routing::gossip::P2PGossipSync; -use lampo_common::utils; use lampo_common::wallet::WalletManager; +use lampo_common::{error, json, utils}; use crate::actions::handler::LampoHandler; use crate::actions::Handler; use crate::chain::LampoChainManager; use crate::handler::external_handler::ExternalHandler; -use crate::ln::OffchainManager; -use crate::ln::{LampoChannelManager, LampoInventoryManager, LampoPeerManager}; +use crate::ln::{LampoChannelManager, LampoInventoryManager, LampoPeerManager, OffchainManager}; use crate::persistence::LampoPersistence; use crate::utils::logger::LampoLogger; @@ -227,12 +224,14 @@ impl LampoDaemon { Ok(()) } - /// Registers an external handler to handle incoming requests from external sources. - /// These requests are passed to the handler via the `call` method. + /// Registers an external handler to handle incoming requests from external + /// sources. These requests are passed to the handler via the `call` + /// method. /// /// Additionally, the registered handler serves as the entry point for - /// the Chain of Responsibility pattern that handles all unsupported commands that the Lampod daemon - /// may receive from external sources (assuming the user has defined a handler for them). + /// the Chain of Responsibility pattern that handles all unsupported + /// commands that the Lampod daemon may receive from external sources + /// (assuming the user has defined a handler for them). pub fn add_external_handler(&self, ext_handler: Arc) -> error::Result<()> { let Some(ref handler) = self.handler else { error::bail!("Initial handler is None"); @@ -282,12 +281,13 @@ impl LampoDaemon { } /// Call any method supported by the lampod configuration. This includes - /// a lot of handler code. This function serves as a broker pattern in some ways, - /// but it may also function as a chain of responsibility pattern in certain cases. + /// a lot of handler code. This function serves as a broker pattern in some + /// ways, but it may also function as a chain of responsibility pattern + /// in certain cases. /// - /// Welcome to the third design pattern in under 300 lines of code. The code will clarify the - /// idea, but be prepared to see a broker pattern begin as a chain of responsibility pattern - /// at some point. + /// Welcome to the third design pattern in under 300 lines of code. The code + /// will clarify the idea, but be prepared to see a broker pattern begin + /// as a chain of responsibility pattern at some point. pub fn call(&self, method: &str, args: json::Value) -> error::Result { let Some(ref handler) = self.handler else { error::bail!("at this point the handler should be not None"); diff --git a/lampod/src/ln/events.rs b/lampod/src/ln/events.rs index 8e7ddbda..7f4ccace 100644 --- a/lampod/src/ln/events.rs +++ b/lampod/src/ln/events.rs @@ -5,8 +5,7 @@ use async_trait::async_trait; use lampo_common::error; use lampo_common::ldk::ln::features::ChannelTypeFeatures; -use lampo_common::model::request; -use lampo_common::model::response; +use lampo_common::model::{request, response}; use lampo_common::types::{ChannelId, ChannelState, NodeId}; use super::peer_event; diff --git a/lampod/src/ln/inventory_manager.rs b/lampod/src/ln/inventory_manager.rs index b61ab8fc..67660be5 100644 --- a/lampod/src/ln/inventory_manager.rs +++ b/lampod/src/ln/inventory_manager.rs @@ -1,9 +1,8 @@ //! Inventory Manager Implementation use std::sync::Arc; -use lampo_common::error; -use lampo_common::json; use lampo_common::model::response::NetworkInfo; +use lampo_common::{error, json}; use super::{LampoChannelManager, LampoPeerManager}; use crate::actions::InventoryHandler; @@ -35,12 +34,14 @@ impl InventoryHandler for LampoInventoryManager { InventoryCommand::GetNodeInfo(chan) => { let chain = self.channel_manager.conf.network.to_string(); let alias = self.channel_manager.conf.alias.clone(); - // we have to put "" in case of alias missing as cln provide us with a random alias. + // we have to put "" in case of alias missing as cln provide us with a random + // alias. let alias = alias.unwrap_or_default(); let (_, height) = self.channel_manager.onchain.backend.get_best_block()?; let blockheight = height.unwrap_or_default(); let lampo_dir = self.channel_manager.conf.root_path.to_string(); - // We provide a vector here as there may be other types of address in future like tor and ipv6. + // We provide a vector here as there may be other types of address in future + // like tor and ipv6. let mut address_vec = Vec::new(); let address = self.channel_manager.conf.announce_addr.clone(); if let Some(addr) = address { diff --git a/lampod/src/ln/offchain_manager.rs b/lampod/src/ln/offchain_manager.rs index 9f45ca16..bd4b987d 100644 --- a/lampod/src/ln/offchain_manager.rs +++ b/lampod/src/ln/offchain_manager.rs @@ -18,16 +18,13 @@ use lampo_common::bitcoin::hashes::sha256::Hash as Sha256; use lampo_common::bitcoin::hashes::Hash; use lampo_common::bitcoin::secp256k1::PublicKey as pubkey; use lampo_common::conf::LampoConf; -use lampo_common::error; use lampo_common::keys::LampoKeysManager; -use lampo_common::ldk; -use lampo_common::ldk::ln::channelmanager::Retry; -use lampo_common::ldk::ln::channelmanager::{PaymentId, RecipientOnionFields}; +use lampo_common::ldk::ln::channelmanager::{PaymentId, RecipientOnionFields, Retry}; use lampo_common::ldk::ln::{PaymentHash, PaymentPreimage}; -use lampo_common::ldk::offers::offer::Amount; -use lampo_common::ldk::offers::offer::Offer; +use lampo_common::ldk::offers::offer::{Amount, Offer}; use lampo_common::ldk::routing::router::{PaymentParameters, RouteParameters}; use lampo_common::ldk::sign::EntropySource; +use lampo_common::{error, ldk}; use super::LampoChannelManager; use crate::chain::LampoChainManager; @@ -158,8 +155,9 @@ impl OffchainManager { ); let PaymentPreimage(bytes) = payment_preimage; let payment_hash = PaymentHash(Sha256::hash(&bytes).to_byte_array()); - // The 40 here is the max CheckLockTimeVerify which locks the output of the transaction for a certain - // period of time.The false here stands for the allow_mpp, which is to allow the multi part route payments. + // The 40 here is the max CheckLockTimeVerify which locks the output of the + // transaction for a certain period of time.The false here stands for + // the allow_mpp, which is to allow the multi part route payments. let route_params = RouteParameters { payment_params: PaymentParameters::for_keysend(destination, 40, false), final_value_msat: amount_msat, diff --git a/lampod/src/ln/peer_event.rs b/lampod/src/ln/peer_event.rs index c428cdf6..7f3c570d 100644 --- a/lampod/src/ln/peer_event.rs +++ b/lampod/src/ln/peer_event.rs @@ -3,7 +3,8 @@ use std::net::SocketAddr; use crossbeam_channel as chan; -use lampo_common::{model::Connect, types::NodeId}; +use lampo_common::model::Connect; +use lampo_common::types::NodeId; #[derive(Debug, Clone)] pub enum PeerCommand { diff --git a/lampod/src/ln/peer_manager.rs b/lampod/src/ln/peer_manager.rs index bb4dad54..e6c084d3 100644 --- a/lampod/src/ln/peer_manager.rs +++ b/lampod/src/ln/peer_manager.rs @@ -6,18 +6,16 @@ use std::time::{Duration, SystemTime}; use async_trait::async_trait; use lampo_common::conf::LampoConf; -use lampo_common::error; use lampo_common::keys::LampoKeysManager; -use lampo_common::ldk; use lampo_common::ldk::blinded_path::EmptyNodeIdLookUp; -use lampo_common::ldk::ln::peer_handler::MessageHandler; -use lampo_common::ldk::ln::peer_handler::{IgnoringMessageHandler, PeerManager}; +use lampo_common::ldk::ln::peer_handler::{IgnoringMessageHandler, MessageHandler, PeerManager}; use lampo_common::ldk::net; use lampo_common::ldk::net::SocketDescriptor; use lampo_common::ldk::onion_message::messenger::{DefaultMessageRouter, OnionMessenger}; use lampo_common::ldk::routing::gossip::{NetworkGraph, P2PGossipSync}; use lampo_common::model::Connect; use lampo_common::types::NodeId; +use lampo_common::{error, ldk}; use crate::async_run; use crate::chain::{LampoChainManager, WalletManager}; diff --git a/tests/tests/src/lampo_cln_tests.rs b/tests/tests/src/lampo_cln_tests.rs index 37df8013..f26f56fa 100644 --- a/tests/tests/src/lampo_cln_tests.rs +++ b/tests/tests/src/lampo_cln_tests.rs @@ -1,24 +1,18 @@ use std::str::FromStr; use std::time::Duration; -use lampo_common::error; use lampo_common::event::ln::LightningEvent; use lampo_common::event::onchain::OnChainEvent; use lampo_common::event::Event; use lampo_common::handler::Handler; -use lampo_common::json; -use lampo_common::model::request; -use lampo_common::model::response; -use lampo_common::model::response::InvoiceInfo; -use lampo_common::model::response::NetworkChannels; -use lampo_common::model::response::Offer; -use lampo_common::model::Connect; +use lampo_common::model::response::{InvoiceInfo, NetworkChannels, Offer}; +use lampo_common::model::{request, response, Connect}; use lampo_common::secp256k1::PublicKey; +use lampo_common::{error, json}; use lampo_testing::prelude::bitcoincore_rpc::RpcApi; use lampo_testing::prelude::*; -use lampo_testing::wait; -use lampo_testing::LampoTesting; +use lampo_testing::{wait, LampoTesting}; use crate::init; use crate::utils::*; @@ -973,7 +967,8 @@ fn test_closing_two_channels_without_channelid_fails() { Err(()) }); - // This should fail as there are two channels with the peer so we need to pass the specific `channel_id` + // This should fail as there are two channels with the peer so we need to pass + // the specific `channel_id` let result: Result = lampo.call( "close", request::CloseChannel { diff --git a/tests/tests/src/lampo_tests.rs b/tests/tests/src/lampo_tests.rs index cba1e156..7e7da87a 100644 --- a/tests/tests/src/lampo_tests.rs +++ b/tests/tests/src/lampo_tests.rs @@ -4,17 +4,15 @@ use std::sync::Arc; use std::time::Duration; -use lampo_common::error; use lampo_common::event::ln::LightningEvent; use lampo_common::event::onchain::OnChainEvent; use lampo_common::event::Event; use lampo_common::handler::Handler; -use lampo_common::json; use lampo_common::model::{request, response}; +use lampo_common::{error, json}; use lampo_testing::prelude::*; -use lampo_testing::wait; -use lampo_testing::LampoTesting; +use lampo_testing::{wait, LampoTesting}; use crate::init; diff --git a/tests/tests/src/utils.rs b/tests/tests/src/utils.rs index f22421c1..1611f458 100644 --- a/tests/tests/src/utils.rs +++ b/tests/tests/src/utils.rs @@ -2,9 +2,8 @@ use std::str::FromStr; use std::sync::Arc; -use lampo_testing::prelude::bitcoincore_rpc; use lampo_testing::prelude::bitcoincore_rpc::RpcApi; -use lampo_testing::prelude::btc; +use lampo_testing::prelude::{bitcoincore_rpc, btc}; use lampo_common::error;