Line data Source code
1 : #ifndef HEADER_fd_src_disco_fd_txn_p_h 2 : #define HEADER_fd_src_disco_fd_txn_p_h 3 : 4 : #include "../ballet/txn/fd_txn.h" 5 : 6 : struct __attribute__((aligned(64))) fd_txn_p { 7 : uchar payload[FD_TPU_MTU]; 8 : 9 : /* Keep metadata within 40 bytes so fd_txn_p_t fits in 4992 bytes. */ 10 : 11 : /* Size of payload in bytes, at most FD_TPU_MTU. */ 12 : ushort payload_sz; 13 : 14 : /* Source ipv4 address and tpu pipeline for this transaction. TPU is 15 : one of FD_TXN_M_TPU_SOURCE_* */ 16 : uchar source_tpu; 17 : uint source_ipv4; 18 : 19 : union { 20 : struct { 21 : uint non_execution_cus; 22 : uint requested_exec_plus_acct_data_cus; 23 : } pack_cu; /* Populated by pack. Execle reads these to populate the other struct of the union. */ 24 : struct { 25 : uint rebated_cus; /* requested_exec_plus_acct_data_cus-actual used CUs. Pack reads this for CU rebating. */ 26 : uint actual_consumed_cus; /* non_execution_cus+real execution CUs+real account data cus. PoH reads this for block CU counting. */ 27 : } execle_cu; /* Populated by execle. */ 28 : ulong blockhash_slot; /* Slot provided by resolv tile when txn arrives at the pack tile. Used when txn is in extra storage in pack. */ 29 : }; 30 : /* Wallclock nanoseconds at which the transaction arrived to the pack tile. Set by pack and intended to be read from a transaction on a pack->execle link. */ 31 : long scheduler_arrival_time_nanos; 32 : 33 : /* Wallclock nanoseconds at which the validator first saw the 34 : transaction. */ 35 : long first_seen_nanos; 36 : 37 : union { 38 : struct { 39 : /* set by replay scheduler for use by monitoring tools */ 40 : ushort start_shred_idx; /* the shred index of the shred containing the first byte of this transaction */ 41 : ushort end_shred_idx; /* the shred index of the shred containing the byte after the last byte of this transaction, capped at the maximum shred index for this block */ 42 : }; 43 : /* pack populates pack_alloc based on an estimate of how many bytes 44 : of account data the transaction may allocate. There should be a 45 : field called rebate_alloc, similar to the CU variables, but 46 : actually the rebated alloc bytes don't really depend on 47 : execution. */ 48 : uint pack_alloc; 49 : }; 50 : 51 : /* Populated by pack, execle. A combination of the bitfields 52 : FD_TXN_P_FLAGS_* defined above. The execle sets the high byte with 53 : the transaction result code. */ 54 : uint flags; 55 : /* union { 56 : This would be ideal but doesn't work because of the flexible array member 57 : uchar _[FD_TXN_MAX_SZ]; 58 : fd_txn_t txn; 59 : }; */ 60 : /* Access with TXN macro below */ 61 : uchar _[FD_TXN_MAX_SZ] __attribute__((aligned(alignof(fd_txn_t)))); 62 : }; 63 : 64 : typedef struct fd_txn_p fd_txn_p_t; 65 : 66 : FD_STATIC_ASSERT( FD_TPU_MTU<=USHORT_MAX, fd_txn_p_payload_sz ); 67 : FD_STATIC_ASSERT( sizeof(fd_txn_p_t)==4992UL, fd_txn_p_layout ); 68 : 69 428853 : #define TXN(txn_p) ((fd_txn_t *)( (txn_p)->_ )) 70 : 71 : /* fd_txn_e_t: An fd_txn_p_t with expanded address lookup tables */ 72 : struct __attribute__((aligned(64))) fd_txn_e { 73 : fd_txn_p_t txnp[1]; 74 : fd_acct_addr_t alt_accts[FD_TXN_ACCT_ADDR_MAX]; /* The used account is in the fd_txn_t*/ 75 : }; 76 : 77 : typedef struct fd_txn_e fd_txn_e_t; 78 : 79 : #endif /* HEADER_fd_src_disco_fd_txn_p_h */