Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions simapp/app/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -39,7 +36,6 @@ type HandlerOptions struct {
TXCounterStoreService corestoretypes.KVStoreService
CircuitKeeper *circuitkeeper.Keeper

GlobalFeeKeeper globalfeekeeper.Keeper
BypassMinFeeMsgTypes []string
ConsumerKeeper ccvconsumerkeeper.Keeper
}
Expand Down Expand Up @@ -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),
Expand Down
42 changes: 1 addition & 41 deletions simapp/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -414,7 +407,6 @@ func NewChainApp(
icacontrollertypes.StoreKey,
tokenfactorytypes.StoreKey,
poa.StoreKey,
globalfeetypes.StoreKey,
packetforwardtypes.StoreKey,
wasmlctypes.StoreKey,
ratelimittypes.StoreKey,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -1110,7 +1094,6 @@ func NewChainApp(
wasmtypes.ModuleName, // wasm after ibc transfer
poa.ModuleName,
tokenfactorytypes.ModuleName,
globalfeetypes.ModuleName,
packetforwardtypes.ModuleName,
wasmlctypes.ModuleName,
ratelimittypes.ModuleName,
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -1260,25 +1240,6 @@ func NewChainApp(
return app
}

// <spawntag:globalfee
func GetDefaultBypassFeeMessages() []string {
return []string{
sdk.MsgTypeURL(&ibcchanneltypes.MsgRecvPacket{}),
sdk.MsgTypeURL(&ibcchanneltypes.MsgAcknowledgement{}),
sdk.MsgTypeURL(&ibcclienttypes.MsgCreateClient{}),
sdk.MsgTypeURL(&ibcclienttypes.MsgUpdateClient{}),
sdk.MsgTypeURL(&ibcclienttypes.MsgUpgradeClient{}),
sdk.MsgTypeURL(&ibctransfertypes.MsgTransfer{}),
sdk.MsgTypeURL(&ibcchanneltypes.MsgTimeout{}),
sdk.MsgTypeURL(&ibcchanneltypes.MsgTimeoutOnClose{}),
sdk.MsgTypeURL(&ibcchanneltypes.MsgChannelOpenTry{}),
sdk.MsgTypeURL(&ibcchanneltypes.MsgChannelOpenConfirm{}),
sdk.MsgTypeURL(&ibcchanneltypes.MsgChannelOpenAck{}),
}
}

// spawntag:globalfee>

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
Expand Down Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion simapp/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions simapp/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
1 change: 0 additions & 1 deletion simapp/interchaintest/go.mod_
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions simapp/interchaintest/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
4 changes: 0 additions & 4 deletions simapp/interchaintest/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions simapp/scripts/test_ics_node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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
$BINARY start --pruning=nothing --minimum-gas-prices=0$DENOM --rpc.laddr="tcp://0.0.0.0:$RPC" --home $HOME_DIR
2 changes: 0 additions & 2 deletions simapp/scripts/test_node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down