From dd9f6870111063fe20cf0dcf754a7085844ce014 Mon Sep 17 00:00:00 2001 From: Dev Ojha Date: Tue, 31 Oct 2023 18:52:55 +0100 Subject: [PATCH 01/10] Try respect authz (#6793) --- x/txfees/keeper/txfee_filters/arb_tx.go | 60 +++++++++++++++++-------- 1 file changed, 41 insertions(+), 19 deletions(-) diff --git a/x/txfees/keeper/txfee_filters/arb_tx.go b/x/txfees/keeper/txfee_filters/arb_tx.go index 1d1c8e7e17a..012d01c6344 100644 --- a/x/txfees/keeper/txfee_filters/arb_tx.go +++ b/x/txfees/keeper/txfee_filters/arb_tx.go @@ -1,6 +1,8 @@ package txfee_filters import ( + authztypes "github.com/cosmos/cosmos-sdk/x/authz" + gammtypes "github.com/osmosis-labs/osmosis/v20/x/gamm/types" poolmanagertypes "github.com/osmosis-labs/osmosis/v20/x/poolmanager/types" @@ -23,33 +25,53 @@ func IsArbTxLoose(tx sdk.Tx) bool { swapInDenom := "" lpTypesSeen := make(map[gammtypes.LiquidityChangeType]bool, 2) + isArb := false for _, m := range msgs { - // (4) Check that the tx doesn't have both JoinPool & ExitPool msgs - lpMsg, isLpMsg := m.(gammtypes.LiquidityChangeMsg) - if isLpMsg { - lpTypesSeen[lpMsg.LiquidityChangeType()] = true - if len(lpTypesSeen) > 1 { - return true - } + swapInDenom, isArb = isArbTxLooseAuthz(m, swapInDenom, lpTypesSeen) + if isArb { + return true } + } - swapMsg, isSwapMsg := m.(poolmanagertypes.SwapMsgRoute) - if !isSwapMsg { - continue - } + return false +} - // (1) Check that swap denom in != swap denom out - if swapMsg.TokenInDenom() == swapMsg.TokenOutDenom() { - return true +func isArbTxLooseAuthz(msg sdk.Msg, swapInDenom string, lpTypesSeen map[gammtypes.LiquidityChangeType]bool) (string, bool) { + if authzMsg, ok := msg.(*authztypes.MsgExec); ok { + msgs, _ := authzMsg.GetMessages() + for _, m := range msgs { + swapInDenom, isAuthz := isArbTxLooseAuthz(m, swapInDenom, lpTypesSeen) + if isAuthz { + return swapInDenom, true + } } + return swapInDenom, false + } - // (2) - if swapInDenom != "" && swapMsg.TokenInDenom() != swapInDenom { - return true + // (4) Check that the tx doesn't have both JoinPool & ExitPool msgs + lpMsg, isLpMsg := msg.(gammtypes.LiquidityChangeMsg) + if isLpMsg { + lpTypesSeen[lpMsg.LiquidityChangeType()] = true + if len(lpTypesSeen) > 1 { + return swapInDenom, true } - swapInDenom = swapMsg.TokenInDenom() } - return false + swapMsg, isSwapMsg := msg.(poolmanagertypes.SwapMsgRoute) + if !isSwapMsg { + return swapInDenom, false + } + + // (1) Check that swap denom in != swap denom out + if swapMsg.TokenInDenom() == swapMsg.TokenOutDenom() { + return swapInDenom, true + } + + // (2) + if swapInDenom != "" && swapMsg.TokenInDenom() != swapInDenom { + return swapInDenom, true + } + swapInDenom = swapMsg.TokenInDenom() + return swapInDenom, false } From 3477983b82eca136aebd0577e46822c9de0d02e3 Mon Sep 17 00:00:00 2001 From: Dev Ojha Date: Thu, 2 Nov 2023 19:43:41 +0100 Subject: [PATCH 02/10] fix split route (#6810) --- x/poolmanager/types/msg_swap.go | 64 ++++++++++++++++++++++++- x/txfees/keeper/txfee_filters/arb_tx.go | 16 +++++++ 2 files changed, 79 insertions(+), 1 deletion(-) diff --git a/x/poolmanager/types/msg_swap.go b/x/poolmanager/types/msg_swap.go index 38d2090740a..478e0ef60ef 100644 --- a/x/poolmanager/types/msg_swap.go +++ b/x/poolmanager/types/msg_swap.go @@ -7,11 +7,73 @@ type SwapMsgRoute interface { TokenDenomsOnPath() []string } +type MultiSwapMsgRoute interface { + GetSwapMsgs() []SwapMsgRoute +} + +func (msg MsgSplitRouteSwapExactAmountIn) GetSwapMsgs() []SwapMsgRoute { + routes := make([]SwapMsgRoute, len(msg.Routes)) + for i := 0; i < len(msg.Routes); i++ { + routes[i] = SwapAmountInSplitRouteWrapper{msg.Routes[i].Pools, msg.TokenInDenom} + } + return routes +} + +func (msg MsgSplitRouteSwapExactAmountOut) GetSwapMsgs() []SwapMsgRoute { + routes := make([]SwapMsgRoute, len(msg.Routes)) + for i := 0; i < len(msg.Routes); i++ { + routes[i] = SwapAmountOutSplitRouteWrapper{msg.Routes[i].Pools, msg.TokenOutDenom} + } + return routes +} + +type SwapAmountInSplitRouteWrapper struct { + Pools []SwapAmountInRoute `json:"pools"` + InDenom string `json:"in_denom"` +} + +type SwapAmountOutSplitRouteWrapper struct { + Pools []SwapAmountOutRoute `json:"pools"` + OutDenom string `json:"in_denom"` +} + var ( - _ SwapMsgRoute = MsgSwapExactAmountOut{} _ SwapMsgRoute = MsgSwapExactAmountIn{} + _ SwapMsgRoute = MsgSwapExactAmountOut{} + _ SwapMsgRoute = SwapAmountInSplitRouteWrapper{} + _ SwapMsgRoute = SwapAmountOutSplitRouteWrapper{} ) +func (msg SwapAmountOutSplitRouteWrapper) TokenInDenom() string { + return msg.Pools[0].TokenInDenom +} +func (msg SwapAmountOutSplitRouteWrapper) TokenOutDenom() string { + return msg.OutDenom +} +func (msg SwapAmountOutSplitRouteWrapper) TokenDenomsOnPath() []string { + denoms := make([]string, 0, len(msg.Pools)+1) + for i := 0; i < len(msg.Pools); i++ { + denoms = append(denoms, msg.Pools[i].TokenInDenom) + } + denoms = append(denoms, msg.TokenOutDenom()) + return denoms +} + +func (msg SwapAmountInSplitRouteWrapper) TokenInDenom() string { + return msg.InDenom +} +func (msg SwapAmountInSplitRouteWrapper) TokenOutDenom() string { + return msg.Pools[len(msg.Pools)-1].TokenOutDenom +} +func (msg SwapAmountInSplitRouteWrapper) TokenDenomsOnPath() []string { + denoms := make([]string, 0, len(msg.Pools)+1) + denoms = append(denoms, msg.TokenInDenom()) + for i := 0; i < len(msg.Pools); i++ { + denoms = append(denoms, msg.Pools[i].TokenOutDenom) + } + return denoms +} + func (msg MsgSwapExactAmountOut) TokenInDenom() string { return msg.Routes[0].GetTokenInDenom() } diff --git a/x/txfees/keeper/txfee_filters/arb_tx.go b/x/txfees/keeper/txfee_filters/arb_tx.go index 012d01c6344..266fd7fd5b1 100644 --- a/x/txfees/keeper/txfee_filters/arb_tx.go +++ b/x/txfees/keeper/txfee_filters/arb_tx.go @@ -58,11 +58,27 @@ func isArbTxLooseAuthz(msg sdk.Msg, swapInDenom string, lpTypesSeen map[gammtype } } + multiSwapMsg, isMultiSwapMsg := msg.(poolmanagertypes.MultiSwapMsgRoute) + if isMultiSwapMsg { + for _, swapMsg := range multiSwapMsg.GetSwapMsgs() { + // TODO: Fix this later + swapInDenom, isArb := isArbTxLooseSwapMsg(swapMsg, swapInDenom) + if isArb { + return swapInDenom, true + } + } + return swapInDenom, false + } + swapMsg, isSwapMsg := msg.(poolmanagertypes.SwapMsgRoute) if !isSwapMsg { return swapInDenom, false } + return isArbTxLooseSwapMsg(swapMsg, swapInDenom) +} + +func isArbTxLooseSwapMsg(swapMsg poolmanagertypes.SwapMsgRoute, swapInDenom string) (string, bool) { // (1) Check that swap denom in != swap denom out if swapMsg.TokenInDenom() == swapMsg.TokenOutDenom() { return swapInDenom, true From eb8fbe05450d329bd86b00b8ae9b41797583b088 Mon Sep 17 00:00:00 2001 From: Dev Ojha Date: Fri, 3 Nov 2023 21:20:34 +0100 Subject: [PATCH 03/10] Dev/mempool 1559 (#6811) * initial commit * More skeleton code * Is this good for testing? * sync * better comment * fix * Update * add cli * fix code * ensure it doesn't go below min * export eip struct * Update smth * update * moire prints * change target to 40M to see what happens * reparam + config * Nicolas/1559 persist (#6812) * persisting to disk * better prints after testing * add max base fee * cloning everywhere to be safe * chore: add unit tests to eip code * Add a recheck bound * Cfg + adjust constants * Make a GlobalMempool * Ok testing * remove log * lint * Apply @pipello 's code suggestions * chore: add comments to eip-1559 code (#6818) * chore: add comments to eip-1559 code * Update x/txfees/keeper/mempool-1559/code.go Co-authored-by: Roman * Update x/txfees/keeper/mempool-1559/code.go Co-authored-by: Roman * chore: add logger, use const instead of var * chore: remove sleep in test --------- Co-authored-by: Roman * add app.toml options for all vars * Revert "add app.toml options for all vars" This reverts commit 6fa54ba25d2aee360286e51ab6be3ac924629a16. --------- Co-authored-by: Adam Tucker Co-authored-by: Nicolas Lara Co-authored-by: PaddyMc Co-authored-by: Roman --- cmd/osmosisd/cmd/root.go | 3 + proto/osmosis/txfees/v1beta1/query.proto | 15 + x/txfees/client/cli/query.go | 12 + x/txfees/keeper/feedecorator.go | 17 + x/txfees/keeper/grpc_query.go | 7 + x/txfees/keeper/mempool-1559/.gitignore | 1 + x/txfees/keeper/mempool-1559/code.go | 181 ++++++++ x/txfees/keeper/mempool-1559/code_test.go | 84 ++++ .../state_compatible_update_logic.go | 21 + x/txfees/module.go | 8 +- x/txfees/types/options.go | 33 ++ x/txfees/types/query.pb.go | 408 ++++++++++++++++-- x/txfees/types/query.pb.gw.go | 65 +++ 13 files changed, 813 insertions(+), 42 deletions(-) create mode 100644 x/txfees/keeper/mempool-1559/.gitignore create mode 100644 x/txfees/keeper/mempool-1559/code.go create mode 100644 x/txfees/keeper/mempool-1559/code_test.go create mode 100644 x/txfees/keeper/mempool-1559/state_compatible_update_logic.go 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, 0x2e, 0x4d, 0x32, 0xdb, 0xcc, 0xa4, 0x34, 0x88, 0x17, 0x9f, 0x40, 0x50, 0x7c, - 0x00, 0x2f, 0xde, 0x7c, 0x8e, 0x1e, 0x0b, 0x5e, 0xc4, 0x43, 0x90, 0xc4, 0x27, 0xc8, 0x13, 0xc8, - 0xce, 0xce, 0x66, 0xd3, 0x36, 0x6b, 0x9a, 0x5b, 0x66, 0xbe, 0xff, 0xf7, 0xff, 0xfe, 0x5f, 0xe6, - 0x97, 0x20, 0xc2, 0x78, 0x8b, 0x71, 0x9f, 0x53, 0x71, 0xda, 0x00, 0xe0, 0xf4, 0x64, 0xc7, 0x05, - 0xe1, 0xec, 0xd0, 0xe3, 0x2e, 0x74, 0x7a, 0x66, 0xd0, 0x61, 0x82, 0xe1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 0x4a, 0xb6, 0xdb, 0x8b, 0xbe, 0x5f, 0xfc, 0x5d, 0x43, 0xcb, - 0x13, 0x00, 0x60, 0x3a, 0x7b, 0xf2, 0x05, 0xda, 0xf4, 0xed, 0xeb, 0x37, 0xa8, 0x9c, 0x4f, 0x65, - 0x4e, 0x8a, 0x8b, 0x69, 0x39, 0x65, 0x32, 0x5b, 0x71, 0x46, 0xdf, 0xcb, 0xe3, 0x07, 0xf9, 0xe6, - 0x63, 0x92, 0x66, 0xbc, 0xf9, 0x65, 0x14, 0x67, 0xbc, 0xf9, 0x15, 0x40, 0x67, 0xbf, 0x79, 0x82, - 0x68, 0x65, 0xef, 0x6c, 0x60, 0x68, 0xe7, 0x03, 0x43, 0xfb, 0x33, 0x30, 0xb4, 0x4f, 0x43, 0x23, - 0x73, 0x3e, 0x34, 0x32, 0xbf, 0x86, 0x46, 0xe6, 0xa0, 0xe4, 0xf9, 0xe2, 0xb0, 0xeb, 0x9a, 0x35, - 0xd6, 0x8a, 0x7d, 0x8a, 0x4d, 0xc7, 0xe5, 0x63, 0xd3, 0x93, 0xd2, 0x36, 0x3d, 0x8d, 0xad, 0x45, - 0x2f, 0x00, 0xee, 0x2e, 0xc9, 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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b, 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 ) From e2a167694a14a3a99e0dd6ecb91c64a85b8538dc Mon Sep 17 00:00:00 2001 From: Dev Ojha Date: Thu, 9 Nov 2023 11:38:17 -0500 Subject: [PATCH 04/10] Tune 1559 params (#6844) --- x/txfees/keeper/mempool-1559/code.go | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/x/txfees/keeper/mempool-1559/code.go b/x/txfees/keeper/mempool-1559/code.go index 63521da2358..36d18c57042 100644 --- a/x/txfees/keeper/mempool-1559/code.go +++ b/x/txfees/keeper/mempool-1559/code.go @@ -40,17 +40,22 @@ import ( */ var ( - DefaultBaseFee = sdk.MustNewDecFromStr("0.0025") - MinBaseFee = sdk.MustNewDecFromStr("0.0025") - MaxBaseFee = sdk.MustNewDecFromStr("10") - MaxBlockChangeRate = sdk.NewDec(1).Quo(sdk.NewDec(16)) + DefaultBaseFee = sdk.MustNewDecFromStr("0.0025") + MinBaseFee = sdk.MustNewDecFromStr("0.0025") + MaxBaseFee = sdk.MustNewDecFromStr("10") + + // Max increase per block is a factor of 15/14, max decrease is 9/10 + MaxBlockChangeRate = sdk.NewDec(1).Quo(sdk.NewDec(10)) + TargetGas = int64(70_000_000) + // In face of continuous spam, will take ~21 blocks from base fee > spam cost, to mempool eviction + // ceil(log_{15/14}(RecheckFeeConstant)) + // So potentially 2 minutes of impaired UX from 1559 nodes on top of time to get to base fee > spam. + RecheckFeeConstant = int64(4) + ResetInterval = int64(1000) ) const ( - TargetGas = int64(60_000_000) - ResetInterval = int64(1000) - BackupFile = "eip1559state.json" - RecheckFeeConstant = int64(4) + BackupFile = "eip1559state.json" ) // EipState tracks the current base fee and totalGasWantedThisBlock From 932f26d2762762a9448e0eb44c60a79608761c6e Mon Sep 17 00:00:00 2001 From: Dev Ojha Date: Thu, 9 Nov 2023 12:05:29 -0500 Subject: [PATCH 05/10] Fix CLI --- x/txfees/client/cli/query.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/x/txfees/client/cli/query.go b/x/txfees/client/cli/query.go index 92e293e16e4..cb320d818f0 100644 --- a/x/txfees/client/cli/query.go +++ b/x/txfees/client/cli/query.go @@ -15,9 +15,10 @@ func GetQueryCmd() *cobra.Command { GetCmdFeeTokens(), GetCmdDenomPoolID(), GetCmdBaseDenom(), - GetCmdQueryBaseFee(), ) + osmocli.AddQueryCmd(cmd, types.NewQueryClient, GetCmdQueryBaseFee) + return cmd } @@ -54,13 +55,12 @@ func GetCmdBaseDenom() *cobra.Command { ) } -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, - ) +func GetCmdQueryBaseFee() (*osmocli.QueryDescriptor, *types.QueryEipBaseFeeRequest) { + return &osmocli.QueryDescriptor{ + Use: "base-fee", + Short: "Query the eip base fee.", + Long: `{{.Short}}{{.ExampleHeader}} +{{.CommandPrefix}} base-fee`, + QueryFnName: "GetEipBaseFee", + }, &types.QueryEipBaseFeeRequest{} } From 877ac0550d926a684608d082f3616115649539b7 Mon Sep 17 00:00:00 2001 From: Alpo <62043214+AlpinYukseloglu@users.noreply.github.com> Date: Thu, 9 Nov 2023 09:23:19 -0800 Subject: [PATCH 06/10] fix comments to align with new tuned params (#6846) --- x/txfees/keeper/mempool-1559/code.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/txfees/keeper/mempool-1559/code.go b/x/txfees/keeper/mempool-1559/code.go index 36d18c57042..04c1664dab4 100644 --- a/x/txfees/keeper/mempool-1559/code.go +++ b/x/txfees/keeper/mempool-1559/code.go @@ -30,10 +30,10 @@ import ( - 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. + - MaxBlockChangeRate: The maximum block change rate, initialized to 1/10. Global constants: - - TargetGas: Gas wanted per block, initialized to 60,000,000. + - TargetGas: Gas wanted per block, initialized to 70,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. From c7f27954dbf617e3dfbbe40cf9cec9a313cc72c2 Mon Sep 17 00:00:00 2001 From: Dev Ojha Date: Thu, 9 Nov 2023 12:48:41 -0500 Subject: [PATCH 07/10] Add new query (#6855) --- proto/osmosis/superfluid/query.proto | 12 + x/superfluid/keeper/grpc_query.go | 10 + x/superfluid/types/expected_keepers.go | 1 + x/superfluid/types/query.pb.go | 642 ++++++++++++++++++++----- x/superfluid/types/query.pb.gw.go | 83 ++++ 5 files changed, 619 insertions(+), 129 deletions(-) diff --git a/proto/osmosis/superfluid/query.proto b/proto/osmosis/superfluid/query.proto index e3dc87c09e0..2eace443b27 100644 --- a/proto/osmosis/superfluid/query.proto +++ b/proto/osmosis/superfluid/query.proto @@ -141,6 +141,10 @@ service Query { "account_undelegating_cl_positions/" "{delegator_address}"; } + + rpc RestSupply(QueryRestSupplyRequest) returns (QueryRestSupplyResponse) { + option (google.api.http).get = "/osmosis/superfluid/v1beta1/supply"; + } } message QueryParamsRequest {} @@ -320,3 +324,11 @@ message UserConcentratedSuperfluidPositionsUndelegatingResponse { repeated ConcentratedPoolUserPositionRecord cl_pool_user_position_records = 1 [ (gogoproto.nullable) = false ]; } + +// THIS QUERY IS TEMPORARY +message QueryRestSupplyRequest { string denom = 1; } + +message QueryRestSupplyResponse { + // amount is the supply of the coin. + cosmos.base.v1beta1.Coin amount = 1 [ (gogoproto.nullable) = false ]; +} diff --git a/x/superfluid/keeper/grpc_query.go b/x/superfluid/keeper/grpc_query.go index 61baeb81ebc..d65dacc88aa 100644 --- a/x/superfluid/keeper/grpc_query.go +++ b/x/superfluid/keeper/grpc_query.go @@ -704,3 +704,13 @@ func (q Querier) filterConcentratedPositionLocks(ctx sdk.Context, positions []mo } return clPoolUserPositionRecords, nil } + +// TEMPORARY CODE +func (q Querier) RestSupply(goCtx context.Context, req *types.QueryRestSupplyRequest) (*types.QueryRestSupplyResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + supply := q.bk.GetSupply(sdk.UnwrapSDKContext(goCtx), req.Denom) + return &types.QueryRestSupplyResponse{Amount: supply}, nil +} diff --git a/x/superfluid/types/expected_keepers.go b/x/superfluid/types/expected_keepers.go index 3000986b717..b20cd370cdc 100644 --- a/x/superfluid/types/expected_keepers.go +++ b/x/superfluid/types/expected_keepers.go @@ -67,6 +67,7 @@ type BankKeeper interface { AddSupplyOffset(ctx sdk.Context, denom string, offsetAmount osmomath.Int) SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error + GetSupply(ctx sdk.Context, denom string) sdk.Coin } // StakingKeeper expected staking keeper. diff --git a/x/superfluid/types/query.pb.go b/x/superfluid/types/query.pb.go index c2131dcdf3d..567e79109bf 100644 --- a/x/superfluid/types/query.pb.go +++ b/x/superfluid/types/query.pb.go @@ -1769,6 +1769,96 @@ func (m *UserConcentratedSuperfluidPositionsUndelegatingResponse) GetClPoolUserP return nil } +// THIS QUERY IS TEMPORARY +type QueryRestSupplyRequest struct { + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` +} + +func (m *QueryRestSupplyRequest) Reset() { *m = QueryRestSupplyRequest{} } +func (m *QueryRestSupplyRequest) String() string { return proto.CompactTextString(m) } +func (*QueryRestSupplyRequest) ProtoMessage() {} +func (*QueryRestSupplyRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_e3d9448e4ed3943f, []int{36} +} +func (m *QueryRestSupplyRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryRestSupplyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryRestSupplyRequest.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 *QueryRestSupplyRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryRestSupplyRequest.Merge(m, src) +} +func (m *QueryRestSupplyRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryRestSupplyRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryRestSupplyRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryRestSupplyRequest proto.InternalMessageInfo + +func (m *QueryRestSupplyRequest) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +type QueryRestSupplyResponse struct { + // amount is the supply of the coin. + Amount types.Coin `protobuf:"bytes,1,opt,name=amount,proto3" json:"amount"` +} + +func (m *QueryRestSupplyResponse) Reset() { *m = QueryRestSupplyResponse{} } +func (m *QueryRestSupplyResponse) String() string { return proto.CompactTextString(m) } +func (*QueryRestSupplyResponse) ProtoMessage() {} +func (*QueryRestSupplyResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_e3d9448e4ed3943f, []int{37} +} +func (m *QueryRestSupplyResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryRestSupplyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryRestSupplyResponse.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 *QueryRestSupplyResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryRestSupplyResponse.Merge(m, src) +} +func (m *QueryRestSupplyResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryRestSupplyResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryRestSupplyResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryRestSupplyResponse proto.InternalMessageInfo + +func (m *QueryRestSupplyResponse) GetAmount() types.Coin { + if m != nil { + return m.Amount + } + return types.Coin{} +} + func init() { proto.RegisterType((*QueryParamsRequest)(nil), "osmosis.superfluid.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "osmosis.superfluid.QueryParamsResponse") @@ -1806,140 +1896,146 @@ func init() { proto.RegisterType((*UserConcentratedSuperfluidPositionsDelegatedResponse)(nil), "osmosis.superfluid.UserConcentratedSuperfluidPositionsDelegatedResponse") proto.RegisterType((*UserConcentratedSuperfluidPositionsUndelegatingRequest)(nil), "osmosis.superfluid.UserConcentratedSuperfluidPositionsUndelegatingRequest") proto.RegisterType((*UserConcentratedSuperfluidPositionsUndelegatingResponse)(nil), "osmosis.superfluid.UserConcentratedSuperfluidPositionsUndelegatingResponse") + proto.RegisterType((*QueryRestSupplyRequest)(nil), "osmosis.superfluid.QueryRestSupplyRequest") + proto.RegisterType((*QueryRestSupplyResponse)(nil), "osmosis.superfluid.QueryRestSupplyResponse") } func init() { proto.RegisterFile("osmosis/superfluid/query.proto", fileDescriptor_e3d9448e4ed3943f) } var fileDescriptor_e3d9448e4ed3943f = []byte{ - // 2042 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x5a, 0x4d, 0x6c, 0x14, 0xd7, - 0x1d, 0x67, 0xd6, 0x8e, 0x0d, 0x7f, 0x24, 0x30, 0x0f, 0x12, 0xec, 0x01, 0xd6, 0x64, 0x4c, 0xb0, - 0xeb, 0xc0, 0x0c, 0x98, 0x60, 0x1c, 0x52, 0x50, 0x76, 0x31, 0x26, 0x6e, 0x21, 0x38, 0x6b, 0x6c, - 0xd4, 0x2f, 0x4d, 0xc7, 0x3b, 0xcf, 0xeb, 0x91, 0x67, 0xe7, 0xad, 0xe7, 0xcd, 0x38, 0x59, 0x45, - 0xb4, 0x52, 0xaa, 0x4a, 0x8d, 0x7a, 0x68, 0xa5, 0x1c, 0xaa, 0xdc, 0x7a, 0xe9, 0xa1, 0x39, 0xb4, - 0xb7, 0x56, 0x95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, - 0x6e, 0xa5, 0x39, 0x36, 0xc0, 0x1d, 0x54, 0x7e, 0xeb, 0xc9, 0x15, 0x09, 0xe4, 0xeb, 0x0c, 0xf9, - 0x0a, 0x7a, 0x3b, 0xf7, 0x4c, 0xe6, 0x9f, 0x42, 0xc9, 0xad, 0x84, 0x1d, 0x5d, 0xb7, 0xd2, 0x67, - 0xfd, 0x2f, 0x4a, 0xa0, 0xf5, 0x79, 0xb1, 0x43, 0x5f, 0x1b, 0x10, 0x55, 0xca, 0x2d, 0x54, 0xfe, - 0xfa, 0x53, 0xd1, 0x25, 0x82, 0xf4, 0x0d, 0x16, 0xa4, 0x55, 0xf4, 0x4e, 0x2f, 0x41, 0xf2, 0x13, - 0x1a, 0x0a, 0xe3, 0x54, 0x5d, 0xf9, 0xf4, 0x51, 0x59, 0xfa, 0xec, 0x51, 0x59, 0xfa, 0xe2, 0x51, - 0x59, 0xfa, 0xe9, 0xe3, 0xf2, 0xbe, 0xcf, 0x1e, 0x97, 0xf7, 0xfd, 0xed, 0x71, 0x79, 0xdf, 0x37, - 0xe7, 0x13, 0xeb, 0x13, 0x61, 0xf6, 0xbc, 0x6d, 0x6c, 0xd0, 0xc8, 0x87, 0xdd, 0xb9, 0x0b, 0xda, - 0x7b, 0x49, 0x4f, 0xd8, 0x4a, 0x65, 0x63, 0x84, 0xfd, 0x8f, 0x90, 0x4b, 0xff, 0x0b, 0x00, 0x00, - 0xff, 0xff, 0x57, 0xd7, 0xae, 0xd1, 0x8f, 0x23, 0x00, 0x00, + // 2098 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x5a, 0x4f, 0x6c, 0x14, 0xd7, + 0x19, 0x67, 0x6c, 0xc7, 0x86, 0x0f, 0x09, 0xcc, 0x83, 0x60, 0x7b, 0xc0, 0x6b, 0x32, 0x26, 0xd8, + 0x75, 0x60, 0x06, 0x4c, 0xb0, 0x1d, 0x52, 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x49, 0xfa, 0xfc, 0x51, 0x49, 0xfa, 0xe9, 0xe3, 0xd2, 0x81, 0x4f, 0x1f, + 0x97, 0x0e, 0xfc, 0xfd, 0x71, 0xe9, 0xc0, 0x37, 0xe7, 0x52, 0x6b, 0x25, 0x2e, 0xe7, 0x82, 0x6d, + 0x6c, 0x91, 0x58, 0xe8, 0xfe, 0xec, 0x45, 0xed, 0xdd, 0xb4, 0x68, 0xba, 0x6a, 0xda, 0x1a, 0xa4, + 0xff, 0x53, 0xe6, 0xf2, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, 0xb7, 0x26, 0xcc, 0xa7, 0xa7, 0x24, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1993,6 +2089,7 @@ type QueryClient interface { // Returns all of a user's full range CL positions that are superfluid staked. UserConcentratedSuperfluidPositionsDelegated(ctx context.Context, in *UserConcentratedSuperfluidPositionsDelegatedRequest, opts ...grpc.CallOption) (*UserConcentratedSuperfluidPositionsDelegatedResponse, error) UserConcentratedSuperfluidPositionsUndelegating(ctx context.Context, in *UserConcentratedSuperfluidPositionsUndelegatingRequest, opts ...grpc.CallOption) (*UserConcentratedSuperfluidPositionsUndelegatingResponse, error) + RestSupply(ctx context.Context, in *QueryRestSupplyRequest, opts ...grpc.CallOption) (*QueryRestSupplyResponse, error) } type queryClient struct { @@ -2156,6 +2253,15 @@ func (c *queryClient) UserConcentratedSuperfluidPositionsUndelegating(ctx contex return out, nil } +func (c *queryClient) RestSupply(ctx context.Context, in *QueryRestSupplyRequest, opts ...grpc.CallOption) (*QueryRestSupplyResponse, error) { + out := new(QueryRestSupplyResponse) + err := c.cc.Invoke(ctx, "/osmosis.superfluid.Query/RestSupply", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // Params returns the total set of superfluid parameters. @@ -2197,6 +2303,7 @@ type QueryServer interface { // Returns all of a user's full range CL positions that are superfluid staked. UserConcentratedSuperfluidPositionsDelegated(context.Context, *UserConcentratedSuperfluidPositionsDelegatedRequest) (*UserConcentratedSuperfluidPositionsDelegatedResponse, error) UserConcentratedSuperfluidPositionsUndelegating(context.Context, *UserConcentratedSuperfluidPositionsUndelegatingRequest) (*UserConcentratedSuperfluidPositionsUndelegatingResponse, error) + RestSupply(context.Context, *QueryRestSupplyRequest) (*QueryRestSupplyResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -2254,6 +2361,9 @@ func (*UnimplementedQueryServer) UserConcentratedSuperfluidPositionsDelegated(ct func (*UnimplementedQueryServer) UserConcentratedSuperfluidPositionsUndelegating(ctx context.Context, req *UserConcentratedSuperfluidPositionsUndelegatingRequest) (*UserConcentratedSuperfluidPositionsUndelegatingResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UserConcentratedSuperfluidPositionsUndelegating not implemented") } +func (*UnimplementedQueryServer) RestSupply(ctx context.Context, req *QueryRestSupplyRequest) (*QueryRestSupplyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RestSupply not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -2565,6 +2675,24 @@ func _Query_UserConcentratedSuperfluidPositionsUndelegating_Handler(srv interfac return interceptor(ctx, in, info, handler) } +func _Query_RestSupply_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRestSupplyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).RestSupply(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/osmosis.superfluid.Query/RestSupply", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).RestSupply(ctx, req.(*QueryRestSupplyRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "osmosis.superfluid.Query", HandlerType: (*QueryServer)(nil), @@ -2637,6 +2765,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "UserConcentratedSuperfluidPositionsUndelegating", Handler: _Query_UserConcentratedSuperfluidPositionsUndelegating_Handler, }, + { + MethodName: "RestSupply", + Handler: _Query_RestSupply_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "osmosis/superfluid/query.proto", @@ -3975,6 +4107,69 @@ func (m *UserConcentratedSuperfluidPositionsUndelegatingResponse) MarshalToSized return len(dAtA) - i, nil } +func (m *QueryRestSupplyRequest) 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 *QueryRestSupplyRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryRestSupplyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryRestSupplyResponse) 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 *QueryRestSupplyResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryRestSupplyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + 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 @@ -4530,6 +4725,30 @@ func (m *UserConcentratedSuperfluidPositionsUndelegatingResponse) Size() (n int) return n } +func (m *QueryRestSupplyRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryRestSupplyResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Amount.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -7998,6 +8217,171 @@ func (m *UserConcentratedSuperfluidPositionsUndelegatingResponse) Unmarshal(dAtA } return nil } +func (m *QueryRestSupplyRequest) 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: QueryRestSupplyRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryRestSupplyRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", 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 + } + m.Denom = string(dAtA[iNdEx:postIndex]) + 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 (m *QueryRestSupplyResponse) 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: QueryRestSupplyResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryRestSupplyResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.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/superfluid/types/query.pb.gw.go b/x/superfluid/types/query.pb.gw.go index 1a874965b60..7fe6bec87df 100644 --- a/x/superfluid/types/query.pb.gw.go +++ b/x/superfluid/types/query.pb.gw.go @@ -663,6 +663,42 @@ func local_request_Query_UserConcentratedSuperfluidPositionsUndelegating_0(ctx c } +var ( + filter_Query_RestSupply_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_RestSupply_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryRestSupplyRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_RestSupply_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.RestSupply(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_RestSupply_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryRestSupplyRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_RestSupply_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.RestSupply(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. @@ -1037,6 +1073,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_RestSupply_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_RestSupply_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_RestSupply_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1398,6 +1457,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_RestSupply_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_RestSupply_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_RestSupply_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1433,6 +1512,8 @@ var ( pattern_Query_UserConcentratedSuperfluidPositionsDelegated_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"osmosis", "superfluid", "v1beta1", "account_delegated_cl_positions", "delegator_address"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_UserConcentratedSuperfluidPositionsUndelegating_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"osmosis", "superfluid", "v1beta1", "account_undelegating_cl_positions", "delegator_address"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_RestSupply_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"osmosis", "superfluid", "v1beta1", "supply"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -1467,4 +1548,6 @@ var ( forward_Query_UserConcentratedSuperfluidPositionsDelegated_0 = runtime.ForwardResponseMessage forward_Query_UserConcentratedSuperfluidPositionsUndelegating_0 = runtime.ForwardResponseMessage + + forward_Query_RestSupply_0 = runtime.ForwardResponseMessage ) From 54faf8f859c593a4ee46935031bca1d83557e0fb Mon Sep 17 00:00:00 2001 From: Joe Abbey Date: Fri, 10 Nov 2023 11:00:33 -0500 Subject: [PATCH 08/10] Fixing Bug 6856 (#6857) --- app/app.go | 2 ++ app/keepers/keepers.go | 2 ++ x/txfees/keeper/feedecorator.go | 5 +++++ x/txfees/keeper/keeper.go | 3 +++ x/txfees/keeper/mempool-1559/code.go | 11 ++++++----- 5 files changed, 18 insertions(+), 5 deletions(-) diff --git a/app/app.go b/app/app.go index d191dfb8e35..d3d2cff5959 100644 --- a/app/app.go +++ b/app/app.go @@ -263,6 +263,7 @@ func NewOsmosisApp( } app.homePath = homePath + dataDir := filepath.Join(homePath, "data") wasmDir := filepath.Join(homePath, "wasm") wasmConfig, err := wasm.ReadWasmConfig(appOpts) // Uncomment this for debugging contracts. In the future this could be made into a param passed by the tests @@ -285,6 +286,7 @@ func NewOsmosisApp( encodingConfig, bApp, maccPerms, + dataDir, wasmDir, wasmConfig, wasmEnabledProposals, diff --git a/app/keepers/keepers.go b/app/keepers/keepers.go index d875b96ca7d..a34f41d7c43 100644 --- a/app/keepers/keepers.go +++ b/app/keepers/keepers.go @@ -184,6 +184,7 @@ func (appKeepers *AppKeepers) InitNormalKeepers( encodingConfig appparams.EncodingConfig, bApp *baseapp.BaseApp, maccPerms map[string][]string, + dataDir string, wasmDir string, wasmConfig wasm.Config, wasmEnabledProposals []wasm.ProposalType, @@ -402,6 +403,7 @@ func (appKeepers *AppKeepers) InitNormalKeepers( appKeepers.GAMMKeeper, appKeepers.ProtoRevKeeper, appKeepers.DistrKeeper, + dataDir, ) appKeepers.TxFeesKeeper = &txFeesKeeper appKeepers.ProtoRevKeeper.SetTxFeesKeeper(appKeepers.TxFeesKeeper) diff --git a/x/txfees/keeper/feedecorator.go b/x/txfees/keeper/feedecorator.go index 600c06007c1..f0755897d63 100644 --- a/x/txfees/keeper/feedecorator.go +++ b/x/txfees/keeper/feedecorator.go @@ -2,6 +2,7 @@ package keeper import ( "fmt" + "path/filepath" errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" @@ -27,6 +28,10 @@ type MempoolFeeDecorator struct { } func NewMempoolFeeDecorator(txFeesKeeper Keeper, opts types.MempoolFeeOptions) MempoolFeeDecorator { + if opts.Mempool1559Enabled { + mempool1559.CurEipState.BackupFilePath = filepath.Join(txFeesKeeper.dataDir, mempool1559.BackupFilename) + } + return MempoolFeeDecorator{ TxFeesKeeper: txFeesKeeper, Opts: opts, diff --git a/x/txfees/keeper/keeper.go b/x/txfees/keeper/keeper.go index b4804c07e33..a9ec02f0bc4 100644 --- a/x/txfees/keeper/keeper.go +++ b/x/txfees/keeper/keeper.go @@ -22,6 +22,7 @@ type Keeper struct { spotPriceCalculator types.SpotPriceCalculator protorevKeeper types.ProtorevKeeper distributionKeeper types.DistributionKeeper + dataDir string } var _ types.TxFeesKeeper = (*Keeper)(nil) @@ -34,6 +35,7 @@ func NewKeeper( spotPriceCalculator types.SpotPriceCalculator, protorevKeeper types.ProtorevKeeper, distributionKeeper types.DistributionKeeper, + dataDir string, ) Keeper { return Keeper{ accountKeeper: accountKeeper, @@ -43,6 +45,7 @@ func NewKeeper( spotPriceCalculator: spotPriceCalculator, protorevKeeper: protorevKeeper, distributionKeeper: distributionKeeper, + dataDir: dataDir, } } diff --git a/x/txfees/keeper/mempool-1559/code.go b/x/txfees/keeper/mempool-1559/code.go index 04c1664dab4..848f8fc7831 100644 --- a/x/txfees/keeper/mempool-1559/code.go +++ b/x/txfees/keeper/mempool-1559/code.go @@ -55,7 +55,7 @@ var ( ) const ( - BackupFile = "eip1559state.json" + BackupFilename = "eip1559state.json" ) // EipState tracks the current base fee and totalGasWantedThisBlock @@ -63,8 +63,8 @@ const ( type EipState struct { lastBlockHeight int64 totalGasWantedThisBlock int64 - - CurBaseFee osmomath.Dec `json:"cur_base_fee"` + BackupFilePath string + CurBaseFee osmomath.Dec `json:"cur_base_fee"` } // CurEipState is a global variable used in the BeginBlock, EndBlock and @@ -73,6 +73,7 @@ type EipState struct { var CurEipState = EipState{ lastBlockHeight: 0, totalGasWantedThisBlock: 0, + BackupFilePath: "", CurBaseFee: sdk.NewDec(0), } @@ -156,7 +157,7 @@ func (e *EipState) tryPersist() { return } - err = os.WriteFile(BackupFile, bz, 0644) + err = os.WriteFile(e.BackupFilePath, bz, 0644) if err != nil { fmt.Println("Error writing eip1559 state", err) return @@ -166,7 +167,7 @@ func (e *EipState) tryPersist() { // 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) + bz, err := os.ReadFile(e.BackupFilePath) if err != nil { fmt.Println("Error reading eip1559 state", err) fmt.Println("Setting eip1559 state to default value", MinBaseFee) From 2a36c45f3f10607d60b9274cc5be8cbb436e076f Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Fri, 10 Nov 2023 09:50:57 -0700 Subject: [PATCH 09/10] fix conflicts --- go.mod | 1 + go.sum | 1 + x/txfees/keeper/mempool-1559/code_test.go | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 2b4f0916fc4..bc616fda6cc 100644 --- a/go.mod +++ b/go.mod @@ -47,6 +47,7 @@ require ( google.golang.org/protobuf v1.31.0 gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v3 v3.0.1 + gotest.tools v2.2.0+incompatible mvdan.cc/gofumpt v0.5.0 ) diff --git a/go.sum b/go.sum index 1ef2e3b1f23..c207a769f70 100644 --- a/go.sum +++ b/go.sum @@ -2556,6 +2556,7 @@ gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= +gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= gotest.tools/v3 v3.5.0 h1:Ljk6PdHdOhAb5aDMWXjDLMMhph+BpztA4v1QdqEW2eY= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/x/txfees/keeper/mempool-1559/code_test.go b/x/txfees/keeper/mempool-1559/code_test.go index bae57e7e022..41513c51749 100644 --- a/x/txfees/keeper/mempool-1559/code_test.go +++ b/x/txfees/keeper/mempool-1559/code_test.go @@ -3,9 +3,9 @@ package mempool1559 import ( "testing" + "github.com/cometbft/cometbft/libs/log" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" 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" From 38d5501095d3333229aa452c5ee85155e42ab117 Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Fri, 10 Nov 2023 09:52:17 -0700 Subject: [PATCH 10/10] changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 126a122c86d..f0a61da4f3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,12 +53,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### State Breaks * [#6758](https://github.com/osmosis-labs/osmosis/pull/6758) Add codec for MsgUndelegateFromRebalancedValidatorSet -* [#6836](https://github.com/osmosis-labs/osmosis/pull/6836) Add DenomsMetadata to stargate whitelist and fixs the DenomMetadata response type +* [#6836](https://github.com/osmosis-labs/osmosis/pull/6836) Add DenomsMetadata to stargate whitelist and fixs the DenomMetadata response type * [#6814](https://github.com/osmosis-labs/osmosis/pull/6814) Add EstimateTradeBasedOnPriceImpact to stargate whitelist ### Misc Improvements * [#6788](https://github.com/osmosis-labs/osmosis/pull/6788) Improve error message when CL LP fails due to slippage bound hit. +* [#6858](https://github.com/osmosis-labs/osmosis/pull/6858) Merge mempool improvements from v20 ### API Breaks