Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Exclude runtime code from (at least wasm) light client bundle #5123

Closed
svyatonik opened this issue Mar 3, 2020 · 2 comments
Closed

Exclude runtime code from (at least wasm) light client bundle #5123

svyatonik opened this issue Mar 3, 2020 · 2 comments
Labels
I8-footprint An enhancement to provide a smaller (system load, memory, network or disk) footprint.
Milestone

Comments

@svyatonik
Copy link
Contributor

Original problem description by @amaurymartiny: "the wasm light client has not 1 but 2 runtimes bundled in it: one in wasm and one in native (which is also wasm in our case)"

So the idea we have is to exclude both runtimes from (at least wasm) light client compilation. We have agreed that runtime code should still be included as storage entry in ChainSpec/GenesisConfig (we still need genesis runtime code for consensus modules initialization).

The main problem is that we need something similar to RuntimeApi, in order to compile Client (and its own clients - RPCs, consensus modules, ...). And RuntimeApi is provided by runtime, which we want to exclude from compilation. The simplest option is to generate that struct at the native node side, but then we need to sync apis that are implemented every time we add/remove something from runtime, which is unacceptable The other solution could be 3rd compilation mode for runtime (in addition to wasm and native) - light-native, which will only expose RuntimeApi implementation (that is something I've originally suggested in #3875 ).

@svyatonik svyatonik added the I8-footprint An enhancement to provide a smaller (system load, memory, network or disk) footprint. label Mar 3, 2020
@svyatonik svyatonik added this to the Ideas milestone Mar 3, 2020
@bkchr
Copy link
Member

bkchr commented Mar 3, 2020

which will only expose RuntimeApi implementation (that is something I've originally suggested in #3875 )

This sounds like the best way IMHO. We could let the macros just generate the code that encodes the parameters and calls the appropriate function (which will be a remote call).

@EmmanuellNorbertTulbure

Is this still relevant @svyatonik ? Asking to know if I should migrate it or not.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
I8-footprint An enhancement to provide a smaller (system load, memory, network or disk) footprint.
Projects
None yet
Development

No branches or pull requests

3 participants