Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename DaServiceConfig to BitcoinServiceConfig #1029

Merged
merged 1 commit into from
Aug 21, 2024
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
4 changes: 2 additions & 2 deletions bin/citrea/src/main.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -107,7 +107,7 @@ async fn main() -> Result<(), anyhow::Error> {
.await?;
}
SupportedDaLayer::Bitcoin => {
start_rollup::<BitcoinRollup, DaServiceConfig>(
start_rollup::<BitcoinRollup, BitcoinServiceConfig>(
&GenesisPaths::from_dir(&args.genesis_paths),
rollup_config_path,
prover_config,
Expand Down
4 changes: 2 additions & 2 deletions bin/citrea/src/rollup/bitcoin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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;
Expand Down
16 changes: 8 additions & 8 deletions crates/bitcoin-da/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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<SenderWithNotifier<TxidWrapper>>,
) -> Result<Self> {
Expand Down Expand Up @@ -193,7 +193,7 @@ impl BitcoinService {

#[cfg(test)]
pub async fn new_without_wallet_check(
config: DaServiceConfig,
config: BitcoinServiceConfig,
chain_params: RollupParams,
tx: UnboundedSender<SenderWithNotifier<TxidWrapper>>,
) -> Result<Self> {
Expand Down Expand Up @@ -817,15 +817,15 @@ 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;
use crate::spec::RollupParams;
use crate::verifier::BitcoinVerifier;

async fn get_service() -> Arc<BitcoinService> {
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(),
Expand Down Expand Up @@ -858,7 +858,7 @@ mod tests {
}

async fn get_service_wrong_rollup_name() -> Arc<BitcoinService> {
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(),
Expand Down Expand Up @@ -891,7 +891,7 @@ mod tests {
}

async fn get_service_correct_sig_different_public_key() -> Arc<BitcoinService> {
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(),
Expand Down Expand Up @@ -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(),
Expand Down
4 changes: 2 additions & 2 deletions crates/sovereign-sdk/full-node/sov-stf-runner/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,15 @@ pub struct RollupPublicKeys {

/// Rollup Configuration
#[derive(Debug, Clone, PartialEq, Deserialize)]
pub struct FullNodeConfig<DaServiceConfig> {
pub struct FullNodeConfig<BitcoinServiceConfig> {
/// RPC configuration
pub rpc: RpcConfig,
/// Currently rollup config runner only supports storage path parameter
pub storage: StorageConfig,
/// Runner own configuration.
pub runner: Option<RunnerConfig>, // 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
Expand Down
Loading