Skip to content

Commit 12c1366

Browse files
committed
runtime, fuzz: move block height update outside epoch boundary processing
1 parent 97399a1 commit 12c1366

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/discof/replay/fd_replay_tile.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,6 +1233,9 @@ handle_new_slot( fd_replay_tile_ctx_t * ctx,
12331233

12341234
fd_bank_tick_height_set( ctx->slot_ctx->bank, fd_bank_max_tick_height_get( ctx->slot_ctx->bank ) );
12351235

1236+
/* Update block height. */
1237+
fd_bank_block_height_set( ctx->slot_ctx->bank, fd_bank_block_height_get( ctx->slot_ctx->bank ) + 1UL );
1238+
12361239
ulong * max_tick_height = fd_bank_max_tick_height_modify( ctx->slot_ctx->bank );
12371240
ulong ticks_per_slot = fd_bank_ticks_per_slot_get( ctx->slot_ctx->bank );
12381241
if( FD_UNLIKELY( FD_RUNTIME_EXECUTE_SUCCESS != fd_runtime_compute_max_tick_height(ticks_per_slot, slot, max_tick_height ) ) ) {

src/flamenco/runtime/fd_runtime.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2689,9 +2689,6 @@ fd_runtime_block_pre_execute_process_new_epoch( fd_exec_slot_ctx_t * slot_ctx,
26892689
fd_spad_t * runtime_spad,
26902690
int * is_epoch_boundary ) {
26912691

2692-
/* Update block height. */
2693-
fd_bank_block_height_set( slot_ctx->bank, fd_bank_block_height_get( slot_ctx->bank ) + 1UL );
2694-
26952692
ulong const slot = fd_bank_slot_get( slot_ctx->bank );
26962693
if( slot != 0UL ) {
26972694
fd_epoch_schedule_t const * epoch_schedule = fd_bank_epoch_schedule_query( slot_ctx->bank );
@@ -2707,7 +2704,7 @@ fd_runtime_block_pre_execute_process_new_epoch( fd_exec_slot_ctx_t * slot_ctx,
27072704
if( FD_UNLIKELY( prev_epoch<new_epoch || !slot_idx ) ) {
27082705
FD_LOG_DEBUG(( "Epoch boundary" ));
27092706
/* Epoch boundary! */
2710-
fd_runtime_process_new_epoch( slot_ctx, new_epoch - 1UL, runtime_spad );
2707+
fd_runtime_process_new_epoch( slot_ctx, prev_epoch, runtime_spad );
27112708
*is_epoch_boundary = 1;
27122709
}
27132710
} else {

0 commit comments

Comments
 (0)