Closed mazeboard closed 9 months ago
You have disable-validation: true
which disables all the checks. Can you please try without this option?
Though it doesn't seem right anyway. I will check it because disabling the validation should not cause this
Sorry for the delay, but this one was a bit tricky.
To provide some context. First, I want to clarify that 'Primary' and 'Fallback' means upstream availability, not the responses they provide. An 'error' in the response doesn't necessarily mean that the entire request has failed. This is because an 'error' response can be valid for some other types of calls. However, I believe that HTTP status 429 always means that something is wrong, and the response body should not be considered as an actual response.
In fact, previously Dshackle was doing exactly what you expect. But it turns out some servers may respond with 500 or 404 in additional to normal JSON RPC response, so Dshackle started to accept those responses as valid if the body is a valid JSON RPC message.
I agree that status code 429 must be treated as a connection error, and any response should be disregarded. This is what the fix is doing. But this logic applies only to situations like yours, where there is another valid upstream source available. Otherwise it provides it back as is, because he has no other option.
I am testing dshackle with a primary server that only responds with HTTP status code 429, and fallback server that uses INFURA (mainnet)
I was expecting dshackle upon receiving the HTTP status 429 from the primary server to switch to the fallback server, but dshackle returns HTTP status 200 and returns the response of the primary server instead of switching to the fallback server
The primary server is implemented using ncat command as follows:
and the config file dshackle.yaml is:
Thanks in advance for your help