this fix got lost in rebases

This commit is contained in:
Bryan Stitt 2023-09-19 15:28:07 -07:00
parent 8b08828473
commit e137d813af

@ -1440,6 +1440,7 @@ impl Web3ProxyApp {
};
if try_archive {
if let Some(head_block_num) = head_block.map(|x| x.number()) {
// TODO: only charge for archive if it gave a result
request_metadata
.archive_request
@ -1455,10 +1456,11 @@ impl Web3ProxyApp {
// TODO: should this be block 0 instead?
Some(&U64::one()),
// TODO: is this a good way to allow lagged archive nodes a try
Some(&head_block.unwrap().number().saturating_sub(5.into()).clamp(U64::one(), U64::MAX)),
Some(head_block_num.saturating_sub(5.into()).clamp(U64::one(), U64::MAX)),
)
.await;
}
}
response_data.try_into()?
}