Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Change visibility of open_database for use in cumulus #6034

Merged
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
14 changes: 7 additions & 7 deletions node/service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ impl IdentifyVariant for Box<dyn ChainSpec> {
}

#[cfg(feature = "full-node")]
fn open_database(db_source: &DatabaseSource) -> Result<Arc<dyn Database>, Error> {
pub fn open_database(db_source: &DatabaseSource) -> Result<Arc<dyn Database>, Error> {
let parachains_db = match db_source {
DatabaseSource::RocksDb { path, .. } => parachains_db::open_creating_rocksdb(
path.clone(),
Expand Down Expand Up @@ -718,6 +718,11 @@ where
Ok(leaves.into_iter().rev().take(MAX_ACTIVE_LEAVES).collect())
}

pub const AVAILABILITY_CONFIG: AvailabilityConfig = AvailabilityConfig {
col_data: parachains_db::REAL_COLUMNS.col_availability_data,
col_meta: parachains_db::REAL_COLUMNS.col_availability_meta,
};

/// Create a new full node of arbitrary runtime and executor.
///
/// This is an advanced feature and not recommended for general use. Generally, `build_full` is
Expand Down Expand Up @@ -926,11 +931,6 @@ where

let parachains_db = open_database(&config.database)?;

let availability_config = AvailabilityConfig {
col_data: parachains_db::REAL_COLUMNS.col_availability_data,
col_meta: parachains_db::REAL_COLUMNS.col_availability_meta,
};

let approval_voting_config = ApprovalVotingConfig {
col_data: parachains_db::REAL_COLUMNS.col_approval_data,
slot_duration_millis: slot_duration.as_millis() as u64,
Expand Down Expand Up @@ -1063,7 +1063,7 @@ where
spawner,
is_collator,
approval_voting_config,
availability_config,
availability_config: AVAILABILITY_CONFIG,
candidate_validation_config,
chain_selection_config,
dispute_coordinator_config,
Expand Down