Skip to content

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 [email protected]

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 force-pushed the fix/yield-uint8arraylists branch from 6997e90 to bc7c158 Compare November 29, 2023 15:23
@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
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