From a6617776d3fa1e09c27162ab2960f9aea718da10 Mon Sep 17 00:00:00 2001 From: okkothejawa <103260942+okkothejawa@users.noreply.github.com> Date: Wed, 21 Aug 2024 12:07:04 +0300 Subject: [PATCH] Rename DaServiceConfig to BitcoinServiceConfig (#1029) --- bin/citrea/src/main.rs | 4 ++-- bin/citrea/src/rollup/bitcoin.rs | 4 ++-- crates/bitcoin-da/src/service.rs | 16 ++++++++-------- .../full-node/sov-stf-runner/src/config.rs | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/bin/citrea/src/main.rs b/bin/citrea/src/main.rs index ba9347f5f..4f22f5c83 100644 --- a/bin/citrea/src/main.rs +++ b/bin/citrea/src/main.rs @@ -1,7 +1,7 @@ use core::fmt::Debug as DebugTrait; use anyhow::Context as _; -use bitcoin_da::service::DaServiceConfig; +use bitcoin_da::service::BitcoinServiceConfig; use citrea::{initialize_logging, BitcoinRollup, CitreaRollupBlueprint, MockDemoRollup}; use citrea_sequencer::SequencerConfig; use citrea_stf::genesis_config::GenesisPaths; @@ -107,7 +107,7 @@ async fn main() -> Result<(), anyhow::Error> { .await?; } SupportedDaLayer::Bitcoin => { - start_rollup::( + start_rollup::( &GenesisPaths::from_dir(&args.genesis_paths), rollup_config_path, prover_config, diff --git a/bin/citrea/src/rollup/bitcoin.rs b/bin/citrea/src/rollup/bitcoin.rs index 0f07f9e3e..8da8365d9 100644 --- a/bin/citrea/src/rollup/bitcoin.rs +++ b/bin/citrea/src/rollup/bitcoin.rs @@ -2,7 +2,7 @@ use std::collections::HashMap; use std::sync::Arc; use async_trait::async_trait; -use bitcoin_da::service::{BitcoinService, DaServiceConfig, TxidWrapper}; +use bitcoin_da::service::{BitcoinService, BitcoinServiceConfig, TxidWrapper}; use bitcoin_da::spec::{BitcoinSpec, RollupParams}; use bitcoin_da::verifier::BitcoinVerifier; use citrea_primitives::{REVEAL_BATCH_PROOF_PREFIX, REVEAL_LIGHT_CLIENT_PREFIX, ROLLUP_NAME}; @@ -38,7 +38,7 @@ impl CitreaRollupBlueprint for BitcoinRollup {} impl RollupBlueprint for BitcoinRollup { type DaService = BitcoinService; type DaSpec = BitcoinSpec; - type DaConfig = DaServiceConfig; + type DaConfig = BitcoinServiceConfig; type Vm = Risc0BonsaiHost<'static>; type ZkContext = ZkDefaultContext; diff --git a/crates/bitcoin-da/src/service.rs b/crates/bitcoin-da/src/service.rs index acafaff49..1bd835a95 100644 --- a/crates/bitcoin-da/src/service.rs +++ b/crates/bitcoin-da/src/service.rs @@ -59,7 +59,7 @@ pub struct BitcoinService { /// Runtime configuration for the DA service #[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] -pub struct DaServiceConfig { +pub struct BitcoinServiceConfig { /// The URL of the Bitcoin node to connect to pub node_url: String, pub node_username: String, @@ -81,7 +81,7 @@ const POLLING_INTERVAL: u64 = 10; // seconds impl BitcoinService { // Create a new instance of the DA service from the given configuration. pub async fn new_with_wallet_check( - config: DaServiceConfig, + config: BitcoinServiceConfig, chain_params: RollupParams, tx: UnboundedSender>, ) -> Result { @@ -193,7 +193,7 @@ impl BitcoinService { #[cfg(test)] pub async fn new_without_wallet_check( - config: DaServiceConfig, + config: BitcoinServiceConfig, chain_params: RollupParams, tx: UnboundedSender>, ) -> Result { @@ -817,7 +817,7 @@ mod tests { use super::BitcoinService; use crate::helpers::parsers::parse_hex_transaction; use crate::helpers::test_utils::{get_mock_data, get_mock_txs}; - use crate::service::DaServiceConfig; + use crate::service::BitcoinServiceConfig; use crate::spec::block::BitcoinBlock; use crate::spec::header::HeaderWrapper; use crate::spec::transaction::TransactionWrapper; @@ -825,7 +825,7 @@ mod tests { use crate::verifier::BitcoinVerifier; async fn get_service() -> Arc { - let runtime_config = DaServiceConfig { + let runtime_config = BitcoinServiceConfig { node_url: "http://localhost:38332/wallet/test".to_string(), node_username: "chainway".to_string(), node_password: "topsecret".to_string(), @@ -858,7 +858,7 @@ mod tests { } async fn get_service_wrong_rollup_name() -> Arc { - let runtime_config = DaServiceConfig { + let runtime_config = BitcoinServiceConfig { node_url: "http://localhost:38332/wallet/other".to_string(), node_username: "chainway".to_string(), node_password: "topsecret".to_string(), @@ -891,7 +891,7 @@ mod tests { } async fn get_service_correct_sig_different_public_key() -> Arc { - let runtime_config = DaServiceConfig { + let runtime_config = BitcoinServiceConfig { node_url: "http://localhost:38332/wallet/other2".to_string(), node_username: "chainway".to_string(), node_password: "topsecret".to_string(), @@ -1146,7 +1146,7 @@ mod tests { .serialize() .to_vec(); - let runtime_config = DaServiceConfig { + let runtime_config = BitcoinServiceConfig { node_url: "http://localhost:38332".to_string(), node_username: "chainway".to_string(), node_password: "topsecret".to_string(), diff --git a/crates/sovereign-sdk/full-node/sov-stf-runner/src/config.rs b/crates/sovereign-sdk/full-node/sov-stf-runner/src/config.rs index 931e3bde3..f1a0ac3c3 100644 --- a/crates/sovereign-sdk/full-node/sov-stf-runner/src/config.rs +++ b/crates/sovereign-sdk/full-node/sov-stf-runner/src/config.rs @@ -106,7 +106,7 @@ pub struct RollupPublicKeys { /// Rollup Configuration #[derive(Debug, Clone, PartialEq, Deserialize)] -pub struct FullNodeConfig { +pub struct FullNodeConfig { /// RPC configuration pub rpc: RpcConfig, /// Currently rollup config runner only supports storage path parameter @@ -114,7 +114,7 @@ pub struct FullNodeConfig { /// Runner own configuration. pub runner: Option, // optional bc sequencer doesn't need it /// Data Availability service configuration. - pub da: DaServiceConfig, + pub da: BitcoinServiceConfig, /// Important pubkeys pub public_keys: RollupPublicKeys, /// Number of blocks to request during sync