Line data Source code
1 : #ifndef HEADER_fd_src_disco_plugin_fd_plugin_h 2 : #define HEADER_fd_src_disco_plugin_fd_plugin_h 3 : 4 0 : #define FD_PLUGIN_MSG_SLOT_ROOTED ( 0UL) 5 0 : #define FD_PLUGIN_MSG_SLOT_OPTIMISTICALLY_CONFIRMED ( 1UL) 6 0 : #define FD_PLUGIN_MSG_SLOT_COMPLETED ( 2UL) 7 0 : #define FD_PLUGIN_MSG_SLOT_ESTIMATED ( 3UL) 8 0 : #define FD_PLUGIN_MSG_GOSSIP_UPDATE ( 4UL) 9 0 : #define FD_PLUGIN_MSG_VOTE_ACCOUNT_UPDATE ( 5UL) 10 0 : #define FD_PLUGIN_MSG_LEADER_SCHEDULE ( 6UL) 11 0 : #define FD_PLUGIN_MSG_VALIDATOR_INFO ( 7UL) 12 0 : #define FD_PLUGIN_MSG_SLOT_START ( 8UL) 13 : 14 : typedef struct { 15 : ulong slot; 16 : ulong parent_slot; 17 : } fd_plugin_msg_slot_start_t; 18 : 19 0 : #define FD_PLUGIN_MSG_SLOT_END ( 9UL) 20 : 21 : typedef struct { 22 : ulong slot; 23 : ulong cus_used; 24 : } fd_plugin_msg_slot_end_t; 25 : 26 0 : #define FD_PLUGIN_MSG_SLOT_RESET (10UL) 27 0 : #define FD_PLUGIN_MSG_BALANCE (11UL) 28 0 : #define FD_PLUGIN_MSG_START_PROGRESS (12UL) 29 0 : #define FD_PLUGIN_MSG_GENESIS_HASH_KNOWN (13UL) 30 : 31 : struct __attribute__((packed, aligned(8))) fd_replay_complete_msg { 32 : ulong slot; 33 : ulong total_txn_count; 34 : ulong nonvote_txn_count; 35 : ulong failed_txn_count; 36 : ulong nonvote_failed_txn_count; 37 : ulong compute_units; 38 : ulong transaction_fee; 39 : ulong priority_fee; 40 : ulong parent_slot; 41 : }; 42 : typedef struct fd_replay_complete_msg fd_replay_complete_msg_t; 43 : 44 0 : #define FD_CLUSTER_NODE_CNT (200U*201U - 1U) 45 : /* TODO: this needs to be bumped to 13, but that would break 46 : fd_gui_handle_gossip_update */ 47 0 : #define FD_GOSSIP_UPDATE_MSG_NUM_SOCKETS (12U) 48 0 : #define FD_GOSSIP_LINK_MSG_SIZE (58U + FD_GOSSIP_UPDATE_MSG_NUM_SOCKETS * 6U) 49 : #define FD_VALIDATOR_INFO_MSG_SIZE ( 608U) 50 : 51 : struct __attribute__((packed)) fd_gossip_update_msg { 52 : uchar pubkey[32]; // 0..31 53 : ulong wallclock; // 32..39 54 : ushort shred_version; // 40..41 55 : uchar version_type; // 42 56 : ushort version_major; // 43..44 57 : ushort version_minor; // 45..46 58 : ushort version_patch; // 47..48 59 : uchar version_commit_type; // 49 60 : uint version_commit; // 50..53 61 : uint version_feature_set; // 54..57 62 : /* gossip_socket, 63 : rpc_socket, 64 : rpc_pubsub_socket, 65 : serve_repair_socket_udp, 66 : serve_repair_socket_quic, 67 : tpu_socket_udp, 68 : tpu_socket_quic, 69 : tvu_socket_udp, 70 : tvu_socket_quic, 71 : tpu_forwards_socket_udp, 72 : tpu_forwards_socket_quic, 73 : tpu_vote_socket, */ 74 : struct __attribute__((packed)) { 75 : uint ip; // 0..3 76 : ushort port; // 4..5 77 : } addrs[FD_GOSSIP_UPDATE_MSG_NUM_SOCKETS]; 78 : }; 79 : typedef struct fd_gossip_update_msg fd_gossip_update_msg_t; 80 : 81 : FD_STATIC_ASSERT( sizeof(fd_gossip_update_msg_t) == FD_GOSSIP_LINK_MSG_SIZE, fd_gossip_update_msg ); 82 : 83 : struct __attribute__((packed)) fd_vote_update_msg { 84 : uchar vote_pubkey[32]; // 0..31 85 : uchar node_pubkey[32]; // 32..63 86 : ulong activated_stake; // 64..71 87 : ulong last_vote; // 72..79 88 : ulong root_slot; // 80..87 89 : ulong epoch_credits; // 88..95 90 : uchar commission; // 96 91 : uchar is_delinquent; // 97 92 : }; 93 : typedef struct fd_vote_update_msg fd_vote_update_msg_t; 94 : 95 : FD_STATIC_ASSERT( sizeof(fd_vote_update_msg_t) <= FD_GOSSIP_LINK_MSG_SIZE, fd_vote_update_msg ); 96 : 97 0 : #define FD_PLUGIN_MSG_BLOCK_ENGINE_UPDATE (14UL) 98 : 99 0 : #define FD_PLUGIN_MSG_BLOCK_ENGINE_UPDATE_STATUS_DISCONNECTED (0) 100 0 : #define FD_PLUGIN_MSG_BLOCK_ENGINE_UPDATE_STATUS_CONNECTING (1) 101 0 : #define FD_PLUGIN_MSG_BLOCK_ENGINE_UPDATE_STATUS_CONNECTED (2) 102 : 103 : typedef struct { 104 : char name[ 16 ]; 105 : char url[ 256 ]; 106 : char ip_cstr[ 40 ]; /* IPv4 or IPv6 cstr */ 107 : int status; 108 : } fd_plugin_msg_block_engine_update_t; 109 : 110 : #endif /* HEADER_fd_src_disco_plugin_fd_plugin_h */