diff --git a/.github/workflows/blockifier_ci.yml b/.github/workflows/blockifier_ci.yml index 484052db7c..557b9661c4 100644 --- a/.github/workflows/blockifier_ci.yml +++ b/.github/workflows/blockifier_ci.yml @@ -32,6 +32,11 @@ on: - 'scripts/install_build_tools.sh' - 'scripts/sequencer-ci.Dockerfile' +# On PR events, cancel existing CI runs on this same PR for this workflow. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.event.name == 'pull_request' }} + jobs: featureless-build: runs-on: starkware-ubuntu-20-04-medium diff --git a/.github/workflows/blockifier_compiled_cairo.yml b/.github/workflows/blockifier_compiled_cairo.yml index 1bcda6cc25..2623d189ab 100644 --- a/.github/workflows/blockifier_compiled_cairo.yml +++ b/.github/workflows/blockifier_compiled_cairo.yml @@ -25,6 +25,11 @@ on: - 'crates/blockifier/tests/feature_contracts_compatibility_test.rs' - 'crates/blockifier/tests/requirements.txt' +# On PR events, cancel existing CI runs on this same PR for this workflow. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.event.name == 'pull_request' }} + jobs: verify_cairo_file_dependencies: runs-on: starkware-ubuntu-20-04-medium diff --git a/.github/workflows/committer_ci.yml b/.github/workflows/committer_ci.yml index 55e2ab84bf..34691e6b98 100644 --- a/.github/workflows/committer_ci.yml +++ b/.github/workflows/committer_ci.yml @@ -30,9 +30,15 @@ on: - 'crates/starknet_committer/**' - 'crates/starknet_patricia/**' +# On PR events, cancel existing CI runs on this same PR for this workflow. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.event.name == 'pull_request' }} + jobs: run-regression-tests: runs-on: starkware-ubuntu-latest-small + if: ${{ github.event_name == 'pull_request' }} steps: - uses: actions/checkout@v4 - uses: ./.github/actions/install_rust @@ -49,6 +55,7 @@ jobs: benchmarking: runs-on: starkware-ubuntu-latest-small + if: ${{ github.event_name == 'pull_request' }} steps: # Checkout the base branch to get the old code. - uses: actions/checkout@v4 @@ -110,7 +117,6 @@ jobs: owner: context.repo.owner, repo: context.repo.repo, body: fs.readFileSync('bench_new.txt', 'utf8'), - path: 'Commits' }) gcs-push: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d35f7bc068..578cbd3933 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,6 +16,11 @@ on: - auto_merge_enabled - edited +# On PR events, cancel existing CI runs on this same PR for this workflow. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.event.name == 'pull_request' }} + jobs: commitlint: runs-on: starkware-ubuntu-latest-small @@ -90,6 +95,14 @@ jobs: version: ${{env.PROTOC_VERSION}} - run: cargo doc --workspace -r --document-private-items --no-deps + run-workspace-tests: + runs-on: starkware-ubuntu-latest-small + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/install_rust + - uses: Swatinem/rust-cache@v2 + - run: cargo test -p workspace_tests + run-tests: runs-on: starkware-ubuntu-20-04-medium steps: @@ -118,7 +131,6 @@ jobs: python3 -m venv ci ci/bin/pip install -r scripts/requirements.txt ci/bin/python scripts/run_tests.py --changes_only --commit_id ${{ github.event.pull_request.base.sha }} - ci/bin/python scripts/run_tests.py --changes_only --concurrency --commit_id ${{ github.event.pull_request.base.sha }} env: SEED: 0 @@ -129,7 +141,6 @@ jobs: python3 -m venv ci ci/bin/pip install -r scripts/requirements.txt ci/bin/python scripts/run_tests.py - ci/bin/python scripts/run_tests.py --concurrency env: SEED: 0 diff --git a/.github/workflows/merge_paths_ci.yml b/.github/workflows/merge_paths_ci.yml index 456a1bd694..ebe68a84cc 100644 --- a/.github/workflows/merge_paths_ci.yml +++ b/.github/workflows/merge_paths_ci.yml @@ -28,6 +28,11 @@ on: - 'scripts/merge_paths_test.py' - 'scripts/merge_status.py' +# On PR events, cancel existing CI runs on this same PR for this workflow. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.event.name == 'pull_request' }} + jobs: merge-paths-test: runs-on: starkware-ubuntu-latest-small diff --git a/.github/workflows/papyrus_ci.yml b/.github/workflows/papyrus_ci.yml index 5472342399..42795a14ec 100644 --- a/.github/workflows/papyrus_ci.yml +++ b/.github/workflows/papyrus_ci.yml @@ -33,6 +33,11 @@ on: merge_group: types: [checks_requested] +# On PR events, cancel existing CI runs on this same PR for this workflow. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.event.name == 'pull_request' }} + env: PROTOC_VERSION: v25.1 diff --git a/.github/workflows/papyrus_docker-publish.yml b/.github/workflows/papyrus_docker-publish.yml index 760b379ec8..7276ab779e 100644 --- a/.github/workflows/papyrus_docker-publish.yml +++ b/.github/workflows/papyrus_docker-publish.yml @@ -14,6 +14,11 @@ on: - '.github/workflows/papyrus_docker-publish.yml' - 'crates/papyrus**/**' +# On PR events, cancel existing CI runs on this same PR for this workflow. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.event.name == 'pull_request' }} + env: REGISTRY: ghcr.io REPO_NAME: ${{ github.repository }} diff --git a/Cargo.lock b/Cargo.lock index 0556840fbe..b13150c50c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -968,7 +968,7 @@ dependencies = [ [[package]] name = "blockifier" -version = "0.8.0-rc.2" +version = "0.0.0" dependencies = [ "anyhow", "ark-ec", @@ -1948,7 +1948,7 @@ dependencies = [ [[package]] name = "committer_cli" -version = "0.1.0-rc.0" +version = "0.0.0" dependencies = [ "clap", "criterion", @@ -5590,7 +5590,7 @@ dependencies = [ [[package]] name = "native_blockifier" -version = "0.8.0-rc.0" +version = "0.0.0" dependencies = [ "blockifier", "cached", @@ -6108,7 +6108,7 @@ dependencies = [ [[package]] name = "papyrus_base_layer" -version = "0.4.0-rc.0" +version = "0.0.0" dependencies = [ "async-trait", "ethers", @@ -6130,7 +6130,7 @@ dependencies = [ [[package]] name = "papyrus_block_builder" -version = "0.4.0-rc.0" +version = "0.0.0" dependencies = [ "papyrus_storage", "papyrus_test_utils", @@ -6142,7 +6142,7 @@ dependencies = [ [[package]] name = "papyrus_common" -version = "0.4.0-rc.0" +version = "0.0.0" dependencies = [ "assert_matches", "cairo-lang-starknet-classes", @@ -6163,7 +6163,7 @@ dependencies = [ [[package]] name = "papyrus_config" -version = "0.4.0-rc.0" +version = "0.0.0" dependencies = [ "assert_matches", "clap", @@ -6180,7 +6180,7 @@ dependencies = [ [[package]] name = "papyrus_consensus" -version = "0.4.0-rc.0" +version = "0.0.0" dependencies = [ "async-trait", "futures", @@ -6205,7 +6205,7 @@ dependencies = [ [[package]] name = "papyrus_execution" -version = "0.4.0-rc.0" +version = "0.0.0" dependencies = [ "anyhow", "assert_matches", @@ -6234,7 +6234,7 @@ dependencies = [ [[package]] name = "papyrus_load_test" -version = "0.4.0-rc.0" +version = "0.0.0" dependencies = [ "anyhow", "assert_matches", @@ -6251,7 +6251,7 @@ dependencies = [ [[package]] name = "papyrus_monitoring_gateway" -version = "0.4.0-rc.0" +version = "0.0.0" dependencies = [ "axum", "http-body", @@ -6275,7 +6275,7 @@ dependencies = [ [[package]] name = "papyrus_network" -version = "0.4.0-rc.0" +version = "0.0.0" dependencies = [ "assert_matches", "async-stream", @@ -6307,7 +6307,7 @@ dependencies = [ [[package]] name = "papyrus_node" -version = "0.4.0-rc.0" +version = "0.0.0" dependencies = [ "anyhow", "assert-json-diff", @@ -6349,7 +6349,7 @@ dependencies = [ [[package]] name = "papyrus_p2p_sync" -version = "0.4.0-rc.0" +version = "0.0.0" dependencies = [ "assert_matches", "async-stream", @@ -6380,7 +6380,7 @@ dependencies = [ [[package]] name = "papyrus_proc_macros" -version = "0.4.0-rc.0" +version = "0.0.0" dependencies = [ "metrics 0.21.1", "metrics-exporter-prometheus", @@ -6394,7 +6394,7 @@ dependencies = [ [[package]] name = "papyrus_protobuf" -version = "0.4.0-rc.0" +version = "0.0.0" dependencies = [ "indexmap 2.2.6", "lazy_static", @@ -6412,7 +6412,7 @@ dependencies = [ [[package]] name = "papyrus_rpc" -version = "0.4.0-rc.0" +version = "0.0.0" dependencies = [ "anyhow", "assert_matches", @@ -6465,7 +6465,7 @@ dependencies = [ [[package]] name = "papyrus_storage" -version = "0.4.0-rc.0" +version = "0.0.0" dependencies = [ "assert_matches", "byteorder", @@ -6516,7 +6516,7 @@ dependencies = [ [[package]] name = "papyrus_sync" -version = "0.4.0-rc.0" +version = "0.0.0" dependencies = [ "assert_matches", "async-stream", @@ -6551,7 +6551,7 @@ dependencies = [ [[package]] name = "papyrus_test_utils" -version = "0.4.0-rc.0" +version = "0.0.0" dependencies = [ "cairo-lang-casm", "cairo-lang-starknet-classes", @@ -8765,7 +8765,7 @@ dependencies = [ [[package]] name = "starknet_api" -version = "0.13.0-rc.1" +version = "0.0.0" dependencies = [ "assert_matches", "bitvec", @@ -8819,7 +8819,7 @@ dependencies = [ [[package]] name = "starknet_client" -version = "0.4.0-rc.0" +version = "0.0.0" dependencies = [ "assert_matches", "async-trait", @@ -8854,7 +8854,7 @@ dependencies = [ [[package]] name = "starknet_committer" -version = "0.1.0-rc.0" +version = "0.0.0" dependencies = [ "hex", "pretty_assertions", @@ -9042,7 +9042,7 @@ dependencies = [ [[package]] name = "starknet_patricia" -version = "0.1.0-rc.0" +version = "0.0.0" dependencies = [ "async-recursion", "derive_more", @@ -10471,6 +10471,14 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "workspace_tests" +version = "0.0.0" +dependencies = [ + "serde", + "toml", +] + [[package]] name = "ws_stream_wasm" version = "0.7.4" diff --git a/Cargo.toml b/Cargo.toml index a28ff9a87c..cc515cad8f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,6 +41,7 @@ members = [ "crates/starknet_sierra_compile", "crates/task_executor", "crates/tests-integration", + "workspace_tests", ] [workspace.package] @@ -68,7 +69,7 @@ base64 = "0.13.0" bincode = "1.3.3" bisection = "0.1.0" bitvec = "1.0.1" -blockifier = { path = "crates/blockifier", version = "0.8.0-rc.2" } +blockifier = { path = "crates/blockifier", version = "0.0.0" } byteorder = "1.4.3" bytes = "1" cached = "0.44.0" @@ -116,7 +117,7 @@ libp2p-swarm-test = "0.3.0" log = "0.4" lru = "0.12.0" memmap2 = "0.8.0" -mempool_test_utils = { path = "crates/mempool_test_utils", version = "0.0" } +mempool_test_utils = { path = "crates/mempool_test_utils", version = "0.0.0" } metrics = "0.21.0" metrics-exporter-prometheus = "0.12.1" mockall = "0.12.1" @@ -127,20 +128,20 @@ num-traits = "0.2.15" once_cell = "1.19.0" os_info = "3.6.0" page_size = "0.6.0" -papyrus_base_layer = { path = "crates/papyrus_base_layer", version = "0.4.0-rc.0" } -papyrus_common = { path = "crates/papyrus_common", version = "0.4.0-rc.0" } -papyrus_config = { path = "crates/papyrus_config", version = "0.4.0-rc.0" } -papyrus_consensus = { path = "crates/sequencing/papyrus_consensus", version = "0.4.0-rc.0" } -papyrus_execution = { path = "crates/papyrus_execution", version = "0.4.0-rc.0" } -papyrus_monitoring_gateway = { path = "crates/papyrus_monitoring_gateway", version = "0.4.0-rc.0" } -papyrus_network = { path = "crates/papyrus_network", version = "0.4.0-rc.0" } -papyrus_p2p_sync = { path = "crates/papyrus_p2p_sync", version = "0.4.0-rc.0" } -papyrus_proc_macros = { path = "crates/papyrus_proc_macros", version = "0.4.0-rc.0" } -papyrus_protobuf = { path = "crates/papyrus_protobuf", version = "0.4.0-rc.0" } -papyrus_rpc = { path = "crates/papyrus_rpc", version = "0.4.0-rc.0" } -papyrus_storage = { path = "crates/papyrus_storage", version = "0.4.0-rc.0" } -papyrus_sync = { path = "crates/papyrus_sync", version = "0.4.0-rc.0" } -papyrus_test_utils = { path = "crates/papyrus_test_utils", version = "0.4.0-rc.0" } +papyrus_base_layer = { path = "crates/papyrus_base_layer", version = "0.0.0" } +papyrus_common = { path = "crates/papyrus_common", version = "0.0.0" } +papyrus_config = { path = "crates/papyrus_config", version = "0.0.0" } +papyrus_consensus = { path = "crates/sequencing/papyrus_consensus", version = "0.0.0" } +papyrus_execution = { path = "crates/papyrus_execution", version = "0.0.0" } +papyrus_monitoring_gateway = { path = "crates/papyrus_monitoring_gateway", version = "0.0.0" } +papyrus_network = { path = "crates/papyrus_network", version = "0.0.0" } +papyrus_p2p_sync = { path = "crates/papyrus_p2p_sync", version = "0.0.0" } +papyrus_proc_macros = { path = "crates/papyrus_proc_macros", version = "0.0.0" } +papyrus_protobuf = { path = "crates/papyrus_protobuf", version = "0.0.0" } +papyrus_rpc = { path = "crates/papyrus_rpc", version = "0.0.0" } +papyrus_storage = { path = "crates/papyrus_storage", version = "0.0.0" } +papyrus_sync = { path = "crates/papyrus_sync", version = "0.0.0" } +papyrus_test_utils = { path = "crates/papyrus_test_utils", version = "0.0.0" } parity-scale-codec = "=3.6.9" parity-scale-codec-derive = "=3.6.9" paste = "1.0.15" @@ -172,21 +173,21 @@ simple_logger = "4.0.0" starknet-core = "0.6.0" 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.1" } -starknet_batcher = { path = "crates/batcher", version = "0.0" } -starknet_batcher_types = { path = "crates/batcher_types", version = "0.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_consensus_manager = { path = "crates/consensus_manager", version = "0.0" } -starknet_consensus_manager_types = { path = "crates/consensus_manager_types", version = "0.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" } +starknet_api = { path = "crates/starknet_api", version = "0.0.0" } +starknet_batcher = { path = "crates/batcher", version = "0.0.0" } +starknet_batcher_types = { path = "crates/batcher_types", version = "0.0.0" } +starknet_client = { path = "crates/starknet_client", version = "0.0.0" } +starknet_committer = { path = "crates/starknet_committer", version = "0.0.0" } +starknet_consensus_manager = { path = "crates/consensus_manager", version = "0.0.0" } +starknet_consensus_manager_types = { path = "crates/consensus_manager_types", version = "0.0.0" } +starknet_gateway = { path = "crates/gateway", version = "0.0.0" } +starknet_mempool = { path = "crates/mempool", version = "0.0.0" } +starknet_mempool_infra = { path = "crates/mempool_infra", version = "0.0.0" } +starknet_mempool_node = { path = "crates/mempool_node", version = "0.0.0" } +starknet_mempool_types = { path = "crates/mempool_types", version = "0.0.0" } +starknet_patricia = { path = "crates/starknet_patricia", version = "0.0.0" } +starknet_sierra_compile = { path = "crates/starknet_sierra_compile", version = "0.0.0" } +starknet_task_executor = { path = "crates/task_executor", version = "0.0.0" } static_assertions = "1.1.0" statistical = "1.0.0" strum = "0.25.0" diff --git a/crates/batcher/Cargo.toml b/crates/batcher/Cargo.toml index 34a56ef960..a735b2908d 100644 --- a/crates/batcher/Cargo.toml +++ b/crates/batcher/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "starknet_batcher" -version = "0.0.0" +version.workspace = true edition.workspace = true license.workspace = true repository.workspace = true diff --git a/crates/batcher_types/Cargo.toml b/crates/batcher_types/Cargo.toml index c79e7d06ce..11d41b57e1 100644 --- a/crates/batcher_types/Cargo.toml +++ b/crates/batcher_types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "starknet_batcher_types" -version = "0.0.0" +version.workspace = true edition.workspace = true license.workspace = true repository.workspace = true diff --git a/crates/blockifier/Cargo.toml b/crates/blockifier/Cargo.toml index ff05d295a1..46273c3d3e 100644 --- a/crates/blockifier/Cargo.toml +++ b/crates/blockifier/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "blockifier" -version = "0.8.0-rc.2" +version.workspace = true edition.workspace = true repository.workspace = true license-file.workspace = true diff --git a/crates/committer_cli/Cargo.toml b/crates/committer_cli/Cargo.toml index 721ecbd738..19ae805830 100644 --- a/crates/committer_cli/Cargo.toml +++ b/crates/committer_cli/Cargo.toml @@ -1,7 +1,7 @@ [package] # TODO(Dori, 15/8/2024): Rename to starknet_committer_cli. name = "committer_cli" -version = "0.1.0-rc.0" +version.workspace = true edition.workspace = true repository.workspace = true license-file.workspace = true diff --git a/crates/consensus_manager/Cargo.toml b/crates/consensus_manager/Cargo.toml index 8286f4cc6e..af55ff480d 100644 --- a/crates/consensus_manager/Cargo.toml +++ b/crates/consensus_manager/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "starknet_consensus_manager" -version = "0.0.0" +version.workspace = true edition.workspace = true license.workspace = true repository.workspace = true diff --git a/crates/consensus_manager_types/Cargo.toml b/crates/consensus_manager_types/Cargo.toml index 7bba772e6d..4326c0c729 100644 --- a/crates/consensus_manager_types/Cargo.toml +++ b/crates/consensus_manager_types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "starknet_consensus_manager_types" -version = "0.0.0" +version.workspace = true edition.workspace = true license.workspace = true repository.workspace = true diff --git a/crates/gateway/Cargo.toml b/crates/gateway/Cargo.toml index ac64da36e8..0d2f4cb710 100644 --- a/crates/gateway/Cargo.toml +++ b/crates/gateway/Cargo.toml @@ -3,7 +3,7 @@ edition.workspace = true license.workspace = true name = "starknet_gateway" repository.workspace = true -version = "0.0.0" +version.workspace = true [lints] workspace = true diff --git a/crates/mempool/Cargo.toml b/crates/mempool/Cargo.toml index 6a8da2fc99..5de8ce8e61 100644 --- a/crates/mempool/Cargo.toml +++ b/crates/mempool/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "starknet_mempool" -version = "0.0.0" +version.workspace = true edition.workspace = true repository.workspace = true license.workspace = true diff --git a/crates/mempool_infra/Cargo.toml b/crates/mempool_infra/Cargo.toml index 714e5b4d71..a36bde1434 100644 --- a/crates/mempool_infra/Cargo.toml +++ b/crates/mempool_infra/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "starknet_mempool_infra" -version = "0.0.0" +version.workspace = true edition.workspace = true repository.workspace = true license.workspace = true diff --git a/crates/mempool_node/Cargo.toml b/crates/mempool_node/Cargo.toml index 140a656241..9af3a71f99 100644 --- a/crates/mempool_node/Cargo.toml +++ b/crates/mempool_node/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "starknet_mempool_node" -version = "0.0.0" +version.workspace = true edition.workspace = true repository.workspace = true license.workspace = true diff --git a/crates/mempool_test_utils/Cargo.toml b/crates/mempool_test_utils/Cargo.toml index d01879b9e7..ddf17cece2 100644 --- a/crates/mempool_test_utils/Cargo.toml +++ b/crates/mempool_test_utils/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mempool_test_utils" -version = "0.0.0" +version.workspace = true edition.workspace = true repository.workspace = true license.workspace = true diff --git a/crates/mempool_types/Cargo.toml b/crates/mempool_types/Cargo.toml index 3217e1a8d5..b8d1acd490 100644 --- a/crates/mempool_types/Cargo.toml +++ b/crates/mempool_types/Cargo.toml @@ -3,7 +3,7 @@ name = "starknet_mempool_types" edition.workspace = true license.workspace = true repository.workspace = true -version = "0.0.0" +version.workspace = true [lints] workspace = true diff --git a/crates/native_blockifier/Cargo.toml b/crates/native_blockifier/Cargo.toml index 37d59a8106..488db86192 100644 --- a/crates/native_blockifier/Cargo.toml +++ b/crates/native_blockifier/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "native_blockifier" -version = "0.8.0-rc.0" +version.workspace = true edition.workspace = true repository.workspace = true license-file.workspace = true diff --git a/crates/papyrus_base_layer/Cargo.toml b/crates/papyrus_base_layer/Cargo.toml index 9a9cf8e899..3cd7a533f7 100644 --- a/crates/papyrus_base_layer/Cargo.toml +++ b/crates/papyrus_base_layer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "papyrus_base_layer" -version = "0.4.0-rc.0" +version.workspace = true edition.workspace = true repository.workspace = true license-file.workspace = true diff --git a/crates/papyrus_common/Cargo.toml b/crates/papyrus_common/Cargo.toml index db3c7015ce..b13070dafe 100644 --- a/crates/papyrus_common/Cargo.toml +++ b/crates/papyrus_common/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "papyrus_common" -version = "0.4.0-rc.0" +version.workspace = true edition.workspace = true repository.workspace = true license-file.workspace = true diff --git a/crates/papyrus_config/Cargo.toml b/crates/papyrus_config/Cargo.toml index c316fda4ae..d3fb218a10 100644 --- a/crates/papyrus_config/Cargo.toml +++ b/crates/papyrus_config/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "papyrus_config" -version = "0.4.0-rc.0" +version.workspace = true edition.workspace = true repository.workspace = true license-file.workspace = true diff --git a/crates/papyrus_execution/Cargo.toml b/crates/papyrus_execution/Cargo.toml index 1cfe387fd5..d64cb3e9c0 100644 --- a/crates/papyrus_execution/Cargo.toml +++ b/crates/papyrus_execution/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "papyrus_execution" -version = "0.4.0-rc.0" +version.workspace = true edition.workspace = true repository.workspace = true license-file.workspace = true diff --git a/crates/papyrus_load_test/Cargo.toml b/crates/papyrus_load_test/Cargo.toml index ecd8fa8aea..495f695d1c 100644 --- a/crates/papyrus_load_test/Cargo.toml +++ b/crates/papyrus_load_test/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "papyrus_load_test" -version = "0.4.0-rc.0" +version.workspace = true edition.workspace = true repository.workspace = true license-file.workspace = true diff --git a/crates/papyrus_monitoring_gateway/Cargo.toml b/crates/papyrus_monitoring_gateway/Cargo.toml index 97b36cc442..611eb96e93 100644 --- a/crates/papyrus_monitoring_gateway/Cargo.toml +++ b/crates/papyrus_monitoring_gateway/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "papyrus_monitoring_gateway" -version = "0.4.0-rc.0" +version.workspace = true edition.workspace = true repository.workspace = true license-file.workspace = true diff --git a/crates/papyrus_network/Cargo.toml b/crates/papyrus_network/Cargo.toml index 0ead1b6ffb..2ebfef86ed 100644 --- a/crates/papyrus_network/Cargo.toml +++ b/crates/papyrus_network/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "papyrus_network" -version = "0.4.0-rc.0" +version.workspace = true edition.workspace = true repository.workspace = true license-file.workspace = true diff --git a/crates/papyrus_node/Cargo.toml b/crates/papyrus_node/Cargo.toml index 5b58eb9a99..d6400191d6 100644 --- a/crates/papyrus_node/Cargo.toml +++ b/crates/papyrus_node/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "papyrus_node" -version = "0.4.0-rc.0" +version.workspace = true edition.workspace = true repository.workspace = true license-file.workspace = true diff --git a/crates/papyrus_p2p_sync/Cargo.toml b/crates/papyrus_p2p_sync/Cargo.toml index 0f5ac36b14..456bbd2108 100644 --- a/crates/papyrus_p2p_sync/Cargo.toml +++ b/crates/papyrus_p2p_sync/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "papyrus_p2p_sync" -version = "0.4.0-rc.0" +version.workspace = true edition.workspace = true repository.workspace = true license-file.workspace = true diff --git a/crates/papyrus_proc_macros/Cargo.toml b/crates/papyrus_proc_macros/Cargo.toml index 246ae21407..f6f42cc891 100644 --- a/crates/papyrus_proc_macros/Cargo.toml +++ b/crates/papyrus_proc_macros/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "papyrus_proc_macros" -version = "0.4.0-rc.0" +version.workspace = true edition.workspace = true repository.workspace = true license-file.workspace = true diff --git a/crates/papyrus_protobuf/Cargo.toml b/crates/papyrus_protobuf/Cargo.toml index 7490af9f67..dc25349a9f 100644 --- a/crates/papyrus_protobuf/Cargo.toml +++ b/crates/papyrus_protobuf/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "papyrus_protobuf" -version = "0.4.0-rc.0" +version.workspace = true edition.workspace = true repository.workspace = true license-file.workspace = true diff --git a/crates/papyrus_rpc/Cargo.toml b/crates/papyrus_rpc/Cargo.toml index 9e9c96346c..8b9a6dbd40 100644 --- a/crates/papyrus_rpc/Cargo.toml +++ b/crates/papyrus_rpc/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "papyrus_rpc" -version = "0.4.0-rc.0" +version.workspace = true edition.workspace = true repository.workspace = true license-file.workspace = true diff --git a/crates/papyrus_storage/Cargo.toml b/crates/papyrus_storage/Cargo.toml index b607bed972..b1710444a4 100644 --- a/crates/papyrus_storage/Cargo.toml +++ b/crates/papyrus_storage/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "papyrus_storage" -version = "0.4.0-rc.0" +version.workspace = true edition.workspace = true repository.workspace = true license-file.workspace = true diff --git a/crates/papyrus_sync/Cargo.toml b/crates/papyrus_sync/Cargo.toml index 2248be8b46..0237d111e4 100644 --- a/crates/papyrus_sync/Cargo.toml +++ b/crates/papyrus_sync/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "papyrus_sync" -version = "0.4.0-rc.0" +version.workspace = true edition.workspace = true repository.workspace = true license-file.workspace = true diff --git a/crates/papyrus_test_utils/Cargo.toml b/crates/papyrus_test_utils/Cargo.toml index aaeedc579e..f734d04909 100644 --- a/crates/papyrus_test_utils/Cargo.toml +++ b/crates/papyrus_test_utils/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "papyrus_test_utils" -version = "0.4.0-rc.0" +version.workspace = true edition.workspace = true repository.workspace = true license-file.workspace = true diff --git a/crates/sequencing/papyrus_block_builder/Cargo.toml b/crates/sequencing/papyrus_block_builder/Cargo.toml index 163943ec66..07eee6d113 100644 --- a/crates/sequencing/papyrus_block_builder/Cargo.toml +++ b/crates/sequencing/papyrus_block_builder/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "papyrus_block_builder" -version = "0.4.0-rc.0" +version.workspace = true edition.workspace = true repository.workspace = true license-file.workspace = true diff --git a/crates/sequencing/papyrus_consensus/Cargo.toml b/crates/sequencing/papyrus_consensus/Cargo.toml index 43c31087c9..226df68bc4 100644 --- a/crates/sequencing/papyrus_consensus/Cargo.toml +++ b/crates/sequencing/papyrus_consensus/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "papyrus_consensus" -version = "0.4.0-rc.0" +version.workspace = true edition.workspace = true repository.workspace = true license-file.workspace = true diff --git a/crates/starknet_api/Cargo.toml b/crates/starknet_api/Cargo.toml index 52597dcf4d..be278c6d39 100644 --- a/crates/starknet_api/Cargo.toml +++ b/crates/starknet_api/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "starknet_api" -version = "0.13.0-rc.1" +version.workspace = true edition.workspace = true repository.workspace = true license-file.workspace = true diff --git a/crates/starknet_client/Cargo.toml b/crates/starknet_client/Cargo.toml index e3efd96cb8..34dcf2b4a6 100644 --- a/crates/starknet_client/Cargo.toml +++ b/crates/starknet_client/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "starknet_client" -version = "0.4.0-rc.0" +version.workspace = true edition.workspace = true repository.workspace = true license-file.workspace = true diff --git a/crates/starknet_committer/Cargo.toml b/crates/starknet_committer/Cargo.toml index 8040a796c6..1546be4c6f 100644 --- a/crates/starknet_committer/Cargo.toml +++ b/crates/starknet_committer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "starknet_committer" -version = "0.1.0-rc.0" +version.workspace = true edition.workspace = true repository.workspace = true license.workspace = true diff --git a/crates/starknet_patricia/Cargo.toml b/crates/starknet_patricia/Cargo.toml index d35c118cf1..01de51a31d 100644 --- a/crates/starknet_patricia/Cargo.toml +++ b/crates/starknet_patricia/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "starknet_patricia" -version = "0.1.0-rc.0" +version.workspace = true edition.workspace = true repository.workspace = true license-file.workspace = true diff --git a/crates/starknet_sierra_compile/Cargo.toml b/crates/starknet_sierra_compile/Cargo.toml index 1bcda82fe5..5d76a24570 100644 --- a/crates/starknet_sierra_compile/Cargo.toml +++ b/crates/starknet_sierra_compile/Cargo.toml @@ -3,7 +3,7 @@ edition.workspace = true license.workspace = true name = "starknet_sierra_compile" repository.workspace = true -version = "0.0.0" +version.workspace = true [lints] workspace = true diff --git a/crates/task_executor/Cargo.toml b/crates/task_executor/Cargo.toml index 3deace0db3..f622c6f95c 100644 --- a/crates/task_executor/Cargo.toml +++ b/crates/task_executor/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "starknet_task_executor" -version = "0.0.0" +version.workspace = true edition.workspace = true repository.workspace = true license.workspace = true diff --git a/crates/tests-integration/Cargo.toml b/crates/tests-integration/Cargo.toml index 186bd4e73f..8ca1c185f9 100644 --- a/crates/tests-integration/Cargo.toml +++ b/crates/tests-integration/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "starknet_mempool_integration_tests" -version = "0.0.0" +version.workspace = true edition.workspace = true repository.workspace = true license.workspace = true diff --git a/scripts/run_tests.py b/scripts/run_tests.py index 619b6542fa..11f1d8efbd 100755 --- a/scripts/run_tests.py +++ b/scripts/run_tests.py @@ -75,7 +75,7 @@ def packages_to_test_due_to_global_changes(files: List[str]) -> Set[str]: return set() -def run_test(changes_only: bool, commit_id: Optional[str], concurrency: bool): +def run_test(changes_only: bool, commit_id: Optional[str]): local_changes = get_local_changes(".", commit_id=commit_id) modified_packages = get_modified_packages(local_changes) args = [] @@ -100,12 +100,6 @@ def run_test(changes_only: bool, commit_id: Optional[str], concurrency: bool): # args). cmd = ["cargo", "test"] + args - # TODO: Less specific handling of active feature combinations in tests (which combos should be - # tested and which shouldn't?). - # If blockifier is to be tested, add the concurrency flag if requested. - if concurrency and "blockifier" in tested_packages: - cmd.extend(["--features", "concurrency"]) - print("Running tests...") print(cmd, flush=True) subprocess.run(cmd, check=True) @@ -115,18 +109,13 @@ def run_test(changes_only: bool, commit_id: Optional[str], concurrency: bool): def parse_args() -> argparse.Namespace: parser = argparse.ArgumentParser(description="Presubmit script.") parser.add_argument("--changes_only", action="store_true") - parser.add_argument( - "--concurrency", - action="store_true", - help="If blockifier is to be tested, add the concurrency flag.", - ) parser.add_argument("--commit_id", type=str, help="GIT commit ID to compare against.") return parser.parse_args() def main(): args = parse_args() - run_test(changes_only=args.changes_only, commit_id=args.commit_id, concurrency=args.concurrency) + run_test(changes_only=args.changes_only, commit_id=args.commit_id) if __name__ == "__main__": diff --git a/workspace_tests/Cargo.toml b/workspace_tests/Cargo.toml new file mode 100644 index 0000000000..31b23ffe40 --- /dev/null +++ b/workspace_tests/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "workspace_tests" +version.workspace = true +edition.workspace = true +repository.workspace = true +license-file.workspace = true +description = "Workspace-level tests." + +[dev-dependencies] +serde = { workspace = true, features = ["derive"] } +toml.workspace = true + +[[test]] +name = "workspace_tests" +path = "main.rs" diff --git a/workspace_tests/main.rs b/workspace_tests/main.rs new file mode 100644 index 0000000000..9376af2c29 --- /dev/null +++ b/workspace_tests/main.rs @@ -0,0 +1,4 @@ +#![cfg(test)] + +pub mod toml_utils; +pub mod version_integrity_test; diff --git a/workspace_tests/toml_utils.rs b/workspace_tests/toml_utils.rs new file mode 100644 index 0000000000..396be022c7 --- /dev/null +++ b/workspace_tests/toml_utils.rs @@ -0,0 +1,61 @@ +use std::collections::HashMap; +use std::sync::LazyLock; + +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, Serialize, Deserialize)] +#[serde(untagged)] +pub(crate) enum DependencyValue { + String(String), + Object { version: String, path: Option }, +} + +#[derive(Clone, Debug, Serialize, Deserialize)] +pub(crate) struct Package { + version: String, +} + +#[derive(Clone, Debug, Serialize, Deserialize)] +pub(crate) struct WorkspaceFields { + package: Package, + members: Vec, + dependencies: HashMap, +} + +#[derive(Clone, Debug, Serialize, Deserialize)] +pub(crate) struct CargoToml { + workspace: WorkspaceFields, +} + +#[derive(Debug)] +pub(crate) struct LocalCrate { + pub(crate) path: String, + pub(crate) version: String, +} + +pub(crate) static ROOT_TOML: LazyLock = LazyLock::new(|| { + let root_toml: CargoToml = + toml::from_str(include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/../Cargo.toml"))) + .unwrap(); + root_toml +}); + +impl CargoToml { + pub(crate) fn path_dependencies(&self) -> impl Iterator + '_ { + self.workspace.dependencies.iter().filter_map(|(_name, value)| { + if let DependencyValue::Object { path: Some(path), version } = value { + Some(LocalCrate { path: path.to_string(), version: version.to_string() }) + } else { + None + } + }) + } + + pub(crate) fn members(&self) -> &Vec { + &self.workspace.members + } + + pub(crate) fn workspace_version(&self) -> &str { + &self.workspace.package.version + } +} diff --git a/workspace_tests/version_integrity_test.rs b/workspace_tests/version_integrity_test.rs new file mode 100644 index 0000000000..d3133f2589 --- /dev/null +++ b/workspace_tests/version_integrity_test.rs @@ -0,0 +1,28 @@ +use crate::toml_utils::{LocalCrate, ROOT_TOML}; + +#[test] +fn test_path_dependencies_are_members() { + let non_member_path_crates: Vec<_> = ROOT_TOML + .path_dependencies() + .filter(|LocalCrate { path, .. }| !ROOT_TOML.members().contains(path)) + .collect(); + assert!( + non_member_path_crates.is_empty(), + "The following crates are path dependencies but not members of the workspace: \ + {non_member_path_crates:?}." + ); +} + +#[test] +fn test_version_alignment() { + let workspace_version = ROOT_TOML.workspace_version(); + let crates_with_incorrect_version: Vec<_> = ROOT_TOML + .path_dependencies() + .filter(|LocalCrate { version, .. }| version != workspace_version) + .collect(); + assert!( + crates_with_incorrect_version.is_empty(), + "The following crates have versions different from the workspace version \ + '{workspace_version}': {crates_with_incorrect_version:?}." + ); +}