Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
142 changes: 1 addition & 141 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -298,43 +298,6 @@ jobs:
run: |
cargo all-features check --n-chunks 6 --chunk ${{ matrix.chunk }} --workspace --all-targets

smoke-no-std:
needs: merge-caches
name: Make sure all builds work (no_std)
runs-on: ubuntu-24.04
steps:
- name: Install Rust
uses: dtolnay/rust-toolchain@1.89.0
with:
targets: wasm32-unknown-unknown

- name: Checkout
uses: actions/checkout@v4

- name: Set up cargo cache
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true

- name: Download proof programs symlinks
uses: actions/download-artifact@master
with:
name: proof_programs
path: cairo_programs/proof_programs/

- name: Fetch programs
uses: actions/cache/restore@v3
with:
path: ${{ env.CAIRO_PROGRAMS_PATH }}
key: all-programs-cache-${{ hashFiles('cairo_programs/**/*.cairo', 'examples/wasm-demo/src/array_sum.cairo', 'Makefile', 'requirements.txt') }}
fail-on-cache-miss: true

- name: Check no-std
run: |
cd ensure-no_std
cargo check --no-default-features
cargo check

smoke-wasm-std:
name: Make sure WASM32 with std works
runs-on: ubuntu-24.04
Expand Down Expand Up @@ -364,7 +327,7 @@ jobs:
fail-fast: false
matrix:
special_features: ["", "extensive_hints", "mod_builtin", "cairo-0-secp-hints", "cairo-0-data-availability-hints"]
target: [ test#1, test#2, test#3, test#4, test-no_std#1, test-no_std#2, test-no_std#3, test-no_std#4, test-wasm ]
target: [ test#1, test#2, test#3, test#4, test-wasm ]
name: Run tests
runs-on: ubuntu-24.04
steps:
Expand Down Expand Up @@ -412,11 +375,6 @@ jobs:
--partition count:${PARTITION}/4 \
--workspace --features "cairo-1-hints, test_utils, ${{ matrix.special_features }}"
;;
'test-no_std')
cargo llvm-cov nextest --lcov --output-path lcov-${{ matrix.target }}-${{ matrix.special_features }}.info \
--partition count:${PARTITION}/4 \
--workspace --no-default-features --features "${{ matrix.special_features }}"
;;
'test-wasm')
# NOTE: release mode is needed to avoid "too many locals" error
wasm-pack test --release --node vm --no-default-features --features "${{ matrix.special_features }}"
Expand Down Expand Up @@ -603,30 +561,6 @@ jobs:
path: lcov-test#4-.info
key: codecov-cache-test#4--${{ github.sha }}
fail-on-cache-miss: true
- name: Fetch results for tests without stdlib (part. 1)
uses: actions/cache/restore@v3
with:
path: lcov-test-no_std#1-.info
key: codecov-cache-test-no_std#1--${{ github.sha }}
fail-on-cache-miss: true
- name: Fetch results for tests without stdlib (part. 2)
uses: actions/cache/restore@v3
with:
path: lcov-test-no_std#2-.info
key: codecov-cache-test-no_std#2--${{ github.sha }}
fail-on-cache-miss: true
- name: Fetch results for tests without stdlib (part. 3)
uses: actions/cache/restore@v3
with:
path: lcov-test-no_std#3-.info
key: codecov-cache-test-no_std#3--${{ github.sha }}
fail-on-cache-miss: true
- name: Fetch results for tests without stdlib (part. 4)
uses: actions/cache/restore@v3
with:
path: lcov-test-no_std#4-.info
key: codecov-cache-test-no_std#4--${{ github.sha }}
fail-on-cache-miss: true
- name: Fetch results for tests with stdlib (w/extensive_hints; part. 1)
uses: actions/cache/restore@v3
with:
Expand All @@ -651,31 +585,6 @@ jobs:
path: lcov-test#4-extensive_hints.info
key: codecov-cache-test#4-extensive_hints-${{ github.sha }}
fail-on-cache-miss: true
- name: Fetch results for tests without stdlib (w/extensive_hints; part. 1)
uses: actions/cache/restore@v3
with:
path: lcov-test-no_std#1-extensive_hints.info
key: codecov-cache-test-no_std#1-extensive_hints-${{ github.sha }}
fail-on-cache-miss: true
- name: Fetch results for tests without stdlib (w/extensive_hints; part. 2)
uses: actions/cache/restore@v3
with:
path: lcov-test-no_std#2-extensive_hints.info
key: codecov-cache-test-no_std#2-extensive_hints-${{ github.sha }}
fail-on-cache-miss: true
- name: Fetch results for tests without stdlib (w/extensive_hints; part. 3)
uses: actions/cache/restore@v3
with:
path: lcov-test-no_std#3-extensive_hints.info
key: codecov-cache-test-no_std#3-extensive_hints-${{ github.sha }}
fail-on-cache-miss: true
- name: Fetch results for tests without stdlib (w/extensive_hints; part. 4)
uses: actions/cache/restore@v3
with:
path: lcov-test-no_std#4-extensive_hints.info
key: codecov-cache-test-no_std#4-extensive_hints-${{ github.sha }}
fail-on-cache-miss: true

- name: Fetch results for tests with stdlib (w/mod_builtin; part. 1)
uses: actions/cache/restore@v3
with:
Expand All @@ -700,31 +609,6 @@ jobs:
path: lcov-test#4-mod_builtin.info
key: codecov-cache-test#4-mod_builtin-${{ github.sha }}
fail-on-cache-miss: true
- name: Fetch results for tests without stdlib (w/mod_builtin; part. 1)
uses: actions/cache/restore@v3
with:
path: lcov-test-no_std#1-mod_builtin.info
key: codecov-cache-test-no_std#1-mod_builtin-${{ github.sha }}
fail-on-cache-miss: true
- name: Fetch results for tests without stdlib (w/mod_builtin; part. 2)
uses: actions/cache/restore@v3
with:
path: lcov-test-no_std#2-mod_builtin.info
key: codecov-cache-test-no_std#2-mod_builtin-${{ github.sha }}
fail-on-cache-miss: true
- name: Fetch results for tests without stdlib (w/mod_builtin; part. 3)
uses: actions/cache/restore@v3
with:
path: lcov-test-no_std#3-mod_builtin.info
key: codecov-cache-test-no_std#3-mod_builtin-${{ github.sha }}
fail-on-cache-miss: true
- name: Fetch results for tests without stdlib (w/mod_builtin; part. 4)
uses: actions/cache/restore@v3
with:
path: lcov-test-no_std#4-mod_builtin.info
key: codecov-cache-test-no_std#4-mod_builtin-${{ github.sha }}
fail-on-cache-miss: true

- name: Fetch results for tests with stdlib (w/cairo-0-secp-hints; part. 1)
uses: actions/cache/restore@v3
with:
Expand All @@ -749,30 +633,6 @@ jobs:
path: lcov-test#4-cairo-0-secp-hints.info
key: codecov-cache-test#4-cairo-0-secp-hints-${{ github.sha }}
fail-on-cache-miss: true
- name: Fetch results for tests without stdlib (w/cairo-0-secp-hints; part. 1)
uses: actions/cache/restore@v3
with:
path: lcov-test-no_std#1-cairo-0-secp-hints.info
key: codecov-cache-test-no_std#1-cairo-0-secp-hints-${{ github.sha }}
fail-on-cache-miss: true
- name: Fetch results for tests without stdlib (w/cairo-0-secp-hints; part. 2)
uses: actions/cache/restore@v3
with:
path: lcov-test-no_std#2-cairo-0-secp-hints.info
key: codecov-cache-test-no_std#2-cairo-0-secp-hints-${{ github.sha }}
fail-on-cache-miss: true
- name: Fetch results for tests without stdlib (w/cairo-0-secp-hints; part. 3)
uses: actions/cache/restore@v3
with:
path: lcov-test-no_std#3-cairo-0-secp-hints.info
key: codecov-cache-test-no_std#3-cairo-0-secp-hints-${{ github.sha }}
fail-on-cache-miss: true
- name: Fetch results for tests without stdlib (w/cairo-0-secp-hints; part. 4)
uses: actions/cache/restore@v3
with:
path: lcov-test-no_std#4-cairo-0-secp-hints.info
key: codecov-cache-test-no_std#4-cairo-0-secp-hints-${{ github.sha }}
fail-on-cache-miss: true
- name: Upload coverage to codecov.io
uses: codecov/codecov-action@v3
with:
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Both branches support Stwo prover opcodes (Blake2s, QM31) since v2.0.0.

