@@ -56,6 +56,8 @@ struct fd_bank_ctx {
5656 fd_accdb_user_t accdb [1 ];
5757 fd_progcache_t progcache [1 ];
5858
59+ fd_runtime_t runtime [1 ];
60+
5961 /* For bundle execution, we need to execute each transaction against
6062 a separate transaction context and a set of accounts, but the exec
6163 stack can be reused. We will also use these same memory regions
@@ -66,9 +68,6 @@ struct fd_bank_ctx {
6668
6769 fd_log_collector_t log_collector [ 1 ];
6870
69- fd_runtime_t runtime ;
70-
71-
7271 struct {
7372 ulong txn_result [ FD_METRICS_ENUM_TRANSACTION_RESULT_CNT ];
7473 ulong txn_landed [ FD_METRICS_ENUM_TRANSACTION_LANDED_CNT ];
@@ -84,7 +83,6 @@ scratch_align( void ) {
8483
8584FD_FN_PURE static inline ulong
8685scratch_footprint ( fd_topo_tile_t const * tile ) {
87- (void )tile ;
8886 ulong l = FD_LAYOUT_INIT ;
8987 l = FD_LAYOUT_APPEND ( l , alignof( fd_bank_ctx_t ), sizeof ( fd_bank_ctx_t ) );
9088 l = FD_LAYOUT_APPEND ( l , FD_BLAKE3_ALIGN , FD_BLAKE3_FOOTPRINT );
@@ -199,7 +197,7 @@ handle_microblock( fd_bank_ctx_t * ctx,
199197
200198 fd_bank_t * bank = fd_banks_bank_query ( ctx -> banks , ctx -> _bank_idx );
201199 FD_TEST ( bank );
202- fd_runtime_prepare_and_execute_txn ( & ctx -> runtime , bank , txn_in , txn_out );
200+ fd_runtime_prepare_and_execute_txn ( ctx -> runtime , bank , txn_in , txn_out );
203201
204202 /* Stash the result in the flags value so that pack can inspect it. */
205203 txn -> flags = (txn -> flags & 0x00FFFFFFU ) | ((uint )(- txn_out -> err .txn_err )<<24 );
@@ -234,7 +232,7 @@ handle_microblock( fd_bank_ctx_t * ctx,
234232 if that happens. We cannot reject the transaction here as there
235233 would be no way to undo the partially applied changes to the bank
236234 in finalize anyway. */
237- fd_runtime_commit_txn ( & ctx -> runtime , bank , txn_in , txn_out );
235+ fd_runtime_commit_txn ( ctx -> runtime , bank , txn_in , txn_out );
238236
239237 if ( FD_UNLIKELY ( !txn_out -> err .is_committable ) ) {
240238 /* If the transaction failed to fit into the block, we need to
@@ -385,7 +383,7 @@ handle_bundle( fd_bank_ctx_t * ctx,
385383 fd_bank_t * bank = fd_banks_bank_query ( ctx -> banks , ctx -> _bank_idx );
386384 FD_TEST ( bank );
387385 txn_in -> bundle .is_bundle = 1 ;
388- fd_runtime_prepare_and_execute_txn ( & ctx -> runtime , bank , txn_in , txn_out );
386+ fd_runtime_prepare_and_execute_txn ( ctx -> runtime , bank , txn_in , txn_out );
389387 txn -> flags = (txn -> flags & 0x00FFFFFFU ) | ((uint )(- txn_out -> err .txn_err )<<24 );
390388 if ( FD_UNLIKELY ( !txn_out -> err .is_committable || txn_out -> err .txn_err != FD_RUNTIME_EXECUTE_SUCCESS ) ) {
391389 execution_success = 0 ;
@@ -407,7 +405,7 @@ handle_bundle( fd_bank_ctx_t * ctx,
407405 fd_txn_out_t * txn_out = & ctx -> txn_out [ i ];
408406 uchar * signature = (uchar * )txn_in -> txn -> payload + TXN ( txn_in -> txn )-> signature_off ;
409407
410- fd_runtime_commit_txn ( & ctx -> runtime , bank , txn_in , txn_out );
408+ fd_runtime_commit_txn ( ctx -> runtime , bank , txn_in , txn_out );
411409 if ( FD_UNLIKELY ( !txn_out -> err .is_committable ) ) {
412410 txns [ i ].flags = (txns [ i ].flags & 0x00FFFFFFU ) | ((uint )(- txn_out -> err .txn_err )<<24 );
413411 fd_cost_tracker_t * cost_tracker = fd_bank_cost_tracker_locking_modify ( bank );
@@ -556,7 +554,7 @@ unprivileged_init( fd_topo_t * topo,
556554 void * scratch = fd_topo_obj_laddr ( topo , tile -> tile_obj_id );
557555
558556 FD_SCRATCH_ALLOC_INIT ( l , scratch );
559- fd_bank_ctx_t * ctx = FD_SCRATCH_ALLOC_APPEND ( l , alignof( fd_bank_ctx_t ), sizeof ( fd_bank_ctx_t ) );
557+ fd_bank_ctx_t * ctx = FD_SCRATCH_ALLOC_APPEND ( l , alignof(fd_bank_ctx_t ), sizeof (fd_bank_ctx_t ) );
560558 void * blake3 = FD_SCRATCH_ALLOC_APPEND ( l , FD_BLAKE3_ALIGN , FD_BLAKE3_FOOTPRINT );
561559 void * bmtree = FD_SCRATCH_ALLOC_APPEND ( l , FD_BMTREE_COMMIT_ALIGN , FD_BMTREE_COMMIT_FOOTPRINT (0 ) );
562560 void * _txncache = FD_SCRATCH_ALLOC_APPEND ( l , fd_txncache_align (), fd_txncache_footprint ( tile -> bank .max_live_slots ) );
@@ -598,16 +596,12 @@ unprivileged_init( fd_topo_t * topo,
598596 }
599597 }
600598
601- ctx -> runtime = (fd_runtime_t ) {
602- .accdb = accdb ,
603- .funk = fd_accdb_user_v1_funk ( accdb ),
604- .progcache = progcache ,
605- .status_cache = txncache ,
606- .log = {
607- .log_collector = ctx -> log_collector ,
608- .enable_log_collector = 0 ,
609- }
610- };
599+ ctx -> runtime -> accdb = accdb ;
600+ ctx -> runtime -> funk = fd_accdb_user_v1_funk ( accdb );
601+ ctx -> runtime -> progcache = progcache ;
602+ ctx -> runtime -> status_cache = txncache ;
603+ ctx -> runtime -> log .log_collector = ctx -> log_collector ;
604+ ctx -> runtime -> log .enable_log_collector = 0 ;
611605
612606 ulong banks_obj_id = fd_pod_queryf_ulong ( topo -> props , ULONG_MAX , "banks" );
613607 FD_TEST ( banks_obj_id != ULONG_MAX );
0 commit comments