AcalaNetwork / chopsticks

Create parallel reality of your Substrate network.
Apache License 2.0
133 stars 80 forks source link

Is Kabocha simply too out of date to work with Chopsticks? #564

Closed JelliedOwl closed 9 months ago

JelliedOwl commented 10 months ago

Thank you for merging the Kabocha config file. Sadly, I'm getting an error when I try to use it and I'm not sure how / if I can fix it. Kabocha is currently at roughly the polkadot v0.9.28 level. Is it likely that I can get Chopsticks to work with this or am I wasting my (and everyone else's) time, please? I was hoping to use Chopsticks to help test a runtime update to get it close to the current standard.

When I try it I get this error. I would very much welcome suggestions about next steps please. I'm hoping that I just missed a step...

$ npx @acala-network/chopsticks@latest --config=configs/kabocha.yml
panicked at 'called `Result::unwrap()` on an `Err` value: RuntimeVersion(RuntimeVersionDecode)', src/task.rs:133:6

Stack:

Error
    at imports.wbg.__wbg_new_abda76e883ba8a5f (/Users/paul/.npm/_npx/81ad9c881cb83600/node_modules/@acala-network/chopsticks-executor/dist/cjs/chopsticks_executor.js:729:19)
    at wasm://wasm/009743be:wasm-function[728]:0x12aaea
    at wasm://wasm/009743be:wasm-function[886]:0x13420c
    at wasm://wasm/009743be:wasm-function[802]:0x12eaca
    at wasm://wasm/009743be:wasm-function[105]:0xa92ae
    at wasm://wasm/009743be:wasm-function[355]:0x10e846
    at wasm://wasm/009743be:wasm-function[937]:0x134a9e
    at __wbg_adapter_46 (/Users/paul/.npm/_npx/81ad9c881cb83600/node_modules/@acala-network/chopsticks-executor/dist/cjs/chopsticks_executor.js:407:10)
    at real (/Users/paul/.npm/_npx/81ad9c881cb83600/node_modules/@acala-network/chopsticks-executor/dist/cjs/chopsticks_executor.js:391:22)
    at node:internal/process/task_queues:140:7

node:internal/event_target:1054
  process.nextTick(() => { throw err; });
                           ^
Error [RuntimeError]: unreachable
    at wasm://wasm/009743be:wasm-function[728]:0x12ac13
    at wasm://wasm/009743be:wasm-function[886]:0x13420c
    at wasm://wasm/009743be:wasm-function[802]:0x12eaca
    at wasm://wasm/009743be:wasm-function[105]:0xa92ae
    at wasm://wasm/009743be:wasm-function[355]:0x10e846
    at wasm://wasm/009743be:wasm-function[937]:0x134a9e
    at __wbg_adapter_46 (/Users/paul/.npm/_npx/81ad9c881cb83600/node_modules/@acala-network/chopsticks-executor/dist/cjs/chopsticks_executor.js:407:10)
    at real (/Users/paul/.npm/_npx/81ad9c881cb83600/node_modules/@acala-network/chopsticks-executor/dist/cjs/chopsticks_executor.js:391:22)
    at node:internal/process/task_queues:140:7
    at AsyncResource.runInAsyncScope (node:async_hooks:206:9)
Emitted 'error' event on Worker instance at:
    at [kOnErrorMessage] (node:internal/worker:326:10)
    at [kOnMessage] (node:internal/worker:337:37)
    at MessagePort.<anonymous> (node:internal/worker:232:57)
    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:778:20)
    at exports.emitMessage (node:internal/per_context/messageport:23:28)

Node.js v20.5.0
ermalkaleci commented 10 months ago

Yes probably too old. Chopsticks uses smoldot to execute runtime and seems it can't decode runtime version from your runtime

JelliedOwl commented 10 months ago

Thanks Ermal. Presumably I can run chopsticks / smoldot from my git clone rather than using the deployed packages, and potentially do some debugging. If it's not too much of a noob question (and not too complex of an answer) is there an easy way for me to run that please? Sorry - my NodeJS experience is very limited, but if I can get it working in a debugger I might be able to hack it sufficiently for my current needs.

ermalkaleci commented 10 months ago

well. runtime version should be inside wasm. chopsticks uses smoldot to extract that information. I can create a brunch that get runtime version from api which can start chopsticks but you can't build any block with current wasm. you can try override-wasm and see if your new wasm works

ermalkaleci commented 10 months ago

@JelliedOwl https://github.com/AcalaNetwork/chopsticks/tree/runtime_from_api this is the branch with modification. give it a try install submodules

yarn install
yarn build-wasm
yarn start -c configs/kabocha.yml --wasm-override=<path>
JelliedOwl commented 10 months ago

Thank you very much, @ermalkaleci. I'll have a play and see if I can do something useful with that.