Skip to content

Commit

Permalink
chore(katana): move syncing specific component to /sync dir (#2789)
Browse files Browse the repository at this point in the history
  • Loading branch information
kariy authored Dec 10, 2024
1 parent 3e062fd commit 2738f67
Show file tree
Hide file tree
Showing 12 changed files with 59 additions and 22 deletions.
35 changes: 25 additions & 10 deletions Cargo.lock

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

6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ members = [
"crates/katana/grpc",
"crates/katana/node",
"crates/katana/node-bindings",
"crates/katana/pipeline",
"crates/katana/pool",
"crates/katana/primitives",
"crates/katana/rpc/rpc",
Expand All @@ -37,6 +36,8 @@ members = [
"crates/katana/storage/codecs/derive",
"crates/katana/storage/db",
"crates/katana/storage/provider",
"crates/katana/sync/pipeline",
"crates/katana/sync/stage",
"crates/katana/tasks",
"crates/katana/trie",
"crates/metrics",
Expand Down Expand Up @@ -101,7 +102,7 @@ katana-executor = { path = "crates/katana/executor" }
katana-feeder-gateway = { path = "crates/katana/feeder-gateway" }
katana-node = { path = "crates/katana/node", default-features = false }
katana-node-bindings = { path = "crates/katana/node-bindings" }
katana-pipeline = { path = "crates/katana/pipeline" }
katana-pipeline = { path = "crates/katana/sync/pipeline" }
katana-pool = { path = "crates/katana/pool" }
katana-primitives = { path = "crates/katana/primitives" }
katana-provider = { path = "crates/katana/storage/provider" }
Expand All @@ -111,6 +112,7 @@ katana-rpc-types = { path = "crates/katana/rpc/rpc-types" }
katana-rpc-types-builder = { path = "crates/katana/rpc/rpc-types-builder" }
katana-runner = { path = "crates/katana/runner" }
katana-slot-controller = { path = "crates/katana/controller" }
katana-stage = { path = "crates/katana/sync/stage" }
katana-tasks = { path = "crates/katana/tasks" }
katana-trie = { path = "crates/katana/trie" }

Expand Down
1 change: 1 addition & 0 deletions crates/katana/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ katana-pool.workspace = true
katana-primitives.workspace = true
katana-rpc.workspace = true
katana-rpc-api.workspace = true
katana-stage.workspace = true
katana-tasks.workspace = true

anyhow.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/katana/node/src/full/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ use dojo_metrics::{Report, Server as MetricsServer};
use exit::NodeStoppedFuture;
use katana_db::mdbx::DbEnv;
use katana_feeder_gateway::client::SequencerGateway;
use katana_pipeline::stage::{Blocks, Classes};
use katana_pipeline::{Pipeline, PipelineHandle};
use katana_pool::ordering::FiFo;
use katana_pool::pool::Pool;
use katana_pool::validation::NoopValidator;
use katana_primitives::transaction::ExecutableTxWithHash;
use katana_provider::providers::db::DbProvider;
use katana_stage::{Blocks, Classes};
use katana_tasks::TaskManager;
use tip_watcher::ChainTipWatcher;
use tracing::info;
Expand Down
2 changes: 1 addition & 1 deletion crates/katana/node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ use katana_core::service::block_producer::BlockProducer;
use katana_db::mdbx::DbEnv;
use katana_executor::implementation::blockifier::BlockifierFactory;
use katana_executor::{ExecutionFlags, ExecutorFactory};
use katana_pipeline::stage::Sequencing;
use katana_pool::ordering::FiFo;
use katana_pool::TxPool;
use katana_primitives::block::GasPrices;
Expand All @@ -48,6 +47,7 @@ use katana_rpc_api::dev::DevApiServer;
use katana_rpc_api::saya::SayaApiServer;
use katana_rpc_api::starknet::{StarknetApiServer, StarknetTraceApiServer, StarknetWriteApiServer};
use katana_rpc_api::torii::ToriiApiServer;
use katana_stage::Sequencing;
use katana_tasks::TaskManager;
use tower_http::cors::{AllowOrigin, CorsLayer};
use tracing::info;
Expand Down
19 changes: 19 additions & 0 deletions crates/katana/sync/pipeline/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[package]
edition.workspace = true
license.workspace = true
name = "katana-pipeline"
repository.workspace = true
version.workspace = true

[dependencies]
katana-primitives.workspace = true
katana-provider = { workspace = true, features = [ "test-utils" ] }
katana-stage.workspace = true

futures.workspace = true
thiserror.workspace = true
tokio.workspace = true
tracing.workspace = true

[dev-dependencies]
async-trait.workspace = true
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
#![cfg_attr(not(test), warn(unused_crate_dependencies))]

pub mod stage;

use core::future::IntoFuture;

use futures::future::BoxFuture;
use katana_primitives::block::BlockNumber;
use katana_provider::error::ProviderError;
use katana_provider::traits::stage::StageCheckpointProvider;
use stage::{Stage, StageExecutionInput};
use katana_stage::{Stage, StageExecutionInput};
use tokio::sync::watch;
use tracing::{error, info};

Expand All @@ -24,7 +22,7 @@ pub enum Error {
StageNotFound { id: String },

#[error(transparent)]
Stage(#[from] stage::Error),
Stage(#[from] katana_stage::Error),

#[error(transparent)]
Provider(#[from] ProviderError),
Expand Down Expand Up @@ -186,9 +184,9 @@ where
mod tests {
use katana_provider::test_utils::test_provider;
use katana_provider::traits::stage::StageCheckpointProvider;
use katana_stage::StageResult;

use super::{Pipeline, Stage, StageExecutionInput};
use crate::stage::StageResult;

struct MockStage;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
edition.workspace = true
license.workspace = true
name = "katana-pipeline"
name = "katana-stage"
repository.workspace = true
version.workspace = true

Expand All @@ -11,7 +11,7 @@ katana-executor.workspace = true
katana-feeder-gateway.workspace = true
katana-pool.workspace = true
katana-primitives.workspace = true
katana-provider = { workspace = true, features = [ "test-utils" ] }
katana-provider.workspace = true
katana-rpc-types.workspace = true
katana-tasks.workspace = true

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ mod tests {
use katana_provider::traits::block::BlockNumberProvider;

use super::Blocks;
use crate::stage::{Stage, StageExecutionInput};
use crate::{Stage, StageExecutionInput};

#[tokio::test]
async fn fetch_blocks() {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![cfg_attr(not(test), warn(unused_crate_dependencies))]

use katana_primitives::block::BlockNumber;
use katana_provider::error::ProviderError;

Expand Down
File renamed without changes.

0 comments on commit 2738f67

Please sign in to comment.