alloy icon indicating copy to clipboard operation
alloy copied to clipboard

[Bug] Hang forever when waiting for a transaction to be confirmed

Open wellttllew opened this issue 6 months ago • 0 comments

Component

rpc

What version of Alloy are you on?

v0.2.0

Operating System

Linux

Describe the bug

What happened

After sending a transaction, I tried to watch the transaction to be confirmed.
There was an unexpected error returned from the RPC server, making the following line hanging forever.

        let tx =my_contract_instance
            .some_method()
            .from(addr.clone())
            .send()
            .await?
            .with_required_confirmations(2)
            .watch()
            .await?;

The possible cause

The Error arm should also send something through the channel, or the client side will get stuck:

https://github.com/alloy-rs/alloy/blob/0c998d3300f73451e1985698bf68a61db2b4ee54/crates/rpc-client/src/poller.rs#L173-L188

wellttllew avatar Aug 07 '24 06:08 wellttllew