BobTheBuidler / eth_retry

Provides a decorator to automatically retry calls that fail due to specific transient errors seen in the web3 ecosystem.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Context on the endpoint being retried

DefiDebauchery opened this issue · comments

Through multicall, I'm using eth_retry. However, I'm juggling 16-20 different chains at any given time.

The short stack trace only goes as far as the invoking Multicall method. Would it be possible to also report the endpoint URL that it's encountered the error on? I was a bit stumped on how to do so myself.

You're going to need to do that in multicall lib, try running your script with ETHRETRY_DEBUG=1 set as an env var so you can print the actual exceptions that are being raised. Then, you're going to need to catch them in multicall before they are raised to the eth_retry decorator and add your context to them there.

If you want to do that I think the best way is to add an env var to toggle this setting on so it doesnt spam peoples logs more than this lib already does. catch the exc, contitionally add the self._w3.provider.endpoint_uri result to your exception, and reraise. Going to close this because that is outside the scope of this repo. I'd be happy to review a PR to multicall with this change.