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

feat: set MAX VM cycles from cli #828

Merged
merged 2 commits into from
Jun 5, 2023
Merged

feat: set MAX VM cycles from cli #828

merged 2 commits into from
Jun 5, 2023

Conversation

ajnavarro
Copy link
Contributor

@ajnavarro ajnavarro commented May 18, 2023

Description

Before this change, some VM operations like loading a package or calling a public realm method had a hardcoded limit of 10M max allowed cycles. With this change that limit can be modified.

Usage: gnoland --max-vm-cycles=0

It closes #821

Contributors Checklist

  • Added new tests, or not needed, or not feasible
  • Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory
  • Updated the official documentation or not needed
  • No breaking changes were made, or a BREAKING CHANGE: xxx message was included in the description
  • Added references to related issues and PRs
  • Provided any useful hints for running manual tests

@ajnavarro ajnavarro requested review from jaekwon, moul and a team as code owners May 18, 2023 11:27
@github-actions github-actions bot added 📦 🌐 tendermint v2 Issues or PRs tm2 related 📦 ⛰️ gno.land Issues or PRs gno.land package related labels May 18, 2023
@ajnavarro ajnavarro changed the title feat: set cpu cycles from cli feat: set MAX cpu cycles from cli May 18, 2023
@ajnavarro ajnavarro changed the title feat: set MAX cpu cycles from cli feat: set MAX VM cycles from cli May 18, 2023
Copy link
Member

@moul moul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @ajnavarro, I agree that we should make this editable. However, there are a few things to keep in mind:

  1. In the future, the value won't be dynamically determined by the node itself. Instead, it will be a variable derived from the genesis configuration. This variable can be updated through DAO votes in a new r/system/variables realm (Creating a r/sys/config realm for runtime configuration #1856). You can find more information about this in the following link: Include max memory size of GVM in genesis parameters? #761 (comment).
  2. Our goal is to simplify the configuration process by introducing variables that can be set in both config files and the command-line interface (CLI). This will eliminate the need for concurrent implementation of configuration. For more details, please refer to this pull request: feat(cli): add listen flag #729 (review). Additionally, you can explore issue CLI refactor #731 for further information.

Here's my suggestion for the next steps:

  1. Wait for the completion of the merge for both feat: add support for toml configuration files + recursive flag definitions for subcommands #827 and fix(cli): accept flags after command's arguments  #762 (which will likely happen today).
  2. Once those are merged, proceed by updating the commands package to automatically register flags for available configuration files. You can find more details in issue CLI refactor #731.
  3. Finally, add your new flag, but make sure to give it a name that reflects its purpose as the GenesisMaxVMCycle rather than just the MAX_VM_CYCLE.

@jaekwon
Copy link
Contributor

jaekwon commented Jun 2, 2023

reading now

Copy link
Contributor

@jaekwon jaekwon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pre-approving besides existing comments.

Before this change, some VM operations like loading a package or calling a public realm method had a hardcoded limit of 10M max allowed cycles. Whith this change that limit can be modified.

Signed-off-by: Antonio Navarro <[email protected]>
Signed-off-by: Antonio Navarro Perez <[email protected]>
@ajnavarro
Copy link
Contributor Author

@moul addressed all your comments!

@moul moul mentioned this pull request Jun 5, 2023
8 tasks
@moul moul merged commit a8675d3 into master Jun 5, 2023
@moul moul deleted the feat/set-max-cpu-cycles branch June 5, 2023 16:27
Doozers pushed a commit to Doozers/gno that referenced this pull request Aug 31, 2023
@jaekwon
Copy link
Contributor

jaekwon commented Mar 25, 2024

Thank you Antonio!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 🌐 tendermint v2 Issues or PRs tm2 related 📦 ⛰️ gno.land Issues or PRs gno.land package related
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

How is MaxCycles set for gno.land?
4 participants