Skip to content

Conversation

@igor-sirotin
Copy link
Collaborator

@igor-sirotin igor-sirotin commented Dec 8, 2025

Fixes the issue descried in

Main change

Before, watchTopicShards would directly call wenr.Update:

err = wenr.Update(w.log, w.localNode, wenr.WithWakuRelaySharding(rs[0]))

This was bad, because:

  1. It is done async, there is a race condition with enr.WithMultiaddress implementation.
  2. It did not check for ENR 300 bytes limit

Now LocalNode entries are only modified through UpdateLocalNode.
This way we ensure the order of adding ENR options, making multiaddrs go the last.

Both issue (race condition and 300 bytes limit) solved.

watchTopicShards

Refactoring

  • Refactored UpdateLocalNode to take LocalNodeParams arguments structure
  • Removed UpdateLocalNode duplication (there was a copy in enr tests)
  • To prevent import cycle I had to move some functions into node/utils params

@igor-sirotin igor-sirotin requested a review from osmaczko December 8, 2025 21:23
@igor-sirotin igor-sirotin marked this pull request as ready for review December 8, 2025 21:23
@igor-sirotin igor-sirotin force-pushed the fix/enr-size-panic branch 2 times, most recently from 4d8ac56 to b1ab020 Compare December 8, 2025 21:28
@status-im-auto
Copy link

status-im-auto commented Dec 9, 2025

Jenkins Builds

Commit #️⃣ Finished (UTC) Duration Platform Result
✖️ 80c0b44 #1 2025-12-09 15:21:43 ~26 sec unknown 📄log
✖️ 80c0b44 #2 2025-12-09 21:09:40 ~21 sec unknown 📄log

Copy link
Collaborator

@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.

@igor-sirotin igor-sirotin merged commit b0af769 into master Dec 10, 2025
9 of 11 checks passed
@igor-sirotin igor-sirotin deleted the fix/enr-size-panic branch December 10, 2025 10:22
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.

5 participants