Skip to content

Commit

Permalink
Da monitoring support (#47)
Browse files Browse the repository at this point in the history
* Monitoring config

* Remove reorg_depth from config

* fmt

* Expose inner request method

* Expose http client

* lint

* Add PARALLEL_PROOF_LIMIT to base_env
  • Loading branch information
jfldde authored Nov 6, 2024
1 parent 6bcfb31 commit 94c43a0
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
17 changes: 17 additions & 0 deletions src/citrea_config/bitcoin.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
use serde::{Deserialize, Serialize};

impl Default for MonitoringConfig {
fn default() -> Self {
Self {
check_interval: 1,
history_limit: 100,
}
}
}

#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
pub struct MonitoringConfig {
pub check_interval: u64,
pub history_limit: usize,
}

/// Runtime configuration for the DA service
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
pub struct BitcoinServiceConfig {
Expand All @@ -16,4 +31,6 @@ pub struct BitcoinServiceConfig {

// absolute path to the directory where the txs will be written to
pub tx_backup_dir: String,

pub monitoring: MonitoringConfig,
}
3 changes: 3 additions & 0 deletions src/citrea_config/rollup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use std::path::PathBuf;
use serde::{Deserialize, Serialize};
use tempfile::TempDir;

use super::bitcoin::MonitoringConfig;
use crate::config::{BitcoinConfig, BitcoinServiceConfig};

/// Runner configuration.
Expand Down Expand Up @@ -153,6 +154,7 @@ impl Default for FullNodeConfig<BitcoinServiceConfig> {
.into_path()
.display()
.to_string(),
monitoring: MonitoringConfig::default(),
},
public_keys: RollupPublicKeys {
sequencer_public_key: vec![
Expand Down Expand Up @@ -186,6 +188,7 @@ impl From<BitcoinConfig> for BitcoinServiceConfig {
network: v.network,
da_private_key: None,
tx_backup_dir: String::new(),
monitoring: Default::default(),
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ impl Client {
.build(host)?;
Ok(Self { client })
}

pub fn http_client(&self) -> &HttpClient {
&self.client
}
}

impl Client {
Expand Down
2 changes: 1 addition & 1 deletion src/config/test_case.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub struct TestCaseEnv {
impl TestCaseEnv {
// Base env that should apply to every test cases
fn base_env() -> Vec<(&'static str, &'static str)> {
vec![("NO_COLOR", "1")]
vec![("NO_COLOR", "1"), ("PARALLEL_PROOF_LIMIT", "1")]
}

fn test_env(&self) -> Vec<(&'static str, &'static str)> {
Expand Down

0 comments on commit 94c43a0

Please sign in to comment.