Skip to content

Commit

Permalink
Update the eip1559 constants (#6900)
Browse files Browse the repository at this point in the history
* Update the eip1559 constants

* Generated protofile changes

* updates

* update comments

* updates

* Generated protofile changes

---------

Co-authored-by: github-actions <[email protected]>
Co-authored-by: roman <[email protected]>
  • Loading branch information
3 people authored Nov 21, 2023
1 parent 9bf7d30 commit 17b3b23
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 17 deletions.
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
5 changes: 5 additions & 0 deletions proto/osmosis/poolmanager/v1beta1/query.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,8 @@ queries:
query_func: "k.GetTradingPairTakerFee"
cli:
cmd: "TradingPairTakerFee"
ListPoolsByDenom:
proto_wrapper:
query_func: "k.ListPoolsByDenom"
cli:
cmd: "ListPoolsByDenom"
20 changes: 10 additions & 10 deletions x/poolmanager/client/grpc/grpc_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down
10 changes: 5 additions & 5 deletions x/txfees/keeper/mempool-1559/code.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -41,18 +41,18 @@ import (
*/

var (
DefaultBaseFee = sdk.MustNewDecFromStr("0.0025")
DefaultBaseFee = sdk.MustNewDecFromStr("0.01")
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))
// 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 (
Expand Down

0 comments on commit 17b3b23

Please sign in to comment.