@@ -603,22 +603,21 @@ replay_block_start( fd_replay_tile_t * ctx,
603603
604604 fd_bank_has_identity_vote_set ( bank , 0 );
605605
606- /* Set the tick height. */
607- fd_bank_tick_height_set ( bank , fd_bank_max_tick_height_get ( bank ) );
608-
609606 /* Update block height. */
610607 fd_bank_block_height_set ( bank , fd_bank_block_height_get ( bank ) + 1UL );
611608
612- ulong * max_tick_height = fd_bank_max_tick_height_modify ( bank );
613- ulong ticks_per_slot = fd_bank_ticks_per_slot_get ( bank );
614- if ( FD_UNLIKELY ( FD_RUNTIME_EXECUTE_SUCCESS != fd_runtime_compute_max_tick_height ( ticks_per_slot , slot , max_tick_height ) ) ) {
615- FD_LOG_CRIT (( "couldn't compute tick height/max tick height slot %lu ticks_per_slot %lu" , slot , ticks_per_slot ));
616- }
617-
618609 int is_epoch_boundary = 0 ;
619610 fd_runtime_block_execute_prepare ( ctx -> banks , bank , ctx -> accdb , & ctx -> runtime_stack , ctx -> capture_ctx , & is_epoch_boundary );
620611 if ( FD_UNLIKELY ( is_epoch_boundary ) ) publish_stake_weights ( ctx , stem , bank , 1 );
621612
613+ ulong max_tick_height ;
614+ if ( FD_UNLIKELY ( FD_RUNTIME_EXECUTE_SUCCESS != fd_runtime_compute_max_tick_height ( fd_bank_ticks_per_slot_get ( bank ), slot , & max_tick_height ) ) ) {
615+ FD_LOG_CRIT (( "couldn't compute tick height/max tick height slot %lu ticks_per_slot %lu" , slot , fd_bank_ticks_per_slot_get ( bank ) ));
616+ }
617+ fd_bank_max_tick_height_set ( bank , max_tick_height );
618+ fd_bank_tick_height_set ( bank , fd_bank_max_tick_height_get ( parent_bank ) ); /* The parent's max tick height is our starting tick height. */
619+ fd_sched_set_poh_params ( ctx -> sched , bank -> idx , fd_bank_tick_height_get ( bank ), fd_bank_max_tick_height_get ( bank ), fd_bank_hashes_per_tick_get ( bank ), fd_bank_poh_query ( parent_bank ) );
620+
622621 return bank ;
623622}
624623
@@ -1525,7 +1524,7 @@ dispatch_task( fd_replay_tile_t * ctx,
15251524
15261525 fd_replay_out_link_t * exec_out = ctx -> exec_out ;
15271526 fd_exec_txn_exec_msg_t * exec_msg = fd_chunk_to_laddr ( exec_out -> mem , exec_out -> chunk );
1528- memcpy ( & exec_msg -> txn , txn_p , sizeof (fd_txn_p_t ) );
1527+ memcpy ( exec_msg -> txn , txn_p , sizeof (fd_txn_p_t ) );
15291528 exec_msg -> bank_idx = task -> txn_exec -> bank_idx ;
15301529 exec_msg -> txn_idx = task -> txn_exec -> txn_idx ;
15311530 fd_stem_publish ( stem , exec_out -> idx , (FD_EXEC_TT_TXN_EXEC <<32 ) | task -> txn_exec -> exec_idx , exec_out -> chunk , sizeof (* exec_msg ), 0UL , 0UL , fd_frag_meta_ts_comp ( fd_tickcount () ) );
@@ -1540,13 +1539,27 @@ dispatch_task( fd_replay_tile_t * ctx,
15401539
15411540 fd_replay_out_link_t * exec_out = ctx -> exec_out ;
15421541 fd_exec_txn_sigverify_msg_t * exec_msg = fd_chunk_to_laddr ( exec_out -> mem , exec_out -> chunk );
1543- memcpy ( & exec_msg -> txn , txn_p , sizeof (fd_txn_p_t ) );
1542+ memcpy ( exec_msg -> txn , txn_p , sizeof (fd_txn_p_t ) );
15441543 exec_msg -> bank_idx = task -> txn_sigverify -> bank_idx ;
15451544 exec_msg -> txn_idx = task -> txn_sigverify -> txn_idx ;
15461545 fd_stem_publish ( stem , exec_out -> idx , (FD_EXEC_TT_TXN_SIGVERIFY <<32 ) | task -> txn_sigverify -> exec_idx , exec_out -> chunk , sizeof (* exec_msg ), 0UL , 0UL , 0UL );
15471546 exec_out -> chunk = fd_dcache_compact_next ( exec_out -> chunk , sizeof (* exec_msg ), exec_out -> chunk0 , exec_out -> wmark );
15481547 break ;
15491548 };
1549+ case FD_SCHED_TT_POH_HASH : {
1550+ fd_bank_t * bank = fd_banks_bank_query ( ctx -> banks , task -> poh_hash -> bank_idx );
1551+ bank -> refcnt ++ ;
1552+
1553+ fd_replay_out_link_t * exec_out = ctx -> exec_out ;
1554+ fd_exec_poh_hash_msg_t * exec_msg = fd_chunk_to_laddr ( exec_out -> mem , exec_out -> chunk );
1555+ exec_msg -> bank_idx = task -> poh_hash -> bank_idx ;
1556+ exec_msg -> mblk_idx = task -> poh_hash -> mblk_idx ;
1557+ exec_msg -> hashcnt = task -> poh_hash -> hashcnt ;
1558+ memcpy ( exec_msg -> hash , task -> poh_hash -> hash , sizeof (fd_hash_t ) );
1559+ fd_stem_publish ( stem , exec_out -> idx , (FD_EXEC_TT_POH_HASH <<32 ) | task -> poh_hash -> exec_idx , exec_out -> chunk , sizeof (* exec_msg ), 0UL , 0UL , 0UL );
1560+ exec_out -> chunk = fd_dcache_compact_next ( exec_out -> chunk , sizeof (* exec_msg ), exec_out -> chunk0 , exec_out -> wmark );
1561+ break ;
1562+ };
15501563 default : {
15511564 FD_LOG_CRIT (( "unexpected task type %lu" , task -> task_type ));
15521565 }
@@ -1571,22 +1584,29 @@ replay( fd_replay_tile_t * ctx,
15711584 switch ( task -> task_type ) {
15721585 case FD_SCHED_TT_BLOCK_START : {
15731586 replay_block_start ( ctx , stem , task -> block_start -> bank_idx , task -> block_start -> parent_bank_idx , task -> block_start -> slot );
1574- fd_sched_task_done ( ctx -> sched , FD_SCHED_TT_BLOCK_START , ULONG_MAX , ULONG_MAX );
1587+ fd_sched_task_done ( ctx -> sched , FD_SCHED_TT_BLOCK_START , ULONG_MAX , ULONG_MAX , NULL );
15751588 break ;
15761589 }
15771590 case FD_SCHED_TT_BLOCK_END : {
15781591 fd_bank_t * bank = fd_banks_bank_query ( ctx -> banks , task -> block_end -> bank_idx );
15791592 if ( FD_LIKELY ( !(bank -> flags & FD_BANK_FLAGS_DEAD ) ) ) replay_block_finalize ( ctx , stem , bank );
1580- fd_sched_task_done ( ctx -> sched , FD_SCHED_TT_BLOCK_END , ULONG_MAX , ULONG_MAX );
1593+ fd_sched_task_done ( ctx -> sched , FD_SCHED_TT_BLOCK_END , ULONG_MAX , ULONG_MAX , NULL );
15811594 break ;
15821595 }
15831596 case FD_SCHED_TT_TXN_EXEC :
1584- case FD_SCHED_TT_TXN_SIGVERIFY : {
1597+ case FD_SCHED_TT_TXN_SIGVERIFY :
1598+ case FD_SCHED_TT_POH_HASH : {
15851599 /* Likely/common case: we have a transaction we actually need to
15861600 execute. */
15871601 dispatch_task ( ctx , stem , task );
15881602 break ;
15891603 }
1604+ case FD_SCHED_TT_MARK_DEAD : {
1605+ fd_bank_t * bank = fd_banks_bank_query ( ctx -> banks , task -> mark_dead -> bank_idx );
1606+ publish_slot_dead ( ctx , stem , bank );
1607+ fd_banks_mark_bank_dead ( ctx -> banks , bank );
1608+ break ;
1609+ }
15901610 default : {
15911611 FD_LOG_CRIT (( "unexpected task type %lu" , task -> task_type ));
15921612 }
@@ -1976,7 +1996,8 @@ process_exec_task_done( fd_replay_tile_t * ctx,
19761996 if ( FD_UNLIKELY ( (bank -> flags & FD_BANK_FLAGS_DEAD ) && bank -> refcnt == 0UL ) ) {
19771997 fd_banks_mark_bank_frozen ( ctx -> banks , bank );
19781998 }
1979- fd_sched_task_done ( ctx -> sched , FD_SCHED_TT_TXN_EXEC , msg -> txn_exec -> txn_idx , exec_tile_idx );
1999+ int res = fd_sched_task_done ( ctx -> sched , FD_SCHED_TT_TXN_EXEC , msg -> txn_exec -> txn_idx , exec_tile_idx , NULL );
2000+ FD_TEST ( res == 0 );
19802001 break ;
19812002 }
19822003 case FD_EXEC_TT_TXN_SIGVERIFY : {
@@ -1991,7 +2012,17 @@ process_exec_task_done( fd_replay_tile_t * ctx,
19912012 if ( FD_UNLIKELY ( (bank -> flags & FD_BANK_FLAGS_DEAD ) && bank -> refcnt == 0UL ) ) {
19922013 fd_banks_mark_bank_frozen ( ctx -> banks , bank );
19932014 }
1994- fd_sched_task_done ( ctx -> sched , FD_SCHED_TT_TXN_SIGVERIFY , msg -> txn_sigverify -> txn_idx , exec_tile_idx );
2015+ int res = fd_sched_task_done ( ctx -> sched , FD_SCHED_TT_TXN_SIGVERIFY , msg -> txn_sigverify -> txn_idx , exec_tile_idx , NULL );
2016+ FD_TEST ( res == 0 );
2017+ break ;
2018+ }
2019+ case FD_EXEC_TT_POH_HASH : {
2020+ int res = fd_sched_task_done ( ctx -> sched , FD_SCHED_TT_POH_HASH , ULONG_MAX , exec_tile_idx , msg -> poh_hash );
2021+ if ( FD_UNLIKELY ( res < 0 && !(bank -> flags & FD_BANK_FLAGS_DEAD ) ) ) {
2022+ publish_slot_dead ( ctx , stem , bank );
2023+ fd_banks_mark_bank_dead ( ctx -> banks , bank );
2024+ }
2025+ if ( FD_UNLIKELY ( (bank -> flags & FD_BANK_FLAGS_DEAD ) && bank -> refcnt == 0UL ) ) fd_banks_mark_bank_frozen ( ctx -> banks , bank );
19952026 break ;
19962027 }
19972028 default : FD_LOG_CRIT (( "unexpected sig 0x%lx" , sig ));
0 commit comments