Commit Graph

422 Commits

Author SHA1 Message Date
steviez cc8e531a5d
Enforce a minimum of 1 on full and incremental snapshot retention (#30968) 2023-03-30 10:16:36 -05:00
steviez 86cf0ad758
ledger-tool: Skip compaction in purge command by default (#30891)
Performing a manual ledger compaction can be very time consuming.
Although the compaction will optimize storage use, swapping to skip
compaction favors the command completing faster. Additionally, we no
longer do regular compaction in the validator (via LedgerCleanupService)
and instead make use of range deletion which is much more efficient.

Given the above, this changes alters the default behavior to skip ledger
compaction by default, and introduces a flag should a user really want
to run compaction.
2023-03-29 10:34:00 -05:00
steviez 24be8508bb
ledger-tool: Use common AccountsDbConfig for all functions (#30707)
PR #29975 previously combined some repeated logic around parsing
AccountsDb configuration options. That PR consolidated logic between
verify and create-snapshot, but left alone all of the other commands
that load up and process Bank(s).

Make all functions that will spin up Banks / AccountsDb share this
common function. Additionally, expose some of the AccountsDb
configuration flags to the other commands such as accounts, graph, etc.
2023-03-24 12:46:09 -05:00
steviez 8db35eb7e5
ledger-tool: Add flag to find non-vote optimistic slots (#30580)
In cluster restart scenarios, it is desirable to know the latest
optimistic slot(s), which the subcommand latest-optimistic-slots will
return. However, it is also useful to know whether slots contain only
votes or if they contain votes and user transactions.

This PR adds an extra column of output to show whether an optimistically
confirmed slot is vote only (contains zero non-vote transactions).
Additionally, a flag has been added to enable filtering output to
exclude vote only slots.
2023-03-23 14:13:41 -07:00
Ryo Onodera 6c444df9e0
Add --block-{verification,production}-method flags (noop atm) (#30746)
* Add --{replaying,banking}-backend flags (noop atm)

* Greatly simplify enums with strum

* Update programs/sbf/Cargo.lock...

* Rely on Display, removing Debug

* constify cli_names()

* Don't allow omitting bankend value

* Rename to --block-{verification,production}-method

* Use more specific name

* Actually support missing value....

* Remove strictly-unnecessary flags

* Use lazy_static! instead of abusing DefaultArgs...
2023-03-23 12:57:28 +09:00
Illia Bobyr 809041b151
poh_verify => run_verification: Rename to be more accurate (#30811)
`poh_verify` actually disables transaction signature, tick count and
built in program argument verifications as well.  It is somewhat
confusing to call it `poh_verify`.
2023-03-22 11:03:30 -07:00
Ryo Onodera 721719d776
Add solana_clap_utils::hidden_unless_forced() (#30843)
* Add solana_clap_utils::hidden_unless_forced()

* Use more descriptive env name

Co-authored-by: mvines <mvines@gmail.com>

---------

Co-authored-by: mvines <mvines@gmail.com>
2023-03-22 08:59:17 +00:00
Xiang Zhu 8e3a30c22c
Clean orphaned account snapshot dirs (#30645)
* Clean up orphaned account snapshot hardlink dirs

* fix compilation issues

* debugged, now working.  seeing the orphaned directories deleted

* change back to eprintln + exit for account_path error

* changed eprintln to panic for now

* add test_clean_orphaned_account_snapshot_dirs for codecov check

* address a few comments and nit isseus

* directly unzip, skipped the intermediate array of tuples

* let set_up_account_run_and_snapshot_paths return Result

* 'proper' typo, and comment on return

* use map_err

* use for loop in clean_orphaned_account_snapshot_dirs, removed panic

* add test_set_up_account_run_and_snapshot_paths

* minor, replace .for_each with .all

* rename set_up_account_run_and_snapshot_paths to create_all_accounts_run_and_snapshot_dirs

* remove unnecessary closure return type

* change to for loop

* change match to unwrap_or_else

* remove create_dir_all(&account_path) in create_all

* minor comment cleanup
2023-03-17 15:22:10 -07:00
Tyera 20223b2557
Revert ledger-tool changes, fix master (#30763)
Revert 10f49d4 for ledger-tool
2023-03-16 19:30:10 -06:00
steviez f1cd64f4a1
ledger-tool: chore: Cleanup snapshot retention constants (#30745)
Declare constants at top of function with comment, and stringify the
constants when needed to be in line with how other defaults are done in
ledger-tool main function.
2023-03-17 09:25:58 +08:00
cavemanloverboy 10f49d4e26
Geyser Runtime Reload (#30352)
Support dynamic geyser plugin load, unload, and listing through admin RPC.
2023-03-16 17:03:00 -07:00
Tyera 9d792c1848
Ledger-tool: add param to deactivate features in snapshot creation (#30755)
* Add separate parameter for deactivating features on snapshot creation

* Add debug logs for account/feature removals

* Add the word gate
2023-03-16 15:54:05 -06:00
steviez db94e4564f
ledger-tool: Avoid creating SanitizedTransaction in print command (#30575)
The print command looks up program_ids from transactions by creating
SanitizedTransactions. But, print doesn't have access to a Bank so
transactions that include an address table lookup can't be sanitized.

Sanitizing the transaction isn't necessary, so this change just looks up
the program id from unsanitized transactions.
2023-03-03 14:18:57 -06:00
Brooks 4ba80ad785
Inline format args (#30364)
clippy fixes
2023-02-16 17:00:43 +00:00
steviez 5ad8c8bd20
fixup! lt: Reallow custom accounts path with Secondary access (#30228) (#30236)
The previous change used Primary access; however, it is better to use
PrimaryForMaintenance in this case to disallow any potential compaction
from happening.
2023-02-10 14:09:14 -06:00
Ryo Onodera 3e6162e69e
Add address lookup tables to minimized snapshot (#30158)
* Add address lookup tables to minimized snapshot

* Add comment for future posterity

* Add reference to the issue

* Adjust comment a bit

Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com>

---------

Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com>
2023-02-10 14:46:02 +09:00
steviez 64d2809244
ledger-tool: Reallow custom accounts path with Secondary access (#30228)
Previously, ledger-tool had a guardrail to disallow a custom accounts
path when access mode to the blockstore was Secondary. This was to avoid
potentially pulling the accounts out from underneath solana-validator.
When ledger-tool switched over to use Secondary blockstore access for
all commands that do not need write access, this removed the ability to
use custom accounts paths with ledger-tool at all for these commands.
Custom accounts paths are desirable, especially if that custom path is
in tmpfs to speed up processing.

With this change, when a custom accounts path is passed for a command
using Secondary access, ledger-tool now checks if Primary access is
being held by another process. If not, allow processing to proceed
with the custom accounts path.

The above check isn't fullproof, but it is about equal to the check that
previously existed when ledger-tool would run in Primary access mode
when it didn't need to.
2023-02-09 19:53:31 -06:00
Benno Fünfstück e8c43aa0d1
ledger-tool: Notify geyser of transactions (#29933)
ledger-tool: Notify geyser of transactions
2023-02-09 12:34:20 -08:00
steviez 37461976e0
ledger-tool: Move shred storage type inference next to Blockstore::open (#30084) 2023-02-02 16:55:18 -06:00
steviez 90f8c86d23
ledger-tool: Remove unnecessary function to parse ledger path arg (#29952) 2023-02-01 13:01:58 -06:00
steviez 1e6e623da5
ledger-tool: Move AccountsDbConfig building to common helper function (#29975)
Several subcommands may wish to specify AccountsDb configuration
options. The matching is currently duplicated in both "verify" and
"create-snapshot" command, so move the config to a common helper.

Note that each subcommand that wishes to use any argument will still
need to add the argument to its' argument list under App::new().
2023-01-30 20:59:35 +00:00
Xiang Zhu 856598969c
Account path add run parent with old path cleanup (#29942)
* Add run parent directory for accounts files

* fix test test_concurrent_snapshot_packaging

* review comments.  renamed the path setup function

* Addressed most of the review comments

* remove explict type def for map result

* handle create_accounts_run_and_snapshot_dirs error with expect

* update with more review comments

* minor fixes from review comments

* simplify account_filename option assignment

* handle error from create_accounts_run_and_snapshot_dirs

* use then instead of then_some for lazy evaluation

* Clean up files in the old account_path before trasitioning to the new run path

* try_exist and accounts_dir removing extra

* sync rmdir, is_dir check

* handle the account_path not deletable case
2023-01-30 10:26:43 -08:00
steviez 76ae62596a
ledger-tool: Fix argument matching for accounts_db_ancient_append_vecs (#29976)
The logic was searching for argument in global argument matches when it
should have been searching in the subcommand matches.
2023-01-30 10:56:07 -06:00
steviez f83f658cd8
ledger-tool: Remove duplicate open_genesis_config_by() call (#29950) 2023-01-27 01:20:42 -06:00
Xiang Zhu 4ebcacb4a3
Revert "Add run parent directory for accounts files (#29794)" (#29899)
This PR is causing OOM on master.  Reverting it for now.

This reverts commit 74f89d1494.
2023-01-25 10:03:01 -08:00
HaoranYi 2194551f87
Special case slot 0 for block connectness check in ledger tool (#29860)
* special case is_connected check for slot 0 so that we can load snapshot 0 for gce cluster boostrapting

* remove obsolete comments

* refactor with match expr

* update comments

* Update ledger-tool/src/main.rs

Co-authored-by: steviez <steven@solana.com>

* Update ledger-tool/src/main.rs

Co-authored-by: steviez <steven@solana.com>

Co-authored-by: steviez <steven@solana.com>
2023-01-25 09:06:22 -06:00
Xiang Zhu 74f89d1494
Add run parent directory for accounts files (#29794)
* Add run parent directory for accounts files

* fix test test_concurrent_snapshot_packaging

* review comments.  renamed the path setup function

* Addressed most of the review comments

* remove explict type def for map result

* handle create_accounts_run_and_snapshot_dirs error with expect

* update with more review comments

* minor fixes from review comments

* simplify account_filename option assignment

* handle error from create_accounts_run_and_snapshot_dirs

* use then instead of then_some for lazy evaluation
2023-01-24 16:44:35 -08:00
apfitzge 834b98aac0
Check that halt_slot >= starting_slot (#29868)
* Check that halt_slot >= starting_slot

* Improve message by saying where starting slot comes from
2023-01-24 14:38:52 -08:00
apfitzge 624f3d2d8c
Bugfix: bank-hash optionally takes halt_at_slot (#29865)
bank-hash optionally takes halt_at_slot
2023-01-24 14:15:07 -08:00
Trent Nelson c4e43f1de4
vote: encapsulate `Lockout` (#29753) 2023-01-18 19:28:28 -07:00
steviez 9bd0ce4082
ledger-tool: Clean account paths in all cases (#29609)
The existing logic would clean account paths only when we had secondary
access to the blockstore. However, the access mode shouldn't dictate
when we clean accounts data; we can and should clean account data from
previous runs in all instances given that we always start over from a
snapshot.
2023-01-17 21:53:51 -06:00
Giovanni Napoli 5eab3fb314
Add output in JSON for `solana-ledger-tool bounds` subcommand (#28410)
Introduce a struct to store all of the relevant slot/root information, and then output all in one go at the end as either human-readable or json. There are some slight changes to the human-readable format for the case of an empty ledger
2023-01-12 23:21:04 -06:00
Brooks d0aa93de21
Refactors accounts hash cache (#29625) 2023-01-12 10:43:50 -05:00
steviez 3992cee195
ledger-tool: Update dated println!() calls (#29636)
Removed an "ok" print that occurs after several commands; we already
print a log statement that indicates ledger-tool is done and how long it
took. Additionally, switch a println to info to avoid polluting stdout
incase we want to print information in a more easily readable format
such as json.
2023-01-10 20:41:47 -06:00
Jeff Washington (jwash) c9fe21e3c3
ancient append vecs enabled at -10k by default (#29565) 2023-01-10 05:33:43 -08:00
Boqin Qin(秦 伯钦)@MetaSecure cd5c5804ab
ledger-tool: fix double-readlock in main (#27322) 2023-01-06 19:30:07 +00:00
HaoranYi 4a8b980b81
update leger tool help for db verify refcounts (#29486) 2023-01-03 13:34:06 -06:00
Xiang Zhu 3363c08ac0
Move async remove to snapshot_utils.rs (#29406) 2023-01-03 06:15:32 -08:00
Jeff Washington (jwash) 4cc1890f00
skip_rewrites will only be feature driven (#29468) 2023-01-02 20:15:42 -08:00
Brooks Prumo 4530d161b7
Fixes format strings (#29327) 2022-12-19 17:26:38 -05:00
steviez 0609dce36c
Make ledger-tool list-roots subcommand inclusive of start-root arg (#29265) 2022-12-15 22:33:57 -06:00
Jeff Washington (jwash) b95835143e
remove AccountsBackgroundService::new(caching_enabled) (#29234) 2022-12-13 07:18:02 -08:00
Jeff Washington (jwash) fec8f61566
remove ProcessOptions::accounts_db_caching_enabled (#29217) 2022-12-12 20:25:00 -08:00
Brooks Prumo e02d1670fb
Uses Storages to calculate accounts hash when warping in `ledger-tool create-snapshot` (#29194) 2022-12-12 11:22:15 -05:00
Jeff Washington (jwash) 631a98a3b6
warp_from_parents works with write_cache enabled (#29185) 2022-12-09 14:28:18 -08:00
HaoranYi ca5d8c4b4d
refactor sysmonitor config (#29132) 2022-12-09 07:43:03 -06:00
Jeff Washington (jwash) 2f4731570a
ledger-tool create-snapshot uses write cache (#29119)
* ledger-tool create-snapshot uses write cache

* ledger tool create snapshot works with write cache
2022-12-08 06:09:52 -08:00
HaoranYi 33b15240ac
Revert #28945 (#29127)
revert #28945
2022-12-06 17:08:56 -06:00
behzad nouri 9524c9dbff patches errors from clippy::uninlined_format_args
https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
2022-12-06 19:32:15 +00:00
haoran 037f03c806 fix 2022-12-06 13:31:50 -06:00