Skip to content

Commit

Permalink
Fix compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
sanlee42 committed Nov 19, 2023
1 parent 838d354 commit b8febf4
Show file tree
Hide file tree
Showing 45 changed files with 602 additions and 5,979 deletions.
54 changes: 1 addition & 53 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ members = [
"cmd/db-exporter",
"cmd/genesis-nft-miner",
"flexidag",
"flexidag/service"
]

default-members = [
Expand Down Expand Up @@ -220,7 +219,6 @@ default-members = [
"cmd/miner_client/api",
"cmd/db-exporter",
"flexidag",
"flexidag/service",
]

[profile.dev]
Expand Down
18 changes: 1 addition & 17 deletions chain/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ use starcoin_chain_api::{
ExecutedBlock, MintedUncleNumber, TransactionInfoWithProof, VerifiedBlock, VerifyBlockField,
};
use starcoin_config::ChainNetworkID;
use starcoin_consensus::dag::types::ghostdata::GhostdagData;
use starcoin_consensus::{BlockDAG, Consensus, FlexiDagStorage};
use starcoin_consensus::Consensus;
use starcoin_crypto::hash::PlainCryptoHash;
use starcoin_crypto::HashValue;
use starcoin_executor::VMMetrics;
Expand All @@ -31,7 +30,6 @@ use starcoin_types::block::BlockIdAndNumber;
use starcoin_types::contract_event::ContractEventInfo;
use starcoin_types::dag_block::KTotalDifficulty;
use starcoin_types::filter::Filter;
use starcoin_types::header::DagHeader;
use starcoin_types::startup_info::{ChainInfo, ChainStatus};
use starcoin_types::transaction::RichTransactionInfo;
use starcoin_types::{
Expand All @@ -47,7 +45,6 @@ use starcoin_vm_types::account_config::genesis_address;
use starcoin_vm_types::genesis_config::ConsensusStrategy;
use starcoin_vm_types::on_chain_resource::Epoch;
use std::cmp::min;
use std::collections::BTreeSet;
use std::iter::Extend;
use std::option::Option::{None, Some};
use std::{collections::HashMap, sync::Arc};
Expand Down Expand Up @@ -107,19 +104,6 @@ impl BlockChain {
.ok_or_else(|| format_err!("Can not find genesis hash in storage."))?;
let head_id = head_block.id();
watch(CHAIN_WATCH_NAME, "n1253");

// let dag_accumulator = match storage.get_dag_accumulator_info(head_id)? {
// Some(accmulator_info) => Some(info_2_accumulator(
// accmulator_info,
// AccumulatorStoreType::SyncDag,
// storage.as_ref(),
// )),
// None => None,
// };
// let dag_snapshot_tips = storage
// .get_accumulator_snapshot_storage()
// .get(head_id)?
// .map(|snapshot| snapshot.child_hashes);
let mut chain = Self {
genesis_hash: genesis,
time_service,
Expand Down
10 changes: 8 additions & 2 deletions consensus/src/dag/blockdag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ use starcoin_accumulator::accumulator_info::AccumulatorInfo;
use starcoin_accumulator::node::AccumulatorStoreType;
use starcoin_accumulator::{Accumulator, MerkleAccumulator};
use starcoin_config::{NodeConfig, RocksdbConfig};
use starcoin_crypto::HashValue as Hash;
use starcoin_crypto::{HashValue as Hash, HashValue};
use starcoin_storage::flexi_dag::SyncFlexiDagSnapshotHasher;
use starcoin_storage::storage::CodecKVStore;
use starcoin_storage::{BlockStore, Storage, Store, SyncFlexiDagStore};
use starcoin_types::block::BlockNumber;
use starcoin_types::block::{BlockHeader, BlockNumber};
use starcoin_types::dag_block::KTotalDifficulty;
use starcoin_types::startup_info;
use starcoin_types::{
Expand Down Expand Up @@ -239,6 +239,12 @@ impl BlockDAG {
) -> Result<(), StoreError> {
self.storage.relations_store.insert(child, parents)
}


pub fn get_ghostdag_data_by_child(&self, hash: Hash) -> anyhow::Result<Arc<GhostdagData>> {
let ghostdata = self.storage.ghost_dag_store.get_data(hash)?;
return Ok(ghostdata);
}
}

#[cfg(test)]
Expand Down
28 changes: 6 additions & 22 deletions flexidag/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,20 @@ homepage = { workspace = true }
repository = { workspace = true }
rust-version = { workspace = true }

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
anyhow = { workspace = true }
async-trait = { workspace = true }
byteorder = { workspace = true }

futures = { workspace = true }
hex = { default-features = false, workspace = true }
once_cell = { workspace = true }
proptest = { default-features = false, optional = true, workspace = true }
proptest-derive = { default-features = false, optional = true, workspace = true }
rand = { workspace = true }
rand_core = { default-features = false, workspace = true }
rust-argon2 = { workspace = true }
sha3 = { workspace = true }
starcoin-chain-api = { workspace = true }
starcoin-config = { workspace = true }
starcoin-crypto = { workspace = true }
starcoin-logger = { workspace = true }
starcoin-service-registry = { workspace = true }
starcoin-state-api = { workspace = true }
starcoin-time-service = { workspace = true }
starcoin-storage = { workspace = true }
starcoin-types = { workspace = true }
starcoin-vm-types = { workspace = true }
tokio = { workspace = true }
starcoin-consensus = { workspace = true }
starcoin-accumulator = { workspace = true }
thiserror = { workspace = true }
rocksdb = { workspace = true }
bincode = { workspace = true }
serde = { workspace = true }
starcoin-storage = { workspace = true }
parking_lot = { workspace = true }
itertools = { workspace = true }
starcoin-config = { workspace = true }
bcs-ext = { workspace = true }

41 changes: 0 additions & 41 deletions flexidag/service/Cargo.toml

This file was deleted.

1 change: 0 additions & 1 deletion flexidag/service/src/lib.rs

This file was deleted.

Loading

0 comments on commit b8febf4

Please sign in to comment.