From d38a35903e5e622678190a5294e29ec0a288e575 Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Fri, 6 Oct 2023 22:54:18 -0700 Subject: [PATCH] cargo update --- Cargo.lock | 2 +- Dockerfile | 10 ++++++---- web3_proxy/Cargo.toml | 2 +- web3_proxy/src/rpcs/one.rs | 10 ++-------- 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 766db954..9e470220 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5230,7 +5230,7 @@ checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" [[package]] name = "siwe" version = "0.5.2" -source = "git+https://github.com/llamanodes/siwe-rs?rev=266f494143a4ea627e1d4090d725a5ef77535f67#266f494143a4ea627e1d4090d725a5ef77535f67" +source = "git+https://github.com/llamanodes/siwe-rs?branch=for_web3_proxy#5866c7a5ce3a7e2a14d247d00f0a5915bc0bbd08" dependencies = [ "ethers", "hex", diff --git a/Dockerfile b/Dockerfile index 0a42cebe..9cdd15c6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -90,12 +90,13 @@ COPY . . # TODO: clean needed because of rust upgrade and jenkins caches :'( RUN --mount=type=cache,target=/root/.cargo/git \ --mount=type=cache,target=/root/.cargo/registry \ + --mount=type=cache,target=/app/target \ + --mount=type=cache,target=/app/target_test \ set -eux -o pipefail; \ \ [ -e "$(pwd)/payment-contracts/src/contracts/mod.rs" ] || touch "$(pwd)/payment-contracts/build.rs"; \ - cargo \ - --locked \ - fetch + cargo --locked fetch; \ + CARGO_TARGET_DIR=target_test cargo --locked fetch # build tests (done its in own FROM so that it can run in parallel) FROM rust_with_env as build_tests @@ -106,9 +107,10 @@ COPY --from=rust_nextest /root/.cargo/bin/cargo-nextest* /root/.cargo/bin/ # test the application with cargo-nextest RUN --mount=type=cache,target=/root/.cargo/git \ --mount=type=cache,target=/root/.cargo/registry \ - --mount=type=cache,target=/app/target \ + --mount=type=cache,target=/app/target_test \ set -eux -o pipefail; \ \ + export CARGO_TARGET_DIR=target_test \ [ -e "$(pwd)/payment-contracts/src/contracts/mod.rs" ] || touch "$(pwd)/payment-contracts/build.rs"; \ RUST_LOG=web3_proxy=trace,info \ cargo \ diff --git a/web3_proxy/Cargo.toml b/web3_proxy/Cargo.toml index fce6a2ef..4a8f274e 100644 --- a/web3_proxy/Cargo.toml +++ b/web3_proxy/Cargo.toml @@ -29,7 +29,7 @@ influxdb2-structmap = { git = "https://github.com/llamanodes/influxdb2/", rev = # TODO: we can't actually use 0.6 because they want a Provider and we have an Arc # TODO: this has features ethers which probably brings in things. make sure it has the minimal features -siwe = { git = "https://github.com/llamanodes/siwe-rs", rev = "266f494143a4ea627e1d4090d725a5ef77535f67", features = ["ethers", "serde"] } +siwe = { git = "https://github.com/llamanodes/siwe-rs", branch = "for_web3_proxy", features = ["ethers", "serde"] } # TODO: regex has several "perf" features that we might want to use # TODO: make sure this uuid version matches sea-orm. PR to put this in their prelude diff --git a/web3_proxy/src/rpcs/one.rs b/web3_proxy/src/rpcs/one.rs index f1e90af1..4021d71a 100644 --- a/web3_proxy/src/rpcs/one.rs +++ b/web3_proxy/src/rpcs/one.rs @@ -847,17 +847,11 @@ impl Web3Rpc { if let Some(ws_provider) = self.ws_provider.load().as_ref() { // todo: move subscribe_blocks onto the request handle - let error_handler = Some(Level::ERROR.into()); - - // we don't actually care about params here. we aren't going to use this handle for - let active_request_handle = self - .internal_request::<_, H256>("eth_subscribe", &(), error_handler, None) - .await; + self.wait_for_throttle(Instant::now() + Duration::from_secs(5)) + .await?; let mut pending_txs_sub = ws_provider.subscribe_pending_txs().await?; - drop(active_request_handle); - while let Some(x) = pending_txs_sub.next().await { if *subscribe_stop_rx.borrow_and_update() { // TODO: this is checking way too often. have this on a timer instead