Line data Source code
1 : #ifndef HEADER_fd_src_flamenco_runtime_sysvar_fd_slot_history_h 2 : #define HEADER_fd_src_flamenco_runtime_sysvar_fd_slot_history_h 3 : 4 : #include "../../fd_flamenco_base.h" 5 : #include "../../types/fd_types.h" 6 : #include "../context/fd_exec_slot_ctx.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 : /* The slot history sysvar contains a bit-vector indicating which slots have been processed in the current epoch. */ 14 : 15 : /* Initialize the slot history sysvar account. */ 16 : void 17 : fd_sysvar_slot_history_init( fd_exec_slot_ctx_t * slot_ctx, 18 : fd_spad_t * runtime_spad ); 19 : 20 : /* Update the slot history sysvar account. This should be called at the end of every slot, after execution has concluded. */ 21 : int 22 : fd_sysvar_slot_history_update( fd_exec_slot_ctx_t * slot_ctx, 23 : fd_spad_t * runtime_spad ); 24 : 25 : /* fd_sysvar_slot_history_read reads the slot history sysvar from funk. 26 : If the account doesn't exist in funk or if the account has zero 27 : lamports, this function returns NULL. */ 28 : 29 : fd_slot_history_global_t * 30 : fd_sysvar_slot_history_read( fd_funk_t * funk, 31 : fd_funk_txn_t * funk_txn, 32 : fd_spad_t * spad ); 33 : 34 : int 35 : fd_sysvar_slot_history_find_slot( fd_slot_history_global_t const * history, 36 : ulong slot, 37 : fd_wksp_t * wksp ); 38 : #endif /* HEADER_fd_src_flamenco_runtime_sysvar_fd_slot_history_h */