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

feat: use ethereum-cryptography for enr crypto #285

Merged
merged 2 commits into from
Jan 25, 2024

Conversation

wemeetagain
Copy link
Member

In order to make @chainsafe/enr more usable as a standalone library, we'd like to remove its heavy dependency bcrypto and replace it with something more suitable for cross-environment usage, ethereum-cryptography.

For @chainsafe/discv5, which already uses bcrypto, we can continue to use its enr crypto. This PR adds a side effect of switching enr crypto to use bcrypto when importing from @chainsfafe/discv5.

For users of @chainsafe/discv5 who would like to use ethereum-cryptography for enr crypto, you can always override the enr crypto like so:

import {setV4Crypto, defaultCrypto} from "@chainsafe/enr";

setV4Crypto(defaultCrypto)

By default, use ethereum-cryptography. Provide a more performant option
for nodejs in the discv5 package, see the discv5 README for details.
@wemeetagain wemeetagain requested a review from a team as a code owner January 24, 2024 19:29
Copy link
Member

@nflaig nflaig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@wemeetagain wemeetagain merged commit 50cee57 into master Jan 25, 2024
6 checks passed
@wemeetagain wemeetagain deleted the cayman/enr-noble-crypto branch January 25, 2024 14:27
This was referenced Jan 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

2 participants