Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
CantelopePeel committed Jul 8, 2024
1 parent 35e5757 commit d0bdf50
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 20 deletions.
37 changes: 19 additions & 18 deletions src/app/fdctl/run/tiles/fd_replay.c
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@ after_frag( void * _ctx,

fd_fork_t * fork = fd_fork_frontier_ele_query(
ctx->forks->frontier, &ctx->curr_slot, NULL, ctx->forks->pool );

if( fork == NULL ) {
long prepare_time_ns = -fd_log_wallclock();

Expand All @@ -515,6 +516,24 @@ after_frag( void * _ctx,
// fork is advancing
FD_LOG_DEBUG(( "new block execution - slot: %lu, parent_slot: %lu", ctx->curr_slot, ctx->parent_slot ));

/* if it is an epoch boundary, push out stake weights */
int is_new_epoch = 0;
if( fork->slot_ctx.slot_bank.slot != 0 ) {
ulong slot_idx;
fd_epoch_bank_t * epoch_bank = fd_exec_epoch_ctx_epoch_bank( fork->slot_ctx.epoch_ctx );
ulong prev_epoch = fd_slot_to_epoch( &epoch_bank->epoch_schedule, fork->slot_ctx.slot_bank.prev_slot, &slot_idx );
ulong new_epoch = fd_slot_to_epoch( &epoch_bank->epoch_schedule, fork->slot_ctx.slot_bank.slot, &slot_idx );

if( prev_epoch < new_epoch || slot_idx == 0 ) {
FD_LOG_DEBUG(("Epoch boundary"));
is_new_epoch = 1;
}
}

if( is_new_epoch ) {
publish_stake_weights( ctx, mux, &fork->slot_ctx );
}

fork->slot_ctx.slot_bank.prev_slot = fork->slot_ctx.slot_bank.slot;
fork->slot_ctx.slot_bank.slot = ctx->curr_slot;

Expand All @@ -533,26 +552,8 @@ after_frag( void * _ctx,
FD_LOG_ERR(( "txn publishing failed" ));
}

/* if it is an epoch boundary, push out stake weights */
int is_new_epoch = 0;
if( fork->slot_ctx.slot_bank.slot != 0 ) {
ulong slot_idx;
fd_epoch_bank_t * epoch_bank = fd_exec_epoch_ctx_epoch_bank( fork->slot_ctx.epoch_ctx );
ulong prev_epoch = fd_slot_to_epoch( &epoch_bank->epoch_schedule, fork->slot_ctx.slot_bank.prev_slot, &slot_idx );
ulong new_epoch = fd_slot_to_epoch( &epoch_bank->epoch_schedule, fork->slot_ctx.slot_bank.slot, &slot_idx );

if( prev_epoch < new_epoch || slot_idx == 0 ) {
FD_LOG_DEBUG(("Epoch boundary"));
is_new_epoch = 1;
}
}

res = fd_runtime_block_execute_prepare( &fork->slot_ctx );

if( is_new_epoch ) {
publish_stake_weights( ctx, mux, &fork->slot_ctx );
}

if( res != FD_RUNTIME_EXECUTE_SUCCESS ) {
FD_LOG_ERR(( "block prep execute failed" ));
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/fdctl/run/topos/fd_firedancer.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,14 +331,14 @@ fd_topo_firedancer( config_t * _config ) {
/**/ fd_topob_tile_in( topo, "sender", 0UL, "metric_in", "sign_voter", 0UL, FD_TOPOB_UNRELIABLE, FD_TOPOB_UNPOLLED );
/**/ fd_topob_tile_in( topo, "pack", 0UL, "metric_in", "voter_pack", 0UL, FD_TOPOB_UNRELIABLE, FD_TOPOB_POLLED );
/**/ fd_topob_tile_in( topo, "pack", 0UL, "metric_in", "dedup_pack", 0UL, FD_TOPOB_UNRELIABLE, FD_TOPOB_POLLED ); /* No reliable consumers of networking fragments, may be dropped or overrun */
/**/ fd_topob_tile_in( topo, "pack", 0UL, "metric_in", "poh_pack", 0UL, FD_TOPOB_UNRELIABLE, FD_TOPOB_POLLED );
/**/ fd_topob_tile_in( topo, "pack", 0UL, "metric_in", "gossip_pack", 0UL, FD_TOPOB_UNRELIABLE, FD_TOPOB_POLLED ); /* No reliable consumers of networking fragments, may be dropped or overrun */
/**/ fd_topob_tile_in( topo, "bhole", 0UL, "metric_in", "replay_notif", 0UL, FD_TOPOB_UNRELIABLE, FD_TOPOB_POLLED ); /* No reliable consumers of networking fragments, may be dropped or overrun */
/**/ fd_topob_tile_in( topo, "pohi", 0UL, "metric_in", "replay_poh", 0UL, FD_TOPOB_UNRELIABLE, FD_TOPOB_POLLED ); /* No reliable consumers of networking fragments, may be dropped or overrun */
/**/ fd_topob_tile_in( topo, "pohi", 0UL, "metric_in", "stake_out", 0UL, FD_TOPOB_UNRELIABLE, FD_TOPOB_POLLED ); /* No reliable consumers of networking fragments, may be dropped or overrun */
/**/ fd_topob_tile_in( topo, "pack", 0UL, "metric_in", "dedup_pack", 0UL, FD_TOPOB_UNRELIABLE, FD_TOPOB_POLLED ); /* No reliable consumers of networking fragments, may be dropped or overrun */
/**/ fd_topob_tile_in( topo, "pohi", 0UL, "metric_in", "pack_replay", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
/**/ fd_topob_tile_in( topo, "pack", 0UL, "metric_in", "poh_pack", 0UL, FD_TOPOB_UNRELIABLE, FD_TOPOB_POLLED );
fd_topob_tile_out( topo, "pohi", 0UL, "poh_pack", 0UL );

/* Hacky: Reserve a ulong to allow net0 to pass its PID to its neighbors */
Expand Down

0 comments on commit d0bdf50

Please sign in to comment.