Skip to content
Draft
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#### Upcoming Changes

* fix(breaking): Match constants by full path [#2192](https://github.com/lambdaclass/cairo-vm/pull/2192)

#### [2.5.0] - 2025-09-11

* breaking: Store constants in Hint Data [#2191](https://github.com/lambdaclass/cairo-vm/pull/2191)
Expand Down
41 changes: 41 additions & 0 deletions cairo_programs/constant_collision.cairo
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
%builtins range_check

from starkware.cairo.common.math import assert_le
from starkware.cairo.common.math import split_felt

func override_constants{range_check_ptr}() {
const MAX_HIGH = -1;
const MAX_LOW = -1;
return ();
}
func split_felt_ok{range_check_ptr}(value) -> (high: felt, low: felt) {
const MAX_HIGH = (-1) / 2 ** 128;
const MAX_LOW = 0;
let low = [range_check_ptr];
let high = [range_check_ptr + 1];
let range_check_ptr = range_check_ptr + 2;

%{
from starkware.cairo.common.math_utils import assert_integer
assert ids.MAX_HIGH < 2**128 and ids.MAX_LOW < 2**128
assert PRIME - 1 == ids.MAX_HIGH * 2**128 + ids.MAX_LOW
assert_integer(ids.value)
ids.low = ids.value & ((1 << 128) - 1)
ids.high = ids.value >> 128
%}

assert value = high * (2 ** 128) + low;
if (high == MAX_HIGH) {
assert_le(low, MAX_LOW);
} else {
assert_le(high, MAX_HIGH - 1);
}
return (high=high, low=low);
}

func main{range_check_ptr: felt}() {
let (m, n) = split_felt_ok(5784800237655953878877368326340059594760);
assert m = 17;
assert n = 8;
return ();
}
93 changes: 19 additions & 74 deletions fuzzer/Cargo.lock

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

4 changes: 3 additions & 1 deletion hint_accountant/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,12 @@ fn run() {
}
let mut vm = VirtualMachine::new(false, false);
let mut hint_executor = BuiltinHintProcessor::new_empty();
let (ap_tracking_data, reference_ids, references, mut exec_scopes) = (
let (ap_tracking_data, reference_ids, references, mut exec_scopes, accessible_scopes) = (
ApTracking::default(),
HashMap::new(),
Vec::new(),
ExecutionScopes::new(),
Vec::new(),
);
let missing_hints: HashSet<_> = whitelists
.into_iter()
Expand All @@ -69,6 +70,7 @@ fn run() {
&reference_ids,
&references,
Default::default(),
&accessible_scopes,
)
.expect("this implementation is infallible");
matches!(
Expand Down
Loading
Loading