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

Miner (hopefully) faster sync, faster startup if submission made #1015

Merged
merged 4 commits into from
Feb 8, 2022

Conversation

area
Copy link
Member

@area area commented Feb 2, 2022

Two (mostly) unrelated improvements:

  • When syncing past cycles, no need to make the justification tree - they're historical, the time for disputes has passed, so no need to prepare for how we might respond to a dispute. This could be better; some of the lifting to work out keys/values is still done, it's just that the tree that the values are added to performs no-ops and returns nothing, rather than actually building the tree, and so will return quicker than generating the tree and associated proofs. I did is this way because it was easier than picking apart all the bits that generate the justification tree, which are a bit scattered.

  • Fast-resume if we've made a submission to the cycle. When we generate the next reputation state and save it to the DB, I also save the data required to recreate the justification tree to a json file (not the database, as this is only needed temporarily and does not need to be queried by the oracle). If we've submitted and the miner restarts, it can see that it submitted, and load that state out of the DB and the Justification Tree out of the temporary file, rather than loading the previous state and (re-)applying the reputation update log. This should be a lot quicker, which is good if a restart happens during a dispute, for example.

kronosapiens
kronosapiens previously approved these changes Feb 7, 2022
@kronosapiens kronosapiens merged commit b851c48 into develop Feb 8, 2022
@kronosapiens kronosapiens deleted the maint/miner-client branch February 8, 2022 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants