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: catch infite loops without condition and body #3650

Closed
wants to merge 1 commit into from

Conversation

petar-dambovaliev
Copy link
Contributor

closes 3612

@github-actions github-actions bot added the 📦 🤖 gnovm Issues or PRs gnovm related label Jan 30, 2025
@Gno2D2
Copy link
Collaborator

Gno2D2 commented Jan 30, 2025

🛠 PR Checks Summary

All Automated Checks passed. ✅

Manual Checks (for Reviewers):
  • IGNORE the bot requirements for this PR (force green CI check)
Read More

🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers.

✅ Automated Checks (for Contributors):

No automated checks match this pull request.

☑️ Contributor Actions:
  1. Fix any issues flagged by automated checks.
  2. Follow the Contributor Checklist to ensure your PR is ready for review.
    • Add new tests, or document why they are unnecessary.
    • Provide clear examples/screenshots, if necessary.
    • Update documentation, if required.
    • Ensure no breaking changes, or include BREAKING CHANGE notes.
    • Link related issues/PRs, where applicable.
☑️ Reviewer Actions:
  1. Complete manual checks for the PR, including the guidelines and additional checks if applicable.
📚 Resources:
Debug
Manual Checks
**IGNORE** the bot requirements for this PR (force green CI check)

If

🟢 Condition met
└── 🟢 On every pull request

Can be checked by

  • Any user with comment edit permission

@petar-dambovaliev petar-dambovaliev changed the title catch infite loops without condition and body fix: catch infite loops without condition and body Jan 30, 2025
Copy link

codecov bot commented Jan 30, 2025

Codecov Report

Attention: Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
gnovm/pkg/gnolang/transcribe.go 33.33% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@odeke-em
Copy link
Contributor

Thanks for the fix @petar-dambovaliev! However, this PR doesn't fix the actual issue which is ensuring that the gas metering actually runs out, unless I am missing something?

Copy link
Member

@thehowl thehowl left a comment

Choose a reason for hiding this comment

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

we shouldn't reject infinite loops at the language level. if somebody wants to shoot themselves in the foot when using gno run, they should be able to do so. our gas system should catch this and prevent this on-chain.

@thehowl thehowl closed this Jan 31, 2025
@petar-dambovaliev
Copy link
Contributor Author

petar-dambovaliev commented Jan 31, 2025

@thehowl @odeke-em this targeted the special case, catching it during preprocessing since this specific case can't represent a useful gno program. I mentioned this during a core team meeting and no one objected so it might be better to ask other people to give their opinion too before closing it.

@thehowl
Copy link
Member

thehowl commented Jan 31, 2025

Apologies this seemed like a random close; my intent in closing PRs this way is that the approach needs a complete re-visit, and I see issues as a better venue for discussion in cases like these rather than PRs, which should be for work that is potentially imperfect, but in the right direction.

@petar-dambovaliev
Copy link
Contributor Author

petar-dambovaliev commented Jan 31, 2025

Apologies this seemed like a random close; my intent in closing PRs this way is that the approach needs a complete re-visit, and I see issues as a better venue for discussion in cases like these rather than PRs, which should be for work that is potentially imperfect, but in the right direction.

Agreed. In Any case, this is orthogonal to tweeks in the gas system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 🤖 gnovm Issues or PRs gnovm related
Projects
Development

Successfully merging this pull request may close these issues.

[GnoVM] Gas system doesn't catch infinite loops
4 participants