Skip to content

Commit b37b325

Browse files
glihmkariy
andauthored
feat: bump to cairo 2.9.2 (#2879)
* wip: deps versionning * fix: add missing scarb field * chore: bump scarb * fix blockifier changes * fix: update scarb related code for testing * fix blockifier resource bounds mapping * bump scarb version * cairo fmt * tests: regenerate test databases * fix: bump cainome to fix event parsing * fix: clippy * fix contract call * add test for calling non legacy contract * wip: fixing cairo compilation * chore: bump to cairo 2.9.2 * chore: update scarb * fix: fmt and scarb update * tests: regenerates test dbs * fix: migrate to new scarb test functions * tests: regenerate test db * tests: regenerate test db * ci: add scarb for test commands since it depends on scarb metadata * fix(core-cairo-test): build external world class and adjust panick messages * feat: don't enforce fee if tx max fee is zero * chore: bump scarb * fix: add better error message if env var SCARB is not correctly set * tests: regenerate test db and update addresses in cairo config * only modify if we're in fee enabled mode * tests: fix test policies * ci: use rust 181 devcontainer * tests: regenerate test db * ci: wip * ci+docker: move to ubuntu:noble * ci: add back dojo-dev image for test * ci: add the container to build for the same version * docker: add make to devcontainer * ci: use latest dojo-dev * docker: revert to bookworm for dojo image * fix(devcontainer): add missing dependencies for testing * ci: bump devcontainer * tests: regenerate test db --------- Co-authored-by: Ammar Arif <[email protected]>
1 parent 4b6d473 commit b37b325

File tree

120 files changed

+1861
-1780
lines changed

Some content is hidden

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

120 files changed

+1861
-1780
lines changed

.devcontainer/Dockerfile

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,20 @@
1-
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/rust/.devcontainer/base.Dockerfile
1+
# See here for image contents: https://hub.docker.com/layers/library/rust/1.81.0-slim/images/sha256-ba4ee661bb466ab49f6ceb8c6d9e9f9784bba7c6e45225187cd3c7fb1fbc12ce
22

3-
# [Choice] Debian OS version (use bookworm on local arm64/Apple Silicon): buster, bullseye, bookworm
4-
5-
ARG VARIANT
6-
FROM mcr.microsoft.com/vscode/devcontainers/rust:${VARIANT}
7-
ARG VARIANT
3+
ARG RUST_VERSION=1.81.0
4+
FROM rust:${RUST_VERSION}-slim
5+
ARG RUST_VERSION
86

97
# Install additional packages
108
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
11-
&& apt-get -y install --no-install-recommends protobuf-compiler libprotobuf-dev libclang-dev libzstd-dev
12-
13-
RUN apt install -y gh libgmp3-dev software-properties-common
9+
&& apt-get -y install --no-install-recommends protobuf-compiler libprotobuf-dev libclang-dev libzstd-dev make pkg-config libssl-dev
1410

15-
# Install Cairo Native dependencies
16-
RUN curl -s https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc > /dev/null
17-
RUN echo "deb http://apt.llvm.org/${VARIANT}/ llvm-toolchain-${VARIANT}-17 main" | tee /etc/apt/sources.list.d/llvm.list && apt-get update
18-
RUN apt-get -y install -t llvm-toolchain-${VARIANT}-17 llvm-17 llvm-17-dev llvm-17-runtime clang-17 clang-tools-17 lld-17 libpolly-17-dev libmlir-17-dev mlir-17-tools
11+
RUN apt-get install -y gh libgmp3-dev software-properties-common curl git
1912

2013
RUN curl -L https://foundry.paradigm.xyz/ | bash && . /root/.bashrc && foundryup
2114
ENV PATH="${PATH}:/root/.foundry/bin"
2215

23-
# To build Katana with 'native' feature, we need to set the following environment variables
24-
ENV MLIR_SYS_170_PREFIX=/usr/lib/llvm-17
25-
ENV LLVM_SYS_170_PREFIX=/usr/lib/llvm-17
26-
ENV TABLEGEN_170_PREFIX=/usr/lib/llvm-17
27-
2816
# To allow independent workflow of the container, the rust-toolchain is explicitely given.
29-
RUN echo "1.80.0" > rust_toolchain_version
17+
RUN echo ${RUST_VERSION} > rust_toolchain_version
3018
# Make sure to sync the nightly version with the scripts in ./scripts
3119
RUN echo "nightly-2024-08-28" > nightly_rust_toolchain_version
3220

.github/workflows/ci.yml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ on:
88

99
env:
1010
CARGO_TERM_COLOR: always
11-
RUST_VERSION: 1.80.0
11+
RUST_VERSION: 1.81.0
1212

1313
jobs:
1414
build:
1515
runs-on: ubuntu-latest-4-cores
1616
needs: [fmt, cairofmt]
17+
container:
18+
image: ghcr.io/dojoengine/dojo-dev:rust181bookworm2
1719
steps:
1820
- uses: actions/checkout@v3
1921
- uses: Swatinem/rust-cache@v2
@@ -32,7 +34,7 @@ jobs:
3234
needs: ensure-docker
3335
runs-on: ubuntu-latest-32-cores
3436
container:
35-
image: ghcr.io/dojoengine/dojo-dev:v1.0.12
37+
image: ghcr.io/dojoengine/dojo-dev:rust181bookworm2
3638
steps:
3739
- uses: actions/checkout@v3
3840
- uses: Swatinem/rust-cache@v2
@@ -58,7 +60,7 @@ jobs:
5860
runs-on: ubuntu-latest
5961
needs: [fmt, cairofmt]
6062
container:
61-
image: ghcr.io/dojoengine/dojo-dev:v1.0.12
63+
image: ghcr.io/dojoengine/dojo-dev:rust181bookworm2
6264
steps:
6365
- uses: actions/checkout@v3
6466
- uses: Swatinem/rust-cache@v2
@@ -92,7 +94,7 @@ jobs:
9294
needs: build
9395
runs-on: ubuntu-latest
9496
container:
95-
image: debian:bookworm-slim
97+
image: ubuntu:noble
9698
steps:
9799
- uses: actions/download-artifact@v4
98100
with:
@@ -114,7 +116,7 @@ jobs:
114116
- uses: actions/checkout@v3
115117
- uses: software-mansion/setup-scarb@v1
116118
with:
117-
scarb-version: "2.8.4"
119+
scarb-version: "2.9.2"
118120
- run: |
119121
scarb --manifest-path examples/spawn-and-move/Scarb.toml fmt --check
120122
scarb --manifest-path examples/simple/Scarb.toml fmt --check
@@ -124,9 +126,10 @@ jobs:
124126
dojo-core-test:
125127
needs: build
126128
runs-on: ubuntu-latest
127-
container:
128-
image: ghcr.io/dojoengine/dojo-dev:v1.0.12
129129
steps:
130+
- uses: software-mansion/setup-scarb@v1
131+
with:
132+
scarb-version: "2.9.2"
130133
- uses: actions/download-artifact@v4
131134
with:
132135
name: dojo-bins
@@ -140,9 +143,10 @@ jobs:
140143
dojo-spawn-and-move-example-test:
141144
needs: build
142145
runs-on: ubuntu-latest
143-
container:
144-
image: ghcr.io/dojoengine/dojo-dev:v1.0.12
145146
steps:
147+
- uses: software-mansion/setup-scarb@v1
148+
with:
149+
scarb-version: "2.9.2"
146150
- uses: actions/download-artifact@v4
147151
with:
148152
name: dojo-bins
@@ -157,7 +161,7 @@ jobs:
157161
runs-on: ubuntu-latest-4-cores
158162
needs: [fmt, cairofmt]
159163
container:
160-
image: ghcr.io/dojoengine/dojo-dev:v1.0.12
164+
image: ghcr.io/dojoengine/dojo-dev:rust181bookworm2
161165
steps:
162166
- uses: actions/checkout@v3
163167
- uses: Swatinem/rust-cache@v2
@@ -166,7 +170,7 @@ jobs:
166170
fmt:
167171
runs-on: ubuntu-latest
168172
container:
169-
image: ghcr.io/dojoengine/dojo-dev:v1.0.12
173+
image: ghcr.io/dojoengine/dojo-dev:rust181bookworm2
170174
steps:
171175
- uses: actions/checkout@v3
172176
- uses: Swatinem/rust-cache@v2
@@ -176,7 +180,7 @@ jobs:
176180
runs-on: ubuntu-latest
177181
needs: [fmt, cairofmt]
178182
container:
179-
image: ghcr.io/dojoengine/dojo-dev:v1.0.12
183+
image: ghcr.io/dojoengine/dojo-dev:rust181bookworm2
180184
steps:
181185
- uses: actions/checkout@v3
182186
- uses: Swatinem/rust-cache@v2

.github/workflows/devcontainer.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ jobs:
6464
- name: Build and push Docker image
6565
uses: docker/build-push-action@v2
6666
with:
67-
push: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'release' && startsWith(github.ref, 'refs/tags/')) }}
67+
push: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'release' && startsWith(github.ref, 'refs/tags/')) || github.event_name == 'workflow_dispatch' }}
6868
file: .devcontainer/Dockerfile
6969
tags: ghcr.io/${{ github.repository }}-dev:latest,ghcr.io/${{ github.repository }}-dev:${{ env.DOCKER_TAG }}
7070
build-args: |
71-
VARIANT=bookworm
71+
RUST_VERSION=1.81.0
7272
BUILD_TYPE=${{ github.event_name }}
7373
DOJO_VERSION=${{ github.event.release.tag_name }}
7474
platforms: linux/amd64,linux/arm64

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
scarb 2.8.4
1+
scarb 2.9.2
22
starknet-foundry 0.30.0

0 commit comments

Comments
 (0)