From 17b3b23b8623c49157863cdcbff3c22b3b0cf9aa Mon Sep 17 00:00:00 2001 From: Dev Ojha Date: Tue, 21 Nov 2023 05:24:11 +0100 Subject: [PATCH] Update the eip1559 constants (#6900) * Update the eip1559 constants * Generated protofile changes * updates * update comments * updates * Generated protofile changes --------- Co-authored-by: github-actions Co-authored-by: roman --- go.sum | 2 -- proto/osmosis/poolmanager/v1beta1/query.yml | 5 +++++ x/poolmanager/client/grpc/grpc_query.go | 20 ++++++++++---------- x/txfees/keeper/mempool-1559/code.go | 10 +++++----- 4 files changed, 20 insertions(+), 17 deletions(-) diff --git a/go.sum b/go.sum index 4ff5b1616e7..05708e12696 100644 --- a/go.sum +++ b/go.sum @@ -1458,8 +1458,6 @@ github.com/osmosis-labs/go-mutesting v0.0.0-20221208041716-b43bcd97b3b3 h1:Ylmch github.com/osmosis-labs/go-mutesting v0.0.0-20221208041716-b43bcd97b3b3/go.mod h1:lV6KnqXYD/ayTe7310MHtM3I2q8Z6bBfMAi+bhwPYtI= github.com/osmosis-labs/osmosis/osmomath v0.0.7-0.20231108202153-af031b1367bb h1:d4JXafqN5tqmM5gQ56nMGsOccLI9M+zp3KgI3vFU8vk= github.com/osmosis-labs/osmosis/osmomath v0.0.7-0.20231108202153-af031b1367bb/go.mod h1:I8CSvdOyPJREATq1Kb4mFPiDVrl2jxCRd4W3NVQFom8= -github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231110043608-da030c5b18ac h1:60A8/hLeNPpEJ4QPoJbpN0BgJEjMzcAy+0lByxGIlaE= -github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231110043608-da030c5b18ac/go.mod h1:5vLzE4XFr/qa5bXq6zSFncM3jUwTMOW9hMjVRSlTQAc= github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231113053702-9d3cce854a9d h1:HU/Ti1vae94c2u+AGqCKnVM2YOboewjTfxbMhu1T2rY= github.com/osmosis-labs/osmosis/osmoutils v0.0.7-0.20231113053702-9d3cce854a9d/go.mod h1:5vLzE4XFr/qa5bXq6zSFncM3jUwTMOW9hMjVRSlTQAc= github.com/osmosis-labs/osmosis/x/epochs v0.0.3-0.20231108202153-af031b1367bb h1:Gz4FoT0QgrqbYUt+fj+pl7kpcmv/Jd4VAKWOq3Bjpow= diff --git a/proto/osmosis/poolmanager/v1beta1/query.yml b/proto/osmosis/poolmanager/v1beta1/query.yml index 08bd7c07f0a..1b4abeeeb15 100644 --- a/proto/osmosis/poolmanager/v1beta1/query.yml +++ b/proto/osmosis/poolmanager/v1beta1/query.yml @@ -88,3 +88,8 @@ queries: query_func: "k.GetTradingPairTakerFee" cli: cmd: "TradingPairTakerFee" + ListPoolsByDenom: + proto_wrapper: + query_func: "k.ListPoolsByDenom" + cli: + cmd: "ListPoolsByDenom" diff --git a/x/poolmanager/client/grpc/grpc_query.go b/x/poolmanager/client/grpc/grpc_query.go index 4bdc58d6da4..d1875425e77 100644 --- a/x/poolmanager/client/grpc/grpc_query.go +++ b/x/poolmanager/client/grpc/grpc_query.go @@ -71,16 +71,6 @@ func (q Querier) SpotPrice(grpcCtx context.Context, return q.Q.SpotPrice(ctx, *req) } -func (q Querier) ListPoolsByDenom(grpcCtx context.Context, - req *queryproto.ListPoolsByDenomRequest, -) (*queryproto.ListPoolsByDenomResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "empty request") - } - ctx := sdk.UnwrapSDKContext(grpcCtx) - return q.Q.ListPoolsByDenom(ctx, *req) -} - func (q Querier) Pool(grpcCtx context.Context, req *queryproto.PoolRequest, ) (*queryproto.PoolResponse, error) { @@ -111,6 +101,16 @@ func (q Querier) NumPools(grpcCtx context.Context, return q.Q.NumPools(ctx, *req) } +func (q Querier) ListPoolsByDenom(grpcCtx context.Context, + req *queryproto.ListPoolsByDenomRequest, +) (*queryproto.ListPoolsByDenomResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + ctx := sdk.UnwrapSDKContext(grpcCtx) + return q.Q.ListPoolsByDenom(ctx, *req) +} + func (q Querier) EstimateTradeBasedOnPriceImpact(grpcCtx context.Context, req *queryproto.EstimateTradeBasedOnPriceImpactRequest, ) (*queryproto.EstimateTradeBasedOnPriceImpactResponse, error) { diff --git a/x/txfees/keeper/mempool-1559/code.go b/x/txfees/keeper/mempool-1559/code.go index 19467bb2e04..e4934e59031 100644 --- a/x/txfees/keeper/mempool-1559/code.go +++ b/x/txfees/keeper/mempool-1559/code.go @@ -22,13 +22,13 @@ import ( 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. + Note: The reset interval is set to 2000 blocks, which is approximately 4 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. + - DefaultBaseFee: Default base fee, initialized to 0.01. - MinBaseFee: Minimum base fee, initialized to 0.0025. - MaxBaseFee: Maximum base fee, initialized to 10. - MaxBlockChangeRate: The maximum block change rate, initialized to 1/10. @@ -41,7 +41,7 @@ import ( */ var ( - DefaultBaseFee = sdk.MustNewDecFromStr("0.0025") + DefaultBaseFee = sdk.MustNewDecFromStr("0.01") MinBaseFee = sdk.MustNewDecFromStr("0.0025") MaxBaseFee = sdk.MustNewDecFromStr("10") @@ -49,10 +49,10 @@ var ( 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)) + // ceil(log_{15/14}(RecheckFee mnConstant)) // 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) + ResetInterval = int64(2000) ) const (