-
Notifications
You must be signed in to change notification settings - Fork 54
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
chore(rln-relay): pass in the path to the tree db #1782
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! It looks great!
I just added a few questions
apps/wakunode2/config.nim
Outdated
@@ -201,6 +201,11 @@ type | |||
defaultValue: "" | |||
name: "rln-relay-cred-password" }: string | |||
|
|||
rlnRelayTreePath* {. | |||
desc: "Path to the RLN merkle tree db", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What type of db is expected? Maybe it is worth specifying it a bit more :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! good idea, addressed in 69dc716
mode: "high_throughput", | ||
compression: false, | ||
flush_interval: 12_000, | ||
path: if tree_path != "": tree_path else: DefaultRlnTreePath |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can directly pass the tree_path
variable as it already has an appropriate default value.
path: if tree_path != "": tree_path else: DefaultRlnTreePath | |
path: tree_path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would have to disagree there, since the default value from the wakunode config is "", and could potentially be passed into this proc
## wrapper around the generic JObject constructor. | ||
## We don't need to have a separate proc for the tree_config field | ||
let tree_config = %{ "cache_capacity": %c.tree_config.cache_capacity, | ||
"mode": %c.tree_config.mode, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe very basic question but what does %
do by default in Nim? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If std/json is imported, %
converts the type of the variable to a JsonNode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah true, I forgot it. Thanks! We do the same in
$( %* jsonMessage ) |
Co-authored-by: Ivan Folgueira Bande <128452529+Ivansete-status@users.noreply.github.com>
@@ -53,14 +53,14 @@ proc membershipKeyGen*(ctxPtr: ptr RLN): RlnRelayResult[IdentityCredential] = | |||
|
|||
return ok(identityCredential) | |||
|
|||
type RlnTreeConfig* = ref object of RootObj | |||
type RlnTreeConfig = ref object of RootObj | |||
cache_capacity*: int |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rymnc - Sorry to be picky but could these be "hidden" as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, addressed in 358bba1!
Description
This pr allows the user/operator to pass in the path to the persisted merkle tree, this will allow users to only sync
from the block that they need to, instead of syncing from the start every single time.
Changes
createRlnInstanceLocal
, which is the only proc thatuses it
--rln-relay-tree-path
that accepts a stringNote:
the prs to reduce cognitive load.
Issue
addresses a part of #1772