Skip to content

Conversation

@bmuddha
Copy link
Collaborator

@bmuddha bmuddha commented Dec 3, 2025

Summary by CodeRabbit

Release Notes

  • Chores
    • Updated program cache eviction mechanism to incorporate epoch information during retry scenarios. This enhancement improves cache management precision when capacity limits are reached, ensuring more accurate resource allocation and better system stability during periods of high program loading.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 3, 2025

Walkthrough

Updated the ProgramCache pruning method call in the program cache retry handler from prune_by_deployment_slot(self.slot) to prune(self.slot, self.epoch). This change adds the epoch parameter to the pruning operation that executes when the cache hits its maximum limit during retry.

Changes

Cohort / File(s) Summary
ProgramCache pruning API update
src/transaction_processor.rs
Updated retry path to pass epoch parameter to pruning method; changed from prune_by_deployment_slot(self.slot) to prune(self.slot, self.epoch)

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Suggested reviewers

  • GabrielePicco

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: updating program cache pruning to include epoch parameter for complete pruning when cache limit is reached.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bmuddha/fix/prune-program-cache

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1e6cfeb and 6f74a99.

📒 Files selected for processing (1)
  • src/transaction_processor.rs (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Run cargo test
🔇 Additional comments (1)
src/transaction_processor.rs (1)

381-388: Updated prune call aligns with newer ProgramCache API; verify against dependency version

Switching from prune_by_deployment_slot(self.slot) to prune(self.slot, self.epoch) in the retry path when hit_max_limit is true looks correct and matches the newer API that takes both slot and epoch. It also better fits the PR goal of fully pruning the cache before retrying.

Please:

  • Confirm that solana_program_runtime::loaded_programs::ProgramCache::prune in version 2.2.1 (or the version in Cargo.toml) indeed has the (slot: Slot, epoch: Epoch) signature and that this call compiles as expected.
  • Optionally add a focused test that simulates hit_max_limit and asserts that a second replenish_program_cache attempt succeeds after pruning, to guard this behavior against regressions.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@bmuddha bmuddha requested a review from GabrielePicco December 3, 2025 09:43
Copy link
Contributor

@GabrielePicco GabrielePicco left a comment

Choose a reason for hiding this comment

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

LGTM!

@bmuddha bmuddha merged commit 3062528 into main Dec 3, 2025
2 checks passed
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.

3 participants