Skip to content

Commit

Permalink
add defaults to batch settings
Browse files Browse the repository at this point in the history
  • Loading branch information
justprosh committed Jul 30, 2024
1 parent 7c1d8f1 commit ece6411
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

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

16 changes: 16 additions & 0 deletions crates/server-config/src/defaults.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,3 +301,19 @@ pub fn default_binaries_mapping() -> BTreeMap<String, String> {
pub fn default_proof_poll_period() -> Duration {
Duration::from_secs(60)
}

pub fn default_min_batch_count() -> usize {
1
}

pub fn default_max_batch_count() -> usize {
4
}

pub fn default_max_proof_batch_size() -> usize {
2
}

pub fn default_epoch_end_window() -> Duration {
Duration::from_secs(300)
}
8 changes: 8 additions & 0 deletions crates/server-config/src/node_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -650,9 +650,17 @@ pub struct ChainListenerConfig {
#[serde(default = "default_proof_poll_period")]
#[serde(with = "humantime_serde")]
pub proof_poll_period: Duration,
/// Min number of proofs in a batch for CU to be sent on chain
#[serde(default = "default_min_batch_count")]
pub min_batch_count: usize,
/// Max number of proofs in a batch for CU to be sent on chain
#[serde(default = "default_max_batch_count")]
pub max_batch_count: usize,
/// Max number of proofs batches to be sent on chain
#[serde(default = "default_max_proof_batch_size")]
pub max_proof_batch_size: usize,
/// Defined how much time before epoch end to send all found proofs in any batches
#[serde(default = "default_epoch_end_window")]
#[serde(with = "humantime_serde")]
pub epoch_end_window: Duration,
}
Expand Down

0 comments on commit ece6411

Please sign in to comment.