@@ -199,7 +199,7 @@ struct fd_replay_tile_ctx {
199199
200200 fd_alloc_t * alloc ;
201201 fd_valloc_t valloc ;
202- fd_funk_t * funk ;
202+ fd_funk_t funk [ 1 ] ;
203203 fd_exec_epoch_ctx_t * epoch_ctx ;
204204 fd_epoch_t * epoch ;
205205 fd_forks_t * forks ;
@@ -826,9 +826,9 @@ checkpt( fd_replay_tile_ctx_t * ctx ) {
826826static void FD_FN_UNUSED
827827funk_cancel ( fd_replay_tile_ctx_t * ctx , ulong mismatch_slot ) {
828828 fd_funk_txn_start_write ( ctx -> funk );
829- fd_funk_txn_xid_t xid = { .ul = { mismatch_slot , mismatch_slot } };
830- fd_funk_txn_map_t txn_map = fd_funk_txn_map ( ctx -> funk , fd_funk_wksp ( ctx -> funk ) );
831- fd_funk_txn_t * mismatch_txn = fd_funk_txn_query ( & xid , & txn_map );
829+ fd_funk_txn_xid_t xid = { .ul = { mismatch_slot , mismatch_slot } };
830+ fd_funk_txn_map_t * txn_map = fd_funk_txn_map ( ctx -> funk );
831+ fd_funk_txn_t * mismatch_txn = fd_funk_txn_query ( & xid , txn_map );
832832 FD_TEST ( fd_funk_txn_cancel ( ctx -> funk , mismatch_txn , 1 ) );
833833 fd_funk_txn_end_write ( ctx -> funk );
834834}
@@ -860,7 +860,7 @@ txncache_publish( fd_replay_tile_ctx_t * ctx,
860860 fd_funk_txn_start_read ( ctx -> funk );
861861
862862 fd_funk_txn_t * txn = to_root_txn ;
863- fd_funk_txn_pool_t txn_pool = fd_funk_txn_pool ( ctx -> funk , fd_funk_wksp ( ctx -> funk ) );
863+ fd_funk_txn_pool_t * txn_pool = fd_funk_txn_pool ( ctx -> funk );
864864 while ( txn != rooted_txn ) {
865865 ulong slot = txn -> xid .ul [0 ];
866866 if ( FD_LIKELY ( !fd_txncache_get_is_constipated ( ctx -> slot_ctx -> status_cache ) ) ) {
@@ -870,7 +870,7 @@ txncache_publish( fd_replay_tile_ctx_t * ctx,
870870 FD_LOG_INFO (( "Registering constipated slot %lu" , slot ));
871871 fd_txncache_register_constipated_slot ( ctx -> slot_ctx -> status_cache , slot );
872872 }
873- txn = fd_funk_txn_parent ( txn , & txn_pool );
873+ txn = fd_funk_txn_parent ( txn , txn_pool );
874874 }
875875
876876 fd_funk_txn_end_read ( ctx -> funk );
@@ -962,7 +962,7 @@ funk_publish( fd_replay_tile_ctx_t * ctx,
962962 fd_funk_txn_start_write ( ctx -> funk );
963963
964964 fd_epoch_bank_t * epoch_bank = fd_exec_epoch_ctx_epoch_bank ( ctx -> slot_ctx -> epoch_ctx );
965- fd_funk_txn_pool_t txn_pool = fd_funk_txn_pool ( ctx -> funk , fd_funk_wksp ( ctx -> funk ) );
965+ fd_funk_txn_pool_t * txn_pool = fd_funk_txn_pool ( ctx -> funk );
966966
967967 /* Try to publish into Funk */
968968 if ( is_constipated ) {
@@ -982,7 +982,7 @@ funk_publish( fd_replay_tile_ctx_t * ctx,
982982 if ( FD_UNLIKELY ( fd_funk_txn_publish_into_parent ( ctx -> funk , txn , 0 ) ) ) {
983983 FD_LOG_ERR (( "Can't publish funk transaction" ));
984984 }
985- txn = fd_funk_txn_parent ( txn , & txn_pool );
985+ txn = fd_funk_txn_parent ( txn , txn_pool );
986986 }
987987
988988 } else {
@@ -1003,7 +1003,7 @@ funk_publish( fd_replay_tile_ctx_t * ctx,
10031003 we will calculate the epoch account hash for. */
10041004
10051005 fd_funk_txn_t * txn = to_root_txn ;
1006- fd_funk_txn_t * parent_txn = fd_funk_txn_parent ( txn , & txn_pool );
1006+ fd_funk_txn_t * parent_txn = fd_funk_txn_parent ( txn , txn_pool );
10071007 while ( parent_txn ) {
10081008 /* We need to be careful here because the eah start slot may be skipped
10091009 so the actual slot that we calculate the eah for may be greater than
@@ -1018,7 +1018,7 @@ funk_publish( fd_replay_tile_ctx_t * ctx,
10181018 break ;
10191019 }
10201020 txn = parent_txn ;
1021- parent_txn = fd_funk_txn_parent ( txn , & txn_pool );
1021+ parent_txn = fd_funk_txn_parent ( txn , txn_pool );
10221022 }
10231023
10241024 /* At this point, we know txn is the funk txn that we will want to
@@ -1069,17 +1069,17 @@ get_rooted_txn( fd_replay_tile_ctx_t * ctx,
10691069 we must also register it into the status cache because we don't register
10701070 the root in txncache_publish to avoid registering the same slot multiple times. */
10711071
1072- fd_funk_txn_pool_t txn_pool = fd_funk_txn_pool ( ctx -> funk , fd_funk_wksp ( ctx -> funk ) );
1072+ fd_funk_txn_pool_t * txn_pool = fd_funk_txn_pool ( ctx -> funk );
10731073
10741074 if ( is_constipated ) {
10751075
10761076 if ( FD_UNLIKELY ( !ctx -> false_root ) ) {
10771077
10781078 fd_funk_txn_t * txn = to_root_txn ;
1079- fd_funk_txn_t * parent_txn = fd_funk_txn_parent ( txn , & txn_pool );
1079+ fd_funk_txn_t * parent_txn = fd_funk_txn_parent ( txn , txn_pool );
10801080 while ( parent_txn ) {
10811081 txn = parent_txn ;
1082- parent_txn = fd_funk_txn_parent ( txn , & txn_pool );
1082+ parent_txn = fd_funk_txn_parent ( txn , txn_pool );
10831083 }
10841084
10851085 ctx -> false_root = txn ;
@@ -1143,8 +1143,8 @@ funk_and_txncache_publish( fd_replay_tile_ctx_t * ctx, ulong wmk, fd_funk_txn_xi
11431143 /* Handle updates to funk and the status cache. */
11441144
11451145 fd_funk_txn_start_read ( ctx -> funk );
1146- fd_funk_txn_map_t txn_map = fd_funk_txn_map ( ctx -> funk , fd_funk_wksp ( ctx -> funk ) );
1147- fd_funk_txn_t * to_root_txn = fd_funk_txn_query ( xid , & txn_map );
1146+ fd_funk_txn_map_t * txn_map = fd_funk_txn_map ( ctx -> funk );
1147+ fd_funk_txn_t * to_root_txn = fd_funk_txn_query ( xid , txn_map );
11481148 if ( FD_UNLIKELY ( !to_root_txn ) ) {
11491149 FD_LOG_ERR (( "Unable to find funk transaction for xid %lu" , xid -> ul [0 ] ));
11501150 }
@@ -2918,26 +2918,27 @@ privileged_init( fd_topo_t * topo,
29182918 if ( strcmp ( snapshot , "funk" ) == 0 ) {
29192919 /* Funk database already exists. The parameters are actually mostly ignored. */
29202920 funk = fd_funk_open_file (
2921- tile -> replay .funk_file , 1 , ctx -> funk_seed , tile -> replay .funk_txn_max ,
2921+ ctx -> funk ,
2922+ tile -> replay .funk_file , 1 , ctx -> funk_seed , tile -> replay .funk_txn_max ,
29222923 tile -> replay .funk_rec_max , tile -> replay .funk_sz_gb * (1UL <<30 ),
29232924 FD_FUNK_READ_WRITE , NULL );
29242925 } else if ( strncmp ( snapshot , "wksp:" , 5 ) == 0 ) {
29252926 /* Recover funk database from a checkpoint. */
2926- funk = fd_funk_recover_checkpoint ( tile -> replay .funk_file , 1 , snapshot + 5 , NULL );
2927+ funk = fd_funk_recover_checkpoint ( ctx -> funk , tile -> replay .funk_file , 1 , snapshot + 5 , NULL );
29272928 } else {
29282929 FD_LOG_NOTICE (( "Trying to create new funk at file=%s" , tile -> replay .funk_file ));
29292930 /* Create new funk database */
29302931 funk = fd_funk_open_file (
2931- tile -> replay .funk_file , 1 , ctx -> funk_seed , tile -> replay .funk_txn_max ,
2932+ ctx -> funk ,
2933+ tile -> replay .funk_file , 1 , ctx -> funk_seed , tile -> replay .funk_txn_max ,
29322934 tile -> replay .funk_rec_max , tile -> replay .funk_sz_gb * (1UL <<30 ),
29332935 FD_FUNK_OVERWRITE , NULL );
29342936 FD_LOG_NOTICE (( "Opened funk file at %s" , tile -> replay .funk_file ));
29352937 }
2936- if ( FD_UNLIKELY ( funk == NULL ) ) {
2938+ if ( FD_UNLIKELY ( funk -> shmem == NULL ) ) {
29372939 FD_LOG_ERR (( "no funk loaded" ));
29382940 }
29392941 fd_funk_txn_end_write ( NULL );
2940- ctx -> funk = funk ;
29412942 ctx -> funk_wksp = fd_funk_wksp ( funk );
29422943 if ( FD_UNLIKELY ( ctx -> funk_wksp == NULL ) ) {
29432944 FD_LOG_ERR (( "no funk wksp" ));
0 commit comments