Expand description
Sysvar access via direct syscalls.
Provides zero-alloc, zero-deserialization access to Solana sysvars by reading them directly into stack buffers via syscalls, including the epoch schedule sysvar.
Structs§
- Clock
- Clock sysvar data, read directly from the runtime.
- Epoch
Rewards - EpochRewards sysvar data (SIMD-0118).
- Epoch
Schedule - Epoch schedule sysvar data.
- Rent
- Rent sysvar data.
- Slot
Hash - One
(slot, hash)entry from the SlotHashes sysvar. - Stake
History Entry - One epoch’s stake-history entry.
Constants§
- ACCOUNT_
STORAGE_ OVERHEAD - Fixed per-account storage overhead charged by the cluster.
- CLOCK_
ID - Clock sysvar address.
- EPOCH_
REWARDS_ ID - EpochRewards sysvar address (SIMD-0118).
- EPOCH_
SCHEDULE_ ID - Epoch schedule sysvar address.
- EXEMPTION_
THRESHOLD_ YEARS - Years of rent an account must prepay to be rent-exempt.
- INSTRUCTIONS_
ID - Instructions sysvar address (for instruction introspection).
- LAMPORTS_
PER_ BYTE_ YEAR - Lamports charged per byte of account storage per year.
- LAST_
RESTART_ SLOT_ ID - LastRestartSlot sysvar address.
- RENT_ID
- Rent sysvar address.
- SLOT_
HASHES_ ID - SlotHashes sysvar address.
- STAKE_
HISTORY_ ID - StakeHistory sysvar address.
Functions§
- get_
clock - Read the Clock sysvar.
- get_
epoch_ rewards - Read the EpochRewards sysvar (SIMD-0118).
- get_
epoch_ schedule - Read the EpochSchedule sysvar.
- get_
epoch_ stake - Get the current-epoch activated stake of the vote account at
vote. - get_
last_ restart_ slot - Read the slot of the last cluster restart (hard fork), or
0if the cluster has never been restarted. - get_
rent - Read the Rent sysvar.
- get_
sysvar_ into - Copy
dst.len()bytes starting atoffsetfrom the sysvar identified bysysvar_idintodst. - get_
total_ epoch_ stake - Get the cluster-wide total activated stake for the current epoch.
- rent_
exempt_ minimum - Minimum balance for rent exemption assuming the launch-era rent
constants (
LAMPORTS_PER_BYTE_YEAR,EXEMPTION_THRESHOLD_YEARS,ACCOUNT_STORAGE_OVERHEAD). - saturating_
mul_ u64 a * b, saturating atu64::MAX, without the 128-bit multiply helper.- scale_
by_ exemption_ threshold - Apply the rent
exemption_threshold(given as its IEEE-754 bit pattern) to an integer lamport amount without any floating-point instruction. - slot_
hashes_ latest - Read the most recent
(slot, hash)from the SlotHashes sysvar. - stake_
history_ latest - Read the most recent stake-history entry.