Line data Source code
1 : #ifndef HEADER_fd_src_disco_shred_fd_fec_set_h 2 : #define HEADER_fd_src_disco_shred_fd_fec_set_h 3 : 4 : #include "../../ballet/shred/fd_shred.h" 5 : #include "../../tango/fd_tango_base.h" 6 : 7 14176347 : #define FD_FEC_SHRED_CNT 32 8 : 9 : /* Maximum number of FECs in a slot is max number of shreds in a slot / 32 shreds per FEC */ 10 6729 : #define FD_FEC_BLK_MAX (FD_SHRED_BLK_MAX / FD_FEC_SHRED_CNT) 11 : 12 : /* When using Merkle shreds, an FEC set is essentially the transmission 13 : granularity. Each FEC set has likely dozens of packets, but you have 14 : to construct the entire FEC set before you can send the first byte. 15 : Similarly, on the receive side, in order to validate an FEC set, you 16 : have to receive or reconstruct the whole thing. */ 17 : 18 : struct __attribute__((aligned(FD_CHUNK_ALIGN))) fd_fec_set { 19 : /* Compact bitset of whether we've received the shred or not. */ 20 : uint data_shred_rcvd; 21 : uint parity_shred_rcvd; 22 : ulong turbine_shred_rcvd; 23 : ulong repair_shred_rcvd; 24 : 25 : union { 26 : fd_shred_t s[ 1 ]; 27 : uchar b[ FD_SHRED_MIN_SZ ]; /* data shreds never exceed min_sz */ 28 : } data_shreds[ FD_FEC_SHRED_CNT ]; 29 : union { 30 : fd_shred_t s[ 1 ]; 31 : uchar b[ FD_SHRED_MAX_SZ ]; 32 : } parity_shreds[ FD_FEC_SHRED_CNT ]; 33 : 34 : /* Only relevant for Frankendancer shred_store link. When the 35 : shred tile publishes a leader FEC set to the store tile, it 36 : sets leader_bank and merkle_root which the store tile uses 37 : to set the block_id. For network-produced FEC sets and for 38 : the Firedancer store path, leader_bank is NULL and merkle_root 39 : is undefined. */ 40 : void const * leader_bank; 41 : uchar merkle_root[ 32 ]; 42 : }; 43 : typedef struct fd_fec_set fd_fec_set_t; 44 : 45 : #endif /* HEADER_fd_src_disco_shred_fd_fec_set_h */