dcrstakepool icon indicating copy to clipboard operation
dcrstakepool copied to clipboard

getstakeinfo/stakepooluserinfo use is problematic due to addticket usage

Open chappjc opened this issue 8 years ago • 4 comments

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.

chappjc avatar May 22 '17 20:05 chappjc

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 #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 avatar May 24 '17 16:05 jolan

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 avatar Jul 26 '17 18:07 jolan

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 https://github.com/decred/dcrwallet/pull/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 https://github.com/decred/dcrwallet/issues/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 avatar Aug 28 '17 15:08 jolan

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

jolan avatar Oct 30 '17 18:10 jolan