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

Some Native Functions Not Recognized During Node Startup #3361

Closed
stefann-01 opened this issue Dec 18, 2024 · 4 comments
Closed

Some Native Functions Not Recognized During Node Startup #3361

stefann-01 opened this issue Dec 18, 2024 · 4 comments
Labels
🐞 bug Something isn't working

Comments

@stefann-01
Copy link
Contributor

stefann-01 commented Dec 18, 2024

Native Function GetChainDomain Not Recognized During Node Startup

Description

When starting a local blockchain node using gnoland start, it fails to recognize the native implementation of GetChainDomain function in gnovm/stdlibs/std/native.gno.

I'm not sure if I am doing something completely wrong, but I remember successfully starting local node some time ago. I've been trying to solve this for a while and figured someone more experienced could take a look.

Your environment

  • Go version go1.23.2
  • OS and CPU architecture linux/amd64

Steps to reproduce

Run gnoland start

Expected behaviour

Node should start successfully.

Actual behaviour

Node fails to start with error:
panic: function GetChainDomain does not have a body but is not natively defined [recovered] panic: std/native.gno:14:1: function GetChainDomain does not have a body but is not natively defined

Logs

2024-12-18T02:38:05.491+0100    INFO    Starting localClient    {"module": "proxy", "module": "abci-client", "connection": "query", "impl": "localClient"}
2024-12-18T02:38:05.491+0100    INFO    Starting localClient    {"module": "proxy", "module": "abci-client", "connection": "mempool", "impl": "localClient"}
2024-12-18T02:38:05.491+0100    INFO    Starting localClient    {"module": "proxy", "module": "abci-client", "connection": "consensus", "impl": "localClient"}
2024-12-18T02:38:05.491+0100    INFO    Starting EventStoreService      {"module": "eventstore", "impl": "EventStoreService"}
2024-12-18T02:38:05.491+0100    INFO    ABCI Handshake App Info {"module": "consensus", "height": 0, "hash": "", "abci-version": "", "app-version": ""}
2024-12-18T02:38:05.491+0100    INFO    ABCI Replay Blocks      {"module": "consensus", "appHeight": 0, "storeHeight": 0, "stateHeight": 0}
2024-12-18T02:38:05.491+0100    DEBUG   InitChainer: started
panic: function GetChainDomain does not have a body but is not natively defined [recovered]
        panic: std/native.gno:14:1: function GetChainDomain does not have a body but is not natively defined

goroutine 1 [running]:
github.com/gnolang/gno/gnovm/pkg/gnolang.predefineNow.func1()
        /home/stefan/gno_workspace/gno/gnovm/pkg/gnolang/preprocess.go:3503 +0x45c
panic({0xf3bac0?, 0xc00bc524f0?})
        /usr/local/go/src/runtime/panic.go:785 +0x132
github.com/gnolang/gno/gnovm/pkg/gnolang.tryPredefine({0x13f7148, 0xc0003ac280}, {0x13f5fc0, 0xc00be5b508}, {0x13ea530, 0xc00f589008})
        /home/stefan/gno_workspace/gno/gnovm/pkg/gnolang/preprocess.go:3837 +0x1874
github.com/gnolang/gno/gnovm/pkg/gnolang.predefineNow2({0x13f7148, 0xc0003ac280}, {0x13f5fc0, 0xc00be5b508}, {0x13ea530, 0xc00f589008}, 0xc00638cf28)
        /home/stefan/gno_workspace/gno/gnovm/pkg/gnolang/preprocess.go:3530 +0x226
github.com/gnolang/gno/gnovm/pkg/gnolang.predefineNow({0x13f7148?, 0xc0003ac280?}, {0x13f5fc0?, 0xc00be5b508?}, {0x13ea530?, 0xc00f589008?})
        /home/stefan/gno_workspace/gno/gnovm/pkg/gnolang/preprocess.go:3508 +0xc5
github.com/gnolang/gno/gnovm/pkg/gnolang.PredefineFileSet({0x13f7148, 0xc0003ac280}, 0xc00be8ef08, 0xc00f58e1b0)
        /home/stefan/gno_workspace/gno/gnovm/pkg/gnolang/preprocess.go:90 +0xa76
github.com/gnolang/gno/gnovm/pkg/gnolang.(*Machine).runFileDecls(0xc00e05a6c8, {0xc00f5616c0, 0x8, 0x8})
        /home/stefan/gno_workspace/gno/gnovm/pkg/gnolang/machine.go:641 +0x275
github.com/gnolang/gno/gnovm/pkg/gnolang.(*Machine).RunFileDecls(...)
        /home/stefan/gno_workspace/gno/gnovm/pkg/gnolang/machine.go:607
github.com/gnolang/gno/gnovm/pkg/gnolang.(*Machine).runMemPackage(0xc00e05a6c8, 0xc00f2d1100, 0x1, 0x0)
        /home/stefan/gno_workspace/gno/gnovm/pkg/gnolang/machine.go:303 +0x239
github.com/gnolang/gno/gnovm/pkg/gnolang.(*Machine).RunMemPackage(...)
        /home/stefan/gno_workspace/gno/gnovm/pkg/gnolang/machine.go:269
github.com/gnolang/gno/gno.land/pkg/sdk/vm.loadStdlibPackage({0x110c1e9, 0x3}, {0xc000143b90?, 0x10f4a60?}, {0x13f7148, 0xc0003ac280})
        /home/stefan/gno_workspace/gno/gno.land/pkg/sdk/vm/keeper.go:194 +0x1fc
github.com/gnolang/gno/gno.land/pkg/sdk/vm.loadStdlib({0x13f7148, 0xc0003ac280}, {0xc000143b90, 0x2c})
        /home/stefan/gno_workspace/gno/gno.land/pkg/sdk/vm/keeper.go:171 +0x7f
github.com/gnolang/gno/gno.land/pkg/sdk/vm.(*VMKeeper).LoadStdlib(0x13da8a8?, {{0x13da8a8, 0xc0017f9440}, 0x2, {0x13d8f90, 0xc00181a9f0}, {0x13dac38, 0xc00181e2c0}, {0xc0003bc049, 0x3}, ...}, ...)
        /home/stefan/gno_workspace/gno/gno.land/pkg/sdk/vm/keeper.go:160 +0x8e
github.com/gnolang/gno/gno.land/pkg/gnoland.InitChainerConfig.loadStdlibs({0x128b1a0, {0xc000143b90, 0x2c}, 0x0, 0xc00040a000, {0x13e20f8, 0xc0000e2080}, {0x13dd3c0, 0xc0001943a8}, {0x13e0850, ...}}, ...)
        /home/stefan/gno_workspace/gno/gno.land/pkg/gnoland/app.go:276 +0x255
github.com/gnolang/gno/gno.land/pkg/gnoland.InitChainerConfig.InitChainer({0x128b1a0, {0xc000143b90, 0x2c}, 0x0, 0xc00040a000, {0x13e20f8, 0xc0000e2080}, {0x13dd3c0, 0xc0001943a8}, {0x13e0850, ...}}, ...)
        /home/stefan/gno_workspace/gno/gno.land/pkg/gnoland/app.go:240 +0x158
github.com/gnolang/gno/tm2/pkg/sdk.(*BaseApp).InitChain(_, {{}, {0x1f96e709, 0xedef41a83, 0x0}, {0xc0003bc049, 0x3}, 0xc00181a980, {0xc0017f8d80, 0x1, ...}, ...})
        /home/stefan/gno_workspace/gno/tm2/pkg/sdk/baseapp.go:339 +0x335
github.com/gnolang/gno/tm2/pkg/bft/abci/client.(*localClient).InitChainSync(_, {{}, {0x1f96e709, 0xedef41a83, 0x0}, {0xc0003bc049, 0x3}, 0xc00181a980, {0xc0017f8d80, 0x1, ...}, ...})
        /home/stefan/gno_workspace/gno/tm2/pkg/bft/abci/client/local_client.go:196 +0xfe
github.com/gnolang/gno/tm2/pkg/bft/appconn.(*consensus).InitChainSync(_, {{}, {0x1f96e709, 0xedef41a83, 0x0}, {0xc0003bc049, 0x3}, 0xc00181a980, {0xc0017f8d80, 0x1, ...}, ...})
        /home/stefan/gno_workspace/gno/tm2/pkg/bft/appconn/app_conn.go:66 +0xb7
github.com/gnolang/gno/tm2/pkg/bft/consensus.(*Handshaker).ReplayBlocks(_, {{0xc0017eed90, 0xb}, {0xc0017eedb0, 0xb}, {0x0, 0x0}, {0xc0017eedc0, 0x3}, 0x0, ...}, ...)
        /home/stefan/gno_workspace/gno/tm2/pkg/bft/consensus/replay.go:305 +0xd38
github.com/gnolang/gno/tm2/pkg/bft/consensus.(*Handshaker).Handshake(0xc00638f160, {0x13e8580, 0xc000067d40})
        /home/stefan/gno_workspace/gno/tm2/pkg/bft/consensus/replay.go:263 +0x4c8
github.com/gnolang/gno/tm2/pkg/bft/node.doHandshake({_, _}, {{0xc0017eed90, 0xb}, {0xc0017eedb0, 0xb}, {0x0, 0x0}, {0xc0017eedc0, 0x3}, ...}, ...)
        /home/stefan/gno_workspace/gno/tm2/pkg/bft/node/node.go:243 +0x1e5
github.com/gnolang/gno/tm2/pkg/bft/node.NewNode(0xc00040ad80, {0x13d85f0, 0xc0003ad040}, 0xc000119310, {0x7f7744f8aa58, 0xc000194510}, 0xc00027b9d8, 0x0?, {0x13e8300, 0xc0003a2a80}, ...)
        /home/stefan/gno_workspace/gno/tm2/pkg/bft/node/node.go:467 +0x3a7
github.com/gnolang/gno/tm2/pkg/bft/node.DefaultNewNode(0xc00040ad80, {0xc0003b5200, 0x31}, {0x13e8300, 0xc0003a2a80}, 0xc0001849b0)
        /home/stefan/gno_workspace/gno/tm2/pkg/bft/node/node.go:107 +0x3ed
main.execStart({0x13da758, 0x1bc2380}, 0xc000457220, {0x13eb890, 0xc0003b21e0})
        /home/stefan/gno_workspace/gno/gno.land/cmd/gnoland/start.go:237 +0xaee
main.newStartCmd.func1({0x13da758?, 0x1bc2380?}, {0x974280?, 0xc000020d80?, 0xc000197290?})
        /home/stefan/gno_workspace/gno/gno.land/cmd/gnoland/start.go:72 +0x29
github.com/gnolang/gno/tm2/pkg/commands.(*Command).Run(0x0?, {0x13da758?, 0x1bc2380?})
        /home/stefan/gno_workspace/gno/tm2/pkg/commands/command.go:255 +0x18e
github.com/gnolang/gno/tm2/pkg/commands.(*Command).Run(0xc0003d4c60?, {0x13da758?, 0x1bc2380?})
        /home/stefan/gno_workspace/gno/tm2/pkg/commands/command.go:259 +0x13a
github.com/gnolang/gno/tm2/pkg/commands.(*Command).ParseAndRun(0xc0003d4c60, {0x13da758, 0x1bc2380}, {0xc00011c030?, 0xc0003d4c60?, 0xc0003d4d10?})
        /home/stefan/gno_workspace/gno/tm2/pkg/commands/command.go:140 +0x49
github.com/gnolang/gno/tm2/pkg/commands.(*Command).Execute(0x13eb890?, {0x13da758?, 0x1bc2380?}, {0xc00011c030?, 0x1b1b0f8?, 0xc0000061c0?})
        /home/stefan/gno_workspace/gno/tm2/pkg/commands/command.go:117 +0x2c
main.main()
        /home/stefan/gno_workspace/gno/gno.land/cmd/gnoland/root.go:13 +0x5f```
@stefann-01 stefann-01 added the 🐞 bug Something isn't working label Dec 18, 2024
@stefann-01 stefann-01 changed the title Exported Native Functions Not Recognized During Node Startup Some Native Functions Not Recognized During Node Startup Dec 18, 2024
@leohhhn
Copy link
Contributor

leohhhn commented Dec 18, 2024

Are you sure you're on the latest version of master and have done a make install?

Also, you can do triple ` to do a codeblock.

@thehowl
Copy link
Member

thehowl commented Dec 18, 2024

Most definitely did not build after pulling, because master builds successfully and this would be caught by CI. Made #3363, as this has been a common gotcha before.

@thehowl thehowl closed this as not planned Won't fix, can't repro, duplicate, stale Dec 18, 2024
@stefann-01
Copy link
Contributor Author

I did build it multiple times using make install, checked if I have the latest version and also tried using gno generate from gnovm and issue still remains. Do you have anything else in mind that I could be doing wrong?

thehowl added a commit that referenced this issue Dec 18, 2024
@thehowl
Copy link
Member

thehowl commented Dec 18, 2024

If cd gno.land && make fclean start.gnoland works, then either (a) the binary you're calling is not the up-to-date one or (b) it's using a different GNOROOT.

omarsy pushed a commit to omarsy/gno that referenced this issue Dec 18, 2024
albttx pushed a commit that referenced this issue Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
Development

No branches or pull requests

3 participants