Skip to content

Commit

Permalink
Adds --snapshot-zstd-compression-level to agave-validator
Browse files Browse the repository at this point in the history
  • Loading branch information
brooksprumo committed Jan 20, 2025
1 parent ed5bb69 commit cae78be
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Release channels have their own copy of this changelog:
* Add new command `solana feature revoke` for revoking pending feature activations. When a feature is activated, `solana feature revoke <feature-keypair> <cluster>` can be used to deallocate and reassign the account to the System program, undoing the operation. This can only be done before the feature becomes active.
* Unhide `--accounts-db-access-storages-method` for agave-validator and agave-ledger-tool and change default to `file`
* Remove tracer stats from banking-trace. `banking-trace` directory should be cleared when restarting on v2.2 for first time. It will not break if not cleared, but the file will be a mix of new/old format. (#4043)
* Add `--snapshot-zstd-compression-level` to set the compression level when archiving snapshots with zstd.

## [2.1.0]
* Breaking:
Expand Down
17 changes: 17 additions & 0 deletions validator/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1287,6 +1287,21 @@ pub fn app<'a>(version: &'a str, default_args: &'a DefaultArgs) -> App<'a, 'a> {
.takes_value(true)
.help("Snapshot archive format to use."),
)
.arg(
Arg::with_name("snapshot_zstd_compression_level")
.long("snapshot-zstd-compression-level")
.default_value(&default_args.snapshot_zstd_compression_level)
.value_name("LEVEL")
.takes_value(true)
.requires_if("snapshot-archive-format", "zstd")
.help("The compression level to use when archiving with zstd")
.long_help(
"The compression level to use when archiving with zstd. \
Higher compression levels generally produce higher \
compression ratio at the expense of speed and memory. \
See the zstd manpage for more information."
),
)
.arg(
Arg::with_name("max_genesis_archive_unpacked_size")
.long("max-genesis-archive-unpacked-size")
Expand Down Expand Up @@ -2360,6 +2375,7 @@ pub struct DefaultArgs {

pub snapshot_version: SnapshotVersion,
pub snapshot_archive_format: String,
pub snapshot_zstd_compression_level: String,

pub rocksdb_shred_compaction: String,
pub rocksdb_ledger_compression: String,
Expand Down Expand Up @@ -2460,6 +2476,7 @@ impl DefaultArgs {
min_snapshot_download_speed: DEFAULT_MIN_SNAPSHOT_DOWNLOAD_SPEED.to_string(),
max_snapshot_download_abort: MAX_SNAPSHOT_DOWNLOAD_ABORT.to_string(),
snapshot_archive_format: DEFAULT_ARCHIVE_COMPRESSION.to_string(),
snapshot_zstd_compression_level: "1".to_string(), // level 1 is optimized for speed
contact_debug_interval: "120000".to_string(),
snapshot_version: SnapshotVersion::default(),
rocksdb_shred_compaction: "level".to_string(),
Expand Down
2 changes: 1 addition & 1 deletion validator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1798,7 +1798,7 @@ pub fn main() {
maximum_incremental_snapshot_archives_to_retain,
accounts_hash_debug_verify: validator_config.accounts_db_test_hash_calculation,
packager_thread_niceness_adj: snapshot_packager_niceness_adj,
zstd_compression_level: 1, // level 1 is optimized for speed
zstd_compression_level: value_t_or_exit!(matches, "snapshot_zstd_compression_level", i32),
};

// The accounts hash interval shall match the snapshot interval
Expand Down

0 comments on commit cae78be

Please sign in to comment.