Skip to content

Commit

Permalink
Use static memory layout for all sysvars (#249)
Browse files Browse the repository at this point in the history
Co-authored-by: Richard Patel <[email protected]>
  • Loading branch information
ripatel-fd and riptl authored Mar 15, 2024
1 parent 4425dbe commit fb01ab2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sdk/program/src/epoch_rewards.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
//! [`sysvar::epoch_rewards`]: crate::sysvar::epoch_rewards
use std::ops::AddAssign;

#[repr(C)]
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Default, Clone, Copy, AbiExample)]
pub struct EpochRewards {
/// total rewards for the current epoch, in lamports
Expand Down
1 change: 1 addition & 0 deletions sdk/program/src/fee_calculator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use {
log::*,
};

#[repr(C)]
#[derive(Serialize, Deserialize, Default, PartialEq, Eq, Clone, Copy, Debug, AbiExample)]
#[serde(rename_all = "camelCase")]
pub struct FeeCalculator {
Expand Down
1 change: 1 addition & 0 deletions sdk/program/src/stake_history.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use std::ops::Deref;

pub const MAX_ENTRIES: usize = 512; // it should never take as many as 512 epochs to warm up or cool down

#[repr(C)]
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Default, Clone, AbiExample)]
pub struct StakeHistoryEntry {
pub effective: u64, // effective stake at this epoch
Expand Down

0 comments on commit fb01ab2

Please sign in to comment.