Line data Source code
1 : #ifndef HEADER_fd_src_discof_replay_fd_replay_tile_h 2 : #define HEADER_fd_src_discof_replay_fd_replay_tile_h 3 : 4 : #include "../poh/fd_poh_tile.h" 5 : #include "../../disco/tiles.h" 6 : #include "../../flamenco/types/fd_types_custom.h" 7 : 8 0 : #define REPLAY_SIG_SLOT_COMPLETED (0) 9 0 : #define REPLAY_SIG_ROOT_ADVANCED (1) 10 0 : #define REPLAY_SIG_VOTE_STATE (2) 11 0 : #define REPLAY_SIG_RESET (3) 12 0 : #define REPLAY_SIG_BECAME_LEADER (4) 13 : 14 : struct fd_replay_slot_completed { 15 : ulong slot; 16 : ulong root_slot; 17 : ulong epoch; 18 : ulong slot_in_epoch; 19 : ulong block_height; 20 : ulong parent_slot; 21 : 22 : fd_hash_t block_id; /* block id (last FEC set's merkle root) of the slot received from replay */ 23 : fd_hash_t parent_block_id; /* parent block id of the slot received from replay */ 24 : fd_hash_t bank_hash; /* bank hash of the slot received from replay */ 25 : fd_hash_t block_hash; /* last microblock header hash of slot received from replay */ 26 : 27 : ulong transaction_count; 28 : ulong nonvote_txn_count; 29 : ulong failed_txn_count; 30 : ulong nonvote_failed_txn_count; 31 : ulong max_compute_units; 32 : ulong total_compute_units_used; 33 : ulong execution_fees; 34 : ulong priority_fees; 35 : ulong tips; 36 : ulong shred_count; 37 : 38 : long first_fec_set_received_nanos; /* timestamp when replay received the first fec of the slot from turbine or repair */ 39 : long preparation_begin_nanos; /* timestamp when replay began preparing the state to begin execution of the slot */ 40 : long first_transaction_scheduled_nanos; /* timestamp when replay first sent a transaction to be executed */ 41 : long last_transaction_finished_nanos; /* timestamp when replay received the last execution completion */ 42 : long completion_time_nanos; /* timestamp when replay completed finalizing the slot and notified tower */ 43 : }; 44 : 45 : typedef struct fd_replay_slot_completed fd_replay_slot_completed_t; 46 : 47 : struct fd_replay_root_advanced { 48 : ulong bank_idx; 49 : }; 50 : 51 : typedef struct fd_replay_root_advanced fd_replay_root_advanced_t; 52 : 53 : /* The replay tile currently, on slot replay completion, sends vote 54 : states from the completed bank to the Tower tile so it can determine 55 : how to vote or advance consensus. There are limits on the amount of 56 : data that can be sent over. TODO: merge Tower & Replay tiles to 57 : remove this. */ 58 : 59 0 : #define FD_REPLAY_TOWER_VOTE_ACC_MAX (4096UL) 60 : #define FD_REPLAY_TOWER_ACC_DATA_MAX (4096UL) 61 : 62 : /* The minimal information Tower needs about a vote account at the end of a slot */ 63 : struct fd_replay_tower { 64 : fd_pubkey_t key; 65 : 66 : ulong stake; 67 : 68 : uchar acc[ FD_REPLAY_TOWER_ACC_DATA_MAX ]; 69 : ulong acc_sz; 70 : }; 71 : 72 : typedef struct fd_replay_tower fd_replay_tower_t; 73 : 74 : union fd_replay_message { 75 : fd_replay_slot_completed_t slot_completed; 76 : fd_replay_root_advanced_t root_advanced; 77 : fd_poh_reset_t reset; 78 : fd_became_leader_t became_leader; 79 : fd_replay_tower_t tower; 80 : }; 81 : 82 : typedef union fd_replay_message fd_replay_message_t; 83 : 84 : #endif /* HEADER_fd_src_discof_replay_fd_replay_tile_h */