Skip to content

Commit

Permalink
Add env var to recover archive after pruning (#1567)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbearer authored Jun 10, 2024
2 parents b09a9b7 + a295210 commit 7be94b3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ hotshot-builder-api = { git = "https://github.com/EspressoSystems/HotShot.git",
hotshot-builder-core = { git = "https://github.com/EspressoSystems/hotshot-builder-core", tag = "0.1.27" }
hotshot-events-service = { git = "https://github.com/EspressoSystems/hotshot-events-service.git", tag = "0.1.27" }
hotshot-orchestrator = { git = "https://github.com/EspressoSystems/hotshot", tag = "rc-0.5.57" }
hotshot-query-service = { git = "https://github.com/EspressoSystems/hotshot-query-service", tag = "0.1.37" }
hotshot-query-service = { git = "https://github.com/EspressoSystems/hotshot-query-service", tag = "0.1.38" }
hotshot-stake-table = { git = "https://github.com/EspressoSystems/hotshot", tag = "rc-0.5.57" }
hotshot-state-prover = { version = "0.1.0", path = "hotshot-state-prover" }
hotshot-task = { git = "https://github.com/EspressoSystems/hotshot", tag = "rc-0.5.57" }
Expand Down
1 change: 1 addition & 0 deletions sequencer/api/public-env-vars.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ variables = [
"ESPRESSO_SEQUENCER_ACTIVE_FETCH_DELAY",
"ESPRESSO_SEQUENCER_API_PEERS",
"ESPRESSO_SEQUENCER_API_PORT",
"ESPRESSO_SEQUENCER_ARCHIVE",
"ESPRESSO_SEQUENCER_CDN_ENDPOINT",
"ESPRESSO_SEQUENCER_CHUNK_FETCH_DELAY",
"ESPRESSO_SEQUENCER_FETCH_RATE_LIMIT",
Expand Down
12 changes: 12 additions & 0 deletions sequencer/src/persistence/sql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,15 @@ pub struct Options {
/// The minimum delay between loading chunks in a stream.
#[clap(long, env = "ESPRESSO_SEQUENCER_CHUNK_FETCH_DELAY", value_parser = parse_duration)]
pub(crate) chunk_fetch_delay: Option<Duration>,

/// Disable pruning and reconstruct previously pruned data.
///
/// While running without pruning is the default behavior, the default will not try to
/// reconstruct data that was pruned in a previous run where pruning was enabled. This option
/// instructs the service to run without pruning _and_ reconstruct all previously pruned data by
/// fetching from peers.
#[clap(long, env = "ESPRESSO_SEQUENCER_ARCHIVE", conflicts_with = "prune")]
pub(crate) archive: bool,
}

impl TryFrom<Options> for Config {
Expand Down Expand Up @@ -139,6 +148,9 @@ impl TryFrom<Options> for Config {
if opt.prune {
cfg = cfg.pruner_cfg(PrunerCfg::from(opt.pruning))?;
}
if opt.archive {
cfg = cfg.archive();
}

Ok(cfg)
}
Expand Down

0 comments on commit 7be94b3

Please sign in to comment.