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

Add max_slots_before_prune config #409

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MartinSchere
Copy link
Contributor

This PR adds a new config called max_slots_before_prune which allows the user to configure the oldest age of the slot kept in the ledger.

This is useful if the data in the ledger is required for use cases other than syncing the chain, such as indexers.

@@ -238,7 +239,10 @@ pub fn apply_block_batch<'a>(
.map(|x| x.0)
.unwrap();

let to_finalize = lastest_immutable_slot(tip, byron, shelley);
let to_finalize = max_slots_before_prune
.map(|x| tip - x)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@scarmuega I'm not sure if you want extra guardrails here in case the user shoots themselves in the foot by setting max_slots_before_prune to a very small number.

@scarmuega scarmuega force-pushed the main branch 2 times, most recently from 0c606cf to 3b3de10 Compare January 24, 2025 11:02
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.

1 participant