From 723199076ccdbbb5db745e2f77fee9a4ae7da9ac Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Wed, 1 Nov 2023 22:30:22 -0700 Subject: [PATCH] shorter log --- web3_proxy/src/block_number.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/web3_proxy/src/block_number.rs b/web3_proxy/src/block_number.rs index 31a40085..95bd71be 100644 --- a/web3_proxy/src/block_number.rs +++ b/web3_proxy/src/block_number.rs @@ -284,7 +284,7 @@ impl CacheMode { warn!( method = %request.method, params = ?request.params, - "no servers available to get block from params but head block known. caching with head block" + "no servers available to get block from params" ); } Err(err) => { @@ -292,7 +292,7 @@ impl CacheMode { method = %request.method, params = ?request.params, ?err, - "could not get block from params. caching with head block" + "could not get block from params" ); } } @@ -407,14 +407,14 @@ impl CacheMode { // what if its a hash? let block_num: BlockNumber = serde_json::from_value(x.clone())?; - // sometimes people request `from_block=future, to_block=latest`. latest becomes head and then + // sometimes people request `from_block=head+1, to_block="latest"`. latest becomes head and then theres a problem // TODO: if this is in the future, this cache key won't be very likely to be used again // TODO: delay here until the app has this block? let latest_block = head_block.number().max(from_block.num()); let (block_num, change) = BlockNumber_to_U64(block_num, latest_block); - // TODO: double check this. it scares me + // TODO: double check this. it scares me but i think we need it // if change { // trace!("changing toBlock in eth_getLogs. {} -> {}", x, block_num); // *x = json!(block_num); @@ -666,4 +666,6 @@ mod test { // TODO: cache with the head block instead? matches!(x, CacheMode::Never); } + + // TODO: tests for eth_getLogs }