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: local discovery #1811

Merged
merged 27 commits into from
Feb 16, 2024
Merged

feat: local discovery #1811

merged 27 commits into from
Feb 16, 2024

Conversation

danisharora099
Copy link
Collaborator

@danisharora099 danisharora099 commented Jan 24, 2024

Problem

Whenever a js-waku node is started, it bootstraps itself into the network using a static multiaddr passed by the user, or by using default fleets. These nodes are then used to discovery more nodes using Peer Exchange.

Solution

This PR introduces the usage of Local Storage as a discovery layer that can be used to store & fetch peer information (peerId and multiaddr) of healthy peers that js-waku was previously able to connect to, for that particular app & user.

This reduces the amount of time to discovery healthy nodes by storing previously known healthy nodes to be stored in the Local Storage which can be used as a way to bootstrap your way into the network without relying on the bootstrap fleets, thus also reducing load on them while increasing decentralization.

Notes

Copy link

github-actions bot commented Jan 24, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
Waku core 30.86 KB (+0.16% 🔺) 618 ms (+0.16% 🔺) 675 ms (-24.41% 🔽) 1.3 s
Waku Simple Light Node 276.36 KB (+0.28% 🔺) 5.6 s (+0.28% 🔺) 2.4 s (+39.05% 🔺) 8 s
ECIES encryption 27.55 KB (+0.04% 🔺) 552 ms (+0.04% 🔺) 356 ms (-13.8% 🔽) 907 ms
Symmetric encryption 26.87 KB (+0.04% 🔺) 538 ms (+0.04% 🔺) 976 ms (+55.8% 🔺) 1.6 s
DNS discovery 92.51 KB (+0.02% 🔺) 1.9 s (+0.02% 🔺) 1.4 s (-0.2% 🔽) 3.2 s
Privacy preserving protocols 135.71 KB (+0.02% 🔺) 2.8 s (+0.02% 🔺) 1.5 s (+40.8% 🔺) 4.2 s
Light protocols 29.27 KB (+0.05% 🔺) 586 ms (+0.05% 🔺) 786 ms (+31.07% 🔺) 1.4 s
History retrieval protocols 27.64 KB (+0.06% 🔺) 553 ms (+0.06% 🔺) 347 ms (-43.05% 🔽) 900 ms
Deterministic Message Hashing 6 KB (0%) 120 ms (0%) 143 ms (-41.01% 🔽) 263 ms

@danisharora099 danisharora099 marked this pull request as ready for review January 30, 2024 12:27
@danisharora099 danisharora099 requested a review from a team as a code owner January 30, 2024 12:27
@adklempner
Copy link
Member

Copy link
Collaborator

@weboko weboko left a comment

Choose a reason for hiding this comment

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

left some comments, let's discuss

@danisharora099
Copy link
Collaborator Author

Does this interface need to be updated as well? https://github.com/waku-org/js-waku/pull/1811/files#diff-7a99f40b2c8bda03c8c1333fd225faef1127292ec63c8af55aecfeeac1c1dc31L39-L46

good spot, thanks! addressed

@danisharora099 danisharora099 changed the title feat: local storage as a discovery layer feat: local discovery Feb 15, 2024
packages/tests/package.json Outdated Show resolved Hide resolved
Copy link
Collaborator

@weboko weboko left a comment

Choose a reason for hiding this comment

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

thanks!

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.

3 participants