-
Notifications
You must be signed in to change notification settings - Fork 393
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(gno.land): limit gas in simulate and query #3654
fix(gno.land): limit gas in simulate and query #3654
Conversation
🛠 PR Checks SummaryAll Automated Checks passed. ✅ Manual Checks (for Reviewers):
Read More🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers. ✅ Automated Checks (for Contributors):🟢 Maintainers must be able to edit this pull request (more info) ☑️ Contributor Actions:
☑️ Reviewer Actions:
📚 Resources:Debug
|
Codecov ReportAttention: Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great PR. Nice assortment of tests. Can confirm it prevents the following PoC from crashing the node when using gnokey maketx addpkg
, and simply runs out of gas when using gnokey maketx call
regardless of how much gas you provide:
package hello
func main() {
for {
}
println("hello world")
}
func Main() {
main()
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code changes are fine and ok to me. They fix the issue but also simplify and clarify the implementation of gasmeter and panic handling. Great!
I have some remarks (outside of this PR) while reviewing the whole codepath related to CPU and gas accounting:
- in gnovm
Machine
struct, we still have aMaxCycles
field which is redundant with gasmeter, but almost unused. It still generates some overhead at each opcode execution, we should get rid of it. - There are still places in gas management where overflow check are missing.
I'm preparing a PR to fix those, independently of this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks solid 💯
thanks folks! |
fixes #3612
fixes #3563