From 623e74da35e99ea6497287114874a012741c1819 Mon Sep 17 00:00:00 2001 From: Emily Wang Date: Fri, 23 Oct 2026 21:02:38 +0000 Subject: [PATCH] replay: remove some ag prefixes --- src/discof/replay/fd_replay_tile.c | 130 ++++++++++---------- src/discof/replay/fd_replay_tile_private.h | 16 +-- src/discof/replay/fd_sched.c | 28 ++--- src/discof/replay/test_replay_tile.c | 134 ++++++++++----------- 4 files changed, 151 insertions(+), 157 deletions(-) diff --git a/src/discof/replay/fd_replay_tile.c b/src/discof/replay/fd_replay_tile.c index 75eec9a85d7..8e049084017 100644 --- a/src/discof/replay/fd_replay_tile.c +++ b/src/discof/replay/fd_replay_tile.c @@ -139,21 +139,13 @@ fd_block_id_ele_get_idx( fd_block_id_ele_t * ele_arr, fd_block_id_ele_t * ele ) return (ulong)(ele - ele_arr); } -static inline fd_block_id_ele_t * -fd_block_id_ele_query( fd_replay_tile_t * ctx, - fd_hash_t const * block_id, - ulong slot ) { - ag_block_id_t key = ag_block_id( slot, block_id->uc ); - return fd_ag_block_id_map_ele_query( ctx->ag_block_id_map, &key, NULL, ctx->block_id_arr ); -} - FD_FN_CONST static inline ulong scratch_align( void ) { return 128UL; } FD_FN_PURE static inline ulong scratch_footprint( fd_topo_tile_t const * tile ) { - ulong chain_cnt = fd_ag_block_id_map_chain_cnt_est( tile->replay.max_live_slots ); + ulong chain_cnt = fd_block_id_map_chain_cnt_est( tile->replay.max_live_slots ); ulong l = FD_LAYOUT_INIT; l = FD_LAYOUT_APPEND( l, alignof(fd_replay_tile_t), sizeof(fd_replay_tile_t) ); @@ -165,7 +157,7 @@ scratch_footprint( fd_topo_tile_t const * tile ) { l = FD_LAYOUT_APPEND( l, alignof(fd_hash_t), sizeof(fd_hash_t) * FD_FEC_BLK_MAX * tile->replay.max_live_slots ); l = FD_LAYOUT_APPEND( l, 8UL, FD_EVENT_RUNTIME_SLOT_DIFFS_FOOTPRINT * tile->replay.max_live_slots ); } - l = FD_LAYOUT_APPEND( l, fd_ag_block_id_map_align(), fd_ag_block_id_map_footprint( chain_cnt ) ); + l = FD_LAYOUT_APPEND( l, fd_block_id_map_align(), fd_block_id_map_footprint( chain_cnt ) ); l = FD_LAYOUT_APPEND( l, fd_bhm_map_align(), fd_bhm_map_footprint( chain_cnt ) ); l = FD_LAYOUT_APPEND( l, fd_bhm_pool_align(), fd_bhm_pool_footprint( tile->replay.max_live_slots ) ); l = FD_LAYOUT_APPEND( l, fd_bhm_dlist_align(), fd_bhm_dlist_footprint() ); @@ -1053,7 +1045,7 @@ update_metric_balances( fd_replay_tile_t * ctx, FD_MGAUGE_SET( REPLAY, CLUSTER_ACTIVE_STAKE_LAMPORTS, bank->f.total_epoch_stake ); } -/* try_advance_root_ag attempts to advance root to finalized_block_id. For +/* try_advance_root attempts to advance root to finalized_block_id. For something to be rooted, it must be BOTH finalized AND replayed. This walks up the bank lineage in the block id map to find and set root. @@ -1071,8 +1063,8 @@ update_metric_balances( fd_replay_tile_t * ctx, try_notify_consensus_root hands it off as REPLAY_SIG_ROOT_ADVANCED. */ static void -try_advance_root_ag( fd_replay_tile_t * ctx, - ag_block_id_t finalized_block_id ) { +try_advance_root( fd_replay_tile_t * ctx, + ag_block_id_t finalized_block_id ) { if( FD_UNLIKELY( finalized_block_id.slot<=ctx->consensus_root_slot ) ) return; @@ -1085,7 +1077,7 @@ try_advance_root_ag( fd_replay_tile_t * ctx, fd_bank_t * finalized_bank = NULL; while( FD_LIKELY( ancestor_block_id.slot>ctx->consensus_root_slot ) ) { - fd_block_id_ele_t * ele = fd_ag_block_id_map_ele_query( ctx->ag_block_id_map, &ancestor_block_id, NULL, ctx->block_id_arr ); + fd_block_id_ele_t * ele = fd_block_id_map_ele_query( ctx->block_id_map, &ancestor_block_id, NULL, ctx->block_id_arr ); fd_bank_t * bank = ele ? fd_banks_bank_query( ctx->banks, fd_block_id_ele_get_idx( ctx->block_id_arr, ele ) ) : NULL; if( FD_UNLIKELY( !bank || bank->bank_seq!=ele->bank_seq || bank->state!=FD_BANK_STATE_FROZEN || bank->parent_idx==ULONG_MAX ) ) break; /* not replayed */ if( !finalized_bank ) finalized_bank = bank; @@ -1273,7 +1265,7 @@ publish_slot_completed( fd_replay_tile_t * ctx, timing_slot_release( ctx, bank->idx ); if( FD_UNLIKELY( slot==ctx->finalized_block_id_lo.slot && !memcmp( block_id.uc, ctx->finalized_block_id_lo.hash, sizeof(fd_hash_t) ) ) ) { /* finalized ahead of replay, replay caught up */ - try_advance_root_ag( ctx, ctx->finalized_block_id_lo ); + try_advance_root( ctx, ctx->finalized_block_id_lo ); ctx->finalized_block_id_lo = ctx->finalized_block_id_hi; /* hi becomes lo once lo is reached */ } } @@ -1463,8 +1455,8 @@ prepare_leader_bank( fd_replay_tile_t * ctx, /* Clear the previous occupant of this reused bank idx from whichever map it is currently keyed in. */ fd_block_id_ele_t * block_id_ele = &ctx->block_id_arr[ ctx->leader_bank->idx ]; - if( FD_LIKELY( fd_ag_block_id_map_ele_query( ctx->ag_block_id_map, &block_id_ele->block_info, NULL, ctx->block_id_arr )==block_id_ele ) ) { - FD_TEST( fd_ag_block_id_map_ele_remove( ctx->ag_block_id_map, &block_id_ele->block_info, NULL, ctx->block_id_arr ) ); + if( FD_LIKELY( fd_block_id_map_ele_query( ctx->block_id_map, &block_id_ele->block_info, NULL, ctx->block_id_arr )==block_id_ele ) ) { + FD_TEST( fd_block_id_map_ele_remove( ctx->block_id_map, &block_id_ele->block_info, NULL, ctx->block_id_arr ) ); } block_id_ele->block_id_seen = 0; @@ -1575,16 +1567,14 @@ publish_leader_footer( fd_replay_tile_t * ctx, publish_replay_out( ctx, stem, REPLAY_SIG_LEADER_FOOTER, sz ); } -/* For the most part, try_become_leader_ag mirrors try_become_leader - with modifications for Alpenglow-specific changes, in particular - 1. no more PoH-hashing and 2. picking the reset bank is based on +/* 1. no more PoH-hashing and 2. picking the reset bank is based on ParentReady rather than fork choice. */ static inline int -try_become_leader_ag( fd_replay_tile_t * ctx, - fd_stem_context_t * stem, - uint reason, - ulong end_slot ) { +try_become_leader( fd_replay_tile_t * ctx, + fd_stem_context_t * stem, + uint reason, + ulong end_slot ) { /* Mirrors check from try_become_leader. */ @@ -1598,8 +1588,9 @@ try_become_leader_ag( fd_replay_tile_t * ctx, ulong parent_slot = ctx->votor_leader->parent_slot; fd_hash_t const * parent_block_id = &ctx->votor_leader->parent_block_id; + ag_block_id_t parent_key = ag_block_id( parent_slot, parent_block_id->uc ); - fd_block_id_ele_t * block_id_ele = fd_block_id_ele_query( ctx, parent_block_id, parent_slot ); + fd_block_id_ele_t * block_id_ele = fd_block_id_map_ele_query( ctx->block_id_map, &parent_key, NULL, ctx->block_id_arr ); if( FD_UNLIKELY( !block_id_ele ) ) return 0; fd_bank_t * reset_bank = fd_banks_bank_query( ctx->banks, fd_block_id_ele_get_idx( ctx->block_id_arr, block_id_ele ) ); if( FD_UNLIKELY( !reset_bank || reset_bank->bank_seq!=block_id_ele->bank_seq || reset_bank->state!=FD_BANK_STATE_FROZEN ) ) return 0; @@ -1853,8 +1844,8 @@ replay_block_complete( fd_replay_tile_t * ctx, publish_slot_completed( ctx, stem, bank, 0, 0 /* is_leader */, execution_fees_pre_settle, priority_fees_pre_settle, footer ); /* The footer's finalization cert can also finalize. */ - if( footer->has_fast_final_cert ) { try_advance_root_ag( ctx, ag_block_id( footer->fast_final_cert.slot, footer->fast_final_cert.block_id.uc ) ); } - else if( footer->has_final_cert ) { try_advance_root_ag( ctx, ag_block_id( footer->final_cert.slot, footer->notar_cert.block_id.uc ) ); } + if( footer->has_fast_final_cert ) { try_advance_root( ctx, ag_block_id( footer->fast_final_cert.slot, footer->fast_final_cert.block_id.uc ) ); } + else if( footer->has_final_cert ) { try_advance_root( ctx, ag_block_id( footer->final_cert.slot, footer->notar_cert.block_id.uc ) ); } /* If enabled, dump the block to a file and reset the dumping context state */ @@ -2032,7 +2023,7 @@ try_fini_leader( fd_replay_tile_t * ctx, .parent_ready_ns = ctx->leader_window_start_ns }; ctx->next_leader_slot = curr_slot+1UL; - if( try_become_leader_ag( ctx, stem, FD_METRICS_SAMPLE_REASON_LEADER_END_START, curr_slot ) ) return 1; + if( try_become_leader( ctx, stem, FD_METRICS_SAMPLE_REASON_LEADER_END_START, curr_slot ) ) return 1; } metrics_trigger( ctx, FD_METRICS_SAMPLE_REASON_LEADER_END, curr_slot ); @@ -2430,7 +2421,7 @@ boot_genesis( fd_replay_tile_t * ctx, block_id_ele->latest_fec_idx = 0U; block_id_ele->block_info = ag_block_id( 0UL, initial_block_id.uc ); bank->f.block_id = initial_block_id; - FD_TEST( fd_ag_block_id_map_ele_insert( ctx->ag_block_id_map, block_id_ele, ctx->block_id_arr ) ); + FD_TEST( fd_block_id_map_ele_insert( ctx->block_id_map, block_id_ele, ctx->block_id_arr ) ); fd_replay_slot_completed_t * slot_info = fd_chunk_to_laddr( ctx->replay_out->mem, ctx->replay_out->chunk ); cost_tracker_snap( bank, slot_info ); @@ -2629,7 +2620,7 @@ on_snapshot_message( fd_replay_tile_t * ctx, bank->f.block_id = manifest_block_id; block_id_ele->block_info = ag_block_id( snapshot_slot, manifest_block_id.uc ); - FD_TEST( fd_ag_block_id_map_ele_insert( ctx->ag_block_id_map, block_id_ele, ctx->block_id_arr ) ); + FD_TEST( fd_block_id_map_ele_insert( ctx->block_id_map, block_id_ele, ctx->block_id_arr ) ); /* We call this after fd_runtime_read_genesis, which sets up the slot_bank needed in blockstore_init. */ @@ -2945,12 +2936,12 @@ can_process_rotor_fec( fd_replay_tile_t * ctx, fd_block_id_ele_t * self = NULL; if( FD_LIKELY( !fd_hash_check_zero( &fec->block_id ) ) ) { ag_block_id_t self_key = ag_block_id( fec->slot, fec->block_id.uc ); - self = live_block_id_ele( ctx, fd_ag_block_id_map_ele_query( ctx->ag_block_id_map, &self_key, NULL, ctx->block_id_arr ) ); + self = live_block_id_ele( ctx, fd_block_id_map_ele_query( ctx->block_id_map, &self_key, NULL, ctx->block_id_arr ) ); if( FD_UNLIKELY( self && !self->block_id_seen && !fec->known_id ) ) self = NULL; } if( FD_LIKELY( !self && !fec->known_id ) ) { ag_block_id_t self_key = { .slot = fec->slot }; - self = live_block_id_ele( ctx, fd_ag_block_id_map_ele_query( ctx->ag_block_id_map, &self_key, NULL, ctx->block_id_arr ) ); + self = live_block_id_ele( ctx, fd_block_id_map_ele_query( ctx->block_id_map, &self_key, NULL, ctx->block_id_arr ) ); } if( FD_UNLIKELY( self && ( self->block_id_seen || self->latest_fec_idx>=fec->fec_set_idx ) ) ) return PROCESS_FEC_SKIP; } @@ -2970,7 +2961,7 @@ can_process_rotor_fec( fd_replay_tile_t * ctx, fd_block_id_ele_t * parent = NULL; if( FD_UNLIKELY( fec->fec_set_idx==0 ) ) { ag_block_id_t parent_key = ag_block_id( fec->parent_slot, fec->parent_block_id.uc ); - parent = fd_ag_block_id_map_ele_query( ctx->ag_block_id_map, &parent_key, NULL, ctx->block_id_arr ); + parent = fd_block_id_map_ele_query( ctx->block_id_map, &parent_key, NULL, ctx->block_id_arr ); if( FD_UNLIKELY( !parent ) ) { FD_BASE58_ENCODE_32_BYTES( fec->parent_block_id.uc, parent_key_b58 ); FD_LOG_INFO(( "parent bank not found for slot %lu fec set idx %u, parent slot %lu parent block_id %s", fec->slot, fec->fec_set_idx, fec->parent_slot, parent_key_b58 )); @@ -2988,7 +2979,7 @@ can_process_rotor_fec( fd_replay_tile_t * ctx, ag_block_id_t key = { .slot = fec->slot }; if( FD_LIKELY( fec->known_id ) ) key = ag_block_id( fec->slot, fec->block_id.uc ); - parent = fd_ag_block_id_map_ele_query( ctx->ag_block_id_map, &key, NULL, ctx->block_id_arr ); + parent = fd_block_id_map_ele_query( ctx->block_id_map, &key, NULL, ctx->block_id_arr ); if( FD_UNLIKELY( !parent ) ) { FD_BASE58_ENCODE_32_BYTES( fec->block_id.uc, block_id_b58 ); FD_LOG_INFO(( "parent bank not found for slot %lu fec set idx %u slot_bid %s. parent slot %lu", fec->slot, fec->fec_set_idx, block_id_b58, fec->parent_slot )); @@ -3101,7 +3092,8 @@ try_notify_consensus_root( fd_replay_tile_t * ctx, if( FD_LIKELY( ctx->notified_root_slot==ctx->consensus_root_slot && fd_hash_eq( &ctx->notified_root, &ctx->consensus_root ) ) ) return 0; - fd_block_id_ele_t * block_id_ele = fd_block_id_ele_query( ctx, &ctx->consensus_root, ctx->consensus_root_slot ); + ag_block_id_t root_key = ag_block_id( ctx->consensus_root_slot, ctx->consensus_root.uc ); + fd_block_id_ele_t * block_id_ele = fd_block_id_map_ele_query( ctx->block_id_map, &root_key, NULL, ctx->block_id_arr ); if( FD_UNLIKELY( !block_id_ele ) ) return 0; fd_bank_t * bank = fd_banks_bank_query( ctx->banks, fd_block_id_ele_get_idx( ctx->block_id_arr, block_id_ele ) ); @@ -3197,7 +3189,8 @@ try_advance_published_root( fd_replay_tile_t * ctx, /* If the new root is not available because the bank is/has been evicted, we can't advance the root. Try again later. */ - fd_block_id_ele_t * block_id_ele = fd_block_id_ele_query( ctx, &ctx->consensus_root, ctx->consensus_root_slot ); + ag_block_id_t consensus_root_key = ag_block_id( ctx->consensus_root_slot, ctx->consensus_root.uc ); + fd_block_id_ele_t * block_id_ele = fd_block_id_map_ele_query( ctx->block_id_map, &consensus_root_key, NULL, ctx->block_id_arr ); if( FD_UNLIKELY( !block_id_ele ) ) return 0; fd_bank_t * target_bank = fd_banks_bank_query( ctx->banks, fd_block_id_ele_get_idx( ctx->block_id_arr, block_id_ele ) ); if( FD_UNLIKELY( !target_bank || @@ -3401,7 +3394,7 @@ after_credit( fd_replay_tile_t * ctx, return; } - if( FD_UNLIKELY( try_become_leader_ag( ctx, stem, FD_METRICS_SAMPLE_REASON_LEADER_START, 0UL ) ) ) { + if( FD_UNLIKELY( try_become_leader( ctx, stem, FD_METRICS_SAMPLE_REASON_LEADER_START, 0UL ) ) ) { *charge_busy = 1; *opt_poll_in = 0; return; @@ -3604,7 +3597,7 @@ process_rotor_fec( fd_replay_tile_t * ctx, ulong parent_bank_idx = ULONG_MAX; if( FD_UNLIKELY( fec->fec_set_idx==0 ) ) { ag_block_id_t parent_key = ag_block_id( fec->parent_slot, fec->parent_block_id.uc ); - fd_block_id_ele_t * parent = fd_ag_block_id_map_ele_query( ctx->ag_block_id_map, &parent_key, NULL, ctx->block_id_arr ); + fd_block_id_ele_t * parent = fd_block_id_map_ele_query( ctx->block_id_map, &parent_key, NULL, ctx->block_id_arr ); FD_TEST( parent ); parent_bank_idx = fd_block_id_ele_get_idx( ctx->block_id_arr, parent ); } else { @@ -3620,7 +3613,7 @@ process_rotor_fec( fd_replay_tile_t * ctx, key = ag_block_id( fec->slot, fec->block_id.uc ); } - fd_block_id_ele_t * parent = fd_ag_block_id_map_ele_query( ctx->ag_block_id_map, &key, NULL, ctx->block_id_arr ); + fd_block_id_ele_t * parent = fd_block_id_map_ele_query( ctx->block_id_map, &key, NULL, ctx->block_id_arr ); FD_TEST( parent ); parent_bank_idx = fd_block_id_ele_get_idx( ctx->block_id_arr, parent ); } @@ -3665,8 +3658,8 @@ process_rotor_fec( fd_replay_tile_t * ctx, block_id_ele = &ctx->block_id_arr[ bank->idx ]; /* Clear the previous occupant of this reused bank idx */ - if( FD_LIKELY( fd_ag_block_id_map_ele_query( ctx->ag_block_id_map, &block_id_ele->block_info, NULL, ctx->block_id_arr )==block_id_ele ) ) { - FD_TEST( fd_ag_block_id_map_ele_remove( ctx->ag_block_id_map, &block_id_ele->block_info, NULL, ctx->block_id_arr ) ); + if( FD_LIKELY( fd_block_id_map_ele_query( ctx->block_id_map, &block_id_ele->block_info, NULL, ctx->block_id_arr )==block_id_ele ) ) { + FD_TEST( fd_block_id_map_ele_remove( ctx->block_id_map, &block_id_ele->block_info, NULL, ctx->block_id_arr ) ); } block_id_ele->block_id_seen = 0; @@ -3679,8 +3672,8 @@ process_rotor_fec( fd_replay_tile_t * ctx, /* If this fec 0 is rebuilding an evicted block (recovery redelivery), the evicted bank's stale map entry may still hold this key at a DIFFERENT idx. */ - fd_ag_block_id_map_ele_remove( ctx->ag_block_id_map, &block_id_ele->block_info, NULL, ctx->block_id_arr ); // evicted / stale entry - FD_TEST( fd_ag_block_id_map_ele_insert( ctx->ag_block_id_map, block_id_ele, ctx->block_id_arr ) ); + fd_block_id_map_ele_remove( ctx->block_id_map, &block_id_ele->block_info, NULL, ctx->block_id_arr ); // evicted / stale entry + FD_TEST( fd_block_id_map_ele_insert( ctx->block_id_map, block_id_ele, ctx->block_id_arr ) ); } else { /* FEC for the middle or end of a block */ /* Assign bank idx + seqno to the FEC. Update block id pool ele. The block stays keyed by {slot, 0} in the compound map. */ @@ -3717,11 +3710,11 @@ process_rotor_fec( fd_replay_tile_t * ctx, was evicted (eviction does not remove map entries), now being rebuilt through recovery redelivery. Evict the stale entry before inserting. */ - FD_TEST( fd_ag_block_id_map_ele_remove( ctx->ag_block_id_map, &block_id_ele->block_info, NULL, ctx->block_id_arr )==block_id_ele ); + FD_TEST( fd_block_id_map_ele_remove( ctx->block_id_map, &block_id_ele->block_info, NULL, ctx->block_id_arr )==block_id_ele ); ag_block_id_t key = ag_block_id( fec->slot, fec->block_id.uc ); block_id_ele->block_info = key; - fd_ag_block_id_map_ele_remove( ctx->ag_block_id_map, &key, NULL, ctx->block_id_arr ); // evicted / stale entry - FD_TEST( fd_ag_block_id_map_ele_insert( ctx->ag_block_id_map, block_id_ele, ctx->block_id_arr ) ); + fd_block_id_map_ele_remove( ctx->block_id_map, &key, NULL, ctx->block_id_arr ); // evicted / stale entry + FD_TEST( fd_block_id_map_ele_insert( ctx->block_id_map, block_id_ele, ctx->block_id_arr ) ); } /* For leader FECs, don't insert the FEC into the scheduler. */ @@ -4120,18 +4113,18 @@ returnable_frag( fd_replay_tile_t * ctx, fd_votor_leader_t const * leader = fd_chunk_to_laddr( ctx->in[ in_idx ].mem, chunk ); *ctx->votor_leader = *leader; ctx->next_leader_slot = leader->slot; - try_become_leader_ag( ctx, stem, FD_METRICS_SAMPLE_REASON_LEADER_START, 0UL ); + try_become_leader( ctx, stem, FD_METRICS_SAMPLE_REASON_LEADER_START, 0UL ); } else if( FD_LIKELY( sig==FD_VOTOR_SIG_CERTED ) ) { fd_votor_certed_t const * certed = fd_chunk_to_laddr( ctx->in[ in_idx ].mem, chunk ); fd_votor_certed_t * fin = ctx->votor_final; switch( certed->kind ) { case AG_CERT_KIND_FINAL: if( fin->slot==ULONG_MAX || certed->slot>fin->slot ) *fin = *certed; - try_advance_root_ag( ctx, ag_block_id( certed->slot, certed->block_id.uc ) ); + try_advance_root( ctx, ag_block_id( certed->slot, certed->block_id.uc ) ); break; case AG_CERT_KIND_FAST_FINAL: /* fast beats slow at the same slot */ if( fin->slot==ULONG_MAX || certed->slot>fin->slot || ( certed->slot==fin->slot && fin->kind==AG_CERT_KIND_FINAL ) ) *fin = *certed; - try_advance_root_ag( ctx, ag_block_id( certed->slot, certed->block_id.uc ) ); + try_advance_root( ctx, ag_block_id( certed->slot, certed->block_id.uc ) ); break; default: break; } @@ -4243,7 +4236,8 @@ returnable_frag( fd_replay_tile_t * ctx, on_snapshot_message). */ ctx->next_leader_tickcount = LONG_MAX; if( FD_LIKELY( ctx->next_leader_slot!=ULONG_MAX ) ) { - fd_block_id_ele_t * block_id_ele = fd_block_id_ele_query( ctx, &ctx->reset_dmr, ctx->reset_slot ); + ag_block_id_t reset_key = ag_block_id( ctx->reset_slot, ctx->reset_dmr.uc ); + fd_block_id_ele_t * block_id_ele = fd_block_id_map_ele_query( ctx->block_id_map, &reset_key, NULL, ctx->block_id_arr ); if( FD_LIKELY( block_id_ele ) ) { fd_bank_t * reset_bank = fd_banks_bank_query( ctx->banks, fd_block_id_ele_get_idx( ctx->block_id_arr, block_id_ele ) ); if( FD_LIKELY( reset_bank && reset_bank->bank_seq==block_id_ele->bank_seq && reset_bank->state!=FD_BANK_STATE_PRUNABLE ) ) { @@ -4350,8 +4344,8 @@ privileged_init( fd_topo_t const * topo, FD_TEST( fd_rng_secure( &ctx->rng_seed, sizeof(ctx->rng_seed) ) ); FD_TEST( fd_rng_secure( &ctx->blockhash_seed, sizeof(ulong) ) ); FD_TEST( fd_rng_secure( &ctx->vote_tracker_seed, sizeof(ulong) ) ); - FD_TEST( fd_rng_secure( &ctx->ag_block_id_map_seed, sizeof(ulong) ) ); - FD_TEST( fd_rng_secure( &ctx->bhm_map_seed, sizeof(ulong) ) ); + FD_TEST( fd_rng_secure( &ctx->block_id_map_seed, sizeof(ulong) ) ); + FD_TEST( fd_rng_secure( &ctx->bhm_map_seed, sizeof(ulong) ) ); FD_TEST( fd_rng_secure( &ctx->initial_block_id, sizeof(fd_hash_t) ) ); FD_TEST( fd_rng_secure( &ctx->runtime_stack_seed, sizeof(ulong) ) ); @@ -4371,7 +4365,7 @@ unprivileged_init( fd_topo_t const * topo, fd_topo_tile_t const * tile ) { void * scratch = fd_topo_obj_laddr( topo, tile->tile_obj_id ); void * block_id_map_mem = NULL; - ulong chain_cnt = fd_ag_block_id_map_chain_cnt_est( tile->replay.max_live_slots ); + ulong chain_cnt = fd_block_id_map_chain_cnt_est( tile->replay.max_live_slots ); FD_SCRATCH_ALLOC_INIT( l, scratch ); fd_replay_tile_t * ctx = FD_SCRATCH_ALLOC_APPEND( l, alignof(fd_replay_tile_t), sizeof(fd_replay_tile_t) ); @@ -4380,25 +4374,25 @@ unprivileged_init( fd_topo_t const * topo, void * block_id_arr_mem = FD_SCRATCH_ALLOC_APPEND( l, alignof(fd_block_id_ele_t), sizeof(fd_block_id_ele_t) * tile->replay.max_live_slots ); void * dead_idxs_mem = FD_SCRATCH_ALLOC_APPEND( l, alignof(ulong), sizeof(ulong) * tile->replay.max_live_slots ); void * fec_chain_mem = tile->replay.report_runtime_diffs ? - FD_SCRATCH_ALLOC_APPEND( l, alignof(fd_hash_t), sizeof(fd_hash_t) * FD_FEC_BLK_MAX * tile->replay.max_live_slots ) : NULL; + FD_SCRATCH_ALLOC_APPEND( l, alignof(fd_hash_t), sizeof(fd_hash_t) * FD_FEC_BLK_MAX * tile->replay.max_live_slots ) : NULL; void * slot_diffs_mem = tile->replay.report_runtime_diffs ? - FD_SCRATCH_ALLOC_APPEND( l, 8UL, FD_EVENT_RUNTIME_SLOT_DIFFS_FOOTPRINT * tile->replay.max_live_slots ) : NULL; - block_id_map_mem = FD_SCRATCH_ALLOC_APPEND( l, fd_ag_block_id_map_align(), fd_ag_block_id_map_footprint( chain_cnt ) ); + FD_SCRATCH_ALLOC_APPEND( l, 8UL, FD_EVENT_RUNTIME_SLOT_DIFFS_FOOTPRINT * tile->replay.max_live_slots ) : NULL; + block_id_map_mem = FD_SCRATCH_ALLOC_APPEND( l, fd_block_id_map_align(), fd_block_id_map_footprint( chain_cnt ) ); void * bhm_map_mem = FD_SCRATCH_ALLOC_APPEND( l, fd_bhm_map_align(), fd_bhm_map_footprint( chain_cnt ) ); void * bhm_pool_mem = FD_SCRATCH_ALLOC_APPEND( l, fd_bhm_pool_align(), fd_bhm_pool_footprint( tile->replay.max_live_slots ) ); void * bhm_dlist_mem = FD_SCRATCH_ALLOC_APPEND( l, fd_bhm_dlist_align(), fd_bhm_dlist_footprint() ); - void * _txncache = FD_SCRATCH_ALLOC_APPEND( l, fd_txncache_align(), fd_txncache_footprint( tile->replay.max_live_slots ) ); - void * _accdb = FD_SCRATCH_ALLOC_APPEND( l, fd_accdb_align(), fd_accdb_footprint( tile->replay.max_live_slots, 0 ) ); - void * recp_stats_mem = FD_SCRATCH_ALLOC_APPEND( l, alignof(fd_reception_stats_t), sizeof(fd_reception_stats_t)*tile->replay.max_live_slots ); - void * sched_mem = FD_SCRATCH_ALLOC_APPEND( l, fd_sched_align(), fd_sched_footprint( tile->replay.sched_depth, tile->replay.max_live_slots, tile->replay.max_shreds_per_block, tile->replay.max_txn_per_slot ) ); - void * vote_tracker_mem = FD_SCRATCH_ALLOC_APPEND( l, fd_vote_tracker_align(), fd_vote_tracker_footprint() ); - void * _capture_ctx = FD_SCRATCH_ALLOC_APPEND( l, fd_capture_ctx_align(), fd_capture_ctx_footprint() ); - void * dump_proto_ctx_mem = FD_SCRATCH_ALLOC_APPEND( l, alignof(fd_dump_proto_ctx_t), sizeof(fd_dump_proto_ctx_t) ); + void * _txncache = FD_SCRATCH_ALLOC_APPEND( l, fd_txncache_align(), fd_txncache_footprint( tile->replay.max_live_slots ) ); + void * _accdb = FD_SCRATCH_ALLOC_APPEND( l, fd_accdb_align(), fd_accdb_footprint( tile->replay.max_live_slots, 0 ) ); + void * recp_stats_mem = FD_SCRATCH_ALLOC_APPEND( l, alignof(fd_reception_stats_t), sizeof(fd_reception_stats_t)*tile->replay.max_live_slots ); + void * sched_mem = FD_SCRATCH_ALLOC_APPEND( l, fd_sched_align(), fd_sched_footprint( tile->replay.sched_depth, tile->replay.max_live_slots, tile->replay.max_shreds_per_block, tile->replay.max_txn_per_slot ) ); + void * vote_tracker_mem = FD_SCRATCH_ALLOC_APPEND( l, fd_vote_tracker_align(), fd_vote_tracker_footprint() ); + void * _capture_ctx = FD_SCRATCH_ALLOC_APPEND( l, fd_capture_ctx_align(), fd_capture_ctx_footprint() ); + void * dump_proto_ctx_mem = FD_SCRATCH_ALLOC_APPEND( l, alignof(fd_dump_proto_ctx_t), sizeof(fd_dump_proto_ctx_t) ); void * block_completed_ev = FD_SCRATCH_ALLOC_APPEND( l, alignof(fd_event_block_completed_t), sizeof(fd_event_block_completed_t) ); - void * timing_pool_mem = FD_SCRATCH_ALLOC_APPEND( l, fd_timing_slot_pool_align(), fd_timing_slot_pool_footprint( FD_REPLAY_TXN_TIMING_SLOTS ) ); - void * timing_rec_mem = FD_SCRATCH_ALLOC_APPEND( l, alignof(fd_replay_txn_timing_t), FD_REPLAY_TXN_TIMING_SLOTS*tile->replay.max_txn_per_slot*sizeof(fd_replay_txn_timing_t) ); - void * timing_of_bank_mem = FD_SCRATCH_ALLOC_APPEND( l, alignof(ulong), tile->replay.max_live_slots*sizeof(ulong) ); + void * timing_pool_mem = FD_SCRATCH_ALLOC_APPEND( l, fd_timing_slot_pool_align(), fd_timing_slot_pool_footprint( FD_REPLAY_TXN_TIMING_SLOTS ) ); + void * timing_rec_mem = FD_SCRATCH_ALLOC_APPEND( l, alignof(fd_replay_txn_timing_t), FD_REPLAY_TXN_TIMING_SLOTS*tile->replay.max_txn_per_slot*sizeof(fd_replay_txn_timing_t) ); + void * timing_of_bank_mem = FD_SCRATCH_ALLOC_APPEND( l, alignof(ulong), tile->replay.max_live_slots*sizeof(ulong) ); void * block_dump_ctx = NULL; if( FD_UNLIKELY( tile->replay.dump_block_to_pb ) ) { block_dump_ctx = FD_SCRATCH_ALLOC_APPEND( l, fd_block_dump_context_align(), fd_block_dump_context_footprint() ); @@ -4637,8 +4631,8 @@ unprivileged_init( fd_topo_t const * topo, ctx->fec_chain = (fd_hash_t *)fec_chain_mem; if( FD_UNLIKELY( slot_diffs_mem ) ) fd_event_runtime_slot_diffs_init( slot_diffs_mem, tile->replay.max_live_slots ); - ctx->ag_block_id_map = fd_ag_block_id_map_join( fd_ag_block_id_map_new( block_id_map_mem, chain_cnt, ctx->ag_block_id_map_seed ) ); - FD_TEST( ctx->ag_block_id_map ); + ctx->block_id_map = fd_block_id_map_join( fd_block_id_map_new( block_id_map_mem, chain_cnt, ctx->block_id_map_seed ) ); + FD_TEST( ctx->block_id_map ); ctx->bhm_map = fd_bhm_map_join( fd_bhm_map_new( bhm_map_mem, chain_cnt, ctx->bhm_map_seed ) ); FD_TEST( ctx->bhm_map ); ctx->bhm_pool = fd_bhm_pool_join( fd_bhm_pool_new( bhm_pool_mem, tile->replay.max_live_slots ) ); diff --git a/src/discof/replay/fd_replay_tile_private.h b/src/discof/replay/fd_replay_tile_private.h index 054d6dd0892..ae3ec641a86 100644 --- a/src/discof/replay/fd_replay_tile_private.h +++ b/src/discof/replay/fd_replay_tile_private.h @@ -55,7 +55,7 @@ struct fd_block_id_ele { int block_id_seen; ulong slot; ulong bank_seq; - ulong ag_next_; + ulong next; uint fec_cnt; }; typedef struct fd_block_id_ele fd_block_id_ele_t; @@ -110,11 +110,11 @@ typedef struct fd_replay_txn_timing_slot fd_replay_txn_timing_slot_t; block id is known at the slot start. So the entry is keyed by {slot, block_id} from the start and never rekeyed. */ -#define MAP_NAME fd_ag_block_id_map +#define MAP_NAME fd_block_id_map #define MAP_ELE_T fd_block_id_ele_t #define MAP_KEY_T ag_block_id_t #define MAP_KEY block_info -#define MAP_NEXT ag_next_ +#define MAP_NEXT next #define MAP_KEY_EQ(k0,k1) (ag_block_id_eq( (k0), (k1) )) #define MAP_KEY_HASH(key,seed) (fd_hash( (seed), (key), sizeof(ag_block_id_t) )) #include "../../util/tmpl/fd_map_chain.c" @@ -423,8 +423,8 @@ struct fd_replay_tile { fd_hash_t * fec_chain; - ulong ag_block_id_map_seed; - fd_ag_block_id_map_t * ag_block_id_map; + ulong block_id_map_seed; + fd_block_id_map_t * block_id_map; ulong bhm_map_seed; fd_bhm_map_t * bhm_map; @@ -473,9 +473,9 @@ struct fd_replay_tile { uint supports_leader : 1; int recv_poh; - ulong leader_execution_fees; /* ALPENGLOW-ONLY */ - ulong leader_priority_fees; /* ALPENGLOW-ONLY */ - ulong leader_tips; /* ALPENGLOW-ONLY */ + ulong leader_execution_fees; + ulong leader_priority_fees; + ulong leader_tips; fd_block_footer_t leader_footer[ 1 ]; fd_votor_certed_t votor_final[ 1 ]; /* highest finalization, fast over slow at the same slot */ diff --git a/src/discof/replay/fd_sched.c b/src/discof/replay/fd_sched.c index 6f1664785ea..8debd7bceb3 100644 --- a/src/discof/replay/fd_sched.c +++ b/src/discof/replay/fd_sched.c @@ -211,11 +211,11 @@ struct fd_sched_block { AcceptingEntriesOrFooter 1 0 0 * AcceptingAlpentick 1 1 0 * Done 1 1 1 * */ - int header_seen; - int genesis_cert_seen; - int update_parent_seen; - int footer_seen; - int alpentick_seen; + uint header_seen : 1; + uint genesis_cert_seen : 1; + uint update_parent_seen : 1; + uint footer_seen : 1; + uint alpentick_seen : 1; }; typedef struct fd_sched_block fd_sched_block_t; @@ -337,7 +337,7 @@ static int verify_ticks_final( fd_sched_block_t * block ); static int -ag_on_final( fd_sched_block_t * block ); +on_final( fd_sched_block_t * block ); static void add_block( fd_sched_t * sched, @@ -1229,7 +1229,7 @@ fd_sched_fec_ingest( fd_sched_t * sched, } if( FD_UNLIKELY( block->fec_eos ) ) { - int dead_reason = ag_on_final( block ); + int dead_reason = on_final( block ); if( FD_UNLIKELY( dead_reason!=FD_SCHED_DEAD_REASON_NONE ) ) { handle_bad_block( sched, block, dead_reason ); return 0; @@ -2190,9 +2190,9 @@ add_block( fd_sched_t * sched, the batches sched parses. */ static int -ag_on_marker( fd_sched_t * sched, - fd_sched_block_t * block, - fd_block_marker_t const * marker ) { +on_marker( fd_sched_t * sched, + fd_sched_block_t * block, + fd_block_marker_t const * marker ) { (void)sched; switch( marker->kind ) { @@ -2245,7 +2245,7 @@ ag_on_marker( fd_sched_t * sched, /* Called when a batch header declares one or more microblocks. */ static int -ag_on_entry_batch( fd_sched_block_t * block ) { +on_entry_batch( fd_sched_block_t * block ) { if( FD_UNLIKELY( !block->header_seen ) ) { FD_LOG_INFO(( "bad block: MISSING_PARENT_MARKER, slot %lu, parent slot %lu, entries before header", block->slot, block->parent_slot )); return FD_SCHED_DEAD_REASON_MISSING_PARENT_MARKER; @@ -2265,7 +2265,7 @@ ag_on_entry_batch( fd_sched_block_t * block ) { } static int -ag_on_final( fd_sched_block_t * block ) { +on_final( fd_sched_block_t * block ) { if( FD_UNLIKELY( !block->footer_seen ) ) { FD_LOG_INFO(( "bad block: MISSING_BLOCK_FOOTER, slot %lu, parent slot %lu", block->slot, block->parent_slot )); return FD_SCHED_DEAD_REASON_MISSING_BLOCK_FOOTER; @@ -2457,11 +2457,11 @@ fd_sched_parse( fd_sched_t * sched, fd_sched_block_t * block, fd_sched_alut_ctx_ FD_LOG_INFO(( "bad block: slot %lu, unable to parse block marker (err %d)", block->slot, err )); return FD_SCHED_DEAD_REASON_BAD_BLOCK_MARKER; } - int dead_reason = ag_on_marker( sched, block, marker ); + int dead_reason = on_marker( sched, block, marker ); if( FD_UNLIKELY( dead_reason!=FD_SCHED_DEAD_REASON_NONE ) ) return dead_reason; block->fec_buf_soff = (uint)( FD_BLOCK_MARKER_PREAMBLE_SZ+FD_LOAD( ushort, block->fec_buf+FD_BLOCK_MARKER_PREAMBLE_SZ-sizeof(ushort) ) ); /* the marker is not trailing bytes */ } else if( FD_UNLIKELY( block->mblks_rem ) ) { - int dead_reason = ag_on_entry_batch( block ); + int dead_reason = on_entry_batch( block ); if( FD_UNLIKELY( dead_reason!=FD_SCHED_DEAD_REASON_NONE ) ) return dead_reason; } continue; diff --git a/src/discof/replay/test_replay_tile.c b/src/discof/replay/test_replay_tile.c index 46a8964a56f..619708248d1 100644 --- a/src/discof/replay/test_replay_tile.c +++ b/src/discof/replay/test_replay_tile.c @@ -454,7 +454,7 @@ setup_ctx( fd_replay_tile_t * ctx, /* Block-id map */ ulong bid_cnt = TEST_BANKS_MAX; - ulong chain_cnt = fd_ag_block_id_map_chain_cnt_est( bid_cnt ); + ulong chain_cnt = fd_block_id_map_chain_cnt_est( bid_cnt ); ctx->block_id_arr = fd_wksp_alloc_laddr( wksp, alignof(fd_block_id_ele_t), sizeof(fd_block_id_ele_t) * bid_cnt, 1UL ); FD_TEST( ctx->block_id_arr ); @@ -462,11 +462,11 @@ setup_ctx( fd_replay_tile_t * ctx, ctx->dead_idxs = fd_wksp_alloc_laddr( wksp, alignof(ulong), sizeof(ulong)*bid_cnt, 1UL ); FD_TEST( ctx->dead_idxs ); - void * bid_map_mem = fd_wksp_alloc_laddr( wksp, fd_ag_block_id_map_align(), fd_ag_block_id_map_footprint( chain_cnt ), 1UL ); + void * bid_map_mem = fd_wksp_alloc_laddr( wksp, fd_block_id_map_align(), fd_block_id_map_footprint( chain_cnt ), 1UL ); FD_TEST( bid_map_mem ); - ctx->ag_block_id_map_seed = 7UL; - ctx->ag_block_id_map = fd_ag_block_id_map_join( fd_ag_block_id_map_new( bid_map_mem, chain_cnt, ctx->ag_block_id_map_seed ) ); - FD_TEST( ctx->ag_block_id_map ); + ctx->block_id_map_seed = 7UL; + ctx->block_id_map = fd_block_id_map_join( fd_block_id_map_new( bid_map_mem, chain_cnt, ctx->block_id_map_seed ) ); + FD_TEST( ctx->block_id_map ); ctx->bhm_map = fd_bhm_map_join ( fd_bhm_map_new ( fd_wksp_alloc_laddr( wksp, fd_bhm_map_align(), fd_bhm_map_footprint( chain_cnt ), 1UL ), chain_cnt, 7UL ) ); ctx->bhm_pool = fd_bhm_pool_join ( fd_bhm_pool_new ( fd_wksp_alloc_laddr( wksp, fd_bhm_pool_align(), fd_bhm_pool_footprint( bid_cnt ), 1UL ), bid_cnt ) ); ctx->bhm_dlist = fd_bhm_dlist_join( fd_bhm_dlist_new( fd_wksp_alloc_laddr( wksp, fd_bhm_dlist_align(), fd_bhm_dlist_footprint(), 1UL ) ) ); @@ -543,7 +543,7 @@ setup_ctx( fd_replay_tile_t * ctx, } /* init_root fills the root bank's block id element. Callers key it in - ag_block_id_map themselves. */ + block_id_map themselves. */ static void init_root( fd_replay_tile_t * ctx, @@ -1220,16 +1220,16 @@ test_consensus_root_notification_handoff( fd_wksp_t * wksp ) { fd_blockhashes_init( &root->f.block_hash_queue, 42UL ); FD_TEST( fd_blockhashes_push_new( &root->f.block_hash_queue, &root_id ) ); - ulong chain_cnt = fd_ag_block_id_map_chain_cnt_est( bank_cnt ); + ulong chain_cnt = fd_block_id_map_chain_cnt_est( bank_cnt ); ctx->block_id_arr = fd_wksp_alloc_laddr( wksp, alignof(fd_block_id_ele_t), sizeof(fd_block_id_ele_t)*bank_cnt, 1UL ); FD_TEST( ctx->block_id_arr ); memset( ctx->block_id_arr, 0, sizeof(fd_block_id_ele_t)*bank_cnt ); ctx->dead_idxs = fd_wksp_alloc_laddr( wksp, alignof(ulong), sizeof(ulong)*bank_cnt, 1UL ); FD_TEST( ctx->dead_idxs ); - void * map_mem = fd_wksp_alloc_laddr( wksp, fd_ag_block_id_map_align(), fd_ag_block_id_map_footprint( chain_cnt ), 1UL ); + void * map_mem = fd_wksp_alloc_laddr( wksp, fd_block_id_map_align(), fd_block_id_map_footprint( chain_cnt ), 1UL ); FD_TEST( map_mem ); - ctx->ag_block_id_map = fd_ag_block_id_map_join( fd_ag_block_id_map_new( map_mem, chain_cnt, 44UL ) ); - FD_TEST( ctx->ag_block_id_map ); + ctx->block_id_map = fd_block_id_map_join( fd_block_id_map_new( map_mem, chain_cnt, 44UL ) ); + FD_TEST( ctx->block_id_map ); ctx->block_id_len = bank_cnt; ctx->max_live_slots = bank_cnt; @@ -1301,7 +1301,7 @@ test_consensus_root_notification_handoff( fd_wksp_t * wksp ) { child_ele->slot = child->f.slot; child_ele->bank_seq = child->bank_seq; child_ele->block_id_seen = 1; - FD_TEST( fd_ag_block_id_map_ele_insert( ctx->ag_block_id_map, child_ele, ctx->block_id_arr ) ); + FD_TEST( fd_block_id_map_ele_insert( ctx->block_id_map, child_ele, ctx->block_id_arr ) ); ctx->resolv_tile_cnt = 1UL; ctx->consensus_root = root_id; @@ -1412,12 +1412,12 @@ setup_rooting_ctx( fd_replay_tile_t * ctx, memset( ctx->block_id_arr, 0, sizeof(fd_block_id_ele_t)*bank_cnt ); ctx->dead_idxs = fd_wksp_alloc_laddr( wksp, alignof(ulong), sizeof(ulong)*bank_cnt, 1UL ); FD_TEST( ctx->dead_idxs ); - ulong chain_cnt = fd_ag_block_id_map_chain_cnt_est( bank_cnt ); - void * ag_map_mem = fd_wksp_alloc_laddr( wksp, fd_ag_block_id_map_align(), fd_ag_block_id_map_footprint( chain_cnt ), 1UL ); + ulong chain_cnt = fd_block_id_map_chain_cnt_est( bank_cnt ); + void * ag_map_mem = fd_wksp_alloc_laddr( wksp, fd_block_id_map_align(), fd_block_id_map_footprint( chain_cnt ), 1UL ); FD_TEST( ag_map_mem ); - ctx->ag_block_id_map_seed = 7UL; - ctx->ag_block_id_map = fd_ag_block_id_map_join( fd_ag_block_id_map_new( ag_map_mem, chain_cnt, ctx->ag_block_id_map_seed ) ); - FD_TEST( ctx->ag_block_id_map ); + ctx->block_id_map_seed = 7UL; + ctx->block_id_map = fd_block_id_map_join( fd_block_id_map_new( ag_map_mem, chain_cnt, ctx->block_id_map_seed ) ); + FD_TEST( ctx->block_id_map ); ctx->bhm_map = fd_bhm_map_join ( fd_bhm_map_new ( fd_wksp_alloc_laddr( wksp, fd_bhm_map_align(), fd_bhm_map_footprint( chain_cnt ), 1UL ), chain_cnt, 7UL ) ); ctx->bhm_pool = fd_bhm_pool_join ( fd_bhm_pool_new ( fd_wksp_alloc_laddr( wksp, fd_bhm_pool_align(), fd_bhm_pool_footprint( bank_cnt ), 1UL ), bank_cnt ) ); ctx->bhm_dlist = fd_bhm_dlist_join( fd_bhm_dlist_new( fd_wksp_alloc_laddr( wksp, fd_bhm_dlist_align(), fd_bhm_dlist_footprint(), 1UL ) ) ); @@ -1466,7 +1466,7 @@ add_replayable_block( fd_replay_tile_t * ctx, ele->slot = slot; ele->bank_seq = bank->bank_seq; ele->block_id_seen = 1; - FD_TEST( fd_ag_block_id_map_ele_insert( ctx->ag_block_id_map, ele, ctx->block_id_arr ) ); + FD_TEST( fd_block_id_map_ele_insert( ctx->block_id_map, ele, ctx->block_id_arr ) ); return bank; } @@ -1787,7 +1787,7 @@ test_root_waits_for_replay( fd_wksp_t * wksp ) { fd_bank_t * b2 = add_block( ctx, b1, 2UL, &id2 ); b2->f.total_epoch_stake = 4242UL; FD_MGAUGE_SET( REPLAY, CLUSTER_ACTIVE_STAKE_LAMPORTS, 0UL ); - try_advance_root_ag( ctx, ctx->finalized_block_id_lo ); + try_advance_root( ctx, ctx->finalized_block_id_lo ); expect_rooted( ctx, wksp, seq0, b2 ); FD_TEST( FD_MGAUGE_GET( REPLAY, CLUSTER_ACTIVE_STAKE_LAMPORTS )==4242UL ); @@ -1844,7 +1844,7 @@ test_root_out_of_order_certs( fd_wksp_t * wksp ) { /* Replay catches up using the retained finality, without another cert. */ fd_bank_t * b3 = add_block( ctx, b2, 3UL, &id3 ); - try_advance_root_ag( ctx, ctx->finalized_block_id_hi ); + try_advance_root( ctx, ctx->finalized_block_id_hi ); expect_rooted( ctx, wksp, seq0+1UL, b3 ); FD_TEST( mock_sched_root_notify_cnt==2UL ); @@ -1871,11 +1871,11 @@ test_root_lagging_replay( fd_wksp_t * wksp ) { FD_TEST( ctx->finalized_block_id_lo.slot==2UL && ctx->finalized_block_id_hi.slot==3UL ); fd_bank_t * b2 = add_block( ctx, b1, 2UL, &id2 ); - try_advance_root_ag( ctx, ctx->finalized_block_id_lo ); + try_advance_root( ctx, ctx->finalized_block_id_lo ); expect_rooted( ctx, wksp, seq0, b2 ); fd_bank_t * b3 = add_block( ctx, b2, 3UL, &id3 ); - try_advance_root_ag( ctx, ctx->finalized_block_id_hi ); + try_advance_root( ctx, ctx->finalized_block_id_hi ); expect_rooted( ctx, wksp, seq0+1UL, b3 ); FD_TEST( mock_sched_root_notify_cnt==2UL ); @@ -1903,11 +1903,11 @@ test_root_newer_first( fd_wksp_t * wksp ) { FD_TEST( ctx->finalized_block_id_hi.slot==3UL && !memcmp( ctx->finalized_block_id_hi.hash, id3.uc, sizeof(fd_hash_t) ) ); fd_bank_t * b2 = add_block( ctx, b1, 2UL, &id2 ); - try_advance_root_ag( ctx, ctx->finalized_block_id_lo ); + try_advance_root( ctx, ctx->finalized_block_id_lo ); expect_rooted( ctx, wksp, seq0, b2 ); fd_bank_t * b3 = add_block( ctx, b2, 3UL, &id3 ); - try_advance_root_ag( ctx, ctx->finalized_block_id_hi ); + try_advance_root( ctx, ctx->finalized_block_id_hi ); expect_rooted( ctx, wksp, seq0+1UL, b3 ); FD_TEST( mock_sched_root_notify_cnt==2UL ); @@ -2262,7 +2262,7 @@ test_process_rotor_fec_skip_replayed( fd_wksp_t * wksp ) { fd_block_id_ele_t * root_ele = &ctx->block_id_arr[ root_bank->idx ]; root_ele->block_info = ag_block_id( 0UL, parent_bid.uc ); root_ele->block_id_seen = 1; - FD_TEST( fd_ag_block_id_map_ele_insert( ctx->ag_block_id_map, root_ele, ctx->block_id_arr ) ); + FD_TEST( fd_block_id_map_ele_insert( ctx->block_id_map, root_ele, ctx->block_id_arr ) ); /* An ALREADY-REPLAYED complete block at slot 5 with block_id B: a live bank plus an ele keyed by {5, B} with block_id_seen=1. */ @@ -2277,7 +2277,7 @@ test_process_rotor_fec_skip_replayed( fd_wksp_t * wksp ) { ele5->latest_fec_idx = 0U; ele5->block_id_seen = 1; ele5->block_info = ag_block_id( 5UL, B.uc ); - FD_TEST( fd_ag_block_id_map_ele_insert( ctx->ag_block_id_map, ele5, ctx->block_id_arr ) ); + FD_TEST( fd_block_id_map_ele_insert( ctx->block_id_map, ele5, ctx->block_id_arr ) ); mock_sched_capacity = ULONG_MAX; ulong used0 = fd_banks_pool_used_cnt( ctx->banks ); @@ -2310,14 +2310,14 @@ test_process_rotor_fec_skip_replayed( fd_wksp_t * wksp ) { FD_TEST( mock_store_view_call_cnt==view0+1UL ); FD_TEST( mock_store_view_success_cnt==mock_store_view_release_cnt ); FD_TEST( fd_banks_pool_used_cnt( ctx->banks )==used0 ); - FD_TEST( !fd_ag_block_id_map_ele_query( ctx->ag_block_id_map, &C_key, NULL, ctx->block_id_arr ) ); + FD_TEST( !fd_block_id_map_ele_query( ctx->block_id_map, &C_key, NULL, ctx->block_id_arr ) ); FD_LOG_NOTICE(( "pass: test_process_rotor_fec_skip_replayed" )); } /* Exercises the drain_rotor_fecs gate in the ROTOR_SIG_FEC_REPLAY handler: a bank eviction breaks the replayable FEC chain, so on the - first un-replayable FEC (parent absent from ag_block_id_map -> + first un-replayable FEC (parent absent from block_id_map -> PROCESS_FEC_DROP) replay enters drain, ignores subsequent FECs, and resumes on the first replayable one (PROCESS_FEC_OK). */ static void @@ -2333,7 +2333,7 @@ test_drain_rotor_fecs( fd_wksp_t * wksp ) { FD_TEST( ctx->drain_rotor_fecs==0 ); - /* Step 1: FEC 0 whose parent is not in ag_block_id_map -> DROP -> + /* Step 1: FEC 0 whose parent is not in block_id_map -> DROP -> enter drain, notify rotor once, consume the frag. */ fd_hash_t parent_bid = { .ul = { 0xBEEFUL } }; fd_hash_t mr1 = { .ul = { 201 } }; @@ -2353,7 +2353,7 @@ test_drain_rotor_fecs( fd_wksp_t * wksp ) { FD_TEST( test_stem_seqs[ out_idx ]==seq0+1UL ); /* no new publish */ /* Step 3: make a FEC replayable. Insert the (non-prunable) root ele - into ag_block_id_map keyed by {parent_slot, parent_bid}; a FEC 0 + into block_id_map keyed by {parent_slot, parent_bid}; a FEC 0 whose parent is that entry returns PROCESS_FEC_OK, so the drain gate clears the flag before process_rotor_fec runs. (process_rotor_fec itself may then drop for lack of a store FEC -- the exit is the @@ -2362,7 +2362,7 @@ test_drain_rotor_fecs( fd_wksp_t * wksp ) { root_bank->state = FD_BANK_STATE_FROZEN; /* valid, non-prunable parent */ fd_block_id_ele_t * root_ele = &ctx->block_id_arr[ root_bank->idx ]; root_ele->block_info = ag_block_id( 3UL, parent_bid.uc ); - FD_TEST( fd_ag_block_id_map_ele_insert( ctx->ag_block_id_map, root_ele, ctx->block_id_arr ) ); + FD_TEST( fd_block_id_map_ele_insert( ctx->block_id_map, root_ele, ctx->block_id_arr ) ); mock_sched_capacity = ULONG_MAX; /* sched has room */ fd_hash_t mr3 = { .ul = { 203 } }; @@ -2414,14 +2414,14 @@ test_drain_rotor_fecs_skip_wait_reentry( fd_wksp_t * wksp ) { skip_ele->bank_seq = 0UL; skip_ele->latest_fec_idx = 0U; skip_ele->block_info = ag_block_id( 5UL, zero.uc ); - FD_TEST( fd_ag_block_id_map_ele_insert( ctx->ag_block_id_map, skip_ele, ctx->block_id_arr ) ); + FD_TEST( fd_block_id_map_ele_insert( ctx->block_id_map, skip_ele, ctx->block_id_arr ) ); ulong out_idx = ctx->replay_out->idx; ulong seq0 = test_stem_seqs[ out_idx ]; FD_TEST( ctx->drain_rotor_fecs==0 ); /* Step 1: enter drain via DROP (fec 0 whose parent {0, parent_bid} is - absent from ag_block_id_map). One MISSING_FEC publish. */ + absent from block_id_map). One MISSING_FEC publish. */ fd_hash_t parent_bid = { .ul = { 0xBEEFUL } }; fd_hash_t mr1 = { .ul = { 201 } }; FD_TEST( deliver_rotor_fec( ctx, 1UL, 0U, 0UL, &parent_bid, &mr1, 0, 0 )==0 ); @@ -2442,7 +2442,7 @@ test_drain_rotor_fecs_skip_wait_reentry( fd_wksp_t * wksp ) { not swallowed. */ fd_block_id_ele_t * root_ele = &ctx->block_id_arr[ root_bank->idx ]; root_ele->block_info = ag_block_id( 0UL, parent_bid.uc ); - FD_TEST( fd_ag_block_id_map_ele_insert( ctx->ag_block_id_map, root_ele, ctx->block_id_arr ) ); + FD_TEST( fd_block_id_map_ele_insert( ctx->block_id_map, root_ele, ctx->block_id_arr ) ); root_bank->state = FD_BANK_STATE_PRUNABLE; fd_hash_t mr3 = { .ul = { 203 } }; FD_TEST( deliver_rotor_fec( ctx, 8UL, 0U, 0UL, &parent_bid, &mr3, 0, 0 )==1 ); /* kept for retry */ @@ -2487,7 +2487,7 @@ setup_ag_root( fd_replay_tile_t * ctx, fd_block_id_ele_t * root_ele = &ctx->block_id_arr[ root_bank->idx ]; root_ele->block_info = ag_block_id( 0UL, parent_bid->uc ); root_ele->block_id_seen = 1; - FD_TEST( fd_ag_block_id_map_ele_insert( ctx->ag_block_id_map, root_ele, ctx->block_id_arr ) ); + FD_TEST( fd_block_id_map_ele_insert( ctx->block_id_map, root_ele, ctx->block_id_arr ) ); mock_sched_capacity = ULONG_MAX; } @@ -2541,9 +2541,9 @@ test_rotor_fec_turbine_keying( fd_wksp_t * wksp ) { FD_TEST( deliver_rotor_fec_bid( ctx, 5UL, 0U, 0UL, &parent_bid, &B, &mr0, 0, 0 )==0 ); FD_TEST( fd_banks_pool_used_cnt( ctx->banks )==used0+1UL ); FD_TEST( mock_sched_fec_ingest_cnt==ing0+1UL ); - fd_block_id_ele_t * ele5 = fd_ag_block_id_map_ele_query( ctx->ag_block_id_map, &key_slot, NULL, ctx->block_id_arr ); + fd_block_id_ele_t * ele5 = fd_block_id_map_ele_query( ctx->block_id_map, &key_slot, NULL, ctx->block_id_arr ); FD_TEST( ele5 ); - FD_TEST( !fd_ag_block_id_map_ele_query( ctx->ag_block_id_map, &key_id, NULL, ctx->block_id_arr ) ); + FD_TEST( !fd_block_id_map_ele_query( ctx->block_id_map, &key_id, NULL, ctx->block_id_arr ) ); FD_TEST( ele5->latest_fec_idx==0U && !ele5->block_id_seen ); FD_TEST( ctx->drain_rotor_fecs==0 && test_stem_seqs[ out_idx ]==seq0 ); @@ -2575,8 +2575,8 @@ test_rotor_fec_turbine_keying( fd_wksp_t * wksp ) { FD_TEST( deliver_rotor_fec_bid( ctx, 5UL, 2U*FD_FEC_SHRED_CNT, 0UL, &parent_bid, &B, &mr64, 1, 0 )==0 ); FD_TEST( ctx->drain_rotor_fecs==0 ); FD_TEST( ele5->block_id_seen ); - FD_TEST( fd_ag_block_id_map_ele_query( ctx->ag_block_id_map, &key_id, NULL, ctx->block_id_arr )==ele5 ); - FD_TEST( !fd_ag_block_id_map_ele_query( ctx->ag_block_id_map, &key_slot, NULL, ctx->block_id_arr ) ); + FD_TEST( fd_block_id_map_ele_query( ctx->block_id_map, &key_id, NULL, ctx->block_id_arr )==ele5 ); + FD_TEST( !fd_block_id_map_ele_query( ctx->block_id_map, &key_slot, NULL, ctx->block_id_arr ) ); FD_TEST( mock_sched_fec_ingest_cnt==ing0+3UL ); FD_TEST( deliver_rotor_fec( ctx, 6UL, 0U, 5UL, &B, &mr6, 0, 0 )==0 ); @@ -2653,7 +2653,7 @@ rotor_fec_merged_copies( fd_wksp_t * wksp, } for( uint k=e_cnt; k<3U; k++ ) FD_TEST( deliver_rotor_fec_bid( ctx, 5UL, k*FD_FEC_SHRED_CNT, 0UL, &parent_bid, &B, &mr[ k ], k==2U, 0 )==0 ); - fd_block_id_ele_t * ele = fd_ag_block_id_map_ele_query( ctx->ag_block_id_map, &key_id, NULL, ctx->block_id_arr ); + fd_block_id_ele_t * ele = fd_block_id_map_ele_query( ctx->block_id_map, &key_id, NULL, ctx->block_id_arr ); FD_TEST( ele && ele->block_id_seen && ele->latest_fec_idx==2U*FD_FEC_SHRED_CNT ); FD_TEST( ctx->drain_rotor_fecs==0 && test_stem_seqs[ out_idx ]==seq0 ); @@ -2703,7 +2703,7 @@ test_dead_block_children_drop( fd_wksp_t * wksp ) { FD_TEST( deliver_rotor_fec ( ctx, 5UL, 0U, 0UL, &parent_bid, &mr0, 0, 0 )==0 ); FD_TEST( deliver_rotor_fec_bid( ctx, 5UL, FD_FEC_SHRED_CNT, 0UL, &parent_bid, &B, &mr32, 1, 0 )==0 ); ag_block_id_t key5 = ag_block_id( 5UL, B.uc ); - fd_block_id_ele_t * ele5 = fd_ag_block_id_map_ele_query( ctx->ag_block_id_map, &key5, NULL, ctx->block_id_arr ); + fd_block_id_ele_t * ele5 = fd_block_id_map_ele_query( ctx->block_id_map, &key5, NULL, ctx->block_id_arr ); FD_TEST( ele5 && ele5->block_id_seen ); ulong idx5 = fd_block_id_ele_get_idx( ctx->block_id_arr, ele5 ); fd_bank_t * bank5 = fd_banks_bank_query( ctx->banks, idx5 ); @@ -2791,12 +2791,12 @@ test_stale_id_key_does_not_shadow_rebuild( fd_wksp_t * wksp ) { FD_TEST( deliver_rotor_fec_bid( ctx, 6UL, FD_FEC_SHRED_CNT, 0UL, &parent_bid, &B6, &mr6_32, 1, 0 )==0 ); ag_block_id_t key5_id = ag_block_id( 5UL, B5.uc ); ag_block_id_t key5_slot = { .slot = 5UL }; - fd_block_id_ele_t * stale = fd_ag_block_id_map_ele_query( ctx->ag_block_id_map, &key5_id, NULL, ctx->block_id_arr ); + fd_block_id_ele_t * stale = fd_block_id_map_ele_query( ctx->block_id_map, &key5_id, NULL, ctx->block_id_arr ); FD_TEST( stale && stale->block_id_seen ); ulong idx5 = fd_block_id_ele_get_idx( ctx->block_id_arr, stale ); for( ulong slot=5UL; slot<=6UL; slot++ ) { ag_block_id_t key = ag_block_id( slot, slot==5UL ? B5.uc : B6.uc ); - fd_block_id_ele_t * ele = fd_ag_block_id_map_ele_query( ctx->ag_block_id_map, &key, NULL, ctx->block_id_arr ); + fd_block_id_ele_t * ele = fd_block_id_map_ele_query( ctx->block_id_map, &key, NULL, ctx->block_id_arr ); ulong idx = fd_block_id_ele_get_idx( ctx->block_id_arr, ele ); fd_bank_t * b = fd_banks_bank_query( ctx->banks, idx ); b->state = FD_BANK_STATE_REPLAYABLE; @@ -2806,7 +2806,7 @@ test_stale_id_key_does_not_shadow_rebuild( fd_wksp_t * wksp ) { FD_TEST( fd_banks_prune_one_bank( ctx->banks, cancel ) ); FD_TEST( !fd_banks_bank_query( ctx->banks, idx ) ); } - FD_TEST( fd_ag_block_id_map_ele_query( ctx->ag_block_id_map, &key5_id, NULL, ctx->block_id_arr )==stale ); + FD_TEST( fd_block_id_map_ele_query( ctx->block_id_map, &key5_id, NULL, ctx->block_id_arr )==stale ); ulong used0 = fd_banks_pool_used_cnt( ctx->banks ); ulong ing0 = mock_sched_fec_ingest_cnt; ulong seq0 = test_stem_seqs[ out_idx ]; @@ -2817,10 +2817,10 @@ test_stale_id_key_does_not_shadow_rebuild( fd_wksp_t * wksp ) { FD_TEST( deliver_rotor_fec_bid( ctx, 5UL, 0U, 0UL, &parent_bid, &B5, &mr5_0, 0, 0 )==0 ); FD_TEST( fd_banks_pool_used_cnt( ctx->banks )==used0+1UL ); FD_TEST( mock_sched_fec_ingest_cnt==ing0+1UL ); - fd_block_id_ele_t * live = fd_ag_block_id_map_ele_query( ctx->ag_block_id_map, &key5_slot, NULL, ctx->block_id_arr ); + fd_block_id_ele_t * live = fd_block_id_map_ele_query( ctx->block_id_map, &key5_slot, NULL, ctx->block_id_arr ); FD_TEST( live && live!=stale && !live->block_id_seen && live->latest_fec_idx==0U ); FD_TEST( fd_block_id_ele_get_idx( ctx->block_id_arr, live )!=idx5 ); - FD_TEST( fd_ag_block_id_map_ele_query( ctx->ag_block_id_map, &key5_id, NULL, ctx->block_id_arr )==stale ); + FD_TEST( fd_block_id_map_ele_query( ctx->block_id_map, &key5_id, NULL, ctx->block_id_arr )==stale ); ulong idx_live = fd_block_id_ele_get_idx( ctx->block_id_arr, live ); /* The same FEC 0 again: the stale id hit has no live bank, so the slot @@ -2828,7 +2828,7 @@ test_stale_id_key_does_not_shadow_rebuild( fd_wksp_t * wksp ) { FD_TEST( deliver_rotor_fec_bid( ctx, 5UL, 0U, 0UL, &parent_bid, &B5, &mr5_0, 0, 0 )==0 ); FD_TEST( fd_banks_pool_used_cnt( ctx->banks )==used0+1UL ); FD_TEST( mock_sched_fec_ingest_cnt==ing0+1UL ); - FD_TEST( fd_ag_block_id_map_ele_query( ctx->ag_block_id_map, &key5_slot, NULL, ctx->block_id_arr )==live ); + FD_TEST( fd_block_id_map_ele_query( ctx->block_id_map, &key5_slot, NULL, ctx->block_id_arr )==live ); FD_TEST( fd_banks_bank_query( ctx->banks, idx_live ) ); FD_TEST( test_stem_seqs[ out_idx ]==seq0 ); @@ -2836,9 +2836,9 @@ test_stale_id_key_does_not_shadow_rebuild( fd_wksp_t * wksp ) { {5, B5}, displacing the stale entry. */ FD_TEST( deliver_rotor_fec_bid( ctx, 5UL, FD_FEC_SHRED_CNT, 0UL, &parent_bid, &B5, &mr5_32, 1, 0 )==0 ); FD_TEST( mock_sched_fec_ingest_cnt==ing0+2UL ); - FD_TEST( fd_ag_block_id_map_ele_query( ctx->ag_block_id_map, &key5_id, NULL, ctx->block_id_arr )==live ); + FD_TEST( fd_block_id_map_ele_query( ctx->block_id_map, &key5_id, NULL, ctx->block_id_arr )==live ); FD_TEST( live->block_id_seen ); - FD_TEST( !fd_ag_block_id_map_ele_query( ctx->ag_block_id_map, &key5_slot, NULL, ctx->block_id_arr ) ); + FD_TEST( !fd_block_id_map_ele_query( ctx->block_id_map, &key5_slot, NULL, ctx->block_id_arr ) ); FD_LOG_NOTICE(( "pass: test_stale_id_key_does_not_shadow_rebuild" )); } @@ -2949,13 +2949,13 @@ test_ag_set_identity_leader_slot( fd_wksp_t * wksp, FD_TEST( ctx->halt_replay && keyswitch->state==FD_KEYSWITCH_STATE_COMPLETED ); FD_TEST( keyswitch->result==7UL ); /* votor reads replay_slot */ FD_TEST( fd_pubkey_eq( ctx->identity_pubkey, &new_identity ) ); - FD_TEST( !try_become_leader_ag( ctx, test_stem, FD_METRICS_SAMPLE_REASON_LEADER_START, 0UL ) ); + FD_TEST( !try_become_leader( ctx, test_stem, FD_METRICS_SAMPLE_REASON_LEADER_START, 0UL ) ); fd_keyswitch_state( keyswitch, FD_KEYSWITCH_STATE_UNHALT_PENDING ); during_housekeeping( ctx ); FD_TEST( !ctx->halt_replay && keyswitch->state==FD_KEYSWITCH_STATE_COMPLETED ); - FD_TEST( try_become_leader_ag( ctx, test_stem, FD_METRICS_SAMPLE_REASON_LEADER_START, 0UL )==same_identity ); + FD_TEST( try_become_leader( ctx, test_stem, FD_METRICS_SAMPLE_REASON_LEADER_START, 0UL )==same_identity ); FD_TEST( ctx->is_leader==same_identity ); if( !same_identity ) FD_TEST( ctx->next_leader_slot==ULONG_MAX ); @@ -3061,7 +3061,7 @@ test_ag_leader_abandon_on_root_past_leader_slot( fd_wksp_t * wksp ) { FD_TEST( ctx->vote_tracker ); ctx->slot_out_seq = fd_mcache_seq_laddr_const( test_stem_mcaches[ ctx->slot_out->idx ] ); - FD_TEST( try_become_leader_ag( ctx, test_stem, FD_METRICS_SAMPLE_REASON_LEADER_START, 0UL ) ); + FD_TEST( try_become_leader( ctx, test_stem, FD_METRICS_SAMPLE_REASON_LEADER_START, 0UL ) ); fd_bank_t * leader = ctx->leader_bank; FD_TEST( ctx->is_leader && leader && leader->f.slot==2UL && leader->refcnt==1UL ); ulong leader_idx = leader->idx; @@ -3091,7 +3091,7 @@ test_ag_leader_abandon_on_root_past_leader_slot( fd_wksp_t * wksp ) { /* The cluster finalizes a sibling of our slot. Replay roots it, but the handoff stays gated on is_leader. */ fd_bank_t * b3 = add_block( ctx, b1, 3UL, &id3 ); - try_advance_root_ag( ctx, ag_block_id( 3UL, id3.uc ) ); + try_advance_root( ctx, ag_block_id( 3UL, id3.uc ) ); FD_TEST( ctx->consensus_root_slot==3UL ); FD_TEST( ctx->is_leader ); FD_TEST( !try_notify_consensus_root( ctx, test_stem ) ); @@ -3153,20 +3153,20 @@ test_ag_become_leader_refuses_settled_slot( fd_wksp_t * wksp ) { fd_bank_t * b1 = setup_ag_leader_ctx( ctx, wksp, &root_id, &id1 ); ctx->votor_final->slot = 3UL; - FD_TEST( !try_become_leader_ag( ctx, test_stem, FD_METRICS_SAMPLE_REASON_LEADER_START, 0UL ) ); + FD_TEST( !try_become_leader( ctx, test_stem, FD_METRICS_SAMPLE_REASON_LEADER_START, 0UL ) ); FD_TEST( !ctx->is_leader && ctx->next_leader_slot==ULONG_MAX ); ctx->votor_final->slot = ULONG_MAX; ctx->next_leader_slot = 2UL; ctx->consensus_root_slot = 3UL; ctx->consensus_root = id3; - FD_TEST( !try_become_leader_ag( ctx, test_stem, FD_METRICS_SAMPLE_REASON_LEADER_START, 0UL ) ); + FD_TEST( !try_become_leader( ctx, test_stem, FD_METRICS_SAMPLE_REASON_LEADER_START, 0UL ) ); FD_TEST( !ctx->is_leader && ctx->next_leader_slot==ULONG_MAX ); ctx->next_leader_slot = 2UL; ctx->consensus_root_slot = 1UL; ctx->consensus_root = other1; - FD_TEST( !try_become_leader_ag( ctx, test_stem, FD_METRICS_SAMPLE_REASON_LEADER_START, 0UL ) ); + FD_TEST( !try_become_leader( ctx, test_stem, FD_METRICS_SAMPLE_REASON_LEADER_START, 0UL ) ); FD_TEST( !ctx->is_leader && ctx->next_leader_slot==ULONG_MAX ); /* The cluster already produced a slot of the window (the network's @@ -3176,7 +3176,7 @@ test_ag_become_leader_refuses_settled_slot( fd_wksp_t * wksp ) { fd_hash_t net3 = { .ul = { 403UL } }; fd_bank_t * b3 = add_replayable_block( ctx, b1, 3UL, &net3 ); ulong produced0 = ctx->metrics.leader_slot_already_produced; - FD_TEST( !try_become_leader_ag( ctx, test_stem, FD_METRICS_SAMPLE_REASON_LEADER_START, 0UL ) ); + FD_TEST( !try_become_leader( ctx, test_stem, FD_METRICS_SAMPLE_REASON_LEADER_START, 0UL ) ); FD_TEST( !ctx->is_leader && ctx->next_leader_slot==ULONG_MAX ); FD_TEST( ctx->metrics.leader_slot_already_produced==produced0+1UL ); b3->bank_seq++; /* the network block goes away */ @@ -3192,7 +3192,7 @@ test_ag_become_leader_refuses_settled_slot( fd_wksp_t * wksp ) { FD_TEST( !returnable_frag( ctx, TEST_VOTOR_IN_IDX, 0UL, FD_VOTOR_SIG_PARENT_READY, chunk, sizeof(fd_votor_msg_t), 0UL, 0UL, 0UL, test_stem ) ); produced0 = ctx->metrics.leader_slot_already_produced; ulong superseded0 = ctx->metrics.leader_window_superseded; - FD_TEST( !try_become_leader_ag( ctx, test_stem, FD_METRICS_SAMPLE_REASON_LEADER_START, 0UL ) ); + FD_TEST( !try_become_leader( ctx, test_stem, FD_METRICS_SAMPLE_REASON_LEADER_START, 0UL ) ); FD_TEST( !ctx->is_leader && ctx->next_leader_slot==ULONG_MAX ); FD_TEST( ctx->metrics.leader_window_superseded==superseded0+1UL ); FD_TEST( ctx->metrics.leader_slot_already_produced==produced0 ); /* nothing was produced */ @@ -3201,7 +3201,7 @@ test_ag_become_leader_refuses_settled_slot( fd_wksp_t * wksp ) { /* Rooted at the parent itself: lead. */ ctx->next_leader_slot = 2UL; ctx->consensus_root = id1; - FD_TEST( try_become_leader_ag( ctx, test_stem, FD_METRICS_SAMPLE_REASON_LEADER_START, 0UL ) ); + FD_TEST( try_become_leader( ctx, test_stem, FD_METRICS_SAMPLE_REASON_LEADER_START, 0UL ) ); FD_TEST( ctx->is_leader && ctx->leader_bank->f.slot==2UL ); fd_bank_t * leader = ctx->leader_bank; @@ -3240,7 +3240,7 @@ test_ag_leader_fec_not_gated( fd_wksp_t * wksp ) { fd_hash_t id1 = { .ul = { 201UL } }; fd_hash_t id2 = { .ul = { 202UL } }; fd_bank_t * b1 = setup_ag_leader_ctx( ctx, wksp, &root_id, &id1 ); - FD_TEST( try_become_leader_ag( ctx, test_stem, FD_METRICS_SAMPLE_REASON_LEADER_START, 0UL ) ); + FD_TEST( try_become_leader( ctx, test_stem, FD_METRICS_SAMPLE_REASON_LEADER_START, 0UL ) ); fd_bank_t * leader = ctx->leader_bank; fd_bank_t * tip = b1; @@ -3272,7 +3272,7 @@ test_ag_leader_fec_not_gated( fd_wksp_t * wksp ) { fd_block_id_ele_t * ele = &ctx->block_id_arr[ leader->idx ]; FD_TEST( ele->block_id_seen && fd_hash_eq( &ele->dmr, &id2 ) ); ag_block_id_t key2 = ag_block_id( 2UL, id2.uc ); - FD_TEST( fd_ag_block_id_map_ele_query( ctx->ag_block_id_map, &key2, NULL, ctx->block_id_arr )==ele ); + FD_TEST( fd_block_id_map_ele_query( ctx->block_id_map, &key2, NULL, ctx->block_id_arr )==ele ); FD_TEST( !ctx->drain_rotor_fecs && test_stem_seqs[ ctx->replay_out->idx ]==seq0 ); mock_sched_capacity = ULONG_MAX; @@ -3324,12 +3324,12 @@ setup_snapshot_test_ctx( fd_replay_tile_t * ctx, FD_TEST( ctx->block_id_arr ); memset( ctx->block_id_arr, 0, sizeof(fd_block_id_ele_t)*bank_cnt ); - ulong ag_chain_cnt = fd_ag_block_id_map_chain_cnt_est( bank_cnt ); - void * ag_map_mem = fd_wksp_alloc_laddr( wksp, fd_ag_block_id_map_align(), fd_ag_block_id_map_footprint( ag_chain_cnt ), 1UL ); + ulong ag_chain_cnt = fd_block_id_map_chain_cnt_est( bank_cnt ); + void * ag_map_mem = fd_wksp_alloc_laddr( wksp, fd_block_id_map_align(), fd_block_id_map_footprint( ag_chain_cnt ), 1UL ); FD_TEST( ag_map_mem ); - ctx->ag_block_id_map_seed = 7UL; - ctx->ag_block_id_map = fd_ag_block_id_map_join( fd_ag_block_id_map_new( ag_map_mem, ag_chain_cnt, ctx->ag_block_id_map_seed ) ); - FD_TEST( ctx->ag_block_id_map ); + ctx->block_id_map_seed = 7UL; + ctx->block_id_map = fd_block_id_map_join( fd_block_id_map_new( ag_map_mem, ag_chain_cnt, ctx->block_id_map_seed ) ); + FD_TEST( ctx->block_id_map ); ctx->block_id_len = bank_cnt; @@ -3666,14 +3666,14 @@ test_wfs_leader_gate( fd_wksp_t * wksp ) { ctx->next_leader_slot = 101UL; ctx->is_leader = 0; - /* Blocked by wfs_complete==0. try_become_leader_ag short-circuits on + /* Blocked by wfs_complete==0. try_become_leader short-circuits on an OR, so pin every earlier term open (replay_out->idx==ULONG_MAX in particular would return 0 on its own and hide the WFS gate). */ FD_TEST( ctx->next_leader_slot!=ULONG_MAX ); FD_TEST( !ctx->is_leader ); FD_TEST( ctx->replay_out->idx!=ULONG_MAX ); FD_TEST( !ctx->wfs_complete ); - FD_TEST( try_become_leader_ag( ctx, test_stem, FD_METRICS_SAMPLE_REASON_LEADER_START, 0UL )==0 ); + FD_TEST( try_become_leader( ctx, test_stem, FD_METRICS_SAMPLE_REASON_LEADER_START, 0UL )==0 ); /* after_credit returns immediately when wfs_complete==0. If the gate didn't fire, it would crash on our minimal ctx. */