Prepare light-client for multi-environment support #6486
Labels
prio-low
This is nice to have.
scope-devex
Issues for improving developer experience.
scope-light-clients
All issues regarding light client development.
Lodestar relies heavily on
nodejs
specifics (e.g.Buffer
or native modules). This allows to provide good performance for client artifacts (e.g.beacon-node
,validator
).The
light-client
package can be used independently in a number of alternative environment (e.g.browser
,ReactNative
). While such usage can be made to work it requires polyfilling and dark magic heavily tool dependent.According to my tests, here is the current support of
light-client
for a number of well-known bundlers/platforms:light-client
; doesn't supportnode:*
syntaxbls
)bls
Make sure we document supported platforms.
Different options should be pursued to improve this:
lodestar
libs inter-dependency (only rely on env safe libs)node
modules; follow principled patterns easing theirpolyfilling
when are mandatoryInter-packages dependencies
state-transition
cli
specific fromutils
node
specific fromlogger
(e.g. winston related)NodeJS modules
In general:
node20
, 1)events
with mitt or tseepIt makes it simpler for end users of no shim are required.
light-client
directly or indirectly depends on the following NodeJS modules:From
@chainsafe/blst
#6519From
bls-eth-wasm
From
@chainsafe/bls
From
eventsource
External dependencies
blst
(withwasm
port ofsupranational
); dropbls
dependency Improve implementation selection strategy bls#157Weight analysis
See bundlejs
Heavy packages
utils
The text was updated successfully, but these errors were encountered: