jup-ag / jupiter-swap-api

The jupiter swap api binary
72 stars 20 forks source link

Panic when receiving 429 Too Many Requests from RPC #33

Closed zezic closed 1 month ago

zezic commented 1 month ago

When running jupiter-swap-api with Helius RPC node it crashes with the following log:

...
2024-07-26T07:07:42.045709Z  INFO jupiter_core::address_lookup_table_cache: Fetching 13049 address lookup tables    
2024-07-26T07:07:45.720213Z  INFO jupiter_core::address_lookup_table_cache: Update 13049 ALTs into the AddressLookupTableCache in 3.67468405s    
2024-07-26T07:07:45.720232Z  INFO jupiter_core::router: 122809 amms for 122809 lookup tables    
thread 'main' panicked at jupiter-swap-api/src/main.rs:832:62:
called `Result::unwrap()` on an `Err` value: HTTP status client error (429 Too Many Requests) for url (https://mainnet.helius-rpc.com/?api-key=*api_key_hidden*)

Caused by:
    HTTP status client error (429 Too Many Requests) for url (https://mainnet.helius-rpc.com/?api-key=*api_key_hidden*)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Aborted (core dumped)

Is it possible to handle the HTTP status 429 in jupiter-swap-api? We can't run it in self-hosted scenario because of such behavior, but at the same time we also can't use public Jupiter swap API because it's overloaded.

lonely1215225 commented 1 month ago

me too ,i use quicknode ,grade plan

siong1987 commented 1 month ago

there is no way to recover if the RPC 429. it is best to panic.