Commit Graph

437 Commits

Author SHA1 Message Date
Alexander Meißner ee2c2ef6c7
Cleanup - require_static_program_ids_in_transaction (#31767)
require_static_program_ids_in_transaction
2023-06-07 17:12:41 +02:00
Brooks 7b37a1672f
Enables fastboot for ledger-tool (#31921) 2023-06-06 18:32:24 -04:00
steviez 1d6b03358f
ledger-tool: Rename load_frozen_forks() and adjust error messages (#31903)
This function has morphed as it has been updated, and the existing
function name is a bit of misnomer. Update the function name to use
terminology that I think is more clear and more consistent with what we
use core/src/validator.rs. Additionally, adjust the error messages to be
more clear about what exactly is wrong for when we can't process.
2023-05-31 21:12:49 -05:00
Jeff Washington (jwash) aff9c03e7a
fix cli args (#31804) 2023-05-25 07:47:00 -07:00
Jeff Washington (jwash) 461342cdd4
add cli args and use of partitioned rewards config (#31800)
* add cli args and use of partitioned rewards config

* update comments
2023-05-24 10:54:09 -07:00
Dmitri Makarov fb79e2bbb8
Reorganize ledger-tool run sub-command (#31572)
* Rename ledger-tool run subcommand to program subcommand

* Reorganize ledger-tool program command to multiple subcommands
2023-05-10 15:25:38 -04:00
Dmitri Makarov f09e791a09
Add debugging/tracing capabilities to ledger-tool, previously rbp… (#31346)
* Add debug and trace capabilities to ledger-tool, previously rbpf-cli

* Dump nested logs from saved traces in invoke_context

* Change the ledger-tool run input format to represent keys as strings
2023-05-05 05:14:41 -04:00
Dmitri Makarov e03826b6d8
Refactor ledger-tool moving some of functions to a separate module (#31359)
* Refactor ledger-tool moving some of functions to a separate module

* Rename utils to ledger_utils, move arg parsing funcs to a new module
2023-04-27 14:11:04 -04:00
Brooks c73b6545e6
Spins up AccountsHashVerifier in ledger-tool (#31358) 2023-04-26 12:07:35 -04:00
Alexander Meißner 7002c568fb
Cleanup - Removes the CLI option "no-bpf-jit" (#31329)
* Enables JIT everywhere by default.

* Removes the CLI argument "no-bpf-jit" and its plumbering through out the validator code base.

* Removes with_jit bpf_loader variants.

* Removes the to_builtin!() macro.
2023-04-25 19:04:11 +02:00
Brooks ca1bde3591
Use Arc instead of &Arc in AccountsBackgroundService::new (#31268) 2023-04-19 11:10:41 -04:00
Trent Nelson f34a6bcfce
runtime: transpose `VoteAccount::vote_state()` return to improve ergonomics (#31256) 2023-04-18 14:48:52 -06:00
steviez f3935f679e
ledger-tool: Add deprecation warning for --no-compaction (#31178)
The argument is deprecated with a change in default behavior but this
may not be obvious to a user; the warning makes this a bit more visible.
2023-04-15 00:18:03 -05:00
Brooks d43e19bb03
Refactors the Full/Incremental SnapshotHash types (#31186) 2023-04-13 18:01:27 -04:00
Jeff Washington (jwash) 3d6248d76a
ledger-tool verify cli for final hash calc (#31153) 2023-04-12 07:30:45 -07:00
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