improve 4337 bundler support and retries
This commit is contained in:
parent
a487ce5149
commit
428dfdd835
@ -1198,8 +1198,9 @@ impl Web3ProxyApp {
|
||||
Err(err) => {
|
||||
tries += 1;
|
||||
if tries < max_tries {
|
||||
// try again
|
||||
yield_now().await;
|
||||
// try again after a short delay
|
||||
// TODO: tune this delay
|
||||
sleep(Duration::from_millis(100)).await;
|
||||
|
||||
continue;
|
||||
}
|
||||
@ -1340,13 +1341,15 @@ impl Web3ProxyApp {
|
||||
Some(bundler_4337_rpcs) => {
|
||||
// TODO: timeout
|
||||
let x = bundler_4337_rpcs
|
||||
.try_proxy_connection::<_, Box<RawValue>>(
|
||||
.try_send_all_synced_connections::<Box<RawValue>>(
|
||||
method,
|
||||
params,
|
||||
Some(request_metadata),
|
||||
None,
|
||||
None,
|
||||
Some(Duration::from_secs(30)),
|
||||
None,
|
||||
None,
|
||||
Some(Level::DEBUG.into()),
|
||||
Some(1),
|
||||
)
|
||||
.await?;
|
||||
|
||||
|
@ -365,9 +365,7 @@ impl Web3Rpcs {
|
||||
let handle = tokio::task::Builder::default()
|
||||
.name("noop")
|
||||
.spawn(async move {
|
||||
loop {
|
||||
sleep(Duration::from_secs(600)).await;
|
||||
}
|
||||
futures::future::pending::<()>().await;
|
||||
})?;
|
||||
|
||||
futures.push(flatten_handle(handle));
|
||||
|
@ -158,7 +158,7 @@ impl TestInflux {
|
||||
break;
|
||||
};
|
||||
|
||||
// not open wait. sleep and then try again
|
||||
// not open yet. sleep and then try again
|
||||
sleep(Duration::from_secs(1)).await;
|
||||
}
|
||||
|
||||
|
@ -127,7 +127,7 @@ impl TestMysql {
|
||||
break;
|
||||
};
|
||||
|
||||
// not open wait. sleep and then try again
|
||||
// not open yet. sleep and then try again
|
||||
sleep(Duration::from_secs(1)).await;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user