diff --git a/proposals/0118-partitioned-epoch-reward-distribution.md b/proposals/0118-partitioned-epoch-reward-distribution.md index e61f074e7..1abcd2362 100644 --- a/proposals/0118-partitioned-epoch-reward-distribution.md +++ b/proposals/0118-partitioned-epoch-reward-distribution.md @@ -147,28 +147,29 @@ include: the parameters needed to recalculate the reward partitions, the total rewards to be distributed, and the amount of rewards distributed so far. The layout of `EpochRewards` sysvar is shown in the following pseudo code. +Prefixes indidate the offset of each field, and padding bytes are always zero. ``` -#[repr(C)] // C representation, ie. 8-byte alignment +#[repr(C)] // C representation, 8-byte alignment struct EpochRewards{ // whether the rewards period (calculation and distribution) is active - active: bool, // byte. false: 0x00, true: 0x01 + /* 0x00 */ active: bool, // byte. false: 0x00, true: 0x01 - distribution_starting_block_height: u64, // little-endian unsigned 64-bit integer + /* 0x08 */ distribution_starting_block_height: u64, // little-endian unsigned 64-bit integer - num_partitions: u64, // little-endian unsigned 64-bit integer + /* 0x10 */ num_partitions: u64, // little-endian unsigned 64-bit integer - parent_blockhash: Hash, // byte-array of length 32 + /* 0x18 */ parent_blockhash: Hash, // byte-array of length 32 // total points calculated for the current epoch, where points equals the sum // of delegated stake * credits observed for all delegations - total_points: u128, // little-endian unsigned 128-bit integer + /* 0x38 */ total_points: u128, // little-endian unsigned 128-bit integer // total rewards for the current epoch, in lamports - total_rewards: u64, // little-endian unsigned 64-bit integer + /* 0x48 */ total_rewards: u64, // little-endian unsigned 64-bit integer // distributed rewards for the current epoch, in lamports - distributed_rewards: u64, // little-endian unsigned 64-bit integer + /* 0x50 */ distributed_rewards: u64, // little-endian unsigned 64-bit integer } ```