-
Notifications
You must be signed in to change notification settings - Fork 9
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
Handle edits to the data proxy config #327
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thomasvdam
force-pushed
the
chore/data-proxy-edit
branch
from
August 17, 2024 15:31
a35dc0d
to
350b418
Compare
Thomasvdam
force-pushed
the
chore/data-proxy-edit
branch
from
August 19, 2024 15:24
bdca2fa
to
ceccdc8
Compare
x/data-proxy/keeper/keeper.go
Outdated
return pubkeys, nil | ||
} | ||
|
||
func (k Keeper) ProcessProxyFeeUpdate(ctx sdk.Context, pubKeyBytes []byte, proxyConfig *types.ProxyConfig, msg *types.MsgEditDataProxy) (int64, error) { |
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.
Since this method's logic is a little dependent on msgServer.EditDataProxy
, we can make it unexported? Also, it can take as argument a types.FeeUpdate
struct or just msg.FeeUpdateDelay
& msg.NewFee
instead of the whole message.
hacheigriega
approved these changes
Aug 19, 2024
Thomasvdam
force-pushed
the
chore/data-proxy-edit
branch
from
August 19, 2024 16:01
ceccdc8
to
ee4ebed
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Allow data proxy operators to update their data proxy config on chain.
Explanation of Changes
I purposefully didn't allow changing the admin address through the edit, that will be its own transaction to prevent mistakes when making edits to the config.
I introduced a length limit to the memo to prevent potential abuse. 3000 characters feels like it should be enough for custom applications or whatever fun messages people want to attach to their proxy.
I took inspiration from the x/staking module on how they deal with optional fields. I realised making them nullable doesn't do much since we'll just get an empty string which could also be the value the user tried to pass. Now we check for some constants and rely on the application creating the transaction to supply the correct values in case there are no changes required.
The fee update code feels a little convoluted, but I'm not sure how to express it more clearly with just code. Any suggestions are welcome. :)
Testing
Added tests to msg_server_test that deal with various edit scenarios.
Related PRs and Issues
Part-of: #316