Skip to content

Commit

Permalink
feat: update to latest sequencer with Native support (#768)
Browse files Browse the repository at this point in the history
* wip: cairo native

* use contract executor

* update cargo

* unskip eip1559 for repro

* update to llvm 19

* update remote

* bump gas limits

* restore skipfile

* make tests not quiet

* update used rev

* fix rev

* reduce max steps

* nocapture to have more logs in CI

* bump native

* downgrade native to main

* bump native

* bump native

* latest native main

* remove blockchain-skipped tests

* bump native

* bump native

* fix build

* bump native

* bump cairo

* bump native

* idk

* bump native

* bump native

* bump native

* bump cargo

* bump native

* fix sequencer build

* debug ram only on macos targets

* bump native

* bump native

* bump cairo

* custom macro to track long tests

* update to latest sequencer

* update on main

* fix ef-testing crate

* restore native feature

* bump sequencer to get proper versioned constant parsing

* add required dependencies for native build

* checkout before using composite actions

* make llvm deps in path

* fix workflow

* install LLVM in action instead of sh script

* bump sequencer dep for proper support of serde

* fix trunk

* remove old llvm in ci

* set LLVM_CONFIG var to llvm-19

* add llvm bin to path

* apply suggestions
  • Loading branch information
enitrat authored Dec 6, 2024
1 parent baca720 commit 6d017f9
Show file tree
Hide file tree
Showing 28 changed files with 1,429 additions and 533 deletions.
20 changes: 20 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Required to have the proper environment variables set to
# build the starkware-libs/sequencer dependencies with Native mode.

[env]
CAIRO_NATIVE_RUNTIME_LIBRARY = "./libcairo_native_runtime.a"

# Use `lld` for linking instead of `ld`, since we run out of memory while linking with `ld` on
# 16-cores linux machines, see:
# https://nnethercote.github.io/perf-book/build-configuration.html#linking.
# TODO: remove this once `rust` stabilizes `lld` as the default linker, currently only on nightly:
# https://github.com/rust-lang/rust/issues/39915#issuecomment-618726211
[target.x86_64-unknown-linux-gnu]
rustflags = ["-Clink-arg=-fuse-ld=lld"]
env = { "MLIR_SYS_190_PREFIX" = "/usr/lib/llvm-19", "LLVM_SYS_191_PREFIX" = "/usr/lib/llvm-19", "TABLEGEN_190_PREFIX" = "/usr/lib/llvm-19", "CAIRO_NATIVE_RUNTIME_LIBRARY" = "./libcairo_native_runtime.a" }

[target.x86_64-apple-darwin]
env = { "LIBRARY_PATH" = "/opt/homebrew/lib", "MLIR_SYS_190_PREFIX" = "/opt/homebrew/opt/llvm@19", "LLVM_SYS_191_PREFIX" = "/opt/homebrew/opt/llvm@19", "TABLEGEN_190_PREFIX" = "/opt/homebrew/opt/llvm@19", "CAIRO_NATIVE_RUNTIME_LIBRARY" = "./libcairo_native_runtime.a" }

[target.aarch64-apple-darwin]
env = { "LIBRARY_PATH" = "/opt/homebrew/lib", "MLIR_SYS_190_PREFIX" = "/opt/homebrew/opt/llvm@19", "LLVM_SYS_191_PREFIX" = "/opt/homebrew/opt/llvm@19", "TABLEGEN_190_PREFIX" = "/opt/homebrew/opt/llvm@19", "CAIRO_NATIVE_RUNTIME_LIBRARY" = "./libcairo_native_runtime.a" }
88 changes: 80 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,95 @@
---
name: Workflow - CI

# trunk-ignore-all(checkov/CKV2_GHA_1)

on:
push:
branches: [main]
pull_request:
branches:
- main

permissions: read-all

jobs:
trunk:
name: Trunk
uses: ./.github/workflows/trunk-check.yml
permissions:
checks: write
contents: read
runs-on: ubuntu-24.04
env:
MLIR_SYS_190_PREFIX: /usr/lib/llvm-19/
LLVM_SYS_191_PREFIX: /usr/lib/llvm-19/
TABLEGEN_190_PREFIX: /usr/lib/llvm-19/
steps:
- uses: actions/checkout@v4
- uses: dtolnay/[email protected]
with:
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
- name: add llvm deb repository
uses: myci-actions/add-deb-repo@11
with:
repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main
repo-name: llvm-repo
keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key
- name: Update and upgrade APT
shell: bash
run: sudo apt-get update && sudo apt-get upgrade -y
- name: Install LLVM
run:
sudo apt-get install llvm-19 llvm-19-dev llvm-19-runtime clang-19
clang-tools-19 lld-19 libpolly-19-dev libmlir-19-dev mlir-19-tools
libgmp3-dev libzstd-dev lld libssl-dev zstd
- name: Add llvm bin to PATH
run: echo "/usr/lib/llvm-19/bin" >> $GITHUB_PATH
- name: Trunk Check
uses: trunk-io/[email protected]

tests:
name: Rust tests
uses: ./.github/workflows/test.yml
runs-on: ubuntu-latest-16-cores
env:
MLIR_SYS_190_PREFIX: /usr/lib/llvm-19/
LLVM_SYS_191_PREFIX: /usr/lib/llvm-19/
TABLEGEN_190_PREFIX: /usr/lib/llvm-19/
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- uses: dtolnay/[email protected]
- uses: Swatinem/rust-cache@v2
- name: add llvm deb repository
uses: myci-actions/add-deb-repo@11
with:
repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main
repo-name: llvm-repo
keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key
- name: Install LLVM
run:
sudo apt-get install llvm-19 llvm-19-dev llvm-19-runtime clang-19
clang-tools-19 lld-19 libpolly-19-dev libmlir-19-dev mlir-19-tools
libgmp3-dev libzstd-dev lld libssl-dev zstd
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: fetch ef tests
run: make setup
- name: fetch Kakarot
run: make setup-kakarot
env:
GITHUB_TOKEN: ${{ github.token }}
- name: run tests v0
run: |
set -o pipefail
make vm-tests-v0-ci | tee test_v0.out
- name: run tests v1
run: |
make vm-tests-v1-ci | tee test_v1.out
set +o pipefail
- name: Retrieve ef-tests execution resources
run: python scripts/compute_resources.py
env:
KAKAROT_VERSION: v0,v1
# upload artifacts
- name: upload resources
uses: actions/upload-artifact@v3
with:
path: ./resources/
name: resources-usage
55 changes: 0 additions & 55 deletions .github/workflows/test.yml

This file was deleted.

29 changes: 0 additions & 29 deletions .github/workflows/trunk-check.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ tmp*
# Ignore the generated tests
/crates/ef-testing/tests/*

/crates/ef-testing/native_cache/*

# Ignore the launch file
launch.json

Expand Down
Loading

0 comments on commit 6d017f9

Please sign in to comment.