|
91 | 91 | #define STORE_OUT_IDX 0
|
92 | 92 | #define NET_OUT_IDX 1
|
93 | 93 | #define SIGN_OUT_IDX 2
|
| 94 | +#define MULTI_OUT_IDX 3 |
94 | 95 |
|
95 | 96 | #define MAX_SLOTS_PER_EPOCH 432000UL
|
96 | 97 |
|
@@ -180,6 +181,11 @@ typedef struct {
|
180 | 181 | ulong store_out_wmark;
|
181 | 182 | ulong store_out_chunk;
|
182 | 183 |
|
| 184 | + fd_wksp_t * replay_out_mem; |
| 185 | + ulong replay_out_chunk0; |
| 186 | + ulong replay_out_wmark; |
| 187 | + ulong replay_out_chunk; |
| 188 | + |
183 | 189 | struct {
|
184 | 190 | fd_histf_t contact_info_cnt[ 1 ];
|
185 | 191 | fd_histf_t batch_sz[ 1 ];
|
@@ -523,6 +529,7 @@ send_shred( fd_shred_ctx_t * ctx,
|
523 | 529 | ctx->net_out_chunk = fd_dcache_compact_next( ctx->net_out_chunk, pkt_sz, ctx->net_out_chunk0, ctx->net_out_wmark );
|
524 | 530 | }
|
525 | 531 |
|
| 532 | + |
526 | 533 | static void
|
527 | 534 | after_frag( fd_shred_ctx_t * ctx,
|
528 | 535 | ulong in_idx,
|
@@ -554,11 +561,12 @@ after_frag( fd_shred_ctx_t * ctx,
|
554 | 561 | const ulong fanout = 200UL;
|
555 | 562 | fd_shred_dest_idx_t _dests[ 200*(FD_REEDSOL_DATA_SHREDS_MAX+FD_REEDSOL_PARITY_SHREDS_MAX) ];
|
556 | 563 |
|
557 |
| - if( FD_LIKELY( ctx->in_kind[ in_idx ]==IN_KIND_NET ) ) { |
558 |
| - uchar * shred_buffer = ctx->shred_buffer; |
559 |
| - ulong shred_buffer_sz = ctx->shred_buffer_sz; |
| 564 | + uchar * shred_buffer = ctx->shred_buffer; |
| 565 | + ulong shred_buffer_sz = ctx->shred_buffer_sz; |
560 | 566 |
|
561 |
| - fd_shred_t const * shred = fd_shred_parse( shred_buffer, shred_buffer_sz ); |
| 567 | + fd_shred_t const * shred = fd_shred_parse( shred_buffer, shred_buffer_sz ); |
| 568 | + |
| 569 | + if( FD_LIKELY( ctx->in_kind[ in_idx ]==IN_KIND_NET ) ) { |
562 | 570 | if( FD_UNLIKELY( !shred ) ) { ctx->metrics->shred_processing_result[ 1 ]++; return; }
|
563 | 571 |
|
564 | 572 | fd_epoch_leaders_t const * lsched = fd_stake_ci_get_lsched_for_slot( ctx->stake_ci, shred->slot );
|
@@ -633,14 +641,19 @@ after_frag( fd_shred_ctx_t * ctx,
|
633 | 641 | /* Send to the blockstore, skipping any empty shred34_t s. */
|
634 | 642 | ulong new_sig = ctx->in_kind[ in_idx ]!=IN_KIND_NET; /* sig==0 means the store tile will do extra checks */
|
635 | 643 | ulong tspub = fd_frag_meta_ts_comp( fd_tickcount() );
|
636 |
| - fd_stem_publish( stem, 0UL, new_sig, fd_laddr_to_chunk( ctx->store_out_mem, s34+0UL ), sz0, 0UL, ctx->tsorig, tspub ); |
| 644 | + fd_stem_publish( stem, STORE_OUT_IDX, new_sig, fd_laddr_to_chunk( ctx->store_out_mem, s34+0UL ), sz0, 0UL, ctx->tsorig, tspub ); |
637 | 645 | if( FD_UNLIKELY( s34[ 1 ].shred_cnt ) )
|
638 |
| - fd_stem_publish( stem, 0UL, new_sig, fd_laddr_to_chunk( ctx->store_out_mem, s34+1UL ), sz1, 0UL, ctx->tsorig, tspub ); |
639 |
| - fd_stem_publish( stem, 0UL, new_sig, fd_laddr_to_chunk( ctx->store_out_mem, s34+2UL), sz2, 0UL, ctx->tsorig, tspub ); |
| 646 | + fd_stem_publish( stem, STORE_OUT_IDX, new_sig, fd_laddr_to_chunk( ctx->store_out_mem, s34+1UL ), sz1, 0UL, ctx->tsorig, tspub ); |
| 647 | + fd_stem_publish( stem, STORE_OUT_IDX, new_sig, fd_laddr_to_chunk( ctx->store_out_mem, s34+2UL), sz2, 0UL, ctx->tsorig, tspub ); |
640 | 648 | if( FD_UNLIKELY( s34[ 3 ].shred_cnt ) )
|
641 |
| - fd_stem_publish( stem, 0UL, new_sig, fd_laddr_to_chunk( ctx->store_out_mem, s34+3UL ), sz3, 0UL, ctx->tsorig, tspub ); |
642 |
| - |
643 |
| - |
| 649 | + fd_stem_publish( stem, STORE_OUT_IDX, new_sig, fd_laddr_to_chunk( ctx->store_out_mem, s34+3UL ), sz3, 0UL, ctx->tsorig, tspub ); |
| 650 | + |
| 651 | + /* Send to replay tile */ |
| 652 | +#if FD_HAS_NO_AGAVE |
| 653 | + fd_shred_t const * last_data_shred = (fd_shred_t const *)set->data_shreds[ set->data_shred_cnt-1 ]; |
| 654 | + ulong replay_sig = fd_disco_shred_sig( shred->slot, last_data_shred->data.parent_off, last_data_shred->data.flags, 1 ); |
| 655 | + fd_stem_publish( stem, MULTI_OUT_IDX, replay_sig, ctx->replay_out_chunk, 0, 0UL, ctx->tsorig, tspub ); |
| 656 | +#endif |
644 | 657 | /* Compute all the destinations for all the new shreds */
|
645 | 658 |
|
646 | 659 | fd_shred_t const * new_shreds[ FD_REEDSOL_DATA_SHREDS_MAX+FD_REEDSOL_PARITY_SHREDS_MAX ];
|
@@ -697,11 +710,18 @@ unprivileged_init( fd_topo_t * topo,
|
697 | 710 | fd_topo_tile_t * tile ) {
|
698 | 711 | void * scratch = fd_topo_obj_laddr( topo, tile->tile_obj_id );
|
699 | 712 |
|
700 |
| - if( FD_UNLIKELY( tile->out_cnt!=3UL || |
| 713 | + #if FD_HAS_NO_AGAVE |
| 714 | + int check_multi_out_link = strcmp( topo->links[ tile->out_link_id[ MULTI_OUT_IDX ] ].name, "shred_multi" ); |
| 715 | + #else |
| 716 | + int check_multi_out_link = 0; |
| 717 | + #endif |
| 718 | + |
| 719 | + if( FD_UNLIKELY( tile->out_cnt<3UL || |
701 | 720 | (strcmp( topo->links[ tile->out_link_id[ STORE_OUT_IDX ] ].name, "shred_store" ) &&
|
702 | 721 | strcmp( topo->links[ tile->out_link_id[ STORE_OUT_IDX ] ].name, "shred_storei" ) ) ||
|
703 | 722 | strcmp( topo->links[ tile->out_link_id[ NET_OUT_IDX ] ].name, "shred_net" ) ||
|
704 |
| - strcmp( topo->links[ tile->out_link_id[ SIGN_OUT_IDX ] ].name, "shred_sign" ) ) ) |
| 723 | + strcmp( topo->links[ tile->out_link_id[ SIGN_OUT_IDX ] ].name, "shred_sign" ) || |
| 724 | + check_multi_out_link ) ) |
705 | 725 | FD_LOG_ERR(( "shred tile has none or unexpected output links %lu %s %s",
|
706 | 726 | tile->out_cnt, topo->links[ tile->out_link_id[ 0 ] ].name, topo->links[ tile->out_link_id[ 1 ] ].name ));
|
707 | 727 |
|
@@ -859,6 +879,19 @@ unprivileged_init( fd_topo_t * topo,
|
859 | 879 | ctx->store_out_wmark = fd_dcache_compact_wmark ( ctx->store_out_mem, store_out->dcache, store_out->mtu );
|
860 | 880 | ctx->store_out_chunk = ctx->store_out_chunk0;
|
861 | 881 |
|
| 882 | +#if FD_HAS_NO_AGAVE |
| 883 | + fd_topo_link_t * replay_out = &topo->links[ tile->out_link_id[ MULTI_OUT_IDX ] ]; |
| 884 | + ctx->replay_out_mem = topo->workspaces[ topo->objs[ replay_out->dcache_obj_id ].wksp_id ].wksp; |
| 885 | + ctx->replay_out_chunk0 = fd_dcache_compact_chunk0( ctx->replay_out_mem, replay_out->dcache ); |
| 886 | + ctx->replay_out_wmark = fd_dcache_compact_wmark ( ctx->replay_out_mem, replay_out->dcache, replay_out->mtu ); |
| 887 | + ctx->replay_out_chunk = ctx->replay_out_chunk0; |
| 888 | +#else |
| 889 | + ctx->replay_out_mem = NULL; |
| 890 | + ctx->replay_out_chunk0 = 0; |
| 891 | + ctx->replay_out_wmark = 0; |
| 892 | + ctx->replay_out_chunk = 0; |
| 893 | +#endif |
| 894 | + |
862 | 895 | ctx->poh_in_expect_seq = 0UL;
|
863 | 896 |
|
864 | 897 | ctx->shredder_fec_set_idx = 0UL;
|
|
0 commit comments