Skip to content

Commit

Permalink
refactor(block-producer): move db_block_validator to godwoken-bin
Browse files Browse the repository at this point in the history
  • Loading branch information
zeroqn committed Jul 11, 2022
1 parent 0d1ec0f commit be4a628
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 6 deletions.
8 changes: 7 additions & 1 deletion Cargo.lock

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

1 change: 0 additions & 1 deletion crates/block-producer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ openssl = { version = "0.10", features = ["vendored"] }
hex = "0.4"
async-trait = "0.1"
semver = "1.0"
rayon = "1.5"
thiserror = "1.0"
# For latest tracing
sentry = { git = "https://github.com/getsentry/sentry-rust", rev = "df694a49595d6890c510d80b85cfbb4b5ae6159a" }
Expand Down
1 change: 0 additions & 1 deletion crates/block-producer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ pub mod block_producer;
pub mod challenger;
pub mod cleaner;
pub mod custodian;
pub mod db_block_validator;
pub mod debugger;
pub mod deposit;
pub mod poller;
Expand Down
7 changes: 7 additions & 0 deletions crates/godwoken-bin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,25 @@ edition = "2021"

[dependencies]
anyhow = "1.0"
ckb-types = "0.100.0"
clap = "2.33.3"
indicatif = "0.16"
gw-block-producer = { path = "../block-producer" }
gw-chain = { path = "../chain" }
gw-challenge = { path = "../challenge" }
gw-common = { path = "../common" }
gw-config = { path = "../config" }
gw-db = { path = "../db" }
gw-generator = { path = "../generator" }
gw-jsonrpc-types = { path = "../jsonrpc-types" }
gw-store = { path = "../store" }
gw-types = { path = "../types" }
gw-utils = { path = "../utils" }
gw-version = { path = "../version" }
log = "0.4.14"
num_cpus = "1.13.1"
rayon = "1.5"
serde_json = "1.0"
tokio = { version = "1.17", features = ["full", "tracing"] }
toml = "0.5"

Expand Down
3 changes: 2 additions & 1 deletion crates/godwoken-bin/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ static GLOBAL_ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;

use anyhow::{Context, Result};
use clap::{App, Arg, SubCommand};
use gw_block_producer::{db_block_validator, runner, trace};
use gw_block_producer::{runner, trace};
use gw_config::{BackendSwitchConfig, Config};
use gw_version::Version;
use std::{env, fs, path::Path};

mod subcommand;
use subcommand::db_block_validator;
use subcommand::export_block::{ExportArgs, ExportBlock};
use subcommand::import_block::{ImportArgs, ImportBlock};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use anyhow::{anyhow, bail, Result};
use gw_block_producer::runner::BaseInitComponents;
use gw_challenge::{
cancel_challenge::LoadDataStrategy,
context::build_verify_context,
Expand Down Expand Up @@ -26,8 +27,6 @@ use std::{
sync::Arc,
};

use crate::runner::BaseInitComponents;

pub async fn verify(config: Config, from_block: Option<u64>, to_block: Option<u64>) -> Result<()> {
if config.store.path.as_os_str().is_empty() {
bail!("empty store path, no db block to verify");
Expand Down
1 change: 1 addition & 0 deletions crates/godwoken-bin/src/subcommand/mod.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
pub mod db_block_validator;
pub mod export_block;
pub mod import_block;

0 comments on commit be4a628

Please sign in to comment.