Skip to content
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

fix: casm runner args and gas #181

Merged
merged 1 commit into from
Dec 21, 2023
Merged

fix: casm runner args and gas #181

merged 1 commit into from
Dec 21, 2023

Conversation

shramee
Copy link
Owner

@shramee shramee commented Dec 20, 2023

fixes #177

@shramee shramee mentioned this pull request Dec 20, 2023
@shramee shramee requested a review from enitrat December 21, 2023 17:17
@swarajbachu
Copy link

interesting, just curious

why didnt it work before
according to change it seems like you didnt add any gas limit or as such

but please can you tell me why gas you had to put gas in that file and why were other files working except for a few

thank you

@enitrat
Copy link
Collaborator

enitrat commented Dec 21, 2023

and why were other files working except for a few

Basically, to avoid that a Cairo program runs indefinitely, you run it with a fixed amount of "gas" representing the amount of computation a program can consume. If your program doesn't contain loops, you don't need to give this amount of gas, as you can already ensure during compilation that your program terminates.

But if your program has loops, you can't be sure that it terminates. By providing a max gas, you make sure that if the program reaches that amount of gas consumed, it will stop.

@enitrat enitrat merged commit 3664b3a into main Dec 21, 2023
1 check passed
@swarajbachu
Copy link

and why were other files working except for a few

Basically, to avoid that a Cairo program runs indefinitely, you run it with a fixed amount of "gas" representing the amount of computation a program can consume. If your program doesn't contain loops, you don't need to give this amount of gas, as you can already ensure during compilation that your program terminates.

But if your program has loops, you can't be sure that it terminates. By providing a max gas, you make sure that if the program reaches that amount of gas consumed, it will stop.

thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enums 2 Exercise issue
3 participants