-
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 #76
Comments
Worth noting that this issue is the result of an offline discussion in order to submit #73 in a shorter time period. We also need to decide if we should link it to the V1 Prototype milestone or not... |
Hi there guys! I will be looking into this one if you don't mind 🙂 I just had a glance at it and I have a couple of questions to make sure I understand:
CREATE TABLE flags (
name string PRIMARY_KEY,
height bigint PRIMARY_KEY,
enabled bool NOT NULL,
value bool NOT NULL,
) instead?
Lastly, these are non-blocking questions and I might come up with more questions as I learn more about the codebase but I can definitely get started in the meantime 🚀 |
@deblasis tl;dr Appreciate the help and want to start the discussion but would hold off on implementing this one just yet... Having created and labelled this as a starter task, I'll take the heat that I may have prematurely left it out for the community to pick up. Since the project is young, and this is a great ticket to get a feel for the whole codebase, there are still a handful of ongoing changes (primarily being implemented by @andrewnguyen22 and myself in #105 and #113). I'm afraid the conflicts may be so great right now that is might be worth holding off for a couple of weeks to avoid too many conflicts. However, if we can have several small PRs that don't affect the whole codebase at once, we may be able to start the work here as well. IMO #112 is another highly impactful ticket our team will need almost immediately and can be done while we create space or get started on this one. To answer your question, though, since we can start thinking/designing now and tackle it in pieces...
I like your suggestion about the schema for flag but am still thinking if
For sure. In fact, I'd point you to our public #v1-dev channel, and we can collaborate there. We can also hop on an ad-hoc call there with other core team members so don't feel like you need to wait for an official V1 contributors hour. |
Hi @Olshansk! no problem, it makes sense. I am going to have a look at the issues you mentioned in order to have more context (pun intended) and I'll keep an eye on #v1-dev on DIscord. Any conflicts I am happy to resolve them when the time comes but I agree that they should be minimized especially if big changes are expected in the short run. This way you guys can have a preliminary look if you want and we can adjust as we go. For example, the |
The PR looks awesome. Thank you so much for your contribution! Let's keep the conversation/discussion there, but I think we should just move forward with it because it's a great change to the project |
## Description This PR changes the schema for `params`, adds `flags` (to be implemented) and aims at improving the way we update the values. It should also improve maintainability by: - centralizing Gov schema related metadata into the protobuf by attaching metadata to it. (see gov.proto) - using generics for get/set methods Fixes [issue/76](#76) ## Type of change Please mark the options that are relevant. - [ ] New feature (non-breaking change which adds functionality) - [ ] Bug fix (non-breaking change which fixes an issue) - [x] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Documentation - [ ] Other (<_REPLACE_ME_WITH_DETAILS_>) ## 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._ - [x] `make test_all` - [x] [LocalNet](https://github.com/pokt-network/pocket/blob/main/docs/development/README.md) ## Checklist - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have tested my changes using the available tooling - [ ] If applicable, I have made corresponding changes to related or global README - [ ] If applicable, I have added new diagrams using [mermaid.js](https://mermaid-js.github.io) - [x] If applicable, I have added tests that prove my fix is effective or that my feature works - [x] I have documented `flags` and their differences with `params` as per [comment](#139 (comment))
Optimize params schema for better de-duplication of data while maintaining fast lookups
NOTE: The fundamental issue with the current 'naive' design is that it recreates the entire parameters list everytime we have an edit to a single parameter. However, it is also important to note, parameters are expected to be updated at a low frequency.
Per a suggestion from @iajrz offline, this schema was suggested
My modification to it would be:
We can have very similar tables for flags and params and not how the primary key is a composite key of the name of the flag/param and the height, along with an enabled/disabled bool, so we can automatically (for example) in one snapshot of the state, predefined the behaviour of a flag only being applied for some number of blocks.
The text was updated successfully, but these errors were encountered: