Skip to content

Commit

Permalink
poh: fix issue with not resetting bank
Browse files Browse the repository at this point in the history
  • Loading branch information
mmcgee-jump committed Jan 23, 2024
1 parent 3f7163f commit e284222
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/app/fdctl/run/tiles/fd_poh.c
Original file line number Diff line number Diff line change
Expand Up @@ -723,13 +723,15 @@ fd_ext_poh_reset( ulong reset_bank_slot, /* The slot that successfully p
uchar const * reset_blockhash /* The hash of the last tick in the produced block */ ) {
fd_poh_ctx_t * ctx = fd_ext_poh_write_lock();

int leader_before_reset = ctx->hashcnt>=ctx->next_leader_slot_hashcnt;

fd_memcpy( ctx->hash, reset_blockhash, 32UL );
ctx->hashcnt = (reset_bank_slot+1UL)*ctx->hashcnt_per_slot;
ctx->last_hashcnt = ctx->hashcnt;
ctx->reset_slot_hashcnt = ctx->hashcnt;
ctx->reset_slot_start_ns = fd_log_wallclock();

if( FD_UNLIKELY( ctx->hashcnt>=ctx->next_leader_slot_hashcnt ) ) {
if( FD_UNLIKELY( leader_before_reset ) ) {
/* No longer have a leader bank if we are reset. Replay stage will
call back again to give us a new one if we should become leader
for the reset slot.
Expand Down

0 comments on commit e284222

Please sign in to comment.