Skip to content

remove unused SnapshotMinimizer::ending_slot #6880

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

Merged
merged 1 commit into from
Jul 9, 2025

Conversation

HaoranYi
Copy link

@HaoranYi HaoranYi commented Jul 8, 2025

Problem

SnapshotMinimizer::ending_slot used to be required for snapshot_minimizer due to rent collection. Now rent collection is disabled. ending_slot is no longer needed for snapshot_minimizer.

Summary of Changes

remove ending_slot from snapshot_minimizer.

Fixes #

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.2%. Comparing base (fca11d3) to head (0baa0ed).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##           master    #6880     +/-   ##
=========================================
- Coverage    83.3%    83.2%   -0.1%     
=========================================
  Files         853      852      -1     
  Lines      378508   376882   -1626     
=========================================
- Hits       315483   313861   -1622     
+ Misses      63025    63021      -4     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@HaoranYi HaoranYi requested review from brooksprumo and jstarry July 8, 2025 21:07
@brooksprumo brooksprumo requested review from apfitzge and removed request for jstarry July 8, 2025 21:12
@brooksprumo
Copy link

Removing @jstarry and adding @apfitzge as a reviewer, since @apfitzge is this code's owner.

@apfitzge
Copy link

apfitzge commented Jul 8, 2025

This can't be true. If it's the case in the code ending slot was only used for rent collection, something fundamental has broken about snapshot minimization.

The whole process of minimization is to minimize a snapshot at slot N by keeping only enough state to replay until some later ending slot.
Without the ending slot this process doesn't even make sense.

edit: I see now. this removes it from SnapshotMinimizer NOT from snapshot minimization in ledger-tool.

Copy link

@brooksprumo brooksprumo left a comment

Choose a reason for hiding this comment

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

I'm kinda surprised that we don't need the ending slot anymore, as I thought that would impact the accounts kept/pruned. I'll defer to @apfitzge here.

@HaoranYi
Copy link
Author

HaoranYi commented Jul 8, 2025

edit: I see now. this removes it from SnapshotMinimizer NOT from snapshot minimization in ledger-tool.

yes. snapshot minimizer doesn't need it any more. no rent update, so no end slot needed.

@apfitzge
Copy link

apfitzge commented Jul 8, 2025

@HaoranYi minor. Can you update the title to be something like:

remove unused SnapshotMinimizer::ending_slot

the field name in title doesn't match the actual field name rn

Copy link

@apfitzge apfitzge left a comment

Choose a reason for hiding this comment

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

Left a minor comment about the title.

As I mentioned in a previous comment, this PR removes ending_slot from the SnapshotMinimizer but not from the minimization process. ending_slot is still required to be passed into ledger-tool to figure out which accounts are touched in transactions in [snapshot_slot, ending_slot] range.

@HaoranYi HaoranYi changed the title remove end_slot in snapshot minimizer remove ending_slot in snapshot minimizer Jul 8, 2025
@HaoranYi HaoranYi changed the title remove ending_slot in snapshot minimizer remove unused SnapshotMinimizer::ending_slot Jul 8, 2025
@HaoranYi
Copy link
Author

HaoranYi commented Jul 8, 2025

Left a minor comment about the title.

As I mentioned in a previous comment, this PR removes ending_slot from the SnapshotMinimizer but not from the minimization process. ending_slot is still required to be passed into ledger-tool to figure out which accounts are touched in transactions in [snapshot_slot, ending_slot] range.

updated.

@brooksprumo brooksprumo self-requested a review July 8, 2025 22:12
Copy link

@brooksprumo brooksprumo left a comment

Choose a reason for hiding this comment

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

:shipit:

@HaoranYi HaoranYi merged commit 9e54a06 into anza-xyz:master Jul 9, 2025
41 checks passed
@HaoranYi HaoranYi deleted the end-slot branch July 9, 2025 15:01
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.

4 participants