@@ -171,7 +171,9 @@ static void
171171fd_solfuzz_pb_block_update_prev_epoch_votes_cache ( fd_vote_states_t * vote_states ,
172172 fd_exec_test_vote_account_t * vote_accounts ,
173173 pb_size_t vote_accounts_cnt ,
174- fd_spad_t * spad ) {
174+ fd_runtime_stack_t * runtime_stack ,
175+ fd_spad_t * spad ,
176+ uchar is_t_1 ) {
175177 FD_SPAD_FRAME_BEGIN ( spad ) {
176178 for ( uint i = 0U ; i < vote_accounts_cnt ; i ++ ) {
177179 fd_exec_test_acct_state_t * vote_account = & vote_accounts [i ].vote_account ;
@@ -195,6 +197,36 @@ fd_solfuzz_pb_block_update_prev_epoch_votes_cache( fd_vote_states_t *
195197 vote_state -> stake += stake ;
196198 vote_state -> stake_t_1 += stake ;
197199 vote_state -> stake_t_2 += stake ;
200+
201+ if ( !is_t_1 ) continue ;
202+
203+ /* Update vote credits for T-1 */
204+ fd_vote_epoch_credits_t * epoch_credits = NULL ;
205+ switch ( res -> discriminant ) {
206+ case fd_vote_state_versioned_enum_v0_23_5 :
207+ epoch_credits = res -> inner .v0_23_5 .epoch_credits ;
208+ break ;
209+ case fd_vote_state_versioned_enum_v1_14_11 :
210+ epoch_credits = res -> inner .v1_14_11 .epoch_credits ;
211+ break ;
212+ case fd_vote_state_versioned_enum_current :
213+ epoch_credits = res -> inner .current .epoch_credits ;
214+ break ;
215+ default :
216+ __builtin_unreachable ();
217+ }
218+
219+ fd_vote_state_credits_t * vote_credits = & runtime_stack -> stakes .vote_credits [ vote_state -> idx ];
220+ vote_credits -> credits_cnt = 0UL ;
221+ for ( deq_fd_vote_epoch_credits_t_iter_t iter = deq_fd_vote_epoch_credits_t_iter_init ( epoch_credits );
222+ !deq_fd_vote_epoch_credits_t_iter_done ( epoch_credits , iter );
223+ iter = deq_fd_vote_epoch_credits_t_iter_next ( epoch_credits , iter ) ) {
224+ fd_vote_epoch_credits_t const * credit_ele = deq_fd_vote_epoch_credits_t_iter_ele_const ( epoch_credits , iter );
225+ vote_credits -> epoch [ vote_credits -> credits_cnt ] = (ushort )credit_ele -> epoch ;
226+ vote_credits -> credits [ vote_credits -> credits_cnt ] = credit_ele -> credits ;
227+ vote_credits -> prev_credits [ vote_credits -> credits_cnt ] = credit_ele -> prev_credits ;
228+ vote_credits -> credits_cnt ++ ;
229+ }
198230 }
199231 } FD_SPAD_FRAME_END ;
200232}
@@ -347,7 +379,9 @@ fd_solfuzz_pb_block_ctx_create( fd_solfuzz_runner_t * runner,
347379 vote_states_prev ,
348380 test_ctx -> epoch_ctx .vote_accounts_t_1 ,
349381 test_ctx -> epoch_ctx .vote_accounts_t_1_count ,
350- runner -> spad );
382+ runtime_stack ,
383+ runner -> spad ,
384+ 1 );
351385 fd_bank_vote_states_prev_end_locking_modify ( bank );
352386
353387 /* Update vote cache for epoch T-2 */
@@ -356,7 +390,9 @@ fd_solfuzz_pb_block_ctx_create( fd_solfuzz_runner_t * runner,
356390 vote_states_prev_prev ,
357391 test_ctx -> epoch_ctx .vote_accounts_t_2 ,
358392 test_ctx -> epoch_ctx .vote_accounts_t_2_count ,
359- runner -> spad );
393+ runtime_stack ,
394+ runner -> spad ,
395+ 0 );
360396
361397 /* Refresh vote accounts to calculate stake delegations */
362398 fd_solfuzz_block_refresh_vote_accounts (
@@ -626,14 +662,18 @@ fd_solfuzz_pb_build_leader_schedule_effects( fd_solfuzz_runner_t *
626662 tmp_vs ,
627663 test_ctx -> epoch_ctx .vote_accounts_t_1 ,
628664 test_ctx -> epoch_ctx .vote_accounts_t_1_count ,
629- runner -> spad );
665+ runner -> runtime_stack ,
666+ runner -> spad ,
667+ 1 );
630668 } else if ( agave_epoch == fd_slot_to_leader_schedule_epoch ( sched , parent_slot )- 1UL ) {
631669 /* One before parent epoch, so use vote_accounts_t_2 */
632670 fd_solfuzz_pb_block_update_prev_epoch_votes_cache (
633671 tmp_vs ,
634672 test_ctx -> epoch_ctx .vote_accounts_t_2 ,
635673 test_ctx -> epoch_ctx .vote_accounts_t_2_count ,
636- runner -> spad );
674+ runner -> runtime_stack ,
675+ runner -> spad ,
676+ 0 );
637677 } else if (agave_epoch == fd_slot_to_leader_schedule_epoch (sched , parent_slot )+ 1UL ) {
638678 /* One ahead of parent epoch, so use current acct_states */
639679 for ( ushort i = 0 ; i < test_ctx -> acct_states_count ; i ++ ) {
0 commit comments