fix: auto-load BPF upgradeable programs (#240)#269
fix: auto-load BPF upgradeable programs (#240)#269alex-sumner wants to merge 4 commits intoLiteSVM:masterfrom
Conversation
ca12c1d to
cfc9049
Compare
|
Any feedback on this contribution would be welcome. At the moment we are maintaining our own fork of litesvm because we need these changes for some of our Solana tests. It would be great if this could be merged. Happy to look at it again if you think it needs changes, or just to hear your thoughts on it. |
|
The main problem of this PR is the impact on performance. What's the use case to it ? |
Thanks, I agree it is too expensive. The use case is making freshly deployed or synced BPF upgradeable programs immediately invokable in LiteSVM without requiring a separate full-program reload step. I’ve updated it so sync_accounts() no longer scans the full accounts DB after every transaction. The patch now only does what's needed for the upgradeable-loader case:
|
Fixes #240
Summary
When programs are deployed via BPF Loader Upgradeable, only the ProgramData account gets written to the ExecutionRecord, not the Program account. This causes subsequent transactions to fail.
Changes
sync_accounts()load_all_existing_programs()to scan and load uncached programsexecute_tx_helper()load_existing_programs()public APITest Plan
cargo test --package litesvm --test bpf_upgradeable_autoload(4 tests pass)