Skip to content

[WIP] flamenco: add cost tracker to replay #6027

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 21 additions & 7 deletions src/discof/replay/fd_replay_tile.c
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,13 @@ before_frag( fd_replay_tile_ctx_t * ctx,
return 0;
}

static void
dead_block( fd_replay_tile_ctx_t * ctx,
ulong slot ) {
FD_LOG_WARNING(( "ignoring replay of dead block %lu", slot ));
/* TODO: remove from forks */
}

static void
during_frag( fd_replay_tile_ctx_t * ctx,
ulong in_idx,
Expand Down Expand Up @@ -1180,6 +1187,10 @@ handle_writer_state_updates( fd_replay_tile_ctx_t * ctx ) {
}
break;
}
case FD_WRITER_STATE_DEAD: {
dead_block( ctx, fd_writer_fseq_get_slot( res ) );
break;
}
default:
FD_LOG_CRIT(( "Unexpected fseq state from writer tile idx=%lu state=%u", i, state ));
break;
Expand Down Expand Up @@ -1432,6 +1443,16 @@ handle_new_slice( fd_replay_tile_ctx_t * ctx, fd_stem_context_t * stem ) {
return;
}

/* At this point, our runtime state has been updated correctly. We
need to update the current fork with the range of shred indices
that we are about to execute. We also need to populate the slice's
metadata into the slice_exec_ctx. */
fd_fork_t * current_fork = fd_fork_frontier_ele_query( ctx->forks->frontier, &slot, NULL, ctx->forks->pool );
if( FD_UNLIKELY( !current_fork ) ) {
FD_LOG_WARNING(( "ignoring replay of current_fork is NULL for slot %lu, likely bad ancestry (invalid block)", slot ));
return;
}

/* If the slot of the slice we are about to execute is different than
the current slot, then we need to handle it. There are two cases:
1. We have already executed at least one slice from the slot.
Expand All @@ -1443,13 +1464,6 @@ handle_new_slice( fd_replay_tile_ctx_t * ctx, fd_stem_context_t * stem ) {
handle_slot_change( ctx, stem, slot, parent_slot );
}

/* At this point, our runtime state has been updated correctly. We
need to update the current fork with the range of shred indices
that we are about to execute. We also need to populate the slice's
metadata into the slice_exec_ctx. */
fd_fork_t * current_fork = fd_fork_frontier_ele_query( ctx->forks->frontier, &slot, NULL, ctx->forks->pool );
if( FD_UNLIKELY( !current_fork ) ) FD_LOG_CRIT(( "invariant violation: current_fork is NULL for slot %lu", slot ));

long shacq_start, shacq_end, shrel_end;
FD_STORE_SHACQ_TIMED( ctx->store, shacq_start, shacq_end );
ulong slice_sz = 0;
Expand Down
Loading