diff --git a/broker/Cargo.lock b/broker/Cargo.lock index 2b2bb6e..4cbc767 100644 --- a/broker/Cargo.lock +++ b/broker/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.17.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" +checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" dependencies = [ "gimli", ] @@ -17,41 +17,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" -[[package]] -name = "aead" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c192eb8f11fc081b0fe4259ba5af04217d4e0faddd02417310a927911abd7c8" -dependencies = [ - "crypto-common", - "generic-array", -] - -[[package]] -name = "aes" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "433cfd6710c9986c576a25ca913c39d66a6474107b406f34f91d4a8923395241" -dependencies = [ - "cfg-if 1.0.0", - "cipher", - "cpufeatures", -] - -[[package]] -name = "aes-gcm" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e1366e0c69c9f927b1fa5ce2c7bf9eafc8f9268c0b9800729e8b267612447c" -dependencies = [ - "aead", - "aes", - "cipher", - "ctr", - "ghash", - "subtle", -] - [[package]] name = "ahash" version = "0.3.8" @@ -71,13 +36,19 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "0.7.20" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" +checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04" dependencies = [ "memchr", ] +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + [[package]] name = "android_system_properties" version = "0.1.5" @@ -88,10 +59,59 @@ dependencies = [ ] [[package]] -name = "anyhow" -version = "1.0.66" +name = "anstream" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216261ddc8289130e551ddcd5ce8a064710c0d064a4d2895c67151c92b5443f6" +checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is-terminal", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41ed9a86bf92ae6580e0a31281f65a1b1d867c0cc68d5346e2ae128dddfa6a7d" + +[[package]] +name = "anstyle-parse" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e765fd216e48e067936442276d1d57399e37bce53c264d6fefbe298080cb57ee" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +dependencies = [ + "windows-sys 0.48.0", +] + +[[package]] +name = "anstyle-wincon" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" +dependencies = [ + "anstyle", + "windows-sys 0.48.0", +] + +[[package]] +name = "anyhow" +version = "1.0.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" dependencies = [ "backtrace", ] @@ -121,44 +141,42 @@ dependencies = [ [[package]] name = "async-stream" -version = "0.3.3" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dad5c83079eae9969be7fadefe640a1c566901f05ff91ab221de4b6f68d9507e" +checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" dependencies = [ "async-stream-impl", "futures-core", + "pin-project-lite", ] [[package]] name = "async-stream-impl" -version = "0.3.3" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10f203db73a71dfa2fb6dd22763990fa26f3d2625a6da2da900d23b87d26be27" +checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.18", ] [[package]] name = "async-trait" -version = "0.1.59" +version = "0.1.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6e93155431f3931513b243d371981bb2770112b370c82745a1d19d2f99364" +checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.18", ] [[package]] name = "atomic" -version = "0.5.1" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b88d82667eca772c4aa12f0f1348b3ae643424c8876448f3f7bd5787032e234c" -dependencies = [ - "autocfg", -] +checksum = "c59bdb34bc650a32731b31bd8f0829cc15d24a708ee31559e0bb34f2bc320cba" [[package]] name = "atty" @@ -179,13 +197,13 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "axum" -version = "0.6.1" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08b108ad2665fa3f6e6a517c3d80ec3e77d224c47d605167aefaa5d7ef97fa48" +checksum = "f8175979259124331c1d7bf6586ee7e0da434155e4b2d48ec2c8386281d8df39" dependencies = [ "async-trait", "axum-core", - "bitflags", + "bitflags 1.3.2", "bytes", "futures-util", "http", @@ -205,16 +223,15 @@ dependencies = [ "sync_wrapper", "tokio", "tower", - "tower-http", "tower-layer", "tower-service", ] [[package]] name = "axum-core" -version = "0.3.0" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79b8558f5a0581152dc94dcd289132a1d377494bdeafcd41869b3258e3e2ad92" +checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" dependencies = [ "async-trait", "bytes", @@ -228,10 +245,24 @@ dependencies = [ ] [[package]] -name = "backtrace" -version = "0.3.66" +name = "backoff" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7" +checksum = "b62ddb9cb1ec0a098ad4bbf9344d0713fa193ae1a80af55febcff2627b6a00c1" +dependencies = [ + "futures-core", + "getrandom", + "instant", + "pin-project-lite", + "rand", + "tokio", +] + +[[package]] +name = "backtrace" +version = "0.3.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" dependencies = [ "addr2line", "cc", @@ -248,6 +279,12 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +[[package]] +name = "base64" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" + [[package]] name = "base64-compat" version = "1.0.0" @@ -271,11 +308,11 @@ checksum = "383d29d513d8764dcdc42ea295d979eb99c3c9f00607b3692cf68a431f7dca72" [[package]] name = "bip39" -version = "1.0.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e89470017230c38e52b82b3ee3f530db1856ba1d434e3a67a3456a8a8dec5f" +checksum = "29b9e657de8ff1c3488a4ab77cb51d604eab53415ce34f0bc800f2eac9b13c28" dependencies = [ - "bitcoin_hashes 0.9.7", + "bitcoin_hashes", "rand_core 0.4.2", "serde", "unicode-normalization", @@ -294,35 +331,43 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0694ea59225b0c5f3cb405ff3f670e4828358ed26aec49dc352f730f0cb1a8a3" dependencies = [ "bech32", - "bitcoin_hashes 0.11.0", - "core2", - "hashbrown 0.8.2", + "bitcoin_hashes", + "bitcoinconsensus", "secp256k1", "serde", ] -[[package]] -name = "bitcoin_hashes" -version = "0.9.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ce18265ec2324ad075345d5814fbeed4f41f0a660055dc78840b74d19b874b1" - [[package]] name = "bitcoin_hashes" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90064b8dee6815a6470d60bad07bbbaee885c0e12d04177138fa3291a01b7bc4" dependencies = [ - "core2", "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 = "bitflags" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6776fc96284a0bb647b615056fc496d1fe1644a7ab01829818a6d91cae888b84" + [[package]] name = "bitvec" version = "0.19.6" @@ -337,9 +382,9 @@ dependencies = [ [[package]] name = "block-buffer" -version = "0.10.3" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ "generic-array", ] @@ -347,18 +392,18 @@ dependencies = [ [[package]] name = "bolt-derive" version = "0.1.0" -source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=dcd8628893b5504b3ac2d3eb8cc5ed36f36d7625#dcd8628893b5504b3ac2d3eb8cc5ed36f36d7625" +source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=0c8c4474af62c4a13e2a32d34b569e8092ed414a#0c8c4474af62c4a13e2a32d34b569e8092ed414a" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "bumpalo" -version = "3.11.1" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" +checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" [[package]] name = "byteorder" @@ -368,18 +413,18 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c" +checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" dependencies = [ "serde", ] [[package]] name = "cc" -version = "1.0.77" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9f73505338f7d905b19d18738976aae232eb46b8efc15554ffc56deb5d9ebe4" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" [[package]] name = "cfg-if" @@ -395,39 +440,29 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.23" +version = "0.4.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f" +checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" dependencies = [ + "android-tzdata", "iana-time-zone", "js-sys", - "num-integer", "num-traits", "serde", - "time 0.1.45", + "time 0.1.43", "wasm-bindgen", "winapi", ] -[[package]] -name = "cipher" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1873270f8f7942c191139cb8a40fd228da6c3fd2fc376d7e92d47aa14aeb59e" -dependencies = [ - "crypto-common", - "inout", -] - [[package]] name = "clap" -version = "3.2.23" +version = "3.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5" +checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" dependencies = [ "atty", - "bitflags", - "clap_derive 3.2.18", + "bitflags 1.3.2", + "clap_derive 3.2.25", "clap_lex 0.2.4", "indexmap", "once_cell", @@ -438,43 +473,51 @@ dependencies = [ [[package]] name = "clap" -version = "4.1.4" +version = "4.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f13b9c79b5d1dd500d20ef541215a6423c75829ef43117e1b4d17fd8af0b5d76" +checksum = "b4ed2379f8603fa2b7509891660e802b88c70a79a6427a70abb5968054de2c28" dependencies = [ - "bitflags", - "clap_derive 4.1.0", - "clap_lex 0.3.1", - "is-terminal", + "clap_builder", + "clap_derive 4.3.1", "once_cell", +] + +[[package]] +name = "clap_builder" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72394f3339a76daf211e57d4bcb374410f3965dcc606dd0e03738c7888766980" +dependencies = [ + "anstream", + "anstyle", + "bitflags 1.3.2", + "clap_lex 0.5.0", "strsim", - "termcolor", ] [[package]] name = "clap_derive" -version = "3.2.18" +version = "3.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65" +checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008" dependencies = [ "heck", "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "clap_derive" -version = "4.1.0" +version = "4.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "684a277d672e91966334af371f1a7b5833f9aa00b07c84e92fbce95e00208ce8" +checksum = "59e9ef9a08ee1c0e1f2e162121665ac45ac3783b0f897db7244ae75ad9a8f65b" dependencies = [ "heck", - "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 2.0.18", ] [[package]] @@ -488,22 +531,15 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.3.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "783fe232adfca04f90f56201b26d79682d4cd2625e0bc7290b95123afe558ade" -dependencies = [ - "os_str_bytes", -] +checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" [[package]] -name = "codespan-reporting" -version = "0.11.1" +name = "colorchoice" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" -dependencies = [ - "termcolor", - "unicode-width", -] +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "colored" @@ -518,9 +554,9 @@ dependencies = [ [[package]] name = "concurrent-queue" -version = "2.0.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd7bef69dc86e3c610e4e7aed41035e2a7ed12e72dd7530f61327a6579a4390b" +checksum = "62ec6771ecfa0762d24683ee5a32ad78487a3d3afdc0fb8cae19d2c5deb50b7c" dependencies = [ "crossbeam-utils", ] @@ -540,7 +576,7 @@ dependencies = [ "rust-ini", "serde", "serde_json", - "toml", + "toml 0.5.11", "yaml-rust", ] @@ -552,47 +588,41 @@ checksum = "2913470204e9e8498a0f31f17f90a0de801ae92c8c5ac18c49af4819e6786697" dependencies = [ "directories", "serde", - "toml", + "toml 0.5.11", ] [[package]] name = "cookie" -version = "0.16.1" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "344adc371239ef32293cb1c4fe519592fcf21206c79c02854320afcdf3ab4917" +checksum = "7efb37c3e1ccb1ff97164ad95ac1606e8ccd35b3fa0a7d99a304c7f4a428cc24" dependencies = [ - "aes-gcm", - "base64", - "hkdf", - "hmac", "percent-encoding", - "rand", - "sha2", - "subtle", "time 0.3.17", "version_check", ] [[package]] -name = "core-foundation-sys" -version = "0.8.3" +name = "core-foundation" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" - -[[package]] -name = "core2" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239fa3ae9b63c2dc74bd3fa852d4792b8b305ae64eeede946265b6af62f1fff3" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" dependencies = [ - "memchr", + "core-foundation-sys", + "libc", ] [[package]] -name = "cpufeatures" -version = "0.2.5" +name = "core-foundation-sys" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" + +[[package]] +name = "cpufeatures" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e4c1eaa2012c47becbbad2ab175484c2a84d1185b566fb2cc5b8707343dfe58" dependencies = [ "libc", ] @@ -608,22 +638,22 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.13" +version = "0.9.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01a9af1f4c2ef74bb8aa1f7e19706bc72d03598c8a570bb5de72243c7a9d9d5a" +checksum = "46bd5f3f85273295a9d14aedfb86f6aadbff6d8f5295c4a9edb08e819dcf5695" dependencies = [ "autocfg", "cfg-if 1.0.0", "crossbeam-utils", - "memoffset", + "memoffset 0.8.0", "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.14" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" +checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b" dependencies = [ "cfg-if 1.0.0", ] @@ -635,78 +665,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ "generic-array", - "rand_core 0.6.4", "typenum", ] -[[package]] -name = "ctr" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" -dependencies = [ - "cipher", -] - [[package]] name = "ctrlc" -version = "3.2.5" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbcf33c2a618cbe41ee43ae6e9f2e48368cd9f9db2896f10167d8d762679f639" +checksum = "2a011bbe2c35ce9c1f143b7af6f94f29a167beb4cd1d29e6740ce836f723120e" dependencies = [ "nix", - "windows-sys 0.45.0", -] - -[[package]] -name = "cxx" -version = "1.0.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdf07d07d6531bfcdbe9b8b739b104610c6508dcc4d63b410585faf338241daf" -dependencies = [ - "cc", - "cxxbridge-flags", - "cxxbridge-macro", - "link-cplusplus", -] - -[[package]] -name = "cxx-build" -version = "1.0.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2eb5b96ecdc99f72657332953d4d9c50135af1bac34277801cc3937906ebd39" -dependencies = [ - "cc", - "codespan-reporting", - "once_cell", - "proc-macro2", - "quote", - "scratch", - "syn", -] - -[[package]] -name = "cxxbridge-flags" -version = "1.0.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac040a39517fd1674e0f32177648334b0f4074625b5588a64519804ba0553b12" - -[[package]] -name = "cxxbridge-macro" -version = "1.0.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1362b0ddcfc4eb0a1f57b68bd77dd99f0e826958a96abd0ae9bd092e114ffed6" -dependencies = [ - "proc-macro2", - "quote", - "syn", + "windows-sys 0.48.0", ] [[package]] name = "darling" -version = "0.14.2" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0dd3cd20dc6b5a876612a6e5accfe7f3dd883db6d07acfbf14c128f61550dfa" +checksum = "0558d22a7b463ed0241e993f76f09f30b126687447751a8638587b864e4b3944" dependencies = [ "darling_core", "darling_macro", @@ -714,34 +690,68 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.14.2" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a784d2ccaf7c98501746bf0be29b2022ba41fd62a2e622af997a03e9f972859f" +checksum = "ab8bfa2e259f8ee1ce5e97824a3c55ec4404a0d772ca7fa96bf19f0752a046eb" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim", - "syn", + "syn 2.0.18", ] [[package]] name = "darling_macro" -version = "0.14.2" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7618812407e9402654622dd402b0a89dff9ba93badd6540781526117b92aab7e" +checksum = "29a358ff9f12ec09c3e61fef9b5a9902623a695a46a917b07f269bff1445611a" dependencies = [ "darling_core", "quote", - "syn", + "syn 2.0.18", ] [[package]] name = "data-encoding" -version = "2.3.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d8666cb01533c39dde32bcbab8e227b4ed6679b2c925eba05feabea39508fb" +checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" + +[[package]] +name = "deadpool" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "421fe0f90f2ab22016f32a9881be5134fdd71c65298917084b0c7477cbc3856e" +dependencies = [ + "async-trait", + "deadpool-runtime", + "num_cpus", + "retain_mut", + "tokio", +] + +[[package]] +name = "deadpool-postgres" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "836a24a9d49deefe610b8b60c767a7412e9a931d79a89415cd2d2d71630ca8d7" +dependencies = [ + "deadpool", + "log", + "tokio", + "tokio-postgres", +] + +[[package]] +name = "deadpool-runtime" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaa37046cc0f6c3cc6090fbdbf73ef0b8ef4cfcc37f6befc0020f63e8cf121e1" +dependencies = [ + "tokio", +] [[package]] name = "delegate" @@ -751,7 +761,7 @@ checksum = "35c47a31748d9cfa641f6cccb3608385fafe261ba36054f3d40d5a3ca11eb1af" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -763,7 +773,7 @@ dependencies = [ "nom 6.1.2", "num-bigint", "num-traits", - "syn", + "syn 1.0.109", ] [[package]] @@ -781,9 +791,9 @@ dependencies = [ [[package]] name = "devise" -version = "0.3.1" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50c7580b072f1c8476148f16e0a0d5dedddab787da98d86c5082c5e9ed8ab595" +checksum = "d6eacefd3f541c66fc61433d65e54e0e46e0a029a819a7dbbc7a7b489e8a85f8" dependencies = [ "devise_codegen", "devise_core", @@ -791,9 +801,9 @@ dependencies = [ [[package]] name = "devise_codegen" -version = "0.3.1" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "123c73e7a6e51b05c75fe1a1b2f4e241399ea5740ed810b0e3e6cacd9db5e7b2" +checksum = "9c8cf4b8dd484ede80fd5c547592c46c3745a617c8af278e2b72bea86b2dfed6" dependencies = [ "devise_core", "quote", @@ -801,22 +811,22 @@ dependencies = [ [[package]] name = "devise_core" -version = "0.3.1" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "841ef46f4787d9097405cac4e70fb8644fc037b526e8c14054247c0263c400d0" +checksum = "35b50dba0afdca80b187392b24f2499a88c336d5a8493e4b4ccfb608708be56a" dependencies = [ - "bitflags", + "bitflags 2.3.1", "proc-macro2", "proc-macro2-diagnostics", "quote", - "syn", + "syn 2.0.18", ] [[package]] name = "digest" -version = "0.10.6" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", "crypto-common", @@ -861,15 +871,15 @@ checksum = "0688c2a7f92e427f44895cd63841bff7b29f8d7a1648b9e7e07a4a365b2e1257" [[package]] name = "either" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" +checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" [[package]] name = "encoding_rs" -version = "0.8.31" +version = "0.8.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" +checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" dependencies = [ "cfg-if 1.0.0", ] @@ -902,13 +912,13 @@ dependencies = [ [[package]] name = "errno" -version = "0.2.8" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" +checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" dependencies = [ "errno-dragonfly", "libc", - "winapi", + "windows-sys 0.48.0", ] [[package]] @@ -928,19 +938,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] -name = "fastrand" -version = "1.8.0" +name = "fallible-iterator" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" +checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" + +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" dependencies = [ "instant", ] [[package]] name = "fern" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bdd7b0849075e79ee9a1836df22c717d1eba30451796fdc631b04565dd11e2a" +checksum = "d9f0c14694cbd524c8720dd69b0e3179344f04ebb5f90f2e4a440c6ea3b2f1ee" dependencies = [ "colored", "log", @@ -948,14 +964,14 @@ dependencies = [ [[package]] name = "figment" -version = "0.10.8" +version = "0.10.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e56602b469b2201400dec66a66aec5a9b8761ee97cd1b8c96ab2483fcc16cc9" +checksum = "4547e226f4c9ab860571e070a9034192b3175580ecea38da34fcdb53a018c9a5" dependencies = [ "atomic", "pear", "serde", - "toml", + "toml 0.7.4", "uncased", "version_check", ] @@ -976,7 +992,7 @@ dependencies = [ "futures-sink", "nanorand", "pin-project", - "spin 0.9.4", + "spin 0.9.8", ] [[package]] @@ -1023,9 +1039,9 @@ checksum = "fed34cd105917e91daa4da6b3728c47b068749d6a62c59811f06ed2ac71d9da7" [[package]] name = "futures" -version = "0.3.25" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38390104763dc37a5145a53c29c63c1290b5d316d6086ec32c293f6736051bb0" +checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" dependencies = [ "futures-channel", "futures-core", @@ -1038,9 +1054,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.25" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" dependencies = [ "futures-core", "futures-sink", @@ -1048,15 +1064,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.25" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" [[package]] name = "futures-executor" -version = "0.3.25" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7acc85df6714c176ab5edf386123fafe217be88c0840ec11f199441134a074e2" +checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" dependencies = [ "futures-core", "futures-task", @@ -1065,38 +1081,38 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.25" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" +checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" [[package]] name = "futures-macro" -version = "0.3.25" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d" +checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.18", ] [[package]] name = "futures-sink" -version = "0.3.25" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" [[package]] name = "futures-task" -version = "0.3.25" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" [[package]] name = "futures-util" -version = "0.3.25" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" dependencies = [ "futures-channel", "futures-core", @@ -1121,9 +1137,9 @@ dependencies = [ [[package]] name = "generator" -version = "0.7.1" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc184cace1cea8335047a471cc1da80f18acf8a76f3bab2028d499e328948ec7" +checksum = "f3e123d9ae7c02966b4d892e550bdc32164f05853cd40ab570650ad600596a8a" dependencies = [ "cc", "libc", @@ -1134,9 +1150,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.6" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", @@ -1144,9 +1160,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -1155,33 +1171,23 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "ghash" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d930750de5717d2dd0b8c0d42c076c0e884c81a73e6cab859bbd2339c71e3e40" -dependencies = [ - "opaque-debug", - "polyval", -] - [[package]] name = "gimli" -version = "0.26.2" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" +checksum = "ad0a93d233ebf96623465aad4046a8d3aa4da22d4f4beba5388838c8a434bbb4" [[package]] name = "glob" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "h2" -version = "0.3.15" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f9f29bc9dda355256b2916cf526ab02ce0aeaaaf2bad60d65ef3f12f11dd0f4" +checksum = "d357c7ae988e7d2182f7d7871d0b963962420b0678b0997ce7de72001aeab782" dependencies = [ "bytes", "fnv", @@ -1223,9 +1229,9 @@ dependencies = [ [[package]] name = "heck" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" @@ -1236,6 +1242,15 @@ dependencies = [ "libc", ] +[[package]] +name = "hermit-abi" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +dependencies = [ + "libc", +] + [[package]] name = "hermit-abi" version = "0.3.1" @@ -1248,15 +1263,6 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" -[[package]] -name = "hkdf" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437" -dependencies = [ - "hmac", -] - [[package]] name = "hmac" version = "0.12.1" @@ -1268,9 +1274,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" +checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" dependencies = [ "bytes", "fnv", @@ -1288,12 +1294,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "http-range-header" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bfe8eed0a9285ef776bb792479ea3834e8b94e13d615c2f66d03dd50a435a29" - [[package]] name = "httparse" version = "1.8.0" @@ -1323,9 +1323,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.23" +version = "0.14.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "034711faac9d2166cb1baf1a2fb0b60b1f277f8492fd72176c17f3515e1abd3c" +checksum = "ab302d72a6f11a3b910431ff93aae7e773078c769f0a3ef15fb9ec692ed147d4" dependencies = [ "bytes", "futures-channel", @@ -1338,7 +1338,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2", + "socket2 0.4.9", "tokio", "tower-service", "tracing", @@ -1347,15 +1347,30 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.23.1" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59df7c4e19c950e6e0e868dcc0a300b09a9b88e9ec55bd879ca819087a77355d" +checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" dependencies = [ "http", "hyper", - "rustls", + "log", + "rustls 0.20.8", + "rustls-native-certs", "tokio", - "tokio-rustls", + "tokio-rustls 0.23.4", +] + +[[package]] +name = "hyper-rustls" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0646026eb1b3eea4cd9ba47912ea5ce9cc07713d105b1a14698f4e6433d348b7" +dependencies = [ + "http", + "hyper", + "rustls 0.21.1", + "tokio", + "tokio-rustls 0.24.0", ] [[package]] @@ -1372,26 +1387,25 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.53" +version = "0.1.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" +checksum = "0722cd7114b7de04316e7ea5456a0bbb20e4adb46fd27a3697adb812cff0f37c" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "winapi", + "windows", ] [[package]] name = "iana-time-zone-haiku" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" dependencies = [ - "cxx", - "cxx-build", + "cc", ] [[package]] @@ -1413,9 +1427,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.9.2" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", "hashbrown 0.12.3", @@ -1428,15 +1442,6 @@ version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8fae54786f62fb2918dcfae3d568594e50eb9b5c25bf04371af6fe7516452fb" -[[package]] -name = "inout" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" -dependencies = [ - "generic-array", -] - [[package]] name = "instant" version = "0.1.12" @@ -1448,30 +1453,31 @@ dependencies = [ [[package]] name = "io-lifetimes" -version = "1.0.5" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1abeb7a0dd0f8181267ff8adc397075586500b81b28a73e8a0208b00fc170fb3" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ + "hermit-abi 0.3.1", "libc", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] name = "ipnet" -version = "2.5.1" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f88c5561171189e69df9d98bcf18fd5f9558300f7ea7b801eb8a0fd748bd8745" +checksum = "12b6ee2129af8d4fb011108c73d99a1b83a85977f23b82460c0ae2e25bb4b57f" [[package]] name = "is-terminal" -version = "0.4.3" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e18b0a45d56fe973d6db23972bf5bc46f988a4a2385deac9cc29572f09daef" +checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" dependencies = [ "hermit-abi 0.3.1", "io-lifetimes", "rustix", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -1485,15 +1491,15 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.4" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" +checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" [[package]] name = "js-sys" -version = "0.3.60" +version = "0.3.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" +checksum = "2f37a4a5928311ac501dee68b3c7613a1037d0edb30c8e5427bd832d55d1b790" dependencies = [ "wasm-bindgen", ] @@ -1533,7 +1539,7 @@ dependencies = [ "serde_json", "sled", "thiserror", - "toml", + "toml 0.5.11", ] [[package]] @@ -1549,7 +1555,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6607c62aa161d23d17a9072cc5da0be67cdfc89d3afb1e8d9c842bebc2525ffe" dependencies = [ "arrayvec", - "bitflags", + "bitflags 1.3.2", "cfg-if 1.0.0", "ryu", "static_assertions", @@ -1557,27 +1563,30 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.138" +version = "0.2.144" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6d7e329c562c5dfab7a46a2afabc8b987ab9a4834c9d1ca04dc54c1546cef8" +checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1" [[package]] name = "lightning" -version = "0.0.114" +version = "0.0.115" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "800ec68a160529ba3ca12c5db629867c4a8de2df272792c1246602966a5b789b" +checksum = "e009e1c0c21f66378b491bb40f548682138c63e09db6f3a05af59f8804bb9f4a" dependencies = [ "bitcoin", + "hex", + "regex", ] [[package]] name = "lightning-invoice" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adfb59c6d13e130aece30fc72a7c17d74b201aed0ffb201b740f36e07aaece32" +checksum = "c4e44b0e2822c8811470137d2339fdfe67a699b3248bb1606d1d02eb6a1e9f0a" dependencies = [ "bech32", - "bitcoin_hashes 0.11.0", + "bitcoin", + "bitcoin_hashes", "lightning", "num-traits", "secp256k1", @@ -1585,14 +1594,15 @@ dependencies = [ [[package]] name = "lightning-storage-server" -version = "0.2.0" -source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=dcd8628893b5504b3ac2d3eb8cc5ed36f36d7625#dcd8628893b5504b3ac2d3eb8cc5ed36f36d7625" +version = "0.3.0" +source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=0c8c4474af62c4a13e2a32d34b569e8092ed414a#0c8c4474af62c4a13e2a32d34b569e8092ed414a" dependencies = [ "anyhow", "async-trait", - "bitcoin_hashes 0.11.0", - "clap 3.2.23", + "bitcoin_hashes", + "clap 3.2.25", "ctrlc", + "deadpool-postgres", "dirs", "fern", "futures", @@ -1607,21 +1617,13 @@ dependencies = [ "thiserror", "time 0.3.17", "tokio", + "tokio-postgres", "tonic", "tonic-build", "triggered", "url", ] -[[package]] -name = "link-cplusplus" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9272ab7b96c9046fbc5bc56c06c117cb639fe2d509df0c421cad82d2915cf369" -dependencies = [ - "cc", -] - [[package]] name = "linked-hash-map" version = "0.5.6" @@ -1630,9 +1632,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.1.4" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "lock_api" @@ -1646,12 +1648,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.17" +version = "0.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if 1.0.0", -] +checksum = "518ef76f2f87365916b142844c16d8fefd85039bc5699050210a7778ee1cd1de" [[package]] name = "loom" @@ -1669,6 +1668,23 @@ dependencies = [ "tracing-subscriber", ] +[[package]] +name = "lss-connector" +version = "0.1.0" +source = "git+https://github.com/stakwork/sphinx-rs#a321f628e25368bd04d9f6313f8d67001eb7e807" +dependencies = [ + "anyhow", + "lightning-storage-server", + "log", + "rmp-serde", + "secp256k1", + "serde", + "serde-big-array", + "tokio", + "vls-frontend", + "vls-protocol-signer", +] + [[package]] name = "mach" version = "0.3.2" @@ -1689,9 +1705,9 @@ dependencies = [ [[package]] name = "matches" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" +checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" [[package]] name = "matchit" @@ -1705,6 +1721,15 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" +[[package]] +name = "md-5" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" +dependencies = [ + "digest", +] + [[package]] name = "memchr" version = "2.5.0" @@ -1720,6 +1745,15 @@ dependencies = [ "autocfg", ] +[[package]] +name = "memoffset" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" +dependencies = [ + "autocfg", +] + [[package]] name = "metrics" version = "0.20.1" @@ -1728,7 +1762,7 @@ checksum = "7b9b8653cec6897f73b519a43fba5ee3d50f62fe9af80b428accdcc093b4a849" dependencies = [ "ahash 0.7.6", "metrics-macros", - "portable-atomic", + "portable-atomic 0.3.20", ] [[package]] @@ -1743,7 +1777,7 @@ dependencies = [ "metrics", "metrics-util", "parking_lot 0.12.1", - "portable-atomic", + "portable-atomic 0.3.20", "quanta", "thiserror", "tokio", @@ -1758,7 +1792,7 @@ checksum = "731f8ecebd9f3a4aa847dfe75455e4757a45da40a7793d2f0b1f9b6ed18b23f3" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1773,16 +1807,16 @@ dependencies = [ "metrics", "num_cpus", "parking_lot 0.12.1", - "portable-atomic", + "portable-atomic 0.3.20", "quanta", "sketches-ddsketch", ] [[package]] name = "mime" -version = "0.3.16" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "minimal-lexical" @@ -1792,30 +1826,29 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.5.4" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34" +checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" dependencies = [ "adler", ] [[package]] name = "mio" -version = "0.8.5" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" +checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" dependencies = [ "libc", - "log", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.42.0", + "windows-sys 0.48.0", ] [[package]] name = "multer" -version = "2.0.4" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ed4198ce7a4cbd2a57af78d28c6fbb57d81ac5f1d6ad79ac6c5587419cbdf22" +checksum = "01acbdc23469fd8fe07ab135923371d5f5a422fbf9c522158677c8eb15bc51c2" dependencies = [ "bytes", "encoding_rs", @@ -1825,7 +1858,7 @@ dependencies = [ "log", "memchr", "mime", - "spin 0.9.4", + "spin 0.9.8", "tokio", "tokio-util", "version_check", @@ -1852,10 +1885,10 @@ version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cfg-if 1.0.0", "libc", - "memoffset", + "memoffset 0.7.1", "pin-utils", "static_assertions", ] @@ -1925,19 +1958,19 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.14.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5" +checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" dependencies = [ - "hermit-abi 0.1.19", + "hermit-abi 0.2.6", "libc", ] [[package]] name = "object" -version = "0.29.0" +version = "0.30.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" +checksum = "ea86265d3d3dcb6a27fc51bd29a4bf387fae9d2986b823079d4986af253eb439" dependencies = [ "memchr", ] @@ -1953,9 +1986,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.16.0" +version = "1.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" +checksum = "9670a07f94779e00908f3e686eab508878ebb390ba6e604d3a284c00e8d0487b" [[package]] name = "oneshot" @@ -1967,10 +2000,10 @@ dependencies = [ ] [[package]] -name = "opaque-debug" -version = "0.3.0" +name = "openssl-probe" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "ordered-multimap" @@ -1984,9 +2017,9 @@ dependencies = [ [[package]] name = "os_str_bytes" -version = "6.4.1" +version = "6.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" +checksum = "ceedf44fb00f2d1984b0bc98102627ce622e083e49a5bacdb3e514fa4238e267" [[package]] name = "overload" @@ -2002,7 +2035,7 @@ checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" dependencies = [ "instant", "lock_api", - "parking_lot_core 0.8.5", + "parking_lot_core 0.8.6", ] [[package]] @@ -2012,41 +2045,41 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", - "parking_lot_core 0.9.5", + "parking_lot_core 0.9.7", ] [[package]] name = "parking_lot_core" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" +checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" dependencies = [ "cfg-if 1.0.0", "instant", "libc", - "redox_syscall", + "redox_syscall 0.2.16", "smallvec 1.10.0", "winapi", ] [[package]] name = "parking_lot_core" -version = "0.9.5" +version = "0.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ff9f3fef3968a3ec5945535ed654cb38ff72d7495a25619e2247fb15a2ed9ba" +checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" dependencies = [ "cfg-if 1.0.0", "libc", - "redox_syscall", + "redox_syscall 0.2.16", "smallvec 1.10.0", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] name = "paste" -version = "1.0.9" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1de2e551fb905ac83f73f7aedf2f0cb4a0da7e35efa24a202a936269f1f18e1" +checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79" [[package]] name = "pathdiff" @@ -2056,9 +2089,9 @@ checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" [[package]] name = "pear" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e44241c5e4c868e3eaa78b7c1848cadd6344ed4f54d029832d32b415a58702" +checksum = "0ec95680a7087503575284e5063e14b694b7a9c0b065e5dceec661e0497127e8" dependencies = [ "inlinable_string", "pear_codegen", @@ -2067,14 +2100,14 @@ dependencies = [ [[package]] name = "pear_codegen" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82a5ca643c2303ecb740d506539deba189e16f2754040a42901cd8105d0282d0" +checksum = "9661a3a53f93f09f2ea882018e4d7c88f6ff2956d809a276060476fd8c879d3c" dependencies = [ "proc-macro2", "proc-macro2-diagnostics", "quote", - "syn", + "syn 2.0.18", ] [[package]] @@ -2085,9 +2118,9 @@ checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" [[package]] name = "pest" -version = "2.5.5" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "028accff104c4e513bad663bbcd2ad7cfd5304144404c31ed0a77ac103d00660" +checksum = "e68e84bfb01f0507134eac1e9b410a12ba379d064eab48c50ba4ce329a527b70" dependencies = [ "thiserror", "ucd-trie", @@ -2095,9 +2128,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.5.5" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ac3922aac69a40733080f53c1ce7f91dcf57e1a5f6c52f421fadec7fbdc4b69" +checksum = "6b79d4c71c865a25a4322296122e3924d30bc8ee0834c8bfc8b95f7f054afbfb" dependencies = [ "pest", "pest_generator", @@ -2105,22 +2138,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.5.5" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d06646e185566b5961b4058dd107e0a7f56e77c3f484549fb119867773c0f202" +checksum = "6c435bf1076437b851ebc8edc3a18442796b30f1728ffea6262d59bbe28b077e" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn", + "syn 2.0.18", ] [[package]] name = "pest_meta" -version = "2.5.5" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6f60b2ba541577e2a0c307c8f39d1439108120eb7903adeb6497fa880c59616" +checksum = "745a452f8eb71e39ffd8ee32b3c5f51d03845f99786fa9b68db6ff509c505411" dependencies = [ "once_cell", "pest", @@ -2129,32 +2162,50 @@ dependencies = [ [[package]] name = "petgraph" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5014253a1331579ce62aa67443b4a658c5e7dd03d4bc6d302b94474888143" +checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" dependencies = [ "fixedbitset", "indexmap", ] [[package]] -name = "pin-project" -version = "1.0.12" +name = "phf" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" +checksum = "928c6535de93548188ef63bb7c4036bd415cd8f36ad25af44b9789b2ee72a48c" +dependencies = [ + "phf_shared", +] + +[[package]] +name = "phf_shared" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1fb5f6f826b772a8d4c0394209441e7d37cbbb967ae9c7e0e8134365c9ee676" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pin-project" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c95a7476719eab1e366eaf73d0260af3021184f18177925b07f54b30089ceead" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.12" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" +checksum = "39407670928234ebc5e6e580247dd567ad73a3578460c5990f9503df207e8f07" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.18", ] [[package]] @@ -2176,22 +2227,48 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5da3b0203fd7ee5720aa0b5e790b591aa5d3f41c3ed2c34a3a393382198af2f7" [[package]] -name = "polyval" -version = "0.6.0" +name = "portable-atomic" +version = "0.3.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef234e08c11dfcb2e56f79fd70f6f2eb7f025c0ce2333e82f4f0518ecad30c6" +checksum = "e30165d31df606f5726b090ec7592c308a0eaf61721ff64c9a3018e344a8753e" dependencies = [ - "cfg-if 1.0.0", - "cpufeatures", - "opaque-debug", - "universal-hash", + "portable-atomic 1.3.3", ] [[package]] name = "portable-atomic" -version = "0.3.19" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26f6a7b87c2e435a3241addceeeff740ff8b7e76b74c13bf9acb17fa454ea00b" +checksum = "767eb9f07d4a5ebcb39bbf2d452058a93c011373abf6832e24194a1c3f004794" + +[[package]] +name = "postgres-protocol" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78b7fa9f396f51dffd61546fd8573ee20592287996568e6175ceb0f8699ad75d" +dependencies = [ + "base64 0.21.2", + "byteorder", + "bytes", + "fallible-iterator", + "hmac", + "md-5", + "memchr", + "rand", + "sha2", + "stringprep", +] + +[[package]] +name = "postgres-types" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f028f05971fe20f512bcc679e2c10227e57809a3af86a7606304435bc8896cd6" +dependencies = [ + "bytes", + "fallible-iterator", + "postgres-protocol", +] [[package]] name = "ppv-lite86" @@ -2211,12 +2288,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.1.21" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c142c0e46b57171fe0c528bee8c5b7569e80f0c17e377cd0e30ea57dbc11bb51" +checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86" dependencies = [ "proc-macro2", - "syn", + "syn 1.0.109", ] [[package]] @@ -2228,7 +2305,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "version_check", ] @@ -2245,31 +2322,31 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.47" +version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" +checksum = "6aeca18b86b413c660b781aa319e4e2648a3e6f9eadc9b47e9038e6fe9f3451b" dependencies = [ "unicode-ident", ] [[package]] name = "proc-macro2-diagnostics" -version = "0.9.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bf29726d67464d49fa6224a1d07936a8c08bb3fba727c7493f6cf1616fdaada" +checksum = "606c4ba35817e2922a308af55ad51bab3645b59eae5c570d4a6cf07e36bd493b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.18", "version_check", "yansi", ] [[package]] name = "prost" -version = "0.11.3" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0b18e655c21ff5ac2084a5ad0611e827b3f92badf79f4910b5a5c58f4d87ff0" +checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" dependencies = [ "bytes", "prost-derive", @@ -2277,9 +2354,9 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.11.3" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e330bf1316db56b12c2bcfa399e8edddd4821965ea25ddb2c134b610b1c1c604" +checksum = "119533552c9a7ffacc21e099c24a0ac8bb19c2a2a3f363de84cd9b844feab270" dependencies = [ "bytes", "heck", @@ -2292,31 +2369,30 @@ dependencies = [ "prost", "prost-types", "regex", - "syn", + "syn 1.0.109", "tempfile", "which", ] [[package]] name = "prost-derive" -version = "0.11.2" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "164ae68b6587001ca506d3bf7f1000bfa248d0e1217b618108fba4ec1d0cc306" +checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" dependencies = [ "anyhow", "itertools", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "prost-types" -version = "0.11.2" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "747761bc3dc48f9a34553bf65605cf6cb6288ba219f3450b4275dbd81539551a" +checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" dependencies = [ - "bytes", "prost", ] @@ -2331,7 +2407,7 @@ dependencies = [ "mach", "once_cell", "raw-cpuid", - "wasi 0.10.0+wasi-snapshot-preview1", + "wasi 0.10.2+wasi-snapshot-preview1", "web-sys", "winapi", ] @@ -2344,9 +2420,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.21" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" +checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" dependencies = [ "proc-macro2", ] @@ -2395,11 +2471,11 @@ dependencies = [ [[package]] name = "raw-cpuid" -version = "10.6.1" +version = "10.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c307f7aacdbab3f0adee67d52739a1d71112cc068d6fab169ddeb18e48877fad" +checksum = "6c297679cb867470fa8c9f67dbba74a78d78e3e98d7cf2b08d6d71540f797332" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -2408,7 +2484,16 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ - "bitflags", + "bitflags 1.3.2", +] + +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags 1.3.2", ] [[package]] @@ -2418,39 +2503,39 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ "getrandom", - "redox_syscall", + "redox_syscall 0.2.16", "thiserror", ] [[package]] name = "ref-cast" -version = "1.0.13" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53b15debb4f9d60d767cd8ca9ef7abb2452922f3214671ff052defc7f3502c44" +checksum = "f43faa91b1c8b36841ee70e97188a869d37ae21759da6846d4be66de5bf7b12c" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.13" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abfa8511e9e94fd3de6585a3d3cd00e01ed556dc9814829280af0e8dc72a8f36" +checksum = "8d2275aab483050ab2a7364c1a46604865ee7d6906684e08db0f090acf74f9e7" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.18", ] [[package]] name = "regex" -version = "1.7.0" +version = "1.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e076559ef8e241f2ae3479e36f97bd5741c0330689e217ad51ce2c76808b868a" +checksum = "81ca098a9821bd52d6b24fd8b10bd081f47d39c22778cafaa75a2857a62c6390" dependencies = [ "aho-corasick", "memchr", - "regex-syntax", + "regex-syntax 0.7.2", ] [[package]] @@ -2459,31 +2544,28 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" dependencies = [ - "regex-syntax", + "regex-syntax 0.6.29", ] [[package]] name = "regex-syntax" -version = "0.6.28" +version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] -name = "remove_dir_all" -version = "0.5.3" +name = "regex-syntax" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" -dependencies = [ - "winapi", -] +checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" [[package]] name = "reqwest" -version = "0.11.13" +version = "0.11.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68cc60575865c7831548863cc02356512e3f1dc2f3f82cb837d7fc4cc8f3c97c" +checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" dependencies = [ - "base64", + "base64 0.21.2", "bytes", "encoding_rs", "futures-core", @@ -2492,7 +2574,7 @@ dependencies = [ "http", "http-body", "hyper", - "hyper-rustls", + "hyper-rustls 0.24.0", "ipnet", "js-sys", "log", @@ -2500,13 +2582,13 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls", - "rustls-pemfile 1.0.1", + "rustls 0.21.1", + "rustls-pemfile 1.0.2", "serde", "serde_json", "serde_urlencoded", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.0", "tower-service", "url", "wasm-bindgen", @@ -2516,6 +2598,12 @@ dependencies = [ "winreg", ] +[[package]] +name = "retain_mut" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4389f1d5789befaf6029ebd9f7dac4af7f7e3d61b69d4f30e2ac02b57e7712b0" + [[package]] name = "ring" version = "0.16.20" @@ -2555,20 +2643,20 @@ dependencies = [ [[package]] name = "rocket" -version = "0.5.0-rc.2" +version = "0.5.0-rc.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98ead083fce4a405feb349cf09abdf64471c6077f14e0ce59364aa90d4b99317" +checksum = "58734f7401ae5cfd129685b48f61182331745b357b96f2367f01aebaf1cc9cc9" dependencies = [ "async-stream", "async-trait", "atomic", - "atty", "binascii", "bytes", "either", "figment", "futures", "indexmap", + "is-terminal", "log", "memchr", "multer", @@ -2594,9 +2682,9 @@ dependencies = [ [[package]] name = "rocket_codegen" -version = "0.5.0-rc.2" +version = "0.5.0-rc.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6aeb6bb9c61e9cd2c00d70ea267bf36f76a4cc615e5908b349c2f9d93999b47" +checksum = "7093353f14228c744982e409259fb54878ba9563d08214f2d880d59ff2fc508b" dependencies = [ "devise", "glob", @@ -2604,15 +2692,15 @@ dependencies = [ "proc-macro2", "quote", "rocket_http", - "syn", + "syn 2.0.18", "unicode-xid", ] [[package]] name = "rocket_http" -version = "0.5.0-rc.2" +version = "0.5.0-rc.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ded65d127954de3c12471630bf4b81a2792f065984461e65b91d0fdaafc17a2" +checksum = "936012c99162a03a67f37f9836d5f938f662e26f2717809761a9ac46432090f4" dependencies = [ "cookie", "either", @@ -2641,8 +2729,8 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "88073939a61e5b7680558e6be56b419e208420c2adb92be54921fa6b72283f1a" dependencies = [ - "base64", - "bitflags", + "base64 0.13.1", + "bitflags 1.3.2", "serde", ] @@ -2660,30 +2748,30 @@ dependencies = [ "rustls-pemfile 0.3.0", "thiserror", "tokio", - "tokio-rustls", + "tokio-rustls 0.23.4", ] [[package]] name = "rumqttd" version = "0.12.6" -source = "git+https://github.com/Evanfeenstra/rumqtt?branch=sphinx-2#96af7b82e5d7e97f52547c5c8a868fd55e4661fe" +source = "git+https://github.com/Evanfeenstra/rumqtt?branch=sphinx-2#03d1044df6e2f7cddda5d33970ae1cc4b16601e6" dependencies = [ "axum", "bytes", - "clap 4.1.4", + "clap 4.3.1", "config", "flume", "metrics", "metrics-exporter-prometheus", "oneshot", "parking_lot 0.11.2", - "rustls-pemfile 1.0.1", + "rustls-pemfile 1.0.2", "serde", "serde_json", "slab", "thiserror", "tokio", - "tokio-rustls", + "tokio-rustls 0.23.4", "tracing", "tracing-subscriber", "x509-parser", @@ -2701,9 +2789,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.21" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rusticata-macros" @@ -2716,23 +2804,23 @@ dependencies = [ [[package]] name = "rustix" -version = "0.36.8" +version = "0.37.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43abb88211988493c1abb44a70efa56ff0ce98f233b7b276146f1f3f7ba9644" +checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d" dependencies = [ - "bitflags", + "bitflags 1.3.2", "errno", "io-lifetimes", "libc", "linux-raw-sys", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] name = "rustls" -version = "0.20.7" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "539a2bfe908f471bfa933876bd1eb6a19cf2176d375f82ef7f99530a40e48c2c" +checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" dependencies = [ "log", "ring", @@ -2740,35 +2828,78 @@ dependencies = [ "webpki", ] +[[package]] +name = "rustls" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c911ba11bc8433e811ce56fde130ccf32f5127cab0e0194e9c68c5a5b671791e" +dependencies = [ + "log", + "ring", + "rustls-webpki", + "sct", +] + +[[package]] +name = "rustls-native-certs" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0167bac7a9f490495f3c33013e7722b53cb087ecbe082fb0c6387c96f634ea50" +dependencies = [ + "openssl-probe", + "rustls-pemfile 1.0.2", + "schannel", + "security-framework", +] + [[package]] name = "rustls-pemfile" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ee86d63972a7c661d1536fefe8c3c8407321c3df668891286de28abcd087360" dependencies = [ - "base64", + "base64 0.13.1", ] [[package]] name = "rustls-pemfile" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0864aeff53f8c05aa08d86e5ef839d3dfcf07aeba2db32f12db0ef716e87bd55" +checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" dependencies = [ - "base64", + "base64 0.21.2", +] + +[[package]] +name = "rustls-webpki" +version = "0.100.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6207cd5ed3d8dca7816f8f3725513a34609c0c765bf652b8c3cb4cfd87db46b" +dependencies = [ + "ring", + "untrusted", ] [[package]] name = "rustversion" -version = "1.0.9" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97477e48b4cf8603ad5f7aaf897467cf42ab4218a38ef76fb14c2d6773a6d6a8" +checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06" [[package]] name = "ryu" -version = "1.0.11" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" +checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" + +[[package]] +name = "schannel" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" +dependencies = [ + "windows-sys 0.42.0", +] [[package]] name = "scoped-tls" @@ -2782,12 +2913,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" -[[package]] -name = "scratch" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898" - [[package]] name = "sct" version = "0.7.0" @@ -2800,11 +2925,11 @@ dependencies = [ [[package]] name = "secp256k1" -version = "0.24.1" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff55dc09d460954e9ef2fa8a7ced735a964be9981fd50e870b2b3b0705e14964" +checksum = "6b1629c9c557ef9b293568b338dddfc8208c98a18c59d722a9d53f859d9c9b62" dependencies = [ - "bitcoin_hashes 0.11.0", + "bitcoin_hashes", "rand", "secp256k1-sys", "serde", @@ -2820,14 +2945,46 @@ dependencies = [ ] [[package]] -name = "serde" -version = "1.0.148" +name = "security-framework" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e53f64bb4ba0191d6d0676e1b141ca55047d83b74f5607e6d8eb88126c52c2dc" +checksum = "1fc758eb7bffce5b308734e9b0c1468893cae9ff70ebf13e7090be8dcbcc83a8" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f51d0c0d83bec45f16480d0ce0058397a69e48fcdc52d1dc8855fb68acbd31a7" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "serde" +version = "1.0.163" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2113ab51b87a539ae008b5c6c02dc020ffa39afd2d83cffcb3f4eb2722cebec2" dependencies = [ "serde_derive", ] +[[package]] +name = "serde-big-array" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11fc7cc2c76d73e0f27ee52abbd64eec84d46f370c88371120433196934e4b7f" +dependencies = [ + "serde", +] + [[package]] name = "serde_bolt" version = "0.2.4" @@ -2851,20 +3008,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.148" +version = "1.0.163" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a55492425aa53521babf6137309e7d34c20bbfbbfcfe2c7f3a047fd1f6b92c0c" +checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.18", ] [[package]] name = "serde_json" -version = "1.0.89" +version = "1.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "020ff22c755c2ed3f8cf162dbb41a7268d934702f3ed3631656ea597e08fc3db" +checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" dependencies = [ "itoa", "ryu", @@ -2873,9 +3030,18 @@ dependencies = [ [[package]] name = "serde_path_to_error" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db0969fff533976baadd92e08b1d102c5a3d8a8049eadfd69d4d1e3c5b2ed189" +checksum = "f7f05c1d5476066defcdfacce1f52fc3cae3af1d3089727100c02ae92e5abbe0" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_spanned" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93107647184f6027e3b7dcb2e11034cf95ffa1e3a682c67951963ac69c1c007d" dependencies = [ "serde", ] @@ -2894,11 +3060,11 @@ dependencies = [ [[package]] name = "serde_with" -version = "2.1.0" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25bf4a5a814902cd1014dbccfa4d4560fb8432c779471e96e035602519f82eef" +checksum = "07ff71d2c147a7b57362cead5e22f772cd52f6ab31cfcd9edcd7f6aeb2a0afbe" dependencies = [ - "base64", + "base64 0.13.1", "chrono", "hex", "serde", @@ -2909,21 +3075,21 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "2.1.0" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3452b4c0f6c1e357f73fdb87cd1efabaa12acf328c7a528e252893baeb3f4aa" +checksum = "881b6f881b17d13214e5d494c939ebab463d01264ce1811e9d4ac3a882e7695f" dependencies = [ "darling", "proc-macro2", "quote", - "syn", + "syn 2.0.18", ] [[package]] name = "serde_yaml" -version = "0.9.19" +version = "0.9.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f82e6c8c047aa50a7328632d067bcae6ef38772a79e28daf32f735e0e4f3dd10" +checksum = "d9d684e3ec7de3bf5466b32bd75303ac16f0736426e5a4e0d6e489559ce1249c" dependencies = [ "indexmap", "itoa", @@ -2954,24 +3120,30 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" dependencies = [ "libc", ] [[package]] -name = "sketches-ddsketch" -version = "0.2.0" +name = "siphasher" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ceb945e54128e09c43d8e4f1277851bd5044c6fc540bbaa2ad888f60b3da9ae7" +checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" + +[[package]] +name = "sketches-ddsketch" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68a406c1882ed7f29cd5e248c9848a80e7cb6ae0fea82346d2746f2f941c07e1" [[package]] name = "slab" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" dependencies = [ "autocfg", ] @@ -3009,21 +3181,31 @@ checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" [[package]] name = "socket2" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" dependencies = [ "libc", "winapi", ] +[[package]] +name = "socket2" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "sphinx-auther" version = "0.1.12" -source = "git+https://github.com/stakwork/sphinx-rs#29f63185842ee530703cfa6889697ad4007bf28f" +source = "git+https://github.com/stakwork/sphinx-rs#a321f628e25368bd04d9f6313f8d67001eb7e807" dependencies = [ "anyhow", - "base64", + "base64 0.13.1", "hex", "log", "secp256k1", @@ -3032,7 +3214,7 @@ dependencies = [ [[package]] name = "sphinx-glyph" version = "0.1.2" -source = "git+https://github.com/stakwork/sphinx-rs#29f63185842ee530703cfa6889697ad4007bf28f" +source = "git+https://github.com/stakwork/sphinx-rs#a321f628e25368bd04d9f6313f8d67001eb7e807" dependencies = [ "anyhow", "hex", @@ -3050,12 +3232,13 @@ dependencies = [ "async-trait", "bitcoin", "chrono", - "clap 3.2.23", - "clap_derive 3.2.18", + "clap 3.2.25", + "clap_derive 3.2.25", "confy", "fern", "hex", "log", + "lss-connector", "once_cell", "pretty_env_logger", "rocket", @@ -3066,7 +3249,7 @@ dependencies = [ "serde_json", "sphinx-signer", "thiserror", - "toml", + "toml 0.5.11", "url", "vls-frontend", "vls-protocol", @@ -3077,13 +3260,14 @@ dependencies = [ [[package]] name = "sphinx-signer" version = "0.1.0" -source = "git+https://github.com/stakwork/sphinx-rs#29f63185842ee530703cfa6889697ad4007bf28f" +source = "git+https://github.com/stakwork/sphinx-rs#a321f628e25368bd04d9f6313f8d67001eb7e807" dependencies = [ "anyhow", "bip39", "fsdb", "hex", "log", + "lss-connector", "rand", "serde", "sphinx-glyph", @@ -3100,9 +3284,9 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] name = "spin" -version = "0.9.4" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f6002a767bff9e83f8eeecf883ecb8011875a21ae8da43bffb817a57e78cc09" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" dependencies = [ "lock_api", ] @@ -3131,6 +3315,16 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "stringprep" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ee348cb74b87454fff4b551cbf727025810a004f88aeacae7f85b87f4e9a1c1" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + [[package]] name = "strsim" version = "0.10.0" @@ -3139,15 +3333,26 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "subtle" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "syn" -version = "1.0.105" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b9b43d45702de4c839cb9b51d9f529c5dd26a4aff255b42b1ebc03e88ee908" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" dependencies = [ "proc-macro2", "quote", @@ -3156,9 +3361,9 @@ dependencies = [ [[package]] name = "sync_wrapper" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20518fe4a4c9acf048008599e464deb21beeae3d3578418951a189c235a7a9a8" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" [[package]] name = "tap" @@ -3168,23 +3373,22 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.3.0" +version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" +checksum = "b9fbec84f381d5795b08656e4912bec604d162bff9291d6189a78f4c8ab87998" dependencies = [ "cfg-if 1.0.0", "fastrand", - "libc", - "redox_syscall", - "remove_dir_all", - "winapi", + "redox_syscall 0.3.5", + "rustix", + "windows-sys 0.45.0", ] [[package]] name = "termcolor" -version = "1.1.3" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" dependencies = [ "winapi-util", ] @@ -3197,41 +3401,41 @@ checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" [[package]] name = "thiserror" -version = "1.0.37" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" +checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.37" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" +checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.18", ] [[package]] name = "thread_local" -version = "1.1.4" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" dependencies = [ + "cfg-if 1.0.0", "once_cell", ] [[package]] name = "time" -version = "0.1.45" +version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" +checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" dependencies = [ "libc", - "wasi 0.10.0+wasi-snapshot-preview1", "winapi", ] @@ -3264,22 +3468,21 @@ dependencies = [ [[package]] name = "tokio" -version = "1.26.0" +version = "1.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03201d01c3c27a29c8a5cee5b55a93ddae1ccf6f08f65365c2c918f8c1b76f64" +checksum = "94d7b1cfd2aa4011f2de74c2c4c63665e27a71006b0a192dcd2710272e73dfa2" dependencies = [ "autocfg", "bytes", "libc", - "memchr", "mio", "num_cpus", "parking_lot 0.12.1", "pin-project-lite", "signal-hook-registry", - "socket2", + "socket2 0.4.9", "tokio-macros", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -3294,13 +3497,37 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "1.8.2" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" +checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.18", +] + +[[package]] +name = "tokio-postgres" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e89f6234aa8fd43779746012fcf53603cdb91fdd8399aa0de868c2d56b6dde1" +dependencies = [ + "async-trait", + "byteorder", + "bytes", + "fallible-iterator", + "futures-channel", + "futures-util", + "log", + "parking_lot 0.12.1", + "percent-encoding", + "phf", + "pin-project-lite", + "postgres-protocol", + "postgres-types", + "socket2 0.5.3", + "tokio", + "tokio-util", ] [[package]] @@ -3309,16 +3536,26 @@ version = "0.23.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" dependencies = [ - "rustls", + "rustls 0.20.8", "tokio", "webpki", ] [[package]] -name = "tokio-stream" -version = "0.1.11" +name = "tokio-rustls" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d660770404473ccd7bc9f8b28494a811bc18542b915c0855c51e8f419d5223ce" +checksum = "e0d409377ff5b1e3ca6437aa86c1eb7d40c134bfec254e44c830defa92669db5" +dependencies = [ + "rustls 0.21.1", + "tokio", +] + +[[package]] +name = "tokio-stream" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" dependencies = [ "futures-core", "pin-project-lite", @@ -3327,9 +3564,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.2" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f988a1a1adc2fb21f9c12aa96441da33a1728193ae0b95d2be22dbd17fcb4e5c" +checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" dependencies = [ "bytes", "futures-core", @@ -3341,13 +3578,47 @@ dependencies = [ [[package]] name = "toml" -version = "0.5.9" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" dependencies = [ "serde", ] +[[package]] +name = "toml" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6135d499e69981f9ff0ef2167955a5333c35e36f6937d382974566b3d5b94ec" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a76a9312f5ba4c2dec6b9161fdf25d87ad8a09256ccea5a556fef03c706a10f" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.19.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380d56e8670370eee6566b0bfd4265f65b3f432e8c6d85623f728d4fa31f739" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + [[package]] name = "tonic" version = "0.8.3" @@ -3357,7 +3628,7 @@ dependencies = [ "async-stream", "async-trait", "axum", - "base64", + "base64 0.13.1", "bytes", "futures-core", "futures-util", @@ -3370,9 +3641,9 @@ dependencies = [ "pin-project", "prost", "prost-derive", - "rustls-pemfile 1.0.1", + "rustls-pemfile 1.0.2", "tokio", - "tokio-rustls", + "tokio-rustls 0.23.4", "tokio-stream", "tokio-util", "tower", @@ -3392,7 +3663,7 @@ dependencies = [ "proc-macro2", "prost-build", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -3415,25 +3686,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "tower-http" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f873044bf02dd1e8239e9c1293ea39dad76dc594ec16185d0a1bf31d8dc8d858" -dependencies = [ - "bitflags", - "bytes", - "futures-core", - "futures-util", - "http", - "http-body", - "http-range-header", - "pin-project-lite", - "tower", - "tower-layer", - "tower-service", -] - [[package]] name = "tower-layer" version = "0.3.2" @@ -3461,20 +3713,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" +checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.18", ] [[package]] name = "tracing-core" -version = "0.1.30" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" dependencies = [ "once_cell", "valuable", @@ -3503,9 +3755,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.16" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6176eae26dd70d0c919749377897b54a9276bd7061339665dd68777926b5a70" +checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" dependencies = [ "matchers", "nu-ansi-term", @@ -3527,28 +3779,31 @@ checksum = "ce148eae0d1a376c1b94ae651fc3261d9cb8294788b962b7382066376503a2d1" [[package]] name = "try-lock" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" +checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "txoo" -version = "0.2.0" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09c71b228077155d24c30be72d7941c90f3a69acdfabf8b5e3166606f1334999" +checksum = "0d8d7e67ea44d2f4df67df6c91e4c2d4e199b4f4950074ccc5cb141a3be60e01" dependencies = [ + "async-trait", "bitcoin", - "core2", + "hyper", + "hyper-rustls 0.23.2", "log", "serde", "serde_yaml", + "url", ] [[package]] name = "txoo-bitcoind-client" -version = "0.2.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be487581ff10fc300238a9be763dc5e63f196a3d322f348d23556cf6912f9093" +checksum = "b01e49cf95ef2253890a4da54cb53683eac54b687fa51a2a77c4d9879c2d8859" dependencies = [ "async-trait", "bitcoin", @@ -3564,9 +3819,9 @@ dependencies = [ [[package]] name = "typenum" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" [[package]] name = "ubyte" @@ -3585,9 +3840,9 @@ checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" [[package]] name = "uncased" -version = "0.9.7" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09b01702b0fd0b3fadcf98e098780badda8742d4f4a7676615cad90e8ac73622" +checksum = "9b9bc53168a4be7402ab86c3aad243a84dd7381d09be0eddc81280c1da95ca68" dependencies = [ "serde", "version_check", @@ -3595,15 +3850,15 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.8" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.5" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" +checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" [[package]] name = "unicode-normalization" @@ -3614,33 +3869,17 @@ dependencies = [ "smallvec 0.6.14", ] -[[package]] -name = "unicode-width" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" - [[package]] name = "unicode-xid" version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" -[[package]] -name = "universal-hash" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d3160b73c9a19f7e2939a2fdad446c57c1bbbbf4d919d3213ff1267a580d8b5" -dependencies = [ - "crypto-common", - "subtle", -] - [[package]] name = "unsafe-libyaml" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad2024452afd3874bf539695e04af6732ba06517424dbf958fdb16a01f3bef6c" +checksum = "1865806a559042e51ab5414598446a5871b561d21b6764f2eabb0dd481d880a6" [[package]] name = "untrusted" @@ -3659,6 +3898,12 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + [[package]] name = "valuable" version = "0.1.0" @@ -3673,8 +3918,8 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "vls-core" -version = "0.2.0-rc.2" -source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=dcd8628893b5504b3ac2d3eb8cc5ed36f36d7625#dcd8628893b5504b3ac2d3eb8cc5ed36f36d7625" +version = "0.9.0" +source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=0c8c4474af62c4a13e2a32d34b569e8092ed414a#0c8c4474af62c4a13e2a32d34b569e8092ed414a" dependencies = [ "anyhow", "backtrace", @@ -3697,10 +3942,11 @@ dependencies = [ [[package]] name = "vls-frontend" -version = "0.2.0-rc.2" -source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=dcd8628893b5504b3ac2d3eb8cc5ed36f36d7625#dcd8628893b5504b3ac2d3eb8cc5ed36f36d7625" +version = "0.9.0" +source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=0c8c4474af62c4a13e2a32d34b569e8092ed414a#0c8c4474af62c4a13e2a32d34b569e8092ed414a" dependencies = [ "async-trait", + "lightning-storage-server", "log", "tokio", "txoo-bitcoind-client", @@ -3710,8 +3956,8 @@ dependencies = [ [[package]] name = "vls-persist" -version = "0.2.0-rc.2" -source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=dcd8628893b5504b3ac2d3eb8cc5ed36f36d7625#dcd8628893b5504b3ac2d3eb8cc5ed36f36d7625" +version = "0.9.0" +source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=0c8c4474af62c4a13e2a32d34b569e8092ed414a#0c8c4474af62c4a13e2a32d34b569e8092ed414a" dependencies = [ "hex", "kv", @@ -3724,8 +3970,8 @@ dependencies = [ [[package]] name = "vls-protocol" -version = "0.2.0-rc.2" -source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=dcd8628893b5504b3ac2d3eb8cc5ed36f36d7625#dcd8628893b5504b3ac2d3eb8cc5ed36f36d7625" +version = "0.9.0" +source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=0c8c4474af62c4a13e2a32d34b569e8092ed414a#0c8c4474af62c4a13e2a32d34b569e8092ed414a" dependencies = [ "as-any", "bolt-derive", @@ -3738,8 +3984,8 @@ dependencies = [ [[package]] name = "vls-protocol-client" -version = "0.2.0-rc.2" -source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=dcd8628893b5504b3ac2d3eb8cc5ed36f36d7625#dcd8628893b5504b3ac2d3eb8cc5ed36f36d7625" +version = "0.9.0" +source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=0c8c4474af62c4a13e2a32d34b569e8092ed414a#0c8c4474af62c4a13e2a32d34b569e8092ed414a" dependencies = [ "anyhow", "async-trait", @@ -3753,8 +3999,8 @@ dependencies = [ [[package]] name = "vls-protocol-signer" -version = "0.2.0-rc.2" -source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=dcd8628893b5504b3ac2d3eb8cc5ed36f36d7625#dcd8628893b5504b3ac2d3eb8cc5ed36f36d7625" +version = "0.9.0" +source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=0c8c4474af62c4a13e2a32d34b569e8092ed414a#0c8c4474af62c4a13e2a32d34b569e8092ed414a" dependencies = [ "bit-vec", "log", @@ -3765,14 +4011,15 @@ dependencies = [ [[package]] name = "vls-proxy" -version = "0.2.0-rc.2" -source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=dcd8628893b5504b3ac2d3eb8cc5ed36f36d7625#dcd8628893b5504b3ac2d3eb8cc5ed36f36d7625" +version = "0.9.0" +source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=0c8c4474af62c4a13e2a32d34b569e8092ed414a#0c8c4474af62c4a13e2a32d34b569e8092ed414a" dependencies = [ "anyhow", "as-any", "async-stream", "async-trait", - "clap 3.2.23", + "backoff", + "clap 3.2.25", "ctrlc", "fern", "futures", @@ -3788,7 +4035,7 @@ dependencies = [ "time 0.3.17", "tokio", "tokio-stream", - "toml", + "toml 0.5.11", "tonic", "tonic-build", "triggered", @@ -3814,9 +4061,9 @@ dependencies = [ [[package]] name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" +version = "0.10.2+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" [[package]] name = "wasi" @@ -3826,9 +4073,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.83" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" +checksum = "5bba0e8cb82ba49ff4e229459ff22a191bbe9a1cb3a341610c9c33efc27ddf73" dependencies = [ "cfg-if 1.0.0", "wasm-bindgen-macro", @@ -3836,24 +4083,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.83" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" +checksum = "19b04bc93f9d6bdee709f6bd2118f57dd6679cf1176a1af464fca3ab0d66d8fb" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn", + "syn 2.0.18", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.33" +version = "0.4.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" +checksum = "2d1985d03709c53167ce907ff394f5316aa22cb4e12761295c5dc57dacb6297e" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -3863,9 +4110,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.83" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" +checksum = "14d6b024f1a526bb0234f52840389927257beb670610081360e5a03c5df9c258" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3873,28 +4120,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.83" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" +checksum = "e128beba882dd1eb6200e1dc92ae6c5dbaa4311aa7bb211ca035779e5efc39f8" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.18", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.83" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" +checksum = "ed9d5b4305409d1fc9482fee2d7f9bcbf24b3972bf59817ef757e23982242a93" [[package]] name = "web-sys" -version = "0.3.60" +version = "0.3.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" +checksum = "3bdd9ef4e984da1187bf8110c5cf5b845fbc87a23602cdf912386a76fcd3a7c2" dependencies = [ "js-sys", "wasm-bindgen", @@ -3912,18 +4159,18 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.22.5" +version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368bfe657969fb01238bb756d351dcade285e0f6fcbd36dcb23359a5169975be" +checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" dependencies = [ "webpki", ] [[package]] name = "which" -version = "4.3.0" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c831fbbee9e129a8cf93e7747a82da9d95ba8e16621cae60ec2cdc849bacb7b" +checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" dependencies = [ "either", "libc", @@ -3963,15 +4210,11 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.32.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbedf6db9096bc2364adce0ae0aa636dcd89f3c3f2cd67947062aaf0ca2a10ec" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "windows_aarch64_msvc 0.32.0", - "windows_i686_gnu 0.32.0", - "windows_i686_msvc 0.32.0", - "windows_x86_64_gnu 0.32.0", - "windows_x86_64_msvc 0.32.0", + "windows-targets 0.48.0", ] [[package]] @@ -3980,13 +4223,13 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc 0.42.1", - "windows_i686_gnu 0.42.1", - "windows_i686_msvc 0.42.1", - "windows_x86_64_gnu 0.42.1", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc 0.42.1", + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", ] [[package]] @@ -3995,95 +4238,140 @@ version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" dependencies = [ - "windows-targets", + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.0", ] [[package]] name = "windows-targets" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc 0.42.1", - "windows_i686_gnu 0.42.1", - "windows_i686_msvc 0.42.1", - "windows_x86_64_gnu 0.42.1", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc 0.42.1", + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +dependencies = [ + "windows_aarch64_gnullvm 0.48.0", + "windows_aarch64_msvc 0.48.0", + "windows_i686_gnu 0.48.0", + "windows_i686_msvc 0.48.0", + "windows_x86_64_gnu 0.48.0", + "windows_x86_64_gnullvm 0.48.0", + "windows_x86_64_msvc 0.48.0", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" [[package]] name = "windows_aarch64_msvc" -version = "0.32.0" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8e92753b1c443191654ec532f14c199742964a061be25d77d7a96f09db20bf5" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_aarch64_msvc" -version = "0.42.1" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" [[package]] name = "windows_i686_gnu" -version = "0.32.0" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a711c68811799e017b6038e0922cb27a5e2f43a2ddb609fe0b6f3eeda9de615" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_gnu" -version = "0.42.1" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" [[package]] name = "windows_i686_msvc" -version = "0.32.0" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "146c11bb1a02615db74680b32a68e2d61f553cc24c4eb5b4ca10311740e44172" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_i686_msvc" -version = "0.42.1" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" [[package]] name = "windows_x86_64_gnu" -version = "0.32.0" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c912b12f7454c6620635bbff3450962753834be2a594819bd5e945af18ec64bc" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnu" -version = "0.42.1" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" [[package]] name = "windows_x86_64_msvc" -version = "0.32.0" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "504a2476202769977a040c6364301a3f65d0cc9e3fb08600b2bda150a0488316" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "windows_x86_64_msvc" -version = "0.42.1" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" + +[[package]] +name = "winnow" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61de7bac303dc551fe038e2b3cef0f571087a47571ea6e79a87692ac99b99699" +dependencies = [ + "memchr", +] [[package]] name = "winreg" @@ -4106,7 +4394,7 @@ version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64abca276c58f8341ddc13fd4bd6ae75993cc669043f5b34813c90f7dff04771" dependencies = [ - "base64", + "base64 0.13.1", "chrono", "data-encoding", "der-parser", diff --git a/broker/Cargo.toml b/broker/Cargo.toml index b8e7981..4b726f6 100644 --- a/broker/Cargo.toml +++ b/broker/Cargo.toml @@ -9,11 +9,12 @@ strip = "debuginfo" [dependencies] sphinx-signer = { git = "https://github.com/stakwork/sphinx-rs" } -# sphinx-key-parser = { path = "../parser" } -vls-protocol = { git = "https://gitlab.com/lightning-signer/validating-lightning-signer.git", rev = "dcd8628893b5504b3ac2d3eb8cc5ed36f36d7625" } -vls-proxy = { git = "https://gitlab.com/lightning-signer/validating-lightning-signer.git", rev = "dcd8628893b5504b3ac2d3eb8cc5ed36f36d7625" } -vls-frontend = { git = "https://gitlab.com/lightning-signer/validating-lightning-signer.git", rev = "dcd8628893b5504b3ac2d3eb8cc5ed36f36d7625" } -vls-protocol-client = { git = "https://gitlab.com/lightning-signer/validating-lightning-signer.git", rev = "dcd8628893b5504b3ac2d3eb8cc5ed36f36d7625" } +lss-connector = { git = "https://github.com/stakwork/sphinx-rs" } +# lss-connector = { path = "../../sphinx-rs/lss-connector" } +vls-protocol = { git = "https://gitlab.com/lightning-signer/validating-lightning-signer.git", rev = "0c8c4474af62c4a13e2a32d34b569e8092ed414a" } +vls-proxy = { git = "https://gitlab.com/lightning-signer/validating-lightning-signer.git", rev = "0c8c4474af62c4a13e2a32d34b569e8092ed414a" } +vls-frontend = { git = "https://gitlab.com/lightning-signer/validating-lightning-signer.git", rev = "0c8c4474af62c4a13e2a32d34b569e8092ed414a" } +vls-protocol-client = { git = "https://gitlab.com/lightning-signer/validating-lightning-signer.git", rev = "0c8c4474af62c4a13e2a32d34b569e8092ed414a" } rumqttd = { git = "https://github.com/Evanfeenstra/rumqtt", branch = "sphinx-2" } pretty_env_logger = "0.4.0" confy = "0.4.0" diff --git a/broker/lss.md b/broker/lss.md new file mode 100644 index 0000000..d6322f1 --- /dev/null +++ b/broker/lss.md @@ -0,0 +1,68 @@ +# steps to integrate LSS + +### initialization + +##### broker + +- check that there is an LSS url to use +- LssClient::get_server_pubkey +- send server pubkey to signer + +##### signer + +- let client_id = keys_manager.get_persistence_pubkey() +- let auth_token = keys_manager.get_persistence_auth_token(&server_pubkey) +- let shared_secret = keys_manager.get_persistence_shared_secret(&server_pubkey) +- create a ExternalPersistHelper locally and init `state` +- helper.new_nonce +- send the client_id, auth_token, and nonce back to the broker + +##### broker + +- create Auth +- LssClient::new +- get ALL muts from cloud +- let (muts, server_hmac) = client.get("".to_string(), &nonce) +- send the muts and server_hmac to signer + +##### signer + +- check the server hmac +- insert the muts into local state +- let handler_builder = handler_builder.lss_state(...); +- (what is the above line do it muts are already inserted???) +- let (handler, muts) = handler_builder.build(); +- helper.client_hmac +- send the muts and client_hmac back to broker + +##### broker + +- store the muts using the LssClient (client.put(muts, &client_hmac)) +- send server_hmac back to signer??? +- init the Unix Fd connection finally, so the hsmd_init message comes + +##### signer + +- need to verify server hmac here??? + +### VLS + +##### signer + +- let (reply, muts) = handler.handle(msg) +- let client_hmac = helper.client_hmac(&muts); +- send muts and hmac to broker + +##### broker + +- client.put(muts, &client_hmac).await? +- server hmac sent back to signer + +##### signer + +- verify server hmac +- finally, send the VLS reply back to broker + +##### broker + +- forward the VLS reply back to CLN diff --git a/broker/src/chain_tracker.rs b/broker/src/chain_tracker.rs index ccac9bd..a43deb6 100644 --- a/broker/src/chain_tracker.rs +++ b/broker/src/chain_tracker.rs @@ -1,4 +1,4 @@ -use crate::{ChannelReply, ChannelRequest}; +use crate::conn::{ChannelReply, ChannelRequest}; use async_trait::async_trait; use rocket::tokio::sync::{mpsc, oneshot}; use sphinx_signer::sphinx_glyph::topics; @@ -16,10 +16,8 @@ impl SignerPort for MqttSignerPort { self.get_reply(reply_rx).await } - fn clone(&self) -> Box { - Box::new(Self { - sender: self.sender.clone(), - }) + fn is_ready(&self) -> bool { + true } } diff --git a/broker/src/conn.rs b/broker/src/conn.rs new file mode 100644 index 0000000..4ee2d4b --- /dev/null +++ b/broker/src/conn.rs @@ -0,0 +1,126 @@ +use rocket::tokio::sync::{mpsc, oneshot}; +use serde::{Deserialize, Serialize}; +use anyhow::Result; + +#[derive(Debug, Serialize, Deserialize)] +pub struct Connections { + pub pubkey: Option, + pub clients: Vec, +} + +impl Connections { + pub fn new() -> Self { + Self { + pubkey: None, + clients: Vec::new(), + } + } + pub fn set_pubkey(&mut self, pk: &str) { + self.pubkey = Some(pk.to_string()) + } + pub fn add_client(&mut self, cid: &str) { + let cids = cid.to_string(); + if !self.clients.contains(&cids) { + // new client is added to beginning of Vec + self.clients.insert(0, cids); + } + } + pub fn remove_client(&mut self, cid: &str) { + let cids = cid.to_string(); + if self.clients.contains(&cids) { + self.clients.retain(|x| x != cid) + } + } + pub fn client_action(&mut self, cid: &str, connected: bool) { + if connected { + self.add_client(cid); + } else { + self.remove_client(cid); + } + } +} + +pub struct Channel { + pub sequence: u16, + pub sender: mpsc::Sender, + pub pubkey: [u8; 33], +} + +/// Responses are received on the oneshot sender +#[derive(Debug)] +pub struct ChannelRequest { + pub topic: String, + pub message: Vec, + pub reply_tx: oneshot::Sender, + pub cid: Option, // if it exists, only try the one client +} +impl ChannelRequest { + pub fn new(topic: &str, message: Vec) -> (Self, oneshot::Receiver) { + let (reply_tx, reply_rx) = oneshot::channel(); + let cr = ChannelRequest { + topic: topic.to_string(), + message, + reply_tx, + cid: None, + }; + (cr, reply_rx) + } + pub async fn send(topic: &str, message: Vec, sender: &mpsc::Sender) -> Result> { + let (reply_tx, reply_rx) = oneshot::channel(); + let req = ChannelRequest { + topic: topic.to_string(), + message, + reply_tx, + cid: None, + }; + let _ = sender.send(req).await; + let reply = reply_rx.await?; + Ok(reply.reply) + } + pub async fn send_for(cid: &str, topic: &str, message: Vec, sender: &mpsc::Sender) -> Result> { + let (reply_tx, reply_rx) = oneshot::channel(); + let req = ChannelRequest { + topic: topic.to_string(), + message, + reply_tx, + cid: Some(cid.to_string()), + }; + let _ = sender.send(req).await; + let reply = reply_rx.await?; + Ok(reply.reply) + } + pub fn for_cid(&mut self, cid: &str) { + self.cid = Some(cid.to_string()) + } + pub fn new_for( + cid: &str, + topic: &str, + message: Vec, + ) -> (Self, oneshot::Receiver) { + let (mut cr, reply_rx) = ChannelRequest::new(topic, message); + cr.for_cid(cid); + (cr, reply_rx) + } +} + +// mpsc reply +#[derive(Debug)] +pub struct ChannelReply { + // the return topic end part (after last "/") + pub topic_end: String, + pub reply: Vec, +} + +/// Responses are received on the oneshot sender +#[derive(Debug)] +pub struct LssReq { + pub message: Vec, + pub reply_tx: oneshot::Sender>, +} +impl LssReq { + pub fn new(message: Vec) -> (Self, oneshot::Receiver>) { + let (reply_tx, reply_rx) = oneshot::channel(); + let cr = Self { message, reply_tx }; + (cr, reply_rx) + } +} diff --git a/broker/src/unix_fd.rs b/broker/src/looper.rs similarity index 64% rename from broker/src/unix_fd.rs rename to broker/src/looper.rs index 2860071..84175b6 100644 --- a/broker/src/unix_fd.rs +++ b/broker/src/looper.rs @@ -1,11 +1,16 @@ +use crate::conn::{Channel, ChannelRequest, LssReq}; use crate::util::Settings; -use crate::{Channel, ChannelReply, ChannelRequest}; use bitcoin::blockdata::constants::ChainHash; use log::*; -use rocket::tokio::sync::{mpsc, oneshot}; +use rocket::tokio::sync::mpsc; use secp256k1::PublicKey; use sphinx_signer::{parser, sphinx_glyph::topics}; +use std::sync::{ + atomic::{AtomicBool, Ordering}, + Arc, +}; use std::thread; +use std::time::Duration; use vls_protocol::{msgs, msgs::Message, Error, Result}; use vls_proxy::client::Client; @@ -31,25 +36,35 @@ pub struct SignerLoop { log_prefix: String, chan: Channel, client_id: Option, + lss_tx: mpsc::Sender, + busy: Arc, } impl SignerLoop { /// Create a loop for the root (lightningd) connection, but doesn't start it yet - pub fn new(client: C, sender: mpsc::Sender) -> Self { + pub fn new( + client: C, + lss_tx: mpsc::Sender, + sender: mpsc::Sender, + ) -> Self { let log_prefix = format!("{}/{}", std::process::id(), client.id()); Self { client, log_prefix, chan: Channel::new(sender), client_id: None, + lss_tx, + busy: Arc::new(AtomicBool::new(false)), } } // Create a loop for a non-root connection fn new_for_client( client: C, + lss_tx: mpsc::Sender, sender: mpsc::Sender, client_id: ClientId, + busy: Arc, ) -> Self { let log_prefix = format!("{}/{}", std::process::id(), client.id()); Self { @@ -57,6 +72,8 @@ impl SignerLoop { log_prefix, chan: Channel::new(sender), client_id: Some(client_id), + lss_tx, + busy, } } @@ -86,8 +103,13 @@ impl SignerLoop { peer_id, dbid: m.dbid, }; - let mut new_loop = - SignerLoop::new_for_client(new_client, self.chan.sender.clone(), client_id); + let mut new_loop = SignerLoop::new_for_client( + new_client, + self.lss_tx.clone(), + self.chan.sender.clone(), + client_id, + self.busy.clone(), + ); thread::spawn(move || new_loop.start(None)); } Message::Memleak(_) => { @@ -110,15 +132,25 @@ impl SignerLoop { } } let reply = self.handle_message(raw_msg, catch_init)?; - // Write the reply to the node + // Write the reply to CLN self.client.write_vec(reply)?; - // info!("replied {}", self.log_prefix); } } } } fn handle_message(&mut self, message: Vec, catch_init: bool) -> Result> { + // wait until not busy + loop { + match self + .busy + .compare_exchange(false, true, Ordering::Acquire, Ordering::Relaxed) + { + Ok(_) => break, + Err(_) => thread::sleep(Duration::from_millis(5)), + }; + } + let dbid = self.client_id.as_ref().map(|c| c.dbid).unwrap_or(0); let peer_id = self .client_id @@ -126,16 +158,34 @@ impl SignerLoop { .map(|c| c.peer_id.serialize()) .unwrap_or([0u8; 33]); let md = parser::raw_request_from_bytes(message, self.chan.sequence, peer_id, dbid)?; - // send to glyph - let reply_rx = self.send_request(md)?; - let res = self.get_reply(reply_rx)?; - let reply = parser::raw_response_from_bytes(res, self.chan.sequence)?; + // send to signer + log::info!("SEND ON {}", topics::VLS); + let (res_topic, res) = self.send_request_and_get_reply(topics::VLS, md)?; + log::info!("GOT ON {}", res_topic); + let mut the_res = res.clone(); + if res_topic == topics::LSS_RES { + // send reply to LSS to store muts + let lss_reply = self.send_lss_and_get_reply(res)?; + log::info!("LSS REPLY LEN {}", &lss_reply.len()); + // send to signer for HMAC validation, and get final reply + log::info!("SEND ON {}", topics::LSS_MSG); + let (res_topic2, res2) = self.send_request_and_get_reply(topics::LSS_MSG, lss_reply)?; + log::info!("GOT ON {}, send to CLN", res_topic2); + if res_topic2 != topics::VLS_RETURN { + log::warn!("got a topic NOT on {}", topics::VLS_RETURN); + } + the_res = res2; + } + // create reply bytes for CLN + let reply = parser::raw_response_from_bytes(the_res, self.chan.sequence)?; // add to the sequence self.chan.sequence = self.chan.sequence.wrapping_add(1); // catch the pubkey if its the first one connection if catch_init { let _ = self.set_channel_pubkey(reply.clone()); } + // unlock + self.busy.store(false, Ordering::Relaxed); Ok(reply) } @@ -154,21 +204,31 @@ impl SignerLoop { Ok(()) } - fn send_request(&mut self, message: Vec) -> Result> { + // returns (topic, payload) + // might halt if signer is offline + fn send_request_and_get_reply( + &mut self, + topic: &str, + message: Vec, + ) -> Result<(String, Vec)> { // Send a request to the MQTT handler to send to signer - let (request, reply_rx) = ChannelRequest::new(topics::VLS, message); + let (request, reply_rx) = ChannelRequest::new(topic, message); // This can fail if MQTT shuts down self.chan .sender .blocking_send(request) .map_err(|_| Error::Eof)?; - Ok(reply_rx) + let reply = reply_rx.blocking_recv().map_err(|_| Error::Eof)?; + + Ok((reply.topic_end, reply.reply)) } - fn get_reply(&mut self, reply_rx: oneshot::Receiver) -> Result> { - // Wait for the signer reply - // Can fail if MQTT shuts down - let reply = reply_rx.blocking_recv().map_err(|_| Error::Eof)?; - Ok(reply.reply) + fn send_lss_and_get_reply(&mut self, message: Vec) -> Result> { + // Send a request to the MQTT handler to send to signer + let (request, reply_rx) = LssReq::new(message); + // This can fail if MQTT shuts down + self.lss_tx.blocking_send(request).map_err(|_| Error::Eof)?; + let res = reply_rx.blocking_recv().map_err(|_| Error::Eof)?; + Ok(res) } } diff --git a/broker/src/lss.rs b/broker/src/lss.rs new file mode 100644 index 0000000..e487054 --- /dev/null +++ b/broker/src/lss.rs @@ -0,0 +1,72 @@ +use anyhow::Result; +use rocket::tokio::{ + self, + sync::{mpsc}, +}; +use std::time::Duration; +use crate::conn::{ChannelRequest, LssReq}; +use lss_connector::{LssBroker, Response}; +use sphinx_signer::sphinx_glyph::topics; + +pub async fn lss_setup(uri: &str, mqtt_tx: mpsc::Sender) -> Result { + + // LSS required + let (spk, msg_bytes) = LssBroker::get_server_pubkey(uri).await?; + let reply = ChannelRequest::send(topics::LSS_MSG, msg_bytes, &mqtt_tx).await?; + let ir = Response::from_slice(&reply)?.as_init()?; + + let lss_conn = LssBroker::new(uri, ir.clone(), spk).await?; + // this only returns the initial state if it was requested by signer + let msg_bytes2 = lss_conn.get_created_state_msg(&ir).await?; + + let reply2 = ChannelRequest::send(topics::LSS_MSG, msg_bytes2, &mqtt_tx).await?; + let cr = Response::from_slice(&reply2)?.as_created()?; + + lss_conn.handle(Response::Created(cr)).await?; + + Ok(lss_conn) +} + +pub fn lss_tasks(lss_conn: LssBroker, mut lss_rx: mpsc::Receiver, mut reconn_rx: mpsc::Receiver<(String, bool)>, mqtt_tx: mpsc::Sender) { + // msg handler (from CLN looper) + let lss_conn_ = lss_conn.clone(); + tokio::task::spawn(async move{ + while let Some(req) = lss_rx.recv().await { + match lss_conn_.handle_bytes(&req.message).await { + Ok(msg) => { + let _ = req.reply_tx.send(msg); + }, + Err(e) => { + log::error!("failed lss_handle {:?}", e); + } + } + } + }); + + // reconnect handler (when a client reconnects) + let lss_conn_ = lss_conn.clone(); + let mqtt_tx_ = mqtt_tx.clone(); + tokio::task::spawn(async move{ + while let Some((cid, connected)) = reconn_rx.recv().await { + if connected { + log::info!("CLIENT {} reconnected!", cid); + if let Err(e) = reconnect_dance(&cid, &lss_conn_, &mqtt_tx_).await { + log::error!("reconnect dance failed {:?}", e); + } + } + } + }); +} + +async fn reconnect_dance(cid: &str, lss_conn: &LssBroker, mqtt_tx: &mpsc::Sender) -> Result<()> { + // sleep 3 seconds to make sure ESP32 subscription is active + tokio::time::sleep(Duration::from_secs(3)).await; + let init_bytes = lss_conn.make_init_msg().await?; + let reply = ChannelRequest::send_for(cid, topics::LSS_MSG, init_bytes, mqtt_tx).await?; + let ir = Response::from_slice(&reply)?.as_init()?; + let state_bytes = lss_conn.get_created_state_msg(&ir).await?; + let reply2 = ChannelRequest::send_for(cid, topics::LSS_MSG, state_bytes, mqtt_tx).await?; + let cr = Response::from_slice(&reply2)?.as_created()?; + lss_conn.handle(Response::Created(cr)).await?; + Ok(()) +} diff --git a/broker/src/main.rs b/broker/src/main.rs index fe23320..fe848d5 100644 --- a/broker/src/main.rs +++ b/broker/src/main.rs @@ -4,21 +4,23 @@ mod error_log; mod mqtt; mod routes; mod run_test; -mod unix_fd; +mod looper; mod util; +mod conn; +mod lss; +use crate::conn::{Connections, ChannelRequest, LssReq}; use crate::chain_tracker::MqttSignerPort; use crate::mqtt::{check_auth, start_broker}; -use crate::unix_fd::SignerLoop; +use crate::looper::SignerLoop; use crate::util::{read_broker_config, Settings}; use clap::{arg, App}; use rocket::tokio::{ self, - sync::{broadcast, mpsc, oneshot}, + sync::{broadcast, mpsc}, }; use rumqttd::{oneshot as std_oneshot, AuthMsg}; -use serde::{Deserialize, Serialize}; -use std::env; +use std::{env, time::Duration}; use std::sync::{Arc, Mutex}; use url::Url; use vls_frontend::{frontend::SourceFactory, Frontend}; @@ -27,91 +29,6 @@ use vls_proxy::connection::{open_parent_fd, UnixConnection}; use vls_proxy::portfront::SignerPortFront; use vls_proxy::util::{add_hsmd_args, handle_hsmd_version}; -#[derive(Debug, Serialize, Deserialize)] -pub struct Connections { - pub pubkey: Option, - pub clients: Vec, -} - -impl Connections { - pub fn new() -> Self { - Self { - pubkey: None, - clients: Vec::new(), - } - } - pub fn set_pubkey(&mut self, pk: &str) { - self.pubkey = Some(pk.to_string()) - } - pub fn add_client(&mut self, cid: &str) { - let cids = cid.to_string(); - if !self.clients.contains(&cids) { - self.clients.push(cids) - } - } - pub fn remove_client(&mut self, cid: &str) { - let cids = cid.to_string(); - if self.clients.contains(&cids) { - self.clients.retain(|x| x != cid) - } - } - pub fn client_action(&mut self, cid: &str, connected: bool) { - if connected { - self.add_client(cid); - } else { - self.remove_client(cid); - } - } -} - -pub struct Channel { - pub sequence: u16, - pub sender: mpsc::Sender, - pub pubkey: [u8; 33], -} - -/// Responses are received on the oneshot sender -#[derive(Debug)] -pub struct ChannelRequest { - pub topic: String, - pub message: Vec, - pub reply_tx: oneshot::Sender, - pub cid: Option, // if it exists, only try the one client -} -impl ChannelRequest { - pub fn new(topic: &str, message: Vec) -> (Self, oneshot::Receiver) { - let (reply_tx, reply_rx) = oneshot::channel(); - let cr = ChannelRequest { - topic: topic.to_string(), - message, - reply_tx, - cid: None, - }; - (cr, reply_rx) - } - pub fn for_cid(&mut self, cid: &str) { - self.cid = Some(cid.to_string()) - } - pub fn new_for( - cid: &str, - topic: &str, - message: Vec, - ) -> (Self, oneshot::Receiver) { - let (mut cr, reply_rx) = ChannelRequest::new(topic, message); - cr.for_cid(cid); - (cr, reply_rx) - } -} - -// mpsc reply -#[derive(Debug)] -pub struct ChannelReply { - pub reply: Vec, -} - -// const CLIENT_ID: &str = "sphinx-1"; -const BROKER_CONFIG_PATH: &str = "../broker.conf"; - #[rocket::launch] async fn rocket() -> _ { let parent_fd = open_parent_fd(); @@ -135,9 +52,9 @@ async fn rocket() -> _ { panic!("end") } else { if matches.is_present("test") { - run_test::run_test() + run_test::run_test().await } else { - run_main(parent_fd) + run_main(parent_fd).await } } } @@ -149,10 +66,78 @@ fn make_clap_app() -> App<'static> { add_hsmd_args(app) } +async fn run_main(parent_fd: i32) -> rocket::Rocket { + let settings = read_broker_config(); + + let (mqtt_tx, mqtt_rx) = mpsc::channel(10000); + let (error_tx, error_rx) = broadcast::channel(10000); + error_log::log_errors(error_rx); + + let (reconn_tx, reconn_rx) = mpsc::channel::<(String, bool)>(10000); + + // waits until first connection + let conns = broker_setup(settings, mqtt_rx, reconn_tx.clone(), error_tx.clone()).await; + + tokio::time::sleep(Duration::from_secs(1)).await; + + let (lss_tx, lss_rx) = mpsc::channel::(10000); + let _lss_broker = if let Ok(lss_uri) = env::var("VLS_LSS") { + // waits until LSS confirmation from signer + let lss_broker = loop { + match lss::lss_setup(&lss_uri, mqtt_tx.clone()).await{ + Ok(l) => { + break l; + }, + Err(e) => { + let _ = error_tx.send(e.to_string().as_bytes().to_vec()); + log::error!("failed LSS setup, trying again..."); + tokio::time::sleep(Duration::from_secs(3)).await; + } + } + }; + lss::lss_tasks(lss_broker.clone(), lss_rx, reconn_rx, mqtt_tx.clone()); + log::info!("=> lss broker connection created!"); + Some(lss_broker) + } else { + log::warn!("running without LSS"); + None + }; + + if let Ok(btc_url) = env::var("BITCOIND_RPC_URL") { + let signer_port = MqttSignerPort::new(mqtt_tx.clone()); + let port_front = SignerPortFront::new(Arc::new(signer_port), settings.network); + let source_factory = Arc::new(SourceFactory::new(".", settings.network)); + let frontend = Frontend::new( + Arc::new(port_front), + source_factory, + Url::parse(&btc_url).expect("malformed btc rpc url"), + ); + tokio::spawn(async move { + frontend.start(); + }); + } else { + log::warn!("Running without a frontend") + } + + // test sleep FIXME + tokio::time::sleep(std::time::Duration::from_secs(1)).await; + + let cln_client = UnixClient::new(UnixConnection::new(parent_fd)); + // TODO pass status_rx into SignerLoop? + let mut signer_loop = SignerLoop::new(cln_client, lss_tx.clone(), mqtt_tx.clone()); + // spawn CLN listener + std::thread::spawn(move || { + signer_loop.start(Some(settings)); + }); + + routes::launch_rocket(mqtt_tx, error_tx, settings, conns) +} + // blocks until a connection received -pub fn main_setup( +pub async fn broker_setup( settings: Settings, mqtt_rx: mpsc::Receiver, + reconn_tx: mpsc::Sender<(String, bool)>, error_tx: broadcast::Sender>, ) -> Arc> { let (auth_tx, auth_rx) = std::sync::mpsc::channel::(); @@ -170,7 +155,7 @@ pub fn main_setup( let _ = am.reply.send(ok); } }); - + // broker log::info!("=> start broker on network: {}", settings.network); start_broker( @@ -186,6 +171,7 @@ pub fn main_setup( // client connections state let (startup_tx, startup_rx) = std_oneshot::channel(); let conns_ = conns.clone(); + let reconn_tx_ = reconn_tx.clone(); std::thread::spawn(move || { log::info!("=> wait for connected status"); // wait for connection = true @@ -196,9 +182,11 @@ pub fn main_setup( log::info!("=> connected: {}: {}", cid, connected); let _ = startup_tx.send(true); while let Ok((cid, connected)) = status_rx.recv() { + log::info!("=> reconnected: {}: {}", cid, connected); let mut cs = conns_.lock().unwrap(); cs.client_action(&cid, connected); - drop(cs) + drop(cs); + let _ = reconn_tx_.blocking_send((cid, connected)); } }); let _ = startup_rx.recv(); @@ -206,47 +194,3 @@ pub fn main_setup( conns } -fn run_main(parent_fd: i32) -> rocket::Rocket { - let settings = read_broker_config(BROKER_CONFIG_PATH); - - let (mqtt_tx, mqtt_rx) = mpsc::channel(10000); - let (error_tx, error_rx) = broadcast::channel(10000); - error_log::log_errors(error_rx); - - let conns = main_setup(settings, mqtt_rx, error_tx.clone()); - - // let mqtt_tx_ = mqtt_tx.clone(); - // tokio::spawn(async move { - // while let Some(msg) = unix_rx.recv().await { - // // update LSS here? - // if let Err(e) = mqtt_tx_.send(msg).await { - // log::error!("failed to send on mqtt_tx {:?}", e); - // } - // } - // }); - - if let Ok(btc_url) = env::var("BITCOIND_RPC_URL") { - let signer_port = Box::new(MqttSignerPort::new(mqtt_tx.clone())); - let port_front = SignerPortFront::new(signer_port, settings.network); - let source_factory = Arc::new(SourceFactory::new(".", settings.network)); - let frontend = Frontend::new( - Arc::new(port_front), - source_factory, - Url::parse(&btc_url).expect("malformed btc rpc url"), - ); - tokio::spawn(async move { - frontend.start(); - }); - } else { - log::warn!("Running without a frontend") - } - let cln_client = UnixClient::new(UnixConnection::new(parent_fd)); - // TODO pass status_rx into SignerLoop? - let mut signer_loop = SignerLoop::new(cln_client, mqtt_tx.clone()); - // spawn CLN listener - std::thread::spawn(move || { - signer_loop.start(Some(settings)); - }); - - routes::launch_rocket(mqtt_tx, error_tx, settings, conns) -} diff --git a/broker/src/mqtt.rs b/broker/src/mqtt.rs index 7480acb..d1f882c 100644 --- a/broker/src/mqtt.rs +++ b/broker/src/mqtt.rs @@ -1,6 +1,6 @@ +use crate::conn::Connections; +use crate::conn::{ChannelReply, ChannelRequest}; use crate::util::Settings; -use crate::Connections; -use crate::{ChannelReply, ChannelRequest}; use rocket::tokio::{sync::broadcast, sync::mpsc}; use rumqttd::{local::LinkTx, Alert, AlertEvent, AuthMsg, Broker, Config, Notification}; use sphinx_signer::sphinx_glyph::sphinx_auther::token::Token; @@ -75,56 +75,41 @@ pub fn start_broker( }); // String is the client id - let (msg_tx, msg_rx) = std::sync::mpsc::channel::<(String, Vec)>(); + let (msg_tx, msg_rx) = std::sync::mpsc::channel::<(String, String, Vec)>(); - // receive from CLN, Frontend, or Controller + // receive from CLN, Frontend, Controller, or LSS let conns_ = connections.clone(); let _relay_task = std::thread::spawn(move || { while let Some(msg) = receiver.blocking_recv() { - if let Some(cid) = msg.cid { - // for a specific client - let pub_topic = format!("{}/{}", cid, msg.topic); - if let Err(e) = link_tx.publish(pub_topic, msg.message.clone()) { - log::error!("failed to pub to link_tx! {} {:?}", cid, e); - } - let rep = msg_rx.recv(); - if let Ok((cid, reply)) = rep { - if let Err(_) = msg.reply_tx.send(ChannelReply { reply }) { - log::warn!("could not send on reply_tx {}", cid); - } - } - } else { - // send to each client in turn - 'retry_loop: loop { - // get the current list of connected clients + loop { + let reply = if let Some(cid) = msg.cid.clone() { + // for a specific client + pub_wait(&cid, &msg.topic, &msg.message, &msg_rx, &mut link_tx) + } else { + // send to each client in turn let cs = conns_.lock().unwrap(); let client_list = cs.clients.clone(); drop(cs); // wait a second if there are no clients if client_list.len() == 0 { std::thread::sleep(Duration::from_secs(1)); - } - for client in client_list.iter() { - let pub_topic = format!("{}/{}", client, msg.topic); - if let Err(e) = link_tx.publish(pub_topic, msg.message.clone()) { - log::error!("failed to pub to link_tx! {:?}", e); - } - // and receive from the correct client (or timeout to next) - let dur = Duration::from_secs(9); - let rep = msg_rx.recv_timeout(dur); - if let Ok((cid, reply)) = rep { - if &cid == client { - if let Err(_) = msg.reply_tx.send(ChannelReply { reply }) { - log::warn!("could not send on reply_tx"); - } - break 'retry_loop; - } else { - log::warn!("Mismatched client id!"); - // wait a second before trying again - std::thread::sleep(Duration::from_secs(1)); + None + } else { + let mut rep = None; + for cid in client_list.iter() { + rep = pub_wait(&cid, &msg.topic, &msg.message, &msg_rx, &mut link_tx); + if let Some(_) = &rep { + break; } } + rep } + }; + if let Some(reply) = reply { + if let Err(_) = msg.reply_tx.send(reply) { + log::warn!("could not send on reply_tx"); + } + break; } } } @@ -144,12 +129,16 @@ pub fn start_broker( if topic.ends_with(topics::ERROR) { let _ = error_sender.send(f.publish.payload.to_vec()); } else { + // VLS, CONTROL, LSS let ts: Vec<&str> = topic.split("/").collect(); if ts.len() != 2 { continue; } let cid = ts[0].to_string(); - if let Err(e) = msg_tx.send((cid, f.publish.payload.to_vec())) { + let topic_end = ts[1].to_string(); + if let Err(e) = + msg_tx.send((cid, topic_end, f.publish.payload.to_vec())) + { log::error!("failed to pub to msg_tx! {:?}", e); } } @@ -169,15 +158,45 @@ pub fn start_broker( Ok(()) } +// publish to signer and wait for response +// if timeout is exceed, try next signer +fn pub_wait( + client_id: &str, + topic: &str, + payload: &[u8], + msg_rx: &std::sync::mpsc::Receiver<(String, String, Vec)>, + link_tx: &mut LinkTx, +) -> Option { + let pub_topic = format!("{}/{}", client_id, topic); + log::info!("SENDING TO {} on topic {}", client_id, topic); + if let Err(e) = link_tx.publish(pub_topic, payload.to_vec()) { + log::error!("failed to pub to link_tx! {:?}", e); + } + // and receive from the correct client (or timeout to next) + let dur = Duration::from_secs(9); + if let Ok((cid, topic_end, reply)) = msg_rx.recv_timeout(dur) { + if &cid == client_id { + return Some(ChannelReply { reply, topic_end }); + } else { + log::warn!("Mismatched client id!"); + // wait a second before trying again + std::thread::sleep(Duration::from_secs(1)); + } + } + None +} + fn subs(cid: &str, mut ltx: LinkTx) { ltx.subscribe(format!("{}/{}", cid, topics::VLS_RETURN)) .unwrap(); ltx.subscribe(format!("{}/{}", cid, topics::CONTROL_RETURN)) .unwrap(); ltx.subscribe(format!("{}/{}", cid, topics::ERROR)).unwrap(); + ltx.subscribe(format!("{}/{}", cid, topics::LSS_RES)) + .unwrap(); } -fn unsubs(cid: &str, mut ltx: LinkTx) { +fn unsubs(_cid: &str, mut _ltx: LinkTx) { // ltx.unsubscribe(format!("{}/{}", cid, topics::VLS_RETURN)) // .unwrap(); // ltx.unsubscribe(format!("{}/{}", cid, topics::CONTROL_RETURN)) diff --git a/broker/src/routes.rs b/broker/src/routes.rs index b2fed30..886352e 100644 --- a/broker/src/routes.rs +++ b/broker/src/routes.rs @@ -1,6 +1,6 @@ use crate::util::Settings; -use crate::ChannelRequest; -use crate::Connections; +use crate::conn::ChannelRequest; +use crate::conn::Connections; use rocket::fairing::{Fairing, Info, Kind}; use rocket::http::Header; use rocket::response::stream::{Event, EventStream}; @@ -31,7 +31,7 @@ pub async fn control( cid: &str, ) -> Result { let message = hex::decode(msg)?; - // FIXME validate? + // FIXME validate? and auth here? if message.len() < 65 { return Err(Error::Fail); } diff --git a/broker/src/run_test.rs b/broker/src/run_test.rs index aec1a15..370146c 100644 --- a/broker/src/run_test.rs +++ b/broker/src/run_test.rs @@ -1,6 +1,6 @@ use crate::routes::launch_rocket; use crate::util::Settings; -use crate::ChannelRequest; +use crate::conn::ChannelRequest; use rocket::tokio::{self, sync::broadcast, sync::mpsc}; use sphinx_signer::{parser, sphinx_glyph::topics}; use vls_protocol::serde_bolt::WireString; @@ -8,7 +8,7 @@ use vls_protocol::{msgs, msgs::Message}; // const CLIENT_ID: &str = "test-1"; -pub fn run_test() -> rocket::Rocket { +pub async fn run_test() -> rocket::Rocket { log::info!("TEST..."); // let mut id = 0u16; @@ -17,10 +17,12 @@ pub fn run_test() -> rocket::Rocket { let settings = Settings::default(); let (mqtt_tx, mqtt_rx) = mpsc::channel(10000); let (error_tx, error_rx) = broadcast::channel(10000); + let (conn_tx, _conn_rx) = mpsc::channel(10000); + crate::error_log::log_errors(error_rx); // block until connection - let conns = crate::main_setup(settings, mqtt_rx, error_tx.clone()); + let conns = crate::broker_setup(settings, mqtt_rx, conn_tx.clone(), error_tx.clone()).await; log::info!("=> off to the races!"); let tx_ = mqtt_tx.clone(); diff --git a/broker/src/util.rs b/broker/src/util.rs index c756f3b..8ad029c 100644 --- a/broker/src/util.rs +++ b/broker/src/util.rs @@ -22,7 +22,10 @@ impl Default for Settings { } } -pub fn read_broker_config(config_path: &str) -> Settings { +const BROKER_CONFIG_PATH: &str = "../broker.conf"; + +pub fn read_broker_config() -> Settings { + let config_path = BROKER_CONFIG_PATH; let mut settings = Settings::default(); if let Ok(set) = fs::read_to_string(config_path) { let table = Value::from_str(&set) diff --git a/sphinx-key/Cargo.lock b/sphinx-key/Cargo.lock index dfc7cd7..a1541e0 100644 --- a/sphinx-key/Cargo.lock +++ b/sphinx-key/Cargo.lock @@ -181,8 +181,6 @@ checksum = "0694ea59225b0c5f3cb405ff3f670e4828358ed26aec49dc352f730f0cb1a8a3" dependencies = [ "bech32", "bitcoin_hashes", - "core2", - "hashbrown 0.8.2", "secp256k1", "serde", ] @@ -193,7 +191,6 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90064b8dee6815a6470d60bad07bbbaee885c0e12d04177138fa3291a01b7bc4" dependencies = [ - "core2", "serde", ] @@ -206,7 +203,7 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bolt-derive" version = "0.1.0" -source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=e13c8cd994b310f598c0b2902741d89ad5472382#e13c8cd994b310f598c0b2902741d89ad5472382" +source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=53e6c4beac81f6b450af0bde3d8e1ad6883aa0a4#53e6c4beac81f6b450af0bde3d8e1ad6883aa0a4" dependencies = [ "proc-macro2", "quote", @@ -418,15 +415,6 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" -[[package]] -name = "core2" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239fa3ae9b63c2dc74bd3fa852d4792b8b305ae64eeede946265b6af62f1fff3" -dependencies = [ - "memchr", -] - [[package]] name = "cpufeatures" version = "0.2.6" @@ -1267,17 +1255,18 @@ dependencies = [ [[package]] name = "lightning" -version = "0.0.114" -source = "git+https://github.com/lightningdevkit/rust-lightning.git?rev=a7600dcd584db0c46fdcd99d71d5b271f3052892#a7600dcd584db0c46fdcd99d71d5b271f3052892" +version = "0.0.115" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e009e1c0c21f66378b491bb40f548682138c63e09db6f3a05af59f8804bb9f4a" dependencies = [ "bitcoin", - "musig2", ] [[package]] name = "lightning-invoice" -version = "0.22.0" -source = "git+https://github.com/lightningdevkit/rust-lightning.git?rev=a7600dcd584db0c46fdcd99d71d5b271f3052892#a7600dcd584db0c46fdcd99d71d5b271f3052892" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4e44b0e2822c8811470137d2339fdfe67a699b3248bb1606d1d02eb6a1e9f0a" dependencies = [ "bech32", "bitcoin", @@ -1324,7 +1313,7 @@ dependencies = [ [[package]] name = "lss-connector" version = "0.1.0" -source = "git+https://github.com/stakwork/sphinx-rs.git#56d64d2341880063c3668d616548bc8f4abc0b74" +source = "git+https://github.com/stakwork/sphinx-rs.git#24b96a3375989f7f083fabf62b60f1e1e878a390" dependencies = [ "anyhow", "log", @@ -1332,6 +1321,7 @@ dependencies = [ "secp256k1", "serde", "serde-big-array", + "sphinx-glyph", "vls-protocol-signer", ] @@ -1368,14 +1358,6 @@ dependencies = [ "adler", ] -[[package]] -name = "musig2" -version = "0.1.0" -source = "git+https://github.com/arik-so/rust-musig2?rev=27797d7#27797d78cf64e8974e38d7f31ebb11e455015a9e" -dependencies = [ - "bitcoin", -] - [[package]] name = "nb" version = "0.1.3" @@ -1983,7 +1965,7 @@ dependencies = [ [[package]] name = "sphinx-auther" version = "0.1.12" -source = "git+https://github.com/stakwork/sphinx-rs.git#56d64d2341880063c3668d616548bc8f4abc0b74" +source = "git+https://github.com/stakwork/sphinx-rs.git#24b96a3375989f7f083fabf62b60f1e1e878a390" dependencies = [ "anyhow", "base64", @@ -1995,7 +1977,7 @@ dependencies = [ [[package]] name = "sphinx-crypter" version = "0.1.0" -source = "git+https://github.com/stakwork/sphinx-rs.git#56d64d2341880063c3668d616548bc8f4abc0b74" +source = "git+https://github.com/stakwork/sphinx-rs.git#24b96a3375989f7f083fabf62b60f1e1e878a390" dependencies = [ "anyhow", "chacha20poly1305", @@ -2006,7 +1988,7 @@ dependencies = [ [[package]] name = "sphinx-glyph" version = "0.1.2" -source = "git+https://github.com/stakwork/sphinx-rs.git#56d64d2341880063c3668d616548bc8f4abc0b74" +source = "git+https://github.com/stakwork/sphinx-rs.git#24b96a3375989f7f083fabf62b60f1e1e878a390" dependencies = [ "anyhow", "hex", @@ -2030,6 +2012,7 @@ dependencies = [ "esp-idf-sys", "hex", "log", + "lss-connector", "rmp-serde", "serde", "serde_json", @@ -2042,7 +2025,7 @@ dependencies = [ [[package]] name = "sphinx-signer" version = "0.1.0" -source = "git+https://github.com/stakwork/sphinx-rs.git#56d64d2341880063c3668d616548bc8f4abc0b74" +source = "git+https://github.com/stakwork/sphinx-rs.git#24b96a3375989f7f083fabf62b60f1e1e878a390" dependencies = [ "anyhow", "bip39", @@ -2287,12 +2270,11 @@ dependencies = [ [[package]] name = "txoo" -version = "0.3.0" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04d0beccb482c6106605c4eaf4d4bc4ece62b431f148a3f7c0d53a28c0aed6e7" +checksum = "0d8d7e67ea44d2f4df67df6c91e4c2d4e199b4f4950074ccc5cb141a3be60e01" dependencies = [ "bitcoin", - "core2", "log", "serde", ] @@ -2402,8 +2384,8 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "vls-core" -version = "0.2.1" -source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=e13c8cd994b310f598c0b2902741d89ad5472382#e13c8cd994b310f598c0b2902741d89ad5472382" +version = "0.9.0" +source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=53e6c4beac81f6b450af0bde3d8e1ad6883aa0a4#53e6c4beac81f6b450af0bde3d8e1ad6883aa0a4" dependencies = [ "anyhow", "bitcoin", @@ -2424,8 +2406,8 @@ dependencies = [ [[package]] name = "vls-persist" -version = "0.2.0" -source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=e13c8cd994b310f598c0b2902741d89ad5472382#e13c8cd994b310f598c0b2902741d89ad5472382" +version = "0.9.0" +source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=53e6c4beac81f6b450af0bde3d8e1ad6883aa0a4#53e6c4beac81f6b450af0bde3d8e1ad6883aa0a4" dependencies = [ "hex", "log", @@ -2437,8 +2419,8 @@ dependencies = [ [[package]] name = "vls-protocol" -version = "0.2.0" -source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=e13c8cd994b310f598c0b2902741d89ad5472382#e13c8cd994b310f598c0b2902741d89ad5472382" +version = "0.9.0" +source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=53e6c4beac81f6b450af0bde3d8e1ad6883aa0a4#53e6c4beac81f6b450af0bde3d8e1ad6883aa0a4" dependencies = [ "as-any", "bolt-derive", @@ -2451,8 +2433,8 @@ dependencies = [ [[package]] name = "vls-protocol-signer" -version = "0.2.0" -source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=e13c8cd994b310f598c0b2902741d89ad5472382#e13c8cd994b310f598c0b2902741d89ad5472382" +version = "0.9.0" +source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=53e6c4beac81f6b450af0bde3d8e1ad6883aa0a4#53e6c4beac81f6b450af0bde3d8e1ad6883aa0a4" dependencies = [ "bit-vec", "log", diff --git a/sphinx-key/Cargo.toml b/sphinx-key/Cargo.toml index 57203f6..e6e3347 100644 --- a/sphinx-key/Cargo.toml +++ b/sphinx-key/Cargo.toml @@ -22,6 +22,7 @@ no_persist = [] [dependencies] sphinx-signer = { git = "https://github.com/stakwork/sphinx-rs.git", optional = true } sphinx-crypter = { git = "https://github.com/stakwork/sphinx-rs.git" } +lss-connector = { git = "https://github.com/stakwork/sphinx-rs.git", default-features = false } bitflags = "1.3.2" esp-idf-sys = { version = "0.32.1", features = ["binstart"] } embedded-svc = "0.24.0" diff --git a/sphinx-key/run.sh b/sphinx-key/run.sh index b3bb6eb..7617c8d 100755 --- a/sphinx-key/run.sh +++ b/sphinx-key/run.sh @@ -2,7 +2,7 @@ CFLAGS=-fno-pic CC=$PWD/.embuild/espressif/tools/riscv32-esp-elf/esp-2021r2-patch3-8.4.0/riscv32-esp-elf/bin/riscv32-esp-elf-gcc -cargo +nightly build --release +SSID=sphinx-1 PASS=sphinx-1234 cargo build --release esptool.py --chip esp32c3 elf2image target/riscv32imc-esp-espidf/release/sphinx-key diff --git a/sphinx-key/src/conn/mqtt.rs b/sphinx-key/src/conn/mqtt.rs index c0a3855..9199e41 100644 --- a/sphinx-key/src/conn/mqtt.rs +++ b/sphinx-key/src/conn/mqtt.rs @@ -2,6 +2,7 @@ use crate::core::events::Event as CoreEvent; use sphinx_signer::sphinx_glyph::topics; use anyhow::Result; +use embedded_svc::mqtt::client::Details; use embedded_svc::mqtt::client::{Connection, Event, Message as MqttMessage, MessageImpl, QoS}; use embedded_svc::utils::mqtt::client::ConnState; // use embedded_svc::utils::mqtt::client::Connection as MqttConnection; @@ -29,7 +30,6 @@ pub fn make_client( task_stack: 12288, username: Some(username), password: Some(password), - // FIXME - mqtts crt_bundle_attach: Some(esp_idf_sys::esp_crt_bundle_attach), ..Default::default() }; @@ -51,6 +51,8 @@ pub fn make_client( thread::spawn(move || { info!("MQTT Listening for messages"); + let mut inflight = Vec::new(); + let mut inflight_topic = "".to_string(); loop { match connection.next() { Some(msg) => match msg { @@ -76,19 +78,50 @@ pub fn make_client( Event::Unsubscribed(_mes_id) => info!("RECEIVED Unsubscribed MESSAGE"), Event::Published(_mes_id) => info!("RECEIVED Published MESSAGE"), Event::Received(msg) => { - let topic_opt = msg.topic(); - if let Some(topic) = topic_opt { + let incoming_message: Option<(String, Vec)> = match msg.details() { + Details::Complete => { + if let Some(topic) = msg.topic() { + Some((topic.to_string(), msg.data().to_vec())) + } else { + None + } + } + Details::InitialChunk(chunk_info) => { + if let Some(topic) = msg.topic() { + inflight_topic = topic.to_string(); + inflight.extend(msg.data().iter()); + None + } else { + None + } + } + Details::SubsequentChunk(chunk_data) => { + inflight.extend(msg.data().iter()); + if inflight.len() == chunk_data.total_data_size { + let ret = Some((inflight_topic, inflight)); + inflight_topic = "".to_string(); + inflight = Vec::new(); + ret + } else { + None + } + } + }; + + if let Some((topic, data)) = incoming_message { if topic.ends_with(topics::VLS) { - tx.send(CoreEvent::VlsMessage(msg.data().to_vec())) + tx.send(CoreEvent::VlsMessage(data)) .expect("couldnt send Event::VlsMessage"); + } else if topic.ends_with(topics::LSS_MSG) { + log::info!("received data len {}", data.len()); + tx.send(CoreEvent::LssMessage(data)) + .expect("couldnt send Event::LssMessage"); } else if topic.ends_with(topics::CONTROL) { - tx.send(CoreEvent::Control(msg.data().to_vec())) + tx.send(CoreEvent::Control(data)) .expect("couldnt send Event::Control"); } else { log::warn!("unrecognized topic {}", topic); } - } else { - log::warn!("empty topic in msg!!!"); } } Event::Deleted(_mes_id) => info!("RECEIVED Deleted MESSAGE"), diff --git a/sphinx-key/src/core/events.rs b/sphinx-key/src/core/events.rs index 71431c9..4223bcf 100644 --- a/sphinx-key/src/core/events.rs +++ b/sphinx-key/src/core/events.rs @@ -1,9 +1,11 @@ use crate::conn::mqtt::QOS; +use crate::core::lss; use crate::ota::{update_sphinx_key, validate_ota_message}; +use lss_connector::secp256k1::PublicKey; use sphinx_signer::lightning_signer::bitcoin::Network; use sphinx_signer::lightning_signer::persist::Persist; -use sphinx_signer::persist::FsPersister; +use sphinx_signer::persist::{FsPersister, ThreadMemoPersister}; use sphinx_signer::sphinx_glyph::control::{ Config, ControlMessage, ControlResponse, Controller, Policy, }; @@ -26,6 +28,7 @@ pub enum Event { Connected, Disconnected, VlsMessage(Vec), + LssMessage(Vec), Control(Vec), } @@ -48,6 +51,32 @@ pub enum Status { pub const ROOT_STORE: &str = "/sdcard/store"; +pub const SUB_TOPICS: &[&str] = &[topics::VLS, topics::LSS_MSG, topics::CONTROL]; + +fn mqtt_sub( + mqtt: &mut EspMqttClient>, + client_id: &str, + topics: &[&str], +) { + for top in topics { + let topic = format!("{}/{}", client_id, top); + log::info!("SUBSCRIBE to {}", topic); + mqtt.subscribe(&topic, QOS) + .expect("could not MQTT subscribe"); + } +} + +fn mqtt_pub( + mqtt: &mut EspMqttClient>, + client_id: &str, + top: &str, + payload: &[u8], +) { + let topic = format!("{}/{}", client_id, top); + mqtt.publish(&topic, QOS, false, payload) + .expect("could not MQTT publish"); +} + // the main event loop #[cfg(not(feature = "pingpong"))] pub fn make_event_loop( @@ -61,20 +90,14 @@ pub fn make_event_loop( policy: &Policy, mut ctrlr: Controller, client_id: &str, + node_id: &PublicKey, ) -> Result<()> { while let Ok(event) = rx.recv() { log::info!("BROKER IP AND PORT: {}", config.broker); // wait for a Connection first. match event { Event::Connected => { - let vls_topic = format!("{}/{}", client_id, topics::VLS); - log::info!("SUBSCRIBE to {}", vls_topic); - mqtt.subscribe(&vls_topic, QOS) - .expect("could not MQTT subscribe"); - let control_topic = format!("{}/{}", client_id, topics::CONTROL); - mqtt.subscribe(&control_topic, QOS) - .expect("could not MQTT subscribe"); - led_tx.send(Status::Connected).unwrap(); + mqtt_sub(&mut mqtt, client_id, SUB_TOPICS); break; } _ => (), @@ -83,25 +106,31 @@ pub fn make_event_loop( // create the fs persister // 8 character max file names - let persister: Arc = Arc::new(FsPersister::new(&ROOT_STORE, Some(8))); + // let persister: Arc = Arc::new(FsPersister::new(&ROOT_STORE, Some(8))); + let persister = Arc::new(ThreadMemoPersister {}); // initialize the RootHandler - let handler_builder = - sphinx_signer::root::builder(seed, network, policy, persister).expect("failed to init signer"); - let (root_handler, _) = handler_builder.build(); + let rhb = sphinx_signer::root::builder(seed, network, policy, persister, node_id) + .expect("failed to init signer"); + + // FIXME it right to restart here? + let (root_handler, lss_signer) = match lss::init_lss(client_id, &rx, rhb, &mut mqtt) { + Ok(rl) => rl, + Err(e) => { + log::error!("failed to init lss {:?}", e); + unsafe { esp_idf_sys::esp_restart() }; + } + }; + + // store the previous msgs processed, for LSS last step + let mut msgs: Option<(Vec, Vec)> = None; // signing loop log::info!("=> starting the main signing loop..."); while let Ok(event) = rx.recv() { match event { Event::Connected => { - let vls_topic = format!("{}/{}", client_id, topics::VLS); - mqtt.subscribe(&vls_topic, QOS) - .expect("could not MQTT subscribe"); - log::info!("SUBSCRIBE TO {}", vls_topic); - let control_topic = format!("{}/{}", client_id, topics::CONTROL); - mqtt.subscribe(&control_topic, QOS) - .expect("could not MQTT subscribe"); + mqtt_sub(&mut mqtt, client_id, SUB_TOPICS); led_tx.send(Status::Connected).unwrap(); } Event::Disconnected => { @@ -110,22 +139,41 @@ pub fn make_event_loop( } Event::VlsMessage(ref msg_bytes) => { led_tx.send(Status::Signing).unwrap(); - let _ret = - match sphinx_signer::root::handle(&root_handler, msg_bytes.clone(), do_log) { - Ok(b) => { - let vls_return_topic = format!("{}/{}", client_id, topics::VLS_RETURN); - mqtt.publish(&vls_return_topic, QOS, false, &b) - .expect("could not publish VLS response"); + let _ret = match sphinx_signer::root::handle_with_lss( + &root_handler, + &lss_signer, + msg_bytes.clone(), + do_log, + ) { + Ok((vls_b, lss_b)) => { + if lss_b.len() == 0 { + // no muts, respond directly back! + mqtt_pub(&mut mqtt, client_id, topics::VLS_RETURN, &vls_b); + } else { + // muts! send LSS first! + msgs = Some((vls_b, lss_b.clone())); + mqtt_pub(&mut mqtt, client_id, topics::LSS_RES, &lss_b); } - Err(e) => { - let err_msg = GlyphError::new(1, &e.to_string()); - log::error!("HANDLE FAILED {:?}", e); - let error_topic = format!("{}/{}", client_id, topics::ERROR); - mqtt.publish(&error_topic, QOS, false, &err_msg.to_vec()[..]) - .expect("could not publish VLS error"); - // panic!("HANDLE FAILED {:?}", e); - } - }; + } + Err(e) => { + let err_msg = GlyphError::new(1, &e.to_string()); + log::error!("HANDLE FAILED {:?}", e); + mqtt_pub(&mut mqtt, client_id, topics::ERROR, &err_msg.to_vec()[..]); + } + }; + } + Event::LssMessage(ref msg_bytes) => { + match lss::handle_lss_msg(msg_bytes, &msgs, &lss_signer) { + Ok((ret_topic, bytes)) => { + // set msgs back to None + msgs = None; + mqtt_pub(&mut mqtt, client_id, &ret_topic, &bytes); + } + Err(e) => { + let err_msg = GlyphError::new(1, &e.to_string()); + mqtt_pub(&mut mqtt, client_id, topics::ERROR, &err_msg.to_vec()[..]); + } + } } Event::Control(ref msg_bytes) => { log::info!("GOT A CONTROL MSG"); @@ -135,9 +183,7 @@ pub fn make_event_loop( { let res_data = rmp_serde::to_vec_named(&res).expect("could not publish control response"); - let control_return_topic = format!("{}/{}", client_id, topics::CONTROL_RETURN); - mqtt.publish(&control_return_topic, QOS, false, &res_data) - .expect("could not publish control response"); + mqtt_pub(&mut mqtt, client_id, topics::CONTROL_RETURN, &res_data); } } } @@ -224,16 +270,14 @@ pub fn make_event_loop( _policy: &Policy, mut _ctrlr: Controller, client_id: &str, + _node_id: &PublicKey, ) -> Result<()> { log::info!("About to subscribe to the mpsc channel"); while let Ok(event) = rx.recv() { match event { Event::Connected => { led_tx.send(Status::ConnectedToMqtt).unwrap(); - let vls_topic = format!("{}/{}", client_id, topics::VLS); - log::info!("SUBSCRIBE TO {}", vls_topic); - mqtt.subscribe(&vls_topic, QOS) - .expect("could not MQTT subscribe"); + mqtt_sub(&mut mqtt, client_id, &[topics::VLS]); } Event::VlsMessage(msg_bytes) => { led_tx.send(Status::Signing).unwrap(); @@ -241,10 +285,9 @@ pub fn make_event_loop( if do_log { log::info!("GOT A PING MESSAGE! returning pong now..."); } - let vls_return_topic = format!("{}/{}", client_id, topics::VLS_RETURN); - mqtt.publish(&vls_return_topic, QOS, false, b) - .expect("could not publish ping response"); + mqtt_pub(&mut mqtt, client_id, topics::VLS_RETURN, &b); } + Event::LssMessage(_) => (), Event::Disconnected => { led_tx.send(Status::ConnectingToMqtt).unwrap(); log::info!("GOT A Event::Disconnected msg!"); diff --git a/sphinx-key/src/core/lss.rs b/sphinx-key/src/core/lss.rs new file mode 100644 index 0000000..252a597 --- /dev/null +++ b/sphinx-key/src/core/lss.rs @@ -0,0 +1,43 @@ +use crate::conn::mqtt::QOS; +use crate::core::events::Event; +use anyhow::{anyhow, Result}; +use embedded_svc::mqtt::client::MessageImpl; +use embedded_svc::utils::mqtt::client::ConnState; +use esp_idf_svc::mqtt::client::EspMqttClient; +use esp_idf_sys::EspError; +use lss_connector::{secp256k1::PublicKey, LssSigner, Msg as LssMsg}; +use sphinx_signer::sphinx_glyph::topics; +use sphinx_signer::{self, RootHandler, RootHandlerBuilder}; +use std::sync::mpsc; + +pub use lss_connector::handle_lss_msg; + +pub fn init_lss( + client_id: &str, + rx: &mpsc::Receiver, + handler_builder: RootHandlerBuilder, + mqtt: &mut EspMqttClient>, +) -> Result<(RootHandler, LssSigner)> { + let first_lss_msg = match rx.recv()? { + Event::LssMessage(b) => b, + _ => return Err(anyhow!("not a lss msg")), + }; + let init = LssMsg::from_slice(&first_lss_msg)?.as_init()?; + let server_pubkey = PublicKey::from_slice(&init.server_pubkey)?; + + let (lss_signer, res1) = LssSigner::new(&handler_builder, &server_pubkey); + let lss_res_topic = format!("{}/{}", client_id, topics::LSS_RES); + mqtt.publish(&lss_res_topic, QOS, false, &res1) + .expect("could not publish LSS response"); + + let second_lss_msg = match rx.recv()? { + Event::LssMessage(b) => b, + _ => return Err(anyhow!("not a lss msg")), + }; + let created = LssMsg::from_slice(&second_lss_msg)?.as_created()?; + let (root_handler, res2) = lss_signer.build_with_lss(created, handler_builder)?; + mqtt.publish(&lss_res_topic, QOS, false, &res2) + .expect("could not publish LSS response 2"); + + Ok((root_handler, lss_signer)) +} diff --git a/sphinx-key/src/core/mod.rs b/sphinx-key/src/core/mod.rs index d4a4dc3..5c3a5bd 100644 --- a/sphinx-key/src/core/mod.rs +++ b/sphinx-key/src/core/mod.rs @@ -1,3 +1,4 @@ pub mod config; pub mod control; pub mod events; +pub mod lss; diff --git a/sphinx-key/src/main.rs b/sphinx-key/src/main.rs index 4d18b42..ee5d34f 100644 --- a/sphinx-key/src/main.rs +++ b/sphinx-key/src/main.rs @@ -147,11 +147,14 @@ fn make_and_launch_client( // make the controller to validate Control messages let ctrlr = controller_from_seed(&network, &seed[..], flash); - let pubkey = hex::encode(ctrlr.pubkey().serialize()); - let token = ctrlr.make_auth_token().expect("couldnt make auth token"); - log::info!("PUBKEY {} TOKEN {}", &pubkey, &token); - let mqtt_client = conn::mqtt::make_client(&config.broker, CLIENT_ID, &pubkey, &token, tx)?; + let pubkey = ctrlr.pubkey(); + let pubkey_str = hex::encode(&pubkey.serialize()); + let token = ctrlr.make_auth_token().expect("couldnt make auth token"); + log::info!("PUBKEY {} TOKEN {}", &pubkey_str, &token); + + let client_id = random_word(8); + let mqtt_client = conn::mqtt::make_client(&config.broker, &client_id, &pubkey_str, &token, tx)?; // let mqtt_client = conn::mqtt::start_listening(mqtt, connection, tx)?; // this blocks forever... the "main thread" @@ -170,7 +173,17 @@ fn make_and_launch_client( seed, policy, ctrlr, - CLIENT_ID, + &client_id, + &pubkey, )?; Ok(()) } + +pub fn random_word(n: usize) -> String { + use sphinx_crypter::secp256k1::rand::{self, distributions::Alphanumeric, Rng}; + rand::thread_rng() + .sample_iter(&Alphanumeric) + .take(n) + .map(char::from) + .collect() +} diff --git a/tester/src/main.rs b/tester/src/main.rs index 5af024d..c506029 100644 --- a/tester/src/main.rs +++ b/tester/src/main.rs @@ -72,19 +72,21 @@ async fn main() -> Result<(), Box> { } }; + let vls_topic = format!("{}/{}", client_id, topics::VLS); client - .subscribe(topics::VLS, QoS::AtMostOnce) + .subscribe(vls_topic, QoS::AtMostOnce) .await .expect("could not mqtt subscribe"); + let ctrl_topic = format!("{}/{}", client_id, topics::CONTROL); client - .subscribe(topics::CONTROL, QoS::AtMostOnce) + .subscribe(ctrl_topic, QoS::AtMostOnce) .await .expect("could not mqtt subscribe"); if is_test { - run_test(eventloop, &client, ctrlr, is_log).await; + run_test(eventloop, &client, ctrlr, is_log, client_id).await; } else { - run_main(eventloop, &client, ctrlr, is_log, &seed, network).await; + run_main(eventloop, &client, ctrlr, is_log, &seed, network, client_id).await; } } } @@ -96,14 +98,16 @@ async fn run_main( is_log: bool, seed: &[u8], network: Network, + client_id: &str, ) { let store_path = env::var("STORE_PATH").unwrap_or(ROOT_STORE.to_string()); let seed32: [u8; 32] = seed.try_into().expect("wrong seed"); let persister: Arc = Arc::new(FsPersister::new(&store_path, None)); let policy = types::Policy::default(); - let root_handler = sphinx_signer::root::init(seed32, network, &policy, persister) + let handler_builder = sphinx_signer::root::builder(seed32, network, &policy, persister) .expect("Could not initialize root_handler"); + let (root_handler, _muts) = handler_builder.build(); // the actual handler loop loop { match eventloop.poll().await { @@ -111,46 +115,52 @@ async fn run_main( println!("{:?}", event); if let Some((topic, msg_bytes)) = incoming_bytes(event) { println!("MSG BYTES {:}", msg_bytes.len()); - match topic.as_str() { - topics::VLS => { - match sphinx_signer::root::handle(&root_handler, msg_bytes, is_log) { - Ok(b) => client - .publish(topics::VLS_RETURN, QoS::AtMostOnce, false, b) + log::info!(">>> {}", topic.as_str()); + if topic.as_str().ends_with(topics::VLS) { + match sphinx_signer::root::handle(&root_handler, msg_bytes, is_log) { + Ok(b) => { + let ret_topic = format!("{}/{}", client_id, topics::VLS_RETURN); + client + .publish(ret_topic, QoS::AtMostOnce, false, b) .await - .expect("could not publish init response"), - Err(e) => client + .expect("could not publish init response"); + }, + Err(e) => { + let err_topic = format!("{}/{}", client_id, topics::ERROR); + client .publish( - topics::ERROR, + err_topic, QoS::AtMostOnce, false, e.to_string().as_bytes(), ) .await - .expect("could not publish error response"), - }; - } - topics::CONTROL => { - match ctrlr.handle(&msg_bytes) { - Ok((_msg, res)) => { - let res_data = rmp_serde::to_vec_named(&res) - .expect("could not build control response"); - client - .publish( - topics::CONTROL_RETURN, - QoS::AtMostOnce, - false, - res_data, - ) - .await - .expect("could not mqtt publish"); - } - Err(e) => log::warn!("error parsing ctrl msg {:?}", e), - }; - } - _ => log::info!("invalid topic"), + .expect("could not publish error response"); + } + }; + } else if topic.as_str().ends_with(topics::CONTROL) { + match ctrlr.handle(&msg_bytes) { + Ok((_msg, res)) => { + let res_data = rmp_serde::to_vec_named(&res) + .expect("could not build control response"); + let ctrl_ret_topic = format!("{}/{}", client_id, topics::CONTROL_RETURN); + client + .publish( + ctrl_ret_topic, + QoS::AtMostOnce, + false, + res_data, + ) + .await + .expect("could not mqtt publish"); + } + Err(e) => log::warn!("error parsing ctrl msg {:?}", e), + }; + } else { + log::info!("invalid topic"); } } - } + }, Err(e) => { log::warn!("diconnected {:?}", e); tokio::time::sleep(Duration::from_secs(1)).await; @@ -165,6 +175,7 @@ async fn run_test( client: &AsyncClient, mut ctrlr: Controller, is_log: bool, + client_id: &str, ) { // test handler loop loop { @@ -172,44 +183,45 @@ async fn run_test( Ok(event) => { println!("{:?}", event); if let Some((topic, msg_bytes)) = incoming_bytes(event) { - match topic.as_str() { - topics::VLS => { - let (ping, header) = - parser::request_from_bytes::(msg_bytes) - .expect("read ping header"); - if is_log { - println!("INCOMING: {:?}", ping); + log::info!(">>> {}", topic.as_str()); + if topic.as_str().ends_with(topics::VLS) { + let (ping, header) = + parser::request_from_bytes::(msg_bytes) + .expect("read ping header"); + if is_log { + println!("INCOMING: {:?}", ping); + } + let pong = msgs::Pong { + id: ping.id, + message: ping.message, + }; + let bytes = parser::raw_response_from_msg(pong, header.sequence) + .expect("couldnt parse raw response"); + let ret_topic = format!("{}/{}", client_id, topics::VLS_RETURN); + client + .publish(ret_topic, QoS::AtMostOnce, false, bytes) + .await + .expect("could not mqtt publish"); + } else if topic.as_str().ends_with(topics::CONTROL) { + match ctrlr.handle(&msg_bytes) { + Ok((_msg, res)) => { + let res_data = rmp_serde::to_vec_named(&res) + .expect("could not build control response"); + let ctrl_ret_topic = format!("{}/{}", client_id, topics::CONTROL_RETURN); + client + .publish( + ctrl_ret_topic, + QoS::AtMostOnce, + false, + res_data, + ) + .await + .expect("could not mqtt publish"); } - let pong = msgs::Pong { - id: ping.id, - message: ping.message, - }; - let bytes = parser::raw_response_from_msg(pong, header.sequence) - .expect("couldnt parse raw response"); - client - .publish(topics::VLS_RETURN, QoS::AtMostOnce, false, bytes) - .await - .expect("could not mqtt publish"); - } - topics::CONTROL => { - match ctrlr.handle(&msg_bytes) { - Ok((_msg, res)) => { - let res_data = rmp_serde::to_vec_named(&res) - .expect("could not build control response"); - client - .publish( - topics::CONTROL_RETURN, - QoS::AtMostOnce, - false, - res_data, - ) - .await - .expect("could not mqtt publish"); - } - Err(e) => log::warn!("error parsing ctrl msg {:?}", e), - }; - } - _ => log::info!("invalid topic"), + Err(e) => log::warn!("error parsing ctrl msg {:?}", e), + }; + } else { + log::info!("invalid topic"); } } }