AcalaNetwork / chopsticks

Create parallel reality of your Substrate network.
Apache License 2.0
138 stars 84 forks source link

Called `Result::unwrap()` on an `Err` value: VirtualMachine(... #691

Closed NachoPal closed 7 months ago

NachoPal commented 8 months ago

I am getting the following error when I try to deploy latest AssetHub Rococo runtime built from polkadot-sdk master.

panicked at src/task.rs:131:6:
called `Result::unwrap()` on an `Err` value: VirtualMachine(UnresolvedFunctionImport { function: "ext_storage_proof_size_storage_proof_size_version_1", module_name: "env" })

Stack:

Error
    at imports.wbg.__wbg_new_abda76e883ba8a5f (file:///Users/nacho/Desktop/PARITY/Repos/chopsticks/executor/dist/esm/chopsticks_executor.js:801:19)
    at wasm://wasm/00b1e282:wasm-function[1108]:0x191195
    at wasm://wasm/00b1e282:wasm-function[1334]:0x1997cf
    at wasm://wasm/00b1e282:wasm-function[1221]:0x1967ac
    at wasm://wasm/00b1e282:wasm-function[115]:0xb9075
    at wasm://wasm/00b1e282:wasm-function[632]:0x16b359
    at wasm://wasm/00b1e282:wasm-function[1476]:0x19aeb1
    at __wbg_adapter_48 (file:///Users/nacho/Desktop/PARITY/Repos/chopsticks/executor/dist/esm/chopsticks_executor.js:384:10)
    at real (file:///Users/nacho/Desktop/PARITY/Repos/chopsticks/executor/dist/esm/chopsticks_executor.js:366:22)
    at node:internal/process/task_queues:140:7

node:internal/event_target:1096
  process.nextTick(() => { throw err; });
                           ^
Error [RuntimeError]: unreachable
    at wasm://wasm/00b1e282:wasm-function[1108]:0x1912ab
    at wasm://wasm/00b1e282:wasm-function[1334]:0x1997cf
    at wasm://wasm/00b1e282:wasm-function[1221]:0x1967ac
    at wasm://wasm/00b1e282:wasm-function[115]:0xb9075
    at wasm://wasm/00b1e282:wasm-function[632]:0x16b359
    at wasm://wasm/00b1e282:wasm-function[1476]:0x19aeb1
    at __wbg_adapter_48 (file:///Users/nacho/Desktop/PARITY/Repos/chopsticks/executor/dist/esm/chopsticks_executor.js:384:10)
    at real (file:///Users/nacho/Desktop/PARITY/Repos/chopsticks/executor/dist/esm/chopsticks_executor.js:366:22)
    at node:internal/process/task_queues:140:7
    at AsyncResource.runInAsyncScope (node:async_hooks:206:9)

Chain-spec: ah-rococo-new.json

ermalkaleci commented 8 months ago

try with allow-unresolved-imports. seems like a new host function is added unrecognised by smoldot

NachoPal commented 8 months ago

You mean to add

allow-unresolved-imports: true

in the config.yaml, right?

Unfortunately that didn't work

ermalkaleci commented 8 months ago

Your runtime includes storage_proof_size::HostFunctions. Is this part of standard build?

ermalkaleci commented 8 months ago

@tomaka do we need to implement this on smoldot?

tomaka commented 8 months ago

In principle, no, smoldot doesn't really need a change, and allow_unresolved_functions: true should work. There was a lengthy discussion about this function, and in principle it is used only when parachain blocks are authored or verified by the relay chain. Maybe it would make sense to implement it in smoldot and return an error if the function is called.

ermalkaleci commented 8 months ago

return an error will not help. if allow_unresolved_functions: true didn't help then it's been called

ermalkaleci commented 7 months ago

westend-asset-hub is updated and now won't produce blocks because of this

ermalkaleci commented 7 months ago

https://github.com/smol-dot/smoldot/pull/1742