diff --git a/.github/workflows/blockifier_ci.yml b/.github/workflows/blockifier_ci.yml index f5a994f2fd..58048dfa09 100644 --- a/.github/workflows/blockifier_ci.yml +++ b/.github/workflows/blockifier_ci.yml @@ -9,6 +9,7 @@ on: - v[0-9].** paths: - 'crates/blockifier/**' + - 'crates/native_blockifier/.cargo/config.toml' pull_request: types: @@ -19,6 +20,7 @@ on: - edited paths: - 'crates/blockifier/**' + - 'crates/native_blockifier/.cargo/config.toml' jobs: featureless-build: @@ -40,7 +42,7 @@ jobs: - uses: Swatinem/rust-cache@v2 with: - prefix-key: "v0-rust-ubuntu-20.04" + prefix-key: "v1-rust-ubuntu-20.04" - name: Build native blockifier run: ./build_native_blockifier.sh @@ -77,12 +79,3 @@ jobs: with: path: "target/release/native_blockifier.pypy39-pp73-x86_64-linux-gnu.so" destination: "native_blockifier_artifacts/${{ env.SHORT_HASH }}/release/" - - # Keep the name 'udeps' to match original action name, so we don't need to define specific branch - # rules on Github for specific version branches. - udeps: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Run Machete (detect unused dependencies) - uses: bnjbvr/cargo-machete@main diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 74545671a9..2337750bff 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,14 +28,14 @@ jobs: run: npm install --global @commitlint/cli @commitlint/config-conventional - name: Validate PR commits with commitlint - if: github.event_name == 'pull_request' && !(contains(github.event.pull_request.title, '/merge-main') || contains(github.event.pull_request.title, '/merge main')) + if: github.event_name == 'pull_request' && !(contains(github.event.pull_request.title, 'merge-main') || contains(github.event.pull_request.title, 'merge main')) env: BASE_SHA: ${{ github.event.pull_request.base.sha }} HEAD_SHA: ${{ github.event.pull_request.head.sha }} run: commitlint --from "$BASE_SHA" --to "$HEAD_SHA" --verbose - name: Validate PR title with commitlint - if: github.event_name != 'merge_group' && github.event_name != 'push' && !(contains(github.event.pull_request.title, '/merge-main') || contains(github.event.pull_request.title, '/merge main')) + if: github.event_name != 'merge_group' && github.event_name != 'push' && !(contains(github.event.pull_request.title, 'merge-main') || contains(github.event.pull_request.title, 'merge main')) env: TITLE: ${{ github.event.pull_request.title }} run: echo "$TITLE" | commitlint --verbose @@ -133,6 +133,19 @@ jobs: env: SEED: 0 + taplo: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + - uses: baptiste0928/cargo-install@v3 + with: + crate: taplo-cli + version: '0.9.0' + locked: true + - run: scripts/taplo.sh + machete: runs-on: ubuntu-latest steps: diff --git a/Cargo.lock b/Cargo.lock index 8c4e5d9fb0..fc01f5a8c1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1997,6 +1997,7 @@ dependencies = [ "criterion 0.5.1", "derive_more", "ethnum", + "futures", "indexmap 2.2.6", "log", "pretty_assertions", @@ -2010,6 +2011,7 @@ dependencies = [ "starknet_api", "strum 0.25.0", "strum_macros 0.25.3", + "tempfile", "thiserror", "tokio", ] diff --git a/Cargo.toml b/Cargo.toml index f32e5de75d..f7badf4f4f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,39 +4,39 @@ resolver = "2" members = [ - "crates/batcher", - "crates/blockifier", - "crates/committer", - "crates/committer_cli", - "crates/gateway", - "crates/mempool", - "crates/mempool_infra", - "crates/mempool_node", - "crates/mempool_test_utils", - "crates/mempool_types", - "crates/native_blockifier", - "crates/papyrus_base_layer", - "crates/papyrus_common", - "crates/papyrus_config", - "crates/papyrus_execution", - "crates/papyrus_load_test", - "crates/papyrus_monitoring_gateway", - "crates/papyrus_network", - "crates/papyrus_node", - "crates/papyrus_p2p_sync", - "crates/papyrus_proc_macros", - "crates/papyrus_protobuf", - "crates/papyrus_rpc", - "crates/papyrus_storage", - "crates/papyrus_sync", - "crates/papyrus_test_utils", - "crates/sequencing/papyrus_block_builder", - "crates/sequencing/papyrus_consensus", - "crates/starknet_api", - "crates/starknet_client", - "crates/starknet_sierra_compile", - "crates/task_executor", - "crates/tests-integration", + "crates/batcher", + "crates/blockifier", + "crates/committer", + "crates/committer_cli", + "crates/gateway", + "crates/mempool", + "crates/mempool_infra", + "crates/mempool_node", + "crates/mempool_test_utils", + "crates/mempool_types", + "crates/native_blockifier", + "crates/papyrus_base_layer", + "crates/papyrus_common", + "crates/papyrus_config", + "crates/papyrus_execution", + "crates/papyrus_load_test", + "crates/papyrus_monitoring_gateway", + "crates/papyrus_network", + "crates/papyrus_node", + "crates/papyrus_p2p_sync", + "crates/papyrus_proc_macros", + "crates/papyrus_protobuf", + "crates/papyrus_rpc", + "crates/papyrus_storage", + "crates/papyrus_sync", + "crates/papyrus_test_utils", + "crates/sequencing/papyrus_block_builder", + "crates/sequencing/papyrus_consensus", + "crates/starknet_api", + "crates/starknet_client", + "crates/starknet_sierra_compile", + "crates/task_executor", + "crates/tests-integration", ] [workspace.package] diff --git a/commitlint.config.js b/commitlint.config.js index 4374d98d7f..7b604de97b 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -23,6 +23,7 @@ const Configuration = { 'batcher', 'block_builder', 'block_hash', + 'blockifier', 'ci', 'common', 'concurrency', diff --git a/crates/blockifier/Cargo.toml b/crates/blockifier/Cargo.toml index e01457c0a6..e351d799df 100644 --- a/crates/blockifier/Cargo.toml +++ b/crates/blockifier/Cargo.toml @@ -38,7 +38,7 @@ num-integer.workspace = true num-rational.workspace = true num-traits.workspace = true once_cell.workspace = true -papyrus_config = { path = "../papyrus_config", version = "0.4.0-rc.0"} +papyrus_config = { path = "../papyrus_config", version = "0.4.0-rc.0" } paste.workspace = true phf.workspace = true rand = { workspace = true, optional = true } diff --git a/crates/committer/src/patricia_merkle_tree/node_data/inner_node.rs b/crates/committer/src/patricia_merkle_tree/node_data/inner_node.rs index 4250b0f05e..4f2950a4f4 100644 --- a/crates/committer/src/patricia_merkle_tree/node_data/inner_node.rs +++ b/crates/committer/src/patricia_merkle_tree/node_data/inner_node.rs @@ -1,5 +1,4 @@ use ethnum::U256; -use strum_macros::{EnumDiscriminants, EnumIter}; use crate::felt::Felt; use crate::hash::hash_trait::HashOutput; @@ -12,8 +11,8 @@ use crate::patricia_merkle_tree::types::{NodeIndex, SubTreeHeight}; pub mod inner_node_test; #[derive(Clone, Debug, PartialEq, Eq)] -#[cfg_attr(any(test, feature = "testing"), derive(EnumDiscriminants))] -#[cfg_attr(any(test, feature = "testing"), strum_discriminants(derive(EnumIter)))] +#[cfg_attr(any(test, feature = "testing"), derive(strum_macros::EnumDiscriminants))] +#[cfg_attr(any(test, feature = "testing"), strum_discriminants(derive(strum_macros::EnumIter)))] // A Patricia-Merkle tree node's data, i.e., the pre-image of its hash. pub enum NodeData { Binary(BinaryData), diff --git a/crates/committer/src/patricia_merkle_tree/original_skeleton_tree/create_tree_test.rs b/crates/committer/src/patricia_merkle_tree/original_skeleton_tree/create_tree_test.rs index 4436c4bd5a..223ed32303 100644 --- a/crates/committer/src/patricia_merkle_tree/original_skeleton_tree/create_tree_test.rs +++ b/crates/committer/src/patricia_merkle_tree/original_skeleton_tree/create_tree_test.rs @@ -5,17 +5,15 @@ use pretty_assertions::assert_eq; use rstest::rstest; use super::OriginalSkeletonTreeImpl; -use crate::block_committer::input::StarknetStorageValue; use crate::felt::Felt; use crate::hash::hash_trait::HashOutput; -use crate::patricia_merkle_tree::filled_tree::node::{ClassHash, CompiledClassHash, Nonce}; use crate::patricia_merkle_tree::internal_test_utils::{ small_tree_index_to_full, MockLeaf, OriginalSkeletonMockTrieConfig, }; use crate::patricia_merkle_tree::node_data::inner_node::{EdgePath, EdgePathLength, PathToBottom}; -use crate::patricia_merkle_tree::node_data::leaf::{ContractState, LeafModifications}; +use crate::patricia_merkle_tree::node_data::leaf::LeafModifications; use crate::patricia_merkle_tree::original_skeleton_tree::create_tree::SubTree; use crate::patricia_merkle_tree::original_skeleton_tree::node::OriginalSkeletonNode; use crate::patricia_merkle_tree::original_skeleton_tree::tree::OriginalSkeletonTree; @@ -137,9 +135,9 @@ use crate::storage::storage_trait::{create_db_key, StarknetPrefix, StorageKey, S /// / \ /// 26 90 /// / / \ -/// * 25 65 +/// / 25 65 /// / \ / \ -/// 24 * 6 59 +/// 24 \ 6 59 /// / \ \ / / \ /// 11 13 20 5 19 40 /// @@ -151,9 +149,9 @@ use crate::storage::storage_trait::{create_db_key, StarknetPrefix, StorageKey, S /// / \ /// E B /// / / \ -/// * E B +/// / E B /// / \ / \ -/// 24 * E B +/// 24 \ E B /// \ / \ /// 20 5 40 #[case::tree_of_height_4_with_long_edge( @@ -295,7 +293,7 @@ fn test_create_tree( /// /// 1 /// / \ -/// * * +/// ^ / /// / \ / /// 4 5 6 /// / \ / \ / @@ -412,26 +410,6 @@ pub(crate) fn create_mock_leaf_entry(val: u128) -> (StorageKey, StorageValue) { (leaf.get_db_key(&leaf.0.to_bytes_be()), leaf.serialize()) } -pub(crate) fn create_storage_leaf_entry(val: u128) -> (StorageKey, StorageValue) { - let leaf = StarknetStorageValue(Felt::from(val)); - (leaf.get_db_key(&leaf.0.to_bytes_be()), leaf.serialize()) -} - -pub(crate) fn create_compiled_class_leaf_entry(val: u128) -> (StorageKey, StorageValue) { - let leaf = CompiledClassHash(Felt::from(val)); - (leaf.get_db_key(&leaf.0.to_bytes_be()), leaf.serialize()) -} - -pub(crate) fn create_contract_state_leaf_entry(val: u128) -> (StorageKey, StorageValue) { - let felt = Felt::from(val); - let leaf = ContractState { - nonce: Nonce(felt), - storage_root_hash: HashOutput(felt), - class_hash: ClassHash(felt), - }; - (leaf.get_db_key(&felt.to_bytes_be()), leaf.serialize()) -} - fn create_patricia_key(val: u128) -> StorageKey { create_db_key(StarknetPrefix::InnerNode.to_storage_prefix(), &U256::from(val).to_be_bytes()) } diff --git a/crates/committer/src/patricia_merkle_tree/original_skeleton_tree/skeleton_forest_test.rs b/crates/committer/src/patricia_merkle_tree/original_skeleton_tree/skeleton_forest_test.rs index c3c63ecd0f..263d6f1462 100644 --- a/crates/committer/src/patricia_merkle_tree/original_skeleton_tree/skeleton_forest_test.rs +++ b/crates/committer/src/patricia_merkle_tree/original_skeleton_tree/skeleton_forest_test.rs @@ -21,19 +21,18 @@ use crate::patricia_merkle_tree::original_skeleton_tree::create_tree::create_tre create_32_bytes_entry, create_binary_entry, create_binary_skeleton_node, - create_compiled_class_leaf_entry, - create_contract_state_leaf_entry, create_edge_entry, create_edge_skeleton_node, create_expected_skeleton_nodes, create_root_edge_entry, - create_storage_leaf_entry, create_unmodified_subtree_skeleton_node, }; use crate::patricia_merkle_tree::original_skeleton_tree::skeleton_forest::ForestSortedIndices; use crate::patricia_merkle_tree::original_skeleton_tree::tree::OriginalSkeletonTreeImpl; use crate::patricia_merkle_tree::types::{NodeIndex, SortedLeafIndices, SubTreeHeight}; +use crate::storage::db_object::DBObject; use crate::storage::map_storage::MapStorage; +use crate::storage::storage_trait::{StorageKey, StorageValue}; macro_rules! compare_skeleton_tree { ($actual_skeleton:expr, $expected_skeleton:expr, $expected_indices:expr) => {{ @@ -45,6 +44,26 @@ macro_rules! compare_skeleton_tree { }}; } +pub(crate) fn create_storage_leaf_entry(val: u128) -> (StorageKey, StorageValue) { + let leaf = StarknetStorageValue(Felt::from(val)); + (leaf.get_db_key(&leaf.0.to_bytes_be()), leaf.serialize()) +} + +pub(crate) fn create_compiled_class_leaf_entry(val: u128) -> (StorageKey, StorageValue) { + let leaf = CompiledClassHash(Felt::from(val)); + (leaf.get_db_key(&leaf.0.to_bytes_be()), leaf.serialize()) +} + +pub(crate) fn create_contract_state_leaf_entry(val: u128) -> (StorageKey, StorageValue) { + let felt = Felt::from(val); + let leaf = ContractState { + nonce: Nonce(felt), + storage_root_hash: HashOutput(felt), + class_hash: ClassHash(felt), + }; + (leaf.get_db_key(&felt.to_bytes_be()), leaf.serialize()) +} + // This test assumes for simplicity that hash is addition (i.e hash(a,b) = a + b). // I.e., the value of a binary node is the sum of its children's values, and the value of an edge // node is the sum of its path, bottom value and path length. @@ -92,7 +111,7 @@ macro_rules! compare_skeleton_tree { /// / \ / /// E E B /// / \ / \ -/// * B B E +/// / B B E /// / / \ \ /// 303 NZ 47 UB /// diff --git a/crates/committer_cli/Cargo.toml b/crates/committer_cli/Cargo.toml index 9fc69e8e0e..70dec1303e 100644 --- a/crates/committer_cli/Cargo.toml +++ b/crates/committer_cli/Cargo.toml @@ -11,10 +11,12 @@ workspace = true [dev-dependencies] criterion = { version = "0.5.1", features = ["html_reports"] } +futures.workspace = true pretty_assertions.workspace = true +tempfile.workspace = true [dependencies] -clap = { version = "4.5.4", features = ["cargo", "derive"] } +clap = { version = "4.5.4", features = ["cargo", "derive"] } committer = { path = "../committer", features = ["testing"] } derive_more.workspace = true ethnum.workspace = true @@ -27,7 +29,7 @@ serde_json = "1.0.116" serde_repr = "0.1.19" simplelog.workspace = true starknet-types-core.workspace = true -starknet_api = { path = "../starknet_api", version = "0.13.0-rc.0"} +starknet_api = { path = "../starknet_api", version = "0.13.0-rc.0" } strum.workspace = true strum_macros.workspace = true thiserror.workspace = true diff --git a/crates/committer_cli/src/tests/regression_tests.rs b/crates/committer_cli/src/tests/regression_tests.rs index 8bbf8c59ca..26b5df09ac 100644 --- a/crates/committer_cli/src/tests/regression_tests.rs +++ b/crates/committer_cli/src/tests/regression_tests.rs @@ -1,10 +1,12 @@ use std::collections::HashMap; use std::fs; +use clap::Error; use committer::block_committer::input::{ConfigImpl, Input}; use committer::patricia_merkle_tree::external_test_utils::single_tree_flow_test; use serde::{Deserialize, Deserializer}; use serde_json::{Map, Value}; +use tempfile::NamedTempFile; use super::utils::parse_from_python::parse_input_single_storage_tree_flow_test; use crate::commands::commit; @@ -123,18 +125,15 @@ pub async fn test_regression_single_tree() { assert!(execution_time.as_secs_f64() < MAX_TIME_FOR_SINGLE_TREE_BECHMARK_TEST); } -pub async fn test_single_committer_flow(input: &str, output_path: &str) { +pub async fn test_single_committer_flow(input: String, output_path: String) -> Result<(), Error> { let CommitterRegressionInput { committer_input, contract_states_root: expected_contract_states_root, contract_classes_root: expected_contract_classes_root, expected_facts, - } = serde_json::from_str(input).unwrap(); - - let start = std::time::Instant::now(); + } = serde_json::from_str(&input).unwrap(); // Benchmark the committer flow test. commit(committer_input.0, output_path.to_owned()).await; - let execution_time = std::time::Instant::now() - start; // Assert correctness of the output of the committer flow test. let CommitterRegressionOutput { @@ -151,12 +150,21 @@ pub async fn test_single_committer_flow(input: &str, output_path: &str) { assert_eq!(storage_changes, *expected_facts); // Assert the execution time does not exceed the threshold. - assert!(execution_time.as_secs_f64() < MAX_TIME_FOR_COMMITTER_FLOW_BECHMARK_TEST); + // TODO(Aner, 20/06/2024): Add cpu_time time measurement and verify the time is below the + // threshold. + Ok(()) } #[ignore = "To avoid running the regression test in Coverage or without the --release flag."] #[tokio::test(flavor = "multi_thread")] pub async fn test_regression_committer_flow() { - test_single_committer_flow(FLOW_TEST_INPUT, OUTPUT_PATH).await; + let start = std::time::Instant::now(); + let result = + test_single_committer_flow(FLOW_TEST_INPUT.to_string(), OUTPUT_PATH.to_string()).await; + if result.is_err() { + panic!("Error {}", result.err().unwrap()); + } + let execution_time = std::time::Instant::now() - start; + assert!(execution_time.as_secs_f64() < MAX_TIME_FOR_COMMITTER_FLOW_BECHMARK_TEST); } #[ignore = "To avoid running the regression test in Coverage or without the --release flag."] @@ -167,12 +175,20 @@ pub async fn test_regression_committer_all_files() { EXPECTED_NUMBER_OF_FILES ); let dir_path = fs::read_dir("./test_inputs/regression_files").unwrap(); - for file_path in dir_path { - // TODO(Aner, 23/07/24): multi-thread the test. - test_single_committer_flow( - &fs::read_to_string(file_path.unwrap().path()).unwrap(), - OUTPUT_PATH, - ) - .await; + let mut tasks = Vec::with_capacity(EXPECTED_NUMBER_OF_FILES); + for entry in dir_path { + tasks.push(tokio::task::spawn(async move { + let file_path = entry.unwrap().path(); + let output_file = NamedTempFile::new().unwrap(); + let result = test_single_committer_flow( + fs::read_to_string(file_path.clone()).unwrap(), + output_file.path().to_str().unwrap().to_string(), + ) + .await; + if result.is_err() { + panic!("Error {} for file: {:?}", result.err().unwrap(), file_path); + } + })); } + futures::future::try_join_all(tasks).await.unwrap(); } diff --git a/crates/gateway/Cargo.toml b/crates/gateway/Cargo.toml index aa89ef68d9..e0bedb6913 100644 --- a/crates/gateway/Cargo.toml +++ b/crates/gateway/Cargo.toml @@ -19,18 +19,18 @@ cairo-lang-starknet-classes.workspace = true cairo-vm.workspace = true enum-assoc.workspace = true hyper.workspace = true +mempool_test_utils = { path = "../mempool_test_utils", version = "0.0" } num-traits.workspace = true -papyrus_config = { path = "../papyrus_config", version = "0.4.0-rc.0"} -papyrus_rpc = { path = "../papyrus_rpc", version = "0.4.0-rc.0"} +papyrus_config = { path = "../papyrus_config", version = "0.4.0-rc.0" } +papyrus_rpc = { path = "../papyrus_rpc", version = "0.4.0-rc.0" } reqwest.workspace = true serde.workspace = true serde_json.workspace = true -starknet_api = { path = "../starknet_api", version = "0.13.0-rc.0"} +starknet-types-core.workspace = true +starknet_api = { path = "../starknet_api", version = "0.13.0-rc.0" } starknet_mempool_infra = { path = "../mempool_infra", version = "0.0" } starknet_mempool_types = { path = "../mempool_types", version = "0.0" } starknet_sierra_compile = { path = "../starknet_sierra_compile", version = "0.0" } -starknet-types-core.workspace = true -mempool_test_utils = { path = "../mempool_test_utils", version = "0.0"} thiserror.workspace = true tokio.workspace = true tracing.workspace = true @@ -38,8 +38,8 @@ validator.workspace = true [dev-dependencies] assert_matches.workspace = true -mockito = "1.4.0" mockall.workspace = true +mockito = "1.4.0" num-bigint.workspace = true pretty_assertions.workspace = true rstest.workspace = true diff --git a/crates/mempool/Cargo.toml b/crates/mempool/Cargo.toml index 93ae59475e..4c48c6fc11 100644 --- a/crates/mempool/Cargo.toml +++ b/crates/mempool/Cargo.toml @@ -11,8 +11,8 @@ workspace = true [dependencies] async-trait.workspace = true derive_more.workspace = true +starknet_api = { path = "../starknet_api", version = "0.13.0-rc.0" } starknet_mempool_infra = { path = "../mempool_infra", version = "0.0" } -starknet_api = { path = "../starknet_api", version = "0.13.0-rc.0"} starknet_mempool_types = { path = "../mempool_types", version = "0.0" } tokio.workspace = true diff --git a/crates/mempool_node/Cargo.toml b/crates/mempool_node/Cargo.toml index 5a0bca6baa..5f4a308204 100644 --- a/crates/mempool_node/Cargo.toml +++ b/crates/mempool_node/Cargo.toml @@ -13,7 +13,7 @@ anyhow.workspace = true clap.workspace = true const_format.workspace = true futures.workspace = true -papyrus_config = { path = "../papyrus_config", version = "0.4.0-rc.0"} +papyrus_config = { path = "../papyrus_config", version = "0.4.0-rc.0" } serde.workspace = true starknet_gateway = { path = "../gateway", version = "0.0" } starknet_mempool = { path = "../mempool", version = "0.0" } @@ -27,6 +27,6 @@ validator.workspace = true assert-json-diff.workspace = true assert_matches.workspace = true colored.workspace = true +mempool_test_utils = { path = "../mempool_test_utils" } pretty_assertions.workspace = true serde_json.workspace = true -mempool_test_utils = { path = "../mempool_test_utils" } diff --git a/crates/mempool_test_utils/Cargo.toml b/crates/mempool_test_utils/Cargo.toml index 9e6f31d4f8..5ec0f40f11 100644 --- a/crates/mempool_test_utils/Cargo.toml +++ b/crates/mempool_test_utils/Cargo.toml @@ -9,9 +9,7 @@ license.workspace = true [dependencies] assert_matches.workspace = true -blockifier = { path = "../blockifier", version = "0.8.0-rc.0", features = ["testing"]} -starknet-types-core.workspace = true -starknet_api = { path = "../starknet_api", version = "0.13.0-rc.0"} +blockifier = { path = "../blockifier", version = "0.8.0-rc.0", features = ["testing"] } serde_json.workspace = true - - +starknet-types-core.workspace = true +starknet_api = { path = "../starknet_api", version = "0.13.0-rc.0" } diff --git a/crates/mempool_types/Cargo.toml b/crates/mempool_types/Cargo.toml index e82e6dba98..6ef05d7dbb 100644 --- a/crates/mempool_types/Cargo.toml +++ b/crates/mempool_types/Cargo.toml @@ -10,8 +10,8 @@ workspace = true [dependencies] async-trait.workspace = true -starknet_api = { path = "../starknet_api", version = "0.13.0-rc.0"} mockall.workspace = true serde = { workspace = true, feat = ["derive"] } +starknet_api = { path = "../starknet_api", version = "0.13.0-rc.0" } starknet_mempool_infra = { path = "../mempool_infra" } thiserror.workspace = true diff --git a/crates/native_blockifier/.cargo/config.toml b/crates/native_blockifier/.cargo/config.toml new file mode 100644 index 0000000000..72056763ad --- /dev/null +++ b/crates/native_blockifier/.cargo/config.toml @@ -0,0 +1,18 @@ +[env] +# Enforce native_blockifier linking with pypy3.9. +PYO3_PYTHON = "/usr/local/bin/pypy3.9" +# Increase Rust stack size. +# This should be large enough for `MAX_ENTRY_POINT_RECURSION_DEPTH` recursive entry point calls. +RUST_MIN_STACK = "4194304" # 4 MiB + +[target.x86_64-apple-darwin] +rustflags = [ + "-C", "link-arg=-undefined", + "-C", "link-arg=dynamic_lookup", +] + +[target.aarch64-apple-darwin] +rustflags = [ + "-C", "link-arg=-undefined", + "-C", "link-arg=dynamic_lookup", +] diff --git a/crates/papyrus_base_layer/Cargo.toml b/crates/papyrus_base_layer/Cargo.toml index a274b7386d..adee0a6b0a 100644 --- a/crates/papyrus_base_layer/Cargo.toml +++ b/crates/papyrus_base_layer/Cargo.toml @@ -12,7 +12,7 @@ papyrus_config = { path = "../papyrus_config", version = "0.4.0-rc.0" } rustc-hex.workspace = true serde.workspace = true serde_json.workspace = true -starknet_api = { path = "../starknet_api", version = "0.13.0-rc.0"} +starknet_api = { path = "../starknet_api", version = "0.13.0-rc.0" } thiserror.workspace = true tokio = { workspace = true, features = ["full", "sync"] } url.workspace = true @@ -20,10 +20,8 @@ url.workspace = true [dev-dependencies] ethers-core = { version = "2.0.3" } pretty_assertions.workspace = true -starknet_api = { path = "../starknet_api", version = "0.13.0-rc.0", features = ["testing"] } starknet-types-core.workspace = true +starknet_api = { path = "../starknet_api", version = "0.13.0-rc.0", features = ["testing"] } tar = { version = "0.4.38" } tempfile.workspace = true -test-with = { version = "0.9.3", default-features = false, features = [ - "executable", -] } +test-with = { version = "0.9.3", default-features = false, features = ["executable"] } diff --git a/crates/papyrus_common/Cargo.toml b/crates/papyrus_common/Cargo.toml index 09510a0b2f..aca3b30686 100644 --- a/crates/papyrus_common/Cargo.toml +++ b/crates/papyrus_common/Cargo.toml @@ -9,19 +9,19 @@ description = "Common utils and objects for a Starknet node." [dependencies] cairo-lang-starknet-classes.workspace = true hex.workspace = true +indexmap.workspace = true itertools.workspace = true lazy_static.workspace = true +rand.workspace = true serde.workspace = true serde_json.workspace = true sha3.workspace = true -starknet_api = { path = "../starknet_api", version = "0.13.0-rc.0"} starknet-types-core = { workspace = true, features = ["hash"] } +starknet_api = { path = "../starknet_api", version = "0.13.0-rc.0" } thiserror.workspace = true -rand.workspace = true -indexmap.workspace = true [dev-dependencies] assert_matches.workspace = true -pretty_assertions.workspace = true -serde_json = { workspace = true, features = ["arbitrary_precision"]} papyrus_test_utils = { path = "../papyrus_test_utils" } +pretty_assertions.workspace = true +serde_json = { workspace = true, features = ["arbitrary_precision"] } diff --git a/crates/papyrus_config/Cargo.toml b/crates/papyrus_config/Cargo.toml index 4027dee8e1..ae614b1c5f 100644 --- a/crates/papyrus_config/Cargo.toml +++ b/crates/papyrus_config/Cargo.toml @@ -7,13 +7,13 @@ license-file.workspace = true description = "A library for handling node configuration." [package.metadata.cargo-udeps.ignore] -development = ["tempfile"] # Dependency of a doc-test +development = ["tempfile"] # Dependency of a doc-test [dependencies] clap = { workspace = true, features = ["env", "string"] } itertools.workspace = true serde = { workspace = true, features = ["derive"] } -serde_json = { workspace = true, features = ["arbitrary_precision"]} +serde_json = { workspace = true, features = ["arbitrary_precision"] } strum_macros.workspace = true thiserror.workspace = true validator = { workspace = true, features = ["derive"] } @@ -22,5 +22,5 @@ validator = { workspace = true, features = ["derive"] } assert_matches.workspace = true itertools.workspace = true lazy_static.workspace = true -tempfile.workspace = true papyrus_test_utils = { path = "../papyrus_test_utils" } +tempfile.workspace = true diff --git a/crates/papyrus_execution/Cargo.toml b/crates/papyrus_execution/Cargo.toml index 5aaba14ddf..0ccb4ad428 100644 --- a/crates/papyrus_execution/Cargo.toml +++ b/crates/papyrus_execution/Cargo.toml @@ -7,11 +7,11 @@ license-file.workspace = true description = "Transaction and entry point execution functionality for a Papyrus node." [features] -testing = ["rand", "rand_chacha", "papyrus_test_utils"] +testing = ["papyrus_test_utils", "rand", "rand_chacha"] [dependencies] anyhow.workspace = true -blockifier = { path = "../blockifier", version = "0.8.0-rc.0"} +blockifier = { path = "../blockifier", version = "0.8.0-rc.0" } cairo-lang-starknet-classes.workspace = true cairo-vm.workspace = true indexmap.workspace = true @@ -25,7 +25,7 @@ rand = { workspace = true, optional = true } rand_chacha = { workspace = true, optional = true } serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true, features = ["arbitrary_precision"] } -starknet_api = { path = "../starknet_api", version = "0.13.0-rc.0"} +starknet_api = { path = "../starknet_api", version = "0.13.0-rc.0" } starknet-types-core.workspace = true papyrus_test_utils = { path = "../papyrus_test_utils", optional = true } thiserror.workspace = true diff --git a/crates/papyrus_load_test/Cargo.toml b/crates/papyrus_load_test/Cargo.toml index b98e7286c1..9ac8731e57 100644 --- a/crates/papyrus_load_test/Cargo.toml +++ b/crates/papyrus_load_test/Cargo.toml @@ -13,11 +13,11 @@ anyhow.workspace = true assert_matches.workspace = true goose = "0.17.0" once_cell.workspace = true -serde = { workspace = true, features = ["derive"] } -serde_json = { workspace = true, features = ["arbitrary_precision"]} -tokio.workspace = true rand.workspace = true reqwest.workspace = true +serde = { workspace = true, features = ["derive"] } +serde_json = { workspace = true, features = ["arbitrary_precision"] } +tokio.workspace = true [dev-dependencies] lazy_static.workspace = true diff --git a/crates/papyrus_monitoring_gateway/Cargo.toml b/crates/papyrus_monitoring_gateway/Cargo.toml index 5d276b4864..75ceb6c6a9 100644 --- a/crates/papyrus_monitoring_gateway/Cargo.toml +++ b/crates/papyrus_monitoring_gateway/Cargo.toml @@ -10,8 +10,8 @@ axum.workspace = true hyper = { workspace = true, features = ["full"] } metrics-exporter-prometheus = { version = "0.12.1" } metrics-process = { version = "1.0.11" } -papyrus_storage = { path = "../papyrus_storage", version = "0.4.0-rc.0" } papyrus_config = { path = "../papyrus_config", version = "0.4.0-rc.0" } +papyrus_storage = { path = "../papyrus_storage", version = "0.4.0-rc.0" } rand.workspace = true serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true, features = ["arbitrary_precision"] } diff --git a/crates/papyrus_network/Cargo.toml b/crates/papyrus_network/Cargo.toml index 5664cfe963..b6434068f7 100644 --- a/crates/papyrus_network/Cargo.toml +++ b/crates/papyrus_network/Cargo.toml @@ -15,16 +15,16 @@ derive_more.workspace = true futures.workspace = true lazy_static.workspace = true libp2p = { workspace = true, features = [ - "gossipsub", - "identify", - "kad", - "macros", - "noise", - "quic", - "serde", - "tcp", - "tokio", - "yamux", + "gossipsub", + "identify", + "kad", + "macros", + "noise", + "quic", + "serde", + "tcp", + "tokio", + "yamux", ] } metrics.workspace = true papyrus_common = { path = "../papyrus_common", version = "0.4.0-rc.0" } diff --git a/crates/papyrus_node/Cargo.toml b/crates/papyrus_node/Cargo.toml index a83ca963c2..5d6a82e523 100644 --- a/crates/papyrus_node/Cargo.toml +++ b/crates/papyrus_node/Cargo.toml @@ -6,7 +6,7 @@ repository.workspace = true license-file.workspace = true [package.metadata.cargo-udeps.ignore] -normal = ["papyrus_base_layer", "clap", "reqwest", "tokio"] +normal = ["clap", "papyrus_base_layer", "reqwest", "tokio"] [features] default = ["rpc"] @@ -14,8 +14,8 @@ rpc = ["papyrus_rpc"] [[bin]] name = "central_source_integration_test" -required-features = ["futures-util", "tokio-stream"] path = "src/bin/central_source_integration_test.rs" +required-features = ["futures-util", "tokio-stream"] [dependencies] anyhow.workspace = true @@ -26,8 +26,8 @@ itertools.workspace = true lazy_static.workspace = true once_cell.workspace = true papyrus_base_layer = { path = "../papyrus_base_layer", version = "0.4.0-rc.0" } -papyrus_config = { path = "../papyrus_config", version = "0.4.0-rc.0" } papyrus_common = { path = "../papyrus_common", version = "0.4.0-rc.0" } +papyrus_config = { path = "../papyrus_config", version = "0.4.0-rc.0" } papyrus_consensus = { path = "../sequencing/papyrus_consensus", version = "0.4.0-rc.0" } papyrus_monitoring_gateway = { path = "../papyrus_monitoring_gateway", version = "0.4.0-rc.0" } papyrus_network = { path = "../papyrus_network", version = "0.4.0-rc.0" } @@ -36,15 +36,15 @@ papyrus_protobuf = { path = "../papyrus_protobuf", version = "0.4.0-rc.0" } papyrus_rpc = { path = "../papyrus_rpc", version = "0.4.0-rc.0", optional = true } papyrus_storage = { path = "../papyrus_storage", version = "0.4.0-rc.0" } papyrus_sync = { path = "../papyrus_sync", version = "0.4.0-rc.0" } -reqwest = { workspace = true, features = ["json", "blocking"] } +reqwest = { workspace = true, features = ["blocking", "json"] } serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true, features = ["arbitrary_precision"] } starknet_api = { path = "../starknet_api", version = "0.13.0-rc.0", features = ["testing"] } starknet_client = { path = "../starknet_client" } strum.workspace = true tokio = { workspace = true, features = ["full", "sync"] } -tracing-subscriber = { workspace = true, features = ["env-filter"] } tracing.workspace = true +tracing-subscriber = { workspace = true, features = ["env-filter"] } validator = { workspace = true, features = ["derive"] } # Binaries dependencies @@ -55,8 +55,8 @@ tokio-stream = { workspace = true, optional = true } [dev-dependencies] assert-json-diff.workspace = true colored.workspace = true +insta = { workspace = true, features = ["json"] } metrics-exporter-prometheus.workspace = true +papyrus_test_utils = { path = "../papyrus_test_utils" } pretty_assertions.workspace = true -insta = { workspace = true, features = ["json"] } tempfile.workspace = true -papyrus_test_utils = { path = "../papyrus_test_utils" } diff --git a/crates/papyrus_p2p_sync/Cargo.toml b/crates/papyrus_p2p_sync/Cargo.toml index 397f017db3..8593155d65 100644 --- a/crates/papyrus_p2p_sync/Cargo.toml +++ b/crates/papyrus_p2p_sync/Cargo.toml @@ -20,7 +20,7 @@ papyrus_proc_macros = { path = "../papyrus_proc_macros", version = "0.4.0-rc.0" papyrus_protobuf = { path = "../papyrus_protobuf", version = "0.4.0-rc.0" } papyrus_storage = { path = "../papyrus_storage", version = "0.4.0-rc.0" } serde.workspace = true -starknet_api = { path = "../starknet_api", version = "0.13.0-rc.0"} +starknet_api = { path = "../starknet_api", version = "0.13.0-rc.0" } starknet-types-core.workspace = true thiserror.workspace = true tokio.workspace = true @@ -35,7 +35,7 @@ static_assertions.workspace = true rand.workspace = true rand_chacha.workspace = true papyrus_test_utils = { path = "../papyrus_test_utils" } -papyrus_protobuf = { path = "../papyrus_protobuf", features = ["testing"]} +papyrus_protobuf = { path = "../papyrus_protobuf", features = ["testing"] } # The `metrics` crate is used by `latency_histogram` proc macro, which is used in this crate. [package.metadata.cargo-machete] diff --git a/crates/papyrus_proc_macros/Cargo.toml b/crates/papyrus_proc_macros/Cargo.toml index 5d2a030af3..6b39f41d91 100644 --- a/crates/papyrus_proc_macros/Cargo.toml +++ b/crates/papyrus_proc_macros/Cargo.toml @@ -7,15 +7,15 @@ license-file.workspace = true description = "Procedural macros for the Papyrus node" [dependencies] -syn = { version = "2.0.39", features = ["full"] } quote = "1.0.26" +syn = { version = "2.0.39", features = ["full"] } [dev-dependencies] metrics.workspace = true metrics-exporter-prometheus.workspace = true papyrus_common = { path = "../papyrus_common", version = "0.4.0-dev.1" } -prometheus-parse.workspace = true papyrus_test_utils = { path = "../papyrus_test_utils" } +prometheus-parse.workspace = true [lib] proc-macro = true diff --git a/crates/papyrus_protobuf/Cargo.toml b/crates/papyrus_protobuf/Cargo.toml index 894df504ed..703d10d11c 100644 --- a/crates/papyrus_protobuf/Cargo.toml +++ b/crates/papyrus_protobuf/Cargo.toml @@ -6,7 +6,7 @@ repository.workspace = true license-file.workspace = true [features] -testing = ["rand", "rand_chacha", "papyrus_test_utils"] +testing = ["papyrus_test_utils", "rand", "rand_chacha"] [dependencies] indexmap.workspace = true @@ -15,7 +15,7 @@ primitive-types.workspace = true prost.workspace = true rand = { workspace = true, optional = true } rand_chacha = { workspace = true, optional = true } -starknet_api = { path = "../starknet_api", version = "0.13.0-rc.0"} +starknet_api = { path = "../starknet_api", version = "0.13.0-rc.0" } starknet-types-core.workspace = true papyrus_test_utils = { path = "../papyrus_test_utils", optional = true } thiserror.workspace = true diff --git a/crates/papyrus_rpc/Cargo.toml b/crates/papyrus_rpc/Cargo.toml index 49cae5f47c..d96ba0e446 100644 --- a/crates/papyrus_rpc/Cargo.toml +++ b/crates/papyrus_rpc/Cargo.toml @@ -23,12 +23,12 @@ papyrus_config = { path = "../papyrus_config", version = "0.4.0-rc.0" } papyrus_execution = { path = "../papyrus_execution", version = "0.4.0-rc.0" } papyrus_proc_macros = { path = "../papyrus_proc_macros", version = "0.4.0-rc.0" } papyrus_storage = { path = "../papyrus_storage", version = "0.4.0-rc.0" } -starknet_client = { path = "../starknet_client", version = "0.4.0-rc.0" } regex = { workspace = true } serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true, features = ["arbitrary_precision"] } -starknet_api = { path = "../starknet_api", version = "0.13.0-rc.0"} starknet-types-core.workspace = true +starknet_api = { path = "../starknet_api", version = "0.13.0-rc.0" } +starknet_client = { path = "../starknet_client", version = "0.4.0-rc.0" } tokio = { workspace = true, features = ["full", "sync"] } tower = { workspace = true, features = ["full"] } tracing.workspace = true @@ -41,6 +41,7 @@ cairo-lang-starknet-classes.workspace = true camelpaste.workspace = true derive_more.workspace = true enum-iterator.workspace = true +indexmap = { workspace = true, features = ["serde"] } insta = { workspace = true, features = ["json"] } itertools.workspace = true jsonschema.workspace = true @@ -49,15 +50,14 @@ metrics-exporter-prometheus.workspace = true mockall.workspace = true papyrus_execution = { path = "../papyrus_execution", features = ["testing"] } papyrus_storage = { path = "../papyrus_storage", features = ["testing"] } +papyrus_test_utils = { path = "../papyrus_test_utils" } pretty_assertions.workspace = true prometheus-parse.workspace = true +rand.workspace = true rand_chacha.workspace = true reqwest.workspace = true -papyrus_test_utils = { path = "../papyrus_test_utils" } +starknet-core.workspace = true starknet_api = { path = "../starknet_api", version = "0.13.0-rc.0", features = ["testing"] } starknet_client = { path = "../starknet_client", features = ["testing"] } -starknet-core.workspace = true strum.workspace = true strum_macros.workspace = true -indexmap = { workspace = true, features = ["serde"] } -rand.workspace = true diff --git a/crates/papyrus_storage/Cargo.toml b/crates/papyrus_storage/Cargo.toml index 37b46ae80c..02caac570f 100644 --- a/crates/papyrus_storage/Cargo.toml +++ b/crates/papyrus_storage/Cargo.toml @@ -7,23 +7,23 @@ license-file.workspace = true description = "A storage implementation for a Starknet node." [features] -testing = ["tempfile"] document_calls = ["lazy_static"] +testing = ["tempfile"] [[bin]] name = "dump_declared_classes" -required-features = ["clap"] path = "src/bin/dump_declared_classes.rs" +required-features = ["clap"] [[bin]] name = "storage_benchmark" -required-features = ["clap", "statistical"] path = "src/bin/storage_benchmark.rs" +required-features = ["clap", "statistical"] [dependencies] byteorder.workspace = true -cairo-lang-starknet-classes.workspace = true cairo-lang-casm = { workspace = true, features = ["parity-scale-codec"] } +cairo-lang-starknet-classes.workspace = true cairo-lang-utils.workspace = true human_bytes.workspace = true indexmap = { workspace = true, features = ["serde"] } @@ -41,8 +41,8 @@ parity-scale-codec.workspace = true primitive-types.workspace = true serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true, features = ["arbitrary_precision"] } -starknet_api = { path = "../starknet_api", version = "0.13.0-rc.0"} starknet-types-core = { workspace = true, features = ["papyrus-serialization"] } +starknet_api = { path = "../starknet_api", version = "0.13.0-rc.0" } tempfile = { workspace = true, optional = true } thiserror.workspace = true tracing = { workspace = true, features = ["log"] } @@ -56,14 +56,12 @@ statistical = { workspace = true, optional = true } [dev-dependencies] assert_matches.workspace = true -cairo-lang-casm = { workspace = true, features = [ - "parity-scale-codec", - "schemars", -] } +cairo-lang-casm = { workspace = true, features = ["parity-scale-codec", "schemars"] } camelpaste.workspace = true insta = { workspace = true, features = ["yaml"] } metrics-exporter-prometheus.workspace = true num-traits.workspace = true +papyrus_test_utils = { path = "../papyrus_test_utils" } paste.workspace = true pretty_assertions.workspace = true prometheus-parse.workspace = true @@ -74,5 +72,4 @@ simple_logger.workspace = true tempfile = { workspace = true } test-case.workspace = true test-log.workspace = true -papyrus_test_utils = { path = "../papyrus_test_utils" } tokio = { workspace = true, features = ["full", "sync"] } diff --git a/crates/papyrus_sync/Cargo.toml b/crates/papyrus_sync/Cargo.toml index 66011e9ca8..81fbc54a1f 100644 --- a/crates/papyrus_sync/Cargo.toml +++ b/crates/papyrus_sync/Cargo.toml @@ -10,33 +10,33 @@ async-stream.workspace = true async-trait.workspace = true cairo-lang-starknet-classes.workspace = true chrono.workspace = true -futures-util.workspace = true futures.workspace = true +futures-util.workspace = true indexmap = { workspace = true, features = ["serde"] } itertools.workspace = true lru.workspace = true metrics.workspace = true -papyrus_storage = { path = "../papyrus_storage", version = "0.4.0-rc.0" } papyrus_base_layer = { path = "../papyrus_base_layer", version = "0.4.0-rc.0" } papyrus_common = { path = "../papyrus_common", version = "0.4.0-rc.0" } papyrus_config = { path = "../papyrus_config", version = "0.4.0-rc.0" } papyrus_proc_macros = { path = "../papyrus_proc_macros", version = "0.4.0-rc.0" } -reqwest = { workspace = true, features = ["json", "blocking"] } +papyrus_storage = { path = "../papyrus_storage", version = "0.4.0-rc.0" } +reqwest = { workspace = true, features = ["blocking", "json"] } serde = { workspace = true, features = ["derive"] } -starknet_api = { path = "../starknet_api", version = "0.13.0-rc.0"} -starknet_client = { path = "../starknet_client" } starknet-types-core.workspace = true +starknet_api = { path = "../starknet_api", version = "0.13.0-rc.0" } +starknet_client = { path = "../starknet_client" } thiserror.workspace = true tokio = { workspace = true, features = ["full", "sync"] } tracing.workspace = true [dev-dependencies] -simple_logger.workspace = true assert_matches.workspace = true mockall.workspace = true papyrus_storage = { path = "../papyrus_storage", features = ["testing"] } +papyrus_test_utils = { path = "../papyrus_test_utils" } pretty_assertions.workspace = true -starknet_client = { path = "../starknet_client", features = ["testing"] } +simple_logger.workspace = true starknet_api = { path = "../starknet_api", version = "0.13.0-rc.0", features = ["testing"] } -papyrus_test_utils = { path = "../papyrus_test_utils" } +starknet_client = { path = "../starknet_client", features = ["testing"] } tokio-stream.workspace = true diff --git a/crates/papyrus_test_utils/Cargo.toml b/crates/papyrus_test_utils/Cargo.toml index b66e0ee246..2f59bd7be8 100644 --- a/crates/papyrus_test_utils/Cargo.toml +++ b/crates/papyrus_test_utils/Cargo.toml @@ -8,20 +8,20 @@ license-file.workspace = true [features] [dependencies] -cairo-lang-starknet-classes.workspace = true cairo-lang-casm.workspace = true +cairo-lang-starknet-classes.workspace = true cairo-lang-utils.workspace = true indexmap = { workspace = true, features = ["serde"] } +num-bigint.workspace = true primitive-types = { workspace = true, features = ["serde"] } prometheus-parse.workspace = true -num-bigint.workspace = true rand.workspace = true rand_chacha.workspace = true reqwest = { workspace = true, features = ["json"] } serde = { workspace = true, features = ["derive"] } -serde_json = { workspace = true, features = ["arbitrary_precision"]} -starknet_api = { path = "../starknet_api", version = "0.13.0-rc.0", features = ["testing"] } +serde_json = { workspace = true, features = ["arbitrary_precision"] } starknet-types-core = { workspace = true, features = ["hash"] } +starknet_api = { path = "../starknet_api", version = "0.13.0-rc.0", features = ["testing"] } [dev-dependencies] pretty_assertions.workspace = true diff --git a/crates/sequencing/papyrus_block_builder/Cargo.toml b/crates/sequencing/papyrus_block_builder/Cargo.toml index bd32c581f7..a38a5ba911 100644 --- a/crates/sequencing/papyrus_block_builder/Cargo.toml +++ b/crates/sequencing/papyrus_block_builder/Cargo.toml @@ -8,10 +8,10 @@ description = "A block-builder for Starknet blocks" [dependencies] papyrus_storage = { path = "../../papyrus_storage", version = "0.4.0-rc.0", features = ["testing"] } -starknet_api = { path = "../../starknet_api", version = "0.13.0-rc.0"} +starknet_api = { path = "../../starknet_api", version = "0.13.0-rc.0" } thiserror.workspace = true tracing.workspace = true [dev-dependencies] -pretty_assertions.workspace = true papyrus_test_utils = { path = "../../papyrus_test_utils" } +pretty_assertions.workspace = true diff --git a/crates/sequencing/papyrus_consensus/Cargo.toml b/crates/sequencing/papyrus_consensus/Cargo.toml index dce19350d4..c85e340238 100644 --- a/crates/sequencing/papyrus_consensus/Cargo.toml +++ b/crates/sequencing/papyrus_consensus/Cargo.toml @@ -12,20 +12,22 @@ futures.workspace = true lazy_static.workspace = true metrics.workspace = true papyrus_common = { path = "../../papyrus_common", version = "0.4.0-dev.2" } -papyrus_network = { path = "../../papyrus_network", version = "0.4.0-dev.2" } papyrus_config = { path = "../../papyrus_config", version = "0.4.0-dev.2" } +papyrus_network = { path = "../../papyrus_network", version = "0.4.0-dev.2" } papyrus_protobuf = { path = "../../papyrus_protobuf", version = "0.4.0-dev.2" } papyrus_storage = { path = "../../papyrus_storage", version = "0.4.0-dev.2" } serde = { workspace = true, features = ["derive"] } -starknet_api = { path = "../../starknet_api", version = "0.13.0-rc.0"} starknet-types-core.workspace = true +starknet_api = { path = "../../starknet_api", version = "0.13.0-rc.0" } thiserror.workspace = true tokio = { workspace = true, features = ["full"] } tracing.workspace = true [dev-dependencies] mockall.workspace = true -papyrus_network = { path = "../../papyrus_network", version = "0.4.0-dev.2", features = ["testing"] } +papyrus_network = { path = "../../papyrus_network", version = "0.4.0-dev.2", features = [ + "testing", +] } papyrus_storage = { path = "../../papyrus_storage", features = ["testing"] } papyrus_test_utils = { path = "../../papyrus_test_utils" } test-case.workspace = true diff --git a/crates/starknet_api/Cargo.toml b/crates/starknet_api/Cargo.toml index bda96cb576..cc7a44a7f3 100644 --- a/crates/starknet_api/Cargo.toml +++ b/crates/starknet_api/Cargo.toml @@ -30,4 +30,3 @@ thiserror = "1.0.31" [dev-dependencies] assert_matches = "1.5.0" rstest = "0.17.0" - diff --git a/crates/starknet_client/Cargo.toml b/crates/starknet_client/Cargo.toml index 6bfc284bd8..0454e7eb3b 100644 --- a/crates/starknet_client/Cargo.toml +++ b/crates/starknet_client/Cargo.toml @@ -7,7 +7,7 @@ license-file.workspace = true description = "A client implementation that can communicate with Starknet." [features] -testing = ["enum-iterator", "mockall", "rand", "rand_chacha", "papyrus_test_utils"] +testing = ["enum-iterator", "mockall", "papyrus_test_utils", "rand", "rand_chacha"] [dependencies] async-trait.workspace = true @@ -21,12 +21,12 @@ papyrus_common = { path = "../papyrus_common", version = "0.4.0-rc.0" } papyrus_config = { path = "../papyrus_config", version = "0.4.0-rc.0" } rand = { workspace = true, optional = true } rand_chacha = { workspace = true, optional = true } -reqwest = { workspace = true, features = ["json", "blocking"] } +reqwest = { workspace = true, features = ["blocking", "json"] } serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true, features = ["arbitrary_precision"] } serde_repr.workspace = true -starknet_api = { path = "../starknet_api", version = "0.13.0-rc.0"} -starknet-types-core = {workspace = true, features = ["serde"]} +starknet_api = { path = "../starknet_api", version = "0.13.0-rc.0" } +starknet-types-core = { workspace = true, features = ["serde"] } strum.workspace = true strum_macros.workspace = true papyrus_test_utils = { path = "../papyrus_test_utils", optional = true } diff --git a/crates/starknet_sierra_compile/Cargo.toml b/crates/starknet_sierra_compile/Cargo.toml index 7addf9cee2..641eadbb4a 100644 --- a/crates/starknet_sierra_compile/Cargo.toml +++ b/crates/starknet_sierra_compile/Cargo.toml @@ -12,12 +12,12 @@ workspace = true cairo-lang-sierra.workspace = true cairo-lang-starknet-classes.workspace = true cairo-lang-utils.workspace = true -serde_json.workspace = true serde.workspace = true -starknet_api = { path = "../starknet_api", version = "0.13.0-rc.0"} +serde_json.workspace = true starknet-types-core.workspace = true +starknet_api = { path = "../starknet_api", version = "0.13.0-rc.0" } thiserror.workspace = true [dev-dependencies] assert_matches.workspace = true -mempool_test_utils = {path = "../mempool_test_utils"} +mempool_test_utils = { path = "../mempool_test_utils" } diff --git a/crates/tests-integration/Cargo.toml b/crates/tests-integration/Cargo.toml index 0ae365efc4..8bfc220c85 100644 --- a/crates/tests-integration/Cargo.toml +++ b/crates/tests-integration/Cargo.toml @@ -10,19 +10,19 @@ workspace = true [dependencies] axum.workspace = true -blockifier = { path = "../blockifier", version = "0.8.0-rc.0"} +blockifier = { path = "../blockifier", version = "0.8.0-rc.0" } cairo-lang-starknet-classes.workspace = true indexmap.workspace = true -papyrus_common = { path = "../papyrus_common", version = "0.4.0-rc.0"} -papyrus_rpc = { path = "../papyrus_rpc", version = "0.4.0-rc.0"} -papyrus_storage = { path = "../papyrus_storage", version = "0.4.0-rc.0"} -mempool_test_utils = { path = "../mempool_test_utils", version = "0.0" } itertools.workspace = true +mempool_test_utils = { path = "../mempool_test_utils", version = "0.0" } +papyrus_common = { path = "../papyrus_common", version = "0.4.0-rc.0" } +papyrus_rpc = { path = "../papyrus_rpc", version = "0.4.0-rc.0" } +papyrus_storage = { path = "../papyrus_storage", version = "0.4.0-rc.0" } reqwest.workspace = true serde_json.workspace = true -starknet_api = { path = "../starknet_api", version = "0.13.0-rc.0"} -starknet_client = { path = "../starknet_client", version = "0.4.0-rc.0"} starknet-types-core.workspace = true +starknet_api = { path = "../starknet_api", version = "0.13.0-rc.0" } +starknet_client = { path = "../starknet_client", version = "0.4.0-rc.0" } starknet_gateway = { path = "../gateway", version = "0.0", features = ["testing"] } starknet_mempool_infra = { path = "../mempool_infra", version = "0.0" } starknet_mempool_node = { path = "../mempool_node", version = "0.0" } diff --git a/rustfmt.toml b/rustfmt.toml index 1cb6623287..3820d621dd 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -1,23 +1,23 @@ edition = "2021" +max_width = 100 newline_style = "Unix" use_field_init_shorthand = true use_small_heuristics = "Max" use_try_shorthand = true -max_width = 100 # Unstable features below -unstable_features = true -version = "Two" comment_width = 100 format_code_in_doc_comments = true format_macro_bodies = true format_macro_matchers = true format_strings = true +group_imports = "StdExternalCrate" imports_granularity = "Module" imports_layout = "HorizontalVertical" -group_imports = "StdExternalCrate" normalize_comments = true normalize_doc_attributes = true +unstable_features = true +version = "Two" wrap_comments = true # To use these settings in vscode, add the following line to your settings: diff --git a/scripts/merge_branches.py b/scripts/merge_branches.py index 21d9743af5..6ae3c49338 100755 --- a/scripts/merge_branches.py +++ b/scripts/merge_branches.py @@ -11,6 +11,7 @@ import json import os import subprocess +import time from typing import Dict, List, Optional FINAL_BRANCH = "main" @@ -81,7 +82,7 @@ def merge_branches(src_branch: str, dst_branch: Optional[str]): user = os.environ["USER"] dst_branch = get_dst_branch(src_branch=src_branch, dst_branch_override=dst_branch) - merge_branch = f"{user}/merge-{src_branch}-into-{dst_branch}" + merge_branch = f"{user}/merge-{src_branch}-into-{dst_branch}-{int(time.time())}" print(f"Source branch: {src_branch}") print(f"Destination branch: {dst_branch}\n") diff --git a/scripts/merge_status.py b/scripts/merge_status.py index eccc251972..2a1dfc35f5 100755 --- a/scripts/merge_status.py +++ b/scripts/merge_status.py @@ -47,11 +47,11 @@ def print_merge_status(): ) if len(unmerged_commits_timestamps) == 0: - status = color_txt(BashColor.green, "Up to date") + status = color_txt(BashColor.green, "Up to date.") else: last_unmerged_commit_time = datetime.fromtimestamp(min(unmerged_commits_timestamps)) unmerged_days = (datetime.now() - last_unmerged_commit_time).days - status = f"{unmerged_days} days" + status = f"{unmerged_days} days, {len(unmerged_commits_timestamps)} unmerged commits." if unmerged_days > 7: status = color_txt(BashColor.red, status) diff --git a/taplo.toml b/taplo.toml index a64174e938..9b57998302 100644 --- a/taplo.toml +++ b/taplo.toml @@ -1,3 +1,5 @@ +exclude = ["crates/native_blockifier/.cargo/config.toml"] + [formatting] column_width = 100 reorder_arrays = true