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

dev/moul/sourceless closure #1271

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

Conversation

moul
Copy link
Member

@moul moul commented Oct 21, 2023

When using maketx run, a contract is "kinda" uploaded to r/g123456789/run, executed, and then deleted. In practice, the contract itself is never stored, but any imported realm that undergoes changes is saved at the end of the transaction.

The problem arises when we attempt to update another realm with a locally defined pointer or struct.

The GnoVM behaves differently when storing the typed value compared to the package path. The typed values belong to PkgPath=r/g123455/run, which cannot be lazily resolved in a subsequent transaction when someone attempts to call the imported package using that value (e.g., with a standard maketx call).

There are several potential solutions to consider:

  1. Preserve Contracts: Instead of deleting contracts, consider preserving them in a separate location, like r/g1234567/runX, to allow for later retrieval.
  2. State-Only Storage: Store only the state of r/g12344/run without retaining the source code.
  3. Error Handling: Raise an error each time an attempt is made to save an object created from these virtual packages, indicating that they cannot be stored.
  4. Stateless Contracts: Execute run contracts as if they were p/, enforcing stateless.
  5. Dummy Package: Implement a system modification by default, where a dummy package is created for each r/g123456/run. This dummy package can remain empty, allowing lazy imports to proceed without failure.

moul added 23 commits October 18, 2023 16:18
Signed-off-by: Manfred Touron <[email protected]>
Signed-off-by: moul <[email protected]>
Signed-off-by: moul <[email protected]>
Signed-off-by: moul <[email protected]>
Signed-off-by: moul <[email protected]>
Signed-off-by: moul <[email protected]>
Signed-off-by: moul <[email protected]>
Signed-off-by: moul <[email protected]>
Signed-off-by: moul <[email protected]>
Signed-off-by: moul <[email protected]>
Signed-off-by: moul <[email protected]>
Signed-off-by: moul <[email protected]>
Signed-off-by: moul <[email protected]>
Signed-off-by: moul <[email protected]>
Signed-off-by: moul <[email protected]>
Signed-off-by: moul <[email protected]>
@moul moul self-assigned this Oct 21, 2023
@github-actions github-actions bot added 📦 🌐 tendermint v2 Issues or PRs tm2 related 📦 ⛰️ gno.land Issues or PRs gno.land package related labels Oct 21, 2023
@codecov
Copy link

codecov bot commented Oct 21, 2023

Codecov Report

Attention: 106 lines in your changes are missing coverage. Please review.

Comparison is base (89428c5) 47.84% compared to head (c002d02) 47.70%.
Report is 9 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1271      +/-   ##
==========================================
- Coverage   47.84%   47.70%   -0.14%     
==========================================
  Files         369      371       +2     
  Lines       62764    62812      +48     
==========================================
- Hits        30028    29964      -64     
- Misses      30308    30410     +102     
- Partials     2428     2438      +10     
Files Coverage Δ
gno.land/pkg/sdk/vm/handler.go 0.00% <ø> (ø)
gno.land/pkg/sdk/vm/keeper.go 39.61% <ø> (-0.50%) ⬇️
gno.land/pkg/sdk/vm/msgs.go 37.28% <ø> (+0.62%) ⬆️
tm2/pkg/crypto/keys/client/maketx.go 0.00% <0.00%> (ø)
tm2/pkg/crypto/keys/client/run.go 0.00% <0.00%> (ø)

... and 17 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@moul moul added the 🐞 bug Something isn't working label Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working 📦 🌐 tendermint v2 Issues or PRs tm2 related 📦 ⛰️ gno.land Issues or PRs gno.land package related
Projects
Status: To triage
Status: 📥 Inbox
Status: 🚀 Needed for Launch
Development

Successfully merging this pull request may close these issues.

1 participant