-
Notifications
You must be signed in to change notification settings - Fork 388
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(gnovm): save object when refCount changed #2992
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅ 📢 Thoughts on this report? Let us know! |
2dfe9bf
to
acf12f5
Compare
ed24417
to
2368fed
Compare
d81df2c
to
ff7e012
Compare
Hello @omarsy . There is a merge conflict with master in gno.land/pkg/sdk/vm/gas_test.go . Can you resolve it? |
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 main change is to one file gnovm/pkg/gnolang/realm.go . The rest of the changes are tests. All CI checks pass.
Removed the |
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.
just start looking.
🛠 PR Checks Summary🔴 Maintainers must be able to edit this pull request (more info) 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
|
@omarsy |
Done ^^ |
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.
LGTM, thank you!
gnovm/tests/files/zrealm17.gno
Outdated
|
||
var ( | ||
a = &A{A: "here"} | ||
a2 = &A{A: "here"} |
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.
nit: not used. and is this same with zrealm14?
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.
Nice catch ^^ . Don't know why I have this test. Maybe I used it for my local test
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.
what's going on here?
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.
It is caused by the change of the reference count of the time
package.
It occurs because the time.Time
struct is a field of the Board
object. When the Board
object is referenced, it indirectly causes the reference count of the time package to change, as the time.Time
struct is part of the Board
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.
mhhh, should package values be persisted like this? I don't think so?
In the very least, we shouldn't have a 15k line long file with the entire PackageValue of the time
package, but I'm thinking whether we need to add an exception to saving package values?
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.
Maybe we should avoid to log Block operation like this 7438f8a#diff-152fa445ed649a7f12eb067c6a67f7c6cb98c3242e23da200744b851aaeb3b20R522 ?
This PR a fix in the gnovm to ensure that objects are saved correctly when their reference count changes.
closes: #2266 #1543
Contributors' checklist...
BREAKING CHANGE: xxx
message was included in the description