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

Add predefined nodes #313

Merged
merged 4 commits into from
Oct 5, 2022
Merged

Conversation

felicio
Copy link
Collaborator

@felicio felicio commented Sep 30, 2022

No description provided.

@felicio felicio requested a review from prichodko September 30, 2022 19:49
Copy link
Collaborator

@prichodko prichodko left a comment

Choose a reason for hiding this comment

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

Can we just pass the array of peers to the js-waku instead of replicating this functionality? If we could use PeerDiscoveryStaticPeers similarly to default option, which uses the pseudo-random subset during initialization.

I don't understand the purpose of shuffle. ¯\_(ツ)_/¯

packages/status-js/src/utils/predefined-bootstrap-nodes.ts Outdated Show resolved Hide resolved
@felicio felicio requested a review from prichodko October 5, 2022 13:58
Copy link
Collaborator

@prichodko prichodko left a comment

Choose a reason for hiding this comment

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

Let's raise an issue about peers not working if they won't work by the end of the day.

@felicio
Copy link
Collaborator Author

felicio commented Oct 5, 2022

I don't understand the purpose of shuffle.

@prichodko without some kind of randomization, and in case of only 1 max peer, users would always be hitting one specific node

@felicio felicio merged commit 104f267 into status-im:main Oct 5, 2022
@prichodko
Copy link
Collaborator

prichodko commented Oct 5, 2022

I see it now. I should've read the code better.

But why shuffle an array instead of choosing a random number between 0 and Array.length? (just thinking out loud)

@felicio
Copy link
Collaborator Author

felicio commented Oct 5, 2022

But why shuffle an array instead of choosing a random number between 0 and Array.length? (just thinking out loud)

@prichodko, yeah, had the same question. I'd say it comes down to the randomization func/algo. Pseudo-random in the naming suggests:

A pseudorandom sequence of numbers is one that appears to be statistically random, despite having been produced by a completely deterministic and repeatable process. – https://en.wikipedia.org/wiki/Pseudorandomness

Didn't question it further.

felicio added a commit to felicio/status-web that referenced this pull request May 15, 2023
@felicio felicio self-assigned this May 9, 2024
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.

2 participants