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

feat: Prune states when data is no longer needed #142

Open
hallazzang opened this issue Sep 28, 2021 · 3 comments · May be fixed by #185
Open

feat: Prune states when data is no longer needed #142

hallazzang opened this issue Sep 28, 2021 · 3 comments · May be fixed by #185
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@hallazzang
Copy link
Contributor

Currently some data permanently remain in store(e.g. CurrentEpoch, HistoricalRewards).
By introducing reference counting as in Cosmos SDK, we can safely prune these data.

@hallazzang hallazzang added enhancement New feature or request help wanted Extra attention is needed labels Sep 28, 2021
@dongsam
Copy link
Contributor

dongsam commented Oct 15, 2021

@hallazzang At what point do you think it's safe to erase these data?

@hallazzang
Copy link
Contributor Author

@dongsam Just like Cosmos SDK, we can introduce reference counting and when the reference count becomes zero, we could safely remove the state.

@dongsam
Copy link
Contributor

dongsam commented Nov 24, 2021

Up to one HistoricalRewards object is generated per epoch (Day) per StakingCoinDenom. Since the size of HistoricalRewards is also small, it does not seem to occupy an influential data size. So I don't think we have to put it in v1 unless it's a confident and verified code. We could consider putting in on the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants