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_SLOT_DEAD (1) 10 0 : #define REPLAY_SIG_ROOT_ADVANCED (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 storage_slot; 18 : ulong epoch; 19 : ulong slot_in_epoch; 20 : ulong block_height; 21 : ulong parent_slot; 22 : 23 : fd_hash_t block_id; /* block id (last FEC set's merkle root) of the slot received from replay */ 24 : fd_hash_t parent_block_id; /* parent block id of the slot received from replay */ 25 : fd_hash_t bank_hash; /* bank hash of the slot received from replay */ 26 : fd_hash_t block_hash; /* last microblock header hash of slot received from replay */ 27 : 28 : ulong transaction_count; 29 : 30 : struct { 31 : double initial; 32 : double terminal; 33 : double taper; 34 : double foundation; 35 : double foundation_term; 36 : } inflation; 37 : 38 : struct { 39 : ulong lamports_per_uint8_year; 40 : double exemption_threshold; 41 : uchar burn_percent; 42 : } rent; 43 : 44 : /* Reference to the bank for this completed slot. TODO: We can 45 : eliminate non-timestamp fields and have consumers just use 46 : bank_idx. */ 47 : ulong bank_idx; 48 : ulong parent_bank_idx; /* ULONG_MAX if unavailable */ 49 : 50 : long first_fec_set_received_nanos; /* timestamp when replay received the first fec of the slot from turbine or repair */ 51 : long preparation_begin_nanos; /* timestamp when replay began preparing the state to begin execution of the slot */ 52 : long first_transaction_scheduled_nanos; /* timestamp when replay first sent a transaction to be executed */ 53 : long last_transaction_finished_nanos; /* timestamp when replay received the last execution completion */ 54 : long completion_time_nanos; /* timestamp when replay completed finalizing the slot and notified tower */ 55 : 56 : int is_leader; /* whether we were leader for this slot */ 57 : ulong identity_balance; 58 : 59 : struct { 60 : ulong block_cost; 61 : ulong vote_cost; 62 : ulong allocated_accounts_data_size; 63 : ulong block_cost_limit; 64 : ulong vote_cost_limit; 65 : ulong account_cost_limit; 66 : } cost_tracker; 67 : }; 68 : 69 : typedef struct fd_replay_slot_completed fd_replay_slot_completed_t; 70 : 71 : struct fd_replay_slot_dead { 72 : ulong slot; 73 : fd_hash_t block_id; 74 : }; 75 : typedef struct fd_replay_slot_dead fd_replay_slot_dead_t; 76 : 77 : struct fd_replay_root_advanced { 78 : ulong bank_idx; 79 : }; 80 : 81 : typedef struct fd_replay_root_advanced fd_replay_root_advanced_t; 82 : 83 : union fd_replay_message { 84 : fd_replay_slot_completed_t slot_completed; 85 : fd_replay_root_advanced_t root_advanced; 86 : fd_poh_reset_t reset; 87 : fd_became_leader_t became_leader; 88 : }; 89 : 90 : typedef union fd_replay_message fd_replay_message_t; 91 : 92 : #endif /* HEADER_fd_src_discof_replay_fd_replay_tile_h */