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

How is MaxCycles set for gno.land? #821

Closed
schollz opened this issue May 15, 2023 · 2 comments · Fixed by #828
Closed

How is MaxCycles set for gno.land? #821

schollz opened this issue May 15, 2023 · 2 comments · Fixed by #828
Labels
❓ question Questions about Gno

Comments

@schollz
Copy link
Contributor

schollz commented May 15, 2023

This is not a bug, but a question - I'm wondering how the MaxCycles gets set and why it is what it is. It looks like its set to 10M (https://github.com/gnolang/gno/blob/master/tm2/pkg/sdk/vm/keeper.go#L177), but what is the reasoning for that number?

Practically speaking, I am running into a CPU cycle overrun error by exceeding MaxCycles with a pretty simple realm (https://github.com/schollz/gno/tree/bytebeat-works) that generates audio. The realm works for 1 second of audio, but 2 seconds seems to exceed the maximum cycles. The idea for this realm was to make an audio-based nft where the contract itself generates the audio. If this is out-of-bounds of what is considered for Gno, that's okay.

@ajnavarro ajnavarro added the ❓ question Questions about Gno label May 15, 2023
@ajnavarro
Copy link
Contributor

@schollz I had been looking into it to make it configurable, and I saw that it is set on several code paths; when adding a package (I think that is not the one you are hitting) and when calling a public Gno function (https://github.com/gnolang/gno/blob/master/tm2/pkg/sdk/vm/keeper.go#L251). There is also a limit when evaluating ABCI queries.

I'll try to add a PR by adding a new config param to allow the change of that limit.

@schollz
Copy link
Contributor Author

schollz commented May 19, 2023

Thanks @ajnavarro , having it configurable seems good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
❓ question Questions about Gno
Projects
Development

Successfully merging a pull request may close this issue.

2 participants