alloy-rs / alloy-rs/alloy

[Bug] get_transaction_receipt hangs forever sometimes

Aperta
#3,064 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
Rust
Stelle
1.3k
Fork
668
Merge medio
2g 2h
PR unite (30g)
29

Descrizione

### Component

rpc, provider, pubsub

### What version of Alloy are you on?

1.0.35

### Operating System

None

### Describe the bug

`let query_provider = ProviderBuilder::new()
.connect_http(rpc_url);

let mut receipt = None;
for i in 1..=10 {
info!("{}/10 start waiting", i);
sleep(Duration::from_secs(5)).await;
info!("{}/10 fetch result...", i);
match query_provider.get_transaction_receipt(tx_hash).await {
Ok(Some(t)) => {
receipt = Some(t);
info!("✅ trans confirmed!");
break;
}
Ok(None) => {
info!("trans unconfirmed,5s later retry...");
}
Err(e) => {
error!("error: {}, 5s later retry...", e);
}
}
info!("turn end");
}`
sometimes the log will stop at **x/10 start waiting**, and sometimes will stop at **x/10 fetch result...**, and sometimes will success. I don't what happened, why the sleep line hangs forever, I use those code in actix_web runtime(based on tokio). please help me, thanks a lot!

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.