Skip to content

Commit fb01ab2

Browse files
ripatel-fdriptl
andauthored
Use static memory layout for all sysvars (pyth-network#249)
Co-authored-by: Richard Patel <ripatel@jumptrading.com>
1 parent 4425dbe commit fb01ab2

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

sdk/program/src/epoch_rewards.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
//! [`sysvar::epoch_rewards`]: crate::sysvar::epoch_rewards
88
99
use std::ops::AddAssign;
10+
11+
#[repr(C)]
1012
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Default, Clone, Copy, AbiExample)]
1113
pub struct EpochRewards {
1214
/// total rewards for the current epoch, in lamports

sdk/program/src/fee_calculator.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use {
66
log::*,
77
};
88

9+
#[repr(C)]
910
#[derive(Serialize, Deserialize, Default, PartialEq, Eq, Clone, Copy, Debug, AbiExample)]
1011
#[serde(rename_all = "camelCase")]
1112
pub struct FeeCalculator {

sdk/program/src/stake_history.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use std::ops::Deref;
1111

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

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

0 commit comments

Comments
 (0)