Skip to content
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 3 commits into from
Aug 19, 2024

Conversation

Thomasvdam
Copy link
Member

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

return pubkeys, nil
}

func (k Keeper) ProcessProxyFeeUpdate(ctx sdk.Context, pubKeyBytes []byte, proxyConfig *types.ProxyConfig, msg *types.MsgEditDataProxy) (int64, error) {
Copy link
Member

@hacheigriega hacheigriega Aug 19, 2024

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.

@Thomasvdam Thomasvdam merged commit ee4ebed into feat/data-proxy-registry Aug 19, 2024
9 of 10 checks passed
@Thomasvdam Thomasvdam deleted the chore/data-proxy-edit branch August 19, 2024 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants