From 26f21a86d8c4acb67585bfa8b0bdc838131e425b Mon Sep 17 00:00:00 2001 From: Hanh Date: Sat, 12 Oct 2024 02:52:47 +1000 Subject: [PATCH] Multiserver connection & Load Balancer --- Cargo.lock | 3 +++ Cargo.toml | 2 ++ dart-warp | 2 +- warp-macros/src/lib.rs | 16 +--------------- ywallet | 2 +- zcash-warp | 2 +- 6 files changed, 9 insertions(+), 18 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0aab239..0cf3cd9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4247,6 +4247,7 @@ version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ + "log", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -4865,6 +4866,7 @@ dependencies = [ "halo2_gadgets", "halo2_proofs", "hex", + "hyper", "incrementalmerkletree", "itertools 0.13.0", "jubjub", @@ -4896,6 +4898,7 @@ dependencies = [ "tokio-stream", "tonic", "tonic-build 0.12.2", + "tower", "tracing", "tracing-subscriber", "warp-macros", diff --git a/Cargo.toml b/Cargo.toml index 9b1d817..4f690f2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,6 +26,8 @@ tracing-subscriber = { version = "0.3.18", features = [ "env-filter" ] } tokio = { version = "1.40", features = ["rt-multi-thread"] } tokio-stream = "0.1.15" tonic = { version = "0.12", features = ["tls", "tls-native-roots", "tls-webpki-roots"] } +tower = "0.4.13" +hyper = "1.4.1" prost = "0.13" hex = { version = "0.4", features = ["serde"] } fpdec = "0.10.3" diff --git a/dart-warp b/dart-warp index b63a426..13b2be0 160000 --- a/dart-warp +++ b/dart-warp @@ -1 +1 @@ -Subproject commit b63a4260bc3f7a0d4394d9f8f0c7598b28b00944 +Subproject commit 13b2be053ecb034d8fafa730ee10c2b1d2d36d5a diff --git a/warp-macros/src/lib.rs b/warp-macros/src/lib.rs index 45e1426..6dcf975 100644 --- a/warp-macros/src/lib.rs +++ b/warp-macros/src/lib.rs @@ -122,7 +122,6 @@ pub fn c_export(_attr: TokenStream, item: TokenStream) -> TokenStream { let mut has_connection = false; let mut mut_connection = false; let mut has_client = false; - let mut has_url = false; for input in inputs.iter() { if let FnArg::Typed(pat) = input { if let Pat::Ident(param) = pat.pat.as_ref() { @@ -140,10 +139,6 @@ pub fn c_export(_attr: TokenStream, item: TokenStream) -> TokenStream { has_network = true; continue; } - "url" => { - has_url = true; - continue; - } "connection" => { has_connection = true; if type_name == "& mut Connection" { @@ -234,13 +229,6 @@ pub fn c_export(_attr: TokenStream, item: TokenStream) -> TokenStream { } else { quote! {} }; - let url = if has_url { - quote! { - let url = coin_def.config.lwd_url.clone().unwrap(); - } - } else { - quote! {} - }; let connection = if has_connection { if mut_connection { quote! { @@ -257,7 +245,7 @@ pub fn c_export(_attr: TokenStream, item: TokenStream) -> TokenStream { }; let client = if has_client { quote! { - let mut client = coin_def.connect_lwd().await?; + let mut client = coin_def.connect_lwd()?; let client = &mut client; } } else { @@ -292,7 +280,6 @@ pub fn c_export(_attr: TokenStream, item: TokenStream) -> TokenStream { #coin #network #connection - #url #client #(#convs)* #ident(#(#args),*).await @@ -315,7 +302,6 @@ pub fn c_export(_attr: TokenStream, item: TokenStream) -> TokenStream { #coin #network #connection - #url #client #(#convs)* #ident(#(#args),*) diff --git a/ywallet b/ywallet index ef56980..2a47793 160000 --- a/ywallet +++ b/ywallet @@ -1 +1 @@ -Subproject commit ef5698078da5a4db6f87b8a4b7283e3f3dce2592 +Subproject commit 2a4779301e1f4da3bea84761caceab7379d6b568 diff --git a/zcash-warp b/zcash-warp index 489a67b..685ec92 160000 --- a/zcash-warp +++ b/zcash-warp @@ -1 +1 @@ -Subproject commit 489a67bd0533fdbb3e3e6958094be1ef36672210 +Subproject commit 685ec92cfe969af0be70f5e18728a60b042da1f0