#### Upcoming Changes

* Remove no_std support

* feat: Make `write_encoded` API public again [#2306](https://github.com/lambdaclass/cairo-vm/pull/2306)

* refactor: deduplicate memcpy/memset scope initialization in builtin hint processor [#2313](https://github.com/lambdaclass/cairo-vm/pull/2313)
Expand Down
10 changes: 0 additions & 10 deletions Cargo.lock

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

73 changes: 30 additions & 43 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ members = [
"examples/hyper_threading",
]
default-members = ["cairo-vm-cli", "vm", "cairo1-run"]
exclude = ["ensure-no_std"]

# Explicitly set the resolver to the default for edition >= 2021
# https://doc.rust-lang.org/edition-guide/rust-2021/default-cargo-resolver.html
Expand All @@ -22,57 +21,45 @@ edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/lambdaclass/cairo-vm/"
readme = "README.md"
keywords = ["starknet", "cairo", "vm", "wasm", "no_std"]
keywords = ["starknet", "cairo", "vm", "wasm"]

[workspace.dependencies]
cairo-vm = { path = "./vm", version = "3.1.0", default-features = false }
cairo-vm-tracer = { path = "./cairo-vm-tracer", version = "3.1.0", default-features = false }
cairo-vm = { path = "./vm", version = "3.1.0" }
cairo-vm-tracer = { path = "./cairo-vm-tracer", version = "3.1.0" }
mimalloc = { version = "0.1.37", default-features = false }
num-bigint = { version = "0.4", default-features = false, features = [
"serde",
"rand",
] }
rand = { version = "0.8.5", features = ["small_rng"], default-features = false }
num-traits = { version = "0.2", default-features = false }
num-integer = { version = "0.1.45", default-features = false }
serde = { version = "1.0", features = ["derive"], default-features = false }
serde_json = { version = "1.0", features = [
"arbitrary_precision",
"alloc",
], default-features = false }
hex = { version = "0.4.3", default-features = false }
starknet-crypto = { version = "0.8.0", default-features = false, features = [
"signature-display",
"alloc",
] }
sha3 = { version = "0.10.8", default-features = false }
indoc = { version = "2.0.5", default-features = false }
lazy_static = { version = "1.4.0", default-features = false, features = [
"spin_no_std",
] }
nom = { version = "7", default-features = false }
sha2 = { version = "0.10.7", features = ["compress"], default-features = false }
generic-array = { version = ">=0.14.0, <=0.14.7", default-features = false }
keccak = { version = "0.1.2", default-features = false }
hashbrown = { version = "0.15.2", features = ["serde"] }
anyhow = { version = "1.0.94", default-features = false }
thiserror = { version = "2", default-features = false }
num-bigint = { version = "0.4", features = ["serde", "rand"] }
rand = { version = "0.8.5", features = ["small_rng"] }
num-traits = { version = "0.2" }
num-integer = { version = "0.1.45" }
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0", features = ["arbitrary_precision"] }
hex = { version = "0.4.3" }
starknet-crypto = { version = "0.8.0", features = ["signature-display"] }
sha3 = { version = "0.10.8" }
indoc = { version = "2.0.5" }
lazy_static = { version = "1.4.0" }
nom = { version = "7" }
sha2 = { version = "0.10.7", features = ["compress"] }
generic-array = { version = ">=0.14.0, <=0.14.7" }
keccak = { version = "0.1.2" }
anyhow = { version = "1.0.94" }
thiserror = { version = "2" }

bitvec = { version = "1", default-features = false, features = ["alloc"] }
bitvec = { version = "1" }

# Dependencies for cairo-1-hints feature
cairo-lang-casm = { version = "2.12.0-dev.0", default-features = false }
cairo-lang-casm = { version = "2.12.0-dev.0" }

cairo-lang-starknet-classes = { version = "2.12.0-dev.0", default-features = false }
cairo-lang-compiler = { version = "=2.12.0-dev.0", default-features = false }
cairo-lang-sierra-to-casm = { version = "2.12.0-dev.0", default-features = false }
cairo-lang-sierra = { version = "2.12.0-dev.0", default-features = false }
cairo-lang-runner = { version = "2.12.0-dev.0", default-features = false }
cairo-lang-utils = { version = "=2.12.0-dev.0", default-features = false }
cairo-lang-starknet-classes = { version = "2.12.0-dev.0" }
cairo-lang-compiler = { version = "=2.12.0-dev.0" }
cairo-lang-sierra-to-casm = { version = "2.12.0-dev.0" }
cairo-lang-sierra = { version = "2.12.0-dev.0" }
cairo-lang-runner = { version = "2.12.0-dev.0" }
cairo-lang-utils = { version = "=2.12.0-dev.0" }

# TODO: check these dependencies for wasm compatibility
ark-ff = { version = "0.4.2", default-features = false }
ark-std = { version = "0.4.0", default-features = false }
ark-ff = { version = "0.4.2" }
ark-std = { version = "0.4.0" }

# For fuzzing
arbitrary = { version = "1.3.0", features = ["derive"] }
Expand Down
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,6 @@ endif

test: cairo_proof_programs cairo_test_programs cairo_1_test_contracts cairo_2_test_contracts cairo_1_program
$(TEST_COMMAND) --workspace --features "test_utils, cairo-1-hints"
test-no_std: cairo_proof_programs cairo_test_programs cairo_1_program
$(TEST_COMMAND) --workspace --features test_utils --no-default-features
test-wasm: cairo_proof_programs cairo_test_programs cairo_1_program
# NOTE: release mode is needed to avoid "too many locals" error
wasm-pack test --release --node vm --no-default-features
Expand Down
4 changes: 2 additions & 2 deletions cairo-vm-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ readme.workspace = true
keywords.workspace = true

[dependencies]
cairo-vm = { workspace = true, features = ["std", "clap"] }
cairo-vm = { workspace = true, features = ["clap"] }
cairo-vm-tracer = { workspace = true, optional = true }
clap = { version = "4.3.10", features = ["derive"] }
mimalloc = { version = "0.1.37", default-features = false, optional = true }
thiserror = { workspace = true, features = ["std"]}
thiserror = { workspace = true }

[dev-dependencies]
assert_matches = "1.5.0"
Expand Down
7 changes: 1 addition & 6 deletions cairo-vm-tracer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,9 @@ license.workspace = true
repository.workspace = true
readme.workspace = true

[features]
default = ["std"]
std = []
alloc = []

[dependencies]
cairo-vm = { workspace = true, features = ["test_utils"] }
thiserror = { workspace = true, features = ["std"] }
thiserror = { workspace = true }
num-bigint = { workspace = true }
num-traits = { workspace = true }
axum = "0.6.18"
Expand Down
5 changes: 1 addition & 4 deletions cairo1-run/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,15 @@ cairo-lang-utils.workspace = true
cairo-lang-casm.workspace = true
itertools = "0.11.0"
clap = { version = "4.3.10", features = ["derive"] }
thiserror = { workspace = true, features = ["std"] }
thiserror = { workspace = true }
assert_matches = "1.5.0"
rstest = "0.17.0"
num-traits = { version = "0.2", default-features = false }
num-bigint.workspace = true

[features]
default = ["std"]
mod_builtin = ["cairo-vm/mod_builtin"]
std = ["cairo-vm/std"]

[[bin]]
name = "cairo1-run"
path = "./src/main.rs"
required-features = ["std"]
3 changes: 2 additions & 1 deletion cairo1-run/src/cairo_run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@ use cairo_lang_sierra_type_size::get_type_size_map;
use cairo_lang_utils::{
bigint::BigIntAsHex, casts::IntoOrPanic, unordered_hash_map::UnorderedHashMap,
};
use std::{collections::HashMap, iter::Peekable};

use cairo_vm::{
hint_processor::cairo_1_hint_processor::hint_processor::Cairo1HintProcessor,
math_utils::signed_felt,
serde::deserialize_program::{ApTracking, FlowTrackingData, HintParams, ReferenceManager},
stdlib::{collections::HashMap, iter::Peekable},
types::{
builtin_name::BuiltinName, layout::CairoLayoutParams, layout_name::LayoutName,
program::Program, relocatable::MaybeRelocatable,
Expand Down
Loading
Loading