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

bug: gov execution of hooks causes panic #6580

Open
Tracked by #5970
czarcas7ic opened this issue Sep 28, 2023 · 0 comments
Open
Tracked by #5970

bug: gov execution of hooks causes panic #6580

czarcas7ic opened this issue Sep 28, 2023 · 0 comments
Assignees

Comments

@czarcas7ic
Copy link
Member

Background

The order of initialization is as follows:

  1. InitNormalKeepers
    app.InitNormalKeepers(
  2. This registers gov proposal routes
    // register the proposal types
    govRouter := govtypes.NewRouter()
    govRouter.AddRoute(govtypes.RouterKey, govtypes.ProposalHandler).
    AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(*appKeepers.ParamsKeeper)).
    AddRoute(distrtypes.RouterKey, distribution.NewCommunityPoolSpendProposalHandler(*appKeepers.DistrKeeper)).
    AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(appKeepers.IBCKeeper.ClientKeeper)).
    AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(*appKeepers.UpgradeKeeper)).
    AddRoute(ibchost.RouterKey, ibcclient.NewClientProposalHandler(appKeepers.IBCKeeper.ClientKeeper)).
    AddRoute(poolincentivestypes.RouterKey, poolincentives.NewPoolIncentivesProposalHandler(*appKeepers.PoolIncentivesKeeper)).
    AddRoute(txfeestypes.RouterKey, txfees.NewUpdateFeeTokenProposalHandler(*appKeepers.TxFeesKeeper)).
    AddRoute(superfluidtypes.RouterKey, superfluid.NewSuperfluidProposalHandler(*appKeepers.SuperfluidKeeper, *appKeepers.EpochsKeeper, *appKeepers.GAMMKeeper)).
    AddRoute(protorevtypes.RouterKey, protorev.NewProtoRevProposalHandler(*appKeepers.ProtoRevKeeper)).
    AddRoute(gammtypes.RouterKey, gamm.NewGammProposalHandler(*appKeepers.GAMMKeeper)).
    AddRoute(concentratedliquiditytypes.RouterKey, concentratedliquidity.NewConcentratedLiquidityProposalHandler(*appKeepers.ConcentratedLiquidityKeeper)).
    AddRoute(cosmwasmpooltypes.RouterKey, cosmwasmpool.NewCosmWasmPoolProposalHandler(*appKeepers.CosmwasmPoolKeeper)).
    AddRoute(poolmanagertypes.RouterKey, poolmanager.NewPoolManagerProposalHandler(*appKeepers.PoolManagerKeeper))
  3. After this, we SetupHooks
    app.SetupHooks()

This means that, if a gov prop attempts to call a hook, it will not be registered and will panic.

One way to fix this is to decouple the route setting from the govKeeper itself, and call the route setting after we setup the hooks.

Suggested Design

Refrain from any sdk fork changes until we unfork ourselves to 0.47. I believe routes get removed in 0.47. If it does not and this is still an issue, we should open up an issue in the sdk to fix this.

Acceptance Criteria

TBD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Needs Triage 🔍
Development

No branches or pull requests

1 participant