-
Notifications
You must be signed in to change notification settings - Fork 20
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
multi: Find voted/revoked tickets with GCS filters #413
Conversation
Simnet params were added in the very first commit of vspd purely because of copy/pasting from another project. vspd has never actually been tested on simnet, so its possible (probable) that it won't even operate correctly without additional dev work. If we want simnet to be a properly supported network it can be re-added and tested in the future.
Thanks @davecgh. Performance isn't critical here, but its great to have your suggestions because there are (rare) cases where vspd might need to rescan several thousand blocks. I added some temporary logs for timing and the improvement is notable. Before
After
This PR now contains three commits - the first is a new one to remove simnet params because they are completely unused/untested and I was too lazy to figure out how to handle the DCP-0005 activation height. The middle commit contains exactly the same changes you already reviewed, and the third is a new one to implement your suggestions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. Glad to hear the suggestions helped.
That one is easy. It's always active on simnet. |
Use dcrd and GCS filters to find voted/revoked tickets rather than using the dcrwallet TicketInfo RPC. Using TicketInfo was a bit flakey because wallets do not always correctly detect votes/revokes, and as a result VSP admins may notice that with this change vspd detects some historic voted/revoked tickets which TicketInfo never detected.
Nice job overall and it looks good now. It's much more robust than what it's replacing and with the latest updates should stay reasonably efficient. As an aside, if you ultimately end up needing more performance, you could use filter.MatchAny instead because it saves a lot of time on the filter matching itself when looking for multiple things like this. To do that though, you'd need to restructure your code slightly in this section to use slices instead of a map. That's why I didn't think it was necessary for this PR, but figured I'd mention it in case you ultimately need to speed it up more. |
Use dcrd and GCS filters to find voted/revoked tickets rather than using the dcrwallet TicketInfo RPC.
Using TicketInfo was a bit flakey because wallets do not always correctly detect votes/revokes, and as a result VSP admins may notice that with this change vspd detects some historic voted/revoked tickets which TicketInfo never detected.
Contributes to #268