improve 4337 bundler support and retries

This commit is contained in:
Bryan Stitt 2023-09-02 10:19:43 -07:00
parent a487ce5149
commit 428dfdd835
4 changed files with 11 additions and 10 deletions

View File

@ -1198,8 +1198,9 @@ impl Web3ProxyApp {
Err(err) => { Err(err) => {
tries += 1; tries += 1;
if tries < max_tries { if tries < max_tries {
// try again // try again after a short delay
yield_now().await; // TODO: tune this delay
sleep(Duration::from_millis(100)).await;
continue; continue;
} }
@ -1340,13 +1341,15 @@ impl Web3ProxyApp {
Some(bundler_4337_rpcs) => { Some(bundler_4337_rpcs) => {
// TODO: timeout // TODO: timeout
let x = bundler_4337_rpcs let x = bundler_4337_rpcs
.try_proxy_connection::<_, Box<RawValue>>( .try_send_all_synced_connections::<Box<RawValue>>(
method, method,
params, params,
Some(request_metadata), Some(request_metadata),
None,
None,
Some(Duration::from_secs(30)), Some(Duration::from_secs(30)),
None, Some(Level::DEBUG.into()),
None, Some(1),
) )
.await?; .await?;

View File

@ -365,9 +365,7 @@ impl Web3Rpcs {
let handle = tokio::task::Builder::default() let handle = tokio::task::Builder::default()
.name("noop") .name("noop")
.spawn(async move { .spawn(async move {
loop { futures::future::pending::<()>().await;
sleep(Duration::from_secs(600)).await;
}
})?; })?;
futures.push(flatten_handle(handle)); futures.push(flatten_handle(handle));

View File

@ -158,7 +158,7 @@ impl TestInflux {
break; break;
}; };
// not open wait. sleep and then try again // not open yet. sleep and then try again
sleep(Duration::from_secs(1)).await; sleep(Duration::from_secs(1)).await;
} }

View File

@ -127,7 +127,7 @@ impl TestMysql {
break; break;
}; };
// not open wait. sleep and then try again // not open yet. sleep and then try again
sleep(Duration::from_secs(1)).await; sleep(Duration::from_secs(1)).await;
} }