lets modify web3 proxyd manually copy pasta

This commit is contained in:
yenicelik 2023-03-04 21:19:39 +01:00
parent c7dcc4aac3
commit 5a54fc5e99
3 changed files with 18 additions and 34 deletions

9
Cargo.lock generated
View File

@ -1991,15 +1991,6 @@ dependencies = [
"winapi",
]
[[package]]
name = "fsevent-sys"
version = "4.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "76ee7a02da4d231650c7cea31349b889be2f45ddb3ef3032d2ec8185f6313fd2"
dependencies = [
"libc",
]
[[package]]
name = "fstrings"
version = "0.2.3"

View File

@ -27,11 +27,7 @@ thread-fast-rng = { path = "../thread-fast-rng" }
anyhow = { version = "1.0.69", features = ["backtrace"] }
argh = "0.1.10"
<<<<<<< HEAD
axum = { version = "0.6.8", features = ["headers", "ws"] }
=======
axum = { version = "0.6.7", features = ["headers", "ws"] }
>>>>>>> 698d53d (cargo upgrade)
axum-client-ip = "0.4.0"
axum-macros = "0.3.4"
chrono = "0.4.23"
@ -75,11 +71,7 @@ serde = { version = "1.0.152", features = [] }
serde_json = { version = "1.0.93", default-features = false, features = ["alloc", "raw_value"] }
serde_prometheus = "0.2.1"
siwe = "0.5.0"
<<<<<<< HEAD
time = "0.3.20"
=======
time = "0.3.19"
>>>>>>> 698d53d (cargo upgrade)
tokio = { version = "1.25.0", features = ["full"] }
tokio-stream = { version = "0.1.12", features = ["sync"] }
tokio-uring = { version = "0.4.0", optional = true }

View File

@ -10,6 +10,7 @@ use tokio::sync::broadcast;
use web3_proxy::app::{flatten_handle, flatten_handles, Web3ProxyApp};
use web3_proxy::config::TopConfig;
use web3_proxy::{frontend, prometheus};
use anyhow::Context;
/// start the main proxy daemon
#[derive(FromArgs, PartialEq, Debug, Eq)]
@ -113,23 +114,23 @@ async fn run(
// wait until the app has seen its first consensus head block
// if backups were included, wait a little longer
for _ in 0..3 {
let _ = spawned_app.consensus_connections_watcher.changed().await;
let consensus = spawned_app
.consensus_connections_watcher
.borrow_and_update();
if *consensus.context("Channel closed!")?.backups_needed {
info!(
"waiting longer. found consensus with backups: {}",
*consensus.context("Channel closed!")?.head_block.as_ref().unwrap(),
);
} else {
// TODO: also check that we have at least one archive node connected?
break;
}
}
// for _ in 0..3 {
// let _ = spawned_app.consensus_connections_watcher.changed().await;
//
// let consensus = spawned_app
// .consensus_connections_watcher
// .borrow_and_update();
//
// if *consensus.context("Channel closed!")?.backups_needed {
// info!(
// "waiting longer. found consensus with backups: {}",
// *consensus.context("Channel closed!")?.head_block.as_ref().unwrap(),
// );
// } else {
// // TODO: also check that we have at least one archive node connected?
// break;
// }
// }
// start the frontend port
let frontend_handle = tokio::spawn(frontend::serve(