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_borrowed_account.h"
@@ -37,7 +37,7 @@ struct fd_ledger_args {
37
37
fd_wksp_t * status_cache_wksp ; /* wksp for status cache. */
38
38
fd_blockstore_t blockstore_ljoin ;
39
39
fd_blockstore_t * blockstore ; /* blockstore for replay */
40
- fd_funk_t * funk ; /* handle to funk */
40
+ fd_funkier_t * funk ; /* handle to funk */
41
41
fd_alloc_t * alloc ; /* handle to alloc */
42
42
char const * cmd ; /* user passed command to fd_ledger */
43
43
ulong start_slot ; /* start slot for offline replay */
@@ -55,7 +55,7 @@ struct fd_ledger_args {
55
55
ulong index_max ; /* size of funk index (same as rec max) */
56
56
char const * funk_file ; /* path to funk backing store */
57
57
ulong funk_page_cnt ;
58
- fd_funk_close_file_args_t funk_close_args ;
58
+ fd_funkier_close_file_args_t funk_close_args ;
59
59
char const * snapshot ; /* path to agave snapshot */
60
60
char const * incremental ; /* path to agave incremental snapshot */
61
61
char const * genesis ; /* path to agave genesis */
@@ -679,7 +679,6 @@ allocator_setup( fd_wksp_t * wksp ) {
679
679
void
680
680
fd_ledger_main_setup ( fd_ledger_args_t * args ) {
681
681
fd_flamenco_boot ( NULL , NULL );
682
- fd_funk_t * funk = args -> funk ;
683
682
684
683
/* Setup capture context */
685
684
int has_solcap = args -> capture_fpath && args -> capture_fpath [0 ] != '\0' ;
@@ -735,9 +734,7 @@ fd_ledger_main_setup( fd_ledger_args_t * args ) {
735
734
fd_runtime_update_leaders ( args -> slot_ctx , args -> slot_ctx -> slot_bank .slot , args -> runtime_spad );
736
735
fd_calculate_epoch_accounts_hash_values ( args -> slot_ctx );
737
736
738
- fd_funk_start_write ( funk );
739
737
fd_bpf_scan_and_create_bpf_program_cache_entry_tpool ( args -> slot_ctx , args -> slot_ctx -> funk_txn , args -> tpool , args -> runtime_spad );
740
- fd_funk_end_write ( funk );
741
738
742
739
/* First, load in the sysvars into the sysvar cache. This is required to
743
740
make the StakeHistory sysvar available to the rewards calculation. */
@@ -917,21 +914,20 @@ parse_rocksdb_list( fd_ledger_args_t * args,
917
914
918
915
void
919
916
init_funk ( fd_ledger_args_t * args ) {
920
- fd_funk_t * funk ;
917
+ fd_funkier_t * funk ;
921
918
if ( args -> restore_funk ) {
922
- funk = fd_funk_recover_checkpoint ( args -> funk_file , 1 , args -> restore_funk , & args -> funk_close_args );
919
+ funk = fd_funkier_recover_checkpoint ( args -> funk_file , 1 , args -> restore_funk , & args -> funk_close_args );
923
920
} else {
924
- 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 );
921
+ 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 );
925
922
}
926
923
args -> funk = funk ;
927
- args -> funk_wksp = fd_funk_wksp ( funk );
928
- FD_LOG_NOTICE (( "funky at global address 0x%016lx with %lu records" , fd_wksp_gaddr_fast ( args -> funk_wksp , funk ),
929
- fd_funk_rec_cnt ( fd_funk_rec_map ( funk , args -> funk_wksp ) ) ));
924
+ args -> funk_wksp = fd_funkier_wksp ( funk );
925
+ FD_LOG_NOTICE (( "funky at global address 0x%016lx" , fd_wksp_gaddr_fast ( args -> funk_wksp , funk ) ));
930
926
}
931
927
932
928
void
933
929
cleanup_funk ( fd_ledger_args_t * args ) {
934
- fd_funk_close_file ( & args -> funk_close_args );
930
+ fd_funkier_close_file ( & args -> funk_close_args );
935
931
}
936
932
937
933
void
@@ -973,13 +969,7 @@ checkpt( fd_ledger_args_t * args ) {
973
969
}
974
970
FD_LOG_NOTICE (( "writing funk checkpt %s" , args -> checkpt_funk ));
975
971
unlink ( args -> checkpt_funk );
976
- #ifdef FD_FUNK_WKSP_PROTECT
977
- fd_wksp_mprotect ( args -> funk_wksp , 0 );
978
- #endif
979
972
int err = fd_wksp_checkpt ( args -> funk_wksp , args -> checkpt_funk , 0666 , 0 , NULL );
980
- #ifdef FD_FUNK_WKSP_PROTECT
981
- fd_wksp_mprotect ( args -> funk_wksp , 1 );
982
- #endif
983
973
if ( err ) {
984
974
FD_LOG_ERR (( "funk checkpt failed: error %d" , err ));
985
975
}
@@ -1100,7 +1090,7 @@ ingest( fd_ledger_args_t * args ) {
1100
1090
1101
1091
fd_spad_t * spad = args -> runtime_spad ;
1102
1092
1103
- fd_funk_t * funk = args -> funk ;
1093
+ fd_funkier_t * funk = args -> funk ;
1104
1094
1105
1095
args -> valloc = allocator_setup ( args -> wksp );
1106
1096
uchar * epoch_ctx_mem = fd_spad_alloc ( spad , fd_exec_epoch_ctx_align (), fd_exec_epoch_ctx_footprint ( args -> vote_acct_max ) );
@@ -1144,7 +1134,7 @@ ingest( fd_ledger_args_t * args ) {
1144
1134
args -> exec_spads ,
1145
1135
args -> exec_spad_cnt ,
1146
1136
args -> runtime_spad );
1147
- FD_LOG_NOTICE (( "imported %lu records from snapshot" , fd_funk_rec_cnt ( fd_funk_rec_map ( funk , fd_funk_wksp ( funk ) ) ) ));
1137
+ FD_LOG_NOTICE (( "imported records from snapshot" ));
1148
1138
}
1149
1139
if ( args -> incremental ) {
1150
1140
fd_snapshot_load_all ( args -> incremental ,
@@ -1157,7 +1147,7 @@ ingest( fd_ledger_args_t * args ) {
1157
1147
args -> exec_spads ,
1158
1148
args -> exec_spad_cnt ,
1159
1149
args -> runtime_spad );
1160
- FD_LOG_NOTICE (( "imported %lu records from incremental snapshot" , fd_funk_rec_cnt ( fd_funk_rec_map ( funk , fd_funk_wksp ( funk ) ) ) ));
1150
+ FD_LOG_NOTICE (( "imported records from incremental snapshot" ));
1161
1151
}
1162
1152
1163
1153
if ( args -> genesis ) {
@@ -1200,12 +1190,14 @@ ingest( fd_ledger_args_t * args ) {
1200
1190
}
1201
1191
}
1202
1192
1193
+ #ifdef FD_FUNKIER_HANDHOLDING
1203
1194
if ( args -> verify_funk ) {
1204
1195
FD_LOG_NOTICE (( "verifying funky" ));
1205
- if ( fd_funk_verify ( funk ) ) {
1196
+ if ( fd_funkier_verify ( funk ) ) {
1206
1197
FD_LOG_ERR (( "verification failed" ));
1207
1198
}
1208
1199
}
1200
+ #endif
1209
1201
1210
1202
checkpt ( args );
1211
1203
@@ -1260,7 +1252,7 @@ replay( fd_ledger_args_t * args ) {
1260
1252
1261
1253
1262
1254
/* Setup slot_ctx */
1263
- fd_funk_t * funk = args -> funk ;
1255
+ fd_funkier_t * funk = args -> funk ;
1264
1256
1265
1257
void * epoch_ctx_mem = fd_spad_alloc ( spad , FD_EXEC_EPOCH_CTX_ALIGN , fd_exec_epoch_ctx_footprint ( args -> vote_acct_max ) );
1266
1258
fd_memset ( epoch_ctx_mem , 0 , fd_exec_epoch_ctx_footprint ( args -> vote_acct_max ) );
@@ -1308,22 +1300,19 @@ replay( fd_ledger_args_t * args ) {
1308
1300
/* Check number of records in funk. If rec_cnt == 0, then it can be assumed
1309
1301
that you need to load in snapshot(s). */
1310
1302
1311
- ulong rec_cnt = fd_funk_rec_cnt ( fd_funk_rec_map ( funk , fd_funk_wksp ( funk ) ) );
1312
- if ( !rec_cnt ) {
1313
- /* Load in snapshot(s) */
1314
- if ( args -> snapshot ) {
1315
- fd_snapshot_load_all ( args -> snapshot ,
1316
- args -> slot_ctx ,
1317
- NULL ,
1318
- args -> tpool ,
1319
- args -> verify_acc_hash ,
1320
- args -> check_acc_hash ,
1321
- FD_SNAPSHOT_TYPE_FULL ,
1322
- args -> exec_spads ,
1323
- args -> exec_spad_cnt ,
1324
- args -> runtime_spad );
1325
- FD_LOG_NOTICE (( "imported %lu records from snapshot" , fd_funk_rec_cnt ( fd_funk_rec_map ( funk , fd_funk_wksp ( funk ) ) ) ));
1326
- }
1303
+ /* Load in snapshot(s) */
1304
+ if ( args -> snapshot ) {
1305
+ fd_snapshot_load_all ( args -> snapshot ,
1306
+ args -> slot_ctx ,
1307
+ NULL ,
1308
+ args -> tpool ,
1309
+ args -> verify_acc_hash ,
1310
+ args -> check_acc_hash ,
1311
+ FD_SNAPSHOT_TYPE_FULL ,
1312
+ args -> exec_spads ,
1313
+ args -> exec_spad_cnt ,
1314
+ args -> runtime_spad );
1315
+ FD_LOG_NOTICE (( "imported from snapshot" ));
1327
1316
if ( args -> incremental ) {
1328
1317
fd_snapshot_load_all ( args -> incremental ,
1329
1318
args -> slot_ctx ,
@@ -1335,13 +1324,11 @@ replay( fd_ledger_args_t * args ) {
1335
1324
args -> exec_spads ,
1336
1325
args -> exec_spad_cnt ,
1337
1326
args -> runtime_spad );
1338
- FD_LOG_NOTICE (( "imported %lu records from snapshot" , fd_funk_rec_cnt ( fd_funk_rec_map ( funk , fd_funk_wksp ( funk ) ) ) ));
1339
- }
1340
- if ( args -> genesis ) {
1341
- fd_runtime_read_genesis ( args -> slot_ctx , args -> genesis , args -> snapshot != NULL , NULL , args -> tpool , args -> runtime_spad );
1327
+ FD_LOG_NOTICE (( "imported from snapshot" ));
1342
1328
}
1343
- } else {
1344
- FD_LOG_NOTICE (( "found funk with %lu records" , rec_cnt ));
1329
+ }
1330
+ if ( args -> genesis ) {
1331
+ fd_runtime_read_genesis ( args -> slot_ctx , args -> genesis , args -> snapshot != NULL , NULL , args -> tpool , args -> runtime_spad );
1345
1332
}
1346
1333
1347
1334
FD_LOG_NOTICE (( "Used memory in spad after loading in snapshot %lu" , args -> runtime_spad -> mem_used ));
0 commit comments