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!: simple stupid pruning #39

Closed

Conversation

evan-forbes
Copy link

Description

this PR attempts to simplify pruning by pruning attestations that are older than a threshold of blocks. It will stop pruning if there is only a single validator set update currently in the state, and will wait until there is another added before resuming.

I was too tired to write an integration test, but will tmrw

Copy link
Owner

@rach-id rach-id left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand right, this is pruning everything before the last valset update, right?

If so, then I suggest keeping the name LastUnbondingNonce and prune before it. Because a valset is created also in other scenarios, other than a validator unbonding. So, it's better to keep attestations up to the last unbonding nonce

Copy link
Owner

@rach-id rach-id left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand right, this is pruning everything before the last valset update, right?

If so, then I suggest keeping the name LastUnbondingNonce and prune before it. Because a valset is created also in other scenarios, other than a validator unbonding. So, it's better to keep attestations up to the last unbonding nonce

@evan-forbes
Copy link
Author

to answer the question @sweexordious , this is pruning every attestation from 220,000 blocks ago, unless there is only a single validator set in the store, in which case it will not prune.

closing this, as I think we will go with a different approach, however @sweexordious the test here might be something that we could emulate in whatever approach we end up going with

https://github.com/celestiaorg/celestia-app/blob/4728ad30eadccaa5f70037c8e1a28d6940633c67/x/qgb/pruning_test.go#L23-L102

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

Successfully merging this pull request may close these issues.

2 participants