Skip to content

fix: improve write_program logic; add tests#579

Open
MicaiahReid wants to merge 2 commits intomainfrom
fix/write-program-account
Open

fix: improve write_program logic; add tests#579
MicaiahReid wants to merge 2 commits intomainfrom
fix/write-program-account

Conversation

@MicaiahReid
Copy link
Collaborator

@MicaiahReid MicaiahReid commented Mar 18, 2026

This PR:

  • fixes write_program fn in locker.rs
    • to summarize, when you call set_account on litesvm, it checks if that account is executable and loads it into a cache of programs. I wasn't aware of this. So when we would 1. write program account, 2. write program data account, the program account wasn't being re-indexed with the new program data. This would cause program updates to fail beyond the initial program written
  • slimmed down the minimum program we deploy
    • when you write am account using set_account, if the account is executable, it's also going to verify that there is an associated program data account, and verify the ELF of the program. So, if a program account is being written without the data account, we're pushing a minimal ELF. I've updated this to be smaller
  • tests for the edge cases that I hit

@MicaiahReid MicaiahReid changed the title Fix/write program account fix: improve write_program logic; add tests Mar 18, 2026
@MicaiahReid MicaiahReid requested a review from lgalabru March 18, 2026 21:24
@MicaiahReid MicaiahReid force-pushed the fix/write-program-account branch from b070599 to 3bd3d11 Compare March 20, 2026 16:01
@MicaiahReid MicaiahReid force-pushed the main branch 5 times, most recently from 5419677 to 2129ad9 Compare March 23, 2026 19:40
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