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

EIP 4444 explorations #3196

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft

EIP 4444 explorations #3196

wants to merge 6 commits into from

Conversation

acolytec3
Copy link
Contributor

@acolytec3 acolytec3 commented Dec 14, 2023

Early explorations on an implementation of EIP-4444 following the ideas put forth in #3181

@acolytec3
Copy link
Contributor Author

Before I can proceed further with integrating ultralight within the client so we can serve ancient block history, we need to resolve the fundamental challenge that the client is CJS and ultralight is ESM and has a number of dependencies that are ESM only. I've done some research and haven't yet found a bundler that is able to rewrite ESM dependencies to CJS where the ESM dependency uses the export key (currently not rewriteable by esbuild or swc from what I can tell).
So, the current options I see are:

  1. Have the client start the Ultralight cli app in a child process and make RPC calls to it in order to access block history. Probably the "easiest" from a purely implementation perspective but it might add some undue complexity when troubleshooting issues.
  2. Rewrite the client and really the whole monorepo to use ESM only so we can easily import all the upstream ESM dependencies. This feels like a longer term correctly solution but debatable until if/when Node 20 or 22 entirely drops CJS support (which I don't think is currently on the table)
  3. Add some new build step (maybe using something like esbuild + a custom plugin that will convert upstream dependencies to CJS in a way the client can import them) - probably the hardest

@holgerd77
Copy link
Member

Thanks for the update and the good summary of potential paths forward! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants