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