lightninglabs / lightninglabs/lightning-node-connect

build: investigate shrinking WASM blob size using tiny-go

Open
#33 7 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

optimization wasm
Dominant language
Go
Stars
85
Forks
22
PR merge metrics
No merged PRs in 30d

Description

Was brought up in this twitter thread: https://twitter.com/roasbeef/status/1486422025816064000

[TinyGo](https://tinygo.org/getting-started/overview/) is an alternate Go compiler that is intended for embedded systems, and support compiling to a [WASM target](https://tinygo.org/docs/guides/webassembly/): https://tinygo.org/docs/reference/usage/subcommands/#build.

Their overview page demonstrators shrinking a binary size by 99% just by instead compiling using the Tiny Go compiler. Certain [Go language features aren't fully supported](https://tinygo.org/docs/reference/lang-support/), so we may need to add some additional build tag layers to make it possible. So far, someone has identified that we'll need to [build tag out the `pprof` import at the very least](https://twitter.com/kiwiidb/status/1492520329352298503?s=20&t=veM7xo8h2ujc8VC_XkygVg).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the linked TinyGo WebAssembly guide and language-support list first, then inspect the repository's existing WASM build entry point. Check whether the build can use TinyGo, identify the required build-tag handling for the pprof import, and verify that the resulting WASM blob is smaller and still builds successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, wasm
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.