Line data Source code
1 : #ifndef HEADER_fd_src_flamenco_runtime_sysvar_fd_recent_hashes_h 2 : #define HEADER_fd_src_flamenco_runtime_sysvar_fd_recent_hashes_h 3 : 4 : /* fd_sysvar_recent_hashes.h manages the "recent block hashes" sysvar 5 : account (address SysvarRecentB1ockHashes11111111111111111111). */ 6 : 7 : #include "../../types/fd_types.h" 8 : #include "../../fd_flamenco_base.h" 9 : #include "../../../funk/fd_funk.h" 10 : 11 : /* FD_SYSVAR_RECENT_HASHES_CAP is the max number of block hash entries 12 : the recent blockhashes sysvar will include. 13 : 14 : https://github.com/anza-xyz/agave/blob/6398ddf6ab8a8f81017bf675ab315a70067f0bf0/sdk/program/src/sysvar/recent_blockhashes.rs#L32 15 : */ 16 : 17 69309 : #define FD_SYSVAR_RECENT_HASHES_CAP (150UL) 18 : 19 : FD_PROTOTYPES_BEGIN 20 : 21 : /* The recent hashes sysvar */ 22 : 23 : /* Initialize the recent hashes sysvar account. */ 24 : void 25 : fd_sysvar_recent_hashes_init( fd_bank_t * bank, 26 : fd_funk_t * funk, 27 : fd_funk_txn_xid_t const * xid, 28 : fd_capture_ctx_t * capture_ctx ); 29 : 30 : /* Update the recent hashes sysvar account. This should be called at the start of every slot, before execution commences. */ 31 : void 32 : fd_sysvar_recent_hashes_update( fd_bank_t * bank, 33 : fd_funk_t * funk, 34 : fd_funk_txn_xid_t const * xid, 35 : fd_capture_ctx_t * capture_ctx ); 36 : 37 : 38 : /* fd_sysvar_recent_hashes_read reads the recent hashes sysvar from funk. 39 : If the account doesn't exist in funk or if the account has zero 40 : lamports, this function returns NULL. */ 41 : 42 : fd_recent_block_hashes_t * 43 : fd_sysvar_recent_hashes_read( fd_funk_t * funk, 44 : fd_funk_txn_xid_t const * xid, 45 : fd_spad_t * spad ); 46 : 47 : FD_PROTOTYPES_END 48 : 49 : #endif /* HEADER_fd_src_flamenco_runtime_sysvar_fd_recent_hashes_h */