Line data Source code
1 : #ifndef HEADER_fd_src_flamenco_runtime_sysvar_fd_sysvar_recent_hashes_h 2 : #define HEADER_fd_src_flamenco_runtime_sysvar_fd_sysvar_recent_hashes_h 3 : 4 : /* fd_sysvar_recent_hashes.h manages the "recent block hashes" sysvar 5 : account (address SysvarRecentB1ockHashes11111111111111111111). */ 6 : 7 : #include "../fd_bank.h" 8 : 9 : /* FD_SYSVAR_RECENT_HASHES_CAP is the max number of block hash entries 10 : the recent blockhashes sysvar will include. 11 : 12 : https://github.com/anza-xyz/agave/blob/6398ddf6ab8a8f81017bf675ab315a70067f0bf0/sdk/program/src/sysvar/recent_blockhashes.rs#L32 13 : */ 14 : 15 191309 : #define FD_SYSVAR_RECENT_HASHES_CAP (150UL) 16 : 17 : FD_PROTOTYPES_BEGIN 18 : 19 : /* Initialize the recent hashes sysvar account. */ 20 : 21 : void 22 : fd_sysvar_recent_hashes_init( fd_bank_t * bank, 23 : fd_accdb_t * accdb, 24 : fd_capture_ctx_t * capture_ctx ); 25 : 26 : /* Register the block's PoH hash and rewrite the recent hashes sysvar 27 : account. Called once per block when the bank is frozen, after all 28 : transactions have executed. */ 29 : 30 : void 31 : fd_sysvar_recent_hashes_update( fd_bank_t * bank, 32 : fd_accdb_t * accdb, 33 : fd_capture_ctx_t * capture_ctx ); 34 : 35 : /* Validate recent hashes sysvar account data. Returns 1 if content is 36 : valid, 0 if not. */ 37 : 38 : int 39 : fd_sysvar_recent_hashes_validate( uchar const * data, 40 : ulong sz ); 41 : 42 : FD_PROTOTYPES_END 43 : 44 : #endif /* HEADER_fd_src_flamenco_runtime_sysvar_fd_sysvar_recent_hashes_h */