smarter archive retry

This commit is contained in:
Bryan Stitt 2023-09-19 10:55:52 -07:00
parent 60ffbdfbb2
commit 10c4ffc9d2
4 changed files with 7 additions and 5 deletions

4
Cargo.lock generated

@ -6732,7 +6732,7 @@ dependencies = [
[[package]]
name = "web3_proxy"
version = "1.43.2"
version = "1.43.3"
dependencies = [
"anyhow",
"arc-swap",
@ -6812,7 +6812,7 @@ dependencies = [
[[package]]
name = "web3_proxy_cli"
version = "1.43.2"
version = "1.43.3"
dependencies = [
"env_logger",
"parking_lot",

@ -1,6 +1,6 @@
[package]
name = "web3_proxy"
version = "1.43.2"
version = "1.43.3"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

@ -1441,6 +1441,7 @@ impl Web3ProxyApp {
};
if try_archive {
// TODO: only charge for archive if it gave a result
request_metadata
.archive_request
.store(true, atomic::Ordering::Relaxed);
@ -1454,7 +1455,8 @@ impl Web3ProxyApp {
Some(Duration::from_secs(30)),
// TODO: should this be block 0 instead?
Some(&U64::one()),
None,
// 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)),
)
.await;
}

@ -1,6 +1,6 @@
[package]
name = "web3_proxy_cli"
version = "1.43.2"
version = "1.43.3"
edition = "2021"
default-run = "web3_proxy_cli"