-
Notifications
You must be signed in to change notification settings - Fork 33
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
[Persistence] Optimize gov params schema (Issue #76) #139
[Persistence] Optimize gov params schema (Issue #76) #139
Conversation
Attaching metadata that can be parsed later on in order to have a single source of truth
…_gov_params_schema Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
I did a quick first review (will do an in-depth one next time) but this is frikkin awesome! I think we should continue moving forward with it and the changes are well contained enough that I don't think the conflicts with deprecating persistence will be that bad. CC @andrewnguyen22 |
…_gov_params_schema Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
code review
improve readability
Thanks @Olshansk! I have caught up with |
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.
Left additional comments throughout the PR (some impacting the rest of the DB).
At a high-level, the summary of the architectural changes is:
shared/modules/persistence_module.go
needs to be modified to accept a height for eachGet
call - Eventually I want to simplify that too, but we can do that later- Remove the
nullify
query altogether - it's legacy and we can add it back later - Params should now have an
enabled
field butflags
should - Flags are not used in the database yet, but we already use it for v0 and I think most of the foundation we need for it in v1 is already in this PR.
Let me know if you need any more details and we can jump on a call!
Updated also with so it doesn't show up in our makefile help since it is an internal command basically
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.
tl;dr Almost . Please hold off on squashing and merging
I've re-reviewed this whole PR and just left a couple of minor final NITs.
Overall, I really like the change and it'll make it much easier to both add and extend on our param+flag logic.
Going to approve this change but please hold off on @andrewnguyen22's review before submitting. After he take a look, we'll also need to make a call on whether we want to submit this before or after #140 as there will definitely be conflicts, but I'm sure we can figure it out.
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.
Unapprove to avoid accidental merge.
…_gov_params_schema Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
@andrewnguyen22 In terms of ordering / priority, what are your thoughts on
That way we disperse the burden of merge conflicts amongst every |
@deblasis We're likely going to merge #140 soon, so just a heads up that it'll require a fair amount of conflict resolution. Otherwise, the only blocker here after synching with @andrewnguyen22 is adding some documentation explaining the different between |
ACK. No problem, I subscribed to that issue so I have been quietly stalking you guys and I saw this coming soon my way 🙂
Cool, will do, thanks @Olshansk ! |
…ptimize_gov_params_schema Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
@@ -145,6 +145,12 @@ For example, on macOS, you can check for this with `lsof -i:5432` and kill the a | |||
**Q**: Why not use an ORM? | |||
**A**: We are trying to keep the module small and lean initially but are ope |
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 noticed that the sentence here is truncated :)
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.
Hahaha, I think open to suggestions
is what we wanted to say 😅
**Q**: What is a `Param` in the `Gov` schema? | ||
**A**: It represents a value associated with a name and a height that we can reference to represent governance settings. These settings have the power of altering the behaviour of various aspects of the network. | ||
|
||
**Q**: What is a `Flag` in the `Gov` schema? | ||
**A**: A flag is very much alike a `Param` with the difference that it also has a boolean flag to specify if that setting is enabled or not at any point in time (height). We are discussing if we should replace the boolean flag and allow multivariate feature flags. | ||
|
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.
@andrewnguyen22: I have added some color here about flags/params.
Everything (very little 😅) I know about flags comes from this comment #76 (comment) and subsequent conversations with @Olshansk in the form of comments to this PR.
One thing I assumed initially, that I later changed to the current code, was that flags shouldn't have a value like params but just a boolean flag. Maybe the truth is a bit of both: we should remove the enabled
in flags and create logic around the value
that we can define as float to handle multivariate flags later on, perhaps this would be out of scope for this PR but I am happy to change things if needed.
As things stand, these descriptions should fit, even though we are not yet using flags anywhere so I am assuming that this is very much subject to change as we iterate regardless.
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 extra context. I think the flag concept will definitely evolve but the current description and implementation is more than sufficient to move forward.
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.
LGTM! Let's
I removed the do not merge
, retriggered the jobs and am approving.
@deblasis What we've been doing is doing a squash-and-merge
and copy-pasting the github description into the commit.
I looked at the two issues in the jobs, and they are related to our docker images and a test that's flaky in our consensus algorithm (related to the pacemaker). Will sync with @okdas on this but it doesn't block this PR.
Why is the automation failing on this? @Olshansk |
Description
Currently WIP and paused because of #76 (comment)
This PR changes the schema for
params
, addsflags
(to be implemented) and aims at improving the way we update the values.It should also improve maintainability by:
Fixes issue/76
Type of change
Please mark the options that are relevant.
How Has This Been Tested?
[Not needed for integration PR]
Describe the tests and that you ran to verify your changes. If applicable, provide steps to reproduce. Bonus points for images and videos or gifs.
make test_all
Checklist
flags
and their differences withparams
as per comment