Skip to content

Commit 061ef9d

Browse files
Merge branch 'starkware-libs:main' into main
2 parents 7e7f34e + 2037702 commit 061ef9d

File tree

2,373 files changed

+630252
-221711
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,373 files changed

+630252
-221711
lines changed

.cargo/config.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
[env]
2-
CAIRO_NATIVE_RUNTIME_LIBRARY = "./libcairo_native_runtime.a"
32
LLVM_SYS_191_PREFIX = "/usr/lib/llvm-19/"
43
MLIR_SYS_190_PREFIX = "/usr/lib/llvm-19/"
54
TABLEGEN_190_PREFIX = "/usr/lib/llvm-19/"
65

76
# Use `lld` for linking instead of `ld`, since we run out of memory while linking with `ld` on
87
# 16-cores linux machines, see:
98
# https://nnethercote.github.io/perf-book/build-configuration.html#linking.
10-
# TODO: remove this once `rust` stabilizes `lld` as the default linker, currently only on nightly:
9+
# TODO(Gilad): remove this once `rust` stabilizes `lld` as the default linker, currently only on nightly:
1110
# https://github.com/rust-lang/rust/issues/39915#issuecomment-618726211
12-
[target.x86_64-unknown-linux-gnu]
11+
[target.'cfg(all(target_os = "linux"))']
1312
rustflags = ["-Clink-arg=-fuse-ld=lld"]

.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/data
22
/deployments
33
/logs
4-
/target
4+
**/target/
55
.git
66
!crates/papyrus_load_test/resources
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
1+
name: Bootstrap
2+
description: Install dependencies.
3+
4+
inputs:
5+
extra_rust_toolchains:
6+
description: "Extra toolchains to install, but aren't used by default"
7+
required: false
8+
github_token:
9+
description: "Github token to use for authentication"
10+
required: false
11+
112
runs:
213
using: "composite"
314
steps:
415
- name: Install rust.
516
uses: ./.github/actions/install_rust
17+
with:
18+
extra_rust_toolchains: ${{ inputs.extra_rust_toolchains }}
19+
github_token: ${{ inputs.github_token }}
620
- name: Install cairo native.
721
uses: ./.github/actions/setup_native_deps
Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,34 @@
1-
name: Bootsrap rust installation
1+
name: Bootstrap rust installation
22
description: Setup rust environment and its components, also caching the build results.
33

4+
inputs:
5+
extra_rust_toolchains:
6+
description: "Extra toolchains to install, but aren't used by default"
7+
required: false
8+
github_token:
9+
description: "Github token to use for authentication"
10+
required: false
11+
412
runs:
513
using: "composite"
614
steps:
715
- uses: moonrepo/setup-rust@v1
16+
name: Install Rust toolchain and binaries
817
with:
918
cache-base: main(-v[0-9].*)?
19+
inherit-toolchain: true
20+
bins: [email protected], cargo-machete
21+
# Install additional non-default toolchains (for rustfmt for example), NOP if input omitted.
22+
channel: ${{ inputs.extra_rust_toolchains }}
23+
env:
24+
RUSTFLAGS: "-C link-arg=-fuse-ld=lld"
25+
GITHUB_TOKEN: ${{ inputs.github_token }}
26+
27+
# This installation is _not_ cached, but takes a couple seconds: it's downloading prepackaged
28+
# binaries.
29+
# TODO(Gilad): once we migrate to a cached Docker image, we can remove this step and just
30+
# install it during dependencies.sh (which we don't do now since dependencies.sh isn't cached).
31+
- name: Install Anvil
32+
uses: foundry-rs/foundry-toolchain@v1
33+
with:
34+
version: v0.3.0

.github/workflows/blockifier_ci.yml

Lines changed: 44 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,39 +22,74 @@ on:
2222
paths:
2323
# Other than code-related changes, all changes related to the native-blockifier build-and-push
2424
# process should trigger the build (e.g., changes to the Dockerfile, build scripts, etc.).
25+
- '.github/actions/bootstrap/action.yml'
2526
- '.github/workflows/blockifier_ci.yml'
2627
- '.github/workflows/upload_artifacts_workflow.yml'
2728
- 'build_native_in_docker.sh'
2829
- 'Cargo.lock'
2930
- 'Cargo.toml'
3031
- 'crates/blockifier/**'
32+
- 'crates/blockifier_test_utils/**'
3133
- 'crates/native_blockifier/**'
34+
- 'crates/apollo_sierra_multicompile/build.rs'
3235
- 'scripts/build_native_blockifier.sh'
3336
- 'scripts/dependencies.sh'
3437
- 'scripts/install_build_tools.sh'
3538
- 'scripts/sequencer-ci.Dockerfile'
3639

40+
env:
41+
RUSTFLAGS: "-D warnings -C link-arg=-fuse-ld=lld"
42+
3743
# On PR events, cancel existing CI runs on this same PR for this workflow.
44+
# Also, create different concurrency groups for different pushed commits, on push events.
3845
concurrency:
39-
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.job }}
46+
group: >
47+
${{ github.workflow }}-
48+
${{ github.ref }}-
49+
${{ github.event_name == 'pull_request' && 'PR' || github.sha }}
4050
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
4151

4252
jobs:
43-
feature-combo-builds:
44-
runs-on: starkware-ubuntu-20-04-medium
53+
test-without-features:
54+
runs-on: starkware-ubuntu-24.04-medium
4555
steps:
4656
- uses: actions/checkout@v4
47-
with:
48-
# required to clone native as a gitsubmodule
49-
submodules: recursive
50-
fetch-depth: 0
5157
- uses: ./.github/actions/bootstrap
58+
with:
59+
github_token: ${{ secrets.GITHUB_TOKEN }}
5260
# No features - build blockifier without features activated by dependencies in the workspace.
53-
- run: cargo build -p blockifier
5461
- run: cargo test -p blockifier
62+
- run: cargo build -p blockifier
63+
64+
test-with-transaction-serde-feature:
65+
runs-on: starkware-ubuntu-24.04-medium
66+
steps:
67+
- uses: actions/checkout@v4
68+
- uses: ./.github/actions/bootstrap
69+
with:
70+
github_token: ${{ secrets.GITHUB_TOKEN }}
5571
# transaction_serde is not activated by any workspace crate; test the build.
56-
- run: cargo build -p blockifier --features transaction_serde
5772
- run: cargo test -p blockifier --features transaction_serde
73+
- run: cargo build -p blockifier --features transaction_serde
74+
75+
test-with-cairo-native-feature:
76+
runs-on: starkware-ubuntu-24.04-medium
77+
steps:
78+
- uses: actions/checkout@v4
79+
- uses: ./.github/actions/bootstrap
80+
with:
81+
github_token: ${{ secrets.GITHUB_TOKEN }}
5882
# cairo_native is not activated by any workspace crate; test the build.
5983
- run: cargo build -p blockifier --features cairo_native
6084
- run: cargo test -p blockifier --features cairo_native
85+
86+
test-with-tracing-feature:
87+
runs-on: starkware-ubuntu-24.04-medium
88+
steps:
89+
- uses: actions/checkout@v4
90+
- uses: ./.github/actions/bootstrap
91+
with:
92+
github_token: ${{ secrets.GITHUB_TOKEN }}
93+
# tracing is not activated by any workspace crate; test the build.
94+
- run: cargo build -p blockifier --features tracing
95+
- run: cargo test -p blockifier --features tracing

.github/workflows/blockifier_compiled_cairo.yml

Lines changed: 17 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -7,63 +7,45 @@ on:
77
- reopened
88
- synchronize
99
paths:
10-
- 'Cargo.toml'
1110
- '.github/workflows/blockifier_compiled_cairo.yml'
12-
- 'crates/blockifier/feature_contracts/**'
13-
- 'crates/blockifier/src/test_utils/cairo_compile.rs'
14-
- 'crates/blockifier/tests/feature_contracts_compatibility_test.rs'
15-
- 'crates/blockifier/tests/requirements.txt'
11+
- 'crates/apollo_compile_to_casm/src/constants.rs' # Contains the Cairo1 compiler version.
12+
- 'crates/apollo_infra_utils/src/cairo0_compiler.rs' # Contains the Cairo0 compiler version.
13+
- 'crates/blockifier_test_utils/**'
1614
- 'scripts/dependencies.sh'
1715

16+
env:
17+
RUSTFLAGS: "-D warnings -C link-arg=-fuse-ld=lld"
18+
1819
# On PR events, cancel existing CI runs on this same PR for this workflow.
20+
# Also, create different concurrency groups for different pushed commits, on push events.
1921
concurrency:
20-
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.job }}
22+
group: >
23+
${{ github.workflow }}-
24+
${{ github.ref }}-
25+
${{ github.event_name == 'pull_request' && 'PR' || github.sha }}
2126
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
2227

