Skip to content

gnodev: Issues with PreLoading, Lazy Loading, Proxy Parsing and more #4533

@stefann-01

Description

@stefann-01

Setup Context

We are working on the Volos lending protocol using Gnoswap for price feed, so our development environment is the Gno monorepo with all the Gnoswap packages included.

Issues Encountered

1. Inconsistent package detection with wildcard paths (Skip this section as the latest commit somehow fixed the issue)

Some packages aren't detected for preloading when using wildcard paths like gno.land/r/gnoswap/**. For example, while most subpackages load correctly, gno.land/r/gnoswap/v1/position and gno.land/r/gnoswap/v1/test_tokens/** must be explicitly included for them to be recognized for preloading.

So command for properly preloading all the Gnoswap packages would look like

gnodev -paths "gno.land/r/gnoswap/**,gno.land/r/gnoswap/v1/position,gno.land/r/gnoswap/v1/test_tokens/**"

2. Lazy loading causes timeouts

The lazy loader doesn’t always preload required packages in time. If a transaction depends on a larger package that hasn’t been loaded yet, the first call will fail due to a timeout. A second attempt will succeed because the package gets loaded during the initial failed call. The error logs were very misleading, so it took me a while to figure out what was actually wrong.

Error log:

Data: unauthorized error
Msg Traces:
    0  /Users/stefann/GithubProjects/gno/tm2/pkg/errors/errors.go:28 - check transaction failed: log:--= Error =--
Data: std.UnauthorizedError{abciError:std.abciError{}}
Msg Traces:
    0  /Users/stefann/GithubProjects/gno/tm2/pkg/std/errors.go:72 - signature verification failed; verify correct account, sequence, and chain-id

3. Proxy misparses query function calls as package paths

The proxy incorrectly treating vm/qeval function calls as full package paths. For example, it tries to resolve gno.land/r/volos.GetPositionSupplyShares("gno.land/r/demo/wugnot as if it's a package path.

Query command:

gnokey query vm/qeval -remote $(GNOLAND_RPC_URL) -data "gno.land/r/volos.GetPositionSupplyShares(\"gno.land/r/demo/wugnot:gno.land/r/gnoswap/v1/test_token/bar:3000\", \"$(ADMIN)\")"

Logs:

Loader      ┃ W package not found resolver=root<gno>/root<examples> path="gno.land/r/volos.GetPositionSupplyShares(\"gno.land/r/demo/wugnot" took=12.916µs
Proxy       ┃ D unable to resolve path error="package not found" path="gno.land/r/volos.GetPositionSupplyShares(\"gno.land/r/demo/wugnot"
Proxy       ┃ D connection closed in=127.0.0.1:51863 out=127.0.0.1:51737
Proxy       ┃ D new connection remote=127.0.0.1:51865
Proxy       ┃ D parsed request paths paths="[gno.land/r/volos.GetPositionBorrowShares(\"gno.land/r/demo/wugnot]"

The errors don't affect functionality, all queries are properly executed.

4. Auth warning

I am not sure what this warning is about, but I get it for every transaction (given address is the one signing the transactions):

Proxy       ┃ D request handler warning error="unable to parse RPC request: unhandled: \"auth/accounts/g1tzl3sgre0c2zgxfpws9xhq0c069wf7zqh6aqqy\""

This also doesn't affect execution.

5. Incorrect Gnoweb URL

When using -paths "gno.land/**", the Gnoweb port at http://localhost:8888 incorrectly points to http://gno.land/** instead of http://gno.land.

6. Suggestion: Wildcard support for preloading single packages

Currently, using /* or /** doesn't work for single packages, you have to omit them entirely. It would be much more convenient if /* or /** also worked for single-package folders, so you don't have to think about whether a folder is a package itself or just a parent folder for multiple packages.

cc @gfanton

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions