Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(blockifier): add native entry point execution #551

Closed
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
ef8318b
refactor: split syscalls into separate files
varex83 Aug 6, 2024
956639e
fix: apply cargo-fmt
varex83 Aug 6, 2024
47f3557
fix: address review comments
varex83 Aug 7, 2024
2d1a082
Merge remote-tracking branch 'origin/main' into native/split-syscalls
varex83 Aug 8, 2024
47e6969
fix: conflicts after merge
varex83 Aug 8, 2024
86df83b
fix: clippy warnings
varex83 Aug 8, 2024
e70684e
feat: add ability of native execution
varex83 Aug 8, 2024
379a9d9
fix: make comments capitalized
varex83 Aug 8, 2024
1a5d04e
fix: apply fmt
varex83 Aug 8, 2024
584dc88
fix: small fixes in comments and matching
varex83 Aug 8, 2024
71c8757
fix: bring back old `.toml` formatting
varex83 Aug 8, 2024
5a1bcc2
fix: remove unused yet utility functions
varex83 Aug 8, 2024
83d1e2d
Merge remote-tracking branch 'origin/main' into native/split-syscalls
varex83 Aug 12, 2024
32c4400
feat: add syscall failure format
varex83 Aug 12, 2024
07d3d2f
Merge branch 'native/split-syscalls' into native/add-native-execution…
varex83 Aug 13, 2024
a2ba95b
chore: update Cargo.lock
varex83 Aug 16, 2024
ef1331a
Merge remote-tracking branch 'origin/main' into native/add-native-exe…
varex83 Aug 16, 2024
938c552
feat: update Cargo.lock
varex83 Aug 19, 2024
f236548
fix: address review
varex83 Aug 20, 2024
00d5ca7
refactor: address `get_entry_point` review requests
varex83 Aug 20, 2024
9b7a80a
Merge remote-tracking branch 'origin/main' into native/add-native-exe…
varex83 Aug 20, 2024
bb23d4a
refactor: move out methods that won't be reviewed in this PR
varex83 Aug 20, 2024
3403746
fix: rust fmt
varex83 Aug 20, 2024
79a2872
fix: apply some of the CI fixes
varex83 Aug 20, 2024
3c862cc
feat: add native syscall handler
varex83 Aug 21, 2024
18ec25e
fix: comment in Cargo.toml
varex83 Aug 21, 2024
20db622
fix: comment in Cargo.toml
varex83 Aug 21, 2024
fa1af67
feat: add native entry_point_execution
varex83 Aug 21, 2024
b73639a
fix: address some of the review comments
varex83 Aug 27, 2024
566e6c4
Merge branch 'native/add-native-execution-engine' into native/add-sys…
varex83 Aug 27, 2024
15342e5
fix: remove unnecessary debug message
varex83 Aug 27, 2024
752ed83
fix: change the return type of `create_callinfo` to be just a raw typ…
varex83 Aug 27, 2024
7464699
Merge branch 'native/add-syscall-handler' into native/add-entry-point…
varex83 Aug 27, 2024
05815c5
fix: issues after merge
varex83 Aug 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/actions/setup-native-deps/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: "Setup Cairo Native Dependencies"
description: "Sets up LLVM and GMP libraries"

outputs:
cairo-native-runtime-library:
description: "The path to the cairo native runtime library"
value: ${{ steps.set-env-vars.outputs.cairo-native-runtime-library }}
runs:
using: "composite"
steps:
- name: Add llvm deb repository
uses: myci-actions/add-deb-repo@11
with:
repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main
repo-name: llvm-repo
keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key
- name: Install LLVM and gmplib
shell: bash
run: |
sudo apt-get update
sudo apt-get install llvm-18 llvm-18-dev llvm-18-runtime clang-18 clang-tools-18 lld-18 libpolly-18-dev libmlir-18-dev mlir-18-tools
sudo apt-get install -y libgmp3-dev

- name: Fetch Cairo Native Repository
uses: actions/checkout@v3
with:
repository: "lambdaclass/cairo_native"
ref: "cairo-lang2.7.0-rc.3"
path: "cairo_native"
- name: Install Cairo Native Runtime Dependencies
id: set-env-vars
shell: bash
run: |
cd ./cairo_native &&
echo "cairo-native-runtime-library=$(pwd)/target/release/libcairo_native_runtime.a" >> $GITHUB_OUTPUT &&
echo "CAIRO_NATIVE_RUNTIME_LIBRARY=$(pwd)/target/release/libcairo_native_runtime.a" >> $GITHUB_ENV &&
echo "MLIR_SYS_180_PREFIX=/usr/lib/llvm-18/" >> $GITHUB_ENV &&
echo "LLVM_SYS_181_PREFIX=/usr/lib/llvm-18/" >> $GITHUB_ENV &&
echo "TABLEGEN_180_PREFIX=/usr/lib/llvm-18/" >> $GITHUB_ENV &&
cd ./runtime &&
cargo build --release
3 changes: 3 additions & 0 deletions .github/workflows/blockifier_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install_rust
- name: Set up Native Dependencies
uses: ./.github/actions/setup-native-deps
id: native-deps
- uses: Swatinem/rust-cache@v2
with:
prefix-key: "v0-rust-ubuntu-20.04"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/blockifier_compiled_cairo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ jobs:
with:
toolchain: nightly-2023-07-05

- name: set up native dependencies
uses: ./.github/actions/setup-native-deps
id: native-deps

- name: Verify cairo contract recompilation (both cairo versions).
run:
cd sequencer &&
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/blockifier_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install_rust
- name: Set up Native Dependencies
uses: ./.github/actions/setup-native-deps
id: native-deps
- uses: Swatinem/rust-cache@v2
with:
prefix-key: "v0-rust-ubuntu-20.04"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/blockifier_post-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
prefix-key: "v0-rust-ubuntu-20.04"

- name: Set up Native Dependencies
uses: ./.github/actions/setup-native-deps
id: native-deps

# Setup pypy and link to the location expected by .cargo/config.toml.
- uses: actions/setup-python@v5
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ jobs:
- uses: ./.github/actions/install_rust
with:
components: clippy
- name: Set up Native Dependencies
uses: ./.github/actions/setup-native-deps
id: native-deps
- uses: Swatinem/rust-cache@v2
with:
prefix-key: "v0-rust-ubuntu-20.04"
Expand All @@ -84,6 +87,9 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install_rust
- name: Set up Native Dependencies
uses: ./.github/actions/setup-native-deps
id: native-deps
- uses: Swatinem/rust-cache@v2
- uses: Noelware/setup-protoc@1.1.0
with:
Expand All @@ -98,6 +104,9 @@ jobs:
# Fetch the entire history.
fetch-depth: 0
- uses: ./.github/actions/install_rust
- name: Set up Native Dependencies
uses: ./.github/actions/setup-native-deps
id: native-deps
- uses: Noelware/setup-protoc@1.1.0
- uses: Swatinem/rust-cache@v2
with:
Expand Down Expand Up @@ -160,6 +169,9 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install_rust
- name: Set up Native Dependencies
uses: ./.github/actions/setup-native-deps
id: native-deps
- uses: Swatinem/rust-cache@v2
- uses: Noelware/setup-protoc@1.1.0
with:
Expand Down
Loading