From 793727704e5bf170e6908a8bca3a0415e67df060 Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Fri, 17 Mar 2023 15:58:01 -0700 Subject: [PATCH] bump hardware deps --- sphinx-key/Cargo.lock | 92 +++++++++++++++++++++++------------ sphinx-key/src/conn/mqtt.rs | 2 +- sphinx-key/src/core/events.rs | 34 ++++++------- 3 files changed, 76 insertions(+), 52 deletions(-) diff --git a/sphinx-key/Cargo.lock b/sphinx-key/Cargo.lock index 0785be2..25ac85b 100644 --- a/sphinx-key/Cargo.lock +++ b/sphinx-key/Cargo.lock @@ -30,14 +30,9 @@ dependencies = [ [[package]] name = "ahash" -version = "0.7.6" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" -dependencies = [ - "getrandom", - "once_cell", - "version_check", -] +checksum = "e8fd72866655d1904d6b0997d0b07ba561047d070fbe29de039031c641b61217" [[package]] name = "aho-corasick" @@ -174,6 +169,8 @@ checksum = "0694ea59225b0c5f3cb405ff3f670e4828358ed26aec49dc352f730f0cb1a8a3" dependencies = [ "bech32", "bitcoin_hashes 0.11.0", + "core2", + "hashbrown 0.8.2", "secp256k1", "serde", ] @@ -190,6 +187,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90064b8dee6815a6470d60bad07bbbaee885c0e12d04177138fa3291a01b7bc4" dependencies = [ + "core2", "serde", ] @@ -202,7 +200,7 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bolt-derive" version = "0.1.0" -source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git#b00faf17288b4c08411175e5d32c0fa4ba159389" +source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=dcd8628893b5504b3ac2d3eb8cc5ed36f36d7625#dcd8628893b5504b3ac2d3eb8cc5ed36f36d7625" dependencies = [ "proc-macro2", "quote", @@ -443,6 +441,15 @@ 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.5" @@ -1022,11 +1029,12 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.11.2" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +checksum = "e91b62f79061a0bc2e046024cb7ba44b08419ed238ecbd9adbd787434b9e8c25" dependencies = [ "ahash", + "autocfg", ] [[package]] @@ -1226,16 +1234,18 @@ dependencies = [ [[package]] name = "lightning" -version = "0.0.112" -source = "git+https://github.com/lightningdevkit/rust-lightning.git?rev=af7c2920e1e5ae4ba3f522730e5cce99bedacc8c#af7c2920e1e5ae4ba3f522730e5cce99bedacc8c" +version = "0.0.114" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "800ec68a160529ba3ca12c5db629867c4a8de2df272792c1246602966a5b789b" dependencies = [ "bitcoin", ] [[package]] name = "lightning-invoice" -version = "0.20.0" -source = "git+https://github.com/lightningdevkit/rust-lightning.git?rev=af7c2920e1e5ae4ba3f522730e5cce99bedacc8c#af7c2920e1e5ae4ba3f522730e5cce99bedacc8c" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adfb59c6d13e130aece30fc72a7c17d74b201aed0ffb201b740f36e07aaece32" dependencies = [ "bech32", "bitcoin_hashes 0.11.0", @@ -1782,10 +1792,11 @@ dependencies = [ [[package]] name = "serde_bolt" -version = "0.2.0" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "704720009634ab092146c0b01eb578ae8b9d88eef028398752965fd766eb38bd" +checksum = "fd5fb14792b8d139f641e6d0e1a19eb0e3c47ec8629a2dc4e75fcbd7d77f46a8" dependencies = [ + "hex", "serde", "serde_derive", ] @@ -1878,8 +1889,7 @@ dependencies = [ [[package]] name = "sphinx-auther" version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33bd24149ede6f4ec091326eacf550cfa3fc00492d4e627a045c1bd690255362" +source = "git+https://github.com/stakwork/sphinx-rs.git#29f63185842ee530703cfa6889697ad4007bf28f" dependencies = [ "anyhow", "base64", @@ -1891,7 +1901,7 @@ dependencies = [ [[package]] name = "sphinx-crypter" version = "0.1.0" -source = "git+https://github.com/stakwork/sphinx-rs.git#d66360da1aaa8b161366d6a4217129b9402f0ab7" +source = "git+https://github.com/stakwork/sphinx-rs.git#29f63185842ee530703cfa6889697ad4007bf28f" dependencies = [ "anyhow", "chacha20poly1305", @@ -1902,10 +1912,10 @@ dependencies = [ [[package]] name = "sphinx-glyph" version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62fadd6d488d0e5d824acfc3e8a74599429836c9422503c2dfc84418a19bae24" +source = "git+https://github.com/stakwork/sphinx-rs.git#29f63185842ee530703cfa6889697ad4007bf28f" dependencies = [ "anyhow", + "hex", "rmp-serde", "serde", "serde_json", @@ -1938,7 +1948,7 @@ dependencies = [ [[package]] name = "sphinx-signer" version = "0.1.0" -source = "git+https://github.com/stakwork/sphinx-rs.git#d66360da1aaa8b161366d6a4217129b9402f0ab7" +source = "git+https://github.com/stakwork/sphinx-rs.git#29f63185842ee530703cfa6889697ad4007bf28f" dependencies = [ "anyhow", "bip39", @@ -2135,6 +2145,18 @@ dependencies = [ "serde", ] +[[package]] +name = "txoo" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09c71b228077155d24c30be72d7941c90f3a69acdfabf8b5e3166606f1334999" +dependencies = [ + "bitcoin", + "core2", + "log", + "serde", +] + [[package]] name = "typenum" version = "1.15.0" @@ -2241,23 +2263,30 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "vls-core" -version = "0.1.0-5" -source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git#b00faf17288b4c08411175e5d32c0fa4ba159389" +version = "0.2.0-rc.2" +source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=dcd8628893b5504b3ac2d3eb8cc5ed36f36d7625#dcd8628893b5504b3ac2d3eb8cc5ed36f36d7625" dependencies = [ "anyhow", "bitcoin", - "hashbrown 0.11.2", + "bolt-derive", + "hashbrown 0.8.2", + "hex", "itertools", "lightning", "lightning-invoice", "log", "scopeguard", + "serde", + "serde_bolt", + "serde_derive", + "serde_with", + "txoo", ] [[package]] name = "vls-persist" -version = "0.1.0" -source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git#b00faf17288b4c08411175e5d32c0fa4ba159389" +version = "0.2.0-rc.2" +source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=dcd8628893b5504b3ac2d3eb8cc5ed36f36d7625#dcd8628893b5504b3ac2d3eb8cc5ed36f36d7625" dependencies = [ "hex", "log", @@ -2269,11 +2298,12 @@ dependencies = [ [[package]] name = "vls-protocol" -version = "0.1.0" -source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git#b00faf17288b4c08411175e5d32c0fa4ba159389" +version = "0.2.0-rc.2" +source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=dcd8628893b5504b3ac2d3eb8cc5ed36f36d7625#dcd8628893b5504b3ac2d3eb8cc5ed36f36d7625" dependencies = [ "as-any", "bolt-derive", + "hex", "log", "serde", "serde_bolt", @@ -2282,8 +2312,8 @@ dependencies = [ [[package]] name = "vls-protocol-signer" -version = "0.1.0" -source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git#b00faf17288b4c08411175e5d32c0fa4ba159389" +version = "0.2.0-rc.2" +source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=dcd8628893b5504b3ac2d3eb8cc5ed36f36d7625#dcd8628893b5504b3ac2d3eb8cc5ed36f36d7625" dependencies = [ "bit-vec", "log", diff --git a/sphinx-key/src/conn/mqtt.rs b/sphinx-key/src/conn/mqtt.rs index 264b54a..1447d29 100644 --- a/sphinx-key/src/conn/mqtt.rs +++ b/sphinx-key/src/conn/mqtt.rs @@ -13,7 +13,7 @@ use log::*; use std::sync::mpsc; use std::thread; -pub const QOS: QoS = QoS::AtMostOnce; +pub const QOS: QoS = QoS::ExactlyOnce; pub fn make_client( broker: &str, diff --git a/sphinx-key/src/core/events.rs b/sphinx-key/src/core/events.rs index 368fc3b..638ea1d 100644 --- a/sphinx-key/src/core/events.rs +++ b/sphinx-key/src/core/events.rs @@ -9,7 +9,6 @@ use sphinx_signer::sphinx_glyph::control::{ }; use sphinx_signer::sphinx_glyph::error::Error as GlyphError; use sphinx_signer::sphinx_glyph::topics; -use sphinx_signer::vls_protocol::model::PubKey; use sphinx_signer::{self, RootHandler}; use std::sync::mpsc; use std::sync::Arc; @@ -85,7 +84,6 @@ pub fn make_event_loop( sphinx_signer::root::init(seed, network, policy, persister).expect("failed to init signer"); // signing loop - let dummy_peer = PubKey([0; 33]); while let Ok(event) = rx.recv() { match event { Event::Connected => { @@ -102,24 +100,20 @@ 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(), - dummy_peer.clone(), - do_log, - ) { - Ok(b) => { - mqtt.publish(topics::VLS_RETURN, QOS, false, &b) - .expect("could not publish VLS response"); - } - Err(e) => { - let err_msg = GlyphError::new(1, &e.to_string()); - log::error!("HANDLE FAILED {:?}", e); - mqtt.publish(topics::ERROR, QOS, false, &err_msg.to_vec()[..]) - .expect("could not publish VLS error"); - // panic!("HANDLE FAILED {:?}", e); - } - }; + let _ret = + match sphinx_signer::root::handle(&root_handler, msg_bytes.clone(), do_log) { + Ok(b) => { + mqtt.publish(topics::VLS_RETURN, QOS, false, &b) + .expect("could not publish VLS response"); + } + Err(e) => { + let err_msg = GlyphError::new(1, &e.to_string()); + log::error!("HANDLE FAILED {:?}", e); + mqtt.publish(topics::ERROR, QOS, false, &err_msg.to_vec()[..]) + .expect("could not publish VLS error"); + // panic!("HANDLE FAILED {:?}", e); + } + }; } Event::Control(ref msg_bytes) => { log::info!("GOT A CONTROL MSG");