ChainSafe / ChainSafe/lodestar

Reduce light-client dependency on api

Open
#6,542 0 comments 0 reactions 0 assignees View on GitHub
prio-low scope-devex scope-light-clients
Dominant language
TypeScript
Stars
1.4k
Forks
483
Avg merge
1d 16h
Merged PRs (30d)
150

Description

`api` is pretty big and depends indirectly on a number of NodeJS specifics (via `eventsource`).

Specific consideration regarding `EventSource`: it is about to be merged in node.

* https://github.com/nodejs/undici/pull/2608
* https://github.com/nodejs/node/pull/51575

`ligth-client` depends on `api` for the following API:

* `import {type Api, ApiError, routes} from "@lodestar/api";`
* `import {Api, ApiError} from "@lodestar/api";`
* `import {getClient} from "@lodestar/api";`

Figure out a way to ensure that those API do not drag the whole `api` package and it's dependencies.

Contributor guide

Open the contributing guide

Research direction

Start at the @lodestar/api imports used by light-client, especially Api, ApiError, routes, and getClient, and trace which dependencies bring in eventsource and Node.js specifics. Done means those imports no longer drag the whole api package and its dependencies into light-client, while preserving the listed API usage.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
backend-api-design, blockchain
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.