diff --git a/web3_proxy/src/app/mod.rs b/web3_proxy/src/app/mod.rs index 0f4b30fa..e2e1e0df 100644 --- a/web3_proxy/src/app/mod.rs +++ b/web3_proxy/src/app/mod.rs @@ -1564,6 +1564,37 @@ impl Web3ProxyApp { JsonRpcForwardedResponse::from_value(json!(gas_estimate), request_id) } + "eth_getTransactionReceipt" | "eth_getTransactionByHash" => { + // try to get the transaction without specifying a min_block_height + let mut response = self + .balanced_rpcs + .try_proxy_connection( + authorization, + request, + Some(&request_metadata), + None, + None, + ) + .await?; + + // if we got "null", it is probably because the tx is old. retry requiring nodes with old block data + if let Some(ref result) = response.result { + if result.get() == "null" { + response = self + .balanced_rpcs + .try_proxy_connection( + authorization, + request, + Some(&request_metadata), + Some(&U64::one()), + None, + ) + .await?; + } + } + + response + } // TODO: eth_gasPrice that does awesome magic to predict the future "eth_hashrate" => JsonRpcForwardedResponse::from_value(json!(U64::zero()), request_id), "eth_mining" => {