From 6324d9c7d9710e33f47134d9fcb749bedd61cd9f Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Mon, 12 Jun 2023 21:54:33 -0700 Subject: [PATCH] short circuit if no requests --- web3_proxy/src/app/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web3_proxy/src/app/mod.rs b/web3_proxy/src/app/mod.rs index c24649d3..9571d949 100644 --- a/web3_proxy/src/app/mod.rs +++ b/web3_proxy/src/app/mod.rs @@ -1015,6 +1015,10 @@ impl Web3ProxyApp { // TODO: we should probably change ethers-rs to support this directly. they pushed this off to v2 though let num_requests = requests.len(); + if num_requests == 0 { + return Ok((vec![], vec![])); + } + // get the head block now so that any requests that need it all use the same block // TODO: this still has an edge condition if there is a reorg in the middle of the request!!! let head_block_num = self