diff --git a/cmd/osmosisd/cmd/root.go b/cmd/osmosisd/cmd/root.go index ed83d2d1cb9..572d8ae15da 100644 --- a/cmd/osmosisd/cmd/root.go +++ b/cmd/osmosisd/cmd/root.go @@ -463,6 +463,9 @@ arbitrage-min-gas-fee = ".005" # This is the minimum gas fee any tx with high gas demand should have, denominated in uosmo per gas # Default value of ".0025" then means that a tx with 1 million gas costs (.0025 uosmo/gas) * 1_000_000 gas = .0025 osmo min-gas-price-for-high-gas-tx = ".0025" + +# This parameter enables EIP-1559 like fee market logic in the mempool +adaptive-fee-enabled = "false" ` return OsmosisAppTemplate, OsmosisAppCfg diff --git a/proto/osmosis/txfees/v1beta1/query.proto b/proto/osmosis/txfees/v1beta1/query.proto index 702846dfdd8..9bf7c7ce233 100644 --- a/proto/osmosis/txfees/v1beta1/query.proto +++ b/proto/osmosis/txfees/v1beta1/query.proto @@ -34,6 +34,11 @@ service Query { rpc BaseDenom(QueryBaseDenomRequest) returns (QueryBaseDenomResponse) { option (google.api.http).get = "/osmosis/txfees/v1beta1/base_denom"; } + + // Returns a list of all base denom tokens and their corresponding pools. + rpc GetEipBaseFee(QueryEipBaseFeeRequest) returns (QueryEipBaseFeeResponse) { + option (google.api.http).get = "/osmosis/txfees/v1beta1/cur_eip_base_fee"; + } } message QueryFeeTokensRequest {} @@ -73,3 +78,13 @@ message QueryBaseDenomRequest {} message QueryBaseDenomResponse { string base_denom = 1 [ (gogoproto.moretags) = "yaml:\"base_denom\"" ]; } + +message QueryEipBaseFeeRequest {} +message QueryEipBaseFeeResponse { + string base_fee = 1 [ + (gogoproto.moretags) = "yaml:\"base_fee\"", + + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; +} diff --git a/x/txfees/client/cli/query.go b/x/txfees/client/cli/query.go index 77fb41f6380..92e293e16e4 100644 --- a/x/txfees/client/cli/query.go +++ b/x/txfees/client/cli/query.go @@ -15,6 +15,7 @@ func GetQueryCmd() *cobra.Command { GetCmdFeeTokens(), GetCmdDenomPoolID(), GetCmdBaseDenom(), + GetCmdQueryBaseFee(), ) return cmd @@ -52,3 +53,14 @@ func GetCmdBaseDenom() *cobra.Command { types.ModuleName, types.NewQueryClient, ) } + +func GetCmdQueryBaseFee() *cobra.Command { + return osmocli.SimpleQueryCmd[*types.QueryEipBaseFeeRequest]( + "base-fee", + "Query the eip base fee", + `{{.Short}}{{.ExampleHeader}} +{{.CommandPrefix}} base-fee +`, + types.ModuleName, types.NewQueryClient, + ) +} diff --git a/x/txfees/keeper/feedecorator.go b/x/txfees/keeper/feedecorator.go index c7c33ca5572..600c06007c1 100644 --- a/x/txfees/keeper/feedecorator.go +++ b/x/txfees/keeper/feedecorator.go @@ -8,6 +8,7 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/osmosis-labs/osmosis/osmomath" + mempool1559 "github.com/osmosis-labs/osmosis/v20/x/txfees/keeper/mempool-1559" "github.com/osmosis-labs/osmosis/v20/x/txfees/keeper/txfee_filters" "github.com/osmosis-labs/osmosis/v20/x/txfees/types" @@ -64,6 +65,12 @@ func (mfd MempoolFeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate b return ctx, types.ErrTooManyFeeCoins } + // TODO: Is there a better way to do this? + // I want ctx.IsDeliverTx() but that doesn't exist. + if !ctx.IsCheckTx() && !ctx.IsReCheckTx() { + mempool1559.DeliverTxCode(ctx, feeTx) + } + baseDenom, err := mfd.TxFeesKeeper.GetBaseDenom(ctx) if err != nil { return ctx, err @@ -146,6 +153,8 @@ func (k Keeper) IsSufficientFee(ctx sdk.Context, minBaseGasPrice osmomath.Dec, g } func (mfd MempoolFeeDecorator) GetMinBaseGasPriceForTx(ctx sdk.Context, baseDenom string, tx sdk.FeeTx) osmomath.Dec { + var is1559enabled = mfd.Opts.Mempool1559Enabled + cfgMinGasPrice := ctx.MinGasPrices().AmountOf(baseDenom) // the check below prevents tx gas from getting over HighGasTxThreshold which is default to 1_000_000 if tx.GetGas() >= mfd.Opts.HighGasTxThreshold { @@ -154,6 +163,14 @@ func (mfd MempoolFeeDecorator) GetMinBaseGasPriceForTx(ctx sdk.Context, baseDeno if txfee_filters.IsArbTxLoose(tx) { cfgMinGasPrice = sdk.MaxDec(cfgMinGasPrice, mfd.Opts.MinGasPriceForArbitrageTx) } + // Initial tx only, no recheck + if is1559enabled && ctx.IsCheckTx() && !ctx.IsReCheckTx() { + cfgMinGasPrice = sdk.MaxDec(cfgMinGasPrice, mempool1559.CurEipState.GetCurBaseFee()) + } + // RecheckTx only + if is1559enabled && ctx.IsReCheckTx() { + cfgMinGasPrice = sdk.MaxDec(cfgMinGasPrice, mempool1559.CurEipState.GetCurRecheckBaseFee()) + } return cfgMinGasPrice } diff --git a/x/txfees/keeper/grpc_query.go b/x/txfees/keeper/grpc_query.go index 5ff2aabb97e..fc14d6a978e 100644 --- a/x/txfees/keeper/grpc_query.go +++ b/x/txfees/keeper/grpc_query.go @@ -9,6 +9,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + mempool1559 "github.com/osmosis-labs/osmosis/v20/x/txfees/keeper/mempool-1559" "github.com/osmosis-labs/osmosis/v20/x/txfees/types" ) @@ -18,6 +19,7 @@ var _ types.QueryServer = Querier{} // handlers. type Querier struct { Keeper + mempool1559.EipState } func NewQuerier(k Keeper) Querier { @@ -83,3 +85,8 @@ func (q Querier) BaseDenom(ctx context.Context, _ *types.QueryBaseDenomRequest) return &types.QueryBaseDenomResponse{BaseDenom: baseDenom}, nil } + +func (q Querier) GetEipBaseFee(_ context.Context, _ *types.QueryEipBaseFeeRequest) (*types.QueryEipBaseFeeResponse, error) { + response := mempool1559.CurEipState.GetCurBaseFee() + return &types.QueryEipBaseFeeResponse{BaseFee: response}, nil +} diff --git a/x/txfees/keeper/mempool-1559/.gitignore b/x/txfees/keeper/mempool-1559/.gitignore new file mode 100644 index 00000000000..ab7853345b7 --- /dev/null +++ b/x/txfees/keeper/mempool-1559/.gitignore @@ -0,0 +1 @@ +eip1559state.json \ No newline at end of file diff --git a/x/txfees/keeper/mempool-1559/code.go b/x/txfees/keeper/mempool-1559/code.go new file mode 100644 index 00000000000..63521da2358 --- /dev/null +++ b/x/txfees/keeper/mempool-1559/code.go @@ -0,0 +1,181 @@ +package mempool1559 + +import ( + "encoding/json" + "fmt" + "os" + + sdk "github.com/cosmos/cosmos-sdk/types" + + osmomath "github.com/osmosis-labs/osmosis/osmomath" +) + +/* + This is the logic for the Osmosis implementation for EIP-1559 fee market, + the goal of this code is to prevent spam by charging more for transactions when the network is busy. + + This logic does two things: + - Maintaining data parsed from chain transaction execution and updating eipState accordingly. + - Resetting eipState to default every ResetInterval (1000) block height intervals to maintain consistency. + + Additionally: + - Periodically evaluating CheckTx and RecheckTx for compliance with these parameters. + + Note: The reset interval is set to 1000 blocks, which is approximately 2 hours. Consider adjusting for a smaller time interval (e.g., 500 blocks = 1 hour) if necessary. + + Challenges: + - Transactions falling under their gas bounds are currently discarded by nodes. This behavior can be modified for CheckTx, rather than RecheckTx. + + Global variables stored in memory: + - DefaultBaseFee: Default base fee, initialized to 0.0025. + - MinBaseFee: Minimum base fee, initialized to 0.0025. + - MaxBaseFee: Maximum base fee, initialized to 10. + - MaxBlockChangeRate: The maximum block change rate, initialized to 1/16. + + Global constants: + - TargetGas: Gas wanted per block, initialized to 60,000,000. + - ResetInterval: The interval at which eipState is reset, initialized to 1000 blocks. + - BackupFile: File for backup, set to "eip1559state.json". + - RecheckFeeConstant: A constant value for rechecking fees, initialized to 4. +*/ + +var ( + DefaultBaseFee = sdk.MustNewDecFromStr("0.0025") + MinBaseFee = sdk.MustNewDecFromStr("0.0025") + MaxBaseFee = sdk.MustNewDecFromStr("10") + MaxBlockChangeRate = sdk.NewDec(1).Quo(sdk.NewDec(16)) +) + +const ( + TargetGas = int64(60_000_000) + ResetInterval = int64(1000) + BackupFile = "eip1559state.json" + RecheckFeeConstant = int64(4) +) + +// EipState tracks the current base fee and totalGasWantedThisBlock +// this structure is never written to state +type EipState struct { + lastBlockHeight int64 + totalGasWantedThisBlock int64 + + CurBaseFee osmomath.Dec `json:"cur_base_fee"` +} + +// CurEipState is a global variable used in the BeginBlock, EndBlock and +// DeliverTx (fee decorator AnteHandler) functions, it's also using when determining +// if a transaction has enough gas to successfully execute +var CurEipState = EipState{ + lastBlockHeight: 0, + totalGasWantedThisBlock: 0, + CurBaseFee: sdk.NewDec(0), +} + +// startBlock is executed at the start of each block and is responsible for reseting the state +// of the CurBaseFee when the node reaches the reset interval +func (e *EipState) startBlock(height int64) { + e.lastBlockHeight = height + e.totalGasWantedThisBlock = 0 + + if e.CurBaseFee.Equal(sdk.NewDec(0)) { + // CurBaseFee has not been initialized yet. This only happens when the node has just started. + // Try to read the previous value from the backup file and if not available, set it to the default. + e.CurBaseFee = e.tryLoad() + } + + // we reset the CurBaseFee every ResetInterval + if height%ResetInterval == 0 { + e.CurBaseFee = DefaultBaseFee.Clone() + } +} + +// deliverTxCode runs on every transaction in the feedecorator ante handler and sums the gas of each transaction +func (e *EipState) deliverTxCode(ctx sdk.Context, tx sdk.FeeTx) { + if ctx.BlockHeight() != e.lastBlockHeight { + ctx.Logger().Error("Something is off here? ctx.BlockHeight() != e.lastBlockHeight", ctx.BlockHeight(), e.lastBlockHeight) + } + e.totalGasWantedThisBlock += int64(tx.GetGas()) +} + +// updateBaseFee updates of a base fee in Osmosis. +// It employs the following equation to calculate the new base fee: +// +// baseFeeMultiplier = 1 + (gasUsed - targetGas) / targetGas * maxChangeRate +// newBaseFee = baseFee * baseFeeMultiplier +// +// updateBaseFee runs at the end of every block +func (e *EipState) updateBaseFee(height int64) { + if height != e.lastBlockHeight { + fmt.Println("Something is off here? height != e.lastBlockHeight", height, e.lastBlockHeight) + } + e.lastBlockHeight = height + + gasUsed := e.totalGasWantedThisBlock + gasDiff := gasUsed - TargetGas + // (gasUsed - targetGas) / targetGas * maxChangeRate + baseFeeIncrement := sdk.NewDec(gasDiff).Quo(sdk.NewDec(TargetGas)).Mul(MaxBlockChangeRate) + baseFeeMultiplier := sdk.NewDec(1).Add(baseFeeIncrement) + e.CurBaseFee.MulMut(baseFeeMultiplier) + + // Enforce the minimum base fee by resetting the CurBaseFee is it drops below the MinBaseFee + if e.CurBaseFee.LT(MinBaseFee) { + e.CurBaseFee = MinBaseFee.Clone() + } + + // Enforce the maximum base fee by resetting the CurBaseFee is it goes above the MaxBaseFee + if e.CurBaseFee.GT(MaxBaseFee) { + e.CurBaseFee = MaxBaseFee.Clone() + } + + go e.tryPersist() +} + +// GetCurBaseFee returns a clone of the CurBaseFee to avoid overwriting the initial value in +// the EipState, we use this in the AnteHandler to Check transactions +func (e *EipState) GetCurBaseFee() osmomath.Dec { + return e.CurBaseFee.Clone() +} + +// GetCurRecheckBaseFee returns a clone of the CurBaseFee / RecheckFeeConstant to account for +// rechecked transactions in the feedecorator ante handler +func (e *EipState) GetCurRecheckBaseFee() osmomath.Dec { + return e.CurBaseFee.Clone().Quo(sdk.NewDec(RecheckFeeConstant)) +} + +// tryPersist persists the eip1559 state to disk in the form of a json file +// we do this in case a node stops and it can continue functioning as normal +func (e *EipState) tryPersist() { + bz, err := json.Marshal(e) + if err != nil { + fmt.Println("Error marshalling eip1559 state", err) + return + } + + err = os.WriteFile(BackupFile, bz, 0644) + if err != nil { + fmt.Println("Error writing eip1559 state", err) + return + } +} + +// tryLoad reads eip1559 state from disk and initializes the CurEipState to +// the previous state when a node is restarted +func (e *EipState) tryLoad() osmomath.Dec { + bz, err := os.ReadFile(BackupFile) + if err != nil { + fmt.Println("Error reading eip1559 state", err) + fmt.Println("Setting eip1559 state to default value", MinBaseFee) + return MinBaseFee.Clone() + } + + var loaded EipState + err = json.Unmarshal(bz, &loaded) + if err != nil { + fmt.Println("Error unmarshalling eip1559 state", err) + fmt.Println("Setting eip1559 state to default value", MinBaseFee) + return MinBaseFee.Clone() + } + + fmt.Println("Loaded eip1559 state. CurBaseFee=", loaded.CurBaseFee) + return loaded.CurBaseFee.Clone() +} diff --git a/x/txfees/keeper/mempool-1559/code_test.go b/x/txfees/keeper/mempool-1559/code_test.go new file mode 100644 index 00000000000..bae57e7e022 --- /dev/null +++ b/x/txfees/keeper/mempool-1559/code_test.go @@ -0,0 +1,84 @@ +package mempool1559 + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/tendermint/tendermint/libs/log" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "gotest.tools/assert" + + "github.com/osmosis-labs/osmosis/osmoutils/noapptest" +) + +// TestUpdateBaseFee simulates the update of a base fee in Osmosis. +// It employs the following equation to calculate the new base fee: +// +// baseFeeMultiplier = 1 + (gasUsed - targetGas) / targetGas * maxChangeRate +// newBaseFee = baseFee * baseFeeMultiplier +// +// The function iterates through a series of simulated blocks and transactions, +// updating and validating the base fee at each step to ensure it follows the equation. +func TestUpdateBaseFee(t *testing.T) { + // Create an instance of eipState + eip := &EipState{ + lastBlockHeight: 0, + totalGasWantedThisBlock: 0, + CurBaseFee: DefaultBaseFee.Clone(), + } + + // we iterate over 1000 blocks as the reset happens after 1000 blocks + for i := 1; i <= 1002; i++ { + // create a new block + ctx := sdk.NewContext(nil, tmproto.Header{Height: int64(i)}, false, log.NewNopLogger()) + + // start the new block + eip.startBlock(int64(i)) + + // generate transactions + if i%10 == 0 { + for j := 1; j <= 3; j++ { + tx := GenTx(uint64(500000000 + i)) + eip.deliverTxCode(ctx, tx.(sdk.FeeTx)) + } + } + baseFeeBeforeUpdate := eip.GetCurBaseFee() + + // update base fee + eip.updateBaseFee(int64(i)) + + // calcualte the base fees + expectedBaseFee := calculateBaseFee(eip.totalGasWantedThisBlock, baseFeeBeforeUpdate) + + // Assert that the actual result matches the expected result + assert.DeepEqual(t, expectedBaseFee, eip.CurBaseFee) + } +} + +// calculateBaseFee is the same as in is defined on the eip1559 code +func calculateBaseFee(totalGasWantedThisBlock int64, eipStateCurBaseFee sdk.Dec) (expectedBaseFee sdk.Dec) { + gasUsed := totalGasWantedThisBlock + gasDiff := gasUsed - TargetGas + + baseFeeIncrement := sdk.NewDec(gasDiff).Quo(sdk.NewDec(TargetGas)).Mul(MaxBlockChangeRate) + expectedBaseFeeMultiplier := sdk.NewDec(1).Add(baseFeeIncrement) + expectedBaseFee = eipStateCurBaseFee.MulMut(expectedBaseFeeMultiplier) + + if expectedBaseFee.LT(MinBaseFee) { + expectedBaseFee = MinBaseFee + } + + if expectedBaseFee.GT(MaxBaseFee) { + expectedBaseFee = MaxBaseFee.Clone() + } + + return expectedBaseFee +} + +// GenTx generates a mock gas transaction. +func GenTx(gas uint64) sdk.Tx { + gen := noapptest.MakeTestEncodingConfig().TxConfig + txBuilder := gen.NewTxBuilder() + txBuilder.SetGasLimit(gas) + return txBuilder.GetTx() +} diff --git a/x/txfees/keeper/mempool-1559/state_compatible_update_logic.go b/x/txfees/keeper/mempool-1559/state_compatible_update_logic.go new file mode 100644 index 00000000000..ad4c1bf65e5 --- /dev/null +++ b/x/txfees/keeper/mempool-1559/state_compatible_update_logic.go @@ -0,0 +1,21 @@ +package mempool1559 + +import sdk "github.com/cosmos/cosmos-sdk/types" + +// DeliverTxCode is run on every transaction and will collect +// the gas for every transaction for use calculating gas +func DeliverTxCode(ctx sdk.Context, tx sdk.FeeTx) { + CurEipState.deliverTxCode(ctx, tx) +} + +// BeginBlockCode runs at the start of every block and it +// reset the CurEipStates lastBlockHeight and totalGasWantedThisBlock +func BeginBlockCode(ctx sdk.Context) { + CurEipState.startBlock(ctx.BlockHeight()) +} + +// EndBlockCode runs at the end of every block and it +// updates the base fee based on the block attributes +func EndBlockCode(ctx sdk.Context) { + CurEipState.updateBaseFee(ctx.BlockHeight()) +} diff --git a/x/txfees/module.go b/x/txfees/module.go index a85c83ab168..91c67dd46a8 100644 --- a/x/txfees/module.go +++ b/x/txfees/module.go @@ -26,6 +26,7 @@ import ( "github.com/osmosis-labs/osmosis/v20/x/txfees/client/cli" "github.com/osmosis-labs/osmosis/v20/x/txfees/keeper" + mempool1559 "github.com/osmosis-labs/osmosis/v20/x/txfees/keeper/mempool-1559" "github.com/osmosis-labs/osmosis/v20/x/txfees/types" ) @@ -148,11 +149,14 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw } // BeginBlock executes all ABCI BeginBlock logic respective to the txfees module. -func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} +func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) { + mempool1559.BeginBlockCode(ctx) +} // EndBlock executes all ABCI EndBlock logic respective to the txfees module. It // returns no validator updates. -func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { +func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { + mempool1559.EndBlockCode(ctx) return []abci.ValidatorUpdate{} } diff --git a/x/txfees/types/options.go b/x/txfees/types/options.go index 4191b5a253f..c08c1b73fac 100644 --- a/x/txfees/types/options.go +++ b/x/txfees/types/options.go @@ -2,6 +2,8 @@ package types import ( "fmt" + "strconv" + "strings" "github.com/spf13/cast" @@ -21,13 +23,17 @@ var ( DefaultMinGasPriceForHighGasTx = osmomath.ZeroDec() DefaultMaxGasWantedPerTx = uint64(25 * 1000 * 1000) DefaultHighGasTxThreshold = uint64(1 * 1000 * 1000) + DefaultMempool1559Enabled = false ) +var GlobalMempool1559Enabled = false + type MempoolFeeOptions struct { MaxGasWantedPerTx uint64 MinGasPriceForArbitrageTx osmomath.Dec HighGasTxThreshold uint64 MinGasPriceForHighGasTx osmomath.Dec + Mempool1559Enabled bool } func NewDefaultMempoolFeeOptions() MempoolFeeOptions { @@ -36,6 +42,7 @@ func NewDefaultMempoolFeeOptions() MempoolFeeOptions { MinGasPriceForArbitrageTx: DefaultMinGasPriceForArbitrageTx.Clone(), HighGasTxThreshold: DefaultHighGasTxThreshold, MinGasPriceForHighGasTx: DefaultMinGasPriceForHighGasTx.Clone(), + Mempool1559Enabled: DefaultMempool1559Enabled, } } @@ -45,6 +52,7 @@ func NewMempoolFeeOptions(opts servertypes.AppOptions) MempoolFeeOptions { MinGasPriceForArbitrageTx: parseMinGasPriceForArbitrageTx(opts), HighGasTxThreshold: DefaultHighGasTxThreshold, MinGasPriceForHighGasTx: parseMinGasPriceForHighGasTx(opts), + Mempool1559Enabled: parseMempool1559(opts), } } @@ -68,6 +76,11 @@ func parseMinGasPriceForHighGasTx(opts servertypes.AppOptions) osmomath.Dec { return parseDecFromConfig(opts, "min-gas-price-for-high-gas-tx", DefaultMinGasPriceForHighGasTx.Clone()) } +func parseMempool1559(opts servertypes.AppOptions) bool { + GlobalMempool1559Enabled = parseBoolFromConfig(opts, "adaptive-fee-enabled", DefaultMempool1559Enabled) + return GlobalMempool1559Enabled +} + func parseDecFromConfig(opts servertypes.AppOptions, optName string, defaultValue osmomath.Dec) osmomath.Dec { valueInterface := opts.Get("osmosis-mempool." + optName) value := defaultValue @@ -85,3 +98,23 @@ func parseDecFromConfig(opts servertypes.AppOptions, optName string, defaultValu } return value } + +func parseBoolFromConfig(opts servertypes.AppOptions, optName string, defaultValue bool) bool { + fullOptName := "osmosis-mempool." + optName + valueInterface := opts.Get(fullOptName) + value := defaultValue + if valueInterface != nil { + valueStr, ok := valueInterface.(string) + if !ok { + panic("invalidly configured osmosis-mempool." + optName) + } + valueStr = strings.TrimSpace(valueStr) + v, err := strconv.ParseBool(valueStr) + if err != nil { + fmt.Println("error in parsing" + fullOptName + " as bool, setting to false") + return false + } + return v + } + return value +} diff --git a/x/txfees/types/query.pb.go b/x/txfees/types/query.pb.go index 787e706c2b7..07b8dff91f1 100644 --- a/x/txfees/types/query.pb.go +++ b/x/txfees/types/query.pb.go @@ -372,6 +372,79 @@ func (m *QueryBaseDenomResponse) GetBaseDenom() string { return "" } +type QueryEipBaseFeeRequest struct { +} + +func (m *QueryEipBaseFeeRequest) Reset() { *m = QueryEipBaseFeeRequest{} } +func (m *QueryEipBaseFeeRequest) String() string { return proto.CompactTextString(m) } +func (*QueryEipBaseFeeRequest) ProtoMessage() {} +func (*QueryEipBaseFeeRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_6cbc1b48c44dfdd6, []int{8} +} +func (m *QueryEipBaseFeeRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryEipBaseFeeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryEipBaseFeeRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryEipBaseFeeRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryEipBaseFeeRequest.Merge(m, src) +} +func (m *QueryEipBaseFeeRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryEipBaseFeeRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryEipBaseFeeRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryEipBaseFeeRequest proto.InternalMessageInfo + +type QueryEipBaseFeeResponse struct { + BaseFee cosmossdk_io_math.LegacyDec `protobuf:"bytes,1,opt,name=base_fee,json=baseFee,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"base_fee" yaml:"base_fee"` +} + +func (m *QueryEipBaseFeeResponse) Reset() { *m = QueryEipBaseFeeResponse{} } +func (m *QueryEipBaseFeeResponse) String() string { return proto.CompactTextString(m) } +func (*QueryEipBaseFeeResponse) ProtoMessage() {} +func (*QueryEipBaseFeeResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_6cbc1b48c44dfdd6, []int{9} +} +func (m *QueryEipBaseFeeResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryEipBaseFeeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryEipBaseFeeResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryEipBaseFeeResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryEipBaseFeeResponse.Merge(m, src) +} +func (m *QueryEipBaseFeeResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryEipBaseFeeResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryEipBaseFeeResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryEipBaseFeeResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*QueryFeeTokensRequest)(nil), "osmosis.txfees.v1beta1.QueryFeeTokensRequest") proto.RegisterType((*QueryFeeTokensResponse)(nil), "osmosis.txfees.v1beta1.QueryFeeTokensResponse") @@ -381,6 +454,8 @@ func init() { proto.RegisterType((*QueryDenomPoolIdResponse)(nil), "osmosis.txfees.v1beta1.QueryDenomPoolIdResponse") proto.RegisterType((*QueryBaseDenomRequest)(nil), "osmosis.txfees.v1beta1.QueryBaseDenomRequest") proto.RegisterType((*QueryBaseDenomResponse)(nil), "osmosis.txfees.v1beta1.QueryBaseDenomResponse") + proto.RegisterType((*QueryEipBaseFeeRequest)(nil), "osmosis.txfees.v1beta1.QueryEipBaseFeeRequest") + proto.RegisterType((*QueryEipBaseFeeResponse)(nil), "osmosis.txfees.v1beta1.QueryEipBaseFeeResponse") } func init() { @@ -388,46 +463,51 @@ func init() { } var fileDescriptor_6cbc1b48c44dfdd6 = []byte{ - // 614 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0xc1, 0x6a, 0x13, 0x41, - 0x18, 0xc7, 0xb3, 0xd5, 0x16, 0x32, 0x95, 0xa2, 0x83, 0x6d, 0xe3, 0x56, 0x36, 0x61, 0x50, 0x29, - 0x95, 0xec, 0xb4, 0x89, 0x82, 0x78, 0x33, 0x84, 0x82, 0x50, 0xa4, 0xae, 0x82, 0xd0, 0xcb, 0xb2, - 0x9b, 0x7c, 0xd9, 0x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9, 0x7f, 0xd6, 0xf2, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x6d, 0x9b, - 0x9f, 0x16, 0x12, 0x06, 0x00, 0x00, + // 693 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0xc1, 0x4e, 0x13, 0x51, + 0x14, 0xed, 0xa0, 0xa0, 0x7d, 0x28, 0xea, 0x8b, 0x40, 0x1d, 0xcc, 0x94, 0xbc, 0xa8, 0x21, 0x98, + 0xce, 0x83, 0xa2, 0xc6, 0xb8, 0xb3, 0xa9, 0x18, 0x13, 0x62, 0x60, 0x34, 0x31, 0x61, 0x33, 0x99, + 0x69, 0xef, 0x94, 0x09, 0x6d, 0xdf, 0xd0, 0xf7, 0x4a, 0x68, 0x8c, 0x1b, 0xbf, 0xc0, 0xc4, 0xc4, + 0x0f, 0x60, 0xe3, 0xce, 0xbd, 0x7f, 0xc0, 0x92, 0xc4, 0x8d, 0x71, 0xd1, 0x18, 0xf0, 0x0b, 0xf8, + 0x02, 0x33, 0x6f, 0xde, 0x74, 0x0a, 0x74, 0x68, 0xd9, 0x75, 0xe6, 0xde, 0x7b, 0xce, 0xb9, 0x73, + 0xcf, 0x49, 0x11, 0x61, 0xbc, 0xc1, 0xb8, 0xcf, 0xa9, 0xd8, 0xf3, 0x00, 0x38, 0xdd, 0x5d, 0x76, + 0x41, 0x38, 0xcb, 0x74, 0xa7, 0x0d, 0xad, 0x8e, 0x19, 0xb4, 0x98, 0x60, 0x78, 0x46, 0xf5, 0x98, + 0x51, 0x8f, 0xa9, 0x7a, 0xf4, 0xbb, 0x35, 0x56, 0x63, 0xb2, 0x85, 0x86, 0xbf, 0xa2, 0x6e, 0xfd, + 0x7e, 0x8d, 0xb1, 0x5a, 0x1d, 0xa8, 0x13, 0xf8, 0xd4, 0x69, 0x36, 0x99, 0x70, 0x84, 0xcf, 0x9a, + 0x5c, 0x55, 0x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0x33, 0xb1, 0xb4, 0xed, 0x76, 0xa2, 0x3b, 0xe3, 0xef, 0x1a, 0x9a, 0xec, 0x33, 0x22, 0xa6, 0xc3, + 0x99, 0x4f, 0xb9, 0x5e, 0x5f, 0x1a, 0x7d, 0x40, 0xe9, 0x7c, 0x2a, 0x75, 0x52, 0x5c, 0x48, 0xd3, + 0x29, 0x95, 0xd9, 0xca, 0xef, 0xf4, 0xa3, 0x7c, 0xfc, 0x24, 0x6f, 0xde, 0x73, 0xf4, 0x90, 0x9b, + 0x9f, 0x8d, 0xc4, 0x90, 0x9b, 0x9f, 0x0b, 0xca, 0xf0, 0x9b, 0x27, 0x51, 0xc1, 0xfb, 0x1a, 0xba, + 0xf9, 0x1a, 0x44, 0x92, 0x01, 0x7c, 0x31, 0xdb, 0xb9, 0x18, 0xe9, 0x74, 0xe4, 0x7e, 0x25, 0x6f, + 0x49, 0xca, 0x5b, 0xc4, 0x0b, 0x69, 0xf2, 0x2a, 0xed, 0x96, 0x0d, 0x7e, 0x60, 0xc7, 0x29, 0x2a, + 0xad, 0x1d, 0x1c, 0x19, 0xda, 0xe1, 0x91, 0xa1, 0xfd, 0x3d, 0x32, 0xb4, 0x2f, 0xc7, 0x46, 0xe6, + 0xf0, 0xd8, 0xc8, 0xfc, 0x3e, 0x36, 0x32, 0x9b, 0xc5, 0x9a, 0x2f, 0xb6, 0xda, 0xae, 0x59, 0x61, + 0x8d, 0x18, 0xad, 0x50, 0x77, 0x5c, 0xde, 0x83, 0xde, 0x2d, 0x2e, 0xd1, 0xbd, 0x98, 0x40, 0x74, + 0x02, 0xe0, 0xee, 0x84, 0xfc, 0x1b, 0x5a, 0xf9, 0x1f, 0x00, 0x00, 0xff, 0xff, 0x4c, 0x09, 0x67, + 0xf4, 0x3f, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -452,6 +532,8 @@ type QueryClient interface { DenomPoolId(ctx context.Context, in *QueryDenomPoolIdRequest, opts ...grpc.CallOption) (*QueryDenomPoolIdResponse, error) // Returns a list of all base denom tokens and their corresponding pools. BaseDenom(ctx context.Context, in *QueryBaseDenomRequest, opts ...grpc.CallOption) (*QueryBaseDenomResponse, error) + // Returns a list of all base denom tokens and their corresponding pools. + GetEipBaseFee(ctx context.Context, in *QueryEipBaseFeeRequest, opts ...grpc.CallOption) (*QueryEipBaseFeeResponse, error) } type queryClient struct { @@ -498,6 +580,15 @@ func (c *queryClient) BaseDenom(ctx context.Context, in *QueryBaseDenomRequest, return out, nil } +func (c *queryClient) GetEipBaseFee(ctx context.Context, in *QueryEipBaseFeeRequest, opts ...grpc.CallOption) (*QueryEipBaseFeeResponse, error) { + out := new(QueryEipBaseFeeResponse) + err := c.cc.Invoke(ctx, "/osmosis.txfees.v1beta1.Query/GetEipBaseFee", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // FeeTokens returns a list of all the whitelisted fee tokens and their @@ -510,6 +601,8 @@ type QueryServer interface { DenomPoolId(context.Context, *QueryDenomPoolIdRequest) (*QueryDenomPoolIdResponse, error) // Returns a list of all base denom tokens and their corresponding pools. BaseDenom(context.Context, *QueryBaseDenomRequest) (*QueryBaseDenomResponse, error) + // Returns a list of all base denom tokens and their corresponding pools. + GetEipBaseFee(context.Context, *QueryEipBaseFeeRequest) (*QueryEipBaseFeeResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -528,6 +621,9 @@ func (*UnimplementedQueryServer) DenomPoolId(ctx context.Context, req *QueryDeno func (*UnimplementedQueryServer) BaseDenom(ctx context.Context, req *QueryBaseDenomRequest) (*QueryBaseDenomResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method BaseDenom not implemented") } +func (*UnimplementedQueryServer) GetEipBaseFee(ctx context.Context, req *QueryEipBaseFeeRequest) (*QueryEipBaseFeeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetEipBaseFee not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -605,6 +701,24 @@ func _Query_BaseDenom_Handler(srv interface{}, ctx context.Context, dec func(int return interceptor(ctx, in, info, handler) } +func _Query_GetEipBaseFee_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryEipBaseFeeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).GetEipBaseFee(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/osmosis.txfees.v1beta1.Query/GetEipBaseFee", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).GetEipBaseFee(ctx, req.(*QueryEipBaseFeeRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "osmosis.txfees.v1beta1.Query", HandlerType: (*QueryServer)(nil), @@ -625,6 +739,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "BaseDenom", Handler: _Query_BaseDenom_Handler, }, + { + MethodName: "GetEipBaseFee", + Handler: _Query_GetEipBaseFee_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "osmosis/txfees/v1beta1/query.proto", @@ -869,6 +987,62 @@ func (m *QueryBaseDenomResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *QueryEipBaseFeeRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryEipBaseFeeRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryEipBaseFeeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryEipBaseFeeResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryEipBaseFeeResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryEipBaseFeeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.BaseFee.Size() + i -= size + if _, err := m.BaseFee.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -978,6 +1152,26 @@ func (m *QueryBaseDenomResponse) Size() (n int) { return n } +func (m *QueryEipBaseFeeRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryEipBaseFeeResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.BaseFee.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1586,6 +1780,140 @@ func (m *QueryBaseDenomResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryEipBaseFeeRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryEipBaseFeeRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryEipBaseFeeRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryEipBaseFeeResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryEipBaseFeeResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryEipBaseFeeResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BaseFee", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.BaseFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/txfees/types/query.pb.gw.go b/x/txfees/types/query.pb.gw.go index 0b3b114be5d..daced8132d0 100644 --- a/x/txfees/types/query.pb.gw.go +++ b/x/txfees/types/query.pb.gw.go @@ -159,6 +159,24 @@ func local_request_Query_BaseDenom_0(ctx context.Context, marshaler runtime.Mars } +func request_Query_GetEipBaseFee_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryEipBaseFeeRequest + var metadata runtime.ServerMetadata + + msg, err := client.GetEipBaseFee(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_GetEipBaseFee_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryEipBaseFeeRequest + var metadata runtime.ServerMetadata + + msg, err := server.GetEipBaseFee(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -257,6 +275,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_GetEipBaseFee_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_GetEipBaseFee_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_GetEipBaseFee_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -378,6 +419,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_GetEipBaseFee_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_GetEipBaseFee_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_GetEipBaseFee_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -389,6 +450,8 @@ var ( pattern_Query_DenomPoolId_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"osmosis", "txfees", "v1beta1", "denom_pool_id", "denom"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_BaseDenom_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"osmosis", "txfees", "v1beta1", "base_denom"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_GetEipBaseFee_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"osmosis", "txfees", "v1beta1", "cur_eip_base_fee"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -399,4 +462,6 @@ var ( forward_Query_DenomPoolId_0 = runtime.ForwardResponseMessage forward_Query_BaseDenom_0 = runtime.ForwardResponseMessage + + forward_Query_GetEipBaseFee_0 = runtime.ForwardResponseMessage )