Skip to content

Commit

Permalink
use starknet_api and cairo-* deps from katana-cairo instead of workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
kariy committed Jul 8, 2024
1 parent 7c09e4a commit 5e0b269
Show file tree
Hide file tree
Showing 26 changed files with 124 additions and 166 deletions.
38 changes: 4 additions & 34 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 bin/katana/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ version.workspace = true
[dependencies]
alloy-primitives.workspace = true
anyhow.workspace = true
cfg-if = "1.0.0"
clap.workspace = true
clap_complete.workspace = true
common.workspace = true
Expand All @@ -22,7 +21,6 @@ katana-rpc-api.workspace = true
katana-rpc.workspace = true
serde_json.workspace = true
shellexpand = "3.1.0"
starknet_api.workspace = true
tokio.workspace = true
tracing-subscriber.workspace = true
tracing.workspace = true
Expand Down
2 changes: 2 additions & 0 deletions bin/katana/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![cfg_attr(not(test), warn(unused_crate_dependencies))]

use std::io;
use std::net::SocketAddr;
use std::sync::Arc;
Expand Down
4 changes: 2 additions & 2 deletions bin/sozo/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ pub enum Commands {
Init(InitArgs),
#[command(about = "Remove generated artifacts, manifests and abis")]
Clean(CleanArgs),
#[command(about = "Run a migration, declaring and deploying contracts as necessary to update \
the world")]
#[command(about = "Run a migration, declaring and deploying contracts as necessary to \
update the world")]
Migrate(Box<MigrateArgs>),
#[command(about = "Developer mode: watcher for building and migration")]
Dev(DevArgs),
Expand Down
2 changes: 1 addition & 1 deletion crates/benches/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ version.workspace = true
clap_builder = "4.4.6"
reqwest = { workspace = true, features = [ "blocking", "json", "rustls-tls" ], default-features = false }

katana-core = { path = "../katana/core" }
# katana-core = { path = "../katana/core" }
katana-runner.workspace = true

anyhow.workspace = true
Expand Down
1 change: 1 addition & 0 deletions crates/katana/cairo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ cairo-lang-starknet = { git = "https://github.com/starkware-libs/cairo", tag = "
cairo-lang-starknet-classes = { git = "https://github.com/starkware-libs/cairo", tag = "v2.6.3" }
cairo-lang-utils = { git = "https://github.com/starkware-libs/cairo", tag = "v2.6.3" }
cairo-vm = "0.9.2"
starknet_api = "0.11.0"
2 changes: 1 addition & 1 deletion crates/katana/cairo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ pub mod lang {
};
}

pub use cairo_vm;
pub use {cairo_vm, starknet_api};
20 changes: 8 additions & 12 deletions crates/katana/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,19 @@ katana-provider.workspace = true
katana-tasks.workspace = true

anyhow.workspace = true
async-trait.workspace = true
async-trait = { workspace = true, optional = true }
cairo-vm.workspace = true
convert_case.workspace = true
derive_more.workspace = true
dojo-metrics.workspace = true
flate2.workspace = true
futures.workspace = true
k256 = { version = "0.13", default-features = false, features = [ "ecdsa", "std" ] }
lazy_static.workspace = true
metrics.workspace = true
num-traits.workspace = true
parking_lot.workspace = true
rand = { workspace = true, features = [ "small_rng" ] }
reqwest.workspace = true
serde.workspace = true
serde_json.workspace = true
serde_with.workspace = true
reqwest = { workspace = true, optional = true }
serde = { workspace = true, optional = true }
serde_json = { workspace = true, optional = true }
starknet.workspace = true
starknet_api.workspace = true
thiserror.workspace = true
tokio.workspace = true
tracing.workspace = true
Expand All @@ -45,7 +39,6 @@ alloy-contract = { version = "0.1.0", default-features = false, optional = true
alloy-network = { version = "0.1.0", default-features = false, optional = true }
alloy-provider = { version = "0.1.0", default-features = false, optional = true, features = [ "reqwest" ] }
alloy-rpc-types = { version = "0.1.0", default-features = false, optional = true }
alloy-signer = { version = "0.1.0", default-features = false, optional = true }
alloy-transport = { version = "0.1.0", default-features = false, optional = true }

[dev-dependencies]
Expand All @@ -59,8 +52,11 @@ messaging = [
"alloy-network",
"alloy-provider",
"alloy-rpc-types",
"alloy-signer",
"alloy-sol-types",
"alloy-transport",
"async-trait",
"reqwest",
"serde",
"serde_json",
]
starknet-messaging = [ ]
2 changes: 2 additions & 0 deletions crates/katana/core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![cfg_attr(not(test), warn(unused_crate_dependencies))]

pub mod backend;
pub mod constants;
pub mod env;
Expand Down
10 changes: 3 additions & 7 deletions crates/katana/executor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,11 @@ katana-primitives.workspace = true
katana-provider.workspace = true

convert_case.workspace = true
futures.workspace = true
parking_lot.workspace = true
serde_json.workspace = true
starknet.workspace = true
starknet_api.workspace = true
starknet = { workspace = true, optional = true }
thiserror.workspace = true
tracing.workspace = true

alloy-primitives.workspace = true

# blockifier deps
blockifier = { git = "https://github.com/dojoengine/blockifier", rev = "57c11586", features = [ "testing" ], optional = true }
katana-cairo = { workspace = true, optional = true }
Expand All @@ -32,6 +27,7 @@ katana-cairo = { workspace = true, optional = true }
# starknet-types-core = { version = "0.0.9", optional = true }

[dev-dependencies]
alloy-primitives.workspace = true
anyhow.workspace = true
katana-cairo.workspace = true
katana-provider = { workspace = true, features = [ "test-utils" ] }
Expand All @@ -46,7 +42,7 @@ criterion.workspace = true
pprof = { version = "0.13.0", features = [ "criterion", "flamegraph" ] }

[features]
blockifier = [ "dep:blockifier", "dep:katana-cairo" ]
blockifier = [ "dep:blockifier", "dep:katana-cairo", "dep:starknet" ]
default = [ "blockifier" ]
# native = [ "sir", "sir/cairo-native" ]
# sir = [ "dep:sir", "dep:starknet-types-core" ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ use blockifier::block::{BlockInfo, GasPrices};
use blockifier::context::BlockContext;
use blockifier::state::cached_state::{self, GlobalContractCache, MutRefState};
use blockifier::state::state_api::StateReader;
use katana_cairo::starknet_api::block::{BlockNumber, BlockTimestamp};
use katana_primitives::block::{ExecutableBlock, GasPrices as KatanaGasPrices, PartialHeader};
use katana_primitives::env::{BlockEnv, CfgEnv};
use katana_primitives::fee::TxFeeInfo;
use katana_primitives::transaction::{ExecutableTx, ExecutableTxWithHash, TxWithHash};
use katana_primitives::FieldElement;
use katana_provider::traits::state::StateProvider;
use starknet_api::block::{BlockNumber, BlockTimestamp};
use tracing::info;

use self::state::CachedState;
Expand Down
Loading

0 comments on commit 5e0b269

Please sign in to comment.