LCOV - code coverage report
Current view: top level - flamenco/runtime/sysvar - fd_sysvar_base.h (source / functions) Hit Total Coverage
Test: cov.lcov Lines: 9 9 100.0 %
Date: 2026-07-10 05:48:38 Functions: 0 0 -

          Line data    Source code
       1             : #ifndef HEADER_fd_src_flamenco_runtime_sysvar_fd_sysvar_base_h
       2             : #define HEADER_fd_src_flamenco_runtime_sysvar_fd_sysvar_base_h
       3             : 
       4             : #include "../../fd_flamenco_base.h"
       5             : 
       6             : #define FD_SYSVAR_ALIGN_MAX (16UL)
       7             : 
       8           3 : #define FD_SYSVAR_CLOCK_BINCODE_SZ         (    40UL)
       9         618 : #define FD_SYSVAR_EPOCH_REWARDS_BINCODE_SZ (    81UL)
      10             : #define FD_SYSVAR_EPOCH_SCHEDULE_BINCODE_SZ (   33UL)
      11             : #define FD_SYSVAR_LAST_RESTART_SLOT_BINCODE_SZ  (8UL)
      12           3 : #define FD_SYSVAR_RECENT_HASHES_BINCODE_SZ (  6008UL) /* Agave v2.2.1: https://github.com/anza-xyz/solana-sdk/blob/slot-history%40v2.2.1/sysvar/src/recent_blockhashes.rs#L157 */
      13           6 : #define FD_SYSVAR_RENT_BINCODE_SZ          (    17UL)
      14          15 : #define FD_SYSVAR_SLOT_HASHES_BINCODE_SZ   ( 20488UL) /* Agave v2.2.1: https://github.com/anza-xyz/solana-sdk/blob/slot-history%40v2.2.1/sysvar/src/slot_hashes.rs#L69 */
      15        7194 : #define FD_SYSVAR_SLOT_HISTORY_BINCODE_SZ  (131097UL) /* Agave v2.2.1: https://github.com/anza-xyz/solana-sdk/blob/slot-history%40v2.2.1/sysvar/src/slot_history.rs#L65 */
      16       49650 : #define FD_SYSVAR_STAKE_HISTORY_BINCODE_SZ ( 16392UL) /* Agave v2.2.1: https://github.com/anza-xyz/solana-sdk/blob/slot-history%40v2.2.1/sysvar/src/stake_history.rs#L66 */
      17             : 
      18             : struct fd_sysvar_clock {
      19             :   ulong slot;
      20             :   long  epoch_start_timestamp;
      21             :   ulong epoch;
      22             :   ulong leader_schedule_epoch;
      23             :   long  unix_timestamp;
      24             : };
      25             : typedef struct fd_sysvar_clock fd_sol_sysvar_clock_t;
      26             : 
      27             : struct __attribute__((packed)) fd_sysvar_epoch_rewards {
      28             :   ulong       distribution_starting_block_height;
      29             :   ulong       num_partitions;
      30             :   fd_hash_t   parent_blockhash;
      31             :   fd_w_u128_t total_points;
      32             :   ulong       total_rewards;
      33             :   ulong       distributed_rewards;
      34             :   uchar       active; /* 0 or 1 */
      35             : };
      36             : typedef struct fd_sysvar_epoch_rewards fd_sysvar_epoch_rewards_t;
      37             : 
      38             : struct __attribute__((packed)) fd_rent {
      39             :   ulong  lamports_per_uint8_year;
      40             :   double exemption_threshold;
      41             :   uchar  burn_percent;
      42             : };
      43             : typedef struct fd_rent fd_rent_t;
      44             : 
      45             : struct __attribute__((packed)) fd_epoch_schedule {
      46             :   ulong slots_per_epoch;
      47             :   ulong leader_schedule_slot_offset;
      48             :   uchar warmup; /* 0 or 1 */
      49             :   ulong first_normal_epoch;
      50             :   ulong first_normal_slot;
      51             : };
      52             : typedef struct fd_epoch_schedule fd_epoch_schedule_t;
      53             : 
      54        7230 : #define FD_SYSVAR_SLOT_HASHES_CAP (512UL)
      55             : 
      56             : struct __attribute__((packed)) fd_slot_hash {
      57             :   ulong     slot;
      58             :   fd_hash_t hash;
      59             : };
      60             : typedef struct fd_slot_hash fd_slot_hash_t;
      61             : 
      62             : struct fd_slot_hashes {
      63             :   fd_slot_hash_t const * elems;
      64             :   ulong                  cnt;
      65             : };
      66             : typedef struct fd_slot_hashes fd_slot_hashes_t;
      67             : 
      68        4167 : #define FD_SYSVAR_STAKE_HISTORY_CAP 512UL
      69             : 
      70             : struct __attribute__((packed)) fd_stake_history_entry {
      71             :   ulong epoch;
      72             :   ulong effective;
      73             :   ulong activating;
      74             :   ulong deactivating;
      75             : };
      76             : typedef struct fd_stake_history_entry fd_stake_history_entry_t;
      77             : 
      78             : struct fd_stake_history {
      79             :   fd_stake_history_entry_t const * entries;
      80             :   ulong                            len;
      81             : };
      82             : typedef struct fd_stake_history fd_stake_history_t;
      83             : 
      84             : #endif /* HEADER_fd_src_flamenco_runtime_sysvar_fd_sysvar_base_h */

Generated by: LCOV version 1.14