Line data Source code
1 : #ifndef HEADER_fd_src_discof_repair_fd_repair_tile_h 2 : #define HEADER_fd_src_discof_repair_fd_repair_tile_h 3 : 4 : #include "../../disco/tiles.h" 5 : #include "../../disco/shred/fd_shred_tile.h" 6 : 7 : /* Repair tile forwards all FEC completes received by the shred tile. 8 : It forwards the FEC completes with new sigs: 9 : - REPAIR_SIG_FEC: FEC set complete 10 : - REPAIR_SIG_FEC_LEADER: Leader FEC set complete 11 : - REPAIR_SIG_FEC_INVALID: FEC set detected as invalid based on duplicate confirmations 12 : 13 : Note that invalidity is very strict. i.e., sometimes replay may not 14 : want FEC set at the root / or older than the root to be inserted. 15 : Repair should still forward these as REPAIR_SIG_FEC, because they are 16 : FEC sets that are either valid, or cannot be verified as invalid. 17 : Similarly, repair may have received two versions of one FEC, but is 18 : unsure which one is canonical. These are also forwarded as 19 : REPAIR_SIG_FEC. It's up to replay tile to arbitrate whether to insert 20 : these FEC sets. 21 : 22 : A FEC set forwarded as REPAIR_SIG_FEC_INVALID is with confidence 23 : guaranteed to be not part of the canonical chain. */ 24 : 25 : struct fd_fec_complete_metrics { 26 : uint stats_valid; /* 1 if the forest still tracked the block and the blk_* stats are filled */ 27 : uint blk_turbine_cnt; /* block: shreds received via turbine */ 28 : uint blk_repair_cnt; /* block: data shreds received via repair */ 29 : uint blk_recovered_cnt; /* block: shreds recovered via reed-solomon */ 30 : uint blk_data_cnt; /* block: data shreds received so far (reaches complete_idx+1 once the slot is fully buffered) */ 31 : uint blk_parity_cnt; /* block: coding (parity) shreds received so far */ 32 : uint blk_lowest_verified_fec; /* block: lowest verified FEC index, UINT_MAX if none */ 33 : uchar blk_chain_confirmed; /* block: 1 if the whole chain has been merkle-verified */ 34 : uchar blk_slot_complete; /* block: 1 if the slot-complete shred has been received */ 35 : 36 : uint blk_req_window_cnt; /* block: window (specific-shred) repair requests sent */ 37 : uint blk_req_highest_cnt; /* block: highest-window repair requests sent */ 38 : uint blk_req_orphan_cnt; /* block: orphan repair requests sent */ 39 : uint blk_req_retransmit_cnt; /* block: repair requests re-sent after a response timeout */ 40 : uint blk_repair_responses; /* block: repair responses received */ 41 : uchar blk_chain_verify_failed; /* block: 1 if merkle chain verification flagged this block bad */ 42 : 43 : ulong fec_completed_ts_nanos; 44 : 45 : ulong blk_first_shred_ts_nanos; /* when the first shred of the slot arrived */ 46 : ulong blk_last_shred_ts_nanos; /* when the slot became fully buffered */ 47 : ulong blk_first_req_ts_nanos; /* when the first repair request for the slot was sent */ 48 : ulong blk_last_repair_resp_ts_nanos; /* when the most recent repair response for the slot arrived */ 49 : }; 50 : typedef struct fd_fec_complete_metrics fd_fec_complete_metrics_t; 51 : 52 : struct fd_repair_fec_complete { 53 : fd_fec_complete_t fec; 54 : fd_fec_complete_metrics_t metrics; 55 : }; 56 : typedef struct fd_repair_fec_complete fd_repair_fec_complete_t; 57 : 58 0 : #define REPAIR_SIG_FEC (0UL) /* FEC set complete */ 59 0 : #define REPAIR_SIG_FEC_LEADER (1UL) /* Leader FEC set complete */ 60 0 : #define REPAIR_SIG_FEC_INVALID (2UL) /* FEC set detected as invalid based on duplicate confirmations */ 61 : 62 : #endif /* HEADER_fd_src_discof_repair_fd_repair_tile_h */