Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EpochRewards does not exist at epoch 0 #4928

Open
2501babe opened this issue Feb 11, 2025 · 0 comments
Open

EpochRewards does not exist at epoch 0 #4928

2501babe opened this issue Feb 11, 2025 · 0 comments

Comments

@2501babe
Copy link
Member

2501babe commented Feb 11, 2025

Problem

the stake program depends on the existence of EpochRewards to know if it should be locked out from stake operations or not, but this sysvar is only initialized after the first rewards period. this is not an issue for native stake because it gets the value directly from SysvarCache and cleanly maps a None to false. however the bpf stake program must get it via syscall, which causes svm to halt with an uncatchable UnsupportedSysvar error in this case

in practice this is not a grave issue because no public clusters are on epoch 0, but it could be a problem for people standing up new clusters using a forked agave, because it would prevent all stake operations for the first epoch. however it also makes it impossible to use bpf stake with solana-test-validator until epoch 1

Proposed Solution

set EpochRewards to its default value at genesis. this probably just means adding it to the starting accounts that get populated in GenesisConfig and letting fill_missing_sysvar_cache_entries() pick it up in new_with_paths(). epoch rewards internals are well-encapsulated from Bank so it doesn't have a full object representation like EpochSchedule et al, just EpochRewardStatus which defaults to Inactive

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

No branches or pull requests

1 participant