Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crates/cli/examples/batch_read_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ fn main() -> Result<()> {
epochs: 4,
burial_depth: 4000,
rotate_bytes: 1 << 30,
..Default::default()
};
if flatdb {
Arc::new(rustock_storage::epoch_store::EpochTrieStore::open_read_only_with(
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/examples/btc_cache_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ fn main() -> Result<()> {

// The epoch config only affects rotation and sweeping, neither of which a
// read-only store performs; the values just have to pass validation.
let cfg = EpochConfig { epochs: 4, burial_depth: 4_000, rotate_bytes: 1 << 30 };
let cfg = EpochConfig { epochs: 4, burial_depth: 4_000, rotate_bytes: 1 << 30, ..Default::default() };
let epochs = EpochTrieStore::open_read_only(&trie_dir, cfg)
.with_context(|| format!("opening {trie_dir} read-only"))?;
let raw: Arc<dyn TrieStore> = Arc::new(epochs);
Expand Down
1 change: 1 addition & 0 deletions crates/cli/examples/gc_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ fn main() -> Result<()> {
epochs: args.epochs,
burial_depth: args.burial,
rotate_bytes: args.rotate_mb * (1 << 20),
..Default::default()
},
// The benchmark drives block heights itself from an empty store.
None,
Expand Down
4 changes: 2 additions & 2 deletions crates/cli/examples/read_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ fn main() -> Result<()> {
let store: Box<dyn TrieStore> = if backend == "epoch" {
Box::new(EpochTrieStore::open(
&dir,
EpochConfig { epochs: 4, burial_depth: 0, rotate_bytes: u64::MAX },
EpochConfig { epochs: 4, burial_depth: 0, rotate_bytes: u64::MAX, ..Default::default() },
// A read benchmark never collects, so there is nothing to close.
None,
)?)
Expand All @@ -124,7 +124,7 @@ fn main() -> Result<()> {
let store: Box<dyn TrieStore> = if backend == "epoch" {
Box::new(EpochTrieStore::open(
&dir,
EpochConfig { epochs: 4, burial_depth: 0, rotate_bytes: u64::MAX },
EpochConfig { epochs: 4, burial_depth: 0, rotate_bytes: u64::MAX, ..Default::default() },
// A read benchmark never collects, so there is nothing to close.
None,
)?)
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/examples/resume_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ fn main() -> Result<()> {
println!("Opening READ-ONLY: {data_dir} and {trie_dir} ({engine})\n");

let store = BlockStore::open_read_only(&data_dir)?;
let cfg = EpochConfig { epochs: 4, burial_depth: 4_000, rotate_bytes: 1 << 30 };
let cfg = EpochConfig { epochs: 4, burial_depth: 4_000, rotate_bytes: 1 << 30, ..Default::default() };
let factory: std::sync::Arc<dyn rustock_storage::epoch_backend::EpochBackendFactory> =
match rustock_storage::TrieEngine::parse(&engine)? {
rustock_storage::TrieEngine::RocksDb => std::sync::Arc::new(
Expand Down
37 changes: 37 additions & 0 deletions crates/cli/src/config_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ pub struct FileConfig {
#[serde(default)]
pub gc: GcSection,
#[serde(default)]
pub segbuild: SegbuildSection,
#[serde(default)]
pub prune: PruneSection,
#[serde(default)]
pub mining: MiningSection,
Expand Down Expand Up @@ -248,6 +250,36 @@ pub struct GcSection {
pub rotate_mb: Option<u64>,
pub burial: Option<u64>,
pub check_secs: Option<u64>,
/// Ignore a collection bound that has fallen this far behind the head.
///
/// A bound is a consumer saying "do not discard what blocks after this
/// wrote" -- currently a segment build that has not run yet. It blocks
/// collection while held, so a consumer that is stuck would otherwise hold
/// the floor down until the disk filled.
pub max_bound_lag: Option<u64>,
}

/// Extending the segbuild segment set while syncing.
///
/// The node counts the bytes each block writes, records where segments should
/// end, and re-executes each range once it has settled. See
/// `docs/segbuild-continuous-design.md`.
#[derive(Debug, Default, Deserialize, Serialize)]
#[serde(deny_unknown_fields)]
pub struct SegbuildSection {
/// The segment set to extend. Unset means the feature is off.
///
/// Must already hold a `NNN-start-end` segment and be current with this
/// node's executed head, or the node refuses to start: a gap cannot be
/// built from a garbage-collected store.
pub out: Option<std::path::PathBuf>,
/// Written state a segment accumulates before it is cut.
pub target_mb: Option<u64>,
/// Blocks to wait after a boundary before building its range.
pub lag: Option<u64>,
/// Memory one of the builder's two in-memory tables may hold. The
/// builder's budget, not the segment size.
pub seal_mb: Option<u64>,
}

#[derive(Debug, Default, Deserialize, Serialize)]
Expand Down Expand Up @@ -592,6 +624,11 @@ pub const CONFIGURABLE: &[&str] = &[
"gc_rotate_mb",
"gc_burial",
"gc_check_secs",
"gc_max_bound_lag",
"segbuild_out",
"segbuild_target_mb",
"segbuild_lag",
"segbuild_seal_mb",
"prune_keep_depth",
"prune_max_batch",
"prune_blocks",
Expand Down
Loading
Loading