Line data Source code
1 : #ifndef HEADER_fd_src_flamenco_runtime_sysvar_fd_slot_hashes_h 2 : #define HEADER_fd_src_flamenco_runtime_sysvar_fd_slot_hashes_h 3 : 4 : #include "../../fd_flamenco_base.h" 5 : #include "../../types/fd_types.h" 6 : 7 : /* The slot hashes sysvar contains the most recent hashes of the slot's parent bank hashes. */ 8 : 9 : /* FD_SYSVAR_SLOT_HASHES_CAP is the max number of entries that the 10 : "slot hashes" sysvar will include. 11 : 12 : https://github.com/anza-xyz/agave/blob/6398ddf6ab8a8f81017bf675ab315a70067f0bf0/sdk/program/src/slot_hashes.rs#L19 */ 13 : 14 69 : #define FD_SYSVAR_SLOT_HASHES_CAP (512UL) 15 : 16 : FD_PROTOTYPES_BEGIN 17 : 18 : /* Initialize the slot hashes sysvar account (used for tests currently) */ 19 : void fd_sysvar_slot_hashes_init( fd_exec_slot_ctx_t * slot_ctx, fd_slot_hashes_t * slot_hashes ); 20 : 21 : /* Update the slot hashes sysvar account. This should be called at the end of every slot, before execution commences. */ 22 : void 23 : fd_sysvar_slot_hashes_update( fd_exec_slot_ctx_t * slot_ctx); 24 : 25 : /* fd_sysvar_slot_hashes_read reads the slot hashes sysvar from the 26 : accounts manager. On success, returns 0 and writes deserialized 27 : value into *result. On failure, returns the bincode/acc_mgr error 28 : code. */ 29 : fd_slot_hashes_t * 30 : fd_sysvar_slot_hashes_read( fd_slot_hashes_t * result, 31 : fd_exec_slot_ctx_t * slot_ctx ); 32 : 33 : FD_PROTOTYPES_END 34 : 35 : #endif /* HEADER_fd_src_flamenco_runtime_sysvar_fd_slot_hashes_h */