diff --git a/src/app/fdctl/run/tiles/fd_replay.c b/src/app/fdctl/run/tiles/fd_replay.c index d475d1b153..2c83762d50 100644 --- a/src/app/fdctl/run/tiles/fd_replay.c +++ b/src/app/fdctl/run/tiles/fd_replay.c @@ -804,23 +804,18 @@ after_frag( void * _ctx, FD_LOG_INFO(( "NOT publishing mblk to poh - slot: %lu, parent_slot: %lu, flags: %lx", ctx->curr_slot, ctx->parent_slot, ctx->flags )); } + fd_ghost_slot_print( ctx->ghost, child->slot, 12 ); + // fd_ghost_print( ctx->ghost ); + fd_tower_print( ctx->tower ); fd_fork_t const * vote_fork = fd_tower_vote_fork_select( ctx->tower, ctx->forks, ctx->acc_mgr, ctx->ghost ); - // fd_ghost_print( ctx->ghost ); - fd_ghost_slot_print( ctx->ghost, child->slot, 8 ); - fd_tower_print( ctx->tower ); - FD_LOG_NOTICE( ( "\n\n[Fork Selection]\n" "# of vote accounts: %lu\n" - "reset fork: %lu\n" - "vote fork: %lu\n" "best fork: %lu\n", fd_tower_vote_accs_cnt( ctx->tower->vote_accs ), - !!reset_fork ? reset_fork->slot : 0, - !!vote_fork ? vote_fork->slot : 0, fd_ghost_head( ctx->ghost )->slot ) ); ulong poh_slot = fd_fseq_query( ctx->poh_slot ); diff --git a/src/app/fdctl/run/tiles/fd_store_int.c b/src/app/fdctl/run/tiles/fd_store_int.c index 96979db33e..c5968dd969 100644 --- a/src/app/fdctl/run/tiles/fd_store_int.c +++ b/src/app/fdctl/run/tiles/fd_store_int.c @@ -207,17 +207,29 @@ after_frag( void * _ctx, if( FD_UNLIKELY( in_idx==SHRED_IN_IDX ) ) { for( ulong i = 0; i < ctx->s34_buffer->shred_cnt; i++ ) { + fd_shred_t * shred = &ctx->s34_buffer->pkts[i].shred; + + if( FD_UNLIKELY( (long)(ctx->store->pending_slots->end - shred->slot) > (long)FD_PENDING_MAX ) ) { + FD_LOG_WARNING(("received shred %lu that would overrun pending queue. skipping.", shred->slot)); + continue; + } + + if( FD_UNLIKELY( (long)(ctx->store->curr_turbine_slot - shred->slot) > 100 ) ) { + FD_LOG_WARNING(("received shred with slot %lu that would overrun pending queue. skipping.", shred->slot)); + continue; + } + // TODO: improve return value of api to not use < OK - if( fd_store_shred_insert( ctx->store, &ctx->s34_buffer->pkts[i].shred ) < FD_BLOCKSTORE_OK ) { + if( fd_store_shred_insert( ctx->store, shred ) < FD_BLOCKSTORE_OK ) { FD_LOG_ERR(( "failed inserting to blockstore" )); } else if ( ctx->shred_cap_ctx.is_archive ) { uchar shred_cap_flag = FD_SHRED_CAP_FLAG_MARK_TURBINE(0); - if ( fd_shred_cap_archive(&ctx->shred_cap_ctx, &ctx->s34_buffer->pkts[i].shred, shred_cap_flag) < FD_SHRED_CAP_OK ) { + if ( fd_shred_cap_archive(&ctx->shred_cap_ctx, shred, shred_cap_flag) < FD_SHRED_CAP_OK ) { FD_LOG_ERR(( "failed at archiving turbine shred to file" )); } } - fd_store_shred_update_with_shred_from_turbine( ctx->store, &ctx->s34_buffer->pkts[i].shred ); + fd_store_shred_update_with_shred_from_turbine( ctx->store, shred ); } } diff --git a/src/choreo/tower/fd_tower.c b/src/choreo/tower/fd_tower.c index 165097d6b8..5c21867d61 100644 --- a/src/choreo/tower/fd_tower.c +++ b/src/choreo/tower/fd_tower.c @@ -254,9 +254,10 @@ fd_tower_lockout_check( fd_tower_t const * tower, int lockout_check = top_vote->slot < ghost->root->slot || fd_ghost_is_descendant( ghost, fork->slot, top_vote->slot ); - FD_LOG_NOTICE(( "[fd_tower_lockout_check] ok? %d. top: %lu. switch: %lu.", + FD_LOG_NOTICE(( "[fd_tower_lockout_check] ok? %d. top: (slot: %lu, conf: %lu). switch: %lu.", lockout_check, top_vote->slot, + top_vote->conf, fork->slot )); return lockout_check; } diff --git a/src/choreo/tower/fd_tower.h b/src/choreo/tower/fd_tower.h index c7be356d17..f6d56c76e6 100644 --- a/src/choreo/tower/fd_tower.h +++ b/src/choreo/tower/fd_tower.h @@ -400,8 +400,8 @@ fd_tower_print( fd_tower_t const * tower ); /* Vote state API */ /* fd_tower_vote_state_cmp compares tower with vote_state. Conceptually - this is our comparing our local view of our tower with the cluster's - view (which may be out of sync). Returns -1 if the vote_state is + this is comparing our local view of our tower with the cluster's view + (which may be out of sync). Returns -1 if the vote_state is newer, 0 if they're in sync and 1 if the local view is newer. Assumes both tower and vote_state are valid ie. there is a root and there is at least one vote (verifies this with handholding enabled). diff --git a/src/disco/store/fd_store.c b/src/disco/store/fd_store.c index eb5114c7d2..a0ec14f6ee 100644 --- a/src/disco/store/fd_store.c +++ b/src/disco/store/fd_store.c @@ -184,6 +184,12 @@ fd_store_slot_prepare( fd_store_t * store, int fd_store_shred_insert( fd_store_t * store, fd_shred_t const * shred ) { + + fd_blockstore_t * blockstore = store->blockstore; + + if (shred->slot < blockstore->root) { + return FD_BLOCKSTORE_OK; + } uchar shred_type = fd_shred_type( shred->variant ); if( shred_type != FD_SHRED_TYPE_LEGACY_DATA && shred_type != FD_SHRED_TYPE_MERKLE_DATA @@ -191,8 +197,6 @@ fd_store_shred_insert( fd_store_t * store, return FD_BLOCKSTORE_OK; } - fd_blockstore_t * blockstore = store->blockstore; - fd_blockstore_start_write( blockstore ); /* TODO remove this check when we can handle duplicate shreds and blocks */ if( fd_blockstore_block_query( blockstore, shred->slot ) != NULL ) { diff --git a/src/flamenco/runtime/program/fd_bpf_program_util.c b/src/flamenco/runtime/program/fd_bpf_program_util.c index 04e52f965c..c229666899 100644 --- a/src/flamenco/runtime/program/fd_bpf_program_util.c +++ b/src/flamenco/runtime/program/fd_bpf_program_util.c @@ -145,7 +145,7 @@ fd_bpf_create_bpf_program_cache_entry( fd_exec_slot_ctx_t * slot_ctx, fd_sbpf_elf_info_t elf_info; if( fd_sbpf_elf_peek( &elf_info, program_data, program_data_len, false ) == NULL ) { - FD_LOG_WARNING(( "fd_sbpf_elf_peek() failed: %s", fd_sbpf_strerror() )); + FD_LOG_DEBUG(( "fd_sbpf_elf_peek() failed: %s", fd_sbpf_strerror() )); return FD_EXECUTOR_INSTR_ERR_INVALID_ACC_DATA; }