Discussion of go-libp2p file bloat, vendoring issues
Open
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 38
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
(Raw notes from discussion 8-Oct-2018 @lgierth @raulk @mgoelzer @Kubuxu @vyzo +add yourself)
History
- go-libp2p extracted from IPFS initially
- more can be extracted (the host, identify, tests)
- bitswap relies on go-libp2p package which pulls in everything
- raulk: godepth and
gx --depsor (gx --tree)
What about pulling interfaces out into an interfaces package?
- Arguments against: (1) just a huge bunch of work (2) interfaces will change a lot (Kuba, but Lars disagrees)
- Explanation of (2): we would have to update the hashes
- Raul: but this is weird in any language? will feel unfamiliar?
- Each set of repos (like all muxers) has a go mod dedicated to it
- Them implementers can pull in what they need
- Lars: ok, say I'm going to use only yamux, will it pull in all the other muxers?
- Kuba: no, bc a module is defined by a text file, so it would pull in only yamux
What about go modules?
- We're not dumping gx anytime soon
- gx could live on as a lock file, but go modules could be used to modularize the library
- go mod stable is 2 go versions away (~9 months from now)
Mono repo - would it help downstreams?
Could Ethereum Whisper exclude all non-dotgo files?
- Yes, because we are building with
go buildso compile process cannot pull in anything that is not a .go - Could also exclude all
*_test.go
Competing libraries on HN:
- (forget name) - a one-off p2p library with no upgradability, muxing
- need to convince community that the modularity we've created is worth the bloat
What about just having a go-libp2p-interface package?
Central location for how to use libp2p for different use case
- Problem: there is no central place that explains "what does libp2p provide for me?", "what repos do I need to pull in to get just {transport, identity provider}
What is eth's goal?
- Whisper v6
- Two versions:
- devp2p (default)
- libp2p (behind an experimenrtal flag)
- But just this tiny test option is forcing them to pull in 590 files!
Short-term actions we could take
- We don't want to force them to change how they do their build (ie, force them to remove non-.go files)
- Fix this: root go-libp2p package still has dependencies in there
- Going through dependencies are completely unusused
- Which ones are that use only a tiny fraction of a big library (could just copy the code)
- Putting interfaces into one place
- go modules - figure out how this would look with go modules
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the raw discussion in this issue and review the listed short-term actions around go-libp2p dependencies, interfaces, and Go modules. No files, tests, or entry points are named, and the work is not complete until the scope and acceptance criteria are decided.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- distributed-systems, networking
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 15/100