From ca92b3646cb53c91332b3490a14fd8ff851a7699 Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Fri, 28 Jul 2023 10:41:23 -0700 Subject: [PATCH] cache eth_feeHistory and eth_gasPrice --- web3_proxy/src/block_number.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/web3_proxy/src/block_number.rs b/web3_proxy/src/block_number.rs index 47db3817..aba4f11d 100644 --- a/web3_proxy/src/block_number.rs +++ b/web3_proxy/src/block_number.rs @@ -230,6 +230,13 @@ impl CacheMode { let block_param_id = match method { "eth_call" => 1, "eth_estimateGas" => 1, + "eth_feeHistory" => 1, + "eth_gasPrice" => { + return Ok(CacheMode::Cache { + block: head_block.into(), + cache_errors: false, + }); + } "eth_getBalance" => 1, "eth_getBlockByHash" => { // TODO: double check that any node can serve this