alloy-rs / alloy-rs/alloy

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

Abierto
#3,408 3 comentarios 0 reacciones 0 asignados Ver en GitHub
bug
Lenguaje dominante
Rust
Estrellas
1.3k
Forks
668
Merge medio
2 d 1 h
PR fusionados (30 d)
29

Descripción

### 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

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.