Line data Source code
1 : #ifndef HEADER_fd_src_flamenco_fd_flamenco_base_h 2 : #define HEADER_fd_src_flamenco_fd_flamenco_base_h 3 : 4 : #include "../ballet/base58/fd_base58.h" 5 : #include "types/fd_cast.h" 6 : 7 : #define FD_DEFAULT_SLOTS_PER_EPOCH ( 432000UL ) 8 : #define FD_DEFAULT_SHREDS_PER_EPOCH ( ( 1 << 15UL ) * FD_DEFAULT_SLOTS_PER_EPOCH ) 9 48 : #define FD_SLOT_NULL ( ULONG_MAX ) 10 0 : #define FD_SHRED_IDX_NULL ( UINT_MAX ) 11 : 12 : /* Forward declarations */ 13 : 14 : struct fd_bank; 15 : typedef struct fd_bank fd_bank_t; 16 : 17 : struct fd_banks; 18 : typedef struct fd_banks fd_banks_t; 19 : 20 : struct fd_bank_data; 21 : typedef struct fd_bank_data fd_bank_data_t; 22 : 23 : struct fd_banks_locks; 24 : typedef struct fd_banks_locks fd_banks_locks_t; 25 : 26 : struct fd_exec_instr_ctx; 27 : typedef struct fd_exec_instr_ctx fd_exec_instr_ctx_t; 28 : 29 : struct fd_acc_mgr; 30 : typedef struct fd_acc_mgr fd_acc_mgr_t; 31 : 32 : struct fd_capture_ctx; 33 : typedef struct fd_capture_ctx fd_capture_ctx_t; 34 : 35 : struct fd_borrowed_account; 36 : typedef struct fd_borrowed_account fd_borrowed_account_t; 37 : 38 : union fd_features; 39 : typedef union fd_features fd_features_t; 40 : 41 : struct fd_progcache; 42 : typedef struct fd_progcache fd_progcache_t; 43 : 44 : union fd_runtime_stack; 45 : typedef union fd_runtime_stack fd_runtime_stack_t; 46 : 47 : struct fd_runtime; 48 : typedef struct fd_runtime fd_runtime_t; 49 : 50 : struct fd_txn_in; 51 : typedef struct fd_txn_in fd_txn_in_t; 52 : 53 : struct fd_txn_out; 54 : typedef struct fd_txn_out fd_txn_out_t; 55 : 56 : struct fd_log_collector; 57 : typedef struct fd_log_collector fd_log_collector_t; 58 : 59 : struct fd_acc_pool; 60 : typedef struct fd_acc_pool fd_acc_pool_t; 61 : 62 : struct fd_genesis; 63 : typedef struct fd_genesis fd_genesis_t; 64 : 65 : struct fd_account_meta { 66 : uchar owner[32]; 67 : ulong lamports; 68 : ulong slot; 69 : uint dlen; 70 : uchar executable; 71 : uchar padding[3]; 72 : }; 73 : typedef struct fd_account_meta fd_account_meta_t; 74 : 75 : FD_FN_PURE static inline uchar * 76 1320 : fd_account_data( fd_account_meta_t const * acc ) { 77 1320 : return (uchar *)( acc+1 ); 78 1320 : } 79 : 80 : FD_PROTOTYPES_BEGIN 81 : 82 : /* fd_acct_addr_cstr converts the given Solana address into a base58- 83 : encoded cstr. Returns cstr. On return cstr contains a string with 84 : length in [32,44] (excluding NULL terminator). */ 85 : 86 : static inline char * 87 : fd_acct_addr_cstr( char cstr[ FD_BASE58_ENCODED_32_SZ ], 88 0 : uchar const addr[ 32 ] ) { 89 : return fd_base58_encode_32( addr, NULL, cstr ); 90 0 : } 91 : 92 : FD_PROTOTYPES_END 93 : 94 : #endif /* HEADER_fd_src_flamenco_fd_flamenco_base_h */