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

getstakeinfo/stakepooluserinfo use is problematic due to addticket usage #180

Open
chappjc opened this issue May 22, 2017 · 4 comments
Open
Milestone

Comments

@chappjc
Copy link
Member

chappjc commented May 22, 2017

The number of redeem scripts (from listscripts) and tickets (from gettickets) may be the same on all wallets, but it is possible for getstakeinfo to not match for several reasons that are difficult to rectify.

One is that if the operator has performed addtickets on the wallets at some point, it is necessary to do add the same tickets (until they've expired) on newly added wallets to get the number of "live" tickets in getstakeinfo to match between wallets. This makes it necessary to manually collect every added ticket in a list somewhere so that they can be added in the event of wallet addition or disaster recovery.

In the same case as above, even after doing addtickets (for every invalid ticket ever added), the "voted" number on the new wallet does not catch up with the elder wallets.

Perhaps this should be a dcrwallet issue, but perhaps it's time to workaround this in dcrstakepool given the new stakepoold arch changes.

@jolan
Copy link
Contributor

jolan commented May 24, 2017

The goal is to keep migrating functionality over to stakepoold. I think stakepooluserinfo can eventually be removed.

Rough TODO would be:

  1. Move fee enforcement to stakepoold (WIP stakepoold: Fix ticket handling to be more accurate. #178)
  2. Re-work tickets page. Maybe go back to using ticketsforaddress and add DB caching.
  3. Add some sort of admin/invalid tickets interface so those tickets can be stored in the database and transmitted to/pulled from stakepoold.
  4. Remove stakepooluserinfo and the fee checking from dcrwallet.

@jolan jolan added this to the v1.1.0 milestone Jul 26, 2017
@jolan jolan self-assigned this Jul 26, 2017
@jolan
Copy link
Contributor

jolan commented Jul 26, 2017

Item 3 is in progress now too.

2 and 4 may have to be split out and planned for the next release cycle. There are a lot of dcrwallet/stakepoold changes in-flight already.

@jolan jolan changed the title stakepooluserinfo use is problematic when adding wallets getstakeinfo/stakepooluserinfo use is problematic due to addticket usage Aug 28, 2017
@jolan
Copy link
Contributor

jolan commented Aug 28, 2017

I edited the title to reflect the addition of getstakeinfo and to mention addticket. The problems really lie with the original implementation of the stake code in wallet. That code has been improved and refactored and we need to cope with the changes.

Per decred/dcrwallet#913:

Added tickets are auxiliary to transaction history and do not appear in getstakeinfo stats.

Current status:

  • stakepooluserinfo is still in use by the tickets page. Could possibly replace with the implementation of rpc: add getticketsstatus request dcrwallet#833.
  • getstakeinfo is still in use by the stats page. Need to create a suitable replacement that accounts for tickets that were added via addticket.

@jolan jolan modified the milestones: v1.1.1, v1.1.2 Sep 20, 2017
@jolan jolan removed their assignment Oct 30, 2017
@jolan
Copy link
Contributor

jolan commented Oct 30, 2017

Not actively working on this at the moment but it still needs to be done.

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

No branches or pull requests

2 participants