-
Notifications
You must be signed in to change notification settings - Fork 530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: Multiple division assignment failing #4836
Comments
This has nothing to do with the number of divisions happening in the code - this is all about the number of variables you define in the same scope - this division imposes a large AP-change, so you are bound by the number of such changes you perform. Do you have an actual real world example where you ran into it? |
In any case - even in generated code - i'd recommend against creating huge blocks of code especially if it creates thousands and thousands of variables that are all usable in the same scope. |
@orizi |
Hi Ori, I have these tests, #[test]
#[available_gas(5000000)]
fn mul() {
// Having both of these causes this error:
// #24531->#24532: Got 'Offset overflow' error while moving [62].
let a = fq6(34, 645, 20, 55, 140, 105);
let b = fq6(25, 45, 11, 43, 86, 101);
let c = fq6(9, 600, 31, 12, 54, 4);
// Having two of these cause the overflow error
let ab = a * b;
let bc = b * c;
// This line line after the two above causes
// Failed to cast from 63344.
assert(ab * c == a * bc, 'incorrect mul');
} I move ab and bc computation to separate scope without sharing any vars between them and it works with assert commented out. But of assert I need to share the previous result and I'm not able to avoid the error. |
i'm assuming |
Results in same error... |
can you add the same for your Mul::mul implementation? |
glad to help - i guess we need to track this and auto add this sort of thing. |
Bug Report
Cairo version:
v2.4.4
Current behavior:
When repeating the assignment
let value = 1 / 1;
255 times or more in the code, the following error is encountered:Error: #3585->#3586: Got 'Offset overflow' error while moving [3].
Expected behavior:
There should be no error or limit imposed on the number of times a division assignment can be executed in the code.
Steps to reproduce:
1
.src/gen.cairo
and uncomment line265
.Related code:
https://github.com/neotheprogramist/cairo-playground
Other information:
The issue does not occur when performing the operation in a loop, regardless the n
The text was updated successfully, but these errors were encountered: