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

PFM: FeePercentage param should default to zero if not set #46

Closed
nicolaslara opened this issue Jun 30, 2023 · 6 comments · Fixed by #90
Closed

PFM: FeePercentage param should default to zero if not set #46

nicolaslara opened this issue Jun 30, 2023 · 6 comments · Fixed by #90
Assignees
Labels
bug Something isn't working packet-forward-middleware Label for items related to the packet forward middleware

Comments

@nicolaslara
Copy link
Contributor

At the moment, if the param is not set (i.e.: set to "") txs with forwarding will fail since https://github.com/cosmos/ibc-apps/blob/main/middleware/packet-forward-middleware/router/keeper/keeper.go#L214 can't convert it to a Dec.

Adding sensible defaults should be an easy fix

@Lockwarr
Copy link

Hey! While exploring the PFM, also noticed that the ModuleName has a typo packetfowardmiddleware -> packetforwardmiddleware, would be nice to be renamed if it's an easy fix

@nicolaslara
Copy link
Contributor Author

yeah, I noticed that too, but thought I'd ignore it to avoid having to migrate the params to the new key.

@agouin
Copy link
Member

agouin commented Jun 30, 2023

Hey! While exploring the PFM, also noticed that the ModuleName has a typo packetfowardmiddleware -> packetforwardmiddleware, would be nice to be renamed if it's an easy fix

Yes, we realized this after the first release of the middleware unfortunately, so it was already adopted with the typo by some chains. To prevent migrations, we decided to live with the typo.

https://github.com/strangelove-ventures/packet-forward-middleware/commits/f520372571b26f23e7ce4ba9925efbd1366fb0b6/router/types/keys.go

@jtieri jtieri added bug Something isn't working packet-forward-middleware Label for items related to the packet forward middleware labels Jun 30, 2023
@jtieri jtieri self-assigned this Jul 31, 2023
@jtieri
Copy link
Member

jtieri commented Aug 29, 2023

At the moment, if the param is not set (i.e.: set to "") txs with forwarding will fail since https://github.com/cosmos/ibc-apps/blob/main/middleware/packet-forward-middleware/router/keeper/keeper.go#L214 can't convert it to a Dec.

Adding sensible defaults should be an easy fix

I took a look at this and it seemed like we are using a default value of 0 and also doing some validation to ensure that the param value can be type coerced into the sdk.Dec type properly see

Is there something i'm overlooking here?

@nicolaslara
Copy link
Contributor Author

That looks good to me to right now. I can't remember the details here, but I think it was happening for us on a testnet when the parameter was not set on genesis or set to "". IIRC the validation occurs when setting the param, but if it never was initialized, it would somehow get ""

@jtieri
Copy link
Member

jtieri commented Aug 30, 2023

Thanks that bit of context actually helped me find what I think the issue could be then.

In module.go we are not calling ValidateGenesis in the InitGenesis call. I'll get a PR opened right now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working packet-forward-middleware Label for items related to the packet forward middleware
Projects
None yet
4 participants