Skip to content

Commit 88ce178

Browse files
committed
combining block info wmark and shred idx wmark
1 parent 52b5f57 commit 88ce178

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

src/discof/replay/fd_replay_tile.c

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#include <climits>
21
#define _GNU_SOURCE
32
#include "../../disco/tiles.h"
43
#include "generated/fd_replay_tile_seccomp.h"
@@ -439,6 +438,15 @@ slice_poll( fd_replay_tile_ctx_t * ctx,
439438
fd_replay_slice_t * slice_deque,
440439
ulong slot ) {
441440
uint consumed_idx, slices_added;
441+
442+
fd_replay_idxs_t * shred_idxs = fd_replay_idxs_map_query( ctx->replay->idxs_map, slot, NULL );
443+
uint turbine_shred_wmark;
444+
if( !shred_idxs ) {
445+
turbine_shred_wmark = UINT_MAX;
446+
} else {
447+
turbine_shred_wmark = (uint)shred_idxs->wmark;
448+
}
449+
442450
for(;;) { /* speculative query */
443451
fd_block_map_query_t query[1] = { 0 };
444452
int err = fd_block_map_query_try( ctx->blockstore->block_map, &slot, NULL, query, 0 );
@@ -447,7 +455,7 @@ slice_poll( fd_replay_tile_ctx_t * ctx,
447455
if( FD_UNLIKELY( err == FD_MAP_ERR_KEY ) ) return 0;
448456
if( FD_UNLIKELY( err == FD_MAP_ERR_AGAIN ) ) continue;
449457

450-
consumed_idx = block_info->consumed_idx;
458+
consumed_idx = fd_uint_min( block_info->consumed_idx, turbine_shred_wmark );
451459
slices_added = 0;
452460

453461
if( FD_UNLIKELY( block_info->buffered_idx == UINT_MAX ) ) return 1;
@@ -513,6 +521,10 @@ before_frag( fd_replay_tile_ctx_t * ctx,
513521
(void)ctx;
514522
(void)seq;
515523

524+
if( in_idx == STORE_IN_IDX ) {
525+
FD_LOG_WARNING((" RECEIVE STORE MESSAGE: slot %lu", fd_disco_replay_old_sig_slot( sig )));
526+
}
527+
516528
if( in_idx == SHRED_IN_IDX ) {
517529
// FD_LOG_NOTICE(( "shred in idx: %lu, seq: %lu, sig: %lu", in_idx, seq, sig ));
518530

@@ -589,8 +601,6 @@ during_frag( fd_replay_tile_ctx_t * ctx,
589601
ulong chunk,
590602
ulong sz,
591603
ulong ctl FD_PARAM_UNUSED ) {
592-
return;
593-
594604
ctx->skip_frag = 0;
595605

596606
if( in_idx == STORE_IN_IDX ) {
@@ -604,6 +614,7 @@ during_frag( fd_replay_tile_ctx_t * ctx,
604614
Microblock as a list of fd_txn_p_t (sz * sizeof(fd_txn_p_t)) */
605615

606616
ctx->curr_slot = fd_disco_replay_old_sig_slot( sig );
617+
FD_LOG_WARNING(("store sent slot %lu", ctx->curr_slot));
607618
/* slot changes */
608619
if( FD_UNLIKELY( ctx->curr_slot < fd_fseq_query( ctx->published_wmark ) ) ) {
609620
FD_LOG_WARNING(( "store sent slot %lu before our root.", ctx->curr_slot ));
@@ -1921,7 +1932,7 @@ after_frag( fd_replay_tile_ctx_t * ctx,
19211932
(void)sig;
19221933
(void)sz;
19231934
(void)seq;
1924-
return;
1935+
//return;
19251936

19261937
if( FD_LIKELY( in_idx == SHRED_IN_IDX ) ) {
19271938
/* We are here if any of the slot / shred idx numbers have been overrun */
@@ -2475,9 +2486,9 @@ after_credit( fd_replay_tile_ctx_t * ctx,
24752486
}
24762487
}
24772488

2478-
// exec_slices( ctx, stem, ctx->curr_slot );
2489+
exec_slices( ctx, stem, ctx->curr_slot );
24792490

2480-
return;
2491+
//return;
24812492

24822493
ulong curr_slot = ctx->curr_slot;
24832494
ulong parent_slot = ctx->parent_slot;
@@ -2740,7 +2751,7 @@ after_credit( fd_replay_tile_ctx_t * ctx,
27402751

27412752
static void
27422753
during_housekeeping( void * _ctx ) {
2743-
return;
2754+
//return;
27442755

27452756
fd_replay_tile_ctx_t * ctx = (fd_replay_tile_ctx_t *)_ctx;
27462757

0 commit comments

Comments
 (0)