Skip to content
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

Backport VSP client fixes to 1.8 #2277

Merged
merged 5 commits into from
Aug 8, 2023
Merged

Conversation

jholdstock
Copy link
Member

Backporting various fixes for the VSP client to 1.8 release branch. Most important of these is the hard-coded background context which fixes an issue where VSP client is unable to retry failed fee payments. Without this fix, the only work-around is to re-register tickets with failed fee payments to another VSP via manual intervention. Thanks to @kandiru for help investigating and testing this.

@jrick
Copy link
Member

jrick commented Aug 8, 2023

Please include a "Backport of XXXXX" with the commit hash from the master branch in each backported commit, this makes it far easier to determine what has and has not been backported onto the release branch.

Users should be warned if an error is caused by a locked wallet so they
can remediate the problem. VSP fee payments may be missed if these
errors are suppressed, and the tickets won't be voted.

Partial backport of 2c0284a
The VSP client code was not handling contexts correctly. It was
receiving short-lived contexts bound to the lifespan of a single RPC
request, and using them to create feePayment instances. Most of the code
in feePayment executes async, so should be running on a long-lived
context such as context.Background().

Backport of 19f7ed1
The only way to be certain a VSP has acknowledged a fee tx and added a
ticket to its voting wallets is to check FeeTxStatus == "confirmed".
Checking for 6 confirmations on the fee tx is not an adequate
substitute.

For example, if a client has broadcast it's own fee tx rather than
waiting for the VSP to do it, it's possible that the tx could be mined
and have 6+ confs, but the amount paid is not enough, or the payment is
sent to the wrong address.

Backport of 3c8cd47
@jholdstock
Copy link
Member Author

Done

Previously the live & expiry heights were only being set once upon
feePayment initialization, which meant that an unmined ticket added to
the VSP client would have heights set to zero forever.

With this change, if either of the values are found to be zero, we check
if the ticket has been mined yet and the heights are recalculated to
their correct values if so.

Backport of 8722867
@jrick jrick merged commit 1319da0 into decred:release-v1.8 Aug 8, 2023
2 checks passed
@jholdstock jholdstock deleted the vsp-fixes branch August 29, 2024 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants