Skip to content

Commit

Permalink
On-demand calculation for Ghostdag for Higher Levels (#494)
Browse files Browse the repository at this point in the history
* Refactor pruning proof validation to many functions

Co-authored-by: Ori Newman <[email protected]>

* Use blue score as work for higher levels

Co-authored-by: Ori Newman <[email protected]>

* Remove pruning processor dependency on gd managers

Co-authored-by: Ori Newman <[email protected]>

* Consistency renaming

Co-authored-by: Ori Newman <[email protected]>

* Update db version

Co-authored-by: Ori Newman <[email protected]>

* GD Optimizations

Co-authored-by: Ori Newman <[email protected]>

* Remove remnant of old impl. optimize db prefixes

* Ensure parents are in relations; Add comments

apply_proof only inserts parent entries for a header from the proof into
the relations store for a level if there was GD data in the old stores
for that header.

This adds a check to filter out parent records not in relations store

* Match depth check to block_at_depth logic

* Use singular GD store for header processing

* Relax the panic to warn when finished_headers and couldn't find sufficient root

This happens when there's not enough headers in the pruning proof but it satisfies validation

* Error handling for gd on higher levels

relations.get_parents on GD gets extra parents that aren't in the
current GD store. so get_blue_work throws an error

next, ORIGIN was mising from the GD so add that

* remove using deeper requirements in lower levels

* Fix missed references to self.ghostdag_stores in validate_pruning_point_proof

* Refactoring for single GD header processing

* Add assertion to check root vs old_root

* Lint fix current_dag_level

* Keep DB Version at 3

The new prefixes added are compatible with the old version. We don't want to trigger a db delete with this change

* Cleanup apply_proof logic and handle more ghostdag_stores logic

* remove simpa changes

* Remove rewriting origin to primary GD

It's already on there

* More refactoring to use single GD store/manager

* Lint fixes

* warn to trace for common retry

* Address initial comments

* Remove "primary" in ghostdag store/manager references

* Add small safety margin to proof at level 0

This prevents the case where new root is an anticone of old root

* Revert to only do proof rebuilding on sanity check

* Proper "better" proof check

* Update comment on find_selected_parent_header_at_level

* Re-apply missed comment

* Implement db upgrade logic from 3 to 4

* Explain further the workaround for GD ordering.rs

* Minor update to Display of TempGD keys

* Various fixes

- Keep using old root to minimize proof size. Old root is calculated
  using the temporary gd stores
- fix the off-by-one in block_at_depth and chain_up_to_depth
- revert the temp fix to sync with the off-by-one

* Revert "Various fixes"

This reverts commit bc56e65.

This experimental commit requires a bit more thinking to apply, and
optimization can be deferred.

* Revert better proof check

Recreates the GD stores for the current consensus by checking existing proof

* Fix: use cc gd store

* When building pruning point proof ghostdag data, ignore blocks before the root

* Add trusted blocks to all relevant levels during apply_proof

As opposed to applying only to level 0

* Calculate headers estimate in init proof stores

* Explain finished headers logic

Add back the panic if we couldn't find the required block and our headers are done

Add explanation in comment for why trying anyway if finished_headers is acceptable

* clarify comment

* Rename old_root to depth_based_root

explain logic for the two root calculation

* More merge fixes

* Refactor relations services into self

* Use blue_work for find_selected_parent_header_at_level

* Comment fixes and small refactor

* Revert rename to old root

* Lint fix from merged code

* Some cleanup

- use BlueWorkType
- fix some comments

* remove last reference to ghostdag_primary_*

* Cleaner find_selected_parent_header_at_level

Co-authored-by: Michael Sutton <[email protected]>

* Refactor for better readability and add more docs

* Smaller safety margin for all

* Lint and logic fix

* Reduce loop depth increase on level proof retries

Co-authored-by: Michael Sutton <[email protected]>

* Update consensus/src/processes/pruning_proof/mod.rs

Co-authored-by: Michael Sutton <[email protected]>

* Comment cleanup

* Remove unnecessary clone

Co-authored-by: Michael Sutton <[email protected]>

* Rename genesis_hash to root; Remove redundant filter

* Cleaner reachability_stores type

Co-authored-by: Michael Sutton <[email protected]>

* Change failed to find sufficient root log to debug

* Bump node version to 0.15.3

* A few minor leftovers

---------

Co-authored-by: Ori Newman <[email protected]>
Co-authored-by: Michael Sutton <[email protected]>
Co-authored-by: Michael Sutton <[email protected]>
  • Loading branch information
4 people authored Oct 29, 2024
1 parent aac16a9 commit 3a2bcbb
Show file tree
Hide file tree
Showing 19 changed files with 956 additions and 347 deletions.
118 changes: 60 additions & 58 deletions Cargo.lock

Large diffs are not rendered by default.

112 changes: 56 additions & 56 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ members = [

[workspace.package]
rust-version = "1.81.0"
version = "0.15.2"
version = "0.15.3"
authors = ["Kaspa developers"]
license = "ISC"
repository = "https://github.com/kaspanet/rusty-kaspa"
Expand All @@ -80,61 +80,61 @@ include = [
]

[workspace.dependencies]
# kaspa-testing-integration = { version = "0.15.2", path = "testing/integration" }
kaspa-addresses = { version = "0.15.2", path = "crypto/addresses" }
kaspa-addressmanager = { version = "0.15.2", path = "components/addressmanager" }
kaspa-bip32 = { version = "0.15.2", path = "wallet/bip32" }
kaspa-cli = { version = "0.15.2", path = "cli" }
kaspa-connectionmanager = { version = "0.15.2", path = "components/connectionmanager" }
kaspa-consensus = { version = "0.15.2", path = "consensus" }
kaspa-consensus-core = { version = "0.15.2", path = "consensus/core" }
kaspa-consensus-client = { version = "0.15.2", path = "consensus/client" }
kaspa-consensus-notify = { version = "0.15.2", path = "consensus/notify" }
kaspa-consensus-wasm = { version = "0.15.2", path = "consensus/wasm" }
kaspa-consensusmanager = { version = "0.15.2", path = "components/consensusmanager" }
kaspa-core = { version = "0.15.2", path = "core" }
kaspa-daemon = { version = "0.15.2", path = "daemon" }
kaspa-database = { version = "0.15.2", path = "database" }
kaspa-grpc-client = { version = "0.15.2", path = "rpc/grpc/client" }
kaspa-grpc-core = { version = "0.15.2", path = "rpc/grpc/core" }
kaspa-grpc-server = { version = "0.15.2", path = "rpc/grpc/server" }
kaspa-hashes = { version = "0.15.2", path = "crypto/hashes" }
kaspa-index-core = { version = "0.15.2", path = "indexes/core" }
kaspa-index-processor = { version = "0.15.2", path = "indexes/processor" }
kaspa-math = { version = "0.15.2", path = "math" }
kaspa-merkle = { version = "0.15.2", path = "crypto/merkle" }
kaspa-metrics-core = { version = "0.15.2", path = "metrics/core" }
kaspa-mining = { version = "0.15.2", path = "mining" }
kaspa-mining-errors = { version = "0.15.2", path = "mining/errors" }
kaspa-muhash = { version = "0.15.2", path = "crypto/muhash" }
kaspa-notify = { version = "0.15.2", path = "notify" }
kaspa-p2p-flows = { version = "0.15.2", path = "protocol/flows" }
kaspa-p2p-lib = { version = "0.15.2", path = "protocol/p2p" }
kaspa-perf-monitor = { version = "0.15.2", path = "metrics/perf_monitor" }
kaspa-pow = { version = "0.15.2", path = "consensus/pow" }
kaspa-rpc-core = { version = "0.15.2", path = "rpc/core" }
kaspa-rpc-macros = { version = "0.15.2", path = "rpc/macros" }
kaspa-rpc-service = { version = "0.15.2", path = "rpc/service" }
kaspa-txscript = { version = "0.15.2", path = "crypto/txscript" }
kaspa-txscript-errors = { version = "0.15.2", path = "crypto/txscript/errors" }
kaspa-utils = { version = "0.15.2", path = "utils" }
kaspa-utils-tower = { version = "0.15.2", path = "utils/tower" }
kaspa-utxoindex = { version = "0.15.2", path = "indexes/utxoindex" }
kaspa-wallet = { version = "0.15.2", path = "wallet/native" }
kaspa-wallet-cli-wasm = { version = "0.15.2", path = "wallet/wasm" }
kaspa-wallet-keys = { version = "0.15.2", path = "wallet/keys" }
kaspa-wallet-pskt = { version = "0.15.2", path = "wallet/pskt" }
kaspa-wallet-core = { version = "0.15.2", path = "wallet/core" }
kaspa-wallet-macros = { version = "0.15.2", path = "wallet/macros" }
kaspa-wasm = { version = "0.15.2", path = "wasm" }
kaspa-wasm-core = { version = "0.15.2", path = "wasm/core" }
kaspa-wrpc-client = { version = "0.15.2", path = "rpc/wrpc/client" }
kaspa-wrpc-proxy = { version = "0.15.2", path = "rpc/wrpc/proxy" }
kaspa-wrpc-server = { version = "0.15.2", path = "rpc/wrpc/server" }
kaspa-wrpc-wasm = { version = "0.15.2", path = "rpc/wrpc/wasm" }
kaspa-wrpc-example-subscriber = { version = "0.15.2", path = "rpc/wrpc/examples/subscriber" }
kaspad = { version = "0.15.2", path = "kaspad" }
kaspa-alloc = { version = "0.15.2", path = "utils/alloc" }
# kaspa-testing-integration = { version = "0.15.3", path = "testing/integration" }
kaspa-addresses = { version = "0.15.3", path = "crypto/addresses" }
kaspa-addressmanager = { version = "0.15.3", path = "components/addressmanager" }
kaspa-bip32 = { version = "0.15.3", path = "wallet/bip32" }
kaspa-cli = { version = "0.15.3", path = "cli" }
kaspa-connectionmanager = { version = "0.15.3", path = "components/connectionmanager" }
kaspa-consensus = { version = "0.15.3", path = "consensus" }
kaspa-consensus-core = { version = "0.15.3", path = "consensus/core" }
kaspa-consensus-client = { version = "0.15.3", path = "consensus/client" }
kaspa-consensus-notify = { version = "0.15.3", path = "consensus/notify" }
kaspa-consensus-wasm = { version = "0.15.3", path = "consensus/wasm" }
kaspa-consensusmanager = { version = "0.15.3", path = "components/consensusmanager" }
kaspa-core = { version = "0.15.3", path = "core" }
kaspa-daemon = { version = "0.15.3", path = "daemon" }
kaspa-database = { version = "0.15.3", path = "database" }
kaspa-grpc-client = { version = "0.15.3", path = "rpc/grpc/client" }
kaspa-grpc-core = { version = "0.15.3", path = "rpc/grpc/core" }
kaspa-grpc-server = { version = "0.15.3", path = "rpc/grpc/server" }
kaspa-hashes = { version = "0.15.3", path = "crypto/hashes" }
kaspa-index-core = { version = "0.15.3", path = "indexes/core" }
kaspa-index-processor = { version = "0.15.3", path = "indexes/processor" }
kaspa-math = { version = "0.15.3", path = "math" }
kaspa-merkle = { version = "0.15.3", path = "crypto/merkle" }
kaspa-metrics-core = { version = "0.15.3", path = "metrics/core" }
kaspa-mining = { version = "0.15.3", path = "mining" }
kaspa-mining-errors = { version = "0.15.3", path = "mining/errors" }
kaspa-muhash = { version = "0.15.3", path = "crypto/muhash" }
kaspa-notify = { version = "0.15.3", path = "notify" }
kaspa-p2p-flows = { version = "0.15.3", path = "protocol/flows" }
kaspa-p2p-lib = { version = "0.15.3", path = "protocol/p2p" }
kaspa-perf-monitor = { version = "0.15.3", path = "metrics/perf_monitor" }
kaspa-pow = { version = "0.15.3", path = "consensus/pow" }
kaspa-rpc-core = { version = "0.15.3", path = "rpc/core" }
kaspa-rpc-macros = { version = "0.15.3", path = "rpc/macros" }
kaspa-rpc-service = { version = "0.15.3", path = "rpc/service" }
kaspa-txscript = { version = "0.15.3", path = "crypto/txscript" }
kaspa-txscript-errors = { version = "0.15.3", path = "crypto/txscript/errors" }
kaspa-utils = { version = "0.15.3", path = "utils" }
kaspa-utils-tower = { version = "0.15.3", path = "utils/tower" }
kaspa-utxoindex = { version = "0.15.3", path = "indexes/utxoindex" }
kaspa-wallet = { version = "0.15.3", path = "wallet/native" }
kaspa-wallet-cli-wasm = { version = "0.15.3", path = "wallet/wasm" }
kaspa-wallet-keys = { version = "0.15.3", path = "wallet/keys" }
kaspa-wallet-pskt = { version = "0.15.3", path = "wallet/pskt" }
kaspa-wallet-core = { version = "0.15.3", path = "wallet/core" }
kaspa-wallet-macros = { version = "0.15.3", path = "wallet/macros" }
kaspa-wasm = { version = "0.15.3", path = "wasm" }
kaspa-wasm-core = { version = "0.15.3", path = "wasm/core" }
kaspa-wrpc-client = { version = "0.15.3", path = "rpc/wrpc/client" }
kaspa-wrpc-proxy = { version = "0.15.3", path = "rpc/wrpc/proxy" }
kaspa-wrpc-server = { version = "0.15.3", path = "rpc/wrpc/server" }
kaspa-wrpc-wasm = { version = "0.15.3", path = "rpc/wrpc/wasm" }
kaspa-wrpc-example-subscriber = { version = "0.15.3", path = "rpc/wrpc/examples/subscriber" }
kaspad = { version = "0.15.3", path = "kaspad" }
kaspa-alloc = { version = "0.15.3", path = "utils/alloc" }

# external
aes = "0.8.3"
Expand Down
19 changes: 18 additions & 1 deletion consensus/src/consensus/factory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ pub struct MultiConsensusMetadata {
version: u32,
}

const LATEST_DB_VERSION: u32 = 3;
const LATEST_DB_VERSION: u32 = 4;
impl Default for MultiConsensusMetadata {
fn default() -> Self {
Self {
Expand Down Expand Up @@ -219,6 +219,23 @@ impl MultiConsensusManagementStore {
}
}

/// Returns the current version of this database
pub fn version(&self) -> StoreResult<u32> {
match self.metadata.read() {
Ok(data) => Ok(data.version),
Err(err) => Err(err),
}
}

/// Set the database version to a different one
pub fn set_version(&mut self, version: u32) -> StoreResult<()> {
self.metadata.update(DirectDbWriter::new(&self.db), |mut data| {
data.version = version;
data
})?;
Ok(())
}

pub fn should_upgrade(&self) -> StoreResult<bool> {
match self.metadata.read() {
Ok(data) => Ok(data.version != LATEST_DB_VERSION),
Expand Down
14 changes: 7 additions & 7 deletions consensus/src/consensus/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ impl Consensus {
block_processors_pool,
db.clone(),
storage.statuses_store.clone(),
storage.ghostdag_primary_store.clone(),
storage.ghostdag_store.clone(),
storage.headers_store.clone(),
storage.block_transactions_store.clone(),
storage.body_tips_store.clone(),
Expand Down Expand Up @@ -500,7 +500,7 @@ impl ConsensusApi for Consensus {

fn get_virtual_merge_depth_blue_work_threshold(&self) -> BlueWorkType {
// PRUNE SAFETY: merge depth root is never close to being pruned (in terms of block depth)
self.get_virtual_merge_depth_root().map_or(BlueWorkType::ZERO, |root| self.ghostdag_primary_store.get_blue_work(root).unwrap())
self.get_virtual_merge_depth_root().map_or(BlueWorkType::ZERO, |root| self.ghostdag_store.get_blue_work(root).unwrap())
}

fn get_sink(&self) -> Hash {
Expand Down Expand Up @@ -533,7 +533,7 @@ impl ConsensusApi for Consensus {

for child in initial_children {
if visited.insert(child) {
let blue_work = self.ghostdag_primary_store.get_blue_work(child).unwrap();
let blue_work = self.ghostdag_store.get_blue_work(child).unwrap();
heap.push(Reverse(SortableBlock::new(child, blue_work)));
}
}
Expand All @@ -560,7 +560,7 @@ impl ConsensusApi for Consensus {

for child in children {
if visited.insert(child) {
let blue_work = self.ghostdag_primary_store.get_blue_work(child).unwrap();
let blue_work = self.ghostdag_store.get_blue_work(child).unwrap();
heap.push(Reverse(SortableBlock::new(child, blue_work)));
}
}
Expand Down Expand Up @@ -909,7 +909,7 @@ impl ConsensusApi for Consensus {
Some(BlockStatus::StatusInvalid) => return Err(ConsensusError::InvalidBlock(hash)),
_ => {}
};
let ghostdag = self.ghostdag_primary_store.get_data(hash).unwrap_option().ok_or(ConsensusError::MissingData(hash))?;
let ghostdag = self.ghostdag_store.get_data(hash).unwrap_option().ok_or(ConsensusError::MissingData(hash))?;
Ok((&*ghostdag).into())
}

Expand Down Expand Up @@ -985,7 +985,7 @@ impl ConsensusApi for Consensus {
Ok(self
.services
.window_manager
.block_window(&self.ghostdag_primary_store.get_data(hash).unwrap(), WindowType::SampledDifficultyWindow)
.block_window(&self.ghostdag_store.get_data(hash).unwrap(), WindowType::SampledDifficultyWindow)
.unwrap()
.deref()
.iter()
Expand Down Expand Up @@ -1024,7 +1024,7 @@ impl ConsensusApi for Consensus {
match start_hash {
Some(hash) => {
self.validate_block_exists(hash)?;
let ghostdag_data = self.ghostdag_primary_store.get_data(hash).unwrap();
let ghostdag_data = self.ghostdag_store.get_data(hash).unwrap();
// The selected parent header is used within to check for sampling activation, so we verify its existence first
if !self.headers_store.has(ghostdag_data.selected_parent).unwrap() {
return Err(ConsensusError::DifficultyError(DifficultyError::InsufficientWindowData(0)));
Expand Down
44 changes: 16 additions & 28 deletions consensus/src/consensus/services.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ pub struct ConsensusServices {
pub reachability_service: MTReachabilityService<DbReachabilityStore>,
pub window_manager: DbWindowManager,
pub dag_traversal_manager: DbDagTraversalManager,
pub ghostdag_managers: Arc<Vec<DbGhostdagManager>>,
pub ghostdag_primary_manager: DbGhostdagManager,
pub ghostdag_manager: DbGhostdagManager,
pub coinbase_manager: CoinbaseManager,
pub pruning_point_manager: DbPruningPointManager,
pub pruning_proof_manager: Arc<PruningProofManager>,
Expand Down Expand Up @@ -82,13 +81,13 @@ impl ConsensusServices {
let reachability_service = MTReachabilityService::new(storage.reachability_store.clone());
let dag_traversal_manager = DagTraversalManager::new(
params.genesis.hash,
storage.ghostdag_primary_store.clone(),
storage.ghostdag_store.clone(),
relations_service.clone(),
reachability_service.clone(),
);
let window_manager = DualWindowManager::new(
&params.genesis,
storage.ghostdag_primary_store.clone(),
storage.ghostdag_store.clone(),
storage.headers_store.clone(),
storage.daa_excluded_store.clone(),
storage.block_window_cache_for_difficulty.clone(),
Expand All @@ -110,27 +109,17 @@ impl ConsensusServices {
params.genesis.hash,
storage.depth_store.clone(),
reachability_service.clone(),
storage.ghostdag_primary_store.clone(),
storage.ghostdag_store.clone(),
);
let ghostdag_managers = Arc::new(
storage
.ghostdag_stores
.iter()
.cloned()
.enumerate()
.map(|(level, ghostdag_store)| {
GhostdagManager::new(
params.genesis.hash,
params.ghostdag_k,
ghostdag_store,
relations_services[level].clone(),
storage.headers_store.clone(),
reachability_service.clone(),
)
})
.collect_vec(),
let ghostdag_manager = GhostdagManager::new(
params.genesis.hash,
params.ghostdag_k,
storage.ghostdag_store.clone(),
relations_services[0].clone(),
storage.headers_store.clone(),
reachability_service.clone(),
false,
);
let ghostdag_primary_manager = ghostdag_managers[0].clone();

let coinbase_manager = CoinbaseManager::new(
params.coinbase_payload_script_public_key_max_len,
Expand Down Expand Up @@ -165,7 +154,7 @@ impl ConsensusServices {
params.finality_depth,
params.genesis.hash,
reachability_service.clone(),
storage.ghostdag_primary_store.clone(),
storage.ghostdag_store.clone(),
storage.headers_store.clone(),
storage.past_pruning_points_store.clone(),
storage.headers_selected_tip_store.clone(),
Expand All @@ -184,7 +173,7 @@ impl ConsensusServices {
&storage,
parents_manager.clone(),
reachability_service.clone(),
ghostdag_managers.clone(),
ghostdag_manager.clone(),
dag_traversal_manager.clone(),
window_manager.clone(),
params.max_block_level,
Expand All @@ -199,7 +188,7 @@ impl ConsensusServices {
params.mergeset_size_limit as usize,
reachability_service.clone(),
dag_traversal_manager.clone(),
storage.ghostdag_primary_store.clone(),
storage.ghostdag_store.clone(),
storage.selected_chain_store.clone(),
storage.headers_selected_tip_store.clone(),
storage.pruning_point_store.clone(),
Expand All @@ -213,8 +202,7 @@ impl ConsensusServices {
reachability_service,
window_manager,
dag_traversal_manager,
ghostdag_managers,
ghostdag_primary_manager,
ghostdag_manager,
coinbase_manager,
pruning_point_manager,
pruning_proof_manager,
Expand Down
25 changes: 8 additions & 17 deletions consensus/src/consensus/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ pub struct ConsensusStorage {
pub selected_chain_store: Arc<RwLock<DbSelectedChainStore>>,

// Append-only stores
pub ghostdag_stores: Arc<Vec<Arc<DbGhostdagStore>>>,
pub ghostdag_primary_store: Arc<DbGhostdagStore>,
pub ghostdag_store: Arc<DbGhostdagStore>,
pub headers_store: Arc<DbHeadersStore>,
pub block_transactions_store: Arc<DbBlockTransactionsStore>,
pub past_pruning_points_store: Arc<DbPastPruningPointsStore>,
Expand Down Expand Up @@ -193,19 +192,12 @@ impl ConsensusStorage {
children_builder.build(),
)));

let ghostdag_stores = Arc::new(
(0..=params.max_block_level)
.map(|level| {
Arc::new(DbGhostdagStore::new(
db.clone(),
level,
ghostdag_builder.downscale(level).build(),
ghostdag_compact_builder.downscale(level).build(),
))
})
.collect_vec(),
);
let ghostdag_primary_store = ghostdag_stores[0].clone();
let ghostdag_store = Arc::new(DbGhostdagStore::new(
db.clone(),
0,
ghostdag_builder.downscale(0).build(),
ghostdag_compact_builder.downscale(0).build(),
));
let daa_excluded_store = Arc::new(DbDaaStore::new(db.clone(), daa_excluded_builder.build()));
let headers_store = Arc::new(DbHeadersStore::new(db.clone(), headers_builder.build(), headers_compact_builder.build()));
let depth_store = Arc::new(DbDepthStore::new(db.clone(), header_data_builder.build()));
Expand Down Expand Up @@ -245,8 +237,7 @@ impl ConsensusStorage {
relations_stores,
reachability_relations_store,
reachability_store,
ghostdag_stores,
ghostdag_primary_store,
ghostdag_store,
pruning_point_store,
headers_selected_tip_store,
body_tips_store,
Expand Down
6 changes: 3 additions & 3 deletions consensus/src/consensus/test_consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ impl TestConsensus {

pub fn build_header_with_parents(&self, hash: Hash, parents: Vec<Hash>) -> Header {
let mut header = header_from_precomputed_hash(hash, parents);
let ghostdag_data = self.consensus.services.ghostdag_primary_manager.ghostdag(header.direct_parents());
let ghostdag_data = self.consensus.services.ghostdag_manager.ghostdag(header.direct_parents());
header.pruning_point = self
.consensus
.services
Expand Down Expand Up @@ -201,7 +201,7 @@ impl TestConsensus {
}

pub fn ghostdag_store(&self) -> &Arc<DbGhostdagStore> {
&self.consensus.ghostdag_primary_store
&self.consensus.ghostdag_store
}

pub fn reachability_store(&self) -> &Arc<RwLock<DbReachabilityStore>> {
Expand Down Expand Up @@ -233,7 +233,7 @@ impl TestConsensus {
}

pub fn ghostdag_manager(&self) -> &DbGhostdagManager {
&self.consensus.services.ghostdag_primary_manager
&self.consensus.services.ghostdag_manager
}
}

Expand Down
Loading

0 comments on commit 3a2bcbb

Please sign in to comment.