Line data Source code
1 : #ifndef HEADER_fd_src_discof_replay_fd_exec_h 2 : #define HEADER_fd_src_discof_replay_fd_exec_h 3 : 4 : #include "../../disco/fd_txn_p.h" 5 : #include "../../flamenco/fd_flamenco_base.h" 6 : #include "../../choreo/tower/fd_tower_serdes.h" 7 : 8 : /* Exec tile task types. */ 9 0 : #define FD_EXECRP_TT_TXN_EXEC (1UL) /* Transaction execution. */ 10 0 : #define FD_EXECRP_TT_TXN_SIGVERIFY (2UL) /* Transaction sigverify. */ 11 0 : #define FD_EXECRP_TT_POH_HASH (3UL) /* PoH hashing. */ 12 : 13 : /* Sent from the replay tile to the exec tiles. These describe one of 14 : several types of tasks for an exec tile. An idx to the bank in the 15 : bank pool must be sent over because the key of the bank will change 16 : as FEC sets are processed. */ 17 : 18 : struct fd_execrp_txn_exec_msg { 19 : ulong bank_idx; 20 : ulong txn_idx; 21 : fd_txn_p_t txn[ 1 ]; 22 : 23 : /* Used currently by solcap to maintain ordering of messages 24 : this will change to using txn sigs eventually */ 25 : ulong capture_txn_idx; 26 : 27 : /* FEC-set merkle root at dispatch time. */ 28 : uchar fec_merkle_root[ 32 ]; 29 : 30 : /* 0-indexed position of this transaction within its block. */ 31 : ulong index_in_slot; 32 : }; 33 : typedef struct fd_execrp_txn_exec_msg fd_execrp_txn_exec_msg_t; 34 : 35 : struct fd_execrp_txn_sigverify_msg { 36 : ulong bank_idx; 37 : ulong txn_idx; 38 : fd_txn_p_t txn[ 1 ]; 39 : }; 40 : typedef struct fd_execrp_txn_sigverify_msg fd_execrp_txn_sigverify_msg_t; 41 : 42 : struct fd_execrp_poh_hash_msg { 43 : ulong bank_idx; 44 : ulong mblk_idx; 45 : ulong hashcnt; 46 : fd_hash_t hash[ 1 ]; 47 : }; 48 : typedef struct fd_execrp_poh_hash_msg fd_execrp_poh_hash_msg_t; 49 : 50 : union fd_execrp_task_msg { 51 : fd_execrp_txn_exec_msg_t txn_exec; 52 : fd_execrp_txn_sigverify_msg_t txn_sigverify; 53 : fd_execrp_poh_hash_msg_t poh_hash; 54 : }; 55 : 56 : typedef union fd_execrp_task_msg fd_execrp_task_msg_t; 57 : 58 : /* Sent from exec tiles to the replay tile, notifying the replay tile 59 : that a task has been completed. That is, if the task has any 60 : observable side effects, such as updates to accounts, then those side 61 : effects are fully visible on any other exec tile. */ 62 : 63 : struct fd_execrp_txn_exec_done_msg { 64 : ulong txn_idx; 65 : 66 : /* These flags form a nested series of if statements. 67 : if( is_committable ) { 68 : if( is_fees_only ) { 69 : instructions will not be executed 70 : txn_err will be non-zero and will be one of the account loader errors 71 : } else { 72 : instructions will execute 73 : if( txn_err is non-zero ) { 74 : there's likely an instruction error 75 : } else { 76 : transaction executed successfully 77 : https://github.com/anza-xyz/agave/blob/v3.1.8/svm/src/transaction_execution_result.rs#L26 78 : } 79 : } 80 : } else { 81 : either failed before account loading, or failed cost tracker 82 : } 83 : */ 84 : int is_committable; 85 : int is_fees_only; 86 : int txn_err; 87 : 88 : /* used by monitoring tools */ 89 : ulong slot; 90 : ulong bank_seq; 91 : ushort start_shred_idx; 92 : ushort end_shred_idx; 93 : 94 : /* vote.slot==ULONG_MAX if this was not a vote transaction */ 95 : struct { 96 : ulong slot; 97 : ulong vote_slots[ 31UL ]; 98 : uchar vote_slot_cnt; 99 : fd_pubkey_t identity[ 1 ]; 100 : fd_pubkey_t vote_acct[ 1 ]; 101 : } vote; 102 : }; 103 : typedef struct fd_execrp_txn_exec_done_msg fd_execrp_txn_exec_done_msg_t; 104 : 105 : struct fd_execrp_txn_sigverify_done_msg { 106 : ulong txn_idx; 107 : int err; 108 : }; 109 : typedef struct fd_execrp_txn_sigverify_done_msg fd_execrp_txn_sigverify_done_msg_t; 110 : 111 : struct fd_execrp_poh_hash_done_msg { 112 : ulong mblk_idx; 113 : ulong hashcnt; 114 : fd_hash_t hash[ 1 ]; 115 : }; 116 : typedef struct fd_execrp_poh_hash_done_msg fd_execrp_poh_hash_done_msg_t; 117 : 118 : struct fd_execrp_task_done_msg { 119 : ulong bank_idx; 120 : union { 121 : fd_execrp_txn_exec_done_msg_t txn_exec[ 1 ]; 122 : fd_execrp_txn_sigverify_done_msg_t txn_sigverify[ 1 ]; 123 : fd_execrp_poh_hash_done_msg_t poh_hash[ 1 ]; 124 : }; 125 : }; 126 : typedef struct fd_execrp_task_done_msg fd_execrp_task_done_msg_t; 127 : 128 : #endif /* HEADER_fd_src_discof_replay_fd_execrp_h */