-
Notifications
You must be signed in to change notification settings - Fork 40
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
lwk: add backoff for send #326
Conversation
Send sends a request using the lwkclient and handles retries in case of a "missing transaction" error. It uses an exponential backoff strategy for retries, with a maximum of 5 retries. This is a temporary workaround for an issue where a missing transaction error occurs even when the UTXO exists. If the issue persists, the backoff strategy may need adjustment. - Implement retry logic in the `send` function of `lwkclient` using an exponential backoff strategy to handle "missing transaction" errors. fixes: #325
Ok I think I've triggered the backoff for this swap attempt:
Though in other canceled attempts I will get this error:
|
Thank you for your investigation. The core issue lies in the failure to retrieve the result after broadcasting the transaction. In this situation, even though the transaction itself is valid on the network, the system cancels the swap, causing a problem where the balance decreases and cannot be recovered.
SolutionI will introduce backoff handling when retrieving transaction results. This can potentially mitigate errors caused by temporary failures or delays. ConsiderationsThe case where a swap is canceled even though an opening tx was broadcast may not only occur with LWK/electrs but could also happen with other backends. However, the probability is low. In the future, it may be necessary to implement a manual fund recovery command. For now, we will focus on stabilizing within the LWK environment and consider further actions if issues arise. Additional Information"failed to fund transaction: permanent error" occurs when there’s an error with LWK's send command but does not trigger backoff. Backoff only occurs when a "missing transaction" error is returned. |
GetRawTransaction retrieves the raw transaction data for a given transaction and handles retries in case of a "missing transaction" error. It uses an exponential backoff strategy for retries, with a maximum of 10 retries. This is a temporary workaround for an issue where a missing transaction error occurs even when the UTXO exists. If the issue persists, the backoff strategy may need adjustment. fixes: #325
Looks like this swap hit the "missing transaction" error, retried, and was able to eventually succeed:
A different swap was canceled because the LWK backend was unreachable:
Tested ACK 27077a8 |
Handles retries in case of a "missing transaction" error.
It uses an exponential backoff strategy for retries, with a maximum of 5 retries.
fixes: #325