Skip to content

Commit 07a3534

Browse files
committed
shredcap: topo bugfixes
1 parent 16a3a8a commit 07a3534

File tree

4 files changed

+26
-25
lines changed

4 files changed

+26
-25
lines changed

src/app/firedancer-dev/commands/repair.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,7 @@ repair_cmd_fn( args_t * args,
402402
}
403403

404404
FD_LOG_NOTICE(( "Repair profiler init" ));
405+
fd_topo_print_log( 1, &config->topo );
405406

406407
args_t configure_args = {
407408
.configure.command = CONFIGURE_CMD_INIT,

src/app/firedancer/topology.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -714,11 +714,11 @@ fd_topo_initialize( config_t * config ) {
714714
/**/ fd_topob_tile_out( topo, "sign", 0UL, "sign_repair", 0UL );
715715

716716
fd_topob_tile_out( topo, "snaprd", 0UL, "snap_zstd", 0UL );
717-
fd_topob_tile_in( topo, "snapdc", 0UL, "metric_in", "snap_zstd", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
717+
fd_topob_tile_in ( topo, "snapdc", 0UL, "metric_in", "snap_zstd", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
718718
fd_topob_tile_out( topo, "snapdc", 0UL, "snap_stream", 0UL );
719-
fd_topob_tile_in ( topo, "snapin", 0UL, "metric_in", "snap_stream", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
719+
fd_topob_tile_in ( topo, "snapin", 0UL, "metric_in", "snap_stream", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
720720
fd_topob_tile_out( topo, "snapin", 0UL, "snap_out", 0UL );
721-
fd_topob_tile_in( topo, "replay", 0UL, "metric_in", "snap_out", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
721+
fd_topob_tile_in ( topo, "replay", 0UL, "metric_in", "snap_out", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
722722

723723
fd_topob_tile_in( topo, "snaprd", 0UL, "metric_in", "snapdc_rd", 0UL, FD_TOPOB_RELIABLE, FD_TOPOB_POLLED );
724724
fd_topob_tile_out( topo, "snapdc", 0UL, "snapdc_rd", 0UL );

src/discof/repair/fd_repair_tile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ after_frag( fd_repair_tile_ctx_t * ctx,
586586

587587
FD_TEST( !fd_reasm_query( ctx->reasm, merkle_root ) );
588588
fd_hash_t const * cmr = chained_merkle_root;
589-
if( FD_UNLIKELY( shred->slot - shred->data.parent_off == fd_reasm_slot0( ctx->reasm ) ) ) {
589+
if( FD_UNLIKELY( shred->slot - shred->data.parent_off == fd_reasm_slot0( ctx->reasm ) && shred->fec_set_idx == 0) ) {
590590
cmr = &fd_reasm_root( ctx->reasm )->key;
591591
}
592592
FD_TEST( fd_reasm_insert( ctx->reasm, merkle_root, cmr, shred->slot, shred->fec_set_idx, shred->data.parent_off, (ushort)(shred->idx - shred->fec_set_idx + 1), data_complete, slot_complete ) );

src/discof/shredcap/fd_shredcap_tile.c

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ typedef union {
6060
fd_net_rx_bounds_t net_rx;
6161
} fd_capture_in_ctx_t;
6262

63-
struct fd_stake_out_link {
63+
struct out_link {
6464
ulong idx;
6565
fd_frag_meta_t * mcache;
6666
ulong * sync;
@@ -71,7 +71,7 @@ struct fd_stake_out_link {
7171
ulong wmark;
7272
ulong chunk;
7373
};
74-
typedef struct fd_stake_out_link fd_stake_out_link_t;
74+
typedef struct out_link out_link_t;
7575

7676
struct fd_capture_tile_ctx {
7777
uchar in_kind[ 32 ];
@@ -86,12 +86,8 @@ struct fd_capture_tile_ctx {
8686
ulong repair_buffer_sz;
8787
uchar repair_buffer[ FD_NET_MTU ];
8888

89-
fd_stake_out_link_t stake_out[1];
90-
ulong snap_out_idx;
91-
fd_wksp_t * snap_out_mem;
92-
ulong snap_out_chunk0;
93-
ulong snap_out_wmark;
94-
ulong snap_out_chunk;
89+
out_link_t stake_out[1];
90+
out_link_t snap_out[1];
9591
int enable_publish_stake_weights;
9692
ulong * manifest_wmark;
9793
uchar * manifest_bank_mem;
@@ -290,7 +286,7 @@ handle_new_turbine_contact_info( fd_capture_tile_ctx_t * ctx,
290286

291287
static int
292288
is_fec_completes_msg( ulong sz ) {
293-
return sz == FD_SHRED_DATA_HEADER_SZ + FD_SHRED_MERKLE_ROOT_SZ;
289+
return sz == FD_SHRED_DATA_HEADER_SZ + 2*FD_SHRED_MERKLE_ROOT_SZ;
294290
}
295291

296292
static inline void
@@ -443,14 +439,14 @@ after_credit( fd_capture_tile_ctx_t * ctx,
443439

444440
fd_fseq_update( ctx->manifest_wmark, manifest->slot );
445441

446-
uchar * chunk = fd_chunk_to_laddr( ctx->snap_out_mem, ctx->snap_out_chunk );
442+
uchar * chunk = fd_chunk_to_laddr( ctx->snap_out->mem, ctx->snap_out->chunk );
447443
ulong sz = sizeof(fd_snapshot_manifest_t);
448444
ulong sig = fd_ssmsg_sig( FD_SSMSG_MANIFEST_INCREMENTAL, sz );
449445
memcpy( chunk, manifest, sz );
450-
fd_stem_publish( stem, ctx->snap_out_idx, sig, ctx->snap_out_chunk, sz, 0UL, 0UL, fd_frag_meta_ts_comp( fd_tickcount() ) );
451-
ctx->snap_out_chunk = fd_dcache_compact_next( ctx->snap_out_chunk, sz, ctx->snap_out_chunk0, ctx->snap_out_wmark );
446+
fd_stem_publish( stem, ctx->snap_out->idx, sig, ctx->snap_out->chunk, sz, 0UL, 0UL, fd_frag_meta_ts_comp( fd_tickcount() ) );
447+
ctx->snap_out->chunk = fd_dcache_compact_next( ctx->snap_out->chunk, sz, ctx->snap_out->chunk0, ctx->snap_out->wmark );
452448

453-
fd_stem_publish( stem, ctx->snap_out_idx, fd_ssmsg_sig( FD_SSMSG_DONE, 0UL ), 0UL, 0UL, 0UL, 0UL, 0UL );
449+
fd_stem_publish( stem, ctx->snap_out->idx, fd_ssmsg_sig( FD_SSMSG_DONE, 0UL ), 0UL, 0UL, 0UL, 0UL, 0UL );
454450

455451
publish_stake_weights_manifest( ctx, stem, manifest );
456452
//*charge_busy = 0;
@@ -751,16 +747,20 @@ unprivileged_init( fd_topo_t * topo,
751747
ctx->stake_out->chunk = ctx->stake_out->chunk0;
752748
} else {
753749
FD_LOG_WARNING(( "no connection to stake_out link" ));
754-
memset( ctx->stake_out, 0, sizeof(fd_stake_out_link_t) );
750+
memset( ctx->stake_out, 0, sizeof(out_link_t) );
755751
}
756752

757-
ctx->snap_out_idx = fd_topo_find_tile_out_link( topo, tile, "snap_out", 0 );
758-
FD_TEST( ctx->snap_out_idx!=ULONG_MAX );
759-
fd_topo_link_t * snap_out = &topo->links[tile->out_link_id[ctx->snap_out_idx]];
760-
ctx->snap_out_mem = topo->workspaces[topo->objs[snap_out->dcache_obj_id].wksp_id].wksp;
761-
ctx->snap_out_chunk0 = fd_dcache_compact_chunk0( ctx->snap_out_mem, snap_out->dcache );
762-
ctx->snap_out_wmark = fd_dcache_compact_wmark( ctx->snap_out_mem, snap_out->dcache, snap_out->mtu );
763-
ctx->snap_out_chunk = ctx->snap_out_chunk0;
753+
ctx->snap_out->idx = fd_topo_find_tile_out_link( topo, tile, "snap_out", 0 );
754+
if( FD_LIKELY( ctx->snap_out->idx!=ULONG_MAX ) ) {
755+
fd_topo_link_t * snap_out = &topo->links[tile->out_link_id[ctx->snap_out->idx]];
756+
ctx->snap_out->mem = topo->workspaces[topo->objs[snap_out->dcache_obj_id].wksp_id].wksp;
757+
ctx->snap_out->chunk0 = fd_dcache_compact_chunk0( ctx->snap_out->mem, snap_out->dcache );
758+
ctx->snap_out->wmark = fd_dcache_compact_wmark( ctx->snap_out->mem, snap_out->dcache, snap_out->mtu );
759+
ctx->snap_out->chunk = ctx->snap_out->chunk0;
760+
} else {
761+
FD_LOG_WARNING(( "no connection to snap_out link" ));
762+
memset( ctx->snap_out, 0, sizeof(out_link_t) );
763+
}
764764

765765
/* If the manifest is enabled (for processing), the stake_out link
766766
must be connected to the tile. TODO in principle, it should be

0 commit comments

Comments
 (0)