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

Custom height db dump #1192

Closed
grarco opened this issue Mar 2, 2023 · 1 comment · Fixed by #1468
Closed

Custom height db dump #1192

grarco opened this issue Mar 2, 2023 · 1 comment · Fixed by #1468
Assignees

Comments

@grarco
Copy link
Collaborator

grarco commented Mar 2, 2023

The implementation of the dump-db command provided in #1184 only allows dumping the state of the last block height. It would be useful to accept a --height argument to specify which state should be dumped.

To obtain such state we could reapply the diff subkeys recursively to their corresponding subspace key. This operation should start either from the last block or the first one depending on which one is closer to the desired height, to reduce the number of operations to run. In case the starting point was the first block we should also make sure to load any state from the genesis file.

For the diffs targeting the desired height we can immediately apply that diff without the need to reapply all of them.

Mind that the read_subspace_val_with_height does not work in this case as it applies a similar but different logic.

@grarco grarco self-assigned this Mar 2, 2023
@gijswijs gijswijs self-assigned this May 21, 2023
@gijswijs gijswijs mentioned this issue May 24, 2023
2 tasks
@grarco
Copy link
Collaborator Author

grarco commented May 25, 2023

Actually, given #1466, read_subspace_val_with_height is indeed what we want

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants