alloy-rs / alloy-rs/alloy

[Bug] `watch_pending_transaction` will never pause heartbeat if transaction is missed due to reorg when calling `get_receipt`

Ouverte
#3,408 3 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
bug
Langage dominant
Rust
Étoiles
1.3k
Forks
668
Merge moyen
2 j 1 h
PR mergées (30 j)
29

Description

### Component

provider, pubsub

### What version of Alloy are you on?

1.1.1

### Operating System

Linux

### Describe the bug

Here's an example where the block was missed on arbitrum:

```
2025-12-22T23:56:36.636352Z DEBUG alloy_provider::blocks: yielding block number=413480103
2025-12-22T23:56:36.636359Z DEBUG alloy_provider::heart: handling block block_height=413480103
2025-12-22T23:56:36.947322Z DEBUG alloy_provider::heart: watching tx=0xa957513e3bae1cd9187e65c00bfa33e15d9b3ebb99f96c4c735cd51aaf4e6c75
2025-12-22T23:56:36.947360Z DEBUG alloy_provider::heart: updating heartbeat pause state paused=false
2025-12-22T23:56:38.502948Z DEBUG alloy_provider::blocks: fetching block number=413480111
2025-12-22T23:56:38.522697Z DEBUG alloy_provider::blocks: fetching block number=413480112
2025-12-22T23:56:38.541916Z DEBUG alloy_provider::blocks: yielding block number=413480111
2025-12-22T23:56:38.541927Z DEBUG alloy_provider::heart: handling block block_height=413480111
2025-12-22T23:56:38.541938Z DEBUG alloy_provider::heart: reorg/unpause detected block_height=413480111 last_height=413480103
2025-12-22T23:56:38.541986Z DEBUG alloy_provider::blocks: yielding block number=413480112
2025-12-22T23:56:38.541994Z DEBUG alloy_provider::heart: handling block block_height=413480112
```

The transaction I was waiting for a receipt for here was in `413480106` and it causes `watch_pending_transaction` to poll forever since the transaction is missed.


https://github.com/alloy-rs/alloy/blob/174b64362a61010f77f0ada7a4e47f2cd88a357c/crates/provider/src/heart.rs#L228

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.