Line data Source code
1 : #ifndef HEADER_fd_src_flamenco_runtime_fd_runtime_init_h 2 : #define HEADER_fd_src_flamenco_runtime_fd_runtime_init_h 3 : 4 : /* fd_runtime_init.h provides APIs for backing up and restoring a Solana 5 : runtime environment. This file must not depend on fd_executor.h. */ 6 : 7 : #include "../fd_flamenco_base.h" 8 : #include "../../funk/fd_funk_rec.h" 9 : 10 : /* FD_BLOCK_SLOT_BANK_TYPE stores fd_slot_bank_t bincode encoded */ 11 0 : #define FD_BLOCK_SLOT_BANK_TYPE ((uchar)6) 12 : 13 : /* FD_BLOCK_EPOCH_BANK_TYPE stores fd_epoch_bank_t bincode encoded */ 14 0 : #define FD_BLOCK_EPOCH_BANK_TYPE ((uchar)7) 15 : 16 0 : #define FD_RUNTIME_ENC_BINCODE 0xB13C0DEFU /* classic bincode encoding */ 17 : #define FD_RUNTIME_ENC_ARCHIVE 0xA3C417EAU /* archival encoding */ 18 : 19 : FD_PROTOTYPES_BEGIN 20 : 21 : fd_funk_rec_key_t 22 : fd_runtime_epoch_bank_key( void ); 23 : 24 : fd_funk_rec_key_t 25 : fd_runtime_slot_bank_key( void ); 26 : 27 : int 28 : fd_runtime_save_slot_bank( fd_exec_slot_ctx_t * slot_ctx ); 29 : 30 : int 31 : fd_runtime_save_epoch_bank( fd_exec_slot_ctx_t * slot_ctx ); 32 : 33 : /* fd_features_restore loads all known feature accounts from the 34 : accounts database. This is used when initializing bank from a 35 : snapshot. */ 36 : 37 : void 38 : fd_features_restore( fd_exec_slot_ctx_t * slot_ctx, fd_spad_t * runtime_spad ); 39 : 40 : /* Recover slot_bank and epoch_bank from funk. */ 41 : 42 : void 43 : fd_runtime_recover_banks( fd_exec_slot_ctx_t * slot_ctx, 44 : int delete_first, 45 : int clear_first, 46 : fd_spad_t * runtime_spad ); 47 : 48 : void 49 : fd_runtime_delete_banks( fd_exec_slot_ctx_t * slot_ctx ); 50 : 51 : FD_PROTOTYPES_END 52 : 53 : #endif /* HEADER_fd_src_flamenco_runtime_fd_runtime_init_h */