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

refactor: crypto and pnet #469

Merged
merged 14 commits into from
Nov 4, 2019
Merged

refactor: crypto and pnet #469

merged 14 commits into from
Nov 4, 2019

Conversation

jacobheun
Copy link
Contributor

  • Updates crypto usage to async/await
  • Implements the plaintext 2 protocol for testing
  • Updates pnet to use async/await

@jacobheun jacobheun changed the title [WIP] refactor: crypto and pnet refactor: crypto and pnet Nov 1, 2019
@jacobheun jacobheun marked this pull request as ready for review November 1, 2019 14:40
Copy link
Member

@vasco-santos vasco-santos left a comment

Choose a reason for hiding this comment

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

Looks good, just requesting minor changes here


libp2p = new Libp2p({
peerInfo,
modules: {
Copy link
Member

Choose a reason for hiding this comment

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

In the pubsub PR, I created an util with the base config for pubsub.

What do you think of creating in the root of tests, a util file with the base libp2p config (which would be used here), and in the tests for each component, we would have another utils file, which would get the base libp2p config from the root util and add the specific things for its needs?

Copy link
Member

Choose a reason for hiding this comment

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

Also, in specific tests, we can also use merge-options to overwrite what we want to.

Copy link
Member

@vasco-santos vasco-santos Nov 1, 2019

Choose a reason for hiding this comment

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

I created this on libp2p/js-libp2p#470

.travis.yml Show resolved Hide resolved
src/insecure/plaintext.js Outdated Show resolved Hide resolved
src/insecure/plaintext.js Outdated Show resolved Hide resolved
src/insecure/plaintext.js Outdated Show resolved Hide resolved
src/pnet/crypto.js Outdated Show resolved Hide resolved
src/pnet/crypto.js Outdated Show resolved Hide resolved
src/pnet/index.js Outdated Show resolved Hide resolved
let remoteAddr

before(async () => {
const [peerId, remotePeerId] = await Promise.all([
Copy link
Member

Choose a reason for hiding this comment

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

Should we have an util createPeerInfoFromFixtures? We could provide n and receive n PeerInfos. This is being replicated in a lot of tests

Copy link
Member

Choose a reason for hiding this comment

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

I created this on libp2p/js-libp2p#470

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, once we get through these next few merges I can go through and do some deduplication.

test/dialing/direct.node.js Outdated Show resolved Hide resolved
jacobheun and others added 2 commits November 4, 2019 12:39
Co-Authored-By: Vasco Santos <vasco.santos@moxy.studio>
Copy link
Contributor Author

@jacobheun jacobheun left a comment

Choose a reason for hiding this comment

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

All feedback should be fixed now.

.travis.yml Show resolved Hide resolved
let remoteAddr

before(async () => {
const [peerId, remotePeerId] = await Promise.all([
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, once we get through these next few merges I can go through and do some deduplication.

Copy link
Member

@vasco-santos vasco-santos left a comment

Choose a reason for hiding this comment

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

LGTM!

@jacobheun jacobheun merged commit fba0583 into refactor/async-await Nov 4, 2019
@jacobheun jacobheun deleted the refactor/crypto branch November 4, 2019 13:06
dirkmc pushed a commit that referenced this pull request Nov 26, 2019
* feat: add initial plaintext 2 module

* refactor: initial refactor of pnet

* chore: fix lint

* fix: update plaintext api usage

* test: use plaintext for test crypto

* chore: update deps

test: update dialer suite scope

* feat: add connection protection to the upgrader

* refactor: cleanup and lint fix

* chore: remove unncessary transforms

* chore: temporarily disable bundlesize

* chore: add missing dep

* fix: use it-handshake to prevent overreading

* chore(fix): PR feedback updates

* chore: apply suggestions from code review

Co-Authored-By: Vasco Santos <vasco.santos@moxy.studio>
dirkmc pushed a commit that referenced this pull request Nov 26, 2019
* feat: add initial plaintext 2 module

* refactor: initial refactor of pnet

* chore: fix lint

* fix: update plaintext api usage

* test: use plaintext for test crypto

* chore: update deps

test: update dialer suite scope

* feat: add connection protection to the upgrader

* refactor: cleanup and lint fix

* chore: remove unncessary transforms

* chore: temporarily disable bundlesize

* chore: add missing dep

* fix: use it-handshake to prevent overreading

* chore(fix): PR feedback updates

* chore: apply suggestions from code review

Co-Authored-By: Vasco Santos <vasco.santos@moxy.studio>
jacobheun added a commit that referenced this pull request Dec 12, 2019
* feat: add initial plaintext 2 module

* refactor: initial refactor of pnet

* chore: fix lint

* fix: update plaintext api usage

* test: use plaintext for test crypto

* chore: update deps

test: update dialer suite scope

* feat: add connection protection to the upgrader

* refactor: cleanup and lint fix

* chore: remove unncessary transforms

* chore: temporarily disable bundlesize

* chore: add missing dep

* fix: use it-handshake to prevent overreading

* chore(fix): PR feedback updates

* chore: apply suggestions from code review

Co-Authored-By: Vasco Santos <vasco.santos@moxy.studio>
jacobheun added a commit that referenced this pull request Jan 24, 2020
* feat: add initial plaintext 2 module

* refactor: initial refactor of pnet

* chore: fix lint

* fix: update plaintext api usage

* test: use plaintext for test crypto

* chore: update deps

test: update dialer suite scope

* feat: add connection protection to the upgrader

* refactor: cleanup and lint fix

* chore: remove unncessary transforms

* chore: temporarily disable bundlesize

* chore: add missing dep

* fix: use it-handshake to prevent overreading

* chore(fix): PR feedback updates

* chore: apply suggestions from code review

Co-Authored-By: Vasco Santos <vasco.santos@moxy.studio>
maschad pushed a commit to maschad/js-libp2p that referenced this pull request Jun 21, 2023
Updates the interface and symbol return type
maschad pushed a commit to maschad/js-libp2p that referenced this pull request Jun 21, 2023
## [9.1.4](libp2p/js-libp2p-kad-dht@v9.1.3...v9.1.4) (2023-05-04)

### Dependencies

* update @libp2p/interface-peer-discovery to 2.0.0 ([libp2p#469](libp2p/js-libp2p-kad-dht#469)) ([2c0fc68](libp2p/js-libp2p-kad-dht@2c0fc68))
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