2328
jobs:
2429
verify_cairo_file_dependencies:
25-
runs-on: starkware-ubuntu-20-04-medium
30+
runs-on: starkware-ubuntu-24.04-medium
2631
steps:
2732
- uses: actions/checkout@v4
2833
- uses: ./.github/actions/bootstrap
34+
with:
35+
github_token: ${{ secrets.GITHUB_TOKEN }}
2936

3037
# Setup pypy and link to the location expected by .cargo/config.toml.
3138
- uses: actions/setup-python@v5
3239
id: setup-pypy
3340
with:
3441
python-version: 'pypy3.9'
42+
cache: 'pip'
3543
- run: ln -s '${{ steps.setup-pypy.outputs.python-path }}' /usr/local/bin/pypy3.9
3644
- env:
3745
LD_LIBRARY_PATH: ${{ env.Python3_ROOT_DIR }}/bin
3846
run: echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> $GITHUB_ENV
39-
40-
# Checkout sequencer into a dedicated directory - technical requirement in order to be able to checkout `cairo` in a sibling directory.
41-
- name: checkout sequencer into `sequencer` directory.
42-
uses: actions/checkout@v4
43-
with:
44-
repository: 'starkware-libs/sequencer'
45-
path: 'sequencer'
46-
47-
- name: checkout cairo1 repo in order to compile cairo1 contracts.
48-
uses: actions/checkout@v4
49-
with:
50-
repository: 'starkware-libs/cairo'
51-
fetch-depth: 0
52-
fetch-tags: true
53-
path: 'cairo'
54-
55-
- name: install toolchain for legacy contract compilation (old compiler tag)
56-
uses: actions-rs/toolchain@master
57-
with:
58-
toolchain: nightly-2023-07-05
59-
60-
- name: install toolchain for cairo steps test contract compilation (old compiler tag)
61-
uses: actions-rs/toolchain@master
62-
with:
63-
toolchain: nightly-2024-04-29
47+
- run: pip install -r crates/blockifier_test_utils/resources/blockifier-test-utils-requirements.txt
6448

6549
- name: Verify cairo contract recompilation (both cairo versions).
6650
run:
67-
cd sequencer &&
68-
pip install -r crates/blockifier/tests/requirements.txt &&
69-
cargo test -p blockifier --test feature_contracts_compatibility_test --features testing -- --include-ignored
51+
cargo test -p blockifier_test_utils --test feature_contracts_compatibility_test -- --include-ignored --nocapture

.github/workflows/blockifier_post-merge.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/blockifier_reexecution_ci.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,26 @@ on:
1919
- 'scripts/install_build_tools.sh'
2020
- 'scripts/sequencer-ci.Dockerfile'
2121

22+
env:
23+
RUSTFLAGS: "-D warnings -C link-arg=-fuse-ld=lld"
24+
2225
# On PR events, cancel existing CI runs on this same PR for this workflow.
26+
# Also, create different concurrency groups for different pushed commits, on push events.
2327
concurrency:
24-
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.job }}
28+
group: >
29+
${{ github.workflow }}-
30+
${{ github.ref }}-
31+
${{ github.event_name == 'pull_request' && 'PR' || github.sha }}
2532
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
2633

2734
jobs:
2835
blockifier_reexecution:
29-
runs-on: starkware-ubuntu-latest-medium
36+
runs-on: starkware-ubuntu-24.04-medium
3037
steps:
3138
- uses: actions/checkout@v4
3239
- uses: ./.github/actions/bootstrap
40+
with:
41+
github_token: ${{ secrets.GITHUB_TOKEN }}
3342
# Download the blockifier re-execution test data.
3443
- id: auth
3544
uses: "google-github-actions/auth@v2"
@@ -41,4 +50,4 @@ jobs:
4150
# Run blockifier re-execution tests.
4251
- run: cargo test --release -p blockifier_reexecution -- --include-ignored
4352
# Compile the rpc-tests, without running them.
44-
- run: cargo test -p blockifier_reexecution --features blockifier_regression_https_testing --no-run
53+
- run: cargo test --release -p blockifier_reexecution --features blockifier_regression_https_testing --no-run

.github/workflows/clean_stale_prs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
jobs:
1010
stale:
1111
name: 🧹 Clean up stale issues and PRs
12-
runs-on: starkware-ubuntu-latest-small
12+
runs-on: starkware-ubuntu-24.04-small
1313
steps:
1414
- name: 🚀 Run stale
1515
uses: actions/stale@v3

0 commit comments

Comments
 (0)