mirror of
https://github.com/stakwork/sphinx-key.git
synced 2025-12-17 15:24:32 +01:00
sphinx-key: collect mqtt bytes into a chunked buffer, pull vls chunked filter work
This commit is contained in:
46
broker/Cargo.lock
generated
46
broker/Cargo.lock
generated
@@ -441,7 +441,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "bolt-derive"
|
||||
version = "0.2.0"
|
||||
source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=9708f5281afe27a2ac5460679ba62a28567b79dc#9708f5281afe27a2ac5460679ba62a28567b79dc"
|
||||
source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=300495658a1903a45a081771fdf2fe6883b057a7#300495658a1903a45a081771fdf2fe6883b057a7"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@@ -505,6 +505,12 @@ dependencies = [
|
||||
"windows-targets 0.48.5",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "chunked-buffer"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fa622bd314835eb026b776af471344d0dba94705c937900656a31d0407e53689"
|
||||
|
||||
[[package]]
|
||||
name = "clap"
|
||||
version = "3.2.25"
|
||||
@@ -1560,7 +1566,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "lightning-storage-server"
|
||||
version = "0.3.0"
|
||||
source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=9708f5281afe27a2ac5460679ba62a28567b79dc#9708f5281afe27a2ac5460679ba62a28567b79dc"
|
||||
source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=300495658a1903a45a081771fdf2fe6883b057a7#300495658a1903a45a081771fdf2fe6883b057a7"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-trait",
|
||||
@@ -1654,7 +1660,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "lss-connector"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/stakwork/sphinx-rs?rev=3a35b8fffb51a03b7a81b2f914b16540653b1d1f#3a35b8fffb51a03b7a81b2f914b16540653b1d1f"
|
||||
source = "git+https://github.com/stakwork/sphinx-rs?rev=197a835c0cd1e060b591433aced242a2ed0ad4a7#197a835c0cd1e060b591433aced242a2ed0ad4a7"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"lightning-storage-server",
|
||||
@@ -2650,7 +2656,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "rmp-utils"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/stakwork/sphinx-rs?rev=3a35b8fffb51a03b7a81b2f914b16540653b1d1f#3a35b8fffb51a03b7a81b2f914b16540653b1d1f"
|
||||
source = "git+https://github.com/stakwork/sphinx-rs?rev=197a835c0cd1e060b591433aced242a2ed0ad4a7#197a835c0cd1e060b591433aced242a2ed0ad4a7"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"log",
|
||||
@@ -2985,12 +2991,13 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "serde_bolt"
|
||||
version = "0.3.1"
|
||||
version = "0.3.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ca3ddb862d94a73280b5b6faa3c9bc37db242f6a495d49f0ffb85f040dbb9bca"
|
||||
checksum = "54f634eeb988ab754b0711815e13e6ad983bfc52f76e0af342d492c6cad4f681"
|
||||
dependencies = [
|
||||
"bitcoin",
|
||||
"bitcoin-consensus-derive",
|
||||
"chunked-buffer",
|
||||
"hex",
|
||||
]
|
||||
|
||||
@@ -3187,7 +3194,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "sphinx-auther"
|
||||
version = "0.1.12"
|
||||
source = "git+https://github.com/stakwork/sphinx-rs?rev=3a35b8fffb51a03b7a81b2f914b16540653b1d1f#3a35b8fffb51a03b7a81b2f914b16540653b1d1f"
|
||||
source = "git+https://github.com/stakwork/sphinx-rs?rev=197a835c0cd1e060b591433aced242a2ed0ad4a7#197a835c0cd1e060b591433aced242a2ed0ad4a7"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"base64 0.21.5",
|
||||
@@ -3199,7 +3206,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "sphinx-glyph"
|
||||
version = "0.1.2"
|
||||
source = "git+https://github.com/stakwork/sphinx-rs?rev=3a35b8fffb51a03b7a81b2f914b16540653b1d1f#3a35b8fffb51a03b7a81b2f914b16540653b1d1f"
|
||||
source = "git+https://github.com/stakwork/sphinx-rs?rev=197a835c0cd1e060b591433aced242a2ed0ad4a7#197a835c0cd1e060b591433aced242a2ed0ad4a7"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"hex",
|
||||
@@ -3231,6 +3238,7 @@ dependencies = [
|
||||
"sphinx-signer",
|
||||
"thiserror",
|
||||
"toml 0.5.11",
|
||||
"triggered",
|
||||
"url",
|
||||
"vls-frontend",
|
||||
"vls-protocol",
|
||||
@@ -3241,7 +3249,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "sphinx-signer"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/stakwork/sphinx-rs?rev=3a35b8fffb51a03b7a81b2f914b16540653b1d1f#3a35b8fffb51a03b7a81b2f914b16540653b1d1f"
|
||||
source = "git+https://github.com/stakwork/sphinx-rs?rev=197a835c0cd1e060b591433aced242a2ed0ad4a7#197a835c0cd1e060b591433aced242a2ed0ad4a7"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"bip39",
|
||||
@@ -3790,9 +3798,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "txoo"
|
||||
version = "0.6.2-beta.3"
|
||||
version = "0.6.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "74fb0ae52e565a5e1364ed50933a2a884f2e6330e8ffe9ac32ec6c4084bd3a3a"
|
||||
checksum = "67d7f813b11b656c950f66dd1ea293d147e2e2c3567d4246b3d682916dc19a5c"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"bitcoin",
|
||||
@@ -3800,6 +3808,7 @@ dependencies = [
|
||||
"hyper-rustls",
|
||||
"log",
|
||||
"serde",
|
||||
"serde_bolt",
|
||||
"serde_yaml",
|
||||
"url",
|
||||
]
|
||||
@@ -3945,7 +3954,7 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
|
||||
[[package]]
|
||||
name = "vls-core"
|
||||
version = "0.11.0-rc.1"
|
||||
source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=9708f5281afe27a2ac5460679ba62a28567b79dc#9708f5281afe27a2ac5460679ba62a28567b79dc"
|
||||
source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=300495658a1903a45a081771fdf2fe6883b057a7#300495658a1903a45a081771fdf2fe6883b057a7"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"backtrace",
|
||||
@@ -3971,12 +3980,13 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "vls-frontend"
|
||||
version = "0.11.0-rc.1"
|
||||
source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=9708f5281afe27a2ac5460679ba62a28567b79dc#9708f5281afe27a2ac5460679ba62a28567b79dc"
|
||||
source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=300495658a1903a45a081771fdf2fe6883b057a7#300495658a1903a45a081771fdf2fe6883b057a7"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"lightning-storage-server",
|
||||
"log",
|
||||
"tokio",
|
||||
"triggered",
|
||||
"txoo-bitcoind-client",
|
||||
"url",
|
||||
"vls-core",
|
||||
@@ -3985,7 +3995,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "vls-persist"
|
||||
version = "0.11.0-rc.1"
|
||||
source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=9708f5281afe27a2ac5460679ba62a28567b79dc#9708f5281afe27a2ac5460679ba62a28567b79dc"
|
||||
source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=300495658a1903a45a081771fdf2fe6883b057a7#300495658a1903a45a081771fdf2fe6883b057a7"
|
||||
dependencies = [
|
||||
"hex",
|
||||
"log",
|
||||
@@ -4000,7 +4010,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "vls-protocol"
|
||||
version = "0.11.0-rc.1"
|
||||
source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=9708f5281afe27a2ac5460679ba62a28567b79dc#9708f5281afe27a2ac5460679ba62a28567b79dc"
|
||||
source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=300495658a1903a45a081771fdf2fe6883b057a7#300495658a1903a45a081771fdf2fe6883b057a7"
|
||||
dependencies = [
|
||||
"as-any",
|
||||
"bitcoin-consensus-derive",
|
||||
@@ -4014,7 +4024,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "vls-protocol-client"
|
||||
version = "0.11.0-rc.1"
|
||||
source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=9708f5281afe27a2ac5460679ba62a28567b79dc#9708f5281afe27a2ac5460679ba62a28567b79dc"
|
||||
source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=300495658a1903a45a081771fdf2fe6883b057a7#300495658a1903a45a081771fdf2fe6883b057a7"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-trait",
|
||||
@@ -4029,7 +4039,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "vls-protocol-signer"
|
||||
version = "0.11.0-rc.1"
|
||||
source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=9708f5281afe27a2ac5460679ba62a28567b79dc#9708f5281afe27a2ac5460679ba62a28567b79dc"
|
||||
source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=300495658a1903a45a081771fdf2fe6883b057a7#300495658a1903a45a081771fdf2fe6883b057a7"
|
||||
dependencies = [
|
||||
"bit-vec",
|
||||
"log",
|
||||
@@ -4040,7 +4050,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "vls-proxy"
|
||||
version = "0.11.0-rc.1"
|
||||
source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=9708f5281afe27a2ac5460679ba62a28567b79dc#9708f5281afe27a2ac5460679ba62a28567b79dc"
|
||||
source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=300495658a1903a45a081771fdf2fe6883b057a7#300495658a1903a45a081771fdf2fe6883b057a7"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"as-any",
|
||||
|
||||
@@ -24,19 +24,20 @@ serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
thiserror = "1.0.31"
|
||||
toml = "0.5.9"
|
||||
triggered = "0.1.2"
|
||||
url = { version = "2.2" }
|
||||
|
||||
vls-frontend = { git = "https://gitlab.com/lightning-signer/validating-lightning-signer.git", rev = "9708f5281afe27a2ac5460679ba62a28567b79dc" }
|
||||
vls-protocol = { git = "https://gitlab.com/lightning-signer/validating-lightning-signer.git", rev = "9708f5281afe27a2ac5460679ba62a28567b79dc" }
|
||||
vls-protocol-client = { git = "https://gitlab.com/lightning-signer/validating-lightning-signer.git", rev = "9708f5281afe27a2ac5460679ba62a28567b79dc" }
|
||||
vls-proxy = { git = "https://gitlab.com/lightning-signer/validating-lightning-signer.git", rev = "9708f5281afe27a2ac5460679ba62a28567b79dc" }
|
||||
vls-frontend = { git = "https://gitlab.com/lightning-signer/validating-lightning-signer.git", rev = "300495658a1903a45a081771fdf2fe6883b057a7" }
|
||||
vls-protocol = { git = "https://gitlab.com/lightning-signer/validating-lightning-signer.git", rev = "300495658a1903a45a081771fdf2fe6883b057a7" }
|
||||
vls-protocol-client = { git = "https://gitlab.com/lightning-signer/validating-lightning-signer.git", rev = "300495658a1903a45a081771fdf2fe6883b057a7" }
|
||||
vls-proxy = { git = "https://gitlab.com/lightning-signer/validating-lightning-signer.git", rev = "300495658a1903a45a081771fdf2fe6883b057a7" }
|
||||
# vls-frontend = { path = "../../vls/vls-frontend" }
|
||||
# vls-protocol = { path = "../../vls/vls-protocol" }
|
||||
# vls-protocol-client = { path = "../../vls/vls-protocol-client" }
|
||||
# vls-proxy = { path = "../../vls/vls-proxy" }
|
||||
|
||||
lss-connector = { git = "https://github.com/stakwork/sphinx-rs", rev = "3a35b8fffb51a03b7a81b2f914b16540653b1d1f" }
|
||||
sphinx-signer = { git = "https://github.com/stakwork/sphinx-rs", rev = "3a35b8fffb51a03b7a81b2f914b16540653b1d1f" }
|
||||
lss-connector = { git = "https://github.com/stakwork/sphinx-rs", rev = "197a835c0cd1e060b591433aced242a2ed0ad4a7" }
|
||||
sphinx-signer = { git = "https://github.com/stakwork/sphinx-rs", rev = "197a835c0cd1e060b591433aced242a2ed0ad4a7" }
|
||||
# lss-connector = { path = "../../sphinx-rs/lss-connector" }
|
||||
# sphinx-signer = { path = "../../sphinx-rs/signer" }
|
||||
|
||||
|
||||
@@ -294,6 +294,8 @@ fn vls_cmd(msg: &Message) -> String {
|
||||
Message::CheckOutpointReply(_) => "CheckOutpointReply",
|
||||
Message::LockOutpoint(_) => "LockOutpoint",
|
||||
Message::LockOutpointReply(_) => "LockOutpointReply",
|
||||
Message::ForgetChannel(_) => "ForgetChannel",
|
||||
Message::ForgetChannelReply(_) => "ForgetChannelReply",
|
||||
};
|
||||
m.to_string()
|
||||
}
|
||||
|
||||
@@ -91,10 +91,12 @@ fn run_main(parent_fd: i32) -> rocket::Rocket<rocket::Build> {
|
||||
let signer_port = MqttSignerPort::new(mqtt_tx.clone(), lss_tx.clone());
|
||||
let port_front = SignerPortFront::new(Arc::new(signer_port), settings.network);
|
||||
let source_factory = Arc::new(SourceFactory::new(".", settings.network));
|
||||
let (_trigger, listener) = triggered::trigger();
|
||||
let frontend = Frontend::new(
|
||||
Arc::new(port_front),
|
||||
source_factory,
|
||||
Url::parse(&btc_url).expect("malformed btc rpc url"),
|
||||
listener,
|
||||
);
|
||||
tokio::spawn(async move {
|
||||
frontend.start();
|
||||
|
||||
38
sphinx-key/Cargo.lock
generated
38
sphinx-key/Cargo.lock
generated
@@ -237,7 +237,7 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
|
||||
[[package]]
|
||||
name = "bolt-derive"
|
||||
version = "0.2.0"
|
||||
source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=9708f5281afe27a2ac5460679ba62a28567b79dc#9708f5281afe27a2ac5460679ba62a28567b79dc"
|
||||
source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=300495658a1903a45a081771fdf2fe6883b057a7#300495658a1903a45a081771fdf2fe6883b057a7"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@@ -369,6 +369,12 @@ dependencies = [
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "chunked-buffer"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fa622bd314835eb026b776af471344d0dba94705c937900656a31d0407e53689"
|
||||
|
||||
[[package]]
|
||||
name = "cipher"
|
||||
version = "0.4.4"
|
||||
@@ -1150,7 +1156,7 @@ checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4"
|
||||
[[package]]
|
||||
name = "lss-connector"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/stakwork/sphinx-rs.git?rev=3a35b8fffb51a03b7a81b2f914b16540653b1d1f#3a35b8fffb51a03b7a81b2f914b16540653b1d1f"
|
||||
source = "git+https://github.com/stakwork/sphinx-rs.git?rev=197a835c0cd1e060b591433aced242a2ed0ad4a7#197a835c0cd1e060b591433aced242a2ed0ad4a7"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"log",
|
||||
@@ -1507,7 +1513,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "rmp-utils"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/stakwork/sphinx-rs.git?rev=3a35b8fffb51a03b7a81b2f914b16540653b1d1f#3a35b8fffb51a03b7a81b2f914b16540653b1d1f"
|
||||
source = "git+https://github.com/stakwork/sphinx-rs.git?rev=197a835c0cd1e060b591433aced242a2ed0ad4a7#197a835c0cd1e060b591433aced242a2ed0ad4a7"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"log",
|
||||
@@ -1617,12 +1623,13 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "serde_bolt"
|
||||
version = "0.3.1"
|
||||
version = "0.3.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ca3ddb862d94a73280b5b6faa3c9bc37db242f6a495d49f0ffb85f040dbb9bca"
|
||||
checksum = "54f634eeb988ab754b0711815e13e6ad983bfc52f76e0af342d492c6cad4f681"
|
||||
dependencies = [
|
||||
"bitcoin",
|
||||
"bitcoin-consensus-derive",
|
||||
"chunked-buffer",
|
||||
"hex",
|
||||
]
|
||||
|
||||
@@ -1696,7 +1703,7 @@ checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3"
|
||||
[[package]]
|
||||
name = "sphinx-auther"
|
||||
version = "0.1.12"
|
||||
source = "git+https://github.com/stakwork/sphinx-rs.git?rev=3a35b8fffb51a03b7a81b2f914b16540653b1d1f#3a35b8fffb51a03b7a81b2f914b16540653b1d1f"
|
||||
source = "git+https://github.com/stakwork/sphinx-rs.git?rev=197a835c0cd1e060b591433aced242a2ed0ad4a7#197a835c0cd1e060b591433aced242a2ed0ad4a7"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"base64",
|
||||
@@ -1708,7 +1715,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "sphinx-crypter"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/stakwork/sphinx-rs.git?rev=3a35b8fffb51a03b7a81b2f914b16540653b1d1f#3a35b8fffb51a03b7a81b2f914b16540653b1d1f"
|
||||
source = "git+https://github.com/stakwork/sphinx-rs.git?rev=197a835c0cd1e060b591433aced242a2ed0ad4a7#197a835c0cd1e060b591433aced242a2ed0ad4a7"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"chacha20poly1305",
|
||||
@@ -1719,7 +1726,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "sphinx-glyph"
|
||||
version = "0.1.2"
|
||||
source = "git+https://github.com/stakwork/sphinx-rs.git?rev=3a35b8fffb51a03b7a81b2f914b16540653b1d1f#3a35b8fffb51a03b7a81b2f914b16540653b1d1f"
|
||||
source = "git+https://github.com/stakwork/sphinx-rs.git?rev=197a835c0cd1e060b591433aced242a2ed0ad4a7#197a835c0cd1e060b591433aced242a2ed0ad4a7"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"hex",
|
||||
@@ -1751,7 +1758,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "sphinx-signer"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/stakwork/sphinx-rs.git?rev=3a35b8fffb51a03b7a81b2f914b16540653b1d1f#3a35b8fffb51a03b7a81b2f914b16540653b1d1f"
|
||||
source = "git+https://github.com/stakwork/sphinx-rs.git?rev=197a835c0cd1e060b591433aced242a2ed0ad4a7#197a835c0cd1e060b591433aced242a2ed0ad4a7"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"bip39",
|
||||
@@ -1946,13 +1953,14 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "txoo"
|
||||
version = "0.6.2-beta.3"
|
||||
version = "0.6.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "74fb0ae52e565a5e1364ed50933a2a884f2e6330e8ffe9ac32ec6c4084bd3a3a"
|
||||
checksum = "67d7f813b11b656c950f66dd1ea293d147e2e2c3567d4246b3d682916dc19a5c"
|
||||
dependencies = [
|
||||
"bitcoin",
|
||||
"log",
|
||||
"serde",
|
||||
"serde_bolt",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2001,7 +2009,7 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
|
||||
[[package]]
|
||||
name = "vls-core"
|
||||
version = "0.11.0-rc.1"
|
||||
source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=9708f5281afe27a2ac5460679ba62a28567b79dc#9708f5281afe27a2ac5460679ba62a28567b79dc"
|
||||
source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=300495658a1903a45a081771fdf2fe6883b057a7#300495658a1903a45a081771fdf2fe6883b057a7"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"bitcoin",
|
||||
@@ -2025,7 +2033,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "vls-persist"
|
||||
version = "0.11.0-rc.1"
|
||||
source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=9708f5281afe27a2ac5460679ba62a28567b79dc#9708f5281afe27a2ac5460679ba62a28567b79dc"
|
||||
source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=300495658a1903a45a081771fdf2fe6883b057a7#300495658a1903a45a081771fdf2fe6883b057a7"
|
||||
dependencies = [
|
||||
"hex",
|
||||
"log",
|
||||
@@ -2038,7 +2046,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "vls-protocol"
|
||||
version = "0.11.0-rc.1"
|
||||
source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=9708f5281afe27a2ac5460679ba62a28567b79dc#9708f5281afe27a2ac5460679ba62a28567b79dc"
|
||||
source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=300495658a1903a45a081771fdf2fe6883b057a7#300495658a1903a45a081771fdf2fe6883b057a7"
|
||||
dependencies = [
|
||||
"as-any",
|
||||
"bitcoin-consensus-derive",
|
||||
@@ -2052,7 +2060,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "vls-protocol-signer"
|
||||
version = "0.11.0-rc.1"
|
||||
source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=9708f5281afe27a2ac5460679ba62a28567b79dc#9708f5281afe27a2ac5460679ba62a28567b79dc"
|
||||
source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=300495658a1903a45a081771fdf2fe6883b057a7#300495658a1903a45a081771fdf2fe6883b057a7"
|
||||
dependencies = [
|
||||
"bit-vec",
|
||||
"log",
|
||||
|
||||
@@ -10,7 +10,7 @@ resolver = "2"
|
||||
default = ["std"]
|
||||
no_persist = []
|
||||
pingpong = []
|
||||
std = ["sphinx-signer"]
|
||||
std = ["sphinx-signer/lowmemory"]
|
||||
tls = []
|
||||
|
||||
[dependencies]
|
||||
@@ -25,9 +25,9 @@ serde_json = { version = "1.0.81", default-features = false }
|
||||
serde_urlencoded = "0.7.1"
|
||||
|
||||
# sphinx-rs
|
||||
lss-connector = { git = "https://github.com/stakwork/sphinx-rs.git", default-features = false, rev = "3a35b8fffb51a03b7a81b2f914b16540653b1d1f" }
|
||||
sphinx-crypter = { git = "https://github.com/stakwork/sphinx-rs.git", rev = "3a35b8fffb51a03b7a81b2f914b16540653b1d1f" }
|
||||
sphinx-signer = { git = "https://github.com/stakwork/sphinx-rs.git", optional = true, rev = "3a35b8fffb51a03b7a81b2f914b16540653b1d1f" }
|
||||
lss-connector = { git = "https://github.com/stakwork/sphinx-rs.git", default-features = false, rev = "197a835c0cd1e060b591433aced242a2ed0ad4a7" }
|
||||
sphinx-crypter = { git = "https://github.com/stakwork/sphinx-rs.git", rev = "197a835c0cd1e060b591433aced242a2ed0ad4a7" }
|
||||
sphinx-signer = { git = "https://github.com/stakwork/sphinx-rs.git", optional = true, rev = "197a835c0cd1e060b591433aced242a2ed0ad4a7" }
|
||||
# local
|
||||
# lss-connector = { path = "../../sphinx-rs/lss-connector", default-features = false }
|
||||
# sphinx-crypter = { path = "../../sphinx-rs/crypter" }
|
||||
|
||||
@@ -5,6 +5,7 @@ use anyhow::Result;
|
||||
use esp_idf_svc::mqtt::client::*;
|
||||
use esp_idf_svc::sys::EspError;
|
||||
use log::*;
|
||||
pub(crate) use sphinx_signer::root::MsgBytes;
|
||||
use std::sync::mpsc;
|
||||
use std::thread;
|
||||
|
||||
@@ -45,10 +46,10 @@ pub fn make_client(
|
||||
|
||||
info!("MQTT client started");
|
||||
|
||||
let builder = thread::Builder::new().stack_size(1524);
|
||||
let builder = thread::Builder::new().stack_size(2048);
|
||||
builder.spawn(move || {
|
||||
info!("MQTT Listening for messages");
|
||||
let mut inflight = Vec::new();
|
||||
let mut inflight = MsgBytes::new();
|
||||
let mut inflight_topic = "".to_string();
|
||||
while let Some(msg) = connection.next() {
|
||||
match msg {
|
||||
@@ -74,26 +75,27 @@ pub fn make_client(
|
||||
Event::Unsubscribed(_mes_id) => info!("RECEIVED Unsubscribed MESSAGE"),
|
||||
Event::Published(_mes_id) => info!("RECEIVED Published MESSAGE"),
|
||||
Event::Received(msg) => {
|
||||
let incoming_message: Option<(String, Vec<u8>)> = match msg.details() {
|
||||
Details::Complete => msg
|
||||
.topic()
|
||||
.map(|topic| (topic.to_string(), msg.data().to_vec())),
|
||||
Details::InitialChunk(chunk_info) => {
|
||||
let incoming_message: Option<(String, MsgBytes)> = match msg.details() {
|
||||
Details::Complete => {
|
||||
let mut buf = MsgBytes::new();
|
||||
buf.write(msg.data());
|
||||
msg.topic().map(|topic| (topic.to_string(), buf))
|
||||
}
|
||||
Details::InitialChunk(_chunk_info) => {
|
||||
if let Some(topic) = msg.topic() {
|
||||
inflight = Vec::with_capacity(chunk_info.total_data_size);
|
||||
inflight_topic = topic.to_string();
|
||||
inflight.extend_from_slice(msg.data());
|
||||
inflight.write(msg.data());
|
||||
None
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
Details::SubsequentChunk(chunk_data) => {
|
||||
inflight.extend_from_slice(msg.data());
|
||||
inflight.write(msg.data());
|
||||
if inflight.len() == chunk_data.total_data_size {
|
||||
let ret = Some((inflight_topic, inflight));
|
||||
inflight_topic = String::new();
|
||||
inflight = Vec::new();
|
||||
inflight = MsgBytes::new();
|
||||
ret
|
||||
} else {
|
||||
None
|
||||
@@ -111,10 +113,10 @@ pub fn make_client(
|
||||
|| topic.ends_with(topics::LSS_CONFLICT)
|
||||
{
|
||||
log::debug!("received data len {}", data.len());
|
||||
tx.send(CoreEvent::LssMessage(data))
|
||||
tx.send(CoreEvent::LssMessage(data.to_vec()))
|
||||
.expect("couldnt send Event::LssMessage");
|
||||
} else if topic.ends_with(topics::CONTROL) {
|
||||
tx.send(CoreEvent::Control(data))
|
||||
tx.send(CoreEvent::Control(data.to_vec()))
|
||||
.expect("couldnt send Event::Control");
|
||||
} else {
|
||||
log::warn!("unrecognized topic {}", topic);
|
||||
|
||||
@@ -11,6 +11,7 @@ use glyph::topics;
|
||||
use lss_connector::secp256k1::PublicKey;
|
||||
use sphinx_signer::approver::SphinxApprover;
|
||||
//use sphinx_signer::lightning_signer::persist::DummyPersister;
|
||||
use crate::conn::mqtt::MsgBytes;
|
||||
use sphinx_signer::kvv::{CloudKVVStore, FsKVVStore};
|
||||
use sphinx_signer::lightning_signer::persist::Persist;
|
||||
use sphinx_signer::root::VlsHandlerError;
|
||||
@@ -23,11 +24,10 @@ use std::thread;
|
||||
use esp_idf_svc::mqtt::client::*;
|
||||
use esp_idf_svc::sys::EspError;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum Event {
|
||||
Connected,
|
||||
Disconnected,
|
||||
VlsMessage(Vec<u8>),
|
||||
VlsMessage(MsgBytes),
|
||||
LssMessage(Vec<u8>),
|
||||
Control(Vec<u8>),
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ fn server_pubkey_from_event(event: Event) -> anyhow::Result<PublicKey> {
|
||||
let server_pubkey = PublicKey::from_slice(&init.server_pubkey)?;
|
||||
Ok(server_pubkey)
|
||||
}
|
||||
m => Err(anyhow!("not an LSS msg: {:?}", m)),
|
||||
_m => Err(anyhow!("not an LSS msg")),
|
||||
}
|
||||
}
|
||||
fn created_from_event(event: Event) -> anyhow::Result<BrokerMutations> {
|
||||
|
||||
46
tester/Cargo.lock
generated
46
tester/Cargo.lock
generated
@@ -255,7 +255,7 @@ checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07"
|
||||
[[package]]
|
||||
name = "bolt-derive"
|
||||
version = "0.2.0"
|
||||
source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=19447b1e5d2956aa72aeca4229da7a96c5eaf208#19447b1e5d2956aa72aeca4229da7a96c5eaf208"
|
||||
source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=300495658a1903a45a081771fdf2fe6883b057a7#300495658a1903a45a081771fdf2fe6883b057a7"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@@ -335,6 +335,12 @@ dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "chunked-buffer"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fa622bd314835eb026b776af471344d0dba94705c937900656a31d0407e53689"
|
||||
|
||||
[[package]]
|
||||
name = "cipher"
|
||||
version = "0.4.4"
|
||||
@@ -1114,7 +1120,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "lss-connector"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/stakwork/sphinx-rs.git?rev=05786c02ae213a16ded24608a8858f8e9c6688e0#05786c02ae213a16ded24608a8858f8e9c6688e0"
|
||||
source = "git+https://github.com/stakwork/sphinx-rs.git?rev=197a835c0cd1e060b591433aced242a2ed0ad4a7#197a835c0cd1e060b591433aced242a2ed0ad4a7"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"log",
|
||||
@@ -1686,7 +1692,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "rmp-utils"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/stakwork/sphinx-rs.git?rev=05786c02ae213a16ded24608a8858f8e9c6688e0#05786c02ae213a16ded24608a8858f8e9c6688e0"
|
||||
source = "git+https://github.com/stakwork/sphinx-rs.git?rev=197a835c0cd1e060b591433aced242a2ed0ad4a7#197a835c0cd1e060b591433aced242a2ed0ad4a7"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"log",
|
||||
@@ -1944,12 +1950,13 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "serde_bolt"
|
||||
version = "0.3.1"
|
||||
version = "0.3.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ca3ddb862d94a73280b5b6faa3c9bc37db242f6a495d49f0ffb85f040dbb9bca"
|
||||
checksum = "54f634eeb988ab754b0711815e13e6ad983bfc52f76e0af342d492c6cad4f681"
|
||||
dependencies = [
|
||||
"bitcoin",
|
||||
"bitcoin-consensus-derive",
|
||||
"chunked-buffer",
|
||||
"hex",
|
||||
]
|
||||
|
||||
@@ -2079,7 +2086,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "sphinx-auther"
|
||||
version = "0.1.12"
|
||||
source = "git+https://github.com/stakwork/sphinx-rs.git?rev=05786c02ae213a16ded24608a8858f8e9c6688e0#05786c02ae213a16ded24608a8858f8e9c6688e0"
|
||||
source = "git+https://github.com/stakwork/sphinx-rs.git?rev=197a835c0cd1e060b591433aced242a2ed0ad4a7#197a835c0cd1e060b591433aced242a2ed0ad4a7"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"base64 0.21.5",
|
||||
@@ -2091,7 +2098,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "sphinx-crypter"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/stakwork/sphinx-rs.git?rev=05786c02ae213a16ded24608a8858f8e9c6688e0#05786c02ae213a16ded24608a8858f8e9c6688e0"
|
||||
source = "git+https://github.com/stakwork/sphinx-rs.git?rev=197a835c0cd1e060b591433aced242a2ed0ad4a7#197a835c0cd1e060b591433aced242a2ed0ad4a7"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"chacha20poly1305",
|
||||
@@ -2102,7 +2109,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "sphinx-glyph"
|
||||
version = "0.1.2"
|
||||
source = "git+https://github.com/stakwork/sphinx-rs.git?rev=05786c02ae213a16ded24608a8858f8e9c6688e0#05786c02ae213a16ded24608a8858f8e9c6688e0"
|
||||
source = "git+https://github.com/stakwork/sphinx-rs.git?rev=197a835c0cd1e060b591433aced242a2ed0ad4a7#197a835c0cd1e060b591433aced242a2ed0ad4a7"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"hex",
|
||||
@@ -2140,7 +2147,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "sphinx-signer"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/stakwork/sphinx-rs.git?rev=05786c02ae213a16ded24608a8858f8e9c6688e0#05786c02ae213a16ded24608a8858f8e9c6688e0"
|
||||
source = "git+https://github.com/stakwork/sphinx-rs.git?rev=197a835c0cd1e060b591433aced242a2ed0ad4a7#197a835c0cd1e060b591433aced242a2ed0ad4a7"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"bip39",
|
||||
@@ -2540,13 +2547,14 @@ checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed"
|
||||
|
||||
[[package]]
|
||||
name = "txoo"
|
||||
version = "0.6.2-beta.3"
|
||||
version = "0.6.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "74fb0ae52e565a5e1364ed50933a2a884f2e6330e8ffe9ac32ec6c4084bd3a3a"
|
||||
checksum = "67d7f813b11b656c950f66dd1ea293d147e2e2c3567d4246b3d682916dc19a5c"
|
||||
dependencies = [
|
||||
"bitcoin",
|
||||
"log",
|
||||
"serde",
|
||||
"serde_bolt",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2678,8 +2686,8 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
|
||||
|
||||
[[package]]
|
||||
name = "vls-core"
|
||||
version = "0.10.0"
|
||||
source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=19447b1e5d2956aa72aeca4229da7a96c5eaf208#19447b1e5d2956aa72aeca4229da7a96c5eaf208"
|
||||
version = "0.11.0-rc.1"
|
||||
source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=300495658a1903a45a081771fdf2fe6883b057a7#300495658a1903a45a081771fdf2fe6883b057a7"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"bitcoin",
|
||||
@@ -2702,8 +2710,8 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "vls-persist"
|
||||
version = "0.10.0"
|
||||
source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=19447b1e5d2956aa72aeca4229da7a96c5eaf208#19447b1e5d2956aa72aeca4229da7a96c5eaf208"
|
||||
version = "0.11.0-rc.1"
|
||||
source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=300495658a1903a45a081771fdf2fe6883b057a7#300495658a1903a45a081771fdf2fe6883b057a7"
|
||||
dependencies = [
|
||||
"hex",
|
||||
"log",
|
||||
@@ -2715,8 +2723,8 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "vls-protocol"
|
||||
version = "0.10.0"
|
||||
source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=19447b1e5d2956aa72aeca4229da7a96c5eaf208#19447b1e5d2956aa72aeca4229da7a96c5eaf208"
|
||||
version = "0.11.0-rc.1"
|
||||
source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=300495658a1903a45a081771fdf2fe6883b057a7#300495658a1903a45a081771fdf2fe6883b057a7"
|
||||
dependencies = [
|
||||
"as-any",
|
||||
"bitcoin-consensus-derive",
|
||||
@@ -2729,8 +2737,8 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "vls-protocol-signer"
|
||||
version = "0.10.0"
|
||||
source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=19447b1e5d2956aa72aeca4229da7a96c5eaf208#19447b1e5d2956aa72aeca4229da7a96c5eaf208"
|
||||
version = "0.11.0-rc.1"
|
||||
source = "git+https://gitlab.com/lightning-signer/validating-lightning-signer.git?rev=300495658a1903a45a081771fdf2fe6883b057a7#300495658a1903a45a081771fdf2fe6883b057a7"
|
||||
dependencies = [
|
||||
"bit-vec",
|
||||
"log",
|
||||
|
||||
@@ -23,8 +23,8 @@ serde_json = "1.0"
|
||||
tokio = { version = "1.4.0", features = ["rt", "rt-multi-thread", "macros"] }
|
||||
urlencoding = "2.1.0"
|
||||
|
||||
sphinx-crypter = { git = "https://github.com/stakwork/sphinx-rs.git", rev = "05786c02ae213a16ded24608a8858f8e9c6688e0" }
|
||||
sphinx-signer = { git = "https://github.com/stakwork/sphinx-rs.git", rev = "05786c02ae213a16ded24608a8858f8e9c6688e0" }
|
||||
sphinx-crypter = { git = "https://github.com/stakwork/sphinx-rs.git", rev = "197a835c0cd1e060b591433aced242a2ed0ad4a7" }
|
||||
sphinx-signer = { git = "https://github.com/stakwork/sphinx-rs.git", rev = "197a835c0cd1e060b591433aced242a2ed0ad4a7" }
|
||||
# sphinx-crypter = { path = "../../sphinx-rs/crypter" }
|
||||
# sphinx-signer = { path = "../../sphinx-rs/signer" }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user