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(wakunode2): simplify wakunode2 config and decouple peer persistence #1300

Merged
merged 4 commits into from
Oct 27, 2022

Conversation

LNSD
Copy link
Contributor

@LNSD LNSD commented Oct 26, 2022

This is the second part of #1293, and resolves #1103:

  • Decouple peer persistence database from message store database
  • Decouple --storenode from resumeStoreNode
  • Simplified wakunode2 storage setup procedures
  • Made SqliteDatabase compatible with dbUrl path
  • Removed the deprecated configuration options from wakunode2/config.nim
  • Updated the tests accordingly

NOTE: Some extra work is necessary to improve the message store options (e.g., implement the unimplemented methods in the in-memory store, decouple the message store from the waku store protocol, etc.). This will be done in future PRs.

@LNSD LNSD self-assigned this Oct 26, 2022
@LNSD LNSD changed the title feat(store): simplify wakunode2 configuration options feat(wakunode2): simplify wakunode2 config and decouple peer persistence Oct 26, 2022
@status-im-auto
Copy link
Collaborator

status-im-auto commented Oct 26, 2022

Jenkins Builds

Click to see older builds (6)
Commit #️⃣ Finished (UTC) Duration Platform Result
37dffa7 #1 2022-10-26 13:25:48 ~8 min linux 📄log
37dffa7 #1 2022-10-26 13:27:03 ~9 min macos 📄log
✔️ b533a01 #2 2022-10-26 15:49:51 ~16 min macos 📦bin
✔️ b533a01 #2 2022-10-26 15:50:19 ~16 min linux 📦bin
✔️ 9537c7f #3 2022-10-27 11:54:57 ~14 min linux 📦bin
✔️ 9537c7f #3 2022-10-27 11:55:43 ~15 min macos 📦bin
Commit #️⃣ Finished (UTC) Duration Platform Result
5f34f22 #4 2022-10-27 15:42:02 ~8 min macos 📄log
✔️ 5f34f22 #4 2022-10-27 15:48:14 ~14 min linux 📦bin
55afb4f #5 2022-10-27 15:51:14 ~13 min linux 📄log
✔️ 55afb4f #5 2022-10-27 16:00:24 ~22 min macos 📦bin
✔️ 55afb4f #6 2022-10-27 21:30:17 ~14 min linux 📦bin

@LNSD LNSD force-pushed the feat-wakunode2-storesetup branch from 37dffa7 to b533a01 Compare October 26, 2022 15:33
@LNSD LNSD requested review from jm-clius, rymnc and alrevuelta October 26, 2022 18:53
@LNSD LNSD marked this pull request as ready for review October 26, 2022 18:53
Copy link
Contributor

@rymnc rymnc left a comment

Choose a reason for hiding this comment

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

LGTM 😁

apps/wakunode2/wakunode2.nim Outdated Show resolved Hide resolved
let store = StoreQueueRef.new(storeCapacity)
return ok(store)

proc setupMessageStoreRetentionPolicy(retentionPolicy: string): SetupResult[Option[MessageRetentionPolicy]] =
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we use an optional enum for the retentionPolicy argument since we have only 2, or no retention policy at all?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can you elaborate on that? Where are you suggesting using the enum?

  • Return type?
  • Input argument?
  • Config?

Copy link
Contributor

Choose a reason for hiding this comment

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

in the input, sorry. retentionPolicy: string

apps/wakunode2/wakunode2.nim Outdated Show resolved Hide resolved
ok()

proc startMetricsServer(node: WakuNode, address: ValidIpAddress, port: uint16, portsShift: uint16): SetupResult[void] =
startMetricsServer(address, Port(port + portsShift))
Copy link
Contributor

Choose a reason for hiding this comment

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

a try-except here maybe?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well... the compiler is not complaining, so I don't think we should add a try/catch there.

But I agree that the error management in the metrics, JSON-RPC, and rest servers setup procedure has to be improved.

Co-authored-by: Aaryamann Challani <[email protected]>
Copy link
Contributor

@jm-clius jm-clius left a comment

Choose a reason for hiding this comment

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

LGTM! LMK if you want to divide and conquer the subsequent tasks (infra updates, doc updates, etc.)

Co-authored-by: Aaryamann Challani <[email protected]>
@LNSD
Copy link
Contributor Author

LNSD commented Oct 27, 2022

LGTM! LMK if you want to divide and conquer the subsequent tasks (infra updates, doc updates, etc.)

@jakubgs In this PR, we are dropping the deprecated options. So in the next release, v0.13.0, the store configuration will change. Do you have any concerns before merging the PR?

@jakubgs
Copy link
Contributor

jakubgs commented Oct 27, 2022

Yes, we'll need to coordinate the deployment to fleets or shit will break. I'm in Istanbul next week and off most of week after that, so if we want this done it would probably have to be tomorrow. Or on the 9th possibly.

@LNSD
Copy link
Contributor Author

LNSD commented Oct 27, 2022

No need to rush. AFAIK, we are not planning to do any rollout for now. We can wait until you are back.

Probably it is a better idea because I am planning to add support for configuring via environment variables. So we do not re-work things twice.

@LNSD LNSD merged commit 62328f0 into master Oct 27, 2022
@LNSD LNSD deleted the feat-wakunode2-storesetup branch October 27, 2022 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

store: simplify configuration options
5 participants