Skip to content

Commit 32345a1

Browse files
committed
Remove feature mod_builtin
1 parent 9528e66 commit 32345a1

17 files changed

Lines changed: 38 additions & 152 deletions

File tree

.github/workflows/rust.yml

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ jobs:
294294
strategy:
295295
fail-fast: false
296296
matrix:
297-
special_features: ["", "extensive_hints", "mod_builtin", "cairo-0-secp-hints", "cairo-0-data-availability-hints"]
297+
special_features: ["", "extensive_hints", "cairo-0-secp-hints", "cairo-0-data-availability-hints"]
298298
target: [ test#1, test#2, test#3, test#4 ]
299299
name: Run tests
300300
runs-on: ubuntu-24.04
@@ -542,30 +542,6 @@ jobs:
542542
path: lcov-test#4-extensive_hints.info
543543
key: codecov-cache-test#4-extensive_hints-${{ github.sha }}
544544
fail-on-cache-miss: true
545-
- name: Fetch results for tests with stdlib (w/mod_builtin; part. 1)
546-
uses: actions/cache/restore@v3
547-
with:
548-
path: lcov-test#1-mod_builtin.info
549-
key: codecov-cache-test#1-mod_builtin-${{ github.sha }}
550-
fail-on-cache-miss: true
551-
- name: Fetch results for tests with stdlib (w/mod_builtin; part. 2)
552-
uses: actions/cache/restore@v3
553-
with:
554-
path: lcov-test#2-mod_builtin.info
555-
key: codecov-cache-test#2-mod_builtin-${{ github.sha }}
556-
fail-on-cache-miss: true
557-
- name: Fetch results for tests with stdlib (w/mod_builtin; part. 3)
558-
uses: actions/cache/restore@v3
559-
with:
560-
path: lcov-test#3-mod_builtin.info
561-
key: codecov-cache-test#3-mod_builtin-${{ github.sha }}
562-
fail-on-cache-miss: true
563-
- name: Fetch results for tests with stdlib (w/mod_builtin; part. 4)
564-
uses: actions/cache/restore@v3
565-
with:
566-
path: lcov-test#4-mod_builtin.info
567-
key: codecov-cache-test#4-mod_builtin-${{ github.sha }}
568-
fail-on-cache-miss: true
569545
- name: Fetch results for tests with stdlib (w/cairo-0-secp-hints; part. 1)
570546
uses: actions/cache/restore@v3
571547
with:

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,16 @@ Both branches support Stwo prover opcodes (Blake2s, QM31) since v2.0.0.
1111
---
1212

1313
#### Upcoming Changes
14+
* fix: remove feature mod_builtin [#2387](https://github.com/starkware-libs/cairo-vm/pull/2387)
15+
1416
* fix: decrease spamming logs level to trace [#2385](https://github.com/starkware-libs/cairo-vm/pull/2385)
1517

1618
* feat: add `test_helpers` module (`error_utils`, `test_utils`) with `assert_mr_eq`, `load_cairo_program!` macro and `expect_*` error checkers, behind `test_utils` feature flag [#2381](https://github.com/starkware-libs/cairo-vm/pull/2381)
1719

1820
* feat(makefile,ci): add `cairo_test_suite_programs` Makefile target and CI integration to compile Cairo test suite programs before running tests [#2380](https://github.com/starkware-libs/cairo-vm/pull/2380)
1921

2022
* Add Stwo cairo runner API [#2351](https://github.com/starkware-libs/cairo-vm/pull/2351)
23+
2124
* feat: make max traceback entries configurable [#2370](https://github.com/starkware-libs/cairo-vm/pull/2370)
2225

2326
* feat: create and use VirtualMachineConfig [#2369](https://github.com/starkware-libs/cairo-vm/pull/2369)

cairo-vm-cli/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,3 @@ rstest = "0.17.0"
2222
default = ["with_mimalloc"]
2323
with_mimalloc = ["dep:mimalloc"]
2424
with_tracer = ["cairo-vm/tracer", "cairo-vm-tracer"]
25-
mod_builtin = ["cairo-vm/mod_builtin"]

cairo1-run/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ rstest = "0.17.0"
2626
num-traits = { version = "0.2", default-features = false }
2727
num-bigint.workspace = true
2828

29-
[features]
30-
mod_builtin = ["cairo-vm/mod_builtin"]
31-
3229
[[bin]]
3330
name = "cairo1-run"
3431
path = "./src/main.rs"

cairo1-run/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
CAIRO_1_FOLDER=../cairo_programs/cairo-1-programs
44

55
$(CAIRO_1_FOLDER)/%.trace: $(CAIRO_1_FOLDER)/%.cairo
6-
cargo run --release -F mod_builtin $< --trace_file $@ --layout all_cairo
6+
cargo run --release $< --trace_file $@ --layout all_cairo
77

88
$(CAIRO_1_FOLDER)/%.memory: $(CAIRO_1_FOLDER)/%.cairo
9-
cargo run --release -F mod_builtin $< --memory_file $@ --layout all_cairo
9+
cargo run --release $< --memory_file $@ --layout all_cairo
1010

1111
CAIRO_1_PROGRAMS=$(wildcard ../cairo_programs/cairo-1-programs/*.cairo)
1212
TRACES:=$(patsubst $(CAIRO_1_FOLDER)/%.cairo, $(CAIRO_1_FOLDER)/%.trace, $(CAIRO_1_PROGRAMS))

cairo1-run/README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,6 @@ The cairo1-run cli supports the following optional arguments:
7171

7272
* `--append_return_values`: Adds extra instructions to the program in order to append the return and input values to the output builtin's segment. This is the default behaviour for proof_mode. Only allows `Array<felt252>` as return and input value.
7373

74-
## Running circuits
75-
76-
Circuits in cairo 1 require to enable the `mod_builtin` feature in order for the `AddMod`, `MulMod` and `RangeCheck96` builtins to be taken into account.
77-
7874
# Running scarb projects
7975

8076
As cairo1-run skips gas checks when running, you will need to add the following to your Scarb.toml to ensure that compilation is done without adding gas checks:

cairo1-run/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,13 +408,13 @@ mod tests {
408408
Some("[17 18]"),
409409
Some("[17 18]")
410410
)]
411-
#[cfg_attr(feature = "mod_builtin", case(
411+
#[case(
412412
"circuit.cairo",
413413
"36699840570117848377038274035 72042528776886984408017100026 54251667697617050795983757117 7",
414414
"[36699840570117848377038274035 72042528776886984408017100026 54251667697617050795983757117 7]",
415415
None,
416416
None
417-
))]
417+
)]
418418
#[case(
419419
"gas_builtin_loading.cairo",
420420
"939340725154356279478212603733403581890242362232206720294887278547043341575",

docs/onboarding.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ The `vm` crate has several feature flags that control compilation:
4141

4242
- `std` (default) — Standard library support. Disable for `no_std`/WASM targets.
4343
- `cairo-1-hints` — Enables the Cairo 1 hint processor. Pulls in `cairo-lang-casm` and ark dependencies.
44-
- `mod_builtin` — Enables the modular arithmetic builtin.
4544
- `cairo-0-secp-hints` — Enables secp256k1/secp256r1 hint implementations for Cairo 0.
4645
- `cairo-0-data-availability-hints` — Enables data availability-related hints for Cairo 0.
4746
- `extensive_hints` — Allows extending the hint set at runtime from within a hint.

vm/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ cairo-1-hints = [
1616
"dep:ark-std",
1717
]
1818
tracer = []
19-
mod_builtin = []
2019
cairo-0-secp-hints = []
2120
cairo-0-data-availability-hints = []
2221

vm/src/cairo_run.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -758,19 +758,17 @@ mod tests {
758758
}
759759

760760
fn stwo_allowed_builtins() -> Vec<BuiltinName> {
761-
let mut allowed = vec![
761+
let allowed = vec![
762762
BuiltinName::output,
763763
BuiltinName::pedersen,
764764
BuiltinName::range_check,
765765
BuiltinName::bitwise,
766766
BuiltinName::ec_op,
767767
BuiltinName::poseidon,
768768
BuiltinName::range_check96,
769+
BuiltinName::add_mod,
770+
BuiltinName::mul_mod,
769771
];
770-
if cfg!(feature = "mod_builtin") {
771-
allowed.push(BuiltinName::add_mod);
772-
allowed.push(BuiltinName::mul_mod);
773-
}
774772
allowed
775773
}
776774

0 commit comments

Comments
 (0)