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

Pruning on New Block 1:1 #1393

Closed
Tracked by #1390
Ja7ad opened this issue Jul 2, 2024 · 5 comments · Fixed by #1404
Closed
Tracked by #1390

Pruning on New Block 1:1 #1393

Ja7ad opened this issue Jul 2, 2024 · 5 comments · Fixed by #1404
Assignees
Labels
enhancement New feature or request Sync
Milestone

Comments

@Ja7ad
Copy link
Contributor

Ja7ad commented Jul 2, 2024

Once a new block is committed, the following operations should be performed:

  1. If the node is a Full Node, no action is needed.
  2. If the node is a Pruned Node, call the PruneBlock function with the block number equal to LastBlockHeight - RetentionBlocks.

This process ensures that for each new block added, one old block will be removed, keeping the store blocks up to the RetentionBlocks number.

https://pips.pactus.org/PIPs/pip-27#pruning-on-new-block

@Ja7ad Ja7ad mentioned this issue Jul 2, 2024
6 tasks
@Ja7ad Ja7ad added enhancement New feature or request Sync labels Jul 2, 2024
@Ja7ad Ja7ad added this to the v1.4.0 milestone Jul 6, 2024
@kehiy kehiy self-assigned this Jul 8, 2024
@kehiy
Copy link
Contributor

kehiy commented Jul 8, 2024

@b00f @Ja7ad To determine whether a node is a pruned or full node, it's better to pass this information to the store or sync module? Should it be a part of the config?
Or check if we have the genesis each time or check once and keep it?
I think the best way is to pass it to sync and read it from config.

@b00f
Copy link
Collaborator

b00f commented Jul 9, 2024

@kehiy Based on PIP-27 if the genesis block or block number one exists, it is full node.

image

@kehiy
Copy link
Contributor

kehiy commented Jul 9, 2024

@b00f OK, I'll add it once #1400 got merged.

@kehiy
Copy link
Contributor

kehiy commented Jul 10, 2024

@b00f @Ja7ad If we check prune mode by checking the genesis block, each node will be pruned if it's a new node.

@b00f
Copy link
Collaborator

b00f commented Jul 10, 2024

If we check prune mode by checking the genesis block, each node will be pruned if it's a new node.

Good find, check last certificate exists. If not we are at the genesis state.

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

Successfully merging a pull request may close this issue.

3 participants