a16z / helios

A fast, secure, and portable light client for Ethereum
MIT License
1.76k stars 269 forks source link

Crash on rpc error(s) #323

Open Shungy opened 4 months ago

Shungy commented 4 months ago

Should probably gracefully handle this:

thread 'tokio-runtime-worker' panicked at /home/runner/work/helios/helios/execution/src/evm.rs:76:47:
called `Result::unwrap()` on an `Err` value: rpc error on method: get_proof, message: Deserialization Error: invalid type: string "too many requests, we recommend you to use free api key", expected struct JsonRpcError at line 1 column 67. Response: {"error": "too many requests, we recommend you to use free api key","id":39, "project": "11307768e6d77951256a33cc9abd40851f6f5ce8"}

Location:
    execution/src/rpc/http_rpc.rs:54:30
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Aborted (core dumped)
ncitron commented 4 months ago

Ah yeah that is a good idea. We do handle retries right now via ethers but it seems depending on what type of RPC provider you are using it may fail. We should add a fallback retry in case ethers retries blows up.