Line data Source code
1 : #ifndef HEADER_fd_src_discof_poh_fd_poh_h 2 : #define HEADER_fd_src_discof_poh_fd_poh_h 3 : 4 : #include "../../disco/pack/fd_pack.h" 5 : 6 : /* The maximum number of microblocks pack may put in a slot. This is 7 : not consensus critical; Alpenglow has one tick per block, so there 8 : is no hash budget bounding microblocks and pack is given this fixed 9 : budget instead. */ 10 0 : #define FD_POH_ALPENGLOW_MAX_MICROBLOCKS_PER_SLOT (131072UL) 11 : 12 : /* Per-transaction lifecycle timing for a leader block, captured by poh 13 : in mix order for telemetry purposes. The records are stored in a 14 : shared txn_timing[] array. */ 15 : 16 : struct fd_leader_txn_timing_rec { 17 : long received_ns; 18 : long dispatched_ticks; 19 : long replayed_ticks; 20 : long poh_mixed_ticks; 21 : }; 22 : 23 : typedef struct fd_leader_txn_timing_rec fd_leader_txn_timing_rec_t; 24 : 25 : FD_STATIC_ASSERT( sizeof(fd_leader_txn_timing_rec_t)==32UL, leader_txn_timing_rec ); 26 : 27 : /* The ldr_tt object holds FD_LEADER_TXN_TIMING_TABLE_CNT tables back to 28 : back, each with room for config->limits.max_txn_per_slot records, so 29 : the table stride is a runtime value: index them with 30 : fd_leader_txn_timing_table(). */ 31 : 32 : struct fd_leader_txn_timing_table { 33 : ulong slot; 34 : ulong cnt; 35 : fd_leader_txn_timing_rec_t rec[]; /* max_txn_per_slot */ 36 : }; 37 : 38 : typedef struct fd_leader_txn_timing_table fd_leader_txn_timing_table_t; 39 : 40 0 : #define FD_LEADER_TXN_TIMING_TABLE_CNT (2UL) 41 : 42 : FD_FN_CONST static inline ulong 43 0 : fd_leader_txn_timing_table_footprint( ulong max_txn_per_slot ) { 44 0 : return sizeof(fd_leader_txn_timing_table_t)+max_txn_per_slot*sizeof(fd_leader_txn_timing_rec_t); 45 0 : } 46 : 47 : FD_FN_CONST static inline fd_leader_txn_timing_table_t const * 48 : fd_leader_txn_timing_table_const( fd_leader_txn_timing_table_t const * tables, 49 : ulong idx, 50 0 : ulong max_txn_per_slot ) { 51 0 : return (fd_leader_txn_timing_table_t const *)( (uchar const *)tables + idx*fd_leader_txn_timing_table_footprint( max_txn_per_slot ) ); 52 0 : } 53 : 54 : FD_FN_CONST static inline fd_leader_txn_timing_table_t * 55 : fd_leader_txn_timing_table( fd_leader_txn_timing_table_t * tables, 56 : ulong idx, 57 0 : ulong max_txn_per_slot ) { 58 0 : return (fd_leader_txn_timing_table_t *)fd_leader_txn_timing_table_const( tables, idx, max_txn_per_slot ); 59 0 : } 60 : 61 : struct fd_poh_leader_slot_ended { 62 : int completed; 63 : ulong slot; 64 : uchar blockhash[ 32UL ]; 65 : 66 : ulong timing_table_idx; 67 : 68 : ulong microblock_count; 69 : ulong pack_block_cost; 70 : ulong pack_data_bytes; 71 : ulong bundle_txn_count; 72 : int pack_end_reason; 73 : long pack_start_ns; 74 : long pack_end_ns; 75 : }; 76 : 77 : typedef struct fd_poh_leader_slot_ended fd_poh_leader_slot_ended_t; 78 : 79 : struct fd_poh_out_private { 80 : ulong idx; 81 : fd_wksp_t * mem; 82 : ulong chunk0; 83 : ulong wmark; 84 : ulong chunk; 85 : }; 86 : 87 : typedef struct fd_poh_out_private fd_poh_out_t; 88 : 89 : #endif /* HEADER_fd_src_discof_poh_fd_poh_h */