From daee6cb7c762d82930ef654952e1ad35ba7b91e4 Mon Sep 17 00:00:00 2001 From: Tyera Eulberg Date: Thu, 11 Jul 2024 22:04:26 -0400 Subject: [PATCH] Update sysvars doc --- docs/src/runtime/sysvars.md | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/docs/src/runtime/sysvars.md b/docs/src/runtime/sysvars.md index 36c00747bfaa03..7bf3f04015fd59 100644 --- a/docs/src/runtime/sysvars.md +++ b/docs/src/runtime/sysvars.md @@ -154,18 +154,24 @@ and de-activations per epoch. It is updated at the start of every epoch. ## EpochRewards -The EpochRewards sysvar tracks the progress of epoch rewards distribution. The -sysvar is created in the first block of the epoch, and lasts for several blocks -while paying out the rewards. 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. Therefore, calling -`EpochRewards::get()` on blocks that are outside of the reward period will -return an error, i.e. `UnsupportedSysvar`. This can serve as a method for -determining whether epoch rewards distribution has finished. +The EpochRewards sysvar tracks whether the rewards period (including calculation +and distribution) is in progress, as well as the details needed to resume +distribution when starting from a snapshot during the rewards period. The sysvar +is repopulated at the start of the first block of each epoch. + - Address: `SysvarEpochRewards1111111111111111111111111` - Layout: [EpochRewards](https://docs.rs/solana-program/VERSION_FOR_DOCS_RS/solana_program/epoch_rewards/struct.EpochRewards.html) +- Fields: + + - `distribution_starting_block_height` - starting block height for distribution for the current epoch + - `num_partitions` - the number of partitions in the distribution + - `parent_blockhash` - the blockhash seed used to generate the partition hasher, ie. the blockhash of the parent of the first block in the epoch + - `total_points` - the total rewards points calculated for the epoch + - `total_rewards` - total rewards for epoch, in lamports + - `distributed_rewards` - rewards for the epoch distributed so far, in lamports + - `active` - whether the rewards period is currently active ## LastRestartSlot