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(gnovm): save object when refCount changed #2992

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

omarsy
Copy link
Member

@omarsy omarsy commented Oct 21, 2024

This PR a fix in the gnovm to ensure that objects are saved correctly when their reference count changes.

closes: #2266 #1543

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

@github-actions github-actions bot added 📦 🤖 gnovm Issues or PRs gnovm related 📦 ⛰️ gno.land Issues or PRs gno.land package related labels Oct 21, 2024
Copy link

codecov bot commented Oct 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@omarsy omarsy force-pushed the fix/2266 branch 2 times, most recently from ed24417 to 2368fed Compare October 27, 2024 12:44
@omarsy omarsy force-pushed the fix/2266 branch 2 times, most recently from d81df2c to ff7e012 Compare October 27, 2024 15:40
@omarsy omarsy marked this pull request as ready for review October 27, 2024 19:24
@notJoon notJoon added the review/triage-pending PRs opened by external contributors that are waiting for the 1st review label Oct 28, 2024
@jefft0
Copy link
Contributor

jefft0 commented Nov 19, 2024

Hello @omarsy . There is a merge conflict with master in gno.land/pkg/sdk/vm/gas_test.go . Can you resolve it?

Copy link
Contributor

@jefft0 jefft0 left a 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.

@jefft0 jefft0 removed the review/triage-pending PRs opened by external contributors that are waiting for the 1st review label Nov 20, 2024
@jefft0
Copy link
Contributor

jefft0 commented Nov 20, 2024

Removed the review/triage-pending label because jefft0 approved. Ready for core devs to review if the change is technically correct.

Copy link
Contributor

@ltzmaxwell ltzmaxwell left a comment

Choose a reason for hiding this comment

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

just start looking.

@@ -509,7 +512,7 @@ func (rlm *Realm) decRefDeletedDescendants(store Store, oo Object) {
if rc == 0 {
rlm.decRefDeletedDescendants(store, child)
} else if rc > 0 {
// do nothing
rlm.MarkDirty(child)
Copy link
Contributor

Choose a reason for hiding this comment

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

curious isn't it marked in previous phases?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, it isn't marked as dirty; we change the reference count, but it is never saved.

@Kouteki Kouteki added the in focus Core team is prioritizing this work label Nov 28, 2024
@Gno2D2
Copy link

Gno2D2 commented Nov 28, 2024

Merge Requirements

The following requirements must be fulfilled before a pull request can be merged.
Some requirement checks are automated and can be verified by the CI, while others need manual verification by a staff member.

These requirements are defined in this configuration file.

Automated Checks

🔴 Maintainers must be able to edit this pull request
🟢 The pull request head branch must be up-to-date with its base

Details
Maintainers must be able to edit this pull request

If

🟢 Condition met
└── 🟢 On every pull request

Then

🔴 Requirement not satisfied
└── 🔴 Maintainer can modify this pull request

The pull request head branch must be up-to-date with its base

If

🟢 Condition met
└── 🟢 On every pull request

Then

🟢 Requirement satisfied
└── 🟢 Head branch (TERITORI:fix/2266) is up to date with base (master): behind by 0 / ahead by 8

Manual Checks

  • The pull request description provides enough details
Details
The pull request description provides enough details

If

🟢 Condition met
└── 🟢 Not (🔴 Pull request author is a member of the team: core-contributors)

Can be checked by

  • team core-contributors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in focus Core team is prioritizing this work 📦 ⛰️ gno.land Issues or PRs gno.land package related 📦 🤖 gnovm Issues or PRs gnovm related 🧾 package/realm Tag used for new Realms or Packages.
Projects
Status: No status
Status: In Review
Development

Successfully merging this pull request may close these issues.

[gnovm/avl] Removing keys from AVL trees does not work
6 participants