From 87d0fa64368383c2cf8740cda4174189eab21048 Mon Sep 17 00:00:00 2001 From: Erik Reppel Date: Fri, 19 Apr 2024 19:05:41 -0400 Subject: [PATCH 1/3] Implement rate limiting and add useful middleware --- Cargo.lock | 290 ++++++++++++++++++++++++++++- Cargo.toml | 11 +- examples/extra_rules_and_routes.rs | 2 +- src/api.rs | 46 ++++- src/config.rs | 3 + src/main.rs | 2 +- 6 files changed, 337 insertions(+), 17 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2d1e957..05e6a1c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -74,6 +74,21 @@ dependencies = [ "memchr", ] +[[package]] +name = "alloc-no-stdlib" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" + +[[package]] +name = "alloc-stdlib" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" +dependencies = [ + "alloc-no-stdlib", +] + [[package]] name = "allocator-api2" version = "0.2.16" @@ -447,7 +462,7 @@ dependencies = [ "alloy-sol-macro-input 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "const-hex", "heck 0.4.1", - "indexmap", + "indexmap 2.2.5", "proc-macro-error", "proc-macro2", "quote", @@ -465,7 +480,7 @@ dependencies = [ "alloy-sol-macro-input 0.7.0 (git+https://github.com/alloy-rs/core?rev=7574bfc)", "const-hex", "heck 0.4.1", - "indexmap", + "indexmap 2.2.5", "proc-macro-error", "proc-macro2", "quote", @@ -821,6 +836,22 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "async-compression" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a116f46a969224200a0a97f29cfd4c50e7534e4b4826bd23ea2c3c533039c82c" +dependencies = [ + "brotli", + "flate2", + "futures-core", + "memchr", + "pin-project-lite", + "tokio", + "zstd", + "zstd-safe", +] + [[package]] name = "async-io" version = "2.3.1" @@ -1123,6 +1154,27 @@ dependencies = [ "zeroize", ] +[[package]] +name = "brotli" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "516074a47ef4bce09577a3b379392300159ce5b1ba2e501ff1c819950066100f" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", + "brotli-decompressor", +] + +[[package]] +name = "brotli-decompressor" +version = "2.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e2e4afe60d7dd600fdd3de8d0f08c2b7ec039712e3b6137ff98b7004e82de4f" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", +] + [[package]] name = "bs58" version = "0.5.0" @@ -1215,6 +1267,10 @@ name = "cc" version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a0ba8f7aaa012f30d5b2861462f6708eccd49c3c39863fe083a308035f63d723" +dependencies = [ + "jobserver", + "libc", +] [[package]] name = "cfg-if" @@ -1396,6 +1452,15 @@ version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" +[[package]] +name = "crc32fast" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" +dependencies = [ + "cfg-if", +] + [[package]] name = "crossbeam-channel" version = "0.5.12" @@ -1493,7 +1558,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ "cfg-if", - "hashbrown", + "hashbrown 0.14.3", "lock_api", "once_cell", "parking_lot_core", @@ -1884,6 +1949,16 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "flate2" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + [[package]] name = "flume" version = "0.11.0" @@ -1925,6 +2000,16 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "forwarded-header-value" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8835f84f38484cc86f110a805655697908257fb9a7af005234060891557198e9" +dependencies = [ + "nonempty", + "thiserror", +] + [[package]] name = "funty" version = "2.0.0" @@ -2129,6 +2214,26 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +[[package]] +name = "governor" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68a7f542ee6b35af73b06abc0dad1c1bae89964e4e253bc4b587b91c9637867b" +dependencies = [ + "cfg-if", + "dashmap", + "futures", + "futures-timer", + "no-std-compat", + "nonzero_ext", + "parking_lot", + "portable-atomic", + "quanta", + "rand", + "smallvec", + "spinning_top", +] + [[package]] name = "group" version = "0.13.0" @@ -2152,7 +2257,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap", + "indexmap 2.2.5", "slab", "tokio", "tokio-util", @@ -2171,13 +2276,19 @@ dependencies = [ "futures-sink", "futures-util", "http 1.1.0", - "indexmap", + "indexmap 2.2.5", "slab", "tokio", "tokio-util", "tracing", ] +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + [[package]] name = "hashbrown" version = "0.14.3" @@ -2194,7 +2305,17 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" dependencies = [ - "hashbrown", + "hashbrown 0.14.3", +] + +[[package]] +name = "hdrhistogram" +version = "7.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f19b9f54f7c7f55e31401bb647626ce0cf0f67b0004982ce815b3ee72a02aa8" +dependencies = [ + "byteorder", + "num-traits", ] [[package]] @@ -2566,6 +2687,16 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", +] + [[package]] name = "indexmap" version = "2.2.5" @@ -2573,7 +2704,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b0b929d511467233429c45a44ac1dcaa21ba0f5ba11e4879e6ed28ddb4f9df4" dependencies = [ "equivalent", - "hashbrown", + "hashbrown 0.14.3", ] [[package]] @@ -2636,6 +2767,15 @@ version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +[[package]] +name = "jobserver" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" +dependencies = [ + "libc", +] + [[package]] name = "js-sys" version = "0.3.69" @@ -3128,7 +3268,7 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" dependencies = [ - "hashbrown", + "hashbrown 0.14.3", ] [[package]] @@ -3239,6 +3379,7 @@ dependencies = [ "eyre", "futures", "futures-util", + "governor", "libp2p", "mini-moka", "once_cell", @@ -3253,6 +3394,8 @@ dependencies = [ "test-log", "tokio", "tower", + "tower-http", + "tower_governor", "tracing", "tracing-subscriber", "url", @@ -3418,6 +3561,12 @@ dependencies = [ "libc", ] +[[package]] +name = "no-std-compat" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b93853da6d84c2e3c7d730d6473e8817692dd89be387eb01b94d7f108ecb5b8c" + [[package]] name = "nohash-hasher" version = "0.2.0" @@ -3434,6 +3583,18 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "nonempty" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9e591e719385e6ebaeb5ce5d3887f7d5676fceca6411d1925ccc95745f3d6f7" + +[[package]] +name = "nonzero_ext" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38bf9645c8b145698bb0b18a4637dcacbc421ea49bef2317e4fd8065a387cf21" + [[package]] name = "nu-ansi-term" version = "0.46.0" @@ -3807,6 +3968,12 @@ dependencies = [ "universal-hash", ] +[[package]] +name = "portable-atomic" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" + [[package]] name = "powerfmt" version = "0.2.0" @@ -3926,6 +4093,21 @@ dependencies = [ "unicase", ] +[[package]] +name = "quanta" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5167a477619228a0b284fac2674e3c388cba90631d7b7de620e6f1fcd08da5" +dependencies = [ + "crossbeam-utils", + "libc", + "once_cell", + "raw-cpuid", + "wasi", + "web-sys", + "winapi", +] + [[package]] name = "quick-error" version = "1.2.3" @@ -4056,6 +4238,15 @@ dependencies = [ "rand_core", ] +[[package]] +name = "raw-cpuid" +version = "11.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d86a7c4638d42c44551f4791a20e687dbb4c3de1f33c43dd71e355cd429def1" +dependencies = [ + "bitflags 2.4.2", +] + [[package]] name = "rcgen" version = "0.11.3" @@ -4727,6 +4918,15 @@ dependencies = [ "lock_api", ] +[[package]] +name = "spinning_top" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d96d2d1d716fb500937168cc09353ffdc7a012be8475ac7308e1bdf0e3923300" +dependencies = [ + "lock_api", +] + [[package]] name = "spki" version = "0.7.3" @@ -4782,7 +4982,7 @@ dependencies = [ "futures-util", "hashlink", "hex", - "indexmap", + "indexmap 2.2.5", "log", "memchr", "once_cell", @@ -5304,7 +5504,7 @@ version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" dependencies = [ - "indexmap", + "indexmap 2.2.5", "toml_datetime", "winnow 0.5.40", ] @@ -5317,9 +5517,35 @@ checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" dependencies = [ "futures-core", "futures-util", + "hdrhistogram", + "indexmap 1.9.3", "pin-project", "pin-project-lite", + "rand", + "slab", "tokio", + "tokio-util", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-http" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5" +dependencies = [ + "async-compression", + "bitflags 2.4.2", + "bytes", + "futures-core", + "http 1.1.0", + "http-body 1.0.0", + "http-body-util", + "pin-project-lite", + "tokio", + "tokio-util", "tower-layer", "tower-service", "tracing", @@ -5337,6 +5563,22 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +[[package]] +name = "tower_governor" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3790eac6ad3fb8d9d96c2b040ae06e2517aa24b067545d1078b96ae72f7bb9a7" +dependencies = [ + "axum", + "forwarded-header-value", + "governor", + "http 1.1.0", + "pin-project", + "thiserror", + "tower", + "tracing", +] + [[package]] name = "tracing" version = "0.1.40" @@ -6118,3 +6360,31 @@ dependencies = [ "quote", "syn 2.0.52", ] + +[[package]] +name = "zstd" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d789b1514203a1120ad2429eae43a7bd32b90976a7bb8a05f7ec02fa88cc23a" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "7.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cd99b45c6bc03a018c8b8a86025678c87e55526064e38f9df301989dce7ec0a" +dependencies = [ + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.10+zstd.1.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa" +dependencies = [ + "cc", + "pkg-config", +] diff --git a/Cargo.toml b/Cargo.toml index 33e877e..7b778e8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,6 +44,13 @@ futures-util = "0.3" mini-moka = "0.10.3" axum = "0.7.5" reqwest = "0.12.3" +url = "2.5.0" +futures = "0.3.30" +sha256 = "1.5.0" +tower = { version = "0.4.13", features = ["full"] } +tower_governor = { version = "0.3.2", features = ["axum"] } +governor = { version = "0.6.0" } +tower-http = { version = "0.5.2", features = ["cors", "compression-full", "trace"] } alloy = { git = "https://github.com/alloy-rs/alloy", rev = "17633df", features = [ "sol-types", "network", @@ -71,10 +78,6 @@ alloy-core = { git = "https://github.com/alloy-rs/core", rev = "7574bfc" } alloy-sol-types = { git = "https://github.com/alloy-rs/core", rev = "7574bfc", features = ["eip712-serde"] } alloy-primitives = { git = "https://github.com/alloy-rs/core", rev = "7574bfc", features = ["serde"] } alloy-sol-macro = { git = "https://github.com/alloy-rs/core", rev = "7574bfc", features = ["json"] } -url = "2.5.0" -futures = "0.3.30" -sha256 = "1.5.0" -tower = "0.4.13" [patch.crates-io] diff --git a/examples/extra_rules_and_routes.rs b/examples/extra_rules_and_routes.rs index a07579f..5305e45 100644 --- a/examples/extra_rules_and_routes.rs +++ b/examples/extra_rules_and_routes.rs @@ -30,7 +30,7 @@ async fn main() -> eyre::Result<()> { let ctl = mintpool::run::start_p2p_services(&config, rules).await?; // Add some custom routes in addition to the defaults. You could also add middleware or anything else you can do with axum. - let mut router = mintpool::api::router_with_defaults(); + let mut router = mintpool::api::router_with_defaults(&config); router = router .route("/simple", get(my_simple_route)) .route("/count", get(query_route)); diff --git a/src/api.rs b/src/api.rs index 6fcbe9e..242a756 100644 --- a/src/api.rs +++ b/src/api.rs @@ -3,14 +3,23 @@ use crate::controller::{ControllerCommands, ControllerInterface, DBQuery}; use crate::rules::Results; use crate::storage; use crate::types::PremintTypes; +use axum::error_handling::HandleErrorLayer; use axum::extract::State; use axum::http::StatusCode; use axum::middleware::from_fn_with_state; use axum::routing::{get, post}; use axum::{Json, Router}; +use eyre::OptionExt; use serde::Serialize; use sqlx::SqlitePool; +use std::sync::Arc; +use std::time::Duration; use tokio::net::TcpListener; +use tower::{BoxError, ServiceBuilder}; +use tower_governor::governor::{GovernorConfig, GovernorConfigBuilder}; +use tower_governor::key_extractor::PeerIpKeyExtractor; +use tower_governor::GovernorLayer; +use tracing_subscriber::fmt::layer; #[derive(Clone)] pub struct AppState { @@ -35,17 +44,52 @@ impl AppState { } } -pub fn router_with_defaults() -> Router { +pub fn router_with_defaults(config: &Config) -> Router { + let governor_conf = Box::new( + GovernorConfigBuilder::default() + .per_second(1) + .burst_size(config.rate_limit_rps) + .finish() + .unwrap(), + ); + // rate limiter annoyingly needs a process to clean up the state + // a separate background task to clean up + let governor_limiter = governor_conf.limiter().clone(); + tokio::spawn(async move { + loop { + tokio::time::sleep(Duration::from_secs(60)).await; + governor_limiter.retain_recent(); + } + }); + Router::new() .route("/health", get(health)) .route("/list-all", get(list_all)) .route("/submit-premint", post(submit_premint)) + .layer( + ServiceBuilder::new() + .layer(HandleErrorLayer::new(|error: BoxError| async move { + ( + StatusCode::INTERNAL_SERVER_ERROR, + format!("Unhandled error: {:?}", error), + ) + })) + .layer(tower_http::trace::TraceLayer::new_for_http()) + .layer(tower::timeout::TimeoutLayer::new(Duration::from_secs(10))) + .layer(tower_http::cors::CorsLayer::new().allow_origin(tower_http::cors::Any)) + .layer(tower_http::compression::CompressionLayer::new().gzip(true)), + ) + .layer(GovernorLayer { + config: Box::leak(governor_conf), + }) } fn with_admin_routes(state: AppState, router: Router) -> Router { let admin = Router::new() .route("/admin/node", get(admin::node_info)) .route("/admin/add-peer", post(admin::add_peer)) + // admin submit premint route is not rate limited (allows for operator to send high volume of premints) + .route("/admin/submit-premint", post(submit_premint)) .layer(from_fn_with_state(state, admin::auth_middleware)); router.merge(admin) diff --git a/src/config.rs b/src/config.rs index b5fb8a0..e5d078a 100644 --- a/src/config.rs +++ b/src/config.rs @@ -66,6 +66,9 @@ pub struct Config { // secret key used to access admin api routes #[envconfig(from = "ADMIN_API_SECRET")] pub admin_api_secret: Option, + + #[envconfig(from = "RATE_LIMIT_RPS", default = "2")] + pub rate_limit_rps: u32, } impl Config { diff --git a/src/main.rs b/src/main.rs index b259af9..b5b2b9b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -25,7 +25,7 @@ async fn main() -> eyre::Result<()> { rules.add_default_rules(); let ctl = start_p2p_services(&config, rules).await?; - let router = api::router_with_defaults(); + let router = api::router_with_defaults(&config); api::start_api(&config, ctl.clone(), router, true).await?; start_watch_chain::(&config, ctl.clone()).await; From dba32232e361057e39efd9dc4470fdf26349887e Mon Sep 17 00:00:00 2001 From: Erik Reppel Date: Fri, 19 Apr 2024 19:07:25 -0400 Subject: [PATCH 2/3] Unused imports --- src/api.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/api.rs b/src/api.rs index 242a756..c996c3f 100644 --- a/src/api.rs +++ b/src/api.rs @@ -9,17 +9,13 @@ use axum::http::StatusCode; use axum::middleware::from_fn_with_state; use axum::routing::{get, post}; use axum::{Json, Router}; -use eyre::OptionExt; use serde::Serialize; use sqlx::SqlitePool; -use std::sync::Arc; use std::time::Duration; use tokio::net::TcpListener; use tower::{BoxError, ServiceBuilder}; -use tower_governor::governor::{GovernorConfig, GovernorConfigBuilder}; -use tower_governor::key_extractor::PeerIpKeyExtractor; +use tower_governor::governor::GovernorConfigBuilder; use tower_governor::GovernorLayer; -use tracing_subscriber::fmt::layer; #[derive(Clone)] pub struct AppState { From 9679759c8fca86afef5b4e1ba1038c668da9f921 Mon Sep 17 00:00:00 2001 From: Erik Reppel Date: Fri, 19 Apr 2024 19:10:28 -0400 Subject: [PATCH 3/3] Fix tests --- examples/extra_rules_and_routes.rs | 2 +- src/config.rs | 5 +++++ tests/common/mod.rs | 2 ++ tests/e2e_test.rs | 2 ++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/examples/extra_rules_and_routes.rs b/examples/extra_rules_and_routes.rs index 5305e45..e628292 100644 --- a/examples/extra_rules_and_routes.rs +++ b/examples/extra_rules_and_routes.rs @@ -35,7 +35,7 @@ async fn main() -> eyre::Result<()> { .route("/simple", get(my_simple_route)) .route("/count", get(query_route)); - start_api(&config, ctl.clone(), router).await?; + start_api(&config, ctl.clone(), router, true).await?; let mut sigint = signal(SignalKind::interrupt())?; let mut sigterm = signal(SignalKind::terminate())?; diff --git a/src/config.rs b/src/config.rs index e5d078a..768250c 100644 --- a/src/config.rs +++ b/src/config.rs @@ -92,6 +92,7 @@ impl Config { interactive: false, enable_rpc: true, admin_api_secret: None, + rate_limit_rps: 1, } } } @@ -192,6 +193,8 @@ mod test { external_address: None, interactive: false, enable_rpc: true, + admin_api_secret: None, + rate_limit_rps: 1, }; let names = config.premint_names(); @@ -216,6 +219,8 @@ mod test { external_address: None, interactive: false, enable_rpc: true, + admin_api_secret: None, + rate_limit_rps: 1, }; let names = config.premint_names(); diff --git a/tests/common/mod.rs b/tests/common/mod.rs index 9c4034d..6921855 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -43,6 +43,8 @@ pub mod mintpool_build { peer_port: port, interactive: false, enable_rpc: true, + admin_api_secret: None, + rate_limit_rps: 1, } } diff --git a/tests/e2e_test.rs b/tests/e2e_test.rs index ad91a0b..f7dde8d 100644 --- a/tests/e2e_test.rs +++ b/tests/e2e_test.rs @@ -62,6 +62,8 @@ async fn test_zora_premint_v2_e2e() { external_address: None, interactive: false, enable_rpc: true, + admin_api_secret: None, + rate_limit_rps: 1, }; // set this so CHAINS will use the anvil rpc rather than the one in chains.json