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: testing discovery and dialing with nwaku integration #5940

Merged
merged 16 commits into from
Oct 15, 2024

Conversation

gabrielmer
Copy link

@gabrielmer gabrielmer commented Oct 14, 2024

Description

Testing DNS discovery and peer connections and disconnections when integrating nwaku.
I commented everything in api.go, api_test.go, message_publishing.go and a big part of nwaku.go. I propose to remove the comments incrementally while we implement and test new features with the nwaku integration.

Important changes:

  • commenting api.go, api_test.go, message_publishing.go and part of nwaku.go
  • changed C function definitions to static to avoid compilation error
  • added cGoWakuDialPeerById and cGoWakuDisconnectPeerById using newly added bindings
  • extended WakuConfig with more nwaku node configurations
  • changed cfg field in Waku to be of type *WakuConfig
  • added WakuDialPeerById and DisconnectPeerById functions
  • adapting TestBasicWakuV2to use nwkaku's DNS discovery, dialing and disconnecting from peers and checking that it indeed works

How to test it

  1. compile libwaku in nwaku's chore-adding-libwaku-dial-and-disconnect-by-id branch to have the new libwaku's procs that are used
  2. In another terminal, run
IP_ADDRESS=$(hostname -I | awk '{print $1}');
docker run \
-p 61000:61000/tcp -p 8000:8000/udp -p 8646:8646/tcp harbor.status.im/wakuorg/nwaku:v0.33.0 \
--discv5-discovery=true --cluster-id=16 --log-level=DEBUG \
--nat=extip:${IP_ADDRESS} --discv5-udp-port=8000 --rest-address=0.0.0.0 --store --rest-port=8646 \
  1. Compile and execute TestBasicWakuV2 by running
go test -tags="use_nwaku,gowaku_no_rln" -run TestBasicWakuV2 ./wakuv2/... -count 1 -v -json | jq -r '.Output'

Closes waku-org/nwaku#3039

Copy link

Hey @gabrielmer, and thank you so much for making your first pull request in status-go! ❤️ Please help us make your experience better by filling out this brief questionnaire https://goo.gl/forms/uWqNcVpVz7OIopXg2

@status-im-auto
Copy link
Member

status-im-auto commented Oct 14, 2024

Jenkins Builds

Click to see older builds (30)
Commit #️⃣ Finished (UTC) Duration Platform Result
✖️ 0b5e20b #1 2024-10-14 07:27:40 ~1 min tests 📄log
0b5e20b #1 2024-10-14 07:27:43 ~1 min ios 📄log
✖️ 0b5e20b #1 2024-10-14 07:27:55 ~1 min tests-rpc 📄log
0b5e20b #1 2024-10-14 07:28:05 ~1 min android 📄log
0b5e20b #1 2024-10-14 07:28:13 ~1 min linux 📄log
d1f09c1 #2 2024-10-14 07:38:59 ~26 sec android 📄log
d1f09c1 #2 2024-10-14 07:39:07 ~31 sec linux 📄log
d1f09c1 #2 2024-10-14 07:39:19 ~44 sec ios 📄log
✖️ d1f09c1 #2 2024-10-14 07:39:24 ~43 sec tests 📄log
✖️ d1f09c1 #2 2024-10-14 07:39:40 ~1 min tests-rpc 📄log
4b9bee4 #3 2024-10-14 08:40:37 ~25 sec ios 📄log
4b9bee4 #3 2024-10-14 08:40:41 ~28 sec android 📄log
4b9bee4 #3 2024-10-14 08:40:47 ~31 sec linux 📄log
✖️ 4b9bee4 #3 2024-10-14 08:41:04 ~44 sec tests 📄log
✖️ 4b9bee4 #3 2024-10-14 08:41:18 ~1 min tests-rpc 📄log
cd41b13 #4 2024-10-14 08:42:44 ~23 sec ios 📄log
cd41b13 #4 2024-10-14 08:42:45 ~26 sec android 📄log
cd41b13 #4 2024-10-14 08:42:52 ~31 sec linux 📄log
✖️ cd41b13 #4 2024-10-14 08:43:10 ~43 sec tests 📄log
✖️ cd41b13 #4 2024-10-14 08:43:25 ~1 min tests-rpc 📄log
9373407 #5 2024-10-14 08:56:20 ~25 sec ios 📄log
9373407 #5 2024-10-14 08:56:21 ~27 sec android 📄log
9373407 #5 2024-10-14 08:56:28 ~31 sec linux 📄log
✖️ 9373407 #5 2024-10-14 08:56:54 ~53 sec tests 📄log
✖️ 9373407 #5 2024-10-14 08:57:01 ~1 min tests-rpc 📄log
524b566 #6 2024-10-15 11:13:57 ~28 sec android 📄log
524b566 #6 2024-10-15 11:14:05 ~33 sec ios 📄log
✖️ 524b566 #6 2024-10-15 11:14:34 ~59 sec tests 📄log
✖️ 524b566 #6 2024-10-15 11:14:51 ~1 min tests-rpc 📄log
524b566 #6 2024-10-15 11:15:00 ~1 min linux 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
37d7fd4 #7 2024-10-15 11:17:10 ~27 sec android 📄log
37d7fd4 #7 2024-10-15 11:17:19 ~31 sec linux 📄log
37d7fd4 #7 2024-10-15 11:17:28 ~44 sec ios 📄log
✖️ 37d7fd4 #7 2024-10-15 11:17:50 ~1 min tests 📄log
✖️ 37d7fd4 #7 2024-10-15 11:17:59 ~1 min tests-rpc 📄log
5ec9065 #8 2024-10-15 14:32:38 ~26 sec android 📄log
5ec9065 #8 2024-10-15 14:32:43 ~27 sec ios 📄log
5ec9065 #8 2024-10-15 14:32:47 ~31 sec linux 📄log
✖️ 5ec9065 #8 2024-10-15 14:33:13 ~53 sec tests 📄log
✖️ 5ec9065 #8 2024-10-15 14:33:35 ~1 min tests-rpc 📄log

@gabrielmer gabrielmer marked this pull request as ready for review October 14, 2024 09:14
@gabrielmer gabrielmer self-assigned this Oct 14, 2024
Copy link
Contributor

@Ivansete-status Ivansete-status left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for it! 💯
In all the commented code, shall we add the tag "TODO-nwaku", or sth like that, so that we can revisit all of them in the future?

@gabrielmer
Copy link
Author

LGTM! Thanks for it! 💯 In all the commented code, shall we add the tag "TODO-nwaku", or sth like that, so that we can revisit all of them in the future?

Ooh great idea! Just updated it and added "TODO-nwaku" to all the newly commented blocks :)

Thank you!

Copy link
Member

@richard-ramos richard-ramos left a comment

Choose a reason for hiding this comment

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

Overall LGTM. Just left a comment regarding the enrtree usage!

NodeKey: "11d0dcea28e86f81937a3bd1163473c7fbc0a0db54fd72914849bc47bdf78710",
EnableRelay: true,
LogLevel: "DEBUG",
DnsDiscoveryUrl: "enrtree://AMOJVZX4V6EXP7NTJPMAYJYST2QP6AJXYW76IU6VGJS7UVSNDYZG4@boot.prod.status.nodes.status.im",
Copy link
Member

Choose a reason for hiding this comment

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

This while it will work, it has the inconvenient of polluting the bootnodes with nodes that will only live when we run the tests (hence why the fake enr tree was being created)

Copy link
Author

Choose a reason for hiding this comment

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

Makes sense 100%! As we discussed, I created the following issue to track this improvement waku-org/nwaku#3119

Thanks so much!

wakuv2/nwaku_test.go Outdated Show resolved Hide resolved
@gabrielmer gabrielmer merged commit cf07232 into feature/nwaku-in-status Oct 15, 2024
0 of 5 checks passed
@gabrielmer gabrielmer deleted the chore-fixing-basic-test branch October 15, 2024 16:24
richard-ramos pushed a commit that referenced this pull request Oct 17, 2024
- some minor progress to add nwaku in status-go
- nwaku.go: GetNumConnectedPeers controls when passed pubsub is empty
- waku_test.go: adapt TestWakuV2Store
- add missing shard.go
- feat_: build nwaku with nix and use build tags to choose between go-waku and nwaku (#5896)
- chore_: update nwaku
- nwaku bump (#5911)
- bump: nwaku
- chore: add USE_NWAKU env flag
- fix: build libwaku only if needed
- feat: testing discovery and dialing with nwaku integration (#5940)
richard-ramos pushed a commit that referenced this pull request Oct 17, 2024
- some minor progress to add nwaku in status-go
- nwaku.go: GetNumConnectedPeers controls when passed pubsub is empty
- waku_test.go: adapt TestWakuV2Store
- add missing shard.go
- feat_: build nwaku with nix and use build tags to choose between go-waku and nwaku (#5896)
- chore_: update nwaku
- nwaku bump (#5911)
- bump: nwaku
- chore: add USE_NWAKU env flag
- fix: build libwaku only if needed
- feat: testing discovery and dialing with nwaku integration (#5940)
richard-ramos pushed a commit that referenced this pull request Oct 29, 2024
- some minor progress to add nwaku in status-go
- nwaku.go: GetNumConnectedPeers controls when passed pubsub is empty
- waku_test.go: adapt TestWakuV2Store
- add missing shard.go
- feat_: build nwaku with nix and use build tags to choose between go-waku and nwaku (#5896)
- chore_: update nwaku
- nwaku bump (#5911)
- bump: nwaku
- chore: add USE_NWAKU env flag
- fix: build libwaku only if needed
- feat: testing discovery and dialing with nwaku integration (#5940)
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.

4 participants