LCOV - code coverage report
Current view: top level - flamenco/runtime/sysvar - fd_sysvar_slot_history.h (source / functions) Hit Total Coverage
Test: cov.lcov Lines: 0 5 0.0 %
Date: 2026-02-22 05:44:04 Functions: 0 0 -

          Line data    Source code
       1             : #ifndef HEADER_fd_src_flamenco_runtime_sysvar_fd_sysvar_slot_history_h
       2             : #define HEADER_fd_src_flamenco_runtime_sysvar_fd_sysvar_slot_history_h
       3             : 
       4             : #include "../../fd_flamenco_base.h"
       5             : #include "../../types/fd_types.h"
       6             : #include "../fd_bank.h"
       7             : 
       8           0 : #define FD_SLOT_HISTORY_SLOT_FOUND     (0)
       9           0 : #define FD_SLOT_HISTORY_SLOT_FUTURE    (-1)
      10           0 : #define FD_SLOT_HISTORY_SLOT_NOT_FOUND (-2)
      11           0 : #define FD_SLOT_HISTORY_SLOT_TOO_OLD   (-3)
      12             : 
      13             : /* https://github.com/solana-labs/solana/blob/v1.18.26/sdk/program/src/slot_history.rs#L43 */
      14           0 : #define FD_SLOT_HISTORY_MAX_ENTRIES (1024UL * 1024UL)
      15             : 
      16             : /* The slot history sysvar contains a bit-vector indicating which slots
      17             :    have been processed in the current epoch. */
      18             : 
      19             : /* Initialize the slot history sysvar account. */
      20             : void
      21             : fd_sysvar_slot_history_init( fd_bank_t *               bank,
      22             :                              fd_accdb_user_t *         accdb,
      23             :                              fd_funk_txn_xid_t const * xid,
      24             :                              fd_capture_ctx_t *        capture_ctx );
      25             : 
      26             : /* Update the slot history sysvar account. This should be called at the
      27             :    end of every slot, after execution has concluded. */
      28             : int
      29             : fd_sysvar_slot_history_update( fd_bank_t *               bank,
      30             :                                fd_accdb_user_t *         accdb,
      31             :                                fd_funk_txn_xid_t const * xid,
      32             :                                fd_capture_ctx_t *        capture_ctx );
      33             : 
      34             : /* fd_sysvar_slot_history_read reads the slot history sysvar from funk.
      35             :    If the account doesn't exist in funk or if the account has zero
      36             :    lamports, this function returns NULL. */
      37             : 
      38             : fd_slot_history_global_t *
      39             : fd_sysvar_slot_history_read( fd_accdb_user_t *         accdb,
      40             :                              fd_funk_txn_xid_t const * xid,
      41             :                              uchar                     out_mem[ static FD_SYSVAR_SLOT_HISTORY_FOOTPRINT ] );
      42             : 
      43             : int
      44             : fd_sysvar_slot_history_find_slot( fd_slot_history_global_t const * history,
      45             :                                   ulong                            slot );
      46             : 
      47             : /* fd_sysvar_slot_history_newest returns the most recent slot in the
      48             :    slot history. See https://github.com/solana-labs/solana/blob/v1.18.26/sdk/program/src/slot_history.rs#L87 */
      49             : ulong
      50             : fd_sysvar_slot_history_newest( fd_slot_history_global_t const * history );
      51             : 
      52             : /* fd_sysvar_slot_history_len returns the number of slot history
      53             :    entries. */
      54             : ulong
      55             : fd_sysvar_slot_history_len( fd_slot_history_global_t const * history );
      56             : 
      57             : #endif /* HEADER_fd_src_flamenco_runtime_sysvar_fd_sysvar_slot_history_h */

Generated by: LCOV version 1.14