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

fix: fix regresion + remove deprecated flag #2556

Merged
merged 3 commits into from
Mar 26, 2024
Merged

Conversation

alrevuelta
Copy link
Contributor

Description

  • fix: Enable autosharding in any cluster #2505 introduced a subtle regression due to using the deprecated config flag topics. Deprecated long time ago in favour of pubsubTopics.
  • This PR fixes said regression.
  • And removes deprecated topics flag.

@@ -33,7 +33,7 @@ proc enrConfiguration*(conf: WakuNodeConf, netConfig: NetConfig, key: crypto.Pri

let shards: seq[uint16] =
# no shards configured
if conf.shards.len == 0: toSeq(0..<conf.topics.len).mapIt(uint16(it))
if conf.shards.len == 0: toSeq(0..<conf.pubsubTopics.len).mapIt(uint16(it))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this was casing the regression. topics was empty since its not used.

@alrevuelta alrevuelta requested a review from vpavlin March 26, 2024 12:24
Copy link
Collaborator

@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! 💯
Just added minor question

conf.pubsubTopics & shards
else:
conf.topics
let shards = conf.contentTopics.mapIt(node.wakuSharding.getShard(it).expect("Valid Shard"))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does it crash if contentTopics is empty?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nope, since mapIt iterates over contentTopics, if its empty, then there is nothing to iterate. so no crash :)

Copy link
Member

@vpavlin vpavlin left a comment

Choose a reason for hiding this comment

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

sanity checked, lgtm

@alrevuelta alrevuelta force-pushed the dont-use-topics branch 3 times, most recently from 97bc62c to 7725480 Compare March 26, 2024 12:39
Copy link

github-actions bot commented Mar 26, 2024

You can find the image built from this PR at

quay.io/wakuorg/nwaku-pr:2556-rln-v2-true

Built from 87aa0f0

Copy link
Contributor

@SionoiS SionoiS left a comment

Choose a reason for hiding this comment

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

LGTM

As soon as CI passes and we are sure that topics can be removed.

Comment on lines -300 to -305
topics* {.
desc:
"Default topic to subscribe to. Argument may be repeated. Deprecated! Please use pubsub-topic and/or content-topic instead.",
defaultValue: @["/waku/2/default-waku/proto"],
name: "topic"
.}: seq[string]
Copy link
Contributor

Choose a reason for hiding this comment

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

I would love to remove it but wasn't there someone still using this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the deprecation was announced many months ago.

@alrevuelta alrevuelta merged commit 47ad0fb into master Mar 26, 2024
13 of 15 checks passed
@alrevuelta alrevuelta deleted the dont-use-topics branch March 26, 2024 18:44
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