Closed fengtality closed 3 years ago
I suggest looking at the other Transaction methods in the ethers docs: https://docs.ethers.io/v5/api/providers/provider/#Provider--transaction-methods
Especially:
To stall until the transaction has been mined, consider the waitForTransaction method below.
Why
As @vic-en pointed out, the client currently does not handle polling for ETH transactions well. When it sends a tx, it sleeps instead of properly waiting for the next block before polling for status. We should redesign how it works so that it uses info from the RPC provider to determine when to poll.
What
As discussed in standup, change
/eth/poll
so that it handles the case where the hash isn't available. Check if we are calling the correct API in ethers (getTransactionReceipt), etc.The result should be that we can call the poll function immediately after sending the transaction without having to add sleeps.