Repository navigation
svm: load: use rooted access slot - #15967
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #15967 +/- ##
========================================
Coverage 82.2% 82.2%
========================================
Files 938 938
Lines 372938 373002 +64
========================================
+ Hits 306616 306769 +153
+ Misses 66322 66233 -89 🚀 New features to boost your workflow:
|
buffalojoec
reviewed
Oct 13, 2026
Author
|
@buffalojoec thanks legend! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
#15811 clamped the access slot recorded by
extract()tolatest_root_slot, on the grounds that a rooted slot "represents a slot for a fork that can't be pruned off" so "usage stats are effectively 'rooted'". The load path still records the raw bank slot:load_program_with_pubkeystampscurrent_sloton every freshly loaded entry before it reaches the global cache. A program first loaded on an unrooted bank keeps an inflatedlatest_access_slotby (bank_slot - latest_root_slot) until the root advances past it, which delaysprune()'s stale-tombstone cleanup and inflatesretention_score()for entries whose fork may never root. This is the one remaining production writer oflatest_access_slotwithout the clamp.Summary of Changes
min(latest_root_slot), mirroringextract().load_program_with_pubkeyno longer stamps the access slot itself. Its only other caller isBank::load_program, whose entries go to a local batch cache for ledger-tool and never enter the global cache, so the stamp was unused there.Note: #10770 restructures this call site for threaded compilation. This change is independent of it, but whichever lands second will need a small rebase; happy to coordinate.
Testing
test_replenish_program_cache_records_rooted_access_slot: a program first loaded on a bank at slot 200 withlatest_root_slot = 100records access slot 100. Fails on master (records 200), passes with this change.cargo test -p solana-svmpasses (140 lib + 44 integration tests).