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

Waku v2 Websocket support #732

Merged
merged 24 commits into from
Nov 2, 2021
Merged

Waku v2 Websocket support #732

merged 24 commits into from
Nov 2, 2021

Conversation

rshiv
Copy link
Contributor

@rshiv rshiv commented Oct 6, 2021

This PR introduces web socket transport to wakunode and subsequent unit tests.
Next iteration will introduce secure websocket capablities to the same.

Closes issue #756 and increment towards issue #434

The PR is ready to be merged

@rshiv rshiv requested a review from jm-clius October 6, 2021 17:44
@rshiv rshiv marked this pull request as draft October 6, 2021 17:44
@rshiv rshiv self-assigned this Oct 6, 2021
@rshiv rshiv linked an issue Oct 6, 2021 that may be closed by this pull request
5 tasks
@status-im-auto
Copy link
Collaborator

status-im-auto commented Oct 6, 2021

Jenkins Builds

Click to see older builds (73)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 0617712 #1 2021-10-06 18:06:24 ~22 min macos 📦bin
✔️ 0617712 #1 2021-10-06 18:09:30 ~25 min linux 📦bin
✔️ 0617712 #1 2021-10-06 18:28:43 ~44 min windows 📦exe
3dc37f4 #2 2021-10-15 12:24:50 ~3 min linux 📄log
3dc37f4 #2 2021-10-15 12:25:35 ~3 min macos 📄log
3dc37f4 #2 2021-10-15 12:31:30 ~9 min windows 📄log
41cb12d #3 2021-10-15 13:21:39 ~2 min linux 📄log
41cb12d #3 2021-10-15 13:23:17 ~3 min macos 📄log
41cb12d #3 2021-10-15 13:28:44 ~9 min windows 📄log
a92491d #4 2021-10-15 15:23:13 ~2 min linux 📄log
a92491d #4 2021-10-15 15:23:59 ~3 min macos 📄log
a92491d #4 2021-10-15 15:29:40 ~9 min windows 📄log
526e0ad #5 2021-10-17 21:57:46 ~2 min linux 📄log
526e0ad #5 2021-10-17 21:58:35 ~3 min macos 📄log
526e0ad #5 2021-10-17 22:04:07 ~8 min windows 📄log
73e4182 #6 2021-10-17 22:20:51 ~4 min macos 📄log
73e4182 #6 2021-10-17 22:20:53 ~4 min linux 📄log
73e4182 #6 2021-10-17 22:29:16 ~12 min windows 📄log
8b0112f #7 2021-10-20 11:36:22 ~10 min macos 📄log
8b0112f #7 2021-10-20 11:43:13 ~17 min linux 📄log
8b0112f #7 2021-10-20 12:01:23 ~35 min windows 📄log
262146d #8 2021-10-25 14:57:45 ~16 min linux 📄log
262146d #8 2021-10-25 14:58:38 ~17 min macos 📄log
262146d #8 2021-10-25 15:38:27 ~57 min windows 📄log
43fbae7 #9 2021-10-25 19:45:51 ~11 min macos 📄log
43fbae7 #9 2021-10-25 19:52:51 ~18 min linux 📄log
43fbae7 #9 2021-10-25 20:17:30 ~43 min windows 📄log
eee0f49 #10 2021-10-26 13:11:50 ~7 min macos 📄log
eee0f49 #10 2021-10-26 13:19:07 ~14 min linux 📄log
eee0f49 #10 2021-10-26 13:44:31 ~39 min windows 📄log
5e27f49 #11 2021-10-27 02:01:23 ~12 min macos 📄log
5e27f49 #11 2021-10-27 02:10:31 ~22 min linux 📄log
5e27f49 #11 2021-10-27 02:30:09 ~41 min windows 📄log
22905f0 #12 2021-10-27 11:11:31 ~1 min linux 📄log
✔️ 22905f0 #12 2021-10-27 11:22:39 ~13 min macos 📦bin
✔️ 22905f0 #12 2021-10-27 11:53:28 ~43 min windows 📦exe
✔️ 22905f0 #13 2021-10-27 12:31:37 ~23 min linux 📦bin
ca09340 #13 2021-10-27 14:48:29 ~13 min macos 📄log
ca09340 #14 2021-10-27 14:57:57 ~22 min linux 📄log
ca09340 #13 2021-10-27 15:34:41 ~59 min windows 📄log
9ec6d4e #15 2021-10-27 14:55:56 ~2 min linux 📄log
✔️ 9ec6d4e #14 2021-10-27 15:07:48 ~14 min macos 📦bin
✔️ 9ec6d4e #14 2021-10-27 15:46:19 ~52 min windows 📦exe
✔️ 92430da #15 2021-10-27 15:13:24 ~12 min macos 📦bin
✔️ 92430da #16 2021-10-27 15:19:59 ~19 min linux 📦bin
✔️ 92430da #15 2021-10-27 16:08:29 ~1 hr 7 min windows 📦exe
✔️ 99737ac #16 2021-10-28 13:48:09 ~12 min macos 📦bin
✔️ 99737ac #17 2021-10-28 13:56:51 ~21 min linux 📦bin
✔️ 99737ac #16 2021-10-28 14:18:55 ~43 min windows 📦exe
f541738 #19 2021-10-28 19:50:20 ~1 min linux 📄log
✔️ f541738 #18 2021-10-28 20:00:49 ~12 min macos 📦bin
✔️ f541738 #18 2021-10-28 20:30:13 ~41 min windows 📦exe
✔️ f541738 #20 2021-10-29 11:10:49 ~19 min linux 📦bin
✔️ 7b68b3c #17 2021-10-28 19:54:54 ~12 min macos 📦bin
✔️ 7b68b3c #18 2021-10-28 20:01:08 ~19 min linux 📦bin
✔️ 7b68b3c #17 2021-10-28 20:18:14 ~36 min windows 📦exe
e4df2aa #22 2021-11-01 13:20:51 ~2 min linux 📄log
✔️ e4df2aa #20 2021-11-01 13:30:50 ~12 min macos 📦bin
✔️ e4df2aa #19 2021-11-01 13:33:10 ~15 min macos 📦bin
✔️ e4df2aa #21 2021-11-01 13:37:09 ~19 min linux 📦bin
✔️ e4df2aa #19 2021-11-01 13:54:16 ~36 min windows 📦exe
✔️ e4df2aa #20 2021-11-01 13:55:29 ~37 min windows 📦exe
97063c5 #23 2021-11-01 14:38:55 ~2 min linux 📄log
97063c5 #21 2021-11-01 14:42:31 ~5 min macos 📄log
97063c5 #21 2021-11-01 15:08:49 ~32 min windows 📄log
d5e8aea #24 2021-11-01 14:43:43 ~2 min linux 📄log
d5e8aea #22 2021-11-01 14:47:02 ~5 min macos 📄log
d5e8aea #22 2021-11-01 15:28:05 ~46 min windows 📄log
335fe15 #23 2021-11-01 14:59:56 ~8 min macos 📄log
335fe15 #25 2021-11-01 15:03:50 ~12 min linux 📄log
335fe15 #26 2021-11-01 15:10:18 ~1 min linux 📄log
335fe15 #24 2021-11-01 15:12:33 ~2 min macos 📄log
335fe15 #23 2021-11-01 15:30:59 ~39 min windows 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 9758bf3 #25 2021-11-01 15:25:12 ~12 min macos 📦bin
✔️ 9758bf3 #27 2021-11-01 15:32:13 ~19 min linux 📦bin
✔️ 9758bf3 #24 2021-11-01 16:06:27 ~53 min windows 📦exe
✔️ c188e7a #26 2021-11-01 19:49:46 ~12 min macos 📦bin
✔️ c188e7a #28 2021-11-01 19:57:40 ~20 min linux 📦bin
✔️ c188e7a #25 2021-11-01 20:14:13 ~36 min windows 📦exe

@oskarth oskarth added this to Review/QA in Deprecated: nwaku Oct 6, 2021
Copy link
Contributor

@jm-clius jm-clius left a comment

Choose a reason for hiding this comment

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

Good to see an increment! I know this is just a Draft so you may have been planning to change things in any case, but I have made some comments FWIW.

waku/v2/node/wakunode2.nim Outdated Show resolved Hide resolved
waku/v2/node/wakunode2.nim Outdated Show resolved Hide resolved
waku/v2/node/wakunode2.nim Outdated Show resolved Hide resolved
waku/v2/node/wakunode2.nim Outdated Show resolved Hide resolved
@staheri14
Copy link
Contributor

Please let me know when the PR is ready for the review :) @rshiv
A minor comment, it is good to link the issue (which the PR is for) in the PR description

@oskarth
Copy link
Contributor

oskarth commented Oct 14, 2021

How is this going @rshiv? Would you mind updating PR description to explain current state and blocker? Feel free to include logs in here too with what is the current problem you are trying to figure out.

@rshiv rshiv changed the title wss transport support Waku v2 Websocket support Oct 15, 2021
@rshiv
Copy link
Contributor Author

rshiv commented Oct 15, 2021

How is this going @rshiv? Would you mind updating PR description to explain current state and blocker? Feel free to include logs in here too with what is the current problem you are trying to figure out.

The integration is successful I will update the PR to reflect the changes for web socket support, and later add wss transport support as those would need tls certificate to work.

@rshiv
Copy link
Contributor Author

rshiv commented Oct 15, 2021

Please let me know when the PR is ready for the review :) @rshiv A minor comment, it is good to link the issue (which the PR is for) in the PR description

sure.

Copy link
Contributor

@oskarth oskarth left a comment

Choose a reason for hiding this comment

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

I see this PR is in draft mode. It'd be good to communicate clearly what is working and what is still a WIP. For example, with excerpt of logs showing how it works and/or how it doesn't.

Also seems to miss tests. Useful tests would be to ensure ws switch works in isolation, and that it works when a node supports tcp and ws (for example).

waku/v2/node/config.nim Outdated Show resolved Hide resolved
waku/v2/node/wakunode2.nim Outdated Show resolved Hide resolved
@oskarth
Copy link
Contributor

oskarth commented Oct 18, 2021

later add wss transport support as those would need tls certificate to work.

We can do this in a separate PR once we basic capabilities done here

Copy link
Contributor

@D4nte D4nte left a comment

Choose a reason for hiding this comment

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

As discussed at the pm call I'd suggest to also have tests present to confirm that the ws connection is viable.
Not sure what is the best way to test this in nim. Happy to provide a mini-js script if needed.

waku/v2/node/config.nim Outdated Show resolved Hide resolved
waku/v2/node/config.nim Outdated Show resolved Hide resolved
waku/v2/node/wakunode2.nim Outdated Show resolved Hide resolved
@oskarth
Copy link
Contributor

oskarth commented Oct 25, 2021

Do you have some work in progress tests somewhere? Can't see any test commits.

@jm-clius
Copy link
Contributor

@rshiv, as you address individual comments, please mark them "resolved" and re-request a review from contributors that have reviewed before. While this is WIP/Draft it will be good to see progress on adding tests, etc. Also a good idea to keep your feature branch updated with master from time to time - otherwise a difficult rebase might await once the feature is done :)

@rshiv
Copy link
Contributor Author

rshiv commented Oct 25, 2021

Do you have some work in progress tests somewhere? Can't see any test commits.
I am debugging the existing tests which i suspect might be failing because of incorrect resource deallocation. Once fixed I will push the same.
New test only checks the connection of websocket multiaddress with the same, more test needs to be added.

Signed-off-by: rshiv <reeshav96@gmail.com>
Copy link
Contributor

@staheri14 staheri14 left a comment

Choose a reason for hiding this comment

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

Looks Nice!
I had a quick look and left some comments, will leave a more thorough review tomorrow

examples/v2/chat2.nim Outdated Show resolved Hide resolved
examples/v2/chat2.nim Outdated Show resolved Hide resolved
examples/v2/config_chat2.nim Outdated Show resolved Hide resolved
Copy link
Contributor

@jm-clius jm-clius left a comment

Choose a reason for hiding this comment

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

Thanks, @rshiv! Things seem to be taking shape. :) Some comments below. LMK what you think.

waku/v2/utils/peers.nim Outdated Show resolved Hide resolved
waku/v2/utils/peers.nim Outdated Show resolved Hide resolved
waku/v2/utils/peers.nim Outdated Show resolved Hide resolved
waku/v2/utils/peers.nim Outdated Show resolved Hide resolved
waku/v2/node/wakunode2.nim Outdated Show resolved Hide resolved
waku/v2/node/config.nim Outdated Show resolved Hide resolved
waku/v2/node/config.nim Outdated Show resolved Hide resolved
examples/v2/chat2.nim Outdated Show resolved Hide resolved
examples/v2/config_chat2.nim Outdated Show resolved Hide resolved
tests/v2/test_wakunode.nim Outdated Show resolved Hide resolved
waku/v2/utils/peers.nim Show resolved Hide resolved
examples/v2/chat2.nim Outdated Show resolved Hide resolved
examples/v2/chat2.nim Outdated Show resolved Hide resolved
examples/v2/chat2.nim Outdated Show resolved Hide resolved
examples/v2/config_chat2.nim Outdated Show resolved Hide resolved
waku/v2/node/wakunode2.nim Outdated Show resolved Hide resolved
waku/v2/node/wakunode2.nim Outdated Show resolved Hide resolved
waku/v2/node/wakunode2.nim Outdated Show resolved Hide resolved
waku/v2/utils/peers.nim Outdated Show resolved Hide resolved
Signed-off-by: rshiv <reeshav96@gmail.com>
Signed-off-by: rshiv <reeshav96@gmail.com>
Copy link
Contributor

@oskarth oskarth left a comment

Choose a reason for hiding this comment

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

Nice one! Definitely taking shaping :) Minor comments

tests/v2/test_wakunode.nim Show resolved Hide resolved
tests/v2/test_wakunode.nim Outdated Show resolved Hide resolved
tests/v2/test_wakunode.nim Outdated Show resolved Hide resolved
waku/v2/node/wakunode2.nim Outdated Show resolved Hide resolved
@oskarth oskarth removed the request for review from D4nte November 1, 2021 01:25
@jm-clius
Copy link
Contributor

jm-clius commented Nov 1, 2021

Forgot to add: please update CHANGELOG.md as well. Needed for release documentation.

rshiv and others added 2 commits November 1, 2021 13:17
Co-authored-by: oskarth <ot@oskarthoren.com>
Co-authored-by: oskarth <ot@oskarthoren.com>
waku/v2/utils/peers.nim Outdated Show resolved Hide resolved
Copy link
Contributor

@jm-clius jm-clius left a comment

Choose a reason for hiding this comment

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

I've added a couple more comments, and would like to see the CHANGELOG updated too, but think we're v close to merging. 👍

Signed-off-by: rshiv <reeshav96@gmail.com>
Signed-off-by: rshiv <reeshav96@gmail.com>
Signed-off-by: rshiv <reeshav96@gmail.com>
Signed-off-by: rshiv <reeshav96@gmail.com>
Copy link
Contributor

@oskarth oskarth left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@jm-clius jm-clius left a comment

Choose a reason for hiding this comment

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

This looks good! Let's get it merged. Make sure you squash all commits into a single commit based on master (Github's default "Squash and Merge" should work).

@rshiv rshiv merged commit d1e06fa into master Nov 2, 2021
Deprecated: nwaku automation moved this from Review/QA to Done Nov 2, 2021
@rshiv rshiv deleted the wss_switch_support branch November 2, 2021 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

Waku v2 Websocket support
6 participants