Ethcontract erroneously waits for transaction even after it was mined
taminomara opened this issue · 0 comments
taminomara commented
From slack discussion:
I've noticed a couple of times when executing methods via ethcontract that they may hang and never resolve even though transaction gets mined successfully (I'm using local chain running in dev mode).
So, what happens is that:
- Transaction is sent by ethcontract
- Block number is retrieved and is block X
- transaction gets mined and is now block X+1
- Transaction receipt gets retrieved with block number X+1
- ethcontract thinks that it needs to wait for 1 block
- creates a eth_newBlockFilter to get notifications about new blocks
- waits for ever to get notified about new blocks, but they don't come because Geth only mines when a new transcation comes is.
Interesting. I wonder why we didn't catch it sooner? I guess geth mines some additional blocks?
I think its because:
- On Ganache, the transaction gets mined immediately, so the race is not possible
- On real nodes, new blocks eventually come in, so worst case we wait an extra block