vyperlang / titanoboa

a vyper interpreter
https://titanoboa.readthedocs.io
Other
236 stars 37 forks source link

Catch HTTPError where applicable #202

Closed DanielSchiavini closed 2 months ago

DanielSchiavini commented 2 months ago

When using Alchemy RPC, this line is raising HTTPError (400 Client Error: Bad Request) https://github.com/vyperlang/titanoboa/blob/786e44fa1bb061f19118f9985c6343bad6e0f2b2/boa/rpc.py#L121

But we only catch RPCError here https://github.com/vyperlang/titanoboa/blob/192cb293f026bd2f06e60a05c541005152c35aeb/boa/network.py#L127

let's do a quick search for everywhere that catches RPCError though and see if we also should catch HTTPError

charles-cooper commented 2 months ago

copying from offline: did a quick search and the other places are mostly in boa/network.py. i think catching HTTPError makes sense when we are testing for capabilities (as with evm_snapshot/evm_revert) but not with runtime things like eth_call. if it happens during runtime with something like eth_call, it's probably fine to let the HTTPError propagate to the user.

we could try really hard to do something sane (retrying is probably the most sane thing) but i don't think we need to worry too much about it, especially until we get bug reports