Skip to content

Commit

Permalink
chore(committer): renamed committer to starknet_patricia (#405)
Browse files Browse the repository at this point in the history
Signed-off-by: Dori Medini <dori@starkware.co>
  • Loading branch information
dorimedini-starkware authored Aug 12, 2024
1 parent 86ef5b0 commit ce118c1
Show file tree
Hide file tree
Showing 74 changed files with 154 additions and 151 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/committer_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ on:
- '.github/workflows/committer_ci.yml'
- 'Cargo.toml'
- 'Cargo.lock'
- 'crates/committer/**'
- 'crates/committer_cli/**'
- 'crates/starknet_committer/**'
- 'crates/starknet_patricia/**'

pull_request:
types:
Expand All @@ -26,9 +26,9 @@ on:
- '.github/workflows/committer_ci.yml'
- 'Cargo.toml'
- 'Cargo.lock'
- 'crates/committer/**'
- 'crates/committer_cli/**'
- 'crates/starknet_committer/**'
- 'crates/starknet_patricia/**'

jobs:
run-regression-tests:
Expand Down
46 changes: 23 additions & 23 deletions Cargo.lock

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

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ resolver = "2"

members = [
"crates/blockifier",
"crates/committer",
"crates/committer_cli",
"crates/gateway",
"crates/mempool",
Expand Down Expand Up @@ -34,6 +33,7 @@ members = [
"crates/starknet_api",
"crates/starknet_client",
"crates/starknet_committer",
"crates/starknet_patricia",
"crates/starknet_sierra_compile",
"crates/task_executor",
"crates/tests-integration",
Expand Down Expand Up @@ -79,7 +79,6 @@ camelpaste = "0.1.0"
chrono = "0.4.26"
clap = "4.5.4"
colored = "2.1.0"
committer = { path = "crates/committer", version = "0.1.0-rc.0" }
const_format = "0.2.30"
criterion = "0.5.1"
deadqueue = "0.2.4"
Expand Down Expand Up @@ -169,11 +168,13 @@ starknet-crypto = "0.5.1"
starknet-types-core = { version = "0.1.5", features = ["hash", "prime-bigint", "std"] }
starknet_api = { path = "crates/starknet_api", version = "0.13.0-rc.0" }
starknet_client = { path = "crates/starknet_client", version = "0.4.0-rc.0" }
starknet_committer = { path = "crates/starknet_committer", version = "0.1.0-rc.0" }
starknet_gateway = { path = "crates/gateway", version = "0.0" }
starknet_mempool = { path = "crates/mempool", version = "0.0" }
starknet_mempool_infra = { path = "crates/mempool_infra", version = "0.0" }
starknet_mempool_node = { path = "crates/mempool_node", version = "0.0" }
starknet_mempool_types = { path = "crates/mempool_types", version = "0.0" }
starknet_patricia = { path = "crates/starknet_patricia", version = "0.1.0-rc.0" }
starknet_sierra_compile = { path = "crates/starknet_sierra_compile", version = "0.0" }
starknet_task_executor = { path = "crates/task_executor", version = "0.0" }
static_assertions = "1.1.0"
Expand Down
1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const Configuration = {
'block_hash',
'blockifier',
'ci',
'committer',
'common',
'concurrency',
'config',
Expand Down
5 changes: 3 additions & 2 deletions crates/committer_cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[package]
# TODO(Dori, 15/8/2024): Rename to starknet_committer_cli.
name = "committer_cli"
version = "0.1.0-rc.0"
edition.workspace = true
Expand All @@ -17,7 +18,6 @@ tempfile.workspace = true

[dependencies]
clap = { workspace = true, features = ["cargo", "derive"] }
committer = { workspace = true, features = ["testing"] }
derive_more.workspace = true
ethnum.workspace = true
indexmap.workspace = true
Expand All @@ -28,7 +28,8 @@ serde_json.workspace = true
serde_repr.workspace = true
starknet-types-core.workspace = true
starknet_api.workspace = true
starknet_committer = { path = "../starknet_committer" }
starknet_committer.workspace = true
starknet_patricia = { workspace = true, features = ["testing"] }
strum.workspace = true
strum_macros.workspace = true
thiserror.workspace = true
Expand Down
6 changes: 3 additions & 3 deletions crates/committer_cli/benches/committer_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
use std::collections::HashMap;
use std::sync::Arc;

use committer::patricia_merkle_tree::external_test_utils::tree_computation_flow;
use committer::patricia_merkle_tree::node_data::leaf::LeafModifications;
use committer::patricia_merkle_tree::types::NodeIndex;
use committer_cli::commands::commit;
use committer_cli::parse_input::read::parse_input;
use committer_cli::tests::utils::parse_from_python::TreeFlowInput;
use criterion::{criterion_group, criterion_main, Criterion};
use starknet_committer::block_committer::input::StarknetStorageValue;
use starknet_committer::hash_function::hash::TreeHashFunctionImpl;
use starknet_committer::patricia_merkle_tree::tree::OriginalSkeletonStorageTrieConfig;
use starknet_patricia::patricia_merkle_tree::external_test_utils::tree_computation_flow;
use starknet_patricia::patricia_merkle_tree::node_data::leaf::LeafModifications;
use starknet_patricia::patricia_merkle_tree::types::NodeIndex;

const CONCURRENCY_MODE: bool = true;
const SINGLE_TREE_FLOW_INPUT: &str = include_str!("../test_inputs/tree_flow_inputs.json");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use committer::storage::map_storage::MapStorage;
use serde::Serialize;
use starknet_committer::forest::filled_forest::FilledForest;
use starknet_patricia::storage::map_storage::MapStorage;

pub struct SerializedForest(pub FilledForest);

Expand Down
8 changes: 4 additions & 4 deletions crates/committer_cli/src/parse_input/cast.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
use std::collections::HashMap;

use committer::felt::Felt;
use committer::hash::hash_trait::HashOutput;
use committer::storage::errors::DeserializationError;
use committer::storage::storage_trait::{StorageKey, StorageValue};
use starknet_committer::block_committer::input::{
ConfigImpl,
ContractAddress,
Expand All @@ -13,6 +9,10 @@ use starknet_committer::block_committer::input::{
StateDiff,
};
use starknet_committer::patricia_merkle_tree::types::{ClassHash, CompiledClassHash, Nonce};
use starknet_patricia::felt::Felt;
use starknet_patricia::hash::hash_trait::HashOutput;
use starknet_patricia::storage::errors::DeserializationError;
use starknet_patricia::storage::storage_trait::{StorageKey, StorageValue};

use crate::parse_input::raw_input::RawInput;

Expand Down
2 changes: 1 addition & 1 deletion crates/committer_cli/src/parse_input/read.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::fs::File;
use std::io::{self, BufWriter};

use committer::storage::errors::DeserializationError;
use serde::{Deserialize, Serialize};
use starknet_patricia::storage::errors::DeserializationError;

use crate::parse_input::cast::InputImpl;
use crate::parse_input::raw_input::RawInput;
Expand Down
8 changes: 4 additions & 4 deletions crates/committer_cli/src/parse_input/read_test.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
use std::collections::HashMap;

use committer::felt::Felt;
use committer::hash::hash_trait::HashOutput;
use committer::storage::errors::DeserializationError;
use committer::storage::storage_trait::{StorageKey, StorageValue};
use pretty_assertions::assert_eq;
use starknet_committer::block_committer::input::{
ConfigImpl,
Expand All @@ -14,6 +10,10 @@ use starknet_committer::block_committer::input::{
StateDiff,
};
use starknet_committer::patricia_merkle_tree::types::{ClassHash, CompiledClassHash, Nonce};
use starknet_patricia::felt::Felt;
use starknet_patricia::hash::hash_trait::HashOutput;
use starknet_patricia::storage::errors::DeserializationError;
use starknet_patricia::storage::storage_trait::{StorageKey, StorageValue};
use tracing::level_filters::LevelFilter;

use super::parse_input;
Expand Down
32 changes: 16 additions & 16 deletions crates/committer_cli/src/tests/python_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,6 @@ use std::collections::HashMap;
use std::fmt::Debug;
use std::io;

use committer::felt::Felt;
use committer::hash::hash_trait::HashOutput;
use committer::patricia_merkle_tree::external_test_utils::single_tree_flow_test;
use committer::patricia_merkle_tree::filled_tree::node::FilledNode;
use committer::patricia_merkle_tree::node_data::inner_node::{
BinaryData,
EdgeData,
EdgePathLength,
NodeData,
PathToBottom,
};
use committer::patricia_merkle_tree::types::SubTreeHeight;
use committer::storage::db_object::DBObject;
use committer::storage::errors::{DeserializationError, SerializationError};
use committer::storage::map_storage::MapStorage;
use committer::storage::storage_trait::{Storage, StorageKey, StorageValue};
use ethnum::U256;
use serde_json::json;
use starknet_api::block_hash::block_hash_calculator::{
Expand All @@ -37,6 +21,22 @@ use starknet_committer::hash_function::hash::TreeHashFunctionImpl;
use starknet_committer::patricia_merkle_tree::leaf::leaf_impl::ContractState;
use starknet_committer::patricia_merkle_tree::tree::OriginalSkeletonStorageTrieConfig;
use starknet_committer::patricia_merkle_tree::types::{ClassHash, CompiledClassHash, Nonce};
use starknet_patricia::felt::Felt;
use starknet_patricia::hash::hash_trait::HashOutput;
use starknet_patricia::patricia_merkle_tree::external_test_utils::single_tree_flow_test;
use starknet_patricia::patricia_merkle_tree::filled_tree::node::FilledNode;
use starknet_patricia::patricia_merkle_tree::node_data::inner_node::{
BinaryData,
EdgeData,
EdgePathLength,
NodeData,
PathToBottom,
};
use starknet_patricia::patricia_merkle_tree::types::SubTreeHeight;
use starknet_patricia::storage::db_object::DBObject;
use starknet_patricia::storage::errors::{DeserializationError, SerializationError};
use starknet_patricia::storage::map_storage::MapStorage;
use starknet_patricia::storage::storage_trait::{Storage, StorageKey, StorageValue};
use starknet_types_core::hash::{Pedersen, StarkHash};
use thiserror;
use tracing::{debug, error, info, warn};
Expand Down
2 changes: 1 addition & 1 deletion crates/committer_cli/src/tests/regression_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ use std::collections::HashMap;
use std::fs;

use clap::Error;
use committer::patricia_merkle_tree::external_test_utils::single_tree_flow_test;
use serde::{Deserialize, Deserializer};
use serde_json::{Map, Value};
use starknet_committer::block_committer::input::{ConfigImpl, Input, StarknetStorageValue};
use starknet_committer::hash_function::hash::TreeHashFunctionImpl;
use starknet_committer::patricia_merkle_tree::tree::OriginalSkeletonStorageTrieConfig;
use starknet_patricia::patricia_merkle_tree::external_test_utils::single_tree_flow_test;
use tempfile::NamedTempFile;

use super::utils::parse_from_python::parse_input_single_storage_tree_flow_test;
Expand Down
12 changes: 6 additions & 6 deletions crates/committer_cli/src/tests/utils/parse_from_python.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
use std::collections::HashMap;

use committer::felt::Felt;
use committer::hash::hash_trait::HashOutput;
use committer::patricia_merkle_tree::node_data::leaf::LeafModifications;
use committer::patricia_merkle_tree::types::NodeIndex;
use committer::storage::map_storage::MapStorage;
use committer::storage::storage_trait::{StorageKey, StorageValue};
use ethnum::U256;
use serde::{Deserialize, Deserializer};
use starknet_committer::block_committer::input::StarknetStorageValue;
use starknet_patricia::felt::Felt;
use starknet_patricia::hash::hash_trait::HashOutput;
use starknet_patricia::patricia_merkle_tree::node_data::leaf::LeafModifications;
use starknet_patricia::patricia_merkle_tree::types::NodeIndex;
use starknet_patricia::storage::map_storage::MapStorage;
use starknet_patricia::storage::storage_trait::{StorageKey, StorageValue};

use crate::parse_input::cast::add_unique;
use crate::parse_input::raw_input::RawStorageEntry;
Expand Down
28 changes: 14 additions & 14 deletions crates/committer_cli/src/tests/utils/random_structs.rs
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
use std::cmp::min;
use std::collections::HashMap;

use committer::felt::Felt;
use committer::hash::hash_trait::HashOutput;
use committer::patricia_merkle_tree::external_test_utils::get_random_u256;
use committer::patricia_merkle_tree::filled_tree::node::FilledNode;
use committer::patricia_merkle_tree::node_data::inner_node::{
BinaryData,
EdgeData,
EdgePath,
EdgePathLength,
NodeData,
NodeDataDiscriminants as NodeDataVariants,
PathToBottom,
};
use committer::patricia_merkle_tree::types::NodeIndex;
use ethnum::U256;
use rand::prelude::IteratorRandom;
use rand::Rng;
Expand All @@ -32,6 +18,20 @@ use starknet_committer::patricia_merkle_tree::types::{
StorageTrie,
StorageTrieMap,
};
use starknet_patricia::felt::Felt;
use starknet_patricia::hash::hash_trait::HashOutput;
use starknet_patricia::patricia_merkle_tree::external_test_utils::get_random_u256;
use starknet_patricia::patricia_merkle_tree::filled_tree::node::FilledNode;
use starknet_patricia::patricia_merkle_tree::node_data::inner_node::{
BinaryData,
EdgeData,
EdgePath,
EdgePathLength,
NodeData,
NodeDataDiscriminants as NodeDataVariants,
PathToBottom,
};
use starknet_patricia::patricia_merkle_tree::types::NodeIndex;
use strum::IntoEnumIterator;

pub trait RandomValue {
Expand Down
2 changes: 1 addition & 1 deletion crates/starknet_committer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ description = "Computes and manages Starknet state."


[dependencies]
committer = { path = "../committer", features = ["testing"] }
hex.workspace = true
pretty_assertions.workspace = true
rstest.workspace = true
serde_json.workspace = true
starknet-types-core.workspace = true
starknet_patricia = { workspace = true, features = ["testing"] }
thiserror.workspace = true
tokio.workspace = true
tracing.workspace = true
Expand Down
Loading

0 comments on commit ce118c1

Please sign in to comment.