1

The sysvar documentation gives the address of the Epoch Rewards account as SysvarEpochRewards1111111111111111111111111

Using getAccountInfo, I'm getting "value": null for this address on testnet, devnet, mainnet-beta and a local test validator

The address is found in the solana-labs/solana source code so I think it's correct in the docs: https://github.com/solana-labs/solana/blob/4385ed11b1a955642944a6b11353c09b1fba9187/sdk/program/src/sysvar/epoch_rewards.rs#L135

It's not marked deprecated in parse_sysvar where some others are: https://github.com/solana-labs/solana/blob/4385ed11b1a955642944a6b11353c09b1fba9187/account-decoder/src/parse_sysvar.rs#L107-L123

Should I just assume it's deprecated and no longer exists on any network?

1
  • what solana version is your rpc provider using? Is it v0.16 or older?
    – nickfrosty
    Jan 12 at 17:39

1 Answer 1

2

No, the EpochRewards sysvar is not deprecated. It is actually rather new, having been added within the last year.

It will become live on v0.17, which is not on all networks yet.

If you look at the rust crates, you can see that before v0.17 the sysvar did not exist, and after v0.17 it does.

Here is the current Solana Lab's client's source code that has the SysVar available.

About the sysvar returning null:

Per the docs, this seems to be expected.

When all rewards have been distributed, the sysvar is deleted. Unlike other sysvars, which almost always exist on-chain, EpochRewards sysvar only exists during the reward period

So when there are no pending rewards that need to be distributed, the sysvar will error (and I guess the RPC returns null for that vice an actual error?)

This sysvar should only return an actual value when there are pending rewards that are yet to be distributed

3
  • Awesome, the exact opposite of my guess! :D My local validator is on 1.17.15 and doesn't return anything for SysvarEpochRewards1111111111111111111111111. Do you know if there's a way I can convince a local validator to include it? For context I'm adding the sysvar accounts to web3js so being able to validate against a real response is really useful!
    – Callum M
    Jan 12 at 17:57
  • How are you trying to access the data?
    – nickfrosty
    Jan 12 at 19:55
  • 1
    I did some more research, and updated my answer about why the null response is expected most of the time
    – nickfrosty
    Jan 12 at 20:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.