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

Error while initializing the virtual machine: Instantiation: Couldn't resolve env:ext_trie_blake2_256_ordered_root_version_2 #1965

Closed
librelois opened this issue Jan 30, 2022 · 4 comments

Comments

@librelois
Copy link

librelois commented Jan 30, 2022

Hello,

I develop a standalone substrate chain, the repository here: https://git.duniter.org/nodes/rust/duniter-v2s

Our specific developments are runtime only, and we use BABE/GRANDPA for our consensus, so in theory smoldot should be a working client on our blockchain.

I just tested smoldot on a chain that I bootstrap locally and I have the following error:

$ npm start

> @duniter/duniter-v2s-light@0.0.1 start /home/elois/dev/duniter/duniter-v2s/light
> node index.js

JSON-RPC server now listening on port 9946
Please visit: https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9946

Error while adding chain: Error: Failed to build genesis chain information: Error while initializing the virtual machine: Instantiation: Couldn't resolve `env`:`ext_trie_blake2_256_ordered_root_version_2`
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @duniter/duniter-v2s-light@0.0.1 start: `node index.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @duniter/duniter-v2s-light@0.0.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/elois/.npm/_logs/2022-01-30T21_39_42_587Z-debug.log

I guess it's just the latest release of @substrate/smoldot-light which is not up to date with substrate (we use the monthly-2022-01 version of substrate).

But maybe it's a bug?

@librelois
Copy link
Author

I cloned and compiled smoldot on the main branch (commit bc5d27b), and I have exactly the same error.

@librelois
Copy link
Author

It seems that the problem comes from the fact that substrate has recently introduced a v2 of some host function and that it is not yet implemented in smoldot:

paritytech/substrate#9732

I reverted this PR on my substrate fork and bootstrapped a new currency, this time smoldot is able to load my runtime and connect to my substrate node in p2p, but as soon as I try to submit a transaction I get an error, I open another issue for that.

@tomaka
Copy link
Contributor

tomaka commented Jan 31, 2022

Thanks!

I wasn't aware that this Substrate PR had new host functions
Opened #1967 and #1968

@tomaka
Copy link
Contributor

tomaka commented Feb 11, 2022

Closing as fixed

@tomaka tomaka closed this as completed Feb 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants