Skip to content

Commit

Permalink
Merge branch 'main' into rdr/add-entry-point-execution
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigo-pino authored Oct 10, 2024
2 parents 4742a02 + ac479c5 commit 2f4d0d2
Show file tree
Hide file tree
Showing 148 changed files with 43,354 additions and 2,996 deletions.
8 changes: 8 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,11 @@
LLVM_SYS_181_PREFIX = "/usr/lib/llvm-18/"
MLIR_SYS_180_PREFIX = "/usr/lib/llvm-18/"
TABLEGEN_180_PREFIX = "/usr/lib/llvm-18/"

# Limit concurrency to prevent crash during "cargo build" due to excessive memory usage. Should be removed in the future. Slows down performance.
[build]
jobs = 8

# Limit concurrency to prevent crash during "cargo test" due to excessive memory usage. Should be removed in the future. Slows down performance.
[test]
jobs = 8
5 changes: 5 additions & 0 deletions .github/workflows/blockifier_compiled_cairo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ jobs:
with:
toolchain: nightly-2023-07-05

- name: install toolchain for cairo steps test contract compilation (old compiler tag)
uses: actions-rs/toolchain@master
with:
toolchain: nightly-2024-04-29

- name: Verify cairo contract recompilation (both cairo versions).
run:
cd sequencer &&
Expand Down
51 changes: 0 additions & 51 deletions .github/workflows/committer_ci.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,6 @@
name: Committer-CI

on:
push:
branches:
- main
- main-v[0-9].**
tags:
- v[0-9].**
paths:
- '.github/workflows/committer_ci.yml'
- 'Cargo.toml'
- 'Cargo.lock'
- 'crates/committer_cli/**'
- 'crates/starknet_api/**'
- 'crates/starknet_committer/**'
- 'crates/starknet_patricia/**'
- 'scripts/dependencies.sh'

pull_request:
types:
- opened
Expand Down Expand Up @@ -121,38 +105,3 @@ jobs:
body: fs.readFileSync('bench_new.txt', 'utf8'),
path: 'Commits'
})
gcs-push:
runs-on: starkware-ubuntu-20-04-medium
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/bootstrap

# Commit hash on pull request event would be the head commit of the branch.
- name: Get commit hash prefix for PR update
if: ${{ github.event_name == 'pull_request' }}
env:
COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
run: echo "SHORT_HASH=${COMMIT_SHA:0:7}" >> $GITHUB_ENV

# On push event (to main, for example) we should take the commit post-push.
- name: Get commit hash prefix for merge
if: ${{ github.event_name != 'pull_request' }}
env:
COMMIT_SHA: ${{ github.event.after }}
run: echo "SHORT_HASH=${COMMIT_SHA:0:7}" >> $GITHUB_ENV

- name: Build CLI binary
run: ./build_native_in_docker.sh cargo build -p committer_cli -r --bin committer_cli --target-dir CLI_TARGET

- id: auth
uses: "google-github-actions/auth@v2"
with:
credentials_json: ${{ secrets.COMMITER_PRODUCTS_EXT_WRITER_JSON }}

- name: Upload binary to GCP
id: upload_file
uses: "google-github-actions/upload-cloud-storage@v2"
with:
path: "CLI_TARGET/release/committer_cli"
destination: "committer-products-external/${{ env.SHORT_HASH }}/release/"
76 changes: 76 additions & 0 deletions .github/workflows/committer_cli_push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Committer-CLI-push

on:
push:
branches:
- main
- main-v[0-9].**
tags:
- v[0-9].**
paths:
- '.github/workflows/committer_cli_push.yml'
- 'Cargo.toml'
- 'Cargo.lock'
- 'crates/committer_cli/**'
- 'crates/starknet_api/**'
- 'crates/starknet_committer/**'
- 'crates/starknet_patricia/**'
- 'scripts/dependencies.sh'

pull_request:
types:
- opened
- reopened
- synchronize
- auto_merge_enabled
- edited
paths:
- '.github/workflows/committer_cli_push.yml'
- 'Cargo.toml'
- 'Cargo.lock'
- 'crates/committer_cli/**'
- 'crates/starknet_api/**'
- 'crates/starknet_committer/**'
- 'crates/starknet_patricia/**'
- 'scripts/dependencies.sh'

# On PR events, cancel existing CI runs on this same PR for this workflow.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.job }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
gcs-push:
runs-on: starkware-ubuntu-20-04-medium
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/bootstrap

# Commit hash on pull request event would be the head commit of the branch.
- name: Get commit hash prefix for PR update
if: ${{ github.event_name == 'pull_request' }}
env:
COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
run: echo "SHORT_HASH=${COMMIT_SHA:0:7}" >> $GITHUB_ENV

# On push event (to main, for example) we should take the commit post-push.
- name: Get commit hash prefix for merge
if: ${{ github.event_name != 'pull_request' }}
env:
COMMIT_SHA: ${{ github.event.after }}
run: echo "SHORT_HASH=${COMMIT_SHA:0:7}" >> $GITHUB_ENV

- name: Build CLI binary
run: ./build_native_in_docker.sh cargo build -p committer_cli -r --bin committer_cli --target-dir CLI_TARGET

- id: auth
uses: "google-github-actions/auth@v2"
with:
credentials_json: ${{ secrets.COMMITER_PRODUCTS_EXT_WRITER_JSON }}

- name: Upload binary to GCP
id: upload_file
uses: "google-github-actions/upload-cloud-storage@v2"
with:
path: "CLI_TARGET/release/committer_cli"
destination: "committer-products-external/${{ env.SHORT_HASH }}/release/"
51 changes: 0 additions & 51 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,6 @@ concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
commitlint:
runs-on: starkware-ubuntu-latest-small
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install commitlint
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'))
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'))
env:
TITLE: ${{ github.event.pull_request.title }}
run: echo "$TITLE" | commitlint --verbose

code_style:
runs-on: starkware-ubuntu-20-04-medium
steps:
Expand Down Expand Up @@ -85,7 +62,6 @@ jobs:
- name: Run Machete (detect unused dependencies)
uses: bnjbvr/cargo-machete@main


run-workspace-tests:
runs-on: starkware-ubuntu-latest-medium
steps:
Expand Down Expand Up @@ -130,33 +106,6 @@ jobs:
env:
SEED: 0

merge-gatekeeper:
runs-on: starkware-ubuntu-latest-small
# Restrict permissions of the GITHUB_TOKEN.
# Docs: https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
permissions:
checks: read
statuses: read
steps:
- name: Run Merge Gatekeeper on pull request
if: github.event_name == 'pull_request'
uses: upsidr/merge-gatekeeper@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
timeout: 1500
interval: 30
ignored: "code-review/reviewable"

- name: Run Merge Gatekeeper on Merge Queue || push
if: github.event_name == 'merge_group' || github.event_name == 'push'
uses: upsidr/merge-gatekeeper@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{github.ref}}
timeout: 1500
interval: 30
ignored: "code-review/reviewable"

codecov:
runs-on: starkware-ubuntu-latest-medium
steps:
Expand Down
66 changes: 66 additions & 0 deletions .github/workflows/main_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Main-CI-PR-Flow

on:
pull_request:
types:
- opened
- reopened
- synchronize
- auto_merge_enabled
- edited

# On PR events, cancel existing CI runs on this same PR for this workflow.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.job }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
commitlint:
runs-on: starkware-ubuntu-latest-small
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install commitlint
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'))
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'))
env:
TITLE: ${{ github.event.pull_request.title }}
run: echo "$TITLE" | commitlint --verbose

merge-gatekeeper:
runs-on: starkware-ubuntu-latest-small
# Restrict permissions of the GITHUB_TOKEN.
# Docs: https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
permissions:
checks: read
statuses: read
steps:
- name: Run Merge Gatekeeper on pull request
if: github.event_name == 'pull_request'
uses: upsidr/merge-gatekeeper@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
timeout: 1500
interval: 30
ignored: "code-review/reviewable"

- name: Run Merge Gatekeeper on Merge Queue || push
if: github.event_name == 'merge_group' || github.event_name == 'push'
uses: upsidr/merge-gatekeeper@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{github.ref}}
timeout: 1500
interval: 30
ignored: "code-review/reviewable"
10 changes: 9 additions & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ members = [
"crates/batcher",
"crates/batcher_types",
"crates/blockifier",
"crates/blockifier_regression_test",
"crates/blockifier_reexecution",
"crates/committer_cli",
"crates/consensus_manager",
"crates/consensus_manager_types",
Expand Down
3 changes: 3 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const Configuration = {
'batcher',
'block_hash',
'blockifier',
'blockifier_reexecution',
'ci',
'committer',
'common',
Expand All @@ -41,6 +42,8 @@ const Configuration = {
'mempool',
'mempool_infra',
'mempool_node',
'mempool_p2p',
'mempool_p2p_types',
'mempool_test_utils',
'mempool_types',
'monitoring',
Expand Down
Loading

0 comments on commit 2f4d0d2

Please sign in to comment.