@@ -606,22 +606,21 @@ replay_block_start( fd_replay_tile_t * ctx,
606606
607607 fd_bank_has_identity_vote_set ( bank , 0 );
608608
609- /* Set the tick height. */
610- fd_bank_tick_height_set ( bank , fd_bank_max_tick_height_get ( bank ) );
611-
612609 /* Update block height. */
613610 fd_bank_block_height_set ( bank , fd_bank_block_height_get ( bank ) + 1UL );
614611
615- ulong * max_tick_height = fd_bank_max_tick_height_modify ( bank );
616- ulong ticks_per_slot = fd_bank_ticks_per_slot_get ( bank );
617- if ( FD_UNLIKELY ( FD_RUNTIME_EXECUTE_SUCCESS != fd_runtime_compute_max_tick_height ( ticks_per_slot , slot , max_tick_height ) ) ) {
618- FD_LOG_CRIT (( "couldn't compute tick height/max tick height slot %lu ticks_per_slot %lu" , slot , ticks_per_slot ));
619- }
620-
621612 int is_epoch_boundary = 0 ;
622613 fd_runtime_block_execute_prepare ( ctx -> banks , bank , ctx -> accdb , & ctx -> runtime_stack , ctx -> capture_ctx , & is_epoch_boundary );
623614 if ( FD_UNLIKELY ( is_epoch_boundary ) ) publish_stake_weights ( ctx , stem , bank , 1 );
624615
616+ ulong max_tick_height ;
617+ if ( FD_UNLIKELY ( FD_RUNTIME_EXECUTE_SUCCESS != fd_runtime_compute_max_tick_height ( fd_bank_ticks_per_slot_get ( parent_bank ), slot , & max_tick_height ) ) ) {
618+ 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 ) ));
619+ }
620+ fd_bank_max_tick_height_set ( bank , max_tick_height );
621+ 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. */
622+ 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 ) );
623+
625624 return bank ;
626625}
627626
@@ -1524,7 +1523,7 @@ dispatch_task( fd_replay_tile_t * ctx,
15241523
15251524 fd_replay_out_link_t * exec_out = ctx -> exec_out ;
15261525 fd_exec_txn_exec_msg_t * exec_msg = fd_chunk_to_laddr ( exec_out -> mem , exec_out -> chunk );
1527- memcpy ( & exec_msg -> txn , txn_p , sizeof (fd_txn_p_t ) );
1526+ memcpy ( exec_msg -> txn , txn_p , sizeof (fd_txn_p_t ) );
15281527 exec_msg -> bank_idx = task -> txn_exec -> bank_idx ;
15291528 exec_msg -> txn_idx = task -> txn_exec -> txn_idx ;
15301529 if ( FD_UNLIKELY ( ctx -> capture_ctx ) ) {
@@ -1542,13 +1541,27 @@ dispatch_task( fd_replay_tile_t * ctx,
15421541
15431542 fd_replay_out_link_t * exec_out = ctx -> exec_out ;
15441543 fd_exec_txn_sigverify_msg_t * exec_msg = fd_chunk_to_laddr ( exec_out -> mem , exec_out -> chunk );
1545- memcpy ( & exec_msg -> txn , txn_p , sizeof (fd_txn_p_t ) );
1544+ memcpy ( exec_msg -> txn , txn_p , sizeof (fd_txn_p_t ) );
15461545 exec_msg -> bank_idx = task -> txn_sigverify -> bank_idx ;
15471546 exec_msg -> txn_idx = task -> txn_sigverify -> txn_idx ;
15481547 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 );
15491548 exec_out -> chunk = fd_dcache_compact_next ( exec_out -> chunk , sizeof (* exec_msg ), exec_out -> chunk0 , exec_out -> wmark );
15501549 break ;
15511550 };
1551+ case FD_SCHED_TT_POH_HASH : {
1552+ fd_bank_t * bank = fd_banks_bank_query ( ctx -> banks , task -> poh_hash -> bank_idx );
1553+ bank -> refcnt ++ ;
1554+
1555+ fd_replay_out_link_t * exec_out = ctx -> exec_out ;
1556+ fd_exec_poh_hash_msg_t * exec_msg = fd_chunk_to_laddr ( exec_out -> mem , exec_out -> chunk );
1557+ exec_msg -> bank_idx = task -> poh_hash -> bank_idx ;
1558+ exec_msg -> mblk_idx = task -> poh_hash -> mblk_idx ;
1559+ exec_msg -> hashcnt = task -> poh_hash -> hashcnt ;
1560+ memcpy ( exec_msg -> hash , task -> poh_hash -> hash , sizeof (fd_hash_t ) );
1561+ 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 );
1562+ exec_out -> chunk = fd_dcache_compact_next ( exec_out -> chunk , sizeof (* exec_msg ), exec_out -> chunk0 , exec_out -> wmark );
1563+ break ;
1564+ };
15521565 default : {
15531566 FD_LOG_CRIT (( "unexpected task type %lu" , task -> task_type ));
15541567 }
@@ -1573,22 +1586,29 @@ replay( fd_replay_tile_t * ctx,
15731586 switch ( task -> task_type ) {
15741587 case FD_SCHED_TT_BLOCK_START : {
15751588 replay_block_start ( ctx , stem , task -> block_start -> bank_idx , task -> block_start -> parent_bank_idx , task -> block_start -> slot );
1576- fd_sched_task_done ( ctx -> sched , FD_SCHED_TT_BLOCK_START , ULONG_MAX , ULONG_MAX );
1589+ fd_sched_task_done ( ctx -> sched , FD_SCHED_TT_BLOCK_START , ULONG_MAX , ULONG_MAX , NULL );
15771590 break ;
15781591 }
15791592 case FD_SCHED_TT_BLOCK_END : {
15801593 fd_bank_t * bank = fd_banks_bank_query ( ctx -> banks , task -> block_end -> bank_idx );
15811594 if ( FD_LIKELY ( !(bank -> flags & FD_BANK_FLAGS_DEAD ) ) ) replay_block_finalize ( ctx , stem , bank );
1582- fd_sched_task_done ( ctx -> sched , FD_SCHED_TT_BLOCK_END , ULONG_MAX , ULONG_MAX );
1595+ fd_sched_task_done ( ctx -> sched , FD_SCHED_TT_BLOCK_END , ULONG_MAX , ULONG_MAX , NULL );
15831596 break ;
15841597 }
15851598 case FD_SCHED_TT_TXN_EXEC :
1586- case FD_SCHED_TT_TXN_SIGVERIFY : {
1599+ case FD_SCHED_TT_TXN_SIGVERIFY :
1600+ case FD_SCHED_TT_POH_HASH : {
15871601 /* Likely/common case: we have a transaction we actually need to
15881602 execute. */
15891603 dispatch_task ( ctx , stem , task );
15901604 break ;
15911605 }
1606+ case FD_SCHED_TT_MARK_DEAD : {
1607+ fd_bank_t * bank = fd_banks_bank_query ( ctx -> banks , task -> mark_dead -> bank_idx );
1608+ publish_slot_dead ( ctx , stem , bank );
1609+ fd_banks_mark_bank_dead ( ctx -> banks , bank );
1610+ break ;
1611+ }
15921612 default : {
15931613 FD_LOG_CRIT (( "unexpected task type %lu" , task -> task_type ));
15941614 }
@@ -1957,7 +1977,8 @@ process_exec_task_done( fd_replay_tile_t * ctx,
19571977 if ( FD_UNLIKELY ( (bank -> flags & FD_BANK_FLAGS_DEAD ) && bank -> refcnt == 0UL ) ) {
19581978 fd_banks_mark_bank_frozen ( ctx -> banks , bank );
19591979 }
1960- fd_sched_task_done ( ctx -> sched , FD_SCHED_TT_TXN_EXEC , msg -> txn_exec -> txn_idx , exec_tile_idx );
1980+ int res = fd_sched_task_done ( ctx -> sched , FD_SCHED_TT_TXN_EXEC , msg -> txn_exec -> txn_idx , exec_tile_idx , NULL );
1981+ FD_TEST ( res == 0 );
19611982 break ;
19621983 }
19631984 case FD_EXEC_TT_TXN_SIGVERIFY : {
@@ -1972,7 +1993,17 @@ process_exec_task_done( fd_replay_tile_t * ctx,
19721993 if ( FD_UNLIKELY ( (bank -> flags & FD_BANK_FLAGS_DEAD ) && bank -> refcnt == 0UL ) ) {
19731994 fd_banks_mark_bank_frozen ( ctx -> banks , bank );
19741995 }
1975- fd_sched_task_done ( ctx -> sched , FD_SCHED_TT_TXN_SIGVERIFY , msg -> txn_sigverify -> txn_idx , exec_tile_idx );
1996+ int res = fd_sched_task_done ( ctx -> sched , FD_SCHED_TT_TXN_SIGVERIFY , msg -> txn_sigverify -> txn_idx , exec_tile_idx , NULL );
1997+ FD_TEST ( res == 0 );
1998+ break ;
1999+ }
2000+ case FD_EXEC_TT_POH_HASH : {
2001+ int res = fd_sched_task_done ( ctx -> sched , FD_SCHED_TT_POH_HASH , ULONG_MAX , exec_tile_idx , msg -> poh_hash );
2002+ if ( FD_UNLIKELY ( res < 0 && !(bank -> flags & FD_BANK_FLAGS_DEAD ) ) ) {
2003+ publish_slot_dead ( ctx , stem , bank );
2004+ fd_banks_mark_bank_dead ( ctx -> banks , bank );
2005+ }
2006+ if ( FD_UNLIKELY ( (bank -> flags & FD_BANK_FLAGS_DEAD ) && bank -> refcnt == 0UL ) ) fd_banks_mark_bank_frozen ( ctx -> banks , bank );
19762007 break ;
19772008 }
19782009 default : FD_LOG_CRIT (( "unexpected sig 0x%lx" , sig ));
0 commit comments