Skip to content

Conversation

igor-sirotin
Copy link
Collaborator

@igor-sirotin igor-sirotin commented Sep 18, 2025

Closes #6915

Attempted to implement a test here: #6943

@status-im-auto
Copy link
Member

status-im-auto commented Sep 18, 2025

Jenkins Builds

Click to see older builds (22)
Commit #️⃣ Finished (UTC) Duration Platform Result
✖️ 48edbdd #1 2025-09-18 11:25:10 ~1 min tests 📄log
✔️ 48edbdd #1 2025-09-18 11:26:54 ~3 min linux/status-go 📦zip
✔️ 48edbdd #1 2025-09-18 11:27:09 ~3 min macos/status-go 📦zip
✔️ 48edbdd #1 2025-09-18 11:29:12 ~5 min windows/status-go 📦zip
✔️ 48edbdd #1 2025-09-18 11:33:26 ~10 min linux/nwaku 📦zip
✖️ 48edbdd #1 2025-09-18 11:38:29 ~14 min tests-rpc 📄log
✖️ 77960c0 #2 2025-09-19 12:57:33 ~1 min tests 📄log
✔️ 77960c0 #2 2025-09-19 12:59:25 ~3 min macos/status-go 📦zip
✔️ 77960c0 #2 2025-09-19 12:59:30 ~3 min linux/status-go 📦zip
✔️ 77960c0 #2 2025-09-19 13:01:51 ~5 min windows/status-go 📦zip
✔️ 77960c0 #2 2025-09-19 13:06:46 ~10 min linux/nwaku 📦zip
✖️ 77960c0 #2 2025-09-19 13:06:55 ~10 min tests-rpc 📄log
✖️ 3f20eb2 #3 2025-09-19 13:04:15 ~1 min tests 📄log
✔️ 3f20eb2 #3 2025-09-19 13:05:51 ~3 min macos/status-go 📦zip
✔️ 3f20eb2 #3 2025-09-19 13:06:23 ~3 min linux/status-go 📦zip
✔️ 3f20eb2 #3 2025-09-19 13:10:43 ~7 min windows/status-go 📦zip
✖️ 1c1561d #4 2025-09-19 13:05:44 ~1 min tests 📄log
✔️ 1c1561d #4 2025-09-19 13:09:40 ~3 min macos/status-go 📦zip
✔️ 1c1561d #4 2025-09-19 13:09:51 ~3 min linux/status-go 📦zip
✔️ 1c1561d #4 2025-09-19 13:17:14 ~6 min windows/status-go 📦zip
✔️ 1c1561d #3 2025-09-19 13:17:22 ~10 min linux/nwaku 📦zip
✖️ 1c1561d #3 2025-09-19 13:18:14 ~11 min tests-rpc 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ df48dbf #5 2025-09-19 13:23:39 ~3 min macos/status-go 📦zip
✔️ df48dbf #5 2025-09-19 13:23:41 ~3 min linux/status-go 📦zip
✔️ df48dbf #5 2025-09-19 13:26:08 ~5 min windows/status-go 📦zip
✔️ df48dbf #4 2025-09-19 13:30:57 ~10 min linux/nwaku 📦zip
✖️ df48dbf #4 2025-09-19 13:31:20 ~10 min tests-rpc 📄log
✔️ df48dbf #5 2025-09-19 13:46:14 ~25 min tests 📄log
✔️ cbbbec4 #6 2025-09-19 14:08:47 ~3 min linux/status-go 📦zip
✔️ cbbbec4 #6 2025-09-19 14:08:52 ~3 min macos/status-go 📦zip
✔️ cbbbec4 #6 2025-09-19 14:12:13 ~6 min windows/status-go 📦zip
✔️ cbbbec4 #5 2025-09-19 14:14:49 ~9 min tests-rpc 📄log
✔️ cbbbec4 #5 2025-09-19 14:15:56 ~10 min linux/nwaku 📦zip
✔️ cbbbec4 #6 2025-09-19 14:31:10 ~25 min tests 📄log

@igor-sirotin igor-sirotin force-pushed the fix/peer-exchange branch 2 times, most recently from 77960c0 to 3f20eb2 Compare September 19, 2025 13:02
Copy link

codecov bot commented Sep 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.18%. Comparing base (4edf1be) to head (df48dbf).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #6941      +/-   ##
===========================================
- Coverage    59.19%   59.18%   -0.02%     
===========================================
  Files          822      822              
  Lines       121865   121854      -11     
===========================================
- Hits         72141    72119      -22     
- Misses       42270    42290      +20     
+ Partials      7454     7445       -9     
Flag Coverage Δ
functional 31.37% <100.00%> (+0.07%) ⬆️
unit 55.33% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
messaging/waku/gowaku.go 65.02% <100.00%> (+0.08%) ⬆️

... and 28 files with indirect coverage changes

// If not, the peer selection process in go-waku will filter them out anyway
w.dnsAddressCacheLock.RLock()
var peers peer.IDSlice
for _, record := range w.dnsAddressCache {
Copy link
Contributor

Choose a reason for hiding this comment

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

wondering if we can keep this logic of adding peers discovered via DNS to peerStore and connect to them.
This would provide better/more peers to choose from.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@chaitanyaprem, wouldn't we have DNS-discovered peers already in the peerStore? Or we're not always connecting to them, only use for discovery?

So you want like no matter if we are connected to them or not, we should keep the peer exchange running with them?

Copy link
Contributor

Choose a reason for hiding this comment

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

@chaitanyaprem, wouldn't we have DNS-discovered peers already in the peerStore? Or we're not always connecting to them, only use for discovery?

Since they were being connected to here, was not sure if they are being added to peerStore somewhere else. If they are being added to peerStore then this can be removed.

So you want like no matter if we are connected to them or not, we should keep the peer exchange running with them?

This would be better imo as they would be bootnodes the chance of getting high quality peers is high.

Copy link
Collaborator Author

@igor-sirotin igor-sirotin Sep 21, 2025

Choose a reason for hiding this comment

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

ah, indeed. I was sure they we were connecting to them elsewhere, but couldn't find it now.
Thank you, @chaitanyaprem, I will make sure we still connect to them 👍

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Apparently we do connect to the DNS-discovered nodes, here:

func (w *Waku) discoverAndConnectPeers() {
for _, addrString := range w.cfg.WakuNodes {
err := handlePeerAddress(addrString, w)
if err != nil {
w.logger.Warn("failed to handle peer address", zap.String("addr", addrString), zap.Error(err))
}
}
}
func handlePeerAddress(addr string, handler peerAddressHandler) error {
if strings.HasPrefix(addr, "enrtree://") {
handler.discoverAndConnect(addr)
return nil
}

And we duplicate the enrtree:// in the fleet configuration, for both static connection and Discv5 connection:

FleetStatusProd: {
ClusterID: 16,
WakuNodes: []string{
"enrtree://AMOJVZX4V6EXP7NTJPMAYJYST2QP6AJXYW76IU6VGJS7UVSNDYZG4@boot.prod.status.nodes.status.im",
},
DiscV5BootstrapNodes: []string{
"enrtree://AMOJVZX4V6EXP7NTJPMAYJYST2QP6AJXYW76IU6VGJS7UVSNDYZG4@boot.prod.status.nodes.status.im",

So. All should be good. We have the fleet enrtree:// and always connect to all retrieved nodes. So they will not only appear in dnsAddressCache, but also in the peer cache itself. So we will always run peer exchange with them.

Copy link
Contributor

@chaitanyaprem chaitanyaprem left a comment

Choose a reason for hiding this comment

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

LGTM apart from the comment.

@igor-sirotin igor-sirotin merged commit 620d96c into develop Sep 22, 2025
22 checks passed
@igor-sirotin igor-sirotin deleted the fix/peer-exchange branch September 22, 2025 22:19
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.

Expand the peer exchange loop to use more peers
4 participants