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 : /* 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_accdb_user_t * accdb, 20 : fd_funk_txn_xid_t const * xid, 21 : fd_capture_ctx_t * capture_ctx ); 22 : 23 : /* Update the slot history sysvar account. This should be called at the 24 : end of every slot, after execution has concluded. */ 25 : int 26 : fd_sysvar_slot_history_update( fd_bank_t * bank, 27 : fd_accdb_user_t * accdb, 28 : fd_funk_txn_xid_t const * xid, 29 : fd_capture_ctx_t * capture_ctx ); 30 : 31 : /* fd_sysvar_slot_history_read reads the slot history sysvar from funk. 32 : If the account doesn't exist in funk or if the account has zero 33 : lamports, this function returns NULL. */ 34 : 35 : fd_slot_history_global_t * 36 : fd_sysvar_slot_history_read( fd_funk_t * funk, 37 : fd_funk_txn_xid_t const * xid, 38 : uchar out_mem[ static FD_SYSVAR_SLOT_HISTORY_FOOTPRINT ] ); 39 : 40 : int 41 : fd_sysvar_slot_history_find_slot( fd_slot_history_global_t const * history, 42 : ulong slot ); 43 : 44 : #endif /* HEADER_fd_src_flamenco_runtime_sysvar_fd_sysvar_slot_history_h */