Skip to content

Commit ac306b1

Browse files
committed
work
1 parent 0da1462 commit ac306b1

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

src/app/firedancer/topology.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,6 @@ fd_topo_initialize( config_t * config ) {
203203
ulong writer_tile_cnt = config->firedancer.layout.writer_tile_count;
204204
ulong resolv_tile_cnt = config->layout.resolv_tile_count;
205205

206-
int enable_rpc = ( config->rpc.port != 0 );
207-
208206
fd_topo_t * topo = { fd_topob_new( &config->topo, config->name ) };
209207
topo->max_page_size = fd_cstr_to_shmem_page_sz( config->hugetlbfs.max_page_size );
210208
topo->gigantic_page_threshold = config->hugetlbfs.gigantic_page_threshold_mib << 20;
@@ -296,7 +294,6 @@ fd_topo_initialize( config_t * config ) {
296294
fd_topob_wksp( topo, "replay_manif" );
297295

298296
fd_topob_wksp( topo, "slot_fseqs" ); /* fseqs for marked slots eg. turbine slot */
299-
if( enable_rpc ) fd_topob_wksp( topo, "rpcsrv" );
300297

301298
#define FOR(cnt) for( ulong i=0UL; i<cnt; i++ )
302299

@@ -431,9 +428,6 @@ fd_topo_initialize( config_t * config ) {
431428
/**/ fd_topob_tile( topo, "tower", "tower", "metric_in", tile_to_cpu[ topo->tile_cnt ], 0, 0 );
432429
FOR(writer_tile_cnt) fd_topob_tile( topo, "writer", "writer", "metric_in", tile_to_cpu[ topo->tile_cnt ], 0, 0 );
433430

434-
fd_topo_tile_t * rpcserv_tile = NULL;
435-
if( enable_rpc ) rpcserv_tile = fd_topob_tile( topo, "rpcsrv", "rpcsrv", "metric_in", tile_to_cpu[ topo->tile_cnt ], 0, 1 );
436-
437431
fd_topo_tile_t * snaprd_tile = fd_topob_tile( topo, "snaprd", "snaprd", "metric_in", tile_to_cpu[ topo->tile_cnt ], 0, 0 );
438432
snaprd_tile->allow_shutdown = 1;
439433
fd_topo_tile_t * snapdc_tile = fd_topob_tile( topo, "snapdc", "snapdc", "metric_in", tile_to_cpu[ topo->tile_cnt ], 0, 0 );
@@ -451,7 +445,6 @@ fd_topo_initialize( config_t * config ) {
451445

452446
FOR(exec_tile_cnt) fd_topob_tile_uses( topo, &topo->tiles[ fd_topo_find_tile( topo, "exec", i ) ], funk_obj, FD_SHMEM_JOIN_MODE_READ_WRITE );
453447
/* */ fd_topob_tile_uses( topo, replay_tile, funk_obj, FD_SHMEM_JOIN_MODE_READ_WRITE );
454-
if(enable_rpc) fd_topob_tile_uses( topo, rpcserv_tile, funk_obj, FD_SHMEM_JOIN_MODE_READ_WRITE );
455448
FOR(writer_tile_cnt) fd_topob_tile_uses( topo, &topo->tiles[ fd_topo_find_tile( topo, "writer", i ) ], funk_obj, FD_SHMEM_JOIN_MODE_READ_WRITE );
456449

457450
/* Setup a shared wksp object for banks. */
@@ -778,9 +771,13 @@ fd_topo_initialize( config_t * config ) {
778771
/**/ fd_topob_link( topo, "replay_notif", "replay_notif", FD_REPLAY_NOTIF_DEPTH, FD_REPLAY_NOTIF_MTU, 1UL )->permit_no_consumers = 1;
779772
/**/ fd_topob_tile_out( topo, "replay", 0UL, "replay_notif", 0UL );
780773

774+
int enable_rpc = ( config->rpc.port != 0 );
781775
if( enable_rpc ) {
782-
fd_topob_tile_in( topo, "rpcsrv", 0UL, "metric_in", "replay_notif", 0UL, FD_TOPOB_UNRELIABLE, FD_TOPOB_POLLED );
783-
fd_topob_tile_in( topo, "rpcsrv", 0UL, "metric_in", "stake_out", 0UL, FD_TOPOB_UNRELIABLE, FD_TOPOB_POLLED );
776+
fd_topob_wksp( topo, "rpcsrv" );
777+
fd_topo_tile_t * rpcserv_tile = fd_topob_tile( topo, "rpcsrv", "rpcsrv", "metric_in", tile_to_cpu[ topo->tile_cnt ], 0, 1 );
778+
fd_topob_tile_uses( topo, rpcserv_tile, funk_obj, FD_SHMEM_JOIN_MODE_READ_WRITE );
779+
fd_topob_tile_in( topo, "rpcsrv", 0UL, "metric_in", "replay_notif", 0UL, FD_TOPOB_UNRELIABLE, FD_TOPOB_POLLED );
780+
fd_topob_tile_in( topo, "rpcsrv", 0UL, "metric_in", "stake_out", 0UL, FD_TOPOB_UNRELIABLE, FD_TOPOB_POLLED );
784781
for( ulong j=0UL; j<shred_tile_cnt; j++ ) {
785782
fd_topob_tile_in( topo, "rpcsrv", 0UL, "metric_in", "shred_repair", j, FD_TOPOB_UNRELIABLE, FD_TOPOB_POLLED );
786783
}

src/discof/rpcserver/fd_rpc_history.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,16 @@ fd_rpc_history_alloc_block(fd_rpc_history_t * hist, ulong slot) {
177177
return blk;
178178
}
179179

180+
void
181+
fd_rpc_history_debug(fd_rpc_history_t * hist) {
182+
fd_rpc_shred_map_t * shred_map = hist->shred_map;
183+
for( ulong slot = shred_map->tail; slot < shred_map->head; slot++ ) {
184+
ulong col_idx = slot & (FD_SHRED_MAP_COL_CNT - 1);
185+
struct fd_rpc_shred_map_column * col = &shred_map->cols[col_idx];
186+
FD_LOG_NOTICE(( "slot %lu: %lu shreds, %lu max, %d end_found", slot, col->used_cnt, col->max_idx, (int)col->end_found ));
187+
}
188+
}
189+
180190
void
181191
fd_rpc_history_save_info(fd_rpc_history_t * hist, fd_replay_notif_msg_t * info) {
182192
fd_rpc_block_t * blk = fd_rpc_history_alloc_block( hist, info->slot_exec.slot );

0 commit comments

Comments
 (0)