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

chore: Fix blst dep #162

Closed
wants to merge 1 commit into from
Closed

chore: Fix blst dep #162

wants to merge 1 commit into from

Conversation

acolytec3
Copy link

@chainsafe/blst is imported here but is listed as a devDependency in package.json so causes errors when @chainsafe/bls is imported by a consuming application.

@acolytec3 acolytec3 requested a review from a team as a code owner March 25, 2024 15:00
@CLAassistant
Copy link

CLAassistant commented Mar 25, 2024

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@jeluard
Copy link
Member

jeluard commented Mar 25, 2024

This is on purpose, blst is an optional dependency. To use it downstream you need to install it as a peer dependency. See https://github.com/ChainSafe/bls?tab=readme-ov-file#usage

@acolytec3
Copy link
Author

acolytec3 commented Mar 25, 2024

Hmm, ok, we aren't using BLS anywhere in our code but it's imported via @lodestar/light-client and our tests then fail because @chainsafe/blst isn't installed by default (since it's imported by a transitive dependency - @chainsafe/bls for us. Is the appropriate place to update this within @lodestar/light-client? Seems like it shouldn't be on a consumer of a downstream library to have to find an optional transitive dependency four layers deep in the stack.

@jeluard
Copy link
Member

jeluard commented Mar 25, 2024

I think it is in this case as the usage of blst is an optimization that works only depending on your target runtime (relies on native code). i.e. it wouldn't work if your project was targeting a browser runtime for instance.

The idea is that it should work as-in by relying on the wasm based implementation, just slower.

and our tests then fail because @chainsafe/blst isn't installed by default

This sounds weird, probably something to fix here. What framework do you use to run tests? I am assuming that you are using node?

@acolytec3
Copy link
Author

I think it is in this case as the usage of blst is an optimization that works only depending on your target runtime (relies on native code). i.e. it wouldn't work if your project was targeting a browser runtime for instance.

The idea is that it should work as-in by relying on the wasm based implementation, just slower.

and our tests then fail because @chainsafe/blst isn't installed by default

This sounds weird, probably something to fix here. What framework do you use to run tests? I am assuming that you are using node?

We're using vitest, running our tests in node. I'm going to open an issue on lodestar/light-client for now and just import it directly within Ultralight until the deps get ironed out on the lodestar side.

@g11tech
Copy link
Contributor

g11tech commented Mar 25, 2024

yes if the downstream lib doesn't use bls, then may be its not required

cc @wemeetagain @nflaig

@acolytec3
Copy link
Author

ChainSafe/lodestar#6589 Opened an issue on the lodestar repo for further discussion purposes. Can close here.

@acolytec3 acolytec3 closed this Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants