Line data Source code
1 : #ifndef HEADER_fd_src_flamenco_leaders_fd_leaders_base_h 2 : #define HEADER_fd_src_flamenco_leaders_fd_leaders_base_h 3 : 4 : #include "../types/fd_types_custom.h" 5 : 6 : #define MAX_SLOTS_PER_EPOCH 432000UL 7 : #define MAX_PUB_CNT 50000UL 8 241632 : #define MAX_STAKED_LEADERS 40200UL 9 : 10 : /* Follows message structure in fd_stake_ci_stake_msg_init */ 11 : struct fd_stake_weight_msg_t { 12 : ulong epoch; /* Epoch for which the stake weights are valid */ 13 : ulong staked_cnt; /* Number of staked nodes */ 14 : ulong start_slot; /* Start slot of the epoch */ 15 : ulong slot_cnt; /* Number of slots in the epoch */ 16 : ulong excluded_stake; /* Total stake that is excluded from leader selection */ 17 : ulong vote_keyed_lsched; /* 1=use vote-keyed leader schedule, 0=use old leader schedule */ 18 : fd_vote_stake_weight_t weights[]; /* Stake weights for each staked node */ 19 : }; 20 : typedef struct fd_stake_weight_msg_t fd_stake_weight_msg_t; 21 : 22 0 : #define FD_STAKE_CI_STAKE_MSG_HEADER_SZ (sizeof(fd_stake_weight_msg_t)) 23 0 : #define FD_STAKE_CI_STAKE_MSG_RECORD_SZ (sizeof(fd_vote_stake_weight_t)) 24 0 : #define FD_STAKE_CI_STAKE_MSG_SZ (FD_STAKE_CI_STAKE_MSG_HEADER_SZ + MAX_STAKED_LEADERS * FD_STAKE_CI_STAKE_MSG_RECORD_SZ) 25 : 26 0 : #define FD_STAKE_OUT_MTU FD_STAKE_CI_STAKE_MSG_SZ 27 : 28 0 : static inline ulong fd_stake_weight_msg_sz( ulong cnt ) { 29 0 : return FD_STAKE_CI_STAKE_MSG_HEADER_SZ + cnt * FD_STAKE_CI_STAKE_MSG_RECORD_SZ; 30 0 : } 31 : 32 : #endif /* HEADER_fd_src_flamenco_leaders_fd_leaders_base_h */