-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Prune iavl tree using the same version #5398
Comments
Thanks @chengwenxi! Indeed, the I suppose we never anticipated the need to mount and load another In any case, instead of modifying |
@alexanderbez I see that the upgrade module is ready, it's possible to mount a new module(using a new store) through the upgrade process. |
@chengwenxi with the upgrade module, the binary still needs to be restarted. That being the case, the new software version will have any new modules that it needs -- so they won't be mounted "dynamically", they'll be mounted normally. |
@alexanderbez yeah, it needs to be restarted, but the versions of the old modules and new modules are still different(restart don't change anything), that's my mean about "dynamically". Edit: |
@chengwenxi I don't really understand what you mean. Any new modules introduced will be handled and loaded the same way old modules are and in your example will start processing blocks at 90001. |
@alexanderbez Maybe I have a misunderstanding about the upgrade module. I think we can mount a new module without having to
so when we restart the new binary, the blocks will start from 90001 rather than 1. |
Correct. But there is no "dynamic" module loading. The new module will be introduced in the new binary and handled like any other existing module. |
OK, so I wrote a new test to explain what I mean: I think the upgrade process will be a similar way to introduce new modules. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Resolved by #7415. |
Summary
Prune iavl tree using the same version
Problem Definition
When committing CommitMultiStore, each store is committed (using a self-increasing version), and the version is used to prune the historical versions.
If a store is loaded at the same time as CommitMultiStore is initialized, store.version is always equal to MultiStore.version. However, if the store are loaded after the CommitMultiStore is committed, their versions will be different, then we can't load the CommitMultiStore to the reserved historical version(Pruning.keepEvery set).
The test shows this problem visually:
https://github.com/chengwenxi/cosmos-sdk/blob/multiStore-test/store/store_test.go#L12-L40
There's nothing wrong with that right now, but we should consider this situation: if we want to add a new module dynamically in our app.
Proposal
We can prune iavl tree using the CommitMultiStore.version.
For Admin Use
The text was updated successfully, but these errors were encountered: