cache eth_getLogs fromBlock properly

This commit is contained in:
Bryan Stitt 2023-07-05 23:13:32 -07:00
parent 4ae4d7a75e
commit 0e3fdfa0ea
2 changed files with 3 additions and 4 deletions

View File

@ -271,8 +271,7 @@ impl CacheMode {
BlockNumAndHash(block_num, block_hash)
} else {
warn!("if no from, what should we default? 0 or head?");
head_block.into()
BlockNumAndHash(U64::zero(), H256::zero())
};
let to_block = if let Some(x) = obj.get_mut("toBlock") {

View File

@ -1075,6 +1075,7 @@ impl Web3Rpcs {
);
} else if head_block_num.as_ref() > needed {
// we have synced past the needed block
// TODO: log ranked rpcs
// TODO: only log params in development
error!(
min=?min_block_needed,
@ -1087,6 +1088,7 @@ impl Web3Rpcs {
);
} else {
// TODO: only log params in development
// TODO: log ranked rpcs
error!(
min=?min_block_needed,
max=?max_block_needed,
@ -1097,8 +1099,6 @@ impl Web3Rpcs {
?params,
"Requested data is not available",
);
// TODO: remove this, or move to trace level
// debug!("{}", serde_json::to_string(&request).unwrap());
}
// TODO: what error code?