-
Notifications
You must be signed in to change notification settings - Fork 111
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
Make subtree index upgrade compatible with lightwalletd back-tracking algorithm #7407
Comments
Hey team! Please add your planning poker estimate with Zenhub @arya2 @oxarbitrage @teor2345 @upbqdn |
I have confirmed that this fix is required by testing the upgrade code. The upgrade takes approximately:
So I estimate it will take around an hour. |
For example with
|
(I'm checking with the |
This is a technical limitation of their reindex mode: We should still do it correctly if it's relatively easy to implement. |
Motivation
lightwalletd
needs subtree indexes to be continuous from the tip backwards. This is a requirement of its back-tracking algorithm. The requirement applies even while Zebra is upgrading its state format and rebuilding subtrees.Since the upgrade takes longer than 5 minutes, we can't rebuild subtrees from the genesis block forwards. That would create a gap between the first subtree, and any subtrees added by new blocks. These gaps would provide incorrect data to wallets.
Specifications
Zebra currently adds new subtrees if the tip block completes them. This is the correct behaviour for new blocks, regardless of whether the state also needs an upgrade.
For subtree state upgrades, Zebra can either:
Anything else is out of scope, our priority is to have working code and tests.
Complex Code or Requirements
The indexes are upgraded concurrently with adding new subtrees at the tip.
This ticket does not need a state version bump, because it only changes the order that indexes are rebuilt in. (Once the index rebuild is complete, the order of the rebuild is irrelevant.)
Testing
Depending on the implementation chosen, either:
Related Work
Follow-Up
only if the note commitment tree rebuild is extremely slow (10+ minutes)
Performance / Completion
Avoid rebuilding trees that are already in the database, so partial upgrades are not wasted. This allows Zebra instances that only run for a few minutes at a time to eventually finish the rebuild.
The text was updated successfully, but these errors were encountered: