-
Notifications
You must be signed in to change notification settings - Fork 123
liquidity: persist manager's params to disk #493
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
Conversation
7cd7652 to
585db71
Compare
bhandras
left a comment
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, nice work! 💯
075d5b3 to
e566280
Compare
|
@arshbot: review reminder |
arshbot
left a comment
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.
These changes look good to me! Can we add documentation to the relevant command (perhaps right in the help of setparam) to inform users of how to clear saved params?
This commit refactors the `liquidity` by moving `Parameters` related code into one file.
This commit refactors the method `manager.SetParameters` to take a `SetLiquidityParamsRequest`. As we'll see in the following commit, this will enable us saving the params to disk more easily.
This commit adds a new bucket to save liquidity parameters. We've skipped the serialization and deserialization implementations here and leave them to be handled by the liquidity package.
Updated the description, PTAL |
This commit saves the RPC request used to construct the `Parameters` on disk. Since it's a proto message, an easy way to read/write it is to rely on the proto marshal/unmarshal methods. A side effect is that migration also becomes easy as proto message have its own internal mechanism to keep track of the compatibility.
arshbot
left a comment
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! Great description too :D
Saving the params to a file can be quite cumbersome when it comes to migration, and also is prone to bugs. This PR replaces #490 by saving the data into db instead.
Note that we are saving the RPC request here, which has a nice feature as it handles compatibility very well, as long as the tag numbers are used correctly.
TODO: