Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ledger: normalize flag names #1855

Merged
merged 1 commit into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 42 additions & 42 deletions src/app/ledger/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,48 +35,48 @@ extern void fd_write_builtin_bogus_account( fd_exec_slot_ctx_t * slot_ctx, uchar
static void usage( char const * progname ) {
fprintf( stderr, "fd_ledger usage: %s\n", progname );
fprintf( stderr, " --cmd ingest <ingest|prune|minify|replay> \n" );
fprintf( stderr, " --use-funk-wksp <int> enabled by default, this allows splitting of funk and non-funk wksps\n" );
fprintf( stderr, " --wksp-name <workspace name> workspace name\n" );
fprintf( stderr, " --wksp-name-funk <workspace name> funk workspace name\n" );
fprintf( stderr, " --page-cnt <page count> number of pages for anon wksp\n" );
fprintf( stderr, " --funk-page-cnt <page count> number of pages for funk anon wksp\n" );
fprintf( stderr, " --reset <int> reset workspace\n" );
fprintf( stderr, " --index-max <ulong> number of records to index in funk\n" );
fprintf( stderr, " --txns-max <ulong> number of transactions to store in funk\n" );
fprintf( stderr, " --verify-funky <int> verify funky account database integrity\n" );
fprintf( stderr, " --snapshot <snapshot file> snapshot file\n" );
fprintf( stderr, " --incremental <incremental snapshot file> incremental snapshot file\n" );
fprintf( stderr, " --genesis <genesis snapshot file> genesis snapshot file\n" );
fprintf( stderr, " --rocksdb <rocksdb directory> rocksdb directory\n" );
fprintf( stderr, " --copy-txn-status <int> copy transaction status from rocksdb into blockstore\n" );
fprintf( stderr, " --slot-history <ulong> number of slots to keep in blockstore\n" );
fprintf( stderr, " --shred-max <ulong> max shred\n" );
fprintf( stderr, " --start-slot <ulong> start slot\n" );
fprintf( stderr, " --end-slot <ulong> end slot\n" );
fprintf( stderr, " --verify-hash <hash> verify hash\n" );
fprintf( stderr, " --verify-acc-hash <uint> verify account hash against ledger\n" );
fprintf( stderr, " --check-acc-hash <uint> check account hash against hash generated by data\n" );
fprintf( stderr, " --restore <restore file> path to checkpoint to be restored\n" );
fprintf( stderr, " --restore-funk <restore funk file> path to checkpoint to be restored for funk\n" );
fprintf( stderr, " --shred-cap <shredcap file> path to shredcap file\n" );
fprintf( stderr, " --trash-hash <ulong> trash hash for invalidation\n" );
fprintf( stderr, " --minified-rocksdb <mini rocksdb dir> minified rocksdb directory\n" );
fprintf( stderr, " --funk-only <int> if enabled only funk will be checkpointed\n" );
fprintf( stderr, " --checkpt <checkpoint file> checkpoint wksp into file after execution\n" );
fprintf( stderr, " --abort-on-mismatch <int> abort on mismatch\n" );
fprintf( stderr, " --index-max-pruned <ulong> number of records to index in pruned funk\n" ); /* Prune related */
fprintf( stderr, " --page-cnt-pruned <ulong> number of pages for pruned anon wksp\n" );
fprintf( stderr, " --on-demand-block-ingest <int> on demand block ingest\n" ); /* On demand block reading */
fprintf( stderr, " --on-demand-block-history <ulong> on demand block history\n" );
fprintf( stderr, " --allocator <allocator> allocator to use\n" );
fprintf( stderr, " --capture-solcap <capture file> capture solcap\n" ); /* Capture context tool for solcaps*/
fprintf( stderr, " --capture-txns <int> capture transactions\n" );
fprintf( stderr, " --checkpt-path <checkpoint path> path to checkpoint\n" ); /* Capture context tool for runtime checkpoints */
fprintf( stderr, " --check-acc-hash <uint> check account hash against hash generated by data\n" );
fprintf( stderr, " --checkpt <checkpoint file> checkpoint wksp into file after execution\n" ); /* Capture context tool for runtime checkpoints */
fprintf( stderr, " --checkpt-freq <ulong> checkpoint frequency\n" );
fprintf( stderr, " --checkpt-mismatch <int> checkpoint on mismatch at last rooted slot\n" );
fprintf( stderr, " --allocator <allocator> allocator to use\n" );
fprintf( stderr, " --dump-insn-to-pb <int> dump instructions to pb\n" ); /* Capture ctx tool for insn dumping*/
fprintf( stderr, " --checkpt-path <checkpoint path> path to checkpoint\n" );
fprintf( stderr, " --copy-txn-status <int> copy transaction status from rocksdb into blockstore\n" );
fprintf( stderr, " --dump-insn-output-dir <insn output dir> dump instructions output directory\n" ); /* Capture ctx tool for insn dumping*/
fprintf( stderr, " --dump-insn-sig-filter <insn sig filter> dump instructions signature filter\n" );
fprintf( stderr, " --dump-insn-output-dir <insn output dir> dump instructions output directory\n" );
fprintf( stderr, " --dump-insn-to-pb <int> dump instructions to pb\n" );
fprintf( stderr, " --end-slot <ulong> end slot\n" );
fprintf( stderr, " --funk-only <int> if enabled only funk will be checkpointed\n" ); /* Funk related */
fprintf( stderr, " --funk-page-cnt <page count> number of pages for funk anon wksp\n" );
fprintf( stderr, " --funk-restore <restore funk file> path to checkpoint to be restored for funk\n" );
fprintf( stderr, " --funk-wksp-name <workspace name> funk workspace name\n" );
fprintf( stderr, " --genesis <genesis snapshot file> genesis snapshot file\n" );
fprintf( stderr, " --incremental <incremental snapshot file> incremental snapshot file\n" );
fprintf( stderr, " --index-max <ulong> number of records to index in funk\n" );
fprintf( stderr, " --minified-rocksdb <mini rocksdb dir> minified rocksdb directory\n" );
fprintf( stderr, " --on-demand-block-history <ulong> on demand block history\n" ); /* On demand block reading */
fprintf( stderr, " --on-demand-block-ingest <int> on demand block ingest\n" );
fprintf( stderr, " --page-cnt <page count> number of pages for anon wksp\n" );
fprintf( stderr, " --pruned-index-max <ulong> number of records to index in pruned funk\n" ); /* Prune related */
fprintf( stderr, " --pruned-page-cnt <ulong> number of pages for pruned anon wksp\n" );
fprintf( stderr, " --reset <int> reset workspace\n" );
fprintf( stderr, " --restore <restore file> path to checkpoint to be restored\n" );
fprintf( stderr, " --rocksdb <rocksdb directory> rocksdb directory\n" );
fprintf( stderr, " --shred-cap <shredcap file> path to shredcap file\n" );
fprintf( stderr, " --shred-max <ulong> max shred\n" );
fprintf( stderr, " --slot-history <ulong> number of slots to keep in blockstore\n" );
fprintf( stderr, " --snapshot <snapshot file> snapshot file\n" );
fprintf( stderr, " --start-slot <ulong> start slot\n" );
fprintf( stderr, " --trash-hash <ulong> trash hash for invalidation\n" );
fprintf( stderr, " --txns-max <ulong> number of transactions to store in funk\n" );
fprintf( stderr, " --use-funk-wksp <int> enabled by default, this allows splitting of funk and non-funk wksps\n" );
fprintf( stderr, " --verify-acc-hash <uint> verify account hash against ledger\n" );
fprintf( stderr, " --verify-funky <int> verify funky account database integrity\n" );
fprintf( stderr, " --verify-hash <hash> verify hash\n" );
fprintf( stderr, " --wksp-name <workspace name> workspace name\n" );
}

struct fd_ledger_args {
Expand Down Expand Up @@ -778,7 +778,7 @@ replay( fd_ledger_args_t * args ) {

Example command loading in from on demand checkpoint and replaying with on demand block ingest.
It creates a checkpoint every 1000 slots.
fd_ledger --restore-funk <CHECKPOINT_TO_LOAD_IN> --cmd replay --page-cnt 20
fd_ledger --funk-restore <CHECKPOINT_TO_LOAD_IN> --cmd replay --page-cnt 20
--abort-on-mismatch 1 --tile-cpus 5-21 --allocator wksp
--rocksdb dump/rocksdb --checkpt-path dump/checkpoint_new
--checkpt-freq 1000 --funk-only 1 --on-demand-block-ingest 1 --funk-page-cnt 350
Expand Down Expand Up @@ -1195,7 +1195,7 @@ initial_setup( int argc, char ** argv, fd_ledger_args_t * args ) {
fd_flamenco_boot( &argc, &argv );

char const * wksp_name = fd_env_strip_cmdline_cstr ( &argc, &argv, "--wksp-name", NULL, NULL );
char const * wksp_name_funk = fd_env_strip_cmdline_cstr ( &argc, &argv, "--wksp-name-funk", NULL, NULL );
char const * wksp_name_funk = fd_env_strip_cmdline_cstr ( &argc, &argv, "--funk-wksp-name", NULL, NULL );
ulong funk_page_cnt = fd_env_strip_cmdline_ulong( &argc, &argv, "--funk-page-cnt", NULL, 5 );
ulong page_cnt = fd_env_strip_cmdline_ulong( &argc, &argv, "--page-cnt", NULL, 5 );
int reset = fd_env_strip_cmdline_int ( &argc, &argv, "--reset", NULL, 0 );
Expand All @@ -1216,12 +1216,12 @@ initial_setup( int argc, char ** argv, fd_ledger_args_t * args ) {
uint verify_acc_hash = fd_env_strip_cmdline_uint ( &argc, &argv, "--verify-acc-hash", NULL, 0 );
uint check_acc_hash = fd_env_strip_cmdline_uint ( &argc, &argv, "--check-acc-hash", NULL, 0 );
char const * restore = fd_env_strip_cmdline_cstr ( &argc, &argv, "--restore", NULL, NULL );
char const * restore_funk = fd_env_strip_cmdline_cstr ( &argc, &argv, "--restore-funk", NULL, NULL );
char const * restore_funk = fd_env_strip_cmdline_cstr ( &argc, &argv, "--funk-restore", NULL, NULL );
char const * shredcap = fd_env_strip_cmdline_cstr ( &argc, &argv, "--shred-cap", NULL, NULL );
ulong trash_hash = fd_env_strip_cmdline_ulong( &argc, &argv, "--trash-hash", NULL, ULONG_MAX );
char const * mini_db_dir = fd_env_strip_cmdline_cstr ( &argc, &argv, "--minified-rocksdb", NULL, NULL );
ulong index_max_pruned = fd_env_strip_cmdline_ulong( &argc, &argv, "--index-max-pruned", NULL, 450000000 );
ulong pages_pruned = fd_env_strip_cmdline_ulong( &argc, &argv, "--page-cnt-pruned", NULL, ULONG_MAX );
ulong index_max_pruned = fd_env_strip_cmdline_ulong( &argc, &argv, "--pruned-index-max", NULL, 450000000 );
ulong pages_pruned = fd_env_strip_cmdline_ulong( &argc, &argv, "--pruned-page-cnt", NULL, ULONG_MAX );
int funk_only = fd_env_strip_cmdline_int ( &argc, &argv, "--funk-only", NULL, 0 );
char const * checkpt = fd_env_strip_cmdline_cstr ( &argc, &argv, "--checkpt", NULL, NULL );
char const * checkpt_funk = fd_env_strip_cmdline_cstr ( &argc, &argv, "--checkpt-funk", NULL, NULL );
Expand Down Expand Up @@ -1277,7 +1277,7 @@ initial_setup( int argc, char ** argv, fd_ledger_args_t * args ) {
if( use_funk_wksp ) {
fd_wksp_t * funk_wksp = NULL;
if( wksp_name_funk == NULL ) {
FD_LOG_NOTICE(( "--wksp-name-funk not specified, using an anonymous local funk workspace" ));
FD_LOG_NOTICE(( "--funk-wksp-name not specified, using an anonymous local funk workspace" ));
funk_wksp = fd_wksp_new_anonymous( FD_SHMEM_GIGANTIC_PAGE_SZ, funk_page_cnt, 0, "funk_wksp", 0UL );
} else {
fd_shmem_info_t shmem_info[1];
Expand Down
12 changes: 6 additions & 6 deletions src/flamenco/runtime/tests/run_ledger_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ INC_SNAPSHOT=""
END_SLOT="--end-slot 1010"
FUNK_PAGES="--funk-page-cnt 20"
PAGES="--page-cnt 20"
PRUNED_PAGES="--page-cnt-pruned 20"
PRUNED_PAGES="--pruned-page-cnt 20"
IMAX="--index-max 1000000"
PRUNED_IMAX="--index-max-pruned 1000000"
PRUNED_IMAX="--pruned-index-max 1000000"
START="--start-slot 241819853"
HISTORY="--slot-history 5000"
TRASHHASH=""
Expand Down Expand Up @@ -74,8 +74,8 @@ while [[ $# -gt 0 ]]; do
shift
shift
;;
-P|--page-cnt-pruned)
PRUNED_PAGES="--page-cnt-pruned $2"
-P|--pruned-page-cnt)
PRUNED_PAGES="--pruned-page-cnt $2"
shift
shift
;;
Expand All @@ -100,7 +100,7 @@ while [[ $# -gt 0 ]]; do
shift
;;
-M|--indexmax-pruned)
PRUNED_IMAX="--index-max-pruned $2"
PRUNED_IMAX="--pruned-index-max $2"
shift
shift
;;
Expand Down Expand Up @@ -381,7 +381,7 @@ then
$IMAX \
--start-slot $prune_start_slot \
--end-slot $prune_end_slot \
--restore-funk $RESTORE_PATH \
--funk-restore $RESTORE_PATH \
--checkpt-funk $PRUNE_PATH \
--funk-only 1 \
--txn-max 100 \
Expand Down