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

Detect when an older state version is present, and delete it #1213

Closed
4 tasks
teor2345 opened this issue Oct 26, 2020 · 2 comments · Fixed by #4586
Closed
4 tasks

Detect when an older state version is present, and delete it #1213

teor2345 opened this issue Oct 26, 2020 · 2 comments · Fixed by #4586
Assignees
Labels
A-rust Area: Updates to Rust code C-cleanup Category: This is a cleanup C-enhancement Category: This is an improvement I-heavy Problems with excessive memory, disk, or CPU usage I-usability Zebra is hard to understand or use

Comments

@teor2345
Copy link
Contributor

teor2345 commented Oct 26, 2020

Is your feature request related to a problem? Please describe.

The plan for future database format changes is to blow away the database and start over. Because the database is a cache of chain state, we don't lose any information by doing so, and it's much simpler and more reliable than trying to perform a migration.

Originally posted by @hdevalence in #1172 (comment)

Describe the solution you'd like

Delete any previous versions on database load:

  • {cache_dir}/zebra/v{number}/{network}
    • If Zebra is running version n, we must not delete versions greater than n
    • If possible, restrict the deletion to one filesystem, and don't follow symlinks

Optional:

  • Add a debug config that turns this behaviour off, so developers can keep old states around

Note: number starts at 0

Scheduling

This ticket is only required for the first zebra-state database format change after the Zebra stable release.

@teor2345 teor2345 added C-enhancement Category: This is an improvement S-needs-triage Status: A bug report needs triage labels Oct 26, 2020
@teor2345 teor2345 added this to the State Service milestone Oct 26, 2020
@mpguerra mpguerra removed this from the State Service milestone Jan 5, 2021
@mpguerra mpguerra removed the S-needs-triage Status: A bug report needs triage label Feb 2, 2021
@teor2345 teor2345 added A-rust Area: Updates to Rust code C-cleanup Category: This is a cleanup I-heavy Problems with excessive memory, disk, or CPU usage I-usability Zebra is hard to understand or use NU-5 Network Upgrade: NU5 specific tasks P-Medium labels Feb 25, 2021
@teor2345
Copy link
Contributor Author

We might want to do this ticket for NU5, but it will only be needed if we do a rollback or a new state version.

@teor2345
Copy link
Contributor Author

We might need to do this to support ZecWallet and lightwalletd, let's ask Aditya.

@oxarbitrage oxarbitrage self-assigned this Jun 7, 2022
@conradoplg conradoplg removed the NU-5 Network Upgrade: NU5 specific tasks label Jun 9, 2022
@mergify mergify bot closed this as completed in #4586 Jun 21, 2022
mpguerra added a commit that referenced this issue May 19, 2023
mergify bot pushed a commit that referenced this issue May 23, 2023
* ZIPs were updated to remove ambiguity, this was tracked in #1267.

* #2105 was fixed by #3039 and #2379 was closed by #3069

* #2230 was a duplicate of #2231 which was closed by #2511

* #3235 was obsoleted by #2156 which was fixed by #3505

* #1850 was fixed by #2944, #1851 was fixed by #2961 and #2902 was fixed by #2969

* We migrated to Rust 2021 edition in Jan 2022 with #3332

* #1631 was closed as not needed

* #338 was fixed by #3040 and #1162 was fixed by #3067

* #2079 was fixed by #2445

* #4794 was fixed by #6122

* #1678 stopped being an issue

* #3151 was fixed by #3934

* #3204 was closed as not needed

* #1213 was fixed by #4586

* #1774 was closed as not needed

* #4633 was closed as not needed

* Clarify behaviour of difficulty spacing

Co-authored-by: teor <teor@riseup.net>

* Update comment to reflect implemented behaviour

Co-authored-by: teor <teor@riseup.net>

* Update comment to reflect implemented behaviour when retrying block downloads

Co-authored-by: teor <teor@riseup.net>

* Update `TODO` to remove closed issue and clarify when we might want to fix

Co-authored-by: teor <teor@riseup.net>

* Update `TODO` to remove closed issue and clarify what we might want to change in future

Co-authored-by: teor <teor@riseup.net>

* Clarify benefits of how we do block verification

Co-authored-by: teor <teor@riseup.net>

* Fix rustfmt errors

---------

Co-authored-by: teor <teor@riseup.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rust Area: Updates to Rust code C-cleanup Category: This is a cleanup C-enhancement Category: This is an improvement I-heavy Problems with excessive memory, disk, or CPU usage I-usability Zebra is hard to understand or use
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants