14
14
#include "../../flamenco/fd_flamenco.h"
15
15
#include "../../flamenco/nanopb/pb_decode.h"
16
16
#include "../../flamenco/runtime/fd_hashes.h"
17
- #include "../../funk/fd_funk_filemap .h"
17
+ #include "../../funkier/fd_funkier_filemap .h"
18
18
#include "../../flamenco/types/fd_types.h"
19
19
#include "../../flamenco/runtime/fd_runtime.h"
20
20
#include "../../flamenco/runtime/fd_runtime_public.h"
@@ -38,7 +38,7 @@ struct fd_ledger_args {
38
38
fd_wksp_t * status_cache_wksp ; /* wksp for status cache. */
39
39
fd_blockstore_t blockstore_ljoin ;
40
40
fd_blockstore_t * blockstore ; /* blockstore for replay */
41
- fd_funk_t * funk ; /* handle to funk */
41
+ fd_funkier_t * funk ; /* handle to funk */
42
42
fd_alloc_t * alloc ; /* handle to alloc */
43
43
char const * cmd ; /* user passed command to fd_ledger */
44
44
ulong start_slot ; /* start slot for offline replay */
@@ -56,7 +56,7 @@ struct fd_ledger_args {
56
56
ulong index_max ; /* size of funk index (same as rec max) */
57
57
char const * funk_file ; /* path to funk backing store */
58
58
ulong funk_page_cnt ;
59
- fd_funk_close_file_args_t funk_close_args ;
59
+ fd_funkier_close_file_args_t funk_close_args ;
60
60
char const * snapshot ; /* path to agave snapshot */
61
61
char const * incremental ; /* path to agave incremental snapshot */
62
62
char const * genesis ; /* path to agave genesis */
@@ -664,7 +664,6 @@ allocator_setup( fd_wksp_t * wksp ) {
664
664
void
665
665
fd_ledger_main_setup ( fd_ledger_args_t * args ) {
666
666
fd_flamenco_boot ( NULL , NULL );
667
- fd_funk_t * funk = args -> funk ;
668
667
669
668
/* Setup capture context */
670
669
int has_solcap = args -> capture_fpath && args -> capture_fpath [0 ] != '\0' ;
@@ -720,9 +719,7 @@ fd_ledger_main_setup( fd_ledger_args_t * args ) {
720
719
fd_runtime_update_leaders ( args -> slot_ctx , args -> slot_ctx -> slot_bank .slot , args -> runtime_spad );
721
720
fd_calculate_epoch_accounts_hash_values ( args -> slot_ctx );
722
721
723
- fd_funk_start_write ( funk );
724
722
fd_bpf_scan_and_create_bpf_program_cache_entry_tpool ( args -> slot_ctx , args -> slot_ctx -> funk_txn , args -> tpool , args -> runtime_spad );
725
- fd_funk_end_write ( funk );
726
723
727
724
/* First, load in the sysvars into the sysvar cache. This is required to
728
725
make the StakeHistory sysvar available to the rewards calculation. */
@@ -902,21 +899,20 @@ parse_rocksdb_list( fd_ledger_args_t * args,
902
899
903
900
void
904
901
init_funk ( fd_ledger_args_t * args ) {
905
- fd_funk_t * funk ;
902
+ fd_funkier_t * funk ;
906
903
if ( args -> restore_funk ) {
907
- funk = fd_funk_recover_checkpoint ( args -> funk_file , 1 , args -> restore_funk , & args -> funk_close_args );
904
+ funk = fd_funkier_recover_checkpoint ( args -> funk_file , 1 , args -> restore_funk , & args -> funk_close_args );
908
905
} else {
909
- funk = fd_funk_open_file ( args -> funk_file , 1 , args -> hashseed , args -> txns_max , args -> index_max , args -> funk_page_cnt * (1UL <<30 ), FD_FUNK_OVERWRITE , & args -> funk_close_args );
906
+ funk = fd_funkier_open_file ( args -> funk_file , 1 , args -> hashseed , args -> txns_max , args -> index_max , args -> funk_page_cnt * (1UL <<30 ), FD_FUNKIER_OVERWRITE , & args -> funk_close_args );
910
907
}
911
908
args -> funk = funk ;
912
- args -> funk_wksp = fd_funk_wksp ( funk );
913
- FD_LOG_NOTICE (( "funky at global address 0x%016lx with %lu records" , fd_wksp_gaddr_fast ( args -> funk_wksp , funk ),
914
- fd_funk_rec_cnt ( fd_funk_rec_map ( funk , args -> funk_wksp ) ) ));
909
+ args -> funk_wksp = fd_funkier_wksp ( funk );
910
+ FD_LOG_NOTICE (( "funky at global address 0x%016lx" , fd_wksp_gaddr_fast ( args -> funk_wksp , funk ) ));
915
911
}
916
912
917
913
void
918
914
cleanup_funk ( fd_ledger_args_t * args ) {
919
- fd_funk_close_file ( & args -> funk_close_args );
915
+ fd_funkier_close_file ( & args -> funk_close_args );
920
916
}
921
917
922
918
void
@@ -958,13 +954,7 @@ checkpt( fd_ledger_args_t * args ) {
958
954
}
959
955
FD_LOG_NOTICE (( "writing funk checkpt %s" , args -> checkpt_funk ));
960
956
unlink ( args -> checkpt_funk );
961
- #ifdef FD_FUNK_WKSP_PROTECT
962
- fd_wksp_mprotect ( args -> funk_wksp , 0 );
963
- #endif
964
957
int err = fd_wksp_checkpt ( args -> funk_wksp , args -> checkpt_funk , 0666 , 0 , NULL );
965
- #ifdef FD_FUNK_WKSP_PROTECT
966
- fd_wksp_mprotect ( args -> funk_wksp , 1 );
967
- #endif
968
958
if ( err ) {
969
959
FD_LOG_ERR (( "funk checkpt failed: error %d" , err ));
970
960
}
@@ -1085,7 +1075,7 @@ ingest( fd_ledger_args_t * args ) {
1085
1075
1086
1076
fd_spad_t * spad = args -> runtime_spad ;
1087
1077
1088
- fd_funk_t * funk = args -> funk ;
1078
+ fd_funkier_t * funk = args -> funk ;
1089
1079
1090
1080
args -> valloc = allocator_setup ( args -> wksp );
1091
1081
uchar * epoch_ctx_mem = fd_spad_alloc ( spad , fd_exec_epoch_ctx_align (), fd_exec_epoch_ctx_footprint ( args -> vote_acct_max ) );
@@ -1129,7 +1119,7 @@ ingest( fd_ledger_args_t * args ) {
1129
1119
args -> exec_spads ,
1130
1120
args -> exec_spad_cnt ,
1131
1121
args -> runtime_spad );
1132
- FD_LOG_NOTICE (( "imported %lu records from snapshot" , fd_funk_rec_cnt ( fd_funk_rec_map ( funk , fd_funk_wksp ( funk ) ) ) ));
1122
+ FD_LOG_NOTICE (( "imported records from snapshot" ));
1133
1123
}
1134
1124
if ( args -> incremental ) {
1135
1125
fd_snapshot_load_all ( args -> incremental ,
@@ -1142,7 +1132,7 @@ ingest( fd_ledger_args_t * args ) {
1142
1132
args -> exec_spads ,
1143
1133
args -> exec_spad_cnt ,
1144
1134
args -> runtime_spad );
1145
- FD_LOG_NOTICE (( "imported %lu records from incremental snapshot" , fd_funk_rec_cnt ( fd_funk_rec_map ( funk , fd_funk_wksp ( funk ) ) ) ));
1135
+ FD_LOG_NOTICE (( "imported records from incremental snapshot" ));
1146
1136
}
1147
1137
1148
1138
if ( args -> genesis ) {
@@ -1185,12 +1175,14 @@ ingest( fd_ledger_args_t * args ) {
1185
1175
}
1186
1176
}
1187
1177
1178
+ #ifdef FD_FUNKIER_HANDHOLDING
1188
1179
if ( args -> verify_funk ) {
1189
1180
FD_LOG_NOTICE (( "verifying funky" ));
1190
- if ( fd_funk_verify ( funk ) ) {
1181
+ if ( fd_funkier_verify ( funk ) ) {
1191
1182
FD_LOG_ERR (( "verification failed" ));
1192
1183
}
1193
1184
}
1185
+ #endif
1194
1186
1195
1187
checkpt ( args );
1196
1188
@@ -1259,7 +1251,7 @@ replay( fd_ledger_args_t * args ) {
1259
1251
1260
1252
1261
1253
/* Setup slot_ctx */
1262
- fd_funk_t * funk = args -> funk ;
1254
+ fd_funkier_t * funk = args -> funk ;
1263
1255
1264
1256
void * epoch_ctx_mem = fd_spad_alloc ( spad , FD_EXEC_EPOCH_CTX_ALIGN , fd_exec_epoch_ctx_footprint ( args -> vote_acct_max ) );
1265
1257
fd_memset ( epoch_ctx_mem , 0 , fd_exec_epoch_ctx_footprint ( args -> vote_acct_max ) );
@@ -1304,22 +1296,19 @@ replay( fd_ledger_args_t * args ) {
1304
1296
/* Check number of records in funk. If rec_cnt == 0, then it can be assumed
1305
1297
that you need to load in snapshot(s). */
1306
1298
1307
- ulong rec_cnt = fd_funk_rec_cnt ( fd_funk_rec_map ( funk , fd_funk_wksp ( funk ) ) );
1308
- if ( !rec_cnt ) {
1309
- /* Load in snapshot(s) */
1310
- if ( args -> snapshot ) {
1311
- fd_snapshot_load_all ( args -> snapshot ,
1312
- args -> slot_ctx ,
1313
- NULL ,
1314
- args -> tpool ,
1315
- args -> verify_acc_hash ,
1316
- args -> check_acc_hash ,
1317
- FD_SNAPSHOT_TYPE_FULL ,
1318
- args -> exec_spads ,
1319
- args -> exec_spad_cnt ,
1320
- args -> runtime_spad );
1321
- FD_LOG_NOTICE (( "imported %lu records from snapshot" , fd_funk_rec_cnt ( fd_funk_rec_map ( funk , fd_funk_wksp ( funk ) ) ) ));
1322
- }
1299
+ /* Load in snapshot(s) */
1300
+ if ( args -> snapshot ) {
1301
+ fd_snapshot_load_all ( args -> snapshot ,
1302
+ args -> slot_ctx ,
1303
+ NULL ,
1304
+ args -> tpool ,
1305
+ args -> verify_acc_hash ,
1306
+ args -> check_acc_hash ,
1307
+ FD_SNAPSHOT_TYPE_FULL ,
1308
+ args -> exec_spads ,
1309
+ args -> exec_spad_cnt ,
1310
+ args -> runtime_spad );
1311
+ FD_LOG_NOTICE (( "imported from snapshot" ));
1323
1312
if ( args -> incremental ) {
1324
1313
fd_snapshot_load_all ( args -> incremental ,
1325
1314
args -> slot_ctx ,
@@ -1331,13 +1320,11 @@ replay( fd_ledger_args_t * args ) {
1331
1320
args -> exec_spads ,
1332
1321
args -> exec_spad_cnt ,
1333
1322
args -> runtime_spad );
1334
- FD_LOG_NOTICE (( "imported %lu records from snapshot" , fd_funk_rec_cnt ( fd_funk_rec_map ( funk , fd_funk_wksp ( funk ) ) ) ));
1335
- }
1336
- if ( args -> genesis ) {
1337
- fd_runtime_read_genesis ( args -> slot_ctx , args -> genesis , args -> snapshot != NULL , NULL , args -> tpool , args -> runtime_spad );
1323
+ FD_LOG_NOTICE (( "imported from snapshot" ));
1338
1324
}
1339
- } else {
1340
- FD_LOG_NOTICE (( "found funk with %lu records" , rec_cnt ));
1325
+ }
1326
+ if ( args -> genesis ) {
1327
+ fd_runtime_read_genesis ( args -> slot_ctx , args -> genesis , args -> snapshot != NULL , NULL , args -> tpool , args -> runtime_spad );
1341
1328
}
1342
1329
1343
1330
FD_LOG_NOTICE (( "Used memory in spad after loading in snapshot %lu" , args -> runtime_spad -> mem_used ));
0 commit comments