-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Migrate x/params to protocol buffers for state encoding #7114
Conversation
x/params/types/subspace.go
Outdated
|
||
if pty != ty { | ||
if registeredProtoMarshaler != value { |
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.
This actually needs to check for type equality, not value equality.
@alexanderbez @aaronc Is there a way to do that without reflection?
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.
You mean the concrete types? No, I can't think of any other way apart from reflection.
x/auth/types/params.go
Outdated
@@ -54,7 +54,7 @@ func ParamKeyTable() paramtypes.KeyTable { | |||
func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { | |||
|
|||
return paramtypes.ParamSetPairs{ | |||
paramtypes.NewParamSetPair(KeyMaxMemoCharacters, p.MaxMemoCharacters, validateMaxMemoCharacters), | |||
paramtypes.NewParamSetPair(KeyMaxMemoCharacters, &pt.UInt64Value{Value: p.MaxMemoCharacters}, validateMaxMemoCharacters), |
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.
@alexanderbez this is the kind of stuff we would need all over the place for param values if we wanted to keep the proto representation as primitive types.
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.
Yup, makes sense!
83f8fd5
to
a156dca
Compare
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Description
This PR migrates the x/params module to use protobuf for encoding params state in its store.
The main change is updating this struct:
And subsequently updating all marshalers, validator functions, and other downstream refactoring...
This PR will also migrate the params for each module.
closes: #6983
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
docs/
) or specification (x/<module>/spec/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerCodecov Report
in the comment section below once CI passes