@@ -60,7 +60,7 @@ typedef union {
60
60
fd_net_rx_bounds_t net_rx ;
61
61
} fd_capture_in_ctx_t ;
62
62
63
- struct fd_stake_out_link {
63
+ struct out_link {
64
64
ulong idx ;
65
65
fd_frag_meta_t * mcache ;
66
66
ulong * sync ;
@@ -71,7 +71,7 @@ struct fd_stake_out_link {
71
71
ulong wmark ;
72
72
ulong chunk ;
73
73
};
74
- typedef struct fd_stake_out_link fd_stake_out_link_t ;
74
+ typedef struct out_link out_link_t ;
75
75
76
76
struct fd_capture_tile_ctx {
77
77
uchar in_kind [ 32 ];
@@ -86,12 +86,8 @@ struct fd_capture_tile_ctx {
86
86
ulong repair_buffer_sz ;
87
87
uchar repair_buffer [ FD_NET_MTU ];
88
88
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 ];
95
91
int enable_publish_stake_weights ;
96
92
ulong * manifest_wmark ;
97
93
uchar * manifest_bank_mem ;
@@ -290,7 +286,7 @@ handle_new_turbine_contact_info( fd_capture_tile_ctx_t * ctx,
290
286
291
287
static int
292
288
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 ;
294
290
}
295
291
296
292
static inline void
@@ -443,14 +439,14 @@ after_credit( fd_capture_tile_ctx_t * ctx,
443
439
444
440
fd_fseq_update ( ctx -> manifest_wmark , manifest -> slot );
445
441
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 );
447
443
ulong sz = sizeof (fd_snapshot_manifest_t );
448
444
ulong sig = fd_ssmsg_sig ( FD_SSMSG_MANIFEST_INCREMENTAL , sz );
449
445
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 );
452
448
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 );
454
450
455
451
publish_stake_weights_manifest ( ctx , stem , manifest );
456
452
//*charge_busy = 0;
@@ -751,16 +747,20 @@ unprivileged_init( fd_topo_t * topo,
751
747
ctx -> stake_out -> chunk = ctx -> stake_out -> chunk0 ;
752
748
} else {
753
749
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 ) );
755
751
}
756
752
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
+ }
764
764
765
765
/* If the manifest is enabled (for processing), the stake_out link
766
766
must be connected to the tile. TODO in principle, it should be
0 commit comments