Out of gas limit error

Is there a way to remove the gas model from dfx so that this error doesn’t occur?

Client error (code 5): IC0501: Canister ic:AB974C92C70E22CAD2 ran out of gas limit 5368709120

@enzo @alexa.smith @hansl @claudio

(if tagging you guys annoys you, please let me know and ill stop doing so! just hoping to catch your awareness like that :slight_smile:)

2 Likes

There is def a way to configure the gas limit in the replica, but I’ve never tried to do that. @Prithvi or @Akhi, what do I put in my ic.toml to make this work? In any case, it definitely isn’t configurable via dfx, at least not right now. We need to add that. The only way to make it work right now would be to create a file called ic.toml in the current directory, and then run the replica independently of dfx (e.g. $HOME/.cahce/dfinity/versions/$DFX_VERSION/replica ic.toml). Though as I said, I don’t know the exact setting…

3 Likes

thanks, appreciate the answer. would be indeed very nice to have a flag for dfx! currently running while true loops leads to this error at some point it seems, which makes sense because ongoing computation consumes gas which obviously isnt unlimited in this case.

2 Likes

Those settings for the .toml were:
[scheduler]
# Maximum amount of gas execution of a single round can consume.
round_gas_max = 26843545600
# Maximum amount of gas execution of a single message can consume.
exec_gas = 5368709120

2 Likes

Dfx can now run a replica with flags for these too:
dfx replica --port 8000 --round-gas-limit 26843545600 --message-gas-limit 5368709120

This won’t serve candid or a front end by itself though. If you want that, add a web server and point it at the replica:
dfx bootstrap --providers http://127.0.0.1:8000/api

…which will listen on 8081 by default. So in a browser:
localhost:8081/candid?canisterId=ic:<canister_id>

2 Likes

good catch ori, did you find out how to set this to infinite?

1 Like

No setting I know of for that. Are you still hitting the ceiling?

yes, its a loop that runs infinitely

Yep, just wondering how quickly it hits it, if it’s too short to see any useful progress? (Presuming this is for the game of life?)

2 Likes

oh no, you can see enough progress!

2 Likes

Following up on this - it seems as if those flags for dfx replica are no longer supported or were renamed. No matter what I specify as gas limits, the error message (when it does eventually run out of gas) is always:

Sep 18 12:18:33.309 WARN s:fscpm-uiaaa-aaaaa-aaaap-yai/n:5wjwg-gteaa-aaaaa-aaaap-2ai/ic_http_handler/read Could not perform query on canister: IC0501: Canister 75hes-oqbaa-aaaaa-aaaaa-aaaaa-aaaaa-aaaaa-q ran out of gas limit 1000000000

So the gas limit seems to be fixed at 1000000000 - or the flags to configure it changed. :slight_smile:

Edit: Maybe to clarify - that’s mostly annoying as the gas limit seems to be exhausted after ~0.6s already, which feels a tad low.

With the release of 0.6.9 the issue I had above seems to be resolved, with the canister no longer running out of gas way too quickly. A simple endless loop runs for >30s before seemingly timing out - plenty time for anything. :+1:

3 Likes