Skip to content

Commit

Permalink
flamenco: fix hashes_per_tick feature activation
Browse files Browse the repository at this point in the history
  • Loading branch information
yufeng-jump committed Jan 7, 2025
1 parent 52ef7cf commit 29f6d95
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/flamenco/runtime/fd_runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -2731,15 +2731,15 @@ void fd_process_new_epoch( fd_exec_slot_ctx_t * slot_ctx,

/* Change the speed of the poh clock
https://github.com/anza-xyz/agave/blob/v2.1.0/runtime/src/bank.rs#L6627-L6649 */
if( FD_FEATURE_ACTIVE( slot_ctx, update_hashes_per_tick6 ) ) {
if( FD_FEATURE_JUST_ACTIVATED( slot_ctx, update_hashes_per_tick6 ) ) {
epoch_bank->hashes_per_tick = UPDATED_HASHES_PER_TICK6;
} else if( FD_FEATURE_ACTIVE(slot_ctx, update_hashes_per_tick5 ) ) {
} else if( FD_FEATURE_JUST_ACTIVATED(slot_ctx, update_hashes_per_tick5 ) ) {
epoch_bank->hashes_per_tick = UPDATED_HASHES_PER_TICK5;
} else if( FD_FEATURE_ACTIVE( slot_ctx, update_hashes_per_tick4 ) ) {
} else if( FD_FEATURE_JUST_ACTIVATED( slot_ctx, update_hashes_per_tick4 ) ) {
epoch_bank->hashes_per_tick = UPDATED_HASHES_PER_TICK4;
} else if( FD_FEATURE_ACTIVE(slot_ctx, update_hashes_per_tick3 ) ) {
} else if( FD_FEATURE_JUST_ACTIVATED(slot_ctx, update_hashes_per_tick3 ) ) {
epoch_bank->hashes_per_tick = UPDATED_HASHES_PER_TICK3;
} else if( FD_FEATURE_ACTIVE(slot_ctx, update_hashes_per_tick2 ) ) {
} else if( FD_FEATURE_JUST_ACTIVATED(slot_ctx, update_hashes_per_tick2 ) ) {
epoch_bank->hashes_per_tick = UPDATED_HASHES_PER_TICK2;
}

Expand Down
1 change: 1 addition & 0 deletions src/flamenco/runtime/fd_runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#define FD_RUNTIME_NUM_ROOT_BLOCKS (32UL)

#define FD_FEATURE_ACTIVE(_slot_ctx, _feature_name) (_slot_ctx->slot_bank.slot >= _slot_ctx->epoch_ctx->features. _feature_name)
#define FD_FEATURE_JUST_ACTIVATED(_slot_ctx, _feature_name) (_slot_ctx->slot_bank.slot == _slot_ctx->epoch_ctx->features. _feature_name)

#define FD_BLOCKHASH_QUEUE_MAX_ENTRIES (300UL)
#define FD_RECENT_BLOCKHASHES_MAX_ENTRIES (150UL)
Expand Down

0 comments on commit 29f6d95

Please sign in to comment.