Skip to content

Commit 08a5709

Browse files
authored
remove globalfee (CosmosContracts#536)
* remove globalfee * tidy price feeder * remove stale const
1 parent 72f1c8a commit 08a5709

File tree

13 files changed

+6166
-6645
lines changed

13 files changed

+6166
-6645
lines changed

app/ante.go

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,30 +18,25 @@ import (
1818

1919
feeshareante "github.com/CosmosContracts/juno/v12/x/feeshare/ante"
2020
feesharekeeper "github.com/CosmosContracts/juno/v12/x/feeshare/keeper"
21-
gaiafeeante "github.com/cosmos/gaia/v8/x/globalfee/ante"
2221
)
2322

2423
func updateAppSimulationFlag(flag bool) {
2524
decorators.DefaultIsAppSimulation = flag
2625
}
2726

28-
const maxBypassMinFeeMsgGasUsage = 1_000_000
29-
3027
// HandlerOptions extends the SDK's AnteHandler options by requiring the IBC
3128
// channel keeper and a BankKeeper with an added method for fee sharing.
3229
type HandlerOptions struct {
3330
ante.HandlerOptions
3431

35-
GovKeeper govkeeper.Keeper
36-
IBCKeeper *ibckeeper.Keeper
37-
FeeShareKeeper feesharekeeper.Keeper
38-
BankKeeperFork feeshareante.BankKeeper
39-
TxCounterStoreKey sdk.StoreKey
40-
WasmConfig wasmTypes.WasmConfig
41-
Cdc codec.BinaryCodec
42-
BypassMinFeeMsgTypes []string
43-
GlobalFeeSubspace paramtypes.Subspace
44-
StakingSubspace paramtypes.Subspace
32+
GovKeeper govkeeper.Keeper
33+
IBCKeeper *ibckeeper.Keeper
34+
FeeShareKeeper feesharekeeper.Keeper
35+
BankKeeperFork feeshareante.BankKeeper
36+
TxCounterStoreKey sdk.StoreKey
37+
WasmConfig wasmTypes.WasmConfig
38+
Cdc codec.BinaryCodec
39+
StakingSubspace paramtypes.Subspace
4540
}
4641

4742
// NewAnteHandler returns an AnteHandler that checks and increments sequence
@@ -78,7 +73,6 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
7873
ante.NewTxTimeoutHeightDecorator(),
7974
ante.NewValidateMemoDecorator(options.AccountKeeper),
8075
ante.NewConsumeGasForTxSizeDecorator(options.AccountKeeper),
81-
gaiafeeante.NewFeeDecorator(options.BypassMinFeeMsgTypes, options.GlobalFeeSubspace, options.StakingSubspace, maxBypassMinFeeMsgGasUsage),
8276
ante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper),
8377
feeshareante.NewFeeSharePayoutDecorator(options.BankKeeperFork, options.FeeShareKeeper),
8478
// SetPubKeyDecorator must be called before all signature verification decorators

app/app.go

Lines changed: 8 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,7 @@ import (
3434
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
3535
upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client"
3636
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
37-
ibctransfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types"
3837
ibcclientclient "github.com/cosmos/ibc-go/v4/modules/core/02-client/client"
39-
ibcclienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types"
40-
ibcchanneltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types"
4138
"github.com/ignite-hq/cli/ignite/pkg/openapiconsole"
4239
"github.com/spf13/cast"
4340
abci "github.com/tendermint/tendermint/abci/types"
@@ -46,8 +43,6 @@ import (
4643
tmos "github.com/tendermint/tendermint/libs/os"
4744
dbm "github.com/tendermint/tm-db"
4845

49-
"github.com/cosmos/gaia/v8/x/globalfee"
50-
5146
"github.com/CosmWasm/wasmd/x/wasm"
5247
wasmclient "github.com/CosmWasm/wasmd/x/wasm/client"
5348
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
@@ -60,7 +55,6 @@ import (
6055
v11 "github.com/CosmosContracts/juno/v12/app/upgrades/v11"
6156
v12 "github.com/CosmosContracts/juno/v12/app/upgrades/v12"
6257
oracleclient "github.com/CosmosContracts/juno/v12/x/oracle/client"
63-
oracletypes "github.com/CosmosContracts/juno/v12/x/oracle/types"
6458
)
6559

6660
const (
@@ -307,16 +301,14 @@ func New(
307301
SigGasConsumer: ante.DefaultSigVerificationGasConsumer,
308302
},
309303

310-
GovKeeper: app.GovKeeper,
311-
IBCKeeper: app.IBCKeeper,
312-
FeeShareKeeper: app.FeeShareKeeper,
313-
BankKeeperFork: app.BankKeeper, // since we need extra methods
314-
TxCounterStoreKey: app.GetKey(wasm.StoreKey),
315-
WasmConfig: wasmConfig,
316-
Cdc: appCodec,
317-
BypassMinFeeMsgTypes: GetDefaultBypassFeeMessages(),
318-
GlobalFeeSubspace: app.GetSubspace(globalfee.ModuleName),
319-
StakingSubspace: app.GetSubspace(stakingtypes.ModuleName),
304+
GovKeeper: app.GovKeeper,
305+
IBCKeeper: app.IBCKeeper,
306+
FeeShareKeeper: app.FeeShareKeeper,
307+
BankKeeperFork: app.BankKeeper, // since we need extra methods
308+
TxCounterStoreKey: app.GetKey(wasm.StoreKey),
309+
WasmConfig: wasmConfig,
310+
Cdc: appCodec,
311+
StakingSubspace: app.GetSubspace(stakingtypes.ModuleName),
320312
},
321313
)
322314
if err != nil {
@@ -366,20 +358,6 @@ func New(
366358
return app
367359
}
368360

369-
func GetDefaultBypassFeeMessages() []string {
370-
return []string{
371-
// IBC
372-
sdk.MsgTypeURL(&ibcchanneltypes.MsgRecvPacket{}),
373-
sdk.MsgTypeURL(&ibcchanneltypes.MsgAcknowledgement{}),
374-
sdk.MsgTypeURL(&ibcclienttypes.MsgUpdateClient{}),
375-
sdk.MsgTypeURL(&ibctransfertypes.MsgTransfer{}),
376-
377-
// Oracle
378-
sdk.MsgTypeURL(&oracletypes.MsgAggregateExchangeRatePrevote{}),
379-
sdk.MsgTypeURL(&oracletypes.MsgAggregateExchangeRateVote{}),
380-
}
381-
}
382-
383361
// Name returns the name of the App
384362
func (app *App) Name() string {
385363
return app.BaseApp.Name()

app/keepers/keepers.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ import (
7777
icacontrollerkeeper "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/controller/keeper"
7878
icacontrollertypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/controller/types"
7979

80-
"github.com/cosmos/gaia/v8/x/globalfee"
8180
intertxkeeper "github.com/cosmos/interchain-accounts/x/inter-tx/keeper"
8281
intertxtypes "github.com/cosmos/interchain-accounts/x/inter-tx/types"
8382

@@ -528,7 +527,6 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino
528527
paramsKeeper.Subspace(oracletypes.ModuleName)
529528
paramsKeeper.Subspace(wasm.ModuleName)
530529
paramsKeeper.Subspace(tokenfactorytypes.ModuleName)
531-
paramsKeeper.Subspace(globalfee.ModuleName)
532530
paramsKeeper.Subspace(feesharetypes.ModuleName)
533531

534532
return paramsKeeper

app/modules.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ import (
4343
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
4444
"github.com/cosmos/cosmos-sdk/x/upgrade"
4545
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
46-
"github.com/cosmos/gaia/v8/x/globalfee"
4746
ica "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts"
4847
icatypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/types"
4948
ibcfee "github.com/cosmos/ibc-go/v4/modules/apps/29-fee"
@@ -106,7 +105,6 @@ var ModuleBasics = module.NewBasicManager(
106105
intertx.AppModuleBasic{},
107106
tokenfactory.AppModuleBasic{},
108107
feeshare.AppModuleBasic{},
109-
globalfee.AppModuleBasic{},
110108
ibchooks.AppModuleBasic{},
111109
packetforward.AppModuleBasic{},
112110
)
@@ -142,7 +140,6 @@ func appModules(
142140
transfer.NewAppModule(app.TransferKeeper),
143141
ibcfee.NewAppModule(app.IBCFeeKeeper),
144142
tokenfactory.NewAppModule(app.TokenFactoryKeeper, app.AccountKeeper, app.BankKeeper),
145-
globalfee.NewAppModule(app.GetSubspace(globalfee.ModuleName)),
146143
feeshare.NewAppModule(app.FeeShareKeeper, app.AccountKeeper),
147144
wasm.NewAppModule(appCodec, &app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper),
148145
ica.NewAppModule(&app.ICAControllerKeeper, &app.ICAHostKeeper),
@@ -214,7 +211,6 @@ func orderBeginBlockers() []string {
214211
oracletypes.ModuleName,
215212
tokenfactorytypes.ModuleName,
216213
feesharetypes.ModuleName,
217-
globalfee.ModuleName,
218214
wasm.ModuleName,
219215
ibchookstypes.ModuleName,
220216
}
@@ -248,7 +244,6 @@ func orderEndBlockers() []string {
248244
oracletypes.ModuleName,
249245
tokenfactorytypes.ModuleName,
250246
feesharetypes.ModuleName,
251-
globalfee.ModuleName,
252247
wasm.ModuleName,
253248
ibchookstypes.ModuleName,
254249
}
@@ -282,7 +277,6 @@ func orderInitBlockers() []string {
282277
ibcfeetypes.ModuleName,
283278
tokenfactorytypes.ModuleName,
284279
feesharetypes.ModuleName,
285-
globalfee.ModuleName,
286280
wasm.ModuleName,
287281
ibchookstypes.ModuleName,
288282
}

app/upgrades/v12/constants.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
feesharetypes "github.com/CosmosContracts/juno/v12/x/feeshare/types"
77
oracletypes "github.com/CosmosContracts/juno/v12/x/oracle/types"
88
store "github.com/cosmos/cosmos-sdk/store/types"
9-
"github.com/cosmos/gaia/v8/x/globalfee"
109
ibcfeetypes "github.com/cosmos/ibc-go/v4/modules/apps/29-fee/types"
1110
intertxtypes "github.com/cosmos/interchain-accounts/x/inter-tx/types"
1211
ibchookstypes "github.com/osmosis-labs/osmosis/x/ibc-hooks/types"
@@ -24,7 +23,6 @@ var Upgrade = upgrades.Upgrade{
2423
tokenfactorytypes.ModuleName,
2524
oracletypes.ModuleName,
2625
feesharetypes.ModuleName,
27-
globalfee.ModuleName,
2826
ibcfeetypes.ModuleName,
2927
intertxtypes.ModuleName,
3028
ibchookstypes.StoreKey,

app/upgrades/v12/upgrades.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import (
2626
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
2727
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
2828
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
29-
globalfeetypes "github.com/cosmos/gaia/v8/x/globalfee/types"
3029
ibcfeetypes "github.com/cosmos/ibc-go/v4/modules/apps/29-fee/types"
3130

3231
packetforwardtypes "github.com/strangelove-ventures/packet-forward-middleware/v4/router/types"
@@ -123,20 +122,6 @@ func CreateV12UpgradeHandler(
123122
keepers.ICAControllerKeeper.SetParams(ctx, icacontrollertypes.Params{ControllerEnabled: true})
124123
logger.Info("upgraded ICAHostKeeper params")
125124

126-
// GlobalFee
127-
minGasPrices := sdk.DecCoins{
128-
// 0.0025ujuno
129-
sdk.NewDecCoinFromDec(nativeDenom, sdk.NewDecWithPrec(25, 4)),
130-
// 0.001 ATOM CHANNEL-1 -> `junod q ibc-transfer denom-trace ibc/C4CFF46FD6DE35CA4CF4CE031E643C8FDC9BA4B99AE598E9B0ED98FE3A2319F9`
131-
sdk.NewDecCoinFromDec("ibc/C4CFF46FD6DE35CA4CF4CE031E643C8FDC9BA4B99AE598E9B0ED98FE3A2319F9", sdk.NewDecWithPrec(1, 3)),
132-
}
133-
s, ok := keepers.ParamsKeeper.GetSubspace(globalfeetypes.ModuleName)
134-
if !ok {
135-
panic("global fee params subspace not found")
136-
}
137-
s.Set(ctx, globalfeetypes.ParamStoreKeyMinGasPrices, minGasPrices)
138-
logger.Info(fmt.Sprintf("upgraded global fee params to %s", minGasPrices))
139-
140125
// Oracle
141126
newOracleParams := oracletypes.DefaultParams()
142127

0 commit comments

Comments
 (0)