Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Waiting for a transaction fails on Geth 1.13.11 #3212

Closed
antazoey opened this issue Jan 29, 2024 · 3 comments
Closed

Waiting for a transaction fails on Geth 1.13.11 #3212

antazoey opened this issue Jan 29, 2024 · 3 comments

Comments

@antazoey
Copy link
Contributor

antazoey commented Jan 29, 2024

  • Version: 6.15.0
  • Python: 3.10
  • OS: macos
  • pip freeze output
<put the output from running pip freeze here>

What was wrong?

The line:

tx = web3.eth.wait_for_transaction_receipt(hex_hash)

has issues on my local testing Geth node (inspired from geth --dev).
So I run into this issue if I check too fast:

ValueError {"message": "(-32000) transaction indexing is in progress"}

How can it be fixed?

I think raising + catching a custom error for this situation.
Like it should still wait for the timeout if we are indexing.
Right now, it is only looking for "tx not found" error.

Note: We prefer to use issues to track our work. If you think you've encountered a bug in web3py or
have a feature request, you're in the right place. If you have implementation or usage questions,
please refer to our documentation and/or join the conversation
on discord.

@antazoey
Copy link
Contributor Author

Realizing this is likely related to a recent Geth change: ethereum/go-ethereum#28877

@antazoey antazoey changed the title Waiting for a transaction fails if the node is still indexing transactions Waiting for a transaction fails on Geth 1.13.11 Jan 31, 2024
@rjl493456442
Copy link
Member

The question is: how does web3.py handle receipt waiting?

My hunch is that there is an internal loop that queries the receipts repeatedly until they are available.

Originally, eth_getTransactionReceipt would return null if the receipt was not available yet. After the implementation of ethereum/go-ethereum#28703, eth_getTransactionReceipt returns an error if the receipt is not available, and transaction indexing is not finished yet (note that transaction indexing only occurs during the initial sync stage).

I suspect that the new behavior breaks the logic in web3.py, which immediately returns when the error is returned by the GETH RPC.

@fselmo
Copy link
Collaborator

fselmo commented Feb 5, 2024

closed by #3216 and #3217

@fselmo fselmo closed this as completed Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants