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

fix!: yield uint8arraylists instead of concatenating buffers #391

Merged
merged 5 commits into from
Nov 29, 2023

Conversation

achingbrain
Copy link
Collaborator

@achingbrain achingbrain commented Nov 25, 2023

In order to avoid unnecessary buffer copies, update to the new libp2p connection encrypter API that lets connection encrypters consume/yield lists of buffers instead of requiring them to be concatenated before/after encryption/decryption.

Depends on:

Perf benchmarks are here.

Notably streaming throughput improves slightly (green & red on the graph):

image

BREAKING CHANGE: requires js-libp2p@1.0.0

In order to avoid unnecessary buffer copies, update to the new libp2p
connection encrypter API that lets connection encrypters consume/yield
lists of buffers instead of requiring them to be concatenated
before/after encryption/decryption.
@achingbrain achingbrain requested a review from a team as a code owner November 25, 2023 15:27
@achingbrain achingbrain marked this pull request as draft November 25, 2023 15:28
@achingbrain achingbrain changed the title fix!: use node.js crypto for x25519 keys fix!: yield uint8arraylists instead of concatenating buffers Nov 25, 2023
Refactors code to use the component logger from libp2p to allow more
flexible logging patterns.

Nb. adds a `NoiseComponents` interface separate from `NoiseInit` that
contains the `Metrics` instance - this is consistent with every other
libp2p module.

Refs: https://github.com/libp2p/js-libp2p/issue/2105
Refs: libp2p/js-libp2p#2198
Refs: https://github.com/libp2p/js-libp2p/issue/378
@achingbrain achingbrain marked this pull request as ready for review November 29, 2023 15:26
@wemeetagain wemeetagain merged commit ad25a5e into ChainSafe:master Nov 29, 2023
13 checks passed
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.

2 participants