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

Voting wallet consistency checking #86

Merged
merged 1 commit into from
Jul 28, 2020
Merged

Conversation

jholdstock
Copy link
Member

@jholdstock jholdstock commented May 28, 2020

This PR makes use of the ticketinfo RPC added to dcrwallet to:

  • Perform voting wallet consistency checks
  • Set ticket outcome in the database

Consistency checking

Consistency checks are run immediately on vspd startup and then once every 30 minutes (Closes #46). Consistency checking is a two step process:

  1. Query the database for all tickets which should currently be added to voting wallets, and use ticketinfo on each voting wallet to ensure all of the wallets are aware of all of the tickets
  2. Ensure every ticket on every wallet has the correct voting choices set

Set ticket outcome

Using ticketinfo allows vspd to determine when a ticket is no longer votable, either because it has already voted or because it has been revoked. This information is now stored in the vspd database. The ticketinfo RPC does not distinguish between missed and expired tickets, and so vspd simply buckets both of these into revoked.

This occurs each time a block is connected by the local dcrd instance, which provides a regular check on the status of dcrwallet RPC connections (Closes #103).

Counts of Voting/Voted/Revoked tickets are now reported on both the web front-end and through the /vspinfo API call. This replaces the previous counts of Total tickets and Fee confirmed tickets. Tickets with unconfirmed fees are no longer reported.

@jholdstock jholdstock force-pushed the conssss branch 6 times, most recently from 830ea82 to 5ec05cb Compare June 4, 2020 08:09
@jholdstock jholdstock changed the title [WIP] Start consistency checking Start consistency checking Jun 4, 2020
@jholdstock
Copy link
Member Author

jholdstock commented Jun 4, 2020

Ran into an issue.

  • gettickets RPC only returns tickets which are live.
  • vspd does not know if a ticket has voted or not.

When a ticket is missing from gettickets response, vspd cannot know whether this is because the wallet does not know about the ticket, or because the ticket has voted.

This means that the current code is continuously trying to add tickets which have already voted to the voting wallets.

Ticket Info RPC will be added to dcrwallet to accomodate this (decred/dcrwallet#1783)

@jholdstock jholdstock force-pushed the conssss branch 2 times, most recently from d0f9a2d to 4710400 Compare June 17, 2020 09:50
@jholdstock jholdstock changed the title Start consistency checking Voting wallet consistency checking Jun 17, 2020
@jholdstock jholdstock force-pushed the conssss branch 2 times, most recently from 5e8dd07 to 406473e Compare July 9, 2020 10:34
@jholdstock jholdstock force-pushed the conssss branch 3 times, most recently from 5bb6627 to 65893d8 Compare July 14, 2020 08:45
@jholdstock jholdstock force-pushed the conssss branch 2 times, most recently from b6eb566 to 4881189 Compare July 27, 2020 10:04
@jholdstock
Copy link
Member Author

Ready to go, just waiting for the wallet PR to be merged

@jholdstock jholdstock force-pushed the conssss branch 2 times, most recently from 95a08e9 to 61bbd24 Compare July 27, 2020 15:23
@jholdstock jholdstock marked this pull request as ready for review July 28, 2020 08:22
@jholdstock jholdstock deleted the conssss branch January 25, 2022 09:48
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.

[voting wallet] Warn if wallet stop Consistency checking
2 participants