-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[v6] Catch newly raised geth errors when tx indexing in progress #3217
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
[v6] Catch newly raised geth errors when tx indexing in progress #3217
Conversation
- Geth ``1.13.11`` started to return an error when transaction indexing is in progress and a ``eth_getTransactionReceipt`` call is made. Handle this in the ``wait_for_transaction_receipt`` method by catching the error in order to continue waiting.
937d131
to
31c5126
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nit, not blocking. lgtm!
error_middleware = construct_error_generator_middleware( | ||
{ | ||
RPC.eth_getTransactionReceipt: lambda *_: ( | ||
_swap_error_middleware_for_result_middleware_and_return_error( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super funky but this seems like a good way to test the error/response.
receipt = w3.eth.wait_for_transaction_receipt(f"0x{'00' * 32}") | ||
assert receipt == {"status": 1} | ||
|
||
assert "error_middleware" not in w3.middleware_onion.middlewares |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: This seems like it would always be true given the expected receipt came back. Curious if you have thoughts for this assertion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just to add an extra layer of assertion for better code readability. Sanity check that the error_middleware
is getting cleaned up when we add the result_middleware
which is why we don't remove it from the onion below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
What was wrong?
1.13.11
started to return an error when transaction indexing is in progress and aeth_getTransactionReceipt
call is made.Related to Issue #3212
How was it fixed?
wait_for_transaction_receipt
method by catching the error in order to continue waiting.Todo:
Cute Animal Picture