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 "../../flamenco/types/fd_types_custom.h" 5 : 6 0 : #define REPLAY_SIG_SLOT_COMPLETED (0) 7 0 : #define REPLAY_SIG_ROOT_ADVANCED (1) 8 0 : #define REPLAY_SIG_VOTE_STATE (2) 9 : 10 : struct fd_replay_slot_completed { 11 : ulong slot; 12 : ulong root_slot; 13 : ulong epoch; 14 : ulong slot_in_epoch; 15 : ulong block_height; 16 : ulong parent_slot; 17 : 18 : long completion_time_nanos; 19 : 20 : fd_hash_t block_id; /* block id (last FEC set's merkle root) of the slot received from replay */ 21 : fd_hash_t parent_block_id; /* parent block id of the slot received from replay */ 22 : fd_hash_t bank_hash; /* bank hash of the slot received from replay */ 23 : fd_hash_t block_hash; /* last microblock header hash of slot received from replay */ 24 : 25 : ulong transaction_count; 26 : ulong shred_count; 27 : }; 28 : 29 : typedef struct fd_replay_slot_completed fd_replay_slot_completed_t; 30 : 31 : struct fd_replay_root_advanced { 32 : ulong bank_idx; 33 : }; 34 : 35 : typedef struct fd_replay_root_advanced fd_replay_root_advanced_t; 36 : 37 : /* The replay tile currently, on slot replay completion, sends vote 38 : states from the completed bank to the Tower tile so it can determine 39 : how to vote or advance consensus. There are limits on the amount of 40 : data that can be sent over. TODO: merge Tower & Replay tiles to 41 : remove this. */ 42 : 43 0 : #define FD_REPLAY_TOWER_VOTE_ACC_MAX (4096UL) 44 : #define FD_REPLAY_TOWER_ACC_DATA_MAX (4096UL) 45 : 46 : /* The minimal information Tower needs about a vote account at the end of a slot */ 47 : struct fd_replay_tower { 48 : fd_pubkey_t key; 49 : 50 : ulong stake; 51 : 52 : uchar acc[ FD_REPLAY_TOWER_ACC_DATA_MAX ]; 53 : ulong acc_sz; 54 : }; 55 : 56 : typedef struct fd_replay_tower fd_replay_tower_t; 57 : 58 : union fd_replay_message { 59 : fd_replay_slot_completed_t slot_completed; 60 : fd_replay_root_advanced_t root_advanced; 61 : fd_replay_tower_t tower; 62 : }; 63 : 64 : typedef union fd_replay_message fd_replay_message_t; 65 : 66 : #endif /* HEADER_fd_src_discof_replay_fd_replay_tile_h */