-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
501 fix occassional horizonresponse decodeerror #502
Conversation
…hub.com:pendulum-chain/spacewalk into 501-fix-occassional-horizonresponse-decodeerror
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 👍 I'm curious if this fixes the problem, hard to tell. @b-yap did you happen to test this locally? Encountering these timeouts is probably hard to reproduce locally, as you would need to simulate some redeem requests.
@ebma by flagging this error as "recoverable", it will resend the same transaction again. |
Yes, the logic makes sense to me. I was asking if you tested it because it would actually be interesting to see how this behaves in practice. Because if this error is indeed somehow related to rate limiting, our logic here is not enough to make the transaction eventually go through. Since even if we retry with the same transaction over and over again, the rate-limiting would continue to block it. If this is the case, which I don't know, then we should add some kind of delay here and wait for the rate-limiting window to expire. |
Yesterday it was difficult with the accounts not existing. There is already a delay added on the loop, the spacewalk/clients/wallet/src/horizon/horizon.rs Lines 177 to 183 in a2624f0
Will this slowdown the CI? Possible. |
Ahhh true, we already have that delay in place 👍 That's great. I found out that the Horizon's apparently have IP-based rate limiting of 3600 requests per hour ie. one request per second on average. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's give these changes a try in production. In any case they won't do any harm and at least improve the decoding of some horizon responses, even if we are not 100% sure whether submissions that returned a 403 error will eventually get accepted or not.
Only one integration test failed so we can consider it a shaky test. I checked cargo clippy and rustfmt locally and there are no complaints. Merging. |
closes #501
The error found was 403, and as explained by @ebma, it should be recoverable.
Not only that, I've updated the
HorizonResponseError
structure, flexible enough to accept either aReqwestError
or an error in string format.The string format is important to find the correct error.