From 0d931b86430ed4de6a4c47dd92dfee8e87a25a1b Mon Sep 17 00:00:00 2001 From: Kunal Bhargava Date: Wed, 15 May 2024 22:07:34 +0000 Subject: [PATCH] ledger: normalize flag names --- src/app/ledger/main.c | 84 +++++++++---------- .../runtime/tests/run_ledger_tests.sh | 12 +-- 2 files changed, 48 insertions(+), 48 deletions(-) diff --git a/src/app/ledger/main.c b/src/app/ledger/main.c index 98c5e8c2a7..2c8bc476a9 100644 --- a/src/app/ledger/main.c +++ b/src/app/ledger/main.c @@ -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 \n" ); - fprintf( stderr, " --use-funk-wksp enabled by default, this allows splitting of funk and non-funk wksps\n" ); - fprintf( stderr, " --wksp-name workspace name\n" ); - fprintf( stderr, " --wksp-name-funk funk workspace name\n" ); - fprintf( stderr, " --page-cnt number of pages for anon wksp\n" ); - fprintf( stderr, " --funk-page-cnt number of pages for funk anon wksp\n" ); - fprintf( stderr, " --reset reset workspace\n" ); - fprintf( stderr, " --index-max number of records to index in funk\n" ); - fprintf( stderr, " --txns-max number of transactions to store in funk\n" ); - fprintf( stderr, " --verify-funky verify funky account database integrity\n" ); - fprintf( stderr, " --snapshot snapshot file\n" ); - fprintf( stderr, " --incremental incremental snapshot file\n" ); - fprintf( stderr, " --genesis genesis snapshot file\n" ); - fprintf( stderr, " --rocksdb rocksdb directory\n" ); - fprintf( stderr, " --copy-txn-status copy transaction status from rocksdb into blockstore\n" ); - fprintf( stderr, " --slot-history number of slots to keep in blockstore\n" ); - fprintf( stderr, " --shred-max max shred\n" ); - fprintf( stderr, " --start-slot start slot\n" ); - fprintf( stderr, " --end-slot end slot\n" ); - fprintf( stderr, " --verify-hash verify hash\n" ); - fprintf( stderr, " --verify-acc-hash verify account hash against ledger\n" ); - fprintf( stderr, " --check-acc-hash check account hash against hash generated by data\n" ); - fprintf( stderr, " --restore path to checkpoint to be restored\n" ); - fprintf( stderr, " --restore-funk path to checkpoint to be restored for funk\n" ); - fprintf( stderr, " --shred-cap path to shredcap file\n" ); - fprintf( stderr, " --trash-hash trash hash for invalidation\n" ); - fprintf( stderr, " --minified-rocksdb minified rocksdb directory\n" ); - fprintf( stderr, " --funk-only if enabled only funk will be checkpointed\n" ); - fprintf( stderr, " --checkpt checkpoint wksp into file after execution\n" ); fprintf( stderr, " --abort-on-mismatch abort on mismatch\n" ); - fprintf( stderr, " --index-max-pruned number of records to index in pruned funk\n" ); /* Prune related */ - fprintf( stderr, " --page-cnt-pruned number of pages for pruned anon wksp\n" ); - fprintf( stderr, " --on-demand-block-ingest on demand block ingest\n" ); /* On demand block reading */ - fprintf( stderr, " --on-demand-block-history on demand block history\n" ); + fprintf( stderr, " --allocator allocator to use\n" ); fprintf( stderr, " --capture-solcap capture solcap\n" ); /* Capture context tool for solcaps*/ fprintf( stderr, " --capture-txns capture transactions\n" ); - fprintf( stderr, " --checkpt-path path to checkpoint\n" ); /* Capture context tool for runtime checkpoints */ + fprintf( stderr, " --check-acc-hash check account hash against hash generated by data\n" ); + fprintf( stderr, " --checkpt checkpoint wksp into file after execution\n" ); /* Capture context tool for runtime checkpoints */ fprintf( stderr, " --checkpt-freq checkpoint frequency\n" ); fprintf( stderr, " --checkpt-mismatch checkpoint on mismatch at last rooted slot\n" ); - fprintf( stderr, " --allocator allocator to use\n" ); - fprintf( stderr, " --dump-insn-to-pb dump instructions to pb\n" ); /* Capture ctx tool for insn dumping*/ + fprintf( stderr, " --checkpt-path path to checkpoint\n" ); + fprintf( stderr, " --copy-txn-status copy transaction status from rocksdb into blockstore\n" ); + fprintf( stderr, " --dump-insn-output-dir dump instructions output directory\n" ); /* Capture ctx tool for insn dumping*/ fprintf( stderr, " --dump-insn-sig-filter dump instructions signature filter\n" ); - fprintf( stderr, " --dump-insn-output-dir dump instructions output directory\n" ); + fprintf( stderr, " --dump-insn-to-pb dump instructions to pb\n" ); + fprintf( stderr, " --end-slot end slot\n" ); + fprintf( stderr, " --funk-only if enabled only funk will be checkpointed\n" ); /* Funk related */ + fprintf( stderr, " --funk-page-cnt number of pages for funk anon wksp\n" ); + fprintf( stderr, " --funk-restore path to checkpoint to be restored for funk\n" ); + fprintf( stderr, " --funk-wksp-name funk workspace name\n" ); + fprintf( stderr, " --genesis genesis snapshot file\n" ); + fprintf( stderr, " --incremental incremental snapshot file\n" ); + fprintf( stderr, " --index-max number of records to index in funk\n" ); + fprintf( stderr, " --minified-rocksdb minified rocksdb directory\n" ); + fprintf( stderr, " --on-demand-block-history on demand block history\n" ); /* On demand block reading */ + fprintf( stderr, " --on-demand-block-ingest on demand block ingest\n" ); + fprintf( stderr, " --page-cnt number of pages for anon wksp\n" ); + fprintf( stderr, " --pruned-index-max number of records to index in pruned funk\n" ); /* Prune related */ + fprintf( stderr, " --pruned-page-cnt number of pages for pruned anon wksp\n" ); + fprintf( stderr, " --reset reset workspace\n" ); + fprintf( stderr, " --restore path to checkpoint to be restored\n" ); + fprintf( stderr, " --rocksdb rocksdb directory\n" ); + fprintf( stderr, " --shred-cap path to shredcap file\n" ); + fprintf( stderr, " --shred-max max shred\n" ); + fprintf( stderr, " --slot-history number of slots to keep in blockstore\n" ); + fprintf( stderr, " --snapshot snapshot file\n" ); + fprintf( stderr, " --start-slot start slot\n" ); + fprintf( stderr, " --trash-hash trash hash for invalidation\n" ); + fprintf( stderr, " --txns-max number of transactions to store in funk\n" ); + fprintf( stderr, " --use-funk-wksp enabled by default, this allows splitting of funk and non-funk wksps\n" ); + fprintf( stderr, " --verify-acc-hash verify account hash against ledger\n" ); + fprintf( stderr, " --verify-funky verify funky account database integrity\n" ); + fprintf( stderr, " --verify-hash verify hash\n" ); + fprintf( stderr, " --wksp-name workspace name\n" ); } struct fd_ledger_args { @@ -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 --cmd replay --page-cnt 20 + fd_ledger --funk-restore --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 @@ -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 ); @@ -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 ); @@ -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]; diff --git a/src/flamenco/runtime/tests/run_ledger_tests.sh b/src/flamenco/runtime/tests/run_ledger_tests.sh index 80cc78e097..3308ea209b 100755 --- a/src/flamenco/runtime/tests/run_ledger_tests.sh +++ b/src/flamenco/runtime/tests/run_ledger_tests.sh @@ -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="" @@ -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 ;; @@ -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 ;; @@ -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 \