Skip to content

Commit dc1bcd5

Browse files
voter: init poh_slot from repair (tmp)
1 parent 68d5582 commit dc1bcd5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/discof/repair/fd_repair_tile.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ struct fd_repair_tile_ctx {
177177
fd_blockstore_t * blockstore;
178178

179179
fd_keyguard_client_t keyguard_client[1];
180+
181+
ulong * current_slot;
180182
};
181183
typedef struct fd_repair_tile_ctx fd_repair_tile_ctx_t;
182184

@@ -920,6 +922,9 @@ after_frag( fd_repair_tile_ctx_t * ctx,
920922
}
921923

922924
fd_shred_t * shred = (fd_shred_t *)fd_type_pun( ctx->buffer );
925+
if( fd_fseq_query( ctx->current_slot ) == ULONG_MAX ) {
926+
fd_fseq_update( ctx->current_slot, shred->slot );
927+
}
923928
if( FD_UNLIKELY( shred->slot <= fd_forest_root_slot( ctx->forest ) ) ) return; /* shred too old */
924929

925930
// FD_LOG_NOTICE(( "shred %lu %u", shred->slot, shred->idx ));
@@ -1439,6 +1444,13 @@ unprivileged_init( fd_topo_t * topo,
14391444

14401445
fd_repair_update_addr( ctx->repair, &ctx->repair_intake_addr, &ctx->repair_serve_addr );
14411446

1447+
/* TODO: this is a hack so replay generates votes.
1448+
Once we develop a better notion of 'caught up',
1449+
remove all uses of current_slot in this file */
1450+
ulong poh_slot_obj_id = fd_pod_query_ulong( topo->props, "poh_slot", ULONG_MAX );
1451+
FD_TEST( poh_slot_obj_id!=ULONG_MAX );
1452+
ctx->current_slot = fd_fseq_join( fd_topo_obj_laddr( topo, poh_slot_obj_id ) );
1453+
14421454
fd_repair_settime( ctx->repair, fd_log_wallclock() );
14431455
fd_repair_start( ctx->repair );
14441456

0 commit comments

Comments
 (0)