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 "../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 : /* The slot history sysvar contains a bit-vector indicating which slots 14 : have been processed in the current epoch. */ 15 : 16 : /* Initialize the slot history sysvar account. */ 17 : void 18 : fd_sysvar_slot_history_init( fd_bank_t * bank, 19 : fd_funk_t * funk, 20 : fd_funk_txn_xid_t const * xid, 21 : fd_capture_ctx_t * capture_ctx, 22 : fd_spad_t * runtime_spad ); 23 : 24 : /* Update the slot history sysvar account. This should be called at the 25 : end of every slot, after execution has concluded. */ 26 : int 27 : fd_sysvar_slot_history_update( fd_bank_t * bank, 28 : fd_funk_t * funk, 29 : fd_funk_txn_xid_t const * xid, 30 : fd_capture_ctx_t * capture_ctx ); 31 : 32 : /* fd_sysvar_slot_history_read reads the slot history sysvar from funk. 33 : If the account doesn't exist in funk or if the account has zero 34 : lamports, this function returns NULL. */ 35 : 36 : fd_slot_history_global_t * 37 : fd_sysvar_slot_history_read( fd_funk_t * funk, 38 : fd_funk_txn_xid_t const * xid, 39 : uchar out_mem[ static FD_SYSVAR_SLOT_HISTORY_FOOTPRINT ] ); 40 : 41 : int 42 : fd_sysvar_slot_history_find_slot( fd_slot_history_global_t const * history, 43 : ulong slot, 44 : fd_wksp_t * wksp ); 45 : #endif /* HEADER_fd_src_flamenco_runtime_sysvar_fd_slot_history_h */