From e9dfbd7a9f3d4d0c7e8f32735953aaa39610fa41 Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Mon, 26 Aug 2024 11:37:39 -0500 Subject: [PATCH] remove: globalfee module (bad UX) --- simapp/app/ante.go | 7 +----- simapp/app/app.go | 42 +-------------------------------- simapp/go.mod | 1 - simapp/go.sum | 2 -- simapp/interchaintest/go.mod_ | 1 - simapp/interchaintest/go.sum | 2 -- simapp/interchaintest/setup.go | 4 ---- simapp/scripts/test_ics_node.sh | 4 +--- simapp/scripts/test_node.sh | 2 -- 9 files changed, 3 insertions(+), 62 deletions(-) diff --git a/simapp/app/ante.go b/simapp/app/ante.go index 741b57d0..3fcdd8ab 100644 --- a/simapp/app/ante.go +++ b/simapp/app/ante.go @@ -19,9 +19,6 @@ import ( sdkmath "cosmossdk.io/math" poaante "github.com/strangelove-ventures/poa/ante" - globalfeeante "github.com/strangelove-ventures/globalfee/x/globalfee/ante" - globalfeekeeper "github.com/strangelove-ventures/globalfee/x/globalfee/keeper" - consumerdemocracy "github.com/cosmos/interchain-security/v5/app/consumer-democracy" ccvdemocracyante "github.com/cosmos/interchain-security/v5/app/consumer-democracy/ante" ccvconsumerante "github.com/cosmos/interchain-security/v5/app/consumer/ante" @@ -39,7 +36,6 @@ type HandlerOptions struct { TXCounterStoreService corestoretypes.KVStoreService CircuitKeeper *circuitkeeper.Keeper - GlobalFeeKeeper globalfeekeeper.Keeper BypassMinFeeMsgTypes []string ConsumerKeeper ccvconsumerkeeper.Keeper } @@ -83,8 +79,7 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) { ante.NewTxTimeoutHeightDecorator(), ante.NewValidateMemoDecorator(options.AccountKeeper), ante.NewConsumeGasForTxSizeDecorator(options.AccountKeeper), - globalfeeante.NewFeeDecorator(options.BypassMinFeeMsgTypes, options.GlobalFeeKeeper, 2_000_000), - //ante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper, options.TxFeeChecker), // ?spawntag:globalfee + ante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper, options.TxFeeChecker), ante.NewSetPubKeyDecorator(options.AccountKeeper), // SetPubKeyDecorator must be called before all signature verification decorators ante.NewValidateSigCountDecorator(options.AccountKeeper), ante.NewSigGasConsumeDecorator(options.AccountKeeper, options.SigGasConsumer), diff --git a/simapp/app/app.go b/simapp/app/app.go index b73249ae..1e86b874 100644 --- a/simapp/app/app.go +++ b/simapp/app/app.go @@ -134,8 +134,6 @@ import ( stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - ibcchanneltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" - "github.com/CosmWasm/wasmd/x/wasm" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" @@ -154,10 +152,6 @@ import ( poakeeper "github.com/strangelove-ventures/poa/keeper" poamodule "github.com/strangelove-ventures/poa/module" - globalfee "github.com/strangelove-ventures/globalfee/x/globalfee" - globalfeekeeper "github.com/strangelove-ventures/globalfee/x/globalfee/keeper" - globalfeetypes "github.com/strangelove-ventures/globalfee/x/globalfee/types" - "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward" packetforwardkeeper "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward/keeper" packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward/types" @@ -287,7 +281,6 @@ type ChainApp struct { WasmKeeper wasmkeeper.Keeper TokenFactoryKeeper tokenfactorykeeper.Keeper POAKeeper poakeeper.Keeper - GlobalFeeKeeper globalfeekeeper.Keeper PacketForwardKeeper *packetforwardkeeper.Keeper WasmClientKeeper wasmlckeeper.Keeper RatelimitKeeper ratelimitkeeper.Keeper @@ -414,7 +407,6 @@ func NewChainApp( icacontrollertypes.StoreKey, tokenfactorytypes.StoreKey, poa.StoreKey, - globalfeetypes.StoreKey, packetforwardtypes.StoreKey, wasmlctypes.StoreKey, ratelimittypes.StoreKey, @@ -719,13 +711,6 @@ func NewChainApp( // If evidence needs to be handled for the app, set routes in router here and seal app.EvidenceKeeper = *evidenceKeeper - // Create the globalfee keeper - app.GlobalFeeKeeper = globalfeekeeper.NewKeeper( - appCodec, - app.keys[globalfeetypes.StoreKey], - authtypes.NewModuleAddress(govtypes.ModuleName).String(), - ) - // Create the tokenfactory keeper app.TokenFactoryKeeper = tokenfactorykeeper.NewKeeper( appCodec, @@ -995,7 +980,6 @@ func NewChainApp( // custom tokenfactory.NewAppModule(app.TokenFactoryKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(tokenfactorytypes.ModuleName)), poamodule.NewAppModule(appCodec, app.POAKeeper), - globalfee.NewAppModule(appCodec, app.GlobalFeeKeeper), packetforward.NewAppModule(app.PacketForwardKeeper, app.GetSubspace(packetforwardtypes.ModuleName)), wasmlc.NewAppModule(app.WasmClientKeeper), ratelimit.NewAppModule(appCodec, app.RatelimitKeeper), @@ -1110,7 +1094,6 @@ func NewChainApp( wasmtypes.ModuleName, // wasm after ibc transfer poa.ModuleName, tokenfactorytypes.ModuleName, - globalfeetypes.ModuleName, packetforwardtypes.ModuleName, wasmlctypes.ModuleName, ratelimittypes.ModuleName, @@ -1181,10 +1164,7 @@ func NewChainApp( WasmKeeper: &app.WasmKeeper, TXCounterStoreService: runtime.NewKVStoreService(keys[wasmtypes.StoreKey]), CircuitKeeper: &app.CircuitKeeper, - - GlobalFeeKeeper: app.GlobalFeeKeeper, - BypassMinFeeMsgTypes: GetDefaultBypassFeeMessages(), //spawntag:globalfee - ConsumerKeeper: app.ConsumerKeeper, + ConsumerKeeper: app.ConsumerKeeper, }, ) if err != nil { @@ -1260,25 +1240,6 @@ func NewChainApp( return app } -// - func (app *ChainApp) FinalizeBlock(req *abci.RequestFinalizeBlock) (*abci.ResponseFinalizeBlock, error) { // when skipping sdk 47 for sdk 50, the upgrade handler is called too late in BaseApp // this is a hack to ensure that the migration is executed when needed and not panics @@ -1544,7 +1505,6 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino paramsKeeper.Subspace(wasmtypes.ModuleName) paramsKeeper.Subspace(tokenfactorytypes.ModuleName) paramsKeeper.Subspace(poa.ModuleName) - paramsKeeper.Subspace(globalfee.ModuleName) paramsKeeper.Subspace(packetforwardtypes.ModuleName).WithKeyTable(packetforwardtypes.ParamKeyTable()) paramsKeeper.Subspace(ratelimittypes.ModuleName) paramsKeeper.Subspace(ccvconsumertypes.ModuleName) diff --git a/simapp/go.mod b/simapp/go.mod index d436b350..43b1544e 100644 --- a/simapp/go.mod +++ b/simapp/go.mod @@ -61,7 +61,6 @@ require ( github.com/spf13/cobra v1.8.1 github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.18.2 - github.com/strangelove-ventures/globalfee v0.50.1 github.com/strangelove-ventures/poa v0.50.3 github.com/strangelove-ventures/tokenfactory v0.50.3 github.com/stretchr/testify v1.9.0 diff --git a/simapp/go.sum b/simapp/go.sum index 3386e9f0..b492f258 100644 --- a/simapp/go.sum +++ b/simapp/go.sum @@ -987,8 +987,6 @@ github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.17.0 h1:I5txKw7MJasPL/BrfkbA0Jyo/oELqVmux4pR/UxOMfI= github.com/spf13/viper v1.17.0/go.mod h1:BmMMMLQXSbcHK6KAOiFLz0l5JHrU89OdIRHvsk0+yVI= -github.com/strangelove-ventures/globalfee v0.50.1 h1:UkRoJOFNiswmbAxaTPUI1HndTxQ28XD3yWwYwX6AjI8= -github.com/strangelove-ventures/globalfee v0.50.1/go.mod h1:PSXvznw0SrYj0M36vfnUf5+BVuPJgY58do+wU7HpC2Y= github.com/strangelove-ventures/poa v0.50.3 h1:Ib9t8TObkd8LWQYt+pFxJVnxA4jEfr0HM8bgBytXcE4= github.com/strangelove-ventures/poa v0.50.3/go.mod h1:hCoBNFkrAxmRvVVXVsaIN8j3jpxzBUxDXZ0LP3NrRyw= github.com/strangelove-ventures/tokenfactory v0.50.3 h1:MccxHYUHjMHDOxcmx/HJs1mU4zVhli1f4sz3126Wzr8= diff --git a/simapp/interchaintest/go.mod_ b/simapp/interchaintest/go.mod_ index cf8da4b6..4e64431d 100644 --- a/simapp/interchaintest/go.mod_ +++ b/simapp/interchaintest/go.mod_ @@ -24,7 +24,6 @@ require ( github.com/cosmos/cosmos-sdk v0.50.9 github.com/cosmos/ibc-go/v8 v8.4.0 github.com/cosmos/interchain-security/v5 v5.0.0 - github.com/strangelove-ventures/globalfee v0.50.1 github.com/strangelove-ventures/interchaintest/v8 v8.5.0 github.com/strangelove-ventures/poa v0.50.3 github.com/strangelove-ventures/tokenfactory v0.50.3 diff --git a/simapp/interchaintest/go.sum b/simapp/interchaintest/go.sum index 83ab66fd..75aa16af 100644 --- a/simapp/interchaintest/go.sum +++ b/simapp/interchaintest/go.sum @@ -1791,8 +1791,6 @@ github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.17.0 h1:I5txKw7MJasPL/BrfkbA0Jyo/oELqVmux4pR/UxOMfI= github.com/spf13/viper v1.17.0/go.mod h1:BmMMMLQXSbcHK6KAOiFLz0l5JHrU89OdIRHvsk0+yVI= -github.com/strangelove-ventures/globalfee v0.50.1 h1:UkRoJOFNiswmbAxaTPUI1HndTxQ28XD3yWwYwX6AjI8= -github.com/strangelove-ventures/globalfee v0.50.1/go.mod h1:PSXvznw0SrYj0M36vfnUf5+BVuPJgY58do+wU7HpC2Y= github.com/strangelove-ventures/interchaintest/v8 v8.5.0 h1:U5zh42iq5KkTq0oI1GdQjFnhoiaxbzM3Ud8OKfa/poA= github.com/strangelove-ventures/interchaintest/v8 v8.5.0/go.mod h1:UPMvR1joIXO8RMxDozoHIInLZWmd2345PSGLJYWyrwY= github.com/strangelove-ventures/poa v0.50.3 h1:Ib9t8TObkd8LWQYt+pFxJVnxA4jEfr0HM8bgBytXcE4= diff --git a/simapp/interchaintest/setup.go b/simapp/interchaintest/setup.go index 6935446d..c870ae82 100644 --- a/simapp/interchaintest/setup.go +++ b/simapp/interchaintest/setup.go @@ -18,7 +18,6 @@ import ( wasm "github.com/CosmWasm/wasmd/x/wasm/types" ibcconntypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types" ccvconsumertypes "github.com/cosmos/interchain-security/v5/x/ccv/consumer/types" - globalfee "github.com/strangelove-ventures/globalfee/x/globalfee/types" poa "github.com/strangelove-ventures/poa" tokenfactory "github.com/strangelove-ventures/tokenfactory/x/tokenfactory/types" ) @@ -45,8 +44,6 @@ var ( cosmos.NewGenesisKV("app_state.gov.params.max_deposit_period", MaxDepositPeriod), cosmos.NewGenesisKV("app_state.gov.params.min_deposit.0.denom", Denom), cosmos.NewGenesisKV("app_state.gov.params.min_deposit.0.amount", "1"), - // globalfee: set minimum fee requirements - cosmos.NewGenesisKV("app_state.globalfee.params.minimum_gas_prices", sdk.DecCoins{sdk.NewDecCoinFromDec(Denom, sdkmath.LegacyMustNewDecFromStr("0.0"))}), // tokenfactory: set create cost in set denom or in gas usage. cosmos.NewGenesisKV("app_state.tokenfactory.params.denom_creation_fee", nil), cosmos.NewGenesisKV("app_state.tokenfactory.params.denom_creation_gas_consume", 1), // cost 1 gas to create a new denom @@ -120,7 +117,6 @@ func GetEncodingConfig() *moduletestutil.TestEncodingConfig { // TODO: add encoding types here for the modules you want to use wasm.RegisterInterfaces(cfg.InterfaceRegistry) tokenfactory.RegisterInterfaces(cfg.InterfaceRegistry) - globalfee.RegisterInterfaces(cfg.InterfaceRegistry) poa.RegisterInterfaces(cfg.InterfaceRegistry) ccvconsumertypes.RegisterInterfaces(cfg.InterfaceRegistry) return &cfg diff --git a/simapp/scripts/test_ics_node.sh b/simapp/scripts/test_ics_node.sh index a1b6e75b..5199966b 100644 --- a/simapp/scripts/test_ics_node.sh +++ b/simapp/scripts/test_ics_node.sh @@ -90,8 +90,6 @@ from_scratch () { update_test_genesis `printf '.app_state["crisis"]["constant_fee"]={"denom":"%s","amount":"1000"}' $DENOM` # === CUSTOM MODULES === - # globalfee - update_test_genesis `printf '.app_state["globalfee"]["params"]["minimum_gas_prices"]=[{"amount":"0.000000000000000000","denom":"%s"}]' $DENOM` # tokenfactory update_test_genesis '.app_state["tokenfactory"]["params"]["denom_creation_fee"]=[]' update_test_genesis '.app_state["tokenfactory"]["params"]["denom_creation_gas_consume"]=100000' @@ -145,4 +143,4 @@ sed -i -e 's/address = ":8080"/address = "0.0.0.0:'$ROSETTA'"/g' $HOME_DIR/confi sed -i -e 's/timeout_commit = "5s"/timeout_commit = "'$BLOCK_TIME'"/g' $HOME_DIR/config/config.toml # Start the daemon in the background -$BINARY start --pruning=nothing --minimum-gas-prices=0$DENOM --rpc.laddr="tcp://0.0.0.0:$RPC" --home $HOME_DIR \ No newline at end of file +$BINARY start --pruning=nothing --minimum-gas-prices=0$DENOM --rpc.laddr="tcp://0.0.0.0:$RPC" --home $HOME_DIR diff --git a/simapp/scripts/test_node.sh b/simapp/scripts/test_node.sh index 48d75118..6aad7b62 100644 --- a/simapp/scripts/test_node.sh +++ b/simapp/scripts/test_node.sh @@ -102,8 +102,6 @@ from_scratch () { update_test_genesis `printf '.app_state["crisis"]["constant_fee"]={"denom":"%s","amount":"1000"}' $DENOM` # === CUSTOM MODULES === - # globalfee - update_test_genesis `printf '.app_state["globalfee"]["params"]["minimum_gas_prices"]=[{"amount":"0.000000000000000000","denom":"%s"}]' $DENOM` # tokenfactory update_test_genesis '.app_state["tokenfactory"]["params"]["denom_creation_fee"]=[]' update_test_genesis '.app_state["tokenfactory"]["params"]["denom_creation_gas_consume"]=100000'