From 5d789a3944f1e721fb012b7248d87b67cbcbbeb1 Mon Sep 17 00:00:00 2001 From: dan-starkware <56217775+dan-starkware@users.noreply.github.com> Date: Thu, 25 Jul 2024 12:24:54 +0300 Subject: [PATCH 1/8] ci: remove code owner (#66) --- .github/CODEOWNERS | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS deleted file mode 100644 index 9304789c01..0000000000 --- a/.github/CODEOWNERS +++ /dev/null @@ -1 +0,0 @@ -.github/ @dan-starkware From 48672340a0f63fd072fd3049b16600fd17addc51 Mon Sep 17 00:00:00 2001 From: dan-starkware <56217775+dan-starkware@users.noreply.github.com> Date: Thu, 25 Jul 2024 12:25:02 +0300 Subject: [PATCH 2/8] ci: sort and remove duplicates commitlint scopes (#65) * ci: sort commitlint scopes * ci: remove duplicates commitlint scopes --- commitlint.config.js | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/commitlint.config.js b/commitlint.config.js index 6766638422..adb289042b 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -21,37 +21,34 @@ const Configuration = { 'scope-enum': [2, 'always', [ 'base_layer', 'block_builder', + 'block_hash', 'ci', 'common', + 'concurrency', 'config', 'consensus', 'execution', + 'fee', + 'gateway', 'helm', 'JSON-RPC', 'load_test', + 'mempool_node', + 'mempool', 'monitoring', + 'native_blockifier', 'network', 'node', 'protobuf', 'release', + 'skeleton', 'starknet_client', + 'state', 'storage', 'sync', 'test_utils', - 'ci', - 'gateway', - 'mempool', - 'mempool_node', 'tests-integration', - 'concurrency', - 'execution', - 'fee', - 'native_blockifier', - 'state', 'transaction', - 'block_hash', - 'ci', - 'skeleton', 'types', ]], }, From 57a5f4290acacc7cab56b029302e294b0aebcce7 Mon Sep 17 00:00:00 2001 From: dorimedini-starkware Date: Thu, 25 Jul 2024 13:08:25 +0300 Subject: [PATCH 3/8] chore: fix committer_ci benchmarking phase (#51) Signed-off-by: Dori Medini --- .github/workflows/committer_ci.yml | 8 ++++---- .../committer_cli/benches/bench_split_and_prepare_post.sh | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/committer_ci.yml b/.github/workflows/committer_ci.yml index 35511cb264..8f1a796b4a 100644 --- a/.github/workflows/committer_ci.yml +++ b/.github/workflows/committer_ci.yml @@ -37,7 +37,7 @@ jobs: - uses: 'google-github-actions/setup-gcloud@v2' - run: echo "BENCH_INPUT_FILES_PREFIX=$(cat ./crates/committer_cli/src/tests/flow_test_files_prefix)" >> $GITHUB_ENV - run: gcloud storage cp -r gs://committer-testing-artifacts/$BENCH_INPUT_FILES_PREFIX/* ./crates/committer_cli/benches - - run: cargo test --release -- --include-ignored test_regression + - run: cargo test -p committer_cli --release -- --include-ignored test_regression benchmarking: runs-on: ubuntu-latest @@ -59,10 +59,10 @@ jobs: # List the existing benchmarks. - run: | - cargo bench -- --list | grep ': benchmark$' | sed -e "s/: benchmark$//" > benchmarks_list.txt + cargo bench -p committer_cli -- --list | grep ': benchmark$' | sed -e "s/: benchmark$//" > benchmarks_list.txt # Benchmark the old code. - - run: cargo bench + - run: cargo bench -p committer_cli # Backup the downloaded files to avoid re-downloading them if they didn't change (overwritten by checkout). - run: mv ./crates/committer_cli/benches/tree_flow_inputs.json ./crates/committer_cli/benches/tree_flow_inputs.json_bu @@ -139,4 +139,4 @@ jobs: uses: "google-github-actions/upload-cloud-storage@v2" with: path: "CLI_TARGET/release/committer_cli" - destination: "committer-products-external/${{ env.SHORT_HASH }}/release/" \ No newline at end of file + destination: "committer-products-external/${{ env.SHORT_HASH }}/release/" diff --git a/crates/committer_cli/benches/bench_split_and_prepare_post.sh b/crates/committer_cli/benches/bench_split_and_prepare_post.sh index 5ff1faedfc..2bc4e33453 100644 --- a/crates/committer_cli/benches/bench_split_and_prepare_post.sh +++ b/crates/committer_cli/benches/bench_split_and_prepare_post.sh @@ -8,7 +8,7 @@ benchmark_results=${2} # TODO: split the output file instead. cat ${benchmarks_list} | while read line; do - cargo bench $line > ${line}.txt; + cargo bench -p committer_cli $line > ${line}.txt; sed -i '/'"${line}"'/,$!d' ${line}.txt; done From 0a1fc761f8562b8ff2d9b23d1e4a9b86587e84f8 Mon Sep 17 00:00:00 2001 From: dorimedini-starkware Date: Thu, 25 Jul 2024 15:23:57 +0300 Subject: [PATCH 4/8] chore: extract merge paths test to separate job (#78) Signed-off-by: Dori Medini --- .github/workflows/blockifier_ci.yml | 12 -------- .github/workflows/merge_paths_ci.yml | 41 ++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/merge_paths_ci.yml diff --git a/.github/workflows/blockifier_ci.yml b/.github/workflows/blockifier_ci.yml index f10d3c0487..f5a994f2fd 100644 --- a/.github/workflows/blockifier_ci.yml +++ b/.github/workflows/blockifier_ci.yml @@ -32,18 +32,6 @@ jobs: - run: cargo build -p blockifier - run: cargo test -p blockifier - run-python-tests: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: '3.9' - - run: | - python -m pip install --upgrade pip - pip install pytest - - run: pytest scripts/merge_paths_test.py - native-blockifier-artifacts-push: runs-on: ubuntu-20.04 steps: diff --git a/.github/workflows/merge_paths_ci.yml b/.github/workflows/merge_paths_ci.yml new file mode 100644 index 0000000000..8db9363de8 --- /dev/null +++ b/.github/workflows/merge_paths_ci.yml @@ -0,0 +1,41 @@ +name: Merge-paths test + +on: + push: + branches: + - main + - main-v[0-9].** + tags: + - v[0-9].** + paths: + - '.github/workflows/merge_paths_ci.yml' + - 'scripts/merge_branches.json' + - 'scripts/merge_paths.json' + - 'scripts/merge_paths_test.py' + - 'scripts/merge_status.py' + + pull_request: + types: + - opened + - reopened + - synchronize + - auto_merge_enabled + - edited + paths: + - '.github/workflows/merge_paths_ci.yml' + - 'scripts/merge_branches.json' + - 'scripts/merge_paths.json' + - 'scripts/merge_paths_test.py' + - 'scripts/merge_status.py' + + merge-paths-test: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.9' + - run: | + python -m pip install --upgrade pip + pip install pytest + - run: pytest scripts/merge_paths_test.py From 82c148ca44cfb274adb619f75e56a085c0bf0f63 Mon Sep 17 00:00:00 2001 From: dorimedini-starkware Date: Thu, 25 Jul 2024 15:24:12 +0300 Subject: [PATCH 5/8] chore: fix committer CI triggers (#73) Signed-off-by: Dori Medini --- .github/workflows/committer_ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/committer_ci.yml b/.github/workflows/committer_ci.yml index 8f1a796b4a..7d40303f82 100644 --- a/.github/workflows/committer_ci.yml +++ b/.github/workflows/committer_ci.yml @@ -8,6 +8,9 @@ on: tags: - v[0-9].** paths: + - '.github/workflows/committer_ci.yml' + - 'Cargo.toml' + - 'Cargo.lock' - 'crates/committer/**' - 'crates/committer_cli/**' @@ -19,6 +22,9 @@ on: - auto_merge_enabled - edited paths: + - '.github/workflows/committer_ci.yml' + - 'Cargo.toml' + - 'Cargo.lock' - 'crates/committer/**' - 'crates/committer_cli/**' From 65cc64b904946c92053ff5b01aab9189bf044458 Mon Sep 17 00:00:00 2001 From: dan-starkware <56217775+dan-starkware@users.noreply.github.com> Date: Thu, 25 Jul 2024 16:12:20 +0300 Subject: [PATCH 6/8] chore: remove PR template (#103) --- .github/PULL_REQUEST_TEMPLATE.md | 34 -------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index f4b08c2eaf..0000000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,34 +0,0 @@ -## Pull Request type - -Please check the type of change your PR introduces: - -- [ ] Bugfix -- [ ] Feature -- [ ] Code style update (formatting, renaming) -- [ ] Refactoring (no functional changes, no API changes) -- [ ] Build-related changes -- [ ] Documentation content changes -- [ ] Other (please describe): - -## What is the current behavior? - - - -Issue Number: N/A - -## What is the new behavior? - - - -- - -## Does this introduce a breaking change? - -- [ ] Yes -- [ ] No - - - -## Other information - - From a9dc431be4445b8963c5d46f81023aaaa2b662bd Mon Sep 17 00:00:00 2001 From: dorimedini-starkware Date: Thu, 25 Jul 2024 17:14:13 +0300 Subject: [PATCH 7/8] fix: clippy fixes for rust 1.80 (#109) Signed-off-by: Dori Medini --- Cargo.toml | 11 +++++++++-- crates/blockifier/src/lib.rs | 7 +------ .../updated_skeleton_tree/create_tree_helper.rs | 1 + .../src/component_client/local_component_client.rs | 2 +- crates/native_blockifier/src/lib.rs | 7 +------ 5 files changed, 13 insertions(+), 15 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8d1665c784..1e3a2cea2b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -53,8 +53,8 @@ ark-ec = "0.4.2" ark-ff = "0.4.0-alpha.7" ark-secp256k1 = "0.4.0" ark-secp256r1 = "0.4.0" -assert_matches = "1.5.0" assert-json-diff = "2.0.2" +assert_matches = "1.5.0" async-recursion = "1.1.0" async-stream = "0.3.3" async-trait = "0.1.79" @@ -176,7 +176,14 @@ zstd = "0.13.1" future-incompatible = "deny" nonstandard-style = "deny" rust-2018-idioms = "deny" -unused = "deny" +# See [here](https://github.com/taiki-e/cargo-llvm-cov/issues/370) for a discussion on why this is +# needed (from rust 1.80). +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage_nightly)'] } +# Need a priority of `-1` so it is before the `warnings` lint. See +# [here](https://github.com/rust-lang/cargo/issues/12918) for details on the issue, and +# [here](https://rust-lang.github.io/rust-clippy/master/index.html#/lint_groups_priority) for the +# clippy failure this solves. +unused = { level = "deny", priority = -1 } warnings = "deny" [workspace.lints.clippy] diff --git a/crates/blockifier/src/lib.rs b/crates/blockifier/src/lib.rs index 686c46b983..577f2502de 100644 --- a/crates/blockifier/src/lib.rs +++ b/crates/blockifier/src/lib.rs @@ -2,12 +2,7 @@ // length to pointer type ([not necessarily true](https://github.com/rust-lang/rust/issues/65473), // but it is a reasonable assumption for now), this attribute protects against potential overflow // when converting usize to u128. -#![cfg(any( - target_pointer_width = "16", - target_pointer_width = "32", - target_pointer_width = "64", - target_pointer_width = "128" -))] +#![cfg(any(target_pointer_width = "16", target_pointer_width = "32", target_pointer_width = "64",))] #[cfg(feature = "jemalloc")] // Override default allocator. diff --git a/crates/committer/src/patricia_merkle_tree/updated_skeleton_tree/create_tree_helper.rs b/crates/committer/src/patricia_merkle_tree/updated_skeleton_tree/create_tree_helper.rs index 69d3a29dc7..4bf82a4ce0 100644 --- a/crates/committer/src/patricia_merkle_tree/updated_skeleton_tree/create_tree_helper.rs +++ b/crates/committer/src/patricia_merkle_tree/updated_skeleton_tree/create_tree_helper.rs @@ -41,6 +41,7 @@ impl TempSkeletonNode { /// Assumes the nodes are: /// * Descendants of the given index. /// * A non-empty array. +/// /// Note that the if the LCA is the root, the path will be empty (0 length). fn get_path_to_lca( root_index: &NodeIndex, diff --git a/crates/mempool_infra/src/component_client/local_component_client.rs b/crates/mempool_infra/src/component_client/local_component_client.rs index 2330f9fc89..361a6b3e11 100644 --- a/crates/mempool_infra/src/component_client/local_component_client.rs +++ b/crates/mempool_infra/src/component_client/local_component_client.rs @@ -11,7 +11,7 @@ use crate::component_definitions::ComponentRequestAndResponseSender; /// /// # Fields /// - `tx`: An asynchronous sender channel for transmitting -/// `ComponentRequestAndResponseSender` messages. +/// `ComponentRequestAndResponseSender` messages. /// /// # Example /// ```rust diff --git a/crates/native_blockifier/src/lib.rs b/crates/native_blockifier/src/lib.rs index 539b13673f..8ce52197ed 100644 --- a/crates/native_blockifier/src/lib.rs +++ b/crates/native_blockifier/src/lib.rs @@ -1,10 +1,5 @@ // The blockifier crate supports only these specific architectures. -#![cfg(any( - target_pointer_width = "16", - target_pointer_width = "32", - target_pointer_width = "64", - target_pointer_width = "128" -))] +#![cfg(any(target_pointer_width = "16", target_pointer_width = "32", target_pointer_width = "64",))] pub mod errors; pub mod py_block_executor; From 5ca9ae56ba139a22f9ccb38d16058e5f8b2e82e5 Mon Sep 17 00:00:00 2001 From: Dori Medini Date: Thu, 25 Jul 2024 17:19:16 +0300 Subject: [PATCH 8/8] fix: conflict resolution Signed-off-by: Dori Medini --- commitlint.config.js | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/commitlint.config.js b/commitlint.config.js index 8994b429e2..cf7df8b1ae 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -33,8 +33,9 @@ const Configuration = { 'helm', 'JSON-RPC', 'load_test', - 'mempool_node', 'mempool', + 'mempool_infra', + 'mempool_node', 'monitoring', 'native_blockifier', 'network', @@ -47,19 +48,6 @@ const Configuration = { 'storage', 'sync', 'test_utils', -<<<<<<< HEAD - 'ci', - 'gateway', - 'mempool', - 'mempool_infra', - 'mempool_node', -||||||| cd310745 - 'ci', - 'gateway', - 'mempool', - 'mempool_node', -======= ->>>>>>> origin/main-v0.13.2 'tests-integration', 'transaction', 'types',