1010 important in two contexts:
1111
1212 1. When becoming leader, we need to check that our "previous"
13- leader block _as of_ the parent slot we're building on, has
14- propagated. If it's not propagated, we need to instead
15- retransmit our last block that failed to propagate. "Previous"
16- is quoted, because there is a grace period of one leader
17- rotation for leader blocks to propagate.
13+ leader block _as of_ the parent slot we're building on, has
14+ propagated. If it's not propagated, we need to instead
15+ retransmit our last block that failed to propagate. "Previous"
16+ is quoted, because there is a grace period of one leader
17+ rotation for leader blocks to propagate.
1818
1919 2. When voting, we need to check our previous leader block _as of_
20- the slot we're voting for has propagated (unless we're voting
21- for one of our leader blocks). We cannot vote for slots in
22- which our last leader block failed to propagate.
20+ the slot we're voting for has propagated (unless we're voting
21+ for one of our leader blocks). We cannot vote for slots in
22+ which our last leader block failed to propagate.
2323
2424 - duplicate confirmed: a block is duplicate confirmed if it has
2525 received votes from at least 52% of stake in the cluster. The
8585#define FD_NOTAR_PARANOID 1
8686#endif
8787
88+ #define FD_NOTAR_FLAG_CONFIRMED_PROPAGATED (0)
89+ #define FD_NOTAR_FLAG_CONFIRMED_DUPLICATE (1)
90+ #define FD_NOTAR_FLAG_CONFIRMED_OPTIMISTIC (2)
91+
8892#define SET_NAME fd_notar_slot_vtrs
8993#define SET_MAX FD_VOTER_MAX
9094#include "../../util/tmpl/fd_set.c"
@@ -95,7 +99,7 @@ struct fd_notar_slot {
9599 ulong prev_leader_slot ; /* previous slot in which we were leader */
96100 ulong stake ; /* amount of stake that has voted for this slot */
97101 int is_leader ; /* whether this slot was our own leader slot */
98- int is_propagated ; /* whether this slot has reached 33% of stake */
102+ int is_propagated ; /* whether this slot has reached 1/3 of stake */
99103
100104 fd_hash_t block_ids [FD_VOTER_MAX ]; /* one block id per voter per slot */
101105 ulong block_ids_cnt ; /* count of block ids */
@@ -105,13 +109,13 @@ struct fd_notar_slot {
105109};
106110typedef struct fd_notar_slot fd_notar_slot_t ;
107111
108-
109112struct fd_notar_blk {
110113 fd_hash_t block_id ; /* map key */
111114 uint hash ; /* reserved for fd_map_dynamic */
112115 ulong slot ; /* slot associated with this block */
113116 ulong stake ; /* sum of stake that has voted for this block_id */
114117 int dup_conf ; /* whether this block has reached 52% of stake */
118+ int opt_conf ; /* whether this block has reached 2/3 of stake */
115119};
116120typedef struct fd_notar_blk fd_notar_blk_t ;
117121
@@ -161,7 +165,7 @@ struct __attribute__((aligned(128UL))) fd_notar {
161165 ulong epoch ; /* highest replayed epoch */
162166 ulong lo_wmark ; /* notar ignores votes < lo_wmark */
163167 ulong hi_wmark ; /* notar ignores votes > hi_wmark */
164- ulong slot_max ; /* maximum slot number */
168+ ulong slot_max ; /* maximum number of slots notar can track */
165169
166170 fd_notar_slot_t * slot_map ; /* tracks who has voted for a given slot */
167171 fd_notar_blk_t * blk_map ; /* tracks amount of stake for a given block (keyed by block id) */
@@ -237,7 +241,7 @@ fd_notar_delete( void * notar );
237241 account in the current epoch, slot is slot being voted for, block_id
238242 is the voter's proposed block id for this vote slot. */
239243
240- int
244+ fd_notar_blk_t *
241245fd_notar_count_vote ( fd_notar_t * notar ,
242246 ulong total_stake ,
243247 fd_pubkey_t const * addr ,
0 commit comments