From 91a9d62ce1f42437e5f1bc4a0f76dba9b260a48e Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Wed, 11 Oct 2023 00:48:08 -0700 Subject: [PATCH] pass head_block to internal_request --- web3_proxy/src/rpcs/one.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/web3_proxy/src/rpcs/one.rs b/web3_proxy/src/rpcs/one.rs index ad3f88e8..92eac914 100644 --- a/web3_proxy/src/rpcs/one.rs +++ b/web3_proxy/src/rpcs/one.rs @@ -1316,8 +1316,11 @@ impl Web3Rpc { error_handler: Option, max_wait: Option, ) -> Web3ProxyResult { - // TODO: think about this more. its hard to do this without being self-referenctial! - let web3_request = Web3Request::new_internal(method.into(), params, None, max_wait).await?; + // TODO: should this be the app, or this RPC's head block? + let head_block = self.head_block_sender.as_ref().unwrap().borrow().clone(); + + let web3_request = + Web3Request::new_internal(method.into(), params, head_block, max_wait).await?; // TODO: if we are inside the health checks and we aren't healthy yet. we need some sort of flag to force try_handle to not error