Skip to content

[Bug]: Feegrant and authz keepers not getting their bank keepers. #20589

@SpicyLemon

Description

@SpicyLemon

Is there an existing issue for this?

  • I have searched the existing issues

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 in NewAppModule for both modules.

However, the bank keeper is remaining nil in both keepers used by an app.

There are two problems:

  1. The receivers for the 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.
  2. The keepers are being provided to the NewAppModule functions as their struct (not a reference). So any changes made to the keeper inside NewAppModule 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions