From 3a8f30f87df49f65b88d8707169051012cd9ef65 Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Wed, 28 Dec 2022 08:49:21 -0800 Subject: [PATCH] lint --- TODO.md | 2 ++ web3_proxy/src/bin/web3_proxy.rs | 1 + .../src/bin/web3_proxy_cli/change_user_tier_by_address.rs | 5 ++--- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/TODO.md b/TODO.md index 4b6824c6..25beb67c 100644 --- a/TODO.md +++ b/TODO.md @@ -290,6 +290,8 @@ These are not yet ordered. There might be duplicates. We might not actually need - [x] BUG! if sending transactions gets "INTERNAL_ERROR: existing tx with same hash", create a success message - we just want to be sure that the server has our tx and in this case, it does. - ERROR http_request:request:try_send_all_upstream_servers: web3_proxy::rpcs::request: bad response! err=JsonRpcClientError(JsonRpcError(JsonRpcError { code: -32000, message: "INTERNAL_ERROR: existing tx with same hash", data: None })) method=eth_sendRawTransaction rpc=local_erigon_alpha_archive id=01GF4HV03Y4ZNKQV8DW5NDQ5CG method=POST authorized_request=User(Some(SqlxMySqlPoolConnection), AuthorizedKey { ip: 10.11.12.15, origin: None, user_key_id: 4, log_revert_chance: 0.0000 }) self=Web3Connections { conns: {"local_erigon_alpha_archive_ws": Web3Connection { name: "local_erigon_alpha_archive_ws", blocks: "all", .. }, "local_geth_ws": Web3Connection { name: "local_geth_ws", blocks: 64, .. }, "local_erigon_alpha_archive": Web3Connection { name: "local_erigon_alpha_archive", blocks: "all", .. }}, .. } authorized_request=Some(User(Some(SqlxMySqlPoolConnection), AuthorizedKey { ip: 10.11.12.15, origin: None, user_key_id: 4, log_revert_chance: 0.0000 })) request=JsonRpcRequest { id: RawValue(39), method: "eth_sendRawTransaction", .. } request_metadata=Some(RequestMetadata { datetime: 2022-10-11T22:14:57.406829095Z, period_seconds: 60, request_bytes: 633, backend_requests: 0, no_servers: 0, error_response: false, response_bytes: 0, response_millis: 0 }) block_needed=None +- [x] serde collect unknown fields in config instead of crash +- [x] upgrade user tier by address - [-] fix multiple origin and referer checks - [-] let users choose a % to log (or maybe x/second). someone like curve logging all reverts will be a BIG database very quickly - this must be opt-in or spawned since it will slow things down and will make their calls less private diff --git a/web3_proxy/src/bin/web3_proxy.rs b/web3_proxy/src/bin/web3_proxy.rs index 94269dfa..8f4c6ee2 100644 --- a/web3_proxy/src/bin/web3_proxy.rs +++ b/web3_proxy/src/bin/web3_proxy.rs @@ -336,6 +336,7 @@ mod tests { ), ]), private_rpcs: None, + extra: Default::default(), }; let (shutdown_sender, _) = broadcast::channel(1); diff --git a/web3_proxy/src/bin/web3_proxy_cli/change_user_tier_by_address.rs b/web3_proxy/src/bin/web3_proxy_cli/change_user_tier_by_address.rs index a38e350e..ec879bc6 100644 --- a/web3_proxy/src/bin/web3_proxy_cli/change_user_tier_by_address.rs +++ b/web3_proxy/src/bin/web3_proxy_cli/change_user_tier_by_address.rs @@ -1,13 +1,12 @@ use anyhow::Context; use argh::FromArgs; -use entities::{rpc_key, user, user_tier}; +use entities::{user, user_tier}; +use ethers::types::Address; use log::{debug, info}; use migration::sea_orm::{ self, ActiveModelTrait, ColumnTrait, DatabaseConnection, EntityTrait, IntoActiveModel, QueryFilter, }; -use uuid::Uuid; -use ethers::types::Address; /// change a user's tier. #[derive(FromArgs, PartialEq, Eq, Debug)]