-
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
[Bug]: Feegrant and authz keepers not getting their bank keepers. #20589
Comments
It should be okay given that the check is only added in the message (and we use appmodule that contains the keeper with the bank keeper, so it is where it matters in the flow). We couldn't change NewKeeper to return a reference as it would have been breaking anyway. Users not using depinject already have to use SetBankKeeper manually as well if they wanted to provide it in the app to other modules. However I agree that we can make it better for the keeper provided by depinject 👍 |
I get why it was done that way. I guess people probably just need to know to add calls of Semi-relatedly, people not using |
is this completed and released @julienrbrt |
True, I've updated the release notes to mention this. For v0.50, our monthly release is next week, but it is already released for v0.47.
Yes that's true. This is due to depinject injecting upgrade before you are able to register non-depinject modules later on runtime: https://github.com/cosmos/cosmos-sdk/blob/v0.50.6/simapp/app_v2.go#L253-L262. It is a problem at chain upgrade, so it is imperative to uncomment it when using depinject with non depinject modules.
Completed, v0.50.8 is planned next week. We can close this. |
Is there an existing issue for this?
What happened?
A bug happened!
A bank keeper was recently added to both the feegrant and authz keepers. In order to not be a breaking change, a
SetBankKeeper
method was added to both keepers and that method is called inNewAppModule
for both modules.However, the bank keeper is remaining nil in both keepers used by an app.
There are two problems:
SetBankKeeper
methods are concrete. So it's actually creating a copy of the keeper struct, changing the bank keeper field in the new one, and returning the new one. It doesn't actually update the original keeper.NewAppModule
functions as their struct (not a reference). So any changes made to the keeper insideNewAppModule
do not affect the keeper that was provided to that function. The module struct will have a copy of the keeper that has the bank module set in it, but the keeper that's in the app (being provided to other keepers and modules) does not have the bank keeper.Cosmos SDK Version
0.50.7
How to reproduce?
No response
The text was updated successfully, but these errors were encountered: