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: storenode cycle #1223

Merged
merged 5 commits into from
Oct 14, 2024
Merged

feat: storenode cycle #1223

merged 5 commits into from
Oct 14, 2024

Conversation

richard-ramos
Copy link
Member

@richard-ramos richard-ramos commented Sep 19, 2024

This PR contains the storenode cycle code from status-go.
I tried to simplify it a bit but most of the heavy refactoring should be done on a separate PR since this one is already complex enough.

@plopezlpz, @kaichaosun @igor-sirotin @chaitanyaprem:
I'm still working on the unit tests, but so far, while testing status-im/status-go#5857 with Desktop, it looks promising. Reviews are appreciated!

waku/v2/api/history/emitters.go Show resolved Hide resolved
waku/v2/api/history/emitters.go Outdated Show resolved Hide resolved
waku/v2/api/history/cycle.go Show resolved Hide resolved
waku/v2/api/history/cycle.go Show resolved Hide resolved
waku/v2/api/history/cycle.go Show resolved Hide resolved
waku/v2/api/history/cycle.go Show resolved Hide resolved
waku/v2/api/history/cycle.go Outdated Show resolved Hide resolved
waku/v2/api/history/cycle.go Show resolved Hide resolved
waku/v2/api/history/cycle.go Outdated Show resolved Hide resolved
waku/v2/api/history/cycle.go Show resolved Hide resolved
@richard-ramos richard-ramos marked this pull request as ready for review September 30, 2024 21:47
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.

Code functionality looks good to me! hence approving it. Few comments that might be good to address now.

Some code architectural comments i have noted here, maybe these are planned as part of a subsequent refactor but wanted to indicate anyways :)

  1. Interface between status-go and waku api should be simple i.e status-go specifies list of storenodes to be used and waku internally manages connectivity to them and picks a storenode and manages active store. There can be one event emitter than status-go can register with to get all updates such as what is active-store-node, in case connectivity is lost etc.
  2. All 3 components i.e history-query, missing-messages and message-check should end up using same set of store nodes instead of their own selection criteria and logic.
  3. selection of storenode can be done using peer-selection and RTT. logic seems duplicated here
  4. store node failed requests should also consider requests made from missing_messages and message_check so that active storenode can be switched.

waku/v2/api/history/history.go Show resolved Hide resolved
waku/v2/api/history/history.go Show resolved Hide resolved
waku/v2/api/history/history.go Show resolved Hide resolved
waku/v2/api/history/history.go Show resolved Hide resolved
waku/v2/api/history/cycle.go Outdated Show resolved Hide resolved
@richard-ramos
Copy link
Member Author

Some code architectural comments i have noted here, maybe these are planned as part of a subsequent refactor but wanted to indicate anyways :)

I agree with the suggestions, and will work on these on a separate PR! thank you. Indeed there's a lot of duplication of code between the missing message logic, message check and the store node cycle that will need to be refactored away

@status-im-auto
Copy link

status-im-auto commented Oct 14, 2024

Jenkins Builds

Click to see older builds (6)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ d9361e5 #1 2024-09-19 18:42:38 ~2 min unknown 📄log
✔️ 3988fc6 #2 2024-09-20 19:09:49 ~1 min unknown 📄log
✔️ b2d0226 #3 2024-09-30 21:35:22 ~1 min unknown 📄log
✔️ b852a92 #4 2024-09-30 21:49:52 ~2 min unknown 📄log
✔️ f29ce5f #5 2024-09-30 22:08:00 ~2 min unknown 📄log
✔️ 397b4b5 #6 2024-10-14 16:19:21 ~2 min unknown 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ f40a23c #7 2024-10-14 18:22:48 ~1 min unknown 📄log
✔️ 00d898f #8 2024-10-14 18:34:06 ~2 min unknown 📄log

@richard-ramos richard-ramos merged commit 76275f6 into master Oct 14, 2024
11 of 12 checks passed
@richard-ramos richard-ramos deleted the storenode-cycle branch October 14, 2024 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants