Skip to content

Commit b544f84

Browse files
committed
replay: fix become leader timing
1 parent efe9b98 commit b544f84

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/discof/replay/fd_replay_tile.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,6 +1161,8 @@ maybe_become_leader( fd_replay_tile_t * ctx,
11611161
}
11621162
}
11631163

1164+
long now_nanos = fd_log_wallclock();
1165+
11641166
ctx->is_leader = 1;
11651167
ctx->recv_poh = 0;
11661168
ctx->recv_block_id = 0;
@@ -1171,12 +1173,12 @@ maybe_become_leader( fd_replay_tile_t * ctx,
11711173
FD_LOG_INFO(( "becoming leader for slot %lu, parent slot is %lu", ctx->next_leader_slot, ctx->reset_slot ));
11721174

11731175
/* Acquires bank, sets up initial state, and refcnts it. */
1174-
fd_bank_t * bank = prepare_leader_bank( ctx, ctx->next_leader_slot, now, &ctx->reset_block_id, stem );
1176+
fd_bank_t * bank = prepare_leader_bank( ctx, ctx->next_leader_slot, now_nanos, &ctx->reset_block_id, stem );
11751177

11761178
fd_became_leader_t * msg = fd_chunk_to_laddr( ctx->replay_out->mem, ctx->replay_out->chunk );
11771179
msg->slot = ctx->next_leader_slot;
1178-
msg->slot_start_ns = now;
1179-
msg->slot_end_ns = now+(long)ctx->slot_duration_nanos;
1180+
msg->slot_start_ns = now_nanos;
1181+
msg->slot_end_ns = now_nanos+(long)ctx->slot_duration_nanos;
11801182
msg->bank = NULL;
11811183
msg->bank_idx = bank->idx;
11821184
msg->ticks_per_slot = fd_bank_ticks_per_slot_get( bank );

0 commit comments

Comments
 (0)