Skip to content

fix: remove deleted programs from program cache - #57

Merged
bmuddha merged 1 commit into
devfrom
fix/remove-deleted-program-cache
Aug 12, 2026
Merged

fix: remove deleted programs from program cache#57
bmuddha merged 1 commit into
devfrom
fix/remove-deleted-program-cache

Conversation

@bmuddha

@bmuddha bmuddha commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

What changed

  • Publish a transaction-local closed sentinel when Magic Root deletes an executable program.
  • Remove closed entries during the existing successful-validation merge into the shared program cache.
  • Cover immediate hiding, rollback preservation, committed eviction, and invalid-ELF restoration.
  • Remove the unused MAX_LOADED_ENTRY_COUNT constant and document the deletion contract.

Closes #53

Impact

Successfully deleted programs no longer leave stale compiled entries in the shared cache. Failed transactions preserve the existing entry. This adds no new public change-set type or Keeper behavior.

Validation

  • cargo test -p magicblock-engine --test accounts account_program_cache_tracks_v42_lifecycle
  • cargo test -p solana-program-runtime — 52 passed
  • cargo check -p solana-svm -p magic-root-program
  • cargo fmt --check
  • git diff --check

Reviewer notes

The transaction-local modified-entry map remains last-write-wins. A closed sentinel reaches the shared cache only through the existing successful execution and access_is_valid() gate. Native builtins remain protected by existing account lifecycle rules.

@bmuddha
bmuddha force-pushed the fix/remove-deleted-program-cache branch from a8e52b5 to bac03c4 Compare August 12, 2026 15:21
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@bmuddha, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 37 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 16487219-3424-4e62-a8a8-9667a5836bd2

📥 Commits

Reviewing files that changed from the base of the PR and between 36509e8 and 2e15dfe.

📒 Files selected for processing (5)
  • engine/tests/accounts.rs
  • programs/magic-root-interface/src/lib.rs
  • programs/magic-root-program/README.md
  • programs/magic-root-program/src/account.rs
  • solana/program-runtime/src/loaded_programs.rs
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/remove-deleted-program-cache

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.

@bmuddha
bmuddha force-pushed the fix/remove-deleted-program-cache branch from bac03c4 to 2e15dfe Compare August 12, 2026 15:36
@bmuddha
bmuddha marked this pull request as ready for review August 12, 2026 15:41
@bmuddha
bmuddha merged commit 359f003 into dev Aug 12, 2026
7 of 10 checks passed
@bmuddha
bmuddha deleted the fix/remove-deleted-program-cache branch August 12, 2026 15:44
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.

Remove deleted programs from the program cache

1 participant