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: load packages lazily #3669

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft

feat: load packages lazily #3669

wants to merge 6 commits into from

Conversation

petar-dambovaliev
Copy link
Contributor

Closes 3564

@github-actions github-actions bot added the 📦 🤖 gnovm Issues or PRs gnovm related label Feb 3, 2025
@petar-dambovaliev petar-dambovaliev changed the title load packages lazily feat: load packages lazily Feb 3, 2025
@Gno2D2
Copy link
Collaborator

Gno2D2 commented Feb 3, 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

Copy link

codecov bot commented Feb 3, 2025

Codecov Report

Attention: Patch coverage is 0% with 28 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
gnovm/pkg/gnolang/machine.go 0.00% 28 Missing ⚠️

📢 Thoughts on this report? Let us know!

@github-actions github-actions bot added 🧾 package/realm Tag used for new Realms or Packages. 📦 🌐 tendermint v2 Issues or PRs tm2 related 📦 ⛰️ gno.land Issues or PRs gno.land package related labels Feb 4, 2025
@Gno2D2 Gno2D2 requested review from a team February 4, 2025 13:44
// Set up a PackageGetter that will do the actual preprocessing when needed
pkgGetter := func(pkgPath string, store Store) (*PackageNode, *PackageValue) {
// Get the original MemPackage
memPkg := store.GetMemPackage(pkgPath)
Copy link
Member

Choose a reason for hiding this comment

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

Just a quick note: the problem with this is that nodes which are restarted have a different set of packages in the cache compared to ones which have been running with a cache; consequently, loading a DB from the store needs to happen with a clean gas meter.

I would also suggest that the best solution is one that keeps packages in the store using a cache, so that the amount of packages kept in the store is actually bounded to a specific amount

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am thinking about alternative implementations because the one in the PR seems to have issues with persistence. I'll keep this in mind whether i continue with this or go in a different direction.

@petar-dambovaliev petar-dambovaliev marked this pull request as draft February 6, 2025 19:22
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 📦 🤖 gnovm Issues or PRs gnovm related 🧾 package/realm Tag used for new Realms or Packages.
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

Implement OAK-06
3 participants