@@ -664,12 +664,14 @@ fd_runtime_freeze( fd_exec_slot_ctx_t * slot_ctx, fd_spad_t * runtime_spad ) {
664
664
rec -> meta -> info .lamports += fees ;
665
665
rec -> meta -> slot = slot_ctx -> slot_bank .slot ;
666
666
667
- fd_blockstore_start_write ( slot_ctx -> blockstore );
668
- fd_block_t * blk = slot_ctx -> block ;
669
- blk -> rewards .collected_fees = fees ;
670
- blk -> rewards .post_balance = rec -> meta -> info .lamports ;
671
- memcpy ( blk -> rewards .leader .uc , leader -> uc , sizeof (fd_hash_t ) );
672
- fd_blockstore_end_write ( slot_ctx -> blockstore );
667
+ if ( FD_LIKELY ( slot_ctx -> blockstore ) ) {
668
+ fd_blockstore_start_write ( slot_ctx -> blockstore );
669
+ fd_block_t * blk = slot_ctx -> block ;
670
+ blk -> rewards .collected_fees = fees ;
671
+ blk -> rewards .post_balance = rec -> meta -> info .lamports ;
672
+ memcpy ( blk -> rewards .leader .uc , leader -> uc , sizeof (fd_hash_t ) );
673
+ fd_blockstore_end_write ( slot_ctx -> blockstore );
674
+ }
673
675
} while (0 );
674
676
675
677
ulong old = slot_ctx -> slot_bank .capitalization ;
@@ -1394,7 +1396,7 @@ int
1394
1396
fd_runtime_block_execute_prepare ( fd_exec_slot_ctx_t * slot_ctx ,
1395
1397
fd_spad_t * runtime_spad ) {
1396
1398
1397
- if ( slot_ctx -> slot_bank .slot != 0UL ) {
1399
+ if ( slot_ctx -> blockstore && slot_ctx -> slot_bank .slot != 0UL ) {
1398
1400
fd_blockstore_block_height_update ( slot_ctx -> blockstore ,
1399
1401
slot_ctx -> slot_bank .slot ,
1400
1402
slot_ctx -> slot_bank .block_height );
@@ -2453,7 +2455,7 @@ fd_apply_builtin_program_feature_transitions( fd_exec_slot_ctx_t * slot_ctx,
2453
2455
}
2454
2456
}
2455
2457
2456
- } FD_SCRATCH_SCOPE_END ;
2458
+ } FD_SPAD_FRAME_END ;
2457
2459
}
2458
2460
2459
2461
static void
@@ -3113,8 +3115,9 @@ fd_runtime_block_collect_txns( fd_block_info_t const * block_info,
3113
3115
/* Genesis */
3114
3116
/*******************************************************************************/
3115
3117
3116
- static void
3117
- fd_runtime_init_program ( fd_exec_slot_ctx_t * slot_ctx , fd_spad_t * runtime_spad ) {
3118
+ void
3119
+ fd_runtime_init_program ( fd_exec_slot_ctx_t * slot_ctx ,
3120
+ fd_spad_t * runtime_spad ) {
3118
3121
fd_sysvar_recent_hashes_init ( slot_ctx , runtime_spad );
3119
3122
fd_sysvar_clock_init ( slot_ctx );
3120
3123
fd_sysvar_slot_history_init ( slot_ctx , runtime_spad );
@@ -3792,7 +3795,7 @@ fd_runtime_publish_old_txns( fd_exec_slot_ctx_t * slot_ctx,
3792
3795
return 0 ;
3793
3796
}
3794
3797
3795
- static int
3798
+ int
3796
3799
fd_runtime_block_execute_tpool ( fd_exec_slot_ctx_t * slot_ctx ,
3797
3800
fd_capture_ctx_t * capture_ctx ,
3798
3801
fd_block_info_t const * block_info ,
@@ -3801,6 +3804,7 @@ fd_runtime_block_execute_tpool( fd_exec_slot_ctx_t * slot_ctx,
3801
3804
ulong exec_spad_cnt ,
3802
3805
fd_spad_t * runtime_spad ) {
3803
3806
3807
+ uchar dump_block = capture_ctx && slot_ctx -> slot_bank .slot >= capture_ctx -> dump_proto_start_slot && capture_ctx -> dump_block_to_pb ;
3804
3808
if ( capture_ctx != NULL && capture_ctx -> capture ) {
3805
3809
fd_solcap_writer_set_slot ( capture_ctx -> capture , slot_ctx -> slot_bank .slot );
3806
3810
}
@@ -3812,6 +3816,10 @@ fd_runtime_block_execute_tpool( fd_exec_slot_ctx_t * slot_ctx,
3812
3816
return res ;
3813
3817
}
3814
3818
3819
+ if ( dump_block ) {
3820
+ fd_dump_block_to_protobuf ( block_info , slot_ctx , capture_ctx , runtime_spad );
3821
+ }
3822
+
3815
3823
ulong txn_cnt = block_info -> txn_cnt ;
3816
3824
fd_txn_p_t * txn_ptrs = fd_spad_alloc ( runtime_spad , alignof(fd_txn_p_t ), txn_cnt * sizeof (fd_txn_p_t ) );
3817
3825
@@ -3863,7 +3871,7 @@ fd_runtime_block_execute_tpool( fd_exec_slot_ctx_t * slot_ctx,
3863
3871
return FD_RUNTIME_EXECUTE_SUCCESS ;
3864
3872
}
3865
3873
3866
- int
3874
+ void
3867
3875
fd_runtime_block_pre_execute_process_new_epoch ( fd_exec_slot_ctx_t * slot_ctx ,
3868
3876
fd_tpool_t * tpool ,
3869
3877
fd_spad_t * * exec_spads ,
@@ -3908,8 +3916,6 @@ fd_runtime_block_pre_execute_process_new_epoch( fd_exec_slot_ctx_t * slot_ctx,
3908
3916
runtime_spad );
3909
3917
fd_funk_end_write ( slot_ctx -> acc_mgr -> funk );
3910
3918
}
3911
-
3912
- return FD_RUNTIME_EXECUTE_SUCCESS ;
3913
3919
}
3914
3920
3915
3921
int
@@ -3954,13 +3960,11 @@ fd_runtime_block_eval_tpool( fd_exec_slot_ctx_t * slot_ctx,
3954
3960
fd_funk_end_write ( funk );
3955
3961
}
3956
3962
3957
- if ( FD_UNLIKELY ( (ret = fd_runtime_block_pre_execute_process_new_epoch ( slot_ctx ,
3958
- tpool ,
3959
- exec_spads ,
3960
- exec_spad_cnt ,
3961
- runtime_spad )) != FD_RUNTIME_EXECUTE_SUCCESS ) ) {
3962
- break ;
3963
- }
3963
+ fd_runtime_block_pre_execute_process_new_epoch ( slot_ctx ,
3964
+ tpool ,
3965
+ exec_spads ,
3966
+ exec_spad_cnt ,
3967
+ runtime_spad );
3964
3968
3965
3969
/* All runtime allocations here are scoped to the end of a block. */
3966
3970
FD_SPAD_FRAME_BEGIN ( runtime_spad ) {
0 commit comments