Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Middleware::pending_transaction hangs or panics #102

Closed
vakond opened this issue Dec 14, 2020 · 3 comments · Fixed by #103 or #104
Closed

Middleware::pending_transaction hangs or panics #102

vakond opened this issue Dec 14, 2020 · 3 comments · Fixed by #103 or #104
Labels
bug Something isn't working

Comments

@vakond
Copy link

vakond commented Dec 14, 2020

Version
873cf09
ethers = { git = "https://github.com/gakonst/ethers-rs", features = ["full"] }

Platform
5.4.0-58-generic #64-Ubuntu SMP Wed Dec 9 08:16:25 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Description
Call of pending_transaction(tx_hash) after send_transaction(tx) hangs or panics.

I tried this code:

let tx_hash = client.send_transaction(tx, None).await?;
let receipt = client.pending_transaction(tx_hash).await?;
dbg!(receipt);

I expected to see the contents of the receipt.

Instead, the program hangs or panics with following message:
thread 'tokio-runtime-worker' panicked at 'WS Server panic: NoResponse'

I've prepared two mininal projects to reproduce this behaviour (please see corresponding README files):
https://github.com/vakond/ethers-ganache-pending
https://github.com/vakond/ethers-geth-pending
The bug (if it's a bug) can also be observed with the Kovan testnet.

It seems only one variant panics: Ganache+Ws. Ganache+Http just hangs. Other variants: {Geth, Kovan}+{Ws, Http} all hang.

@gakonst
Copy link
Owner

gakonst commented Dec 16, 2020

@vakond thank you for the detailed bug report. Wish everyone did it this way. I opened #103 as a fix. I've verified it fixes the issue in ganache with both Http and Ws, could you confirm if it fixes it with Geth/Kovan? You can try it by importing as ethers = { git = "https://github.com/gakonst/ethers-rs", branch = "fix/pending-tx-hang", features = ["full"] }

@vakond
Copy link
Author

vakond commented Dec 16, 2020

@gakonst thank you for your excellent library. I gladly confirm the Ganache test has passed with the fix branch. But unfortunately the Geth test still hangs, as well as Kovan. In case you want to try Kovan first, I'm attaching the main.rs template file here (Cargo.toml the same as in ganache-pending).
kovan-main-rs.zip

@gakonst
Copy link
Owner

gakonst commented Dec 17, 2020

@vakond OK should be fixed now in #104. It's merged to master now. I've tested on Kovan & Rinkeby via Infura with both HTTP and WS and it seems to work. Thank you for surfacing this, I should've been more diligent with my testing. In case you want to share more about what you're working, feel free to join t.me/ethers_rs!

meetmangukiya pushed a commit to meetmangukiya/ethers-rs that referenced this issue Mar 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
2 participants