Fix: Fetch StakeHistory sysvar and Stake program from mainnet#605
Open
aoikurokawa wants to merge 2 commits intosolana-foundation:mainfrom
Open
Fix: Fetch StakeHistory sysvar and Stake program from mainnet#605aoikurokawa wants to merge 2 commits intosolana-foundation:mainfrom
aoikurokawa wants to merge 2 commits intosolana-foundation:mainfrom
Conversation
MicaiahReid
requested changes
Apr 2, 2026
Collaborator
MicaiahReid
left a comment
There was a problem hiding this comment.
It seems like a lot of this should be fixed at the LiteSVM level:
- the
StakeConfigsysvar could be loaded during theset_sysvarscall like the other sysvars are - the stake program could be loaded with the other default programs
This would remove a lot of the complexity here.
Could you also add an integration test that is reproducing the issue you're seeing, so we can verify this fixes the issue? With the integration test in place, we can easily try the litesvm fixes to make sure they resolve surfpool upstream
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.
Description
StakeHistorysysvar from remote RPC during init/reset — the Stake program accesses it viaget_sysvarsyscall (not as a transaction account), so lazy fetching never picks it up. Without this,Splitpanics withSBF program Panicked in src/sysvar/stake_history.rscore_bpf_stake-1.0.1.so) with the live mainnet version — the bundled ELF was compiled againstsolana-vote-interfacev2.x which only knowsVoteStateVersionsvariants 0-2, but mainnet vote accounts now use V4 (discriminant 3), causingDelegateStaketo fail withInvalidAccountDataget_raw_accountmethod toSurfnetRemoteClientfor fetching accounts without token/program classification