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

Panic while compiling Moonbeam runtime #1152

Open
mfornos opened this issue Sep 13, 2023 · 7 comments
Open

Panic while compiling Moonbeam runtime #1152

mfornos opened this issue Sep 13, 2023 · 7 comments
Labels
blocked Progress on this issue requires something beyond our control

Comments

@mfornos
Copy link

mfornos commented Sep 13, 2023

We are trying to use the light client to connect to the Moonbeam network.

But it panics while compiling the runtime.

panicked at 'called `Result::unwrap()` on an `Err` value: InvalidRuntime(InvalidHeapPages(TooLarge))', /__w/smoldot/smoldot/light-base/src/json_rpc_service/background.rs:1282:14
file:///home/marc/Development/ocelloids/node_modules/smoldot/dist/mjs/instance/raw-instance.js:36
                throw new Error();
                      ^
Error
    at Object.onPanic (file:///home/marc/Development/ocelloids/node_modules/smoldot/dist/mjs/instance/raw-instance.js:36:23)
    at panic (file:///home/marc/Development/ocelloids/node_modules/smoldot/dist/mjs/instance/bindings-smoldot-light.js:52:20)
    at wasm://wasm/00fc8eb6:wasm-function[2764]:0xa0317
    at wasm://wasm/00fc8eb6:wasm-function[12523]:0x282f48
    at wasm://wasm/00fc8eb6:wasm-function[12513]:0x2823d5
    at wasm://wasm/00fc8eb6:wasm-function[12518]:0x282a47
    at wasm://wasm/00fc8eb6:wasm-function[12590]:0x2888ed
    at wasm://wasm/00fc8eb6:wasm-function[12621]:0x28ddce
    at wasm://wasm/00fc8eb6:wasm-function[1994]:0x83a4b
    at wasm://wasm/00fc8eb6:wasm-function[1497]:0x5492c

Context:

[smoldot] Chain initialization complete for polkadot. Name: "Polkadot". Genesis hash: 0x91b1…90c3. State root hash: 0x29d0d972cd27cbc511e9589fcb7a4506d5eb6a9e8df205f00472e5ab354a4e17. Network identity: 12D3KooWLvwb4xoELUUpFuohYGdEnZtdYuikJXKWA5mUyTtYiCCB. Chain specification or database starting at: 0xcbd8…793f (#16637440)
[smoldot] Parachain initialization complete for moonbeam. Name: "Moonbeam". Genesis hash: 0xfe58…b76d. State root hash: 0x74e54bafcf1ecdce51867078fa16f2902751d11473628ac19e89a5be20df3262. Network identity: 12D3KooWPnCpjre36yqeW9m151stms11FwnnTrCmjPCgMAMzAe8h. Relay chain: polkadot (id: 2004)
[sync-service-polkadot] GrandPa warp sync finished to #17272223 (0xdbf2…3f3b)
[runtime-polkadot] Finalized block runtime ready. Spec version: 9430. Size of `:code`: 1.4 MiB.
[runtime-moonbeam] Failed to compile runtime. Size of `:code`: 1.6 MiB.
Error: Failed to parse `:heappages` storage value: TooLarge
This indicates an incompatibility between smoldot and the chain.

It there anything that we can do to make it work with Moonbeam?

Thank you very much!

@tomaka
Copy link
Contributor

tomaka commented Sep 13, 2023

The value at the storage key :heappages (0x3a686561707061676573) for Moonbeam is 0xed5c416273747261 (queried through a JSON-RPC server).

@tomaka
Copy link
Contributor

tomaka commented Sep 13, 2023

cc paritytech/polkadot-sdk#71

@mfornos
Copy link
Author

mfornos commented Sep 13, 2023

Well... seemingly it is really set to "7021802807942536429" pages.
A "solution" could be to limit the max heap pages number to a reasonable one.
Maybe 65536 as in the fix of the linked issue?
I was checking other networks and didn't found other network specifying ':heappages' so 2048 is being used.

Btw, i'm not aware of the implications for smoldot and how the pages are actually allocated. Will take a look just out of curiosity :D

@tomaka
Copy link
Contributor

tomaka commented Sep 14, 2023

A "solution" could be to limit the max heap pages number to a reasonable one.
Maybe 65536 as in the fix of the linked issue?

Smoldot needs to match the behavior of Substrate.

As far as I understand, Moonbeam made some modifications to their fork of Substrate so that it ignores the number of heap pages. It's unclear to me why they don't fix the on-chain value instead.
If that's the case, then Moonbeam is incompatible with smoldot.

@tomaka
Copy link
Contributor

tomaka commented Sep 20, 2023

If you want to move this issue forward, please find someone from Moonbeam and ask them for an explanation about this.

@tomaka tomaka added the blocked Progress on this issue requires something beyond our control label Sep 25, 2023
@tomaka
Copy link
Contributor

tomaka commented Jan 11, 2024

The panic has been fixed in #1570

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Progress on this issue requires something beyond our control
Projects
None yet
Development

No branches or pull requests

3 participants