From f86211aea3ede4287b3a7fdd2ac9d435c20dc336 Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Fri, 16 Feb 2024 12:11:54 -0700 Subject: [PATCH 01/20] base denom protorev param performance change --- proto/osmosis/protorev/v1beta1/params.proto | 21 + proto/osmosis/protorev/v1beta1/protorev.proto | 16 - proto/osmosis/protorev/v1beta1/tx.proto | 1 + x/protorev/keeper/epoch_hook.go | 5 +- x/protorev/keeper/epoch_hook_test.go | 3 +- x/protorev/keeper/genesis.go | 9 +- x/protorev/keeper/genesis_test.go | 3 +- x/protorev/keeper/grpc_query.go | 5 +- x/protorev/keeper/grpc_query_test.go | 3 +- x/protorev/keeper/hooks.go | 6 +- x/protorev/keeper/keeper_test.go | 5 +- x/protorev/keeper/msg_server.go | 15 +- x/protorev/keeper/msg_server_test.go | 3 +- x/protorev/keeper/protorev.go | 68 ++-- x/protorev/keeper/protorev_test.go | 12 +- x/protorev/keeper/routes.go | 5 +- x/protorev/types/params.pb.go | 327 ++++++++++++++- x/protorev/types/protorev.pb.go | 373 ++++-------------- x/protorev/types/tx.pb.go | 113 +++--- x/txfees/keeper/keeper_test.go | 3 +- 20 files changed, 525 insertions(+), 471 deletions(-) diff --git a/proto/osmosis/protorev/v1beta1/params.proto b/proto/osmosis/protorev/v1beta1/params.proto index 0bbc91f7996..0a8a09412b3 100644 --- a/proto/osmosis/protorev/v1beta1/params.proto +++ b/proto/osmosis/protorev/v1beta1/params.proto @@ -12,4 +12,25 @@ message Params { bool enabled = 1 [ (gogoproto.moretags) = "yaml:\"enabled\"" ]; // The admin account (settings manager) of the protorev module. string admin = 2 [ (gogoproto.moretags) = "yaml:\"admin\"" ]; + // All enabled base denominations for the protorev module. + repeated BaseDenom base_denoms = 3 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"base_denoms\"" + ]; +} + +// BaseDenom represents a single base denom that the module uses for its +// arbitrage trades. It contains the denom name alongside the step size of the +// binary search that is used to find the optimal swap amount +message BaseDenom { + // The denom i.e. name of the base denom (ex. uosmo) + string denom = 1 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; + // The step size of the binary search that is used to find the optimal swap + // amount + string step_size = 2 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"step_size\"" + ]; } \ No newline at end of file diff --git a/proto/osmosis/protorev/v1beta1/protorev.proto b/proto/osmosis/protorev/v1beta1/protorev.proto index ab014b251a3..cd055ab2a9a 100644 --- a/proto/osmosis/protorev/v1beta1/protorev.proto +++ b/proto/osmosis/protorev/v1beta1/protorev.proto @@ -168,22 +168,6 @@ message WeightMap { [ (gogoproto.moretags) = "yaml:\"contract_address\"" ]; } -// BaseDenom represents a single base denom that the module uses for its -// arbitrage trades. It contains the denom name alongside the step size of the -// binary search that is used to find the optimal swap amount -message BaseDenom { - // The denom i.e. name of the base denom (ex. uosmo) - string denom = 1 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; - // The step size of the binary search that is used to find the optimal swap - // amount - string step_size = 2 [ - - (gogoproto.customtype) = "cosmossdk.io/math.Int", - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"step_size\"" - ]; -} - message AllProtocolRevenue { osmosis.poolmanager.v1beta1.TakerFeesTracker taker_fees_tracker = 1 [ (gogoproto.moretags) = "yaml:\"taker_fees_tracker\"", diff --git a/proto/osmosis/protorev/v1beta1/tx.proto b/proto/osmosis/protorev/v1beta1/tx.proto index 04ddae78d19..65be3d34110 100644 --- a/proto/osmosis/protorev/v1beta1/tx.proto +++ b/proto/osmosis/protorev/v1beta1/tx.proto @@ -6,6 +6,7 @@ import "amino/amino.proto"; import "google/api/annotations.proto"; import "osmosis/protorev/v1beta1/protorev.proto"; import "cosmos_proto/cosmos.proto"; +import "osmosis/protorev/v1beta1/params.proto"; option go_package = "github.com/osmosis-labs/osmosis/v23/x/protorev/types"; diff --git a/x/protorev/keeper/epoch_hook.go b/x/protorev/keeper/epoch_hook.go index af11d6ed772..14aa9f038a2 100644 --- a/x/protorev/keeper/epoch_hook.go +++ b/x/protorev/keeper/epoch_hook.go @@ -53,10 +53,7 @@ func (k Keeper) UpdatePools(ctx sdk.Context) error { // baseDenomPools maps each base denom to a map of the highest liquidity pools paired with that base denom // ex. {osmo -> {atom : 100, weth : 200}} baseDenomPools := make(map[string]map[string]LiquidityPoolStruct) - baseDenoms, err := k.GetAllBaseDenoms(ctx) - if err != nil { - return err - } + baseDenoms := k.GetAllBaseDenoms(ctx) // Delete any pools that currently exist in the store + initialize baseDenomPools for _, baseDenom := range baseDenoms { diff --git a/x/protorev/keeper/epoch_hook_test.go b/x/protorev/keeper/epoch_hook_test.go index c2a83d372ba..7e00eca02c2 100644 --- a/x/protorev/keeper/epoch_hook_test.go +++ b/x/protorev/keeper/epoch_hook_test.go @@ -47,8 +47,7 @@ func (s *KeeperTestSuite) TestEpochHook() { totalNumberExpected := 0 expectedToSee := make(map[string]Pool) - baseDenoms, err := s.App.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) - s.Require().NoError(err) + baseDenoms := s.App.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) for _, pool := range s.pools { // Module currently limited to two asset pools // Instantiate asset and amounts for the pool diff --git a/x/protorev/keeper/genesis.go b/x/protorev/keeper/genesis.go index 66e7d344025..0a1dbb53233 100644 --- a/x/protorev/keeper/genesis.go +++ b/x/protorev/keeper/genesis.go @@ -28,9 +28,7 @@ func (k Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState) { // Configure the initial base denoms used for cyclic route building. The order of the list of base // denoms is the order in which routes will be prioritized i.e. routes will be built and simulated in a // first come first serve basis that is based on the order of the base denoms. - if err := k.SetBaseDenoms(ctx, genState.BaseDenoms); err != nil { - panic(err) - } + k.SetBaseDenoms(ctx, genState.BaseDenoms) // Update the pools on genesis. if err := k.UpdatePools(ctx); err != nil { @@ -122,10 +120,7 @@ func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState { genesis.TokenPairArbRoutes = routes // Export the base denoms used for cyclic route building. - baseDenoms, err := k.GetAllBaseDenoms(ctx) - if err != nil { - panic(err) - } + baseDenoms := k.GetAllBaseDenoms(ctx) genesis.BaseDenoms = baseDenoms // Export the developer fees that have been collected. diff --git a/x/protorev/keeper/genesis_test.go b/x/protorev/keeper/genesis_test.go index 37e8b2c2c02..86eb5698f81 100644 --- a/x/protorev/keeper/genesis_test.go +++ b/x/protorev/keeper/genesis_test.go @@ -15,8 +15,7 @@ func (s *KeeperTestSuite) TestInitGenesis() { s.Require().Contains(tokenPairArbRoutes, route) } - baseDenoms, err := s.App.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) - s.Require().NoError(err) + baseDenoms := s.App.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) s.Require().Equal(len(baseDenoms), len(exportedGenesis.BaseDenoms)) for _, baseDenom := range exportedGenesis.BaseDenoms { s.Require().Contains(baseDenoms, baseDenom) diff --git a/x/protorev/keeper/grpc_query.go b/x/protorev/keeper/grpc_query.go index 9a599ca547d..f4656e02e91 100644 --- a/x/protorev/keeper/grpc_query.go +++ b/x/protorev/keeper/grpc_query.go @@ -214,10 +214,7 @@ func (q Querier) GetProtoRevBaseDenoms(c context.Context, req *types.QueryGetPro return nil, status.Error(codes.InvalidArgument, "invalid request") } ctx := sdk.UnwrapSDKContext(c) - baseDenoms, err := q.Keeper.GetAllBaseDenoms(ctx) - if err != nil { - return nil, status.Error(codes.Internal, err.Error()) - } + baseDenoms := q.Keeper.GetAllBaseDenoms(ctx) return &types.QueryGetProtoRevBaseDenomsResponse{BaseDenoms: baseDenoms}, nil } diff --git a/x/protorev/keeper/grpc_query_test.go b/x/protorev/keeper/grpc_query_test.go index 5faebfb78b7..24a34bad445 100644 --- a/x/protorev/keeper/grpc_query_test.go +++ b/x/protorev/keeper/grpc_query_test.go @@ -330,8 +330,7 @@ func (s *KeeperTestSuite) TestGetProtoRevMaxPoolPointsPerBlock() { // TestGetProtoRevBaseDenoms tests the query to retrieve the base denoms func (s *KeeperTestSuite) TestGetProtoRevBaseDenoms() { // base denoms already set in setup - baseDenoms, err := s.App.AppKeepers.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) - s.Require().NoError(err) + baseDenoms := s.App.AppKeepers.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) req := &types.QueryGetProtoRevBaseDenomsRequest{} res, err := s.queryClient.GetProtoRevBaseDenoms(sdk.WrapSDKContext(s.Ctx), req) diff --git a/x/protorev/keeper/hooks.go b/x/protorev/keeper/hooks.go index b0724d8897e..f928622669d 100644 --- a/x/protorev/keeper/hooks.go +++ b/x/protorev/keeper/hooks.go @@ -154,11 +154,7 @@ func (k Keeper) StoreJoinExitPoolSwaps(ctx sdk.Context, sender sdk.AccAddress, p // AfterPoolCreatedWithCoins checks if the new pool should be stored as the highest liquidity pool // for any of the base denoms, and stores it if so. func (k Keeper) AfterPoolCreatedWithCoins(ctx sdk.Context, poolId uint64) { - baseDenoms, err := k.GetAllBaseDenoms(ctx) - if err != nil { - ctx.Logger().Error("Protorev error getting base denoms in AfterCFMMPoolCreated hook: " + err.Error()) - return - } + baseDenoms := k.GetAllBaseDenoms(ctx) baseDenomMap := make(map[string]bool) for _, baseDenom := range baseDenoms { diff --git a/x/protorev/keeper/keeper_test.go b/x/protorev/keeper/keeper_test.go index 5977f9ea603..467a1a20c31 100644 --- a/x/protorev/keeper/keeper_test.go +++ b/x/protorev/keeper/keeper_test.go @@ -94,8 +94,7 @@ func (s *KeeperTestSuite) SetupTest() { StepSize: osmomath.NewInt(1_000_000), }, } - err := s.App.ProtoRevKeeper.SetBaseDenoms(s.Ctx, baseDenomPriorities) - s.Require().NoError(err) + s.App.ProtoRevKeeper.SetBaseDenoms(s.Ctx, baseDenomPriorities) encodingConfig := osmosisapp.MakeEncodingConfig() s.clientCtx = client.Context{}. @@ -151,7 +150,7 @@ func (s *KeeperTestSuite) SetupTest() { // Set the Admin Account s.adminAccount = apptesting.CreateRandomAccounts(1)[0] - err = protorev.HandleSetProtoRevAdminAccount(s.Ctx, *s.App.ProtoRevKeeper, &types.SetProtoRevAdminAccountProposal{Account: s.adminAccount.String()}) + err := protorev.HandleSetProtoRevAdminAccount(s.Ctx, *s.App.ProtoRevKeeper, &types.SetProtoRevAdminAccountProposal{Account: s.adminAccount.String()}) s.Require().NoError(err) queryHelper := baseapp.NewQueryServerTestHelper(s.Ctx, s.App.InterfaceRegistry()) diff --git a/x/protorev/keeper/msg_server.go b/x/protorev/keeper/msg_server.go index 02345a3c0a0..8cbf3660bfd 100644 --- a/x/protorev/keeper/msg_server.go +++ b/x/protorev/keeper/msg_server.go @@ -139,22 +139,17 @@ func (m MsgServer) SetBaseDenoms(c context.Context, msg *types.MsgSetBaseDenoms) } // Get the old base denoms - baseDenoms, err := m.k.GetAllBaseDenoms(ctx) - if err != nil { - return nil, err - } + oldBaseDenoms := m.k.GetAllBaseDenoms(ctx) // Delete all pools associated with the base denoms - for _, baseDenom := range baseDenoms { + for _, baseDenom := range oldBaseDenoms { m.k.DeleteAllPoolsForBaseDenom(ctx, baseDenom.Denom) } - // Delete the old base denoms - m.k.DeleteBaseDenoms(ctx) + // // Delete the old base denoms + // m.k.DeleteBaseDenoms(ctx) - if err := m.k.SetBaseDenoms(ctx, msg.BaseDenoms); err != nil { - return nil, err - } + m.k.SetBaseDenoms(ctx, msg.BaseDenoms) // Update all of the pools if err := m.k.UpdatePools(ctx); err != nil { diff --git a/x/protorev/keeper/msg_server_test.go b/x/protorev/keeper/msg_server_test.go index 2050932e210..0d91ef2bc3a 100644 --- a/x/protorev/keeper/msg_server_test.go +++ b/x/protorev/keeper/msg_server_test.go @@ -655,8 +655,7 @@ func (s *KeeperTestSuite) TestMsgSetBaseDenoms() { s.Require().NoError(err) s.Require().Equal(response, &types.MsgSetBaseDenomsResponse{}) - baseDenoms, err := s.App.AppKeepers.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) - s.Require().NoError(err) + baseDenoms := s.App.AppKeepers.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) s.Require().Equal(testCase.baseDenoms, baseDenoms) } else { s.Require().Error(err) diff --git a/x/protorev/keeper/protorev.go b/x/protorev/keeper/protorev.go index 153ec7b4843..26a847205cf 100644 --- a/x/protorev/keeper/protorev.go +++ b/x/protorev/keeper/protorev.go @@ -76,43 +76,53 @@ func (k Keeper) DeleteAllTokenPairArbRoutes(ctx sdk.Context) { k.DeleteAllEntriesForKeyPrefix(ctx, types.KeyPrefixTokenPairRoutes) } -// GetAllBaseDenoms returns all of the base denoms (sorted by priority in descending order) used to build cyclic arbitrage routes -func (k Keeper) GetAllBaseDenoms(ctx sdk.Context) ([]types.BaseDenom, error) { - baseDenoms := make([]types.BaseDenom, 0) +// // GetAllBaseDenoms returns all of the base denoms (sorted by priority in descending order) used to build cyclic arbitrage routes +// func (k Keeper) GetAllBaseDenoms(ctx sdk.Context) ([]types.BaseDenom, error) { +// baseDenoms := make([]types.BaseDenom, 0) - store := ctx.KVStore(k.storeKey) - iterator := sdk.KVStorePrefixIterator(store, types.KeyPrefixBaseDenoms) +// store := ctx.KVStore(k.storeKey) +// iterator := sdk.KVStorePrefixIterator(store, types.KeyPrefixBaseDenoms) - defer iterator.Close() - for ; iterator.Valid(); iterator.Next() { - baseDenom := types.BaseDenom{} - err := baseDenom.Unmarshal(iterator.Value()) - if err != nil { - return []types.BaseDenom{}, err - } +// defer iterator.Close() +// for ; iterator.Valid(); iterator.Next() { +// baseDenom := types.BaseDenom{} +// err := baseDenom.Unmarshal(iterator.Value()) +// if err != nil { +// return []types.BaseDenom{}, err +// } - baseDenoms = append(baseDenoms, baseDenom) - } +// baseDenoms = append(baseDenoms, baseDenom) +// } - return baseDenoms, nil -} +// return baseDenoms, nil +// } -// SetBaseDenoms sets all of the base denoms used to build cyclic arbitrage routes. The base denoms priority -// order is going to match the order of the base denoms in the slice. -func (k Keeper) SetBaseDenoms(ctx sdk.Context, baseDenoms []types.BaseDenom) error { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixBaseDenoms) +// // SetBaseDenoms sets all of the base denoms used to build cyclic arbitrage routes. The base denoms priority +// // order is going to match the order of the base denoms in the slice. +// func (k Keeper) SetBaseDenoms(ctx sdk.Context, baseDenoms []types.BaseDenom) error { +// store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixBaseDenoms) - for i, baseDenom := range baseDenoms { - key := types.GetKeyPrefixBaseDenom(uint64(i)) +// for i, baseDenom := range baseDenoms { +// key := types.GetKeyPrefixBaseDenom(uint64(i)) - bz, err := baseDenom.Marshal() - if err != nil { - return err - } - store.Set(key, bz) - } +// bz, err := baseDenom.Marshal() +// if err != nil { +// return err +// } +// store.Set(key, bz) +// } - return nil +// return nil +// } + +func (k Keeper) GetAllBaseDenoms(ctx sdk.Context) []types.BaseDenom { + return k.GetParams(ctx).BaseDenoms +} + +func (k Keeper) SetBaseDenoms(ctx sdk.Context, newBaseDenoms []types.BaseDenom) { + params := k.GetParams(ctx) + params.BaseDenoms = newBaseDenoms + k.SetParams(ctx, params) } // DeleteBaseDenoms deletes all of the base denoms diff --git a/x/protorev/keeper/protorev_test.go b/x/protorev/keeper/protorev_test.go index 62e2fa827e8..1b28770002a 100644 --- a/x/protorev/keeper/protorev_test.go +++ b/x/protorev/keeper/protorev_test.go @@ -60,8 +60,7 @@ func (s *KeeperTestSuite) TestDeleteAllTokenPairArbRoutes() { // TestGetAllBaseDenoms tests the GetAllBaseDenoms, SetBaseDenoms, and DeleteBaseDenoms functions. func (s *KeeperTestSuite) TestGetAllBaseDenoms() { // Should be initialized on genesis - baseDenoms, err := s.App.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) - s.Require().NoError(err) + baseDenoms := s.App.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) s.Require().Equal(3, len(baseDenoms)) s.Require().Equal(baseDenoms[0].Denom, types.OsmosisDenomination) s.Require().Equal(baseDenoms[1].Denom, "Atom") @@ -69,15 +68,12 @@ func (s *KeeperTestSuite) TestGetAllBaseDenoms() { // Should be able to delete all base denoms s.App.ProtoRevKeeper.DeleteBaseDenoms(s.Ctx) - baseDenoms, err = s.App.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) - s.Require().NoError(err) + baseDenoms = s.App.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) s.Require().Equal(0, len(baseDenoms)) // Should be able to set the base denoms - err = s.App.ProtoRevKeeper.SetBaseDenoms(s.Ctx, []types.BaseDenom{{Denom: "osmo"}, {Denom: "atom"}, {Denom: "weth"}}) - s.Require().NoError(err) - baseDenoms, err = s.App.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) - s.Require().NoError(err) + s.App.ProtoRevKeeper.SetBaseDenoms(s.Ctx, []types.BaseDenom{{Denom: "osmo"}, {Denom: "atom"}, {Denom: "weth"}}) + baseDenoms = s.App.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) s.Require().Equal(3, len(baseDenoms)) s.Require().Equal(baseDenoms[0].Denom, "osmo") s.Require().Equal(baseDenoms[1].Denom, "atom") diff --git a/x/protorev/keeper/routes.go b/x/protorev/keeper/routes.go index fd2f5598c56..0037a97a678 100644 --- a/x/protorev/keeper/routes.go +++ b/x/protorev/keeper/routes.go @@ -91,10 +91,7 @@ func (k Keeper) BuildHotRoute(ctx sdk.Context, route types.Route, poolId uint64) // and routes are built in a greedy manner. func (k Keeper) BuildHighestLiquidityRoutes(ctx sdk.Context, tokenIn, tokenOut string, poolId uint64) ([]RouteMetaData, error) { routes := make([]RouteMetaData, 0) - baseDenoms, err := k.GetAllBaseDenoms(ctx) - if err != nil { - return routes, err - } + baseDenoms := k.GetAllBaseDenoms(ctx) // Iterate through all denoms greedily. When simulating and executing trades, routes that are closer to the beginning of the list // have priority over those that are later in the list. This way we can build routes that are more likely to succeed and bring in diff --git a/x/protorev/types/params.pb.go b/x/protorev/types/params.pb.go index 6b5aee04af7..08483c1658f 100644 --- a/x/protorev/types/params.pb.go +++ b/x/protorev/types/params.pb.go @@ -4,6 +4,7 @@ package types import ( + cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" _ "github.com/cosmos/cosmos-proto" _ "github.com/cosmos/gogoproto/gogoproto" @@ -30,6 +31,8 @@ type Params struct { Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty" yaml:"enabled"` // The admin account (settings manager) of the protorev module. Admin string `protobuf:"bytes,2,opt,name=admin,proto3" json:"admin,omitempty" yaml:"admin"` + // All enabled base denominations for the protorev module. + BaseDenoms []BaseDenom `protobuf:"bytes,3,rep,name=base_denoms,json=baseDenoms,proto3" json:"base_denoms" yaml:"base_denoms"` } func (m *Params) Reset() { *m = Params{} } @@ -79,8 +82,67 @@ func (m *Params) GetAdmin() string { return "" } +func (m *Params) GetBaseDenoms() []BaseDenom { + if m != nil { + return m.BaseDenoms + } + return nil +} + +// BaseDenom represents a single base denom that the module uses for its +// arbitrage trades. It contains the denom name alongside the step size of the +// binary search that is used to find the optimal swap amount +type BaseDenom struct { + // The denom i.e. name of the base denom (ex. uosmo) + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty" yaml:"denom"` + // The step size of the binary search that is used to find the optimal swap + // amount + StepSize cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=step_size,json=stepSize,proto3,customtype=cosmossdk.io/math.Int" json:"step_size" yaml:"step_size"` +} + +func (m *BaseDenom) Reset() { *m = BaseDenom{} } +func (m *BaseDenom) String() string { return proto.CompactTextString(m) } +func (*BaseDenom) ProtoMessage() {} +func (*BaseDenom) Descriptor() ([]byte, []int) { + return fileDescriptor_72168e5a5a65ae7e, []int{1} +} +func (m *BaseDenom) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BaseDenom) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BaseDenom.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 *BaseDenom) XXX_Merge(src proto.Message) { + xxx_messageInfo_BaseDenom.Merge(m, src) +} +func (m *BaseDenom) XXX_Size() int { + return m.Size() +} +func (m *BaseDenom) XXX_DiscardUnknown() { + xxx_messageInfo_BaseDenom.DiscardUnknown(m) +} + +var xxx_messageInfo_BaseDenom proto.InternalMessageInfo + +func (m *BaseDenom) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + func init() { proto.RegisterType((*Params)(nil), "osmosis.protorev.v1beta1.Params") + proto.RegisterType((*BaseDenom)(nil), "osmosis.protorev.v1beta1.BaseDenom") } func init() { @@ -88,22 +150,30 @@ func init() { } var fileDescriptor_72168e5a5a65ae7e = []byte{ - // 233 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xcd, 0x2f, 0xce, 0xcd, - 0x2f, 0xce, 0x2c, 0xd6, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x2f, 0x4a, 0x2d, 0xd3, 0x2f, 0x33, 0x4c, - 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x03, 0x8b, 0x0b, 0x49, - 0x40, 0x95, 0xe9, 0xc1, 0x94, 0xe9, 0x41, 0x95, 0x49, 0x89, 0xa4, 0xe7, 0xa7, 0xe7, 0x83, 0x45, - 0xf5, 0x41, 0x2c, 0x88, 0x02, 0x29, 0xc9, 0x64, 0xb0, 0x86, 0x78, 0x88, 0x04, 0x84, 0x03, 0x91, - 0x52, 0x8a, 0xe3, 0x62, 0x0b, 0x00, 0x1b, 0x2d, 0xa4, 0xc3, 0xc5, 0x9e, 0x9a, 0x97, 0x98, 0x94, - 0x93, 0x9a, 0x22, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0xe1, 0x24, 0xf4, 0xe9, 0x9e, 0x3c, 0x5f, 0x65, - 0x62, 0x6e, 0x8e, 0x95, 0x12, 0x54, 0x42, 0x29, 0x08, 0xa6, 0x44, 0x48, 0x8d, 0x8b, 0x35, 0x31, - 0x25, 0x37, 0x33, 0x4f, 0x82, 0x49, 0x81, 0x51, 0x83, 0xd3, 0x49, 0xe0, 0xd3, 0x3d, 0x79, 0x1e, - 0x88, 0x5a, 0xb0, 0xb0, 0x52, 0x10, 0x44, 0xda, 0xc9, 0xef, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, - 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, - 0x8f, 0xe5, 0x18, 0xa2, 0x4c, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, - 0xa1, 0xfe, 0xd1, 0xcd, 0x49, 0x4c, 0x2a, 0x86, 0x71, 0xf4, 0xcb, 0x8c, 0x8c, 0xf5, 0x2b, 0x10, - 0x21, 0x51, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0xe6, 0x1b, 0x03, 0x02, 0x00, 0x00, 0xff, - 0xff, 0xed, 0x90, 0x62, 0x56, 0x2a, 0x01, 0x00, 0x00, + // 362 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x91, 0xb1, 0x4e, 0xeb, 0x30, + 0x18, 0x85, 0xe3, 0x5b, 0xdd, 0xd2, 0xba, 0x08, 0x55, 0x11, 0x48, 0xa1, 0x43, 0x52, 0x19, 0x81, + 0x3a, 0x80, 0xad, 0xb6, 0x4c, 0x8c, 0x11, 0x0b, 0x4b, 0x85, 0xc2, 0xc6, 0x52, 0x9c, 0xc6, 0x6a, + 0x23, 0x9a, 0x38, 0xaa, 0x4d, 0x45, 0xbb, 0xf2, 0x02, 0x3c, 0x12, 0x63, 0xc7, 0x8e, 0x88, 0x21, + 0x42,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2, 0xb4, 0x6d, 0x0e, 0x60, 0x5d, 0x48, 0x96, 0x0c, + 0x45, 0xb8, 0x64, 0x45, 0x87, 0x6e, 0xfe, 0xc1, 0x8f, 0xd4, 0x39, 0xd2, 0x7f, 0x48, 0x04, 0x8f, + 0x38, 0xe4, 0x24, 0xa2, 0x72, 0x82, 0x6f, 0x62, 0x99, 0xa5, 0x4e, 0x53, 0x07, 0xed, 0xf6, 0x90, + 0x57, 0xcb, 0xcf, 0x77, 0xe1, 0x92, 0xb9, 0x83, 0xd5, 0xc6, 0x06, 0xeb, 0x8d, 0x0d, 0x3e, 0x37, + 0x36, 0x78, 0xdd, 0xda, 0xc6, 0x7a, 0x6b, 0x1b, 0xef, 0x5b, 0xdb, 0xb8, 0xbf, 0x1c, 0x87, 0x72, + 0xf2, 0xe4, 0xe3, 0x11, 0x8f, 0x48, 0x51, 0xfb, 0x62, 0x4a, 0x7d, 0x51, 0x0e, 0x64, 0xde, 0xeb, + 0x93, 0xe7, 0xef, 0x27, 0x97, 0x8b, 0x84, 0x09, 0xbf, 0xaa, 0xe6, 0xfe, 0x57, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x96, 0x8a, 0xd6, 0x63, 0x13, 0x02, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -126,6 +196,20 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.BaseDenoms) > 0 { + for iNdEx := len(m.BaseDenoms) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.BaseDenoms[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } if len(m.Admin) > 0 { i -= len(m.Admin) copy(dAtA[i:], m.Admin) @@ -146,6 +230,46 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *BaseDenom) 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 *BaseDenom) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BaseDenom) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.StepSize.Size() + i -= size + if _, err := m.StepSize.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintParams(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintParams(dAtA []byte, offset int, v uint64) int { offset -= sovParams(v) base := offset @@ -170,6 +294,27 @@ func (m *Params) Size() (n int) { if l > 0 { n += 1 + l + sovParams(uint64(l)) } + if len(m.BaseDenoms) > 0 { + for _, e := range m.BaseDenoms { + l = e.Size() + n += 1 + l + sovParams(uint64(l)) + } + } + return n +} + +func (m *BaseDenom) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovParams(uint64(l)) + } + l = m.StepSize.Size() + n += 1 + l + sovParams(uint64(l)) return n } @@ -260,6 +405,156 @@ func (m *Params) Unmarshal(dAtA []byte) error { } m.Admin = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BaseDenoms", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BaseDenoms = append(m.BaseDenoms, BaseDenom{}) + if err := m.BaseDenoms[len(m.BaseDenoms)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BaseDenom) 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 ErrIntOverflowParams + } + 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: BaseDenom: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BaseDenom: 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 ErrIntOverflowParams + } + 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 ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StepSize", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + 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 ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.StepSize.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipParams(dAtA[iNdEx:]) diff --git a/x/protorev/types/protorev.pb.go b/x/protorev/types/protorev.pb.go index f038bd07f87..c898f17f212 100644 --- a/x/protorev/types/protorev.pb.go +++ b/x/protorev/types/protorev.pb.go @@ -672,57 +672,6 @@ func (m *WeightMap) GetContractAddress() string { return "" } -// BaseDenom represents a single base denom that the module uses for its -// arbitrage trades. It contains the denom name alongside the step size of the -// binary search that is used to find the optimal swap amount -type BaseDenom struct { - // The denom i.e. name of the base denom (ex. uosmo) - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty" yaml:"denom"` - // The step size of the binary search that is used to find the optimal swap - // amount - StepSize cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=step_size,json=stepSize,proto3,customtype=cosmossdk.io/math.Int" json:"step_size" yaml:"step_size"` -} - -func (m *BaseDenom) Reset() { *m = BaseDenom{} } -func (m *BaseDenom) String() string { return proto.CompactTextString(m) } -func (*BaseDenom) ProtoMessage() {} -func (*BaseDenom) Descriptor() ([]byte, []int) { - return fileDescriptor_1e9f2391fd9fec01, []int{11} -} -func (m *BaseDenom) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *BaseDenom) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BaseDenom.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 *BaseDenom) XXX_Merge(src proto.Message) { - xxx_messageInfo_BaseDenom.Merge(m, src) -} -func (m *BaseDenom) XXX_Size() int { - return m.Size() -} -func (m *BaseDenom) XXX_DiscardUnknown() { - xxx_messageInfo_BaseDenom.DiscardUnknown(m) -} - -var xxx_messageInfo_BaseDenom proto.InternalMessageInfo - -func (m *BaseDenom) GetDenom() string { - if m != nil { - return m.Denom - } - return "" -} - type AllProtocolRevenue struct { TakerFeesTracker types1.TakerFeesTracker `protobuf:"bytes,1,opt,name=taker_fees_tracker,json=takerFeesTracker,proto3" json:"taker_fees_tracker" yaml:"taker_fees_tracker"` CyclicArbTracker CyclicArbTracker `protobuf:"bytes,3,opt,name=cyclic_arb_tracker,json=cyclicArbTracker,proto3" json:"cyclic_arb_tracker" yaml:"cyclic_arb_tracker"` @@ -732,7 +681,7 @@ func (m *AllProtocolRevenue) Reset() { *m = AllProtocolRevenue{} } func (m *AllProtocolRevenue) String() string { return proto.CompactTextString(m) } func (*AllProtocolRevenue) ProtoMessage() {} func (*AllProtocolRevenue) Descriptor() ([]byte, []int) { - return fileDescriptor_1e9f2391fd9fec01, []int{12} + return fileDescriptor_1e9f2391fd9fec01, []int{11} } func (m *AllProtocolRevenue) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -784,7 +733,7 @@ func (m *CyclicArbTracker) Reset() { *m = CyclicArbTracker{} } func (m *CyclicArbTracker) String() string { return proto.CompactTextString(m) } func (*CyclicArbTracker) ProtoMessage() {} func (*CyclicArbTracker) Descriptor() ([]byte, []int) { - return fileDescriptor_1e9f2391fd9fec01, []int{13} + return fileDescriptor_1e9f2391fd9fec01, []int{12} } func (m *CyclicArbTracker) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -839,7 +788,6 @@ func init() { proto.RegisterType((*ConcentratedPoolInfo)(nil), "osmosis.protorev.v1beta1.ConcentratedPoolInfo") proto.RegisterType((*CosmwasmPoolInfo)(nil), "osmosis.protorev.v1beta1.CosmwasmPoolInfo") proto.RegisterType((*WeightMap)(nil), "osmosis.protorev.v1beta1.WeightMap") - proto.RegisterType((*BaseDenom)(nil), "osmosis.protorev.v1beta1.BaseDenom") proto.RegisterType((*AllProtocolRevenue)(nil), "osmosis.protorev.v1beta1.AllProtocolRevenue") proto.RegisterType((*CyclicArbTracker)(nil), "osmosis.protorev.v1beta1.CyclicArbTracker") } @@ -849,80 +797,78 @@ func init() { } var fileDescriptor_1e9f2391fd9fec01 = []byte{ - // 1156 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x4f, 0x6f, 0x1b, 0xc5, - 0x1b, 0xce, 0xc6, 0x4e, 0x1a, 0x8f, 0x53, 0xdb, 0x99, 0xa4, 0xad, 0xe3, 0xfe, 0x7e, 0xde, 0x30, - 0xad, 0xc0, 0x45, 0xaa, 0xad, 0xa4, 0x1c, 0x50, 0x51, 0x91, 0xb2, 0x41, 0x11, 0x01, 0x91, 0x44, - 0x13, 0x4b, 0x15, 0x5c, 0x96, 0xd9, 0xf5, 0xd8, 0x59, 0xd9, 0xbb, 0x63, 0xed, 0x8c, 0xf3, 0xa7, - 0x48, 0xbd, 0x70, 0xe4, 0xc2, 0x85, 0x1b, 0x07, 0x6e, 0x70, 0xe1, 0x33, 0x70, 0xed, 0xb1, 0xc7, - 0x8a, 0xc3, 0x0a, 0x25, 0x17, 0xc4, 0xd1, 0x9f, 0x00, 0xed, 0xcc, 0xec, 0xda, 0x71, 0xe2, 0x86, - 0x48, 0x88, 0xdb, 0xce, 0xfb, 0x3e, 0xcf, 0xf3, 0xce, 0xfb, 0xbc, 0xb3, 0xb3, 0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72, 0x46, 0x12, 0x56, 0x86, 0x91, 0x59, 0x1a, 0x27, 0xb0, 0x81, 0x40, 0x58, - 0xc9, 0xee, 0x0d, 0xc4, 0xd3, 0xec, 0x9f, 0x3f, 0x99, 0x06, 0xfa, 0xd5, 0x00, 0x73, 0xb2, 0x26, - 0xdc, 0x05, 0xf3, 0x22, 0x24, 0xad, 0x7f, 0xd2, 0x49, 0x33, 0xc6, 0x59, 0x77, 0x74, 0x27, 0xb7, - 0x75, 0x11, 0x49, 0x46, 0x58, 0xab, 0xc0, 0x5d, 0x90, 0xe3, 0x82, 0xf6, 0x6d, 0xee, 0xbd, 0xa0, - 0xba, 0x87, 0xf5, 0x98, 0xf1, 0x7b, 0x64, 0xde, 0x51, 0x03, 0xe4, 0xad, 0x6e, 0xdd, 0x63, 0x0d, - 0x9f, 0x88, 0xc3, 0xfa, 0x4e, 0x20, 0x46, 0xfb, 0x4d, 0x79, 0x08, 0x2f, 0xc4, 0xcf, 0x07, 0xde, - 0x0b, 0xaa, 0xf7, 0xfb, 0x83, 0x01, 0xe6, 0x64, 0x79, 0xf8, 0x00, 0x64, 0xe3, 0xf9, 0x96, 0x8d, - 0x35, 0xa3, 0x96, 0xb5, 0x8a, 0xc3, 0xc8, 0xcc, 0x2b, 0x76, 0x1c, 0x45, 0x58, 0x26, 0xff, 0x3b, - 0x1f, 0xff, 0x32, 0x40, 0x51, 0xfa, 0x78, 0x20, 0x88, 0xf0, 0xb8, 0xf0, 0x5c, 0x0e, 0x3f, 0x07, - 0xb7, 0xfa, 0x21, 0x6b, 0x7b, 0x22, 0xb1, 0x74, 0xb5, 0xae, 0x4f, 0x77, 0x7c, 0x72, 0x53, 0x37, - 0xb7, 0x98, 0x17, 0x58, 0x77, 0xb5, 0x99, 0x05, 0xdd, 0x83, 0xe2, 0x21, 0x9c, 0x28, 0x40, 0x07, - 0x94, 0x82, 0x81, 0xef, 0xd0, 0xd0, 0x66, 0x6d, 0x5b, 0x0f, 0x4a, 0x75, 0xf4, 0xe1, 0x75, 0xae, - 0xde, 0x53, 0x9a, 0x93, 0x74, 0x84, 0x0b, 0x2a, 0xb4, 0xd7, 0x6e, 0xaa, 0x91, 0xbd, 0x0b, 0xe6, - 0xe4, 0x59, 0x2c, 0x67, 0xd6, 0x32, 0xb5, 0xac, 0x55, 0x1a, 0x46, 0xe6, 0xa2, 0xe2, 0xca, 0x30, - 0xc2, 0x2a, 0x8d, 0x7e, 0x9e, 0x05, 0xf9, 0x7d, 0xc6, 0x7a, 0xcf, 0xa9, 0xd7, 0x39, 0x14, 0x1c, - 0x3e, 0x03, 0xb7, 0xb9, 0x20, 0x4e, 0x8f, 0xda, 0xc7, 0x32, 0xa2, 0x67, 0x52, 0x1e, 0x46, 0xe6, - 0x4a, 0x32, 0xd1, 0xb1, 0x34, 0xc2, 0x8b, 0x6a, 0xad, 0xf8, 0x70, 0x0b, 0x14, 0x1d, 0xd2, 0x23, - 0x81, 0x4b, 0xc3, 0x44, 0x60, 0x56, 0x0a, 0x54, 0x86, 0x91, 0x79, 0x57, 0x09, 0x4c, 0x00, 0x10, - 0x2e, 0x24, 0x11, 0x2d, 0xb2, 0x07, 0x96, 0x5d, 0x16, 0xb8, 0x34, 0x10, 0x21, 0x11, 0xb4, 0x95, - 0x08, 0x65, 0xa4, 0x50, 0x75, 0x18, 0x99, 0x15, 0x25, 0x74, 0x05, 0x08, 0x61, 0x38, 0x1e, 0x1d, - 0xed, 0x2a, 0x36, 0xf4, 0x98, 0x70, 0x3f, 0x11, 0xcb, 0x4e, 0xee, 0x6a, 0x02, 0x80, 0x70, 0x21, - 0x89, 0x28, 0x11, 0xf4, 0x63, 0x06, 0x14, 0x76, 0x82, 0x36, 0xb3, 0x4e, 0x63, 0xbf, 0x9a, 0xa7, - 0x7d, 0x0a, 0x9f, 0x83, 0x79, 0xd5, 0xbd, 0x74, 0x29, 0xbf, 0x51, 0x9b, 0xfe, 0x9e, 0x1d, 0x48, - 0x5c, 0xcc, 0x94, 0x1a, 0x13, 0x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, 0xff, 0xa9, 0xcd, 0xc6, 0xfb, 0xc1, 0xb9, 0xb4, 0x24, 0xec, 0x82, 0xff, 0x1f, 0xaa, - 0x13, 0x4a, 0x5c, 0x97, 0x0d, 0x02, 0xe1, 0x05, 0x1d, 0x9b, 0x0b, 0x12, 0x0a, 0x6e, 0xb7, 0x43, - 0xe6, 0xcb, 0x19, 0x67, 0xac, 0xda, 0x30, 0x32, 0x1f, 0xaa, 0x1e, 0xde, 0x0a, 0x47, 0xb8, 0xa2, - 0xf2, 0x9b, 0x69, 0xfa, 0x40, 0x66, 0xb7, 0x43, 0xe6, 0x5b, 0xbb, 0xaf, 0xce, 0xaa, 0xc6, 0xeb, - 0xb3, 0xaa, 0xf1, 0xc7, 0x59, 0xd5, 0xf8, 0xfe, 0xbc, 0x3a, 0xf3, 0xfa, 0xbc, 0x3a, 0xf3, 0xe6, - 0xbc, 0x3a, 0xf3, 0xd5, 0x07, 0x1d, 0x4f, 0x1c, 0x0e, 0x9c, 0xba, 0xcb, 0xfc, 0x86, 0x76, 0xf7, - 0x71, 0x8f, 0x38, 0x3c, 0x59, 0x34, 0x8e, 0x36, 0x9e, 0x34, 0x4e, 0x46, 0x3f, 0xda, 0xe2, 0xb4, - 0x4f, 0xb9, 0x33, 0x2f, 0xd7, 0x4f, 0xfe, 0x0e, 0x00, 0x00, 0xff, 0xff, 0xe2, 0x27, 0xf6, 0x6c, - 0x89, 0x0b, 0x00, 0x00, + // 1124 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xbf, 0x6f, 0xdb, 0x46, + 0x14, 0x36, 0x2d, 0xc5, 0xb1, 0x4e, 0x89, 0xa4, 0x9c, 0x9d, 0x44, 0x56, 0x5a, 0xd1, 0xbd, 0x04, + 0xad, 0x52, 0x20, 0x12, 0xec, 0x74, 0x28, 0x52, 0xa4, 0x80, 0x69, 0xc0, 0xa8, 0x5b, 0xd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0xb3, 0x39, 0xab, 0xcf, 0xa6, 0x64, 0x59, 0x2b, 0xaf, 0x23, 0x73, + 0x6e, 0x1c, 0x99, 0x77, 0x4e, 0x88, 0x3f, 0x78, 0x86, 0x26, 0x02, 0x08, 0x17, 0x48, 0x2a, 0xdd, + 0x04, 0x8b, 0x22, 0x2e, 0x68, 0x7b, 0x41, 0x75, 0x7e, 0xd5, 0x68, 0x14, 0xac, 0xa5, 0x71, 0x64, + 0x96, 0x15, 0x27, 0xc9, 0x20, 0x7c, 0x53, 0x3e, 0x6e, 0x07, 0x70, 0x0d, 0x14, 0x54, 0x94, 0x8d, + 0x44, 0x35, 0x27, 0x09, 0xcb, 0xe3, 0xc8, 0xac, 0x4c, 0x13, 0xd8, 0x48, 0x20, 0xac, 0x64, 0x77, + 0x47, 0xe2, 0x59, 0xfe, 0xef, 0x5f, 0x4c, 0x03, 0xfd, 0x6e, 0x80, 0x1b, 0xb2, 0x26, 0xdc, 0x01, + 0x0b, 0x22, 0x24, 0x9d, 0xff, 0xd2, 0x49, 0x3b, 0xc6, 0x59, 0x77, 0x75, 0x27, 0xb7, 0x75, 0x11, + 0x49, 0x46, 0x58, 0xab, 0xc0, 0x1d, 0x50, 0xe0, 0x82, 0x0e, 0x6d, 0xee, 0xbd, 0xa4, 0xba, 0x87, + 0xb5, 0x98, 0xf1, 0x67, 0x64, 0xde, 0x55, 0x03, 0xe4, 0x9d, 0x7e, 0xd3, 0x63, 0x2d, 0x9f, 0x88, + 0x83, 0xe6, 0x76, 0x20, 0x26, 0xfb, 0x4d, 0x79, 0x08, 0x2f, 0xc6, 0xcf, 0xfb, 0xde, 0x4b, 0xaa, + 0xf7, 0xfb, 0x93, 0x01, 0x6e, 0xc8, 0xf2, 0xf0, 0x21, 0xc8, 0xc7, 0xf3, 0xad, 0x1a, 0xab, 0x46, + 0x23, 0x6f, 0x95, 0xc7, 0x91, 0x59, 0x54, 0xec, 0x38, 0x8a, 0xb0, 0x4c, 0xfe, 0x7f, 0x3e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cf, 0x6d, 0x37, 0x64, 0x9c, + 0xd3, 0x8e, 0xbe, 0x3b, 0xef, 0x8d, 0x23, 0xb3, 0xaa, 0x58, 0x17, 0x20, 0x08, 0x97, 0x7d, 0x72, + 0xdc, 0x8e, 0x43, 0x9b, 0x3a, 0x22, 0x40, 0x25, 0x6b, 0x20, 0xfc, 0x0e, 0x14, 0x55, 0x1d, 0xdb, + 0x27, 0xc3, 0xe4, 0x1d, 0xf6, 0x70, 0xf6, 0x04, 0xd4, 0x99, 0xff, 0x9a, 0x0c, 0xad, 0x9a, 0xb6, + 0x1e, 0x4e, 0x6f, 0x5b, 0xaa, 0x20, 0x0c, 0x8e, 0x12, 0x18, 0x47, 0xaf, 0x40, 0x21, 0x25, 0x5d, + 0xa7, 0xef, 0x2d, 0x50, 0x71, 0x59, 0xec, 0x9b, 0x2b, 0x6c, 0xd2, 0xe9, 0x84, 0x94, 0x27, 0x2f, + 0xc3, 0x07, 0x93, 0xf7, 0x5d, 0x16, 0x81, 0x70, 0x39, 0x09, 0x6d, 0xe8, 0xc8, 0x6f, 0xf3, 0x00, + 0x6e, 0x0c, 0x06, 0x7b, 0x71, 0x27, 0x2e, 0x1b, 0x60, 0x7a, 0x48, 0x83, 0x11, 0x85, 0xaf, 0x00, + 0x14, 0xa4, 0x4f, 0x43, 0x3b, 0xfe, 0x27, 0x88, 0xdf, 0x96, 0x6e, 0x9f, 0x86, 0xfa, 0xba, 0x3e, + 0x99, 0xf4, 0x3f, 0xf9, 0xbb, 0x98, 0x7c, 0x19, 0x63, 0xda, 0x16, 0xa5, 0xbc, 0xad, 0x48, 0xd6, + 0x07, 0xda, 0x89, 0x15, 0xfd, 0x05, 0xb9, 0x20, 0x8b, 0x70, 0x45, 0x64, 0x48, 0xf0, 0x7b, 0x00, + 0xdd, 0x13, 0x77, 0xe0, 0xb9, 0x76, 0xfc, 0x7b, 0x90, 0xd4, 0xcf, 0x5d, 0x79, 0x03, 0x24, 0x67, + 0x23, 0x74, 0x66, 0x14, 0xbf, 0xa8, 0x89, 0x70, 0xc5, 0xcd, 0x90, 0xbe, 0xcc, 0x2f, 0xce, 0x57, + 0x72, 0xb8, 0x2c, 0x8e, 0xcf, 0x6f, 0xf3, 0x0f, 0x03, 0x54, 0xb2, 0x05, 0xe0, 0xe7, 0x00, 0x4c, + 0x44, 0xaf, 0xfe, 0xc8, 0xe5, 0xe3, 0xfd, 0xe0, 0x42, 0x5a, 0x12, 0xf6, 0xc1, 0xfb, 0x07, 0xea, + 0x6c, 0x10, 0xd7, 0x65, 0xa3, 0x40, 0x78, 0x41, 0xcf, 0xe6, 0x82, 0x84, 0x82, 0xdb, 0xdd, 0x90, + 0xf9, 0x72, 0xa8, 0x39, 0xab, 0x31, 0x8e, 0xcc, 0x47, 0xaa, 0x87, 0x77, 0xc2, 0x11, 0xae, 0xa9, + 0xfc, 0x46, 0x9a, 0xde, 0x97, 0xd9, 0xad, 0x90, 0xf9, 0xd6, 0xce, 0xeb, 0xd3, 0xba, 0xf1, 0xe6, + 0xb4, 0x6e, 0xfc, 0x75, 0x5a, 0x37, 0x7e, 0x3c, 0xab, 0xcf, 0xbd, 0x39, 0xab, 0xcf, 0xbd, 0x3d, + 0xab, 0xcf, 0x7d, 0xfb, 0x49, 0xcf, 0x13, 0x07, 0x23, 0xa7, 0xe9, 0x32, 0xbf, 0xa5, 0xdd, 0x7d, + 0x32, 0x20, 0x0e, 0x4f, 0x16, 0xad, 0xc3, 0xf5, 0xa7, 0xad, 0xe3, 0xc9, 0x2f, 0xae, 0x38, 0x19, + 0x52, 0xee, 0x2c, 0xc8, 0xf5, 0xd3, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x5b, 0x3d, 0x1f, 0xf4, + 0x03, 0x0b, 0x00, 0x00, } func (this *TokenPairArbRoutes) Equal(that interface{}) bool { @@ -1494,46 +1440,6 @@ func (m *WeightMap) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *BaseDenom) 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 *BaseDenom) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BaseDenom) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.StepSize.Size() - i -= size - if _, err := m.StepSize.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintProtorev(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.Denom) > 0 { - i -= len(m.Denom) - copy(dAtA[i:], m.Denom) - i = encodeVarintProtorev(dAtA, i, uint64(len(m.Denom))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func (m *AllProtocolRevenue) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1822,21 +1728,6 @@ func (m *WeightMap) Size() (n int) { return n } -func (m *BaseDenom) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Denom) - if l > 0 { - n += 1 + l + sovProtorev(uint64(l)) - } - l = m.StepSize.Size() - n += 1 + l + sovProtorev(uint64(l)) - return n -} - func (m *AllProtocolRevenue) Size() (n int) { if m == nil { return 0 @@ -3186,122 +3077,6 @@ func (m *WeightMap) Unmarshal(dAtA []byte) error { } return nil } -func (m *BaseDenom) 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 ErrIntOverflowProtorev - } - 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: BaseDenom: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BaseDenom: 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 ErrIntOverflowProtorev - } - 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 ErrInvalidLengthProtorev - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProtorev - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Denom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StepSize", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProtorev - } - 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 ErrInvalidLengthProtorev - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProtorev - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.StepSize.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProtorev(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProtorev - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *AllProtocolRevenue) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/protorev/types/tx.pb.go b/x/protorev/types/tx.pb.go index a2969bf930b..dc3549db35d 100644 --- a/x/protorev/types/tx.pb.go +++ b/x/protorev/types/tx.pb.go @@ -609,63 +609,64 @@ func init() { func init() { proto.RegisterFile("osmosis/protorev/v1beta1/tx.proto", fileDescriptor_2783dce032fc6954) } var fileDescriptor_2783dce032fc6954 = []byte{ - // 889 bytes of a gzipped FileDescriptorProto + // 897 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xcf, 0x6f, 0xdc, 0x44, - 0x18, 0xcd, 0xa4, 0x80, 0xe8, 0xa4, 0x40, 0xd7, 0xa4, 0xad, 0xd7, 0x6c, 0xbd, 0xce, 0x84, 0xaa, - 0x9b, 0xaa, 0xb5, 0xc9, 0xb6, 0xfc, 0x90, 0x25, 0x90, 0x62, 0xf5, 0x40, 0x0f, 0x41, 0x91, 0x1b, - 0x84, 0xc4, 0x01, 0x63, 0xef, 0x4e, 0x1c, 0xab, 0x6b, 0x8f, 0xe5, 0x99, 0x44, 0xbb, 0x57, 0x8e, - 0x9c, 0x90, 0x90, 0x38, 0xf0, 0x2f, 0xc0, 0x01, 0x21, 0xae, 0xdc, 0xc3, 0xad, 0xa2, 0x07, 0x7a, - 0x61, 0x85, 0x12, 0x24, 0xae, 0x68, 0xff, 0x02, 0xe4, 0x19, 0xaf, 0x37, 0x5e, 0xdb, 0x24, 0xe9, - 0x5e, 0x56, 0xeb, 0x6f, 0xde, 0xf7, 0xbe, 0xf7, 0x9e, 0xed, 0xcf, 0x70, 0x8d, 0xd0, 0x90, 0xd0, - 0x80, 0x1a, 0x71, 0x42, 0x18, 0x49, 0xf0, 0xa1, 0x71, 0xb8, 0xe9, 0x61, 0xe6, 0x6e, 0x1a, 0x6c, - 0xa8, 0xf3, 0x9a, 0x24, 0x67, 0x10, 0x7d, 0x0a, 0xd1, 0x33, 0x88, 0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, 0x05, 0xf0, 0x5a, 0xf9, 0x2a, 0xe9, 0x9e, 0x25, 0xa2, 0xd8, 0xa3, 0x9a, 0x17, 0xef, + 0xc9, 0xa4, 0xdf, 0x17, 0xd2, 0x75, 0x74, 0xa7, 0x5c, 0x7a, 0xf9, 0xba, 0x51, 0x7e, 0x03, 0xb0, + 0x5e, 0xb9, 0x0b, 0xde, 0xbd, 0xa8, 0x1c, 0xd1, 0xa6, 0x7e, 0xf8, 0x42, 0x6d, 0x99, 0x91, 0xf7, + 0x85, 0x91, 0x2d, 0x64, 0x9c, 0xdf, 0x88, 0x58, 0x19, 0xca, 0x8f, 0x00, 0xd6, 0x8a, 0x5f, 0x3a, + 0xfd, 0x2c, 0x35, 0x79, 0xbc, 0xfa, 0xde, 0xc5, 0xf0, 0xe7, 0x7d, 0x74, 0x0a, 0x1f, 0x37, 0xe5, + 0x7b, 0x00, 0x5f, 0xcb, 0xef, 0x9f, 0xdb, 0x67, 0x8d, 0x9e, 0x61, 0xd5, 0xee, 0xf9, 0xb1, 0x99, + 0xc4, 0x4d, 0x21, 0x71, 0x1d, 0xad, 0x95, 0x4b, 0x7c, 0x6e, 0xeb, 0x58, 0x9f, 0x1c, 0x9f, 0x68, + 0xe0, 0xc9, 0x89, 0x06, 0xfe, 0x3a, 0xd1, 0xc0, 0x37, 0xa7, 0xda, 0xd2, 0x93, 0x53, 0x6d, 0xe9, + 0xd9, 0xa9, 0xb6, 0xf4, 0xf9, 0x7d, 0xcf, 0xe7, 0x07, 0x87, 0xae, 0xde, 0xa3, 0xc1, 0x94, 0xe6, + 0xee, 0x00, 0xbb, 0x2c, 0xe3, 0x3c, 0xea, 0xde, 0x33, 0x86, 0x33, 0xe6, 0xc4, 0x2b, 0x73, 0x5f, + 0x11, 0xd7, 0xf7, 0xfe, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x05, 0x15, 0xd3, 0xdd, 0x62, 0x0b, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/txfees/keeper/keeper_test.go b/x/txfees/keeper/keeper_test.go index 7698f76b567..61b204ea902 100644 --- a/x/txfees/keeper/keeper_test.go +++ b/x/txfees/keeper/keeper_test.go @@ -50,8 +50,7 @@ func (s *KeeperTestSuite) SetupTest(isCheckTx bool) { StepSize: osmomath.NewInt(1_000_000), }, } - err = s.App.ProtoRevKeeper.SetBaseDenoms(s.Ctx, baseDenomPriorities) - s.Require().NoError(err) + s.App.ProtoRevKeeper.SetBaseDenoms(s.Ctx, baseDenomPriorities) // Mint some assets to the accounts. for _, acc := range s.TestAccs { From 072eafc9644c9ec152d6d6af152fc313052aae95 Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Fri, 16 Feb 2024 12:58:00 -0700 Subject: [PATCH 02/20] register param and fix tests --- x/protorev/keeper/protorev_test.go | 4 ++-- x/protorev/types/params.go | 37 ++++++++++++++++++++++++++---- x/txfees/keeper/keeper_test.go | 4 ++++ 3 files changed, 39 insertions(+), 6 deletions(-) diff --git a/x/protorev/keeper/protorev_test.go b/x/protorev/keeper/protorev_test.go index 1b28770002a..1b46b68d9ef 100644 --- a/x/protorev/keeper/protorev_test.go +++ b/x/protorev/keeper/protorev_test.go @@ -72,10 +72,10 @@ func (s *KeeperTestSuite) TestGetAllBaseDenoms() { s.Require().Equal(0, len(baseDenoms)) // Should be able to set the base denoms - s.App.ProtoRevKeeper.SetBaseDenoms(s.Ctx, []types.BaseDenom{{Denom: "osmo"}, {Denom: "atom"}, {Denom: "weth"}}) + s.App.ProtoRevKeeper.SetBaseDenoms(s.Ctx, []types.BaseDenom{{Denom: types.OsmosisDenomination}, {Denom: "atom"}, {Denom: "weth"}}) baseDenoms = s.App.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) s.Require().Equal(3, len(baseDenoms)) - s.Require().Equal(baseDenoms[0].Denom, "osmo") + s.Require().Equal(baseDenoms[0].Denom, types.OsmosisDenomination) s.Require().Equal(baseDenoms[1].Denom, "atom") s.Require().Equal(baseDenoms[2].Denom, "weth") } diff --git a/x/protorev/types/params.go b/x/protorev/types/params.go index 6a3932cfd07..f524b24b8a3 100644 --- a/x/protorev/types/params.go +++ b/x/protorev/types/params.go @@ -17,6 +17,7 @@ var ( ParamStoreKeyEnableModule = []byte("EnableProtoRevModule") ParamStoreKeyAdminAccount = []byte("AdminAccount") + ParamStoreKeyBaseDenoms = []byte("BaseDenoms") ) // ParamKeyTable the param key table for launch module @@ -25,16 +26,17 @@ func ParamKeyTable() paramtypes.KeyTable { } // NewParams creates a new Params instance -func NewParams(enable bool, admin string) Params { +func NewParams(enable bool, admin string, baseDenoms []BaseDenom) Params { return Params{ - Enabled: enable, - Admin: admin, + Enabled: enable, + Admin: admin, + BaseDenoms: baseDenoms, } } // DefaultParams returns a default set of parameters func DefaultParams() Params { - return NewParams(DefaultEnableModule, DefaultAdminAccount) + return NewParams(DefaultEnableModule, DefaultAdminAccount, DefaultBaseDenoms) } // ParamSetPairs get the params.ParamSet @@ -42,6 +44,7 @@ func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { return paramtypes.ParamSetPairs{ paramtypes.NewParamSetPair(ParamStoreKeyEnableModule, &p.Enabled, ValidateBoolean), paramtypes.NewParamSetPair(ParamStoreKeyAdminAccount, &p.Admin, ValidateAccount), + paramtypes.NewParamSetPair(ParamStoreKeyBaseDenoms, &p.BaseDenoms, ValidateBaseDenom), } } @@ -74,3 +77,29 @@ func ValidateBoolean(i interface{}) error { } return nil } + +func ValidateBaseDenom(i interface{}) error { + denoms, ok := i.([]BaseDenom) + if !ok { + return fmt.Errorf("invalid parameter type: %T", i) + } + + // The first base denom must be the Osmosis denomination + if len(denoms) == 0 || denoms[0].Denom != OsmosisDenomination { + return fmt.Errorf("the first base denom must be the Osmosis denomination") + } + + seenDenoms := make(map[string]bool) + for _, denom := range denoms { + if err := denom.Validate(); err != nil { + return err + } + + // Ensure that the base denom is unique + if seenDenoms[denom.Denom] { + return fmt.Errorf("duplicate base denom %s", denom) + } + seenDenoms[denom.Denom] = true + } + return nil +} diff --git a/x/txfees/keeper/keeper_test.go b/x/txfees/keeper/keeper_test.go index 61b204ea902..4d4e936db0d 100644 --- a/x/txfees/keeper/keeper_test.go +++ b/x/txfees/keeper/keeper_test.go @@ -45,6 +45,10 @@ func (s *KeeperTestSuite) SetupTest(isCheckTx bool) { // Configure protorev base denoms baseDenomPriorities := []protorevtypes.BaseDenom{ + { + Denom: protorevtypes.OsmosisDenomination, + StepSize: osmomath.NewInt(1_000_000), + }, { Denom: baseDenom, StepSize: osmomath.NewInt(1_000_000), From d9b489a41772c652b3407224cdd9c39528a110fb Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Fri, 16 Feb 2024 14:39:11 -0700 Subject: [PATCH 03/20] delete old KVStore values in the upgrade handler --- app/upgrades/v24/upgrades.go | 11 +++++ app/upgrades/v24/upgrades_test.go | 74 ++++++++++++++++++++++++++++++ x/protorev/keeper/protorev.go | 67 ++++++++++++++------------- x/protorev/keeper/protorev_test.go | 5 -- x/protorev/types/params.go | 28 +---------- x/protorev/types/validate.go | 7 ++- 6 files changed, 127 insertions(+), 65 deletions(-) create mode 100644 app/upgrades/v24/upgrades_test.go diff --git a/app/upgrades/v24/upgrades.go b/app/upgrades/v24/upgrades.go index b784cac77b0..48dcc72bd27 100644 --- a/app/upgrades/v24/upgrades.go +++ b/app/upgrades/v24/upgrades.go @@ -23,6 +23,17 @@ func CreateUpgradeHandler( return nil, err } + // We no longer use the KVStore base denoms and instead use the param store for performance reasons. + // We retrieve the base denoms from the KVStore, set them in the param store, then delete them here. + baseDenoms, err := keepers.ProtoRevKeeper.DeprecatedGetAllBaseDenoms(ctx) + if err != nil { + return nil, err + } + protorevParams := keepers.ProtoRevKeeper.GetParams(ctx) + protorevParams.BaseDenoms = baseDenoms + keepers.ProtoRevKeeper.SetParams(ctx, protorevParams) + keepers.ProtoRevKeeper.DeprecatedDeleteBaseDenoms(ctx) + return migrations, nil } } diff --git a/app/upgrades/v24/upgrades_test.go b/app/upgrades/v24/upgrades_test.go new file mode 100644 index 00000000000..c843dc797ab --- /dev/null +++ b/app/upgrades/v24/upgrades_test.go @@ -0,0 +1,74 @@ +package v24_test + +import ( + "testing" + + "github.com/stretchr/testify/suite" + + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + + abci "github.com/cometbft/cometbft/abci/types" + + "github.com/osmosis-labs/osmosis/osmomath" + "github.com/osmosis-labs/osmosis/v23/app/apptesting" + protorevtypes "github.com/osmosis-labs/osmosis/v23/x/protorev/types" +) + +const ( + v24UpgradeHeight = int64(10) + HistoricalTWAPTimeIndexPrefix = "historical_time_index" + KeySeparator = "|" +) + +type UpgradeTestSuite struct { + apptesting.KeeperTestHelper +} + +func TestUpgradeTestSuite(t *testing.T) { + suite.Run(t, new(UpgradeTestSuite)) +} + +func (s *UpgradeTestSuite) TestUpgrade() { + s.Setup() + + // Set the old KVStore base denoms + s.App.ProtoRevKeeper.DeprecatedSetBaseDenoms(s.Ctx, []protorevtypes.BaseDenom{ + {Denom: protorevtypes.OsmosisDenomination, StepSize: osmomath.NewInt(1_000_000)}, + {Denom: "atom", StepSize: osmomath.NewInt(1_000_000)}, + {Denom: "weth", StepSize: osmomath.NewInt(1_000_000)}}) + oldBaseDenoms, err := s.App.ProtoRevKeeper.DeprecatedGetAllBaseDenoms(s.Ctx) + s.Require().NoError(err) + s.Require().Equal(3, len(oldBaseDenoms)) + s.Require().Equal(oldBaseDenoms[0].Denom, protorevtypes.OsmosisDenomination) + s.Require().Equal(oldBaseDenoms[1].Denom, "atom") + s.Require().Equal(oldBaseDenoms[2].Denom, "weth") + + // The new param store should return the default value + newBaseDenoms := s.App.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) + s.Require().Equal(protorevtypes.DefaultBaseDenoms, newBaseDenoms) + + dummyUpgrade(s) + s.Require().NotPanics(func() { + s.App.BeginBlocker(s.Ctx, abci.RequestBeginBlock{}) + }) + + // The new param store should return the old KVStore values + newBaseDenoms = s.App.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) + s.Require().Equal(oldBaseDenoms, newBaseDenoms) + + // The old KVStore base denoms should be deleted + oldBaseDenoms, err = s.App.ProtoRevKeeper.DeprecatedGetAllBaseDenoms(s.Ctx) + s.Require().NoError(err) + s.Require().Empty(oldBaseDenoms) +} + +func dummyUpgrade(s *UpgradeTestSuite) { + s.Ctx = s.Ctx.WithBlockHeight(v24UpgradeHeight - 1) + plan := upgradetypes.Plan{Name: "v24", Height: v24UpgradeHeight} + err := s.App.UpgradeKeeper.ScheduleUpgrade(s.Ctx, plan) + s.Require().NoError(err) + _, exists := s.App.UpgradeKeeper.GetUpgradePlan(s.Ctx) + s.Require().True(exists) + + s.Ctx = s.Ctx.WithBlockHeight(v24UpgradeHeight) +} diff --git a/x/protorev/keeper/protorev.go b/x/protorev/keeper/protorev.go index 26a847205cf..d1a8fd13209 100644 --- a/x/protorev/keeper/protorev.go +++ b/x/protorev/keeper/protorev.go @@ -76,44 +76,46 @@ func (k Keeper) DeleteAllTokenPairArbRoutes(ctx sdk.Context) { k.DeleteAllEntriesForKeyPrefix(ctx, types.KeyPrefixTokenPairRoutes) } -// // GetAllBaseDenoms returns all of the base denoms (sorted by priority in descending order) used to build cyclic arbitrage routes -// func (k Keeper) GetAllBaseDenoms(ctx sdk.Context) ([]types.BaseDenom, error) { -// baseDenoms := make([]types.BaseDenom, 0) +// DeprecatedGetAllBaseDenoms returns all of the base denoms (sorted by priority in descending order) used to build cyclic arbitrage routes +// After v24 upgrade, this method should be deleted. We now use the param store. +func (k Keeper) DeprecatedGetAllBaseDenoms(ctx sdk.Context) ([]types.BaseDenom, error) { + baseDenoms := make([]types.BaseDenom, 0) -// store := ctx.KVStore(k.storeKey) -// iterator := sdk.KVStorePrefixIterator(store, types.KeyPrefixBaseDenoms) + store := ctx.KVStore(k.storeKey) + iterator := sdk.KVStorePrefixIterator(store, types.KeyPrefixBaseDenoms) -// defer iterator.Close() -// for ; iterator.Valid(); iterator.Next() { -// baseDenom := types.BaseDenom{} -// err := baseDenom.Unmarshal(iterator.Value()) -// if err != nil { -// return []types.BaseDenom{}, err -// } + defer iterator.Close() + for ; iterator.Valid(); iterator.Next() { + baseDenom := types.BaseDenom{} + err := baseDenom.Unmarshal(iterator.Value()) + if err != nil { + return []types.BaseDenom{}, err + } -// baseDenoms = append(baseDenoms, baseDenom) -// } + baseDenoms = append(baseDenoms, baseDenom) + } -// return baseDenoms, nil -// } + return baseDenoms, nil +} -// // SetBaseDenoms sets all of the base denoms used to build cyclic arbitrage routes. The base denoms priority -// // order is going to match the order of the base denoms in the slice. -// func (k Keeper) SetBaseDenoms(ctx sdk.Context, baseDenoms []types.BaseDenom) error { -// store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixBaseDenoms) +// DeprecatedSetBaseDenoms sets all of the base denoms used to build cyclic arbitrage routes. The base denoms priority +// order is going to match the order of the base denoms in the slice. +// After v24 upgrade, this method should be deleted. We now use the param store. +func (k Keeper) DeprecatedSetBaseDenoms(ctx sdk.Context, baseDenoms []types.BaseDenom) error { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixBaseDenoms) -// for i, baseDenom := range baseDenoms { -// key := types.GetKeyPrefixBaseDenom(uint64(i)) + for i, baseDenom := range baseDenoms { + key := types.GetKeyPrefixBaseDenom(uint64(i)) -// bz, err := baseDenom.Marshal() -// if err != nil { -// return err -// } -// store.Set(key, bz) -// } + bz, err := baseDenom.Marshal() + if err != nil { + return err + } + store.Set(key, bz) + } -// return nil -// } + return nil +} func (k Keeper) GetAllBaseDenoms(ctx sdk.Context) []types.BaseDenom { return k.GetParams(ctx).BaseDenoms @@ -125,8 +127,9 @@ func (k Keeper) SetBaseDenoms(ctx sdk.Context, newBaseDenoms []types.BaseDenom) k.SetParams(ctx, params) } -// DeleteBaseDenoms deletes all of the base denoms -func (k Keeper) DeleteBaseDenoms(ctx sdk.Context) { +// DeprecatedDeleteBaseDenoms deletes all of the base denoms. +// After v24 upgrade, this method should be deleted. We now use the param store. +func (k Keeper) DeprecatedDeleteBaseDenoms(ctx sdk.Context) { k.DeleteAllEntriesForKeyPrefix(ctx, types.KeyPrefixBaseDenoms) } diff --git a/x/protorev/keeper/protorev_test.go b/x/protorev/keeper/protorev_test.go index 1b46b68d9ef..e056bb1b5a2 100644 --- a/x/protorev/keeper/protorev_test.go +++ b/x/protorev/keeper/protorev_test.go @@ -66,11 +66,6 @@ func (s *KeeperTestSuite) TestGetAllBaseDenoms() { s.Require().Equal(baseDenoms[1].Denom, "Atom") s.Require().Equal(baseDenoms[2].Denom, "ibc/0CD3A0285E1341859B5E86B6AB7682F023D03E97607CCC1DC95706411D866DF7") - // Should be able to delete all base denoms - s.App.ProtoRevKeeper.DeleteBaseDenoms(s.Ctx) - baseDenoms = s.App.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) - s.Require().Equal(0, len(baseDenoms)) - // Should be able to set the base denoms s.App.ProtoRevKeeper.SetBaseDenoms(s.Ctx, []types.BaseDenom{{Denom: types.OsmosisDenomination}, {Denom: "atom"}, {Denom: "weth"}}) baseDenoms = s.App.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) diff --git a/x/protorev/types/params.go b/x/protorev/types/params.go index f524b24b8a3..c99ea656841 100644 --- a/x/protorev/types/params.go +++ b/x/protorev/types/params.go @@ -44,7 +44,7 @@ func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { return paramtypes.ParamSetPairs{ paramtypes.NewParamSetPair(ParamStoreKeyEnableModule, &p.Enabled, ValidateBoolean), paramtypes.NewParamSetPair(ParamStoreKeyAdminAccount, &p.Admin, ValidateAccount), - paramtypes.NewParamSetPair(ParamStoreKeyBaseDenoms, &p.BaseDenoms, ValidateBaseDenom), + paramtypes.NewParamSetPair(ParamStoreKeyBaseDenoms, &p.BaseDenoms, ValidateBaseDenoms), } } @@ -77,29 +77,3 @@ func ValidateBoolean(i interface{}) error { } return nil } - -func ValidateBaseDenom(i interface{}) error { - denoms, ok := i.([]BaseDenom) - if !ok { - return fmt.Errorf("invalid parameter type: %T", i) - } - - // The first base denom must be the Osmosis denomination - if len(denoms) == 0 || denoms[0].Denom != OsmosisDenomination { - return fmt.Errorf("the first base denom must be the Osmosis denomination") - } - - seenDenoms := make(map[string]bool) - for _, denom := range denoms { - if err := denom.Validate(); err != nil { - return err - } - - // Ensure that the base denom is unique - if seenDenoms[denom.Denom] { - return fmt.Errorf("duplicate base denom %s", denom) - } - seenDenoms[denom.Denom] = true - } - return nil -} diff --git a/x/protorev/types/validate.go b/x/protorev/types/validate.go index 838a29b3acc..615518a95dc 100644 --- a/x/protorev/types/validate.go +++ b/x/protorev/types/validate.go @@ -23,7 +23,12 @@ func (base *BaseDenom) Validate() error { } // ValidateBaseDenoms validates the base denoms that are used to generate highest liquidity routes. -func ValidateBaseDenoms(denoms []BaseDenom) error { +func ValidateBaseDenoms(i interface{}) error { + denoms, ok := i.([]BaseDenom) + if !ok { + return fmt.Errorf("invalid parameter type: %T", i) + } + // The first base denom must be the Osmosis denomination if len(denoms) == 0 || denoms[0].Denom != OsmosisDenomination { return fmt.Errorf("the first base denom must be the Osmosis denomination") From 1297beca8d54400a8ee3d00f194f587fe8c1bb6a Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Fri, 16 Feb 2024 14:42:35 -0700 Subject: [PATCH 04/20] add changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b589528d1d1..53b2803d2df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### State Breaking * [#7250](https://github.com/osmosis-labs/osmosis/pull/7250) Further filter spam gauges from epoch distribution. +* [#7508](https://github.com/osmosis-labs/osmosis/pull/7508) Improve protorev performance by removing iterator and storing base denoms as a parameter. ## v23.0.0 From 0b723b460a8444dbbec2a8cab852379ed3749b66 Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Fri, 16 Feb 2024 15:16:40 -0700 Subject: [PATCH 05/20] remove BaseDenom from genState --- proto/osmosis/protorev/v1beta1/genesis.proto | 19 +-- x/protorev/keeper/genesis.go | 9 -- x/protorev/keeper/genesis_test.go | 6 - x/protorev/keeper/msg_server.go | 3 - x/protorev/keeper/protorev.go | 7 +- x/protorev/keeper/protorev_test.go | 11 +- x/protorev/types/genesis.go | 6 - x/protorev/types/genesis.pb.go | 119 ++++++++++--------- x/protorev/types/params.go | 12 ++ 9 files changed, 92 insertions(+), 100 deletions(-) diff --git a/proto/osmosis/protorev/v1beta1/genesis.proto b/proto/osmosis/protorev/v1beta1/genesis.proto index 1df1f0d5a3c..cc2a9160cb1 100644 --- a/proto/osmosis/protorev/v1beta1/genesis.proto +++ b/proto/osmosis/protorev/v1beta1/genesis.proto @@ -19,20 +19,21 @@ message GenesisState { (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"token_pair_arb_routes\"" ]; - // The base denominations being used to create cyclic arbitrage routes via the - // highest liquidity method. + // DEPRECATED: The base denominations being used to create cyclic arbitrage + // routes via the highest liquidity method. This field is deprecated and will + // be removed in a future version. repeated BaseDenom base_denoms = 3 [ (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"base_denoms\"" + (gogoproto.moretags) = "yaml:\"base_denoms\"", + deprecated = true ]; - // The pool weights that are being used to calculate the weight (compute cost) - // of each route. - // - // DEPRECATED: This field is deprecated and will be removed in the next - // release. It is replaced by the `info_by_pool_type` field. + // DEPRECATED: The pool weights that are being used to calculate the weight + // (compute cost) of each route. This field is deprecated and will be removed + // in the next release. It is replaced by the `info_by_pool_type` field. PoolWeights pool_weights = 4 [ (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"pool_weights\"" + (gogoproto.moretags) = "yaml:\"pool_weights\"", + deprecated = true ]; // The number of days since module genesis. uint64 days_since_module_genesis = 5 diff --git a/x/protorev/keeper/genesis.go b/x/protorev/keeper/genesis.go index 0a1dbb53233..9f5f0bea25e 100644 --- a/x/protorev/keeper/genesis.go +++ b/x/protorev/keeper/genesis.go @@ -25,11 +25,6 @@ func (k Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState) { } } - // Configure the initial base denoms used for cyclic route building. The order of the list of base - // denoms is the order in which routes will be prioritized i.e. routes will be built and simulated in a - // first come first serve basis that is based on the order of the base denoms. - k.SetBaseDenoms(ctx, genState.BaseDenoms) - // Update the pools on genesis. if err := k.UpdatePools(ctx); err != nil { panic(err) @@ -119,10 +114,6 @@ func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState { } genesis.TokenPairArbRoutes = routes - // Export the base denoms used for cyclic route building. - baseDenoms := k.GetAllBaseDenoms(ctx) - genesis.BaseDenoms = baseDenoms - // Export the developer fees that have been collected. fees, err := k.GetAllDeveloperFees(ctx) if err != nil { diff --git a/x/protorev/keeper/genesis_test.go b/x/protorev/keeper/genesis_test.go index 86eb5698f81..6470382d3ba 100644 --- a/x/protorev/keeper/genesis_test.go +++ b/x/protorev/keeper/genesis_test.go @@ -15,12 +15,6 @@ func (s *KeeperTestSuite) TestInitGenesis() { s.Require().Contains(tokenPairArbRoutes, route) } - baseDenoms := s.App.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) - s.Require().Equal(len(baseDenoms), len(exportedGenesis.BaseDenoms)) - for _, baseDenom := range exportedGenesis.BaseDenoms { - s.Require().Contains(baseDenoms, baseDenom) - } - params := s.App.ProtoRevKeeper.GetParams(s.Ctx) s.Require().Equal(params, exportedGenesis.Params) diff --git a/x/protorev/keeper/msg_server.go b/x/protorev/keeper/msg_server.go index 8cbf3660bfd..642ed1b5e68 100644 --- a/x/protorev/keeper/msg_server.go +++ b/x/protorev/keeper/msg_server.go @@ -146,9 +146,6 @@ func (m MsgServer) SetBaseDenoms(c context.Context, msg *types.MsgSetBaseDenoms) m.k.DeleteAllPoolsForBaseDenom(ctx, baseDenom.Denom) } - // // Delete the old base denoms - // m.k.DeleteBaseDenoms(ctx) - m.k.SetBaseDenoms(ctx, msg.BaseDenoms) // Update all of the pools diff --git a/x/protorev/keeper/protorev.go b/x/protorev/keeper/protorev.go index d1a8fd13209..b91d39f3897 100644 --- a/x/protorev/keeper/protorev.go +++ b/x/protorev/keeper/protorev.go @@ -117,14 +117,15 @@ func (k Keeper) DeprecatedSetBaseDenoms(ctx sdk.Context, baseDenoms []types.Base return nil } +// GetAllBaseDenoms returns all of the base denoms (sorted by priority in descending order) used to build cyclic arbitrage routes func (k Keeper) GetAllBaseDenoms(ctx sdk.Context) []types.BaseDenom { return k.GetParams(ctx).BaseDenoms } +// SetBaseDenoms sets all of the base denoms used to build cyclic arbitrage routes. The base denoms priority +// order is going to match the order of the base denoms in the slice. func (k Keeper) SetBaseDenoms(ctx sdk.Context, newBaseDenoms []types.BaseDenom) { - params := k.GetParams(ctx) - params.BaseDenoms = newBaseDenoms - k.SetParams(ctx, params) + k.SetParam(ctx, types.ParamStoreKeyBaseDenoms, newBaseDenoms) } // DeprecatedDeleteBaseDenoms deletes all of the base denoms. diff --git a/x/protorev/keeper/protorev_test.go b/x/protorev/keeper/protorev_test.go index e056bb1b5a2..a8f76f5c691 100644 --- a/x/protorev/keeper/protorev_test.go +++ b/x/protorev/keeper/protorev_test.go @@ -67,12 +67,13 @@ func (s *KeeperTestSuite) TestGetAllBaseDenoms() { s.Require().Equal(baseDenoms[2].Denom, "ibc/0CD3A0285E1341859B5E86B6AB7682F023D03E97607CCC1DC95706411D866DF7") // Should be able to set the base denoms - s.App.ProtoRevKeeper.SetBaseDenoms(s.Ctx, []types.BaseDenom{{Denom: types.OsmosisDenomination}, {Denom: "atom"}, {Denom: "weth"}}) + newBaseDenoms := []types.BaseDenom{ + {Denom: types.OsmosisDenomination, StepSize: osmomath.NewInt(1_000_000)}, + {Denom: "atom", StepSize: osmomath.NewInt(1_000_000)}, + {Denom: "weth", StepSize: osmomath.NewInt(1_000_000)}} + s.App.ProtoRevKeeper.SetBaseDenoms(s.Ctx, newBaseDenoms) baseDenoms = s.App.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) - s.Require().Equal(3, len(baseDenoms)) - s.Require().Equal(baseDenoms[0].Denom, types.OsmosisDenomination) - s.Require().Equal(baseDenoms[1].Denom, "atom") - s.Require().Equal(baseDenoms[2].Denom, "weth") + s.Require().Equal(newBaseDenoms, baseDenoms) } // TestGetPoolForDenomPair tests the GetPoolForDenomPair, SetPoolForDenomPair, and DeleteAllPoolsForBaseDenom functions. diff --git a/x/protorev/types/genesis.go b/x/protorev/types/genesis.go index 9655408d492..4a5da9632a5 100644 --- a/x/protorev/types/genesis.go +++ b/x/protorev/types/genesis.go @@ -50,7 +50,6 @@ func DefaultGenesis() *GenesisState { return &GenesisState{ Params: DefaultParams(), TokenPairArbRoutes: DefaultTokenPairArbRoutes, - BaseDenoms: DefaultBaseDenoms, InfoByPoolType: DefaultPoolTypeInfo, DaysSinceModuleGenesis: DefaultDaysSinceModuleGenesis, DeveloperFees: DefaultDeveloperFees, @@ -71,11 +70,6 @@ func (gs GenesisState) Validate() error { return err } - // Validate the base denoms - if err := ValidateBaseDenoms(gs.BaseDenoms); err != nil { - return err - } - // Validate the pool type information if err := gs.InfoByPoolType.Validate(); err != nil { return err diff --git a/x/protorev/types/genesis.pb.go b/x/protorev/types/genesis.pb.go index 49bf3913ad7..6657b760fc0 100644 --- a/x/protorev/types/genesis.pb.go +++ b/x/protorev/types/genesis.pb.go @@ -31,15 +31,14 @@ type GenesisState struct { Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` // Token pair arb routes for the protorev module (hot routes). TokenPairArbRoutes []TokenPairArbRoutes `protobuf:"bytes,2,rep,name=token_pair_arb_routes,json=tokenPairArbRoutes,proto3" json:"token_pair_arb_routes" yaml:"token_pair_arb_routes"` - // The base denominations being used to create cyclic arbitrage routes via the - // highest liquidity method. - BaseDenoms []BaseDenom `protobuf:"bytes,3,rep,name=base_denoms,json=baseDenoms,proto3" json:"base_denoms" yaml:"base_denoms"` - // The pool weights that are being used to calculate the weight (compute cost) - // of each route. - // - // DEPRECATED: This field is deprecated and will be removed in the next - // release. It is replaced by the `info_by_pool_type` field. - PoolWeights PoolWeights `protobuf:"bytes,4,opt,name=pool_weights,json=poolWeights,proto3" json:"pool_weights" yaml:"pool_weights"` + // DEPRECATED: The base denominations being used to create cyclic arbitrage + // routes via the highest liquidity method. This field is deprecated and will + // be removed in a future version. + BaseDenoms []BaseDenom `protobuf:"bytes,3,rep,name=base_denoms,json=baseDenoms,proto3" json:"base_denoms" yaml:"base_denoms"` // Deprecated: Do not use. + // DEPRECATED: The pool weights that are being used to calculate the weight + // (compute cost) of each route. This field is deprecated and will be removed + // in the next release. It is replaced by the `info_by_pool_type` field. + PoolWeights PoolWeights `protobuf:"bytes,4,opt,name=pool_weights,json=poolWeights,proto3" json:"pool_weights" yaml:"pool_weights"` // Deprecated: Do not use. // The number of days since module genesis. DaysSinceModuleGenesis uint64 `protobuf:"varint,5,opt,name=days_since_module_genesis,json=daysSinceModuleGenesis,proto3" json:"days_since_module_genesis,omitempty" yaml:"days_since_module_genesis"` // The fees the developer account has accumulated over time. @@ -111,6 +110,7 @@ func (m *GenesisState) GetTokenPairArbRoutes() []TokenPairArbRoutes { return nil } +// Deprecated: Do not use. func (m *GenesisState) GetBaseDenoms() []BaseDenom { if m != nil { return m.BaseDenoms @@ -118,6 +118,7 @@ func (m *GenesisState) GetBaseDenoms() []BaseDenom { return nil } +// Deprecated: Do not use. func (m *GenesisState) GetPoolWeights() PoolWeights { if m != nil { return m.PoolWeights @@ -204,56 +205,56 @@ func init() { } var fileDescriptor_3c77fc2da5752af2 = []byte{ - // 771 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x54, 0xcf, 0x4e, 0xe3, 0x46, - 0x18, 0x8f, 0x0b, 0x85, 0x32, 0x81, 0x08, 0x86, 0x06, 0x39, 0x69, 0x71, 0x5c, 0x17, 0xda, 0xa8, - 0x2a, 0xb6, 0x80, 0x9e, 0x7a, 0xa8, 0x84, 0xa9, 0x68, 0xab, 0xaa, 0x28, 0x32, 0xa9, 0x2a, 0xb5, - 0x52, 0xa7, 0x63, 0x67, 0x12, 0x2c, 0x6c, 0x8f, 0xe5, 0x99, 0x84, 0xe4, 0x01, 0x7a, 0xef, 0xc3, - 0xf4, 0x21, 0x38, 0xa2, 0xbd, 0xec, 0x9e, 0xa2, 0x15, 0xbc, 0x41, 0x9e, 0x60, 0xe5, 0x99, 0x49, - 0x02, 0x21, 0xde, 0xbd, 0x79, 0xbe, 0xef, 0xf7, 0xe7, 0xfb, 0xcd, 0x1f, 0x83, 0xaf, 0x28, 0x8b, - 0x29, 0x0b, 0x99, 0x93, 0x66, 0x94, 0xd3, 0x8c, 0x0c, 0x9c, 0xc1, 0xb1, 0x4f, 0x38, 0x3e, 0x76, - 0x7a, 0x24, 0x21, 0x2c, 0x64, 0xb6, 0x68, 0x40, 0x5d, 0xe1, 0xec, 0x29, 0xce, 0x56, 0xb8, 0xfa, - 0xa7, 0x3d, 0xda, 0xa3, 0xa2, 0xea, 0xe4, 0x5f, 0x12, 0x50, 0xff, 0xba, 0x50, 0x77, 0x26, 0x20, - 0x81, 0x87, 0xc5, 0x40, 0x9c, 0xe1, 0x58, 0x19, 0xd6, 0x6b, 0x81, 0xc0, 0x21, 0x69, 0x24, 0x17, - 0xaa, 0x65, 0xc8, 0x95, 0xe3, 0x63, 0x46, 0x66, 0xe4, 0x80, 0x86, 0x89, 0xec, 0x5b, 0xaf, 0x01, - 0xd8, 0xfc, 0x49, 0x86, 0xb9, 0xe2, 0x98, 0x13, 0xf8, 0x03, 0x58, 0x93, 0xda, 0xba, 0x66, 0x6a, - 0xcd, 0xf2, 0x89, 0x69, 0x17, 0x85, 0xb3, 0x5b, 0x02, 0xe7, 0xae, 0xde, 0x8d, 0x1b, 0x25, 0x4f, - 0xb1, 0xe0, 0xbf, 0x1a, 0xa8, 0x72, 0x7a, 0x43, 0x12, 0x94, 0xe2, 0x30, 0x43, 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0x00, 0x00, + // 770 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x54, 0xdf, 0x6e, 0xeb, 0x34, + 0x18, 0x6f, 0x38, 0x63, 0x87, 0xe3, 0xee, 0x54, 0x67, 0x1e, 0x9d, 0xdc, 0x6a, 0x4b, 0x43, 0xd8, + 0xa0, 0x42, 0x2c, 0xd1, 0x36, 0xae, 0xb8, 0x40, 0x5a, 0x86, 0x06, 0x08, 0x31, 0x55, 0x59, 0x11, + 0x12, 0x48, 0x58, 0x4e, 0xea, 0x76, 0xd1, 0x92, 0x38, 0x8a, 0xdd, 0xae, 0x7d, 0x00, 0xee, 0x79, + 0x18, 0x1e, 0x62, 0x97, 0x13, 0x57, 0x48, 0x48, 0x15, 0xda, 0xde, 0xa0, 0x4f, 0x80, 0x62, 0xbb, + 0xed, 0xd6, 0x35, 0x70, 0x17, 0x7f, 0xdf, 0xef, 0xcf, 0xf7, 0xf3, 0x9f, 0x80, 0x4f, 0x18, 0x4f, + 0x18, 0x8f, 0xb8, 0x9b, 0xe5, 0x4c, 0xb0, 0x9c, 0x8e, 0xdc, 0xd1, 0x71, 0x40, 0x05, 0x39, 0x76, + 0x07, 0x34, 0xa5, 0x3c, 0xe2, 0x8e, 0x6c, 0x40, 0xa4, 0x71, 0xce, 0x1c, 0xe7, 0x68, 0x5c, 0xf3, + 0xc3, 0x01, 0x1b, 0x30, 0x59, 0x75, 0x8b, 0x2f, 0x05, 0x68, 0x7e, 0x5a, 0xaa, 0xbb, 0x10, 0x50, + 0xc0, 0xc3, 0x72, 0x20, 0xc9, 0x49, 0xa2, 0x0d, 0x9b, 0x8d, 0x50, 0xe2, 0xb0, 0x32, 0x52, 0x0b, + 0xdd, 0x32, 0xd5, 0xca, 0x0d, 0x08, 0xa7, 0x0b, 0x72, 0xc8, 0xa2, 0x54, 0xf5, 0xed, 0xbf, 0x01, + 0xd8, 0xfa, 0x46,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0x62, 0x10, 0x89, 0xeb, 0x61, 0xe0, 0x84, 0x2c, 0x71, 0xf5, 0x00, + 0x47, 0x31, 0x09, 0xf8, 0x7c, 0xe1, 0x8e, 0x4e, 0x4e, 0xdd, 0xf1, 0xf2, 0xbf, 0x5f, 0x04, 0xe3, + 0xc1, 0xa6, 0x5c, 0x9f, 0xfe, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x95, 0xd3, 0x55, 0x14, 0x99, 0x06, + 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/protorev/types/params.go b/x/protorev/types/params.go index c99ea656841..aacf127cd8d 100644 --- a/x/protorev/types/params.go +++ b/x/protorev/types/params.go @@ -54,6 +54,18 @@ func (p Params) Validate() error { return fmt.Errorf("invalid admin account address: %s", p.Admin) } + if err := ValidateBoolean(p.Enabled); err != nil { + return err + } + + if err := ValidateAccount(p.Admin); err != nil { + return err + } + + if err := ValidateBaseDenoms(p.BaseDenoms); err != nil { + return err + } + return nil } From 96f9716dc92bcfc666373cfdb749ffb4a2b2e8fb Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Fri, 16 Feb 2024 16:08:02 -0700 Subject: [PATCH 06/20] clean approach in upgrade handler --- app/upgrades/v24/upgrades.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/upgrades/v24/upgrades.go b/app/upgrades/v24/upgrades.go index 48dcc72bd27..8e97c2531b3 100644 --- a/app/upgrades/v24/upgrades.go +++ b/app/upgrades/v24/upgrades.go @@ -29,9 +29,7 @@ func CreateUpgradeHandler( if err != nil { return nil, err } - protorevParams := keepers.ProtoRevKeeper.GetParams(ctx) - protorevParams.BaseDenoms = baseDenoms - keepers.ProtoRevKeeper.SetParams(ctx, protorevParams) + keepers.ProtoRevKeeper.SetBaseDenoms(ctx, baseDenoms) keepers.ProtoRevKeeper.DeprecatedDeleteBaseDenoms(ctx) return migrations, nil From e7e9d2e27ff8534acfd9948a646da356e151511a Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Fri, 16 Feb 2024 16:25:59 -0700 Subject: [PATCH 07/20] clean up --- app/upgrades/v24/upgrades.go | 2 +- app/upgrades/v24/upgrades_test.go | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/upgrades/v24/upgrades.go b/app/upgrades/v24/upgrades.go index 8e97c2531b3..1db047ecdc8 100644 --- a/app/upgrades/v24/upgrades.go +++ b/app/upgrades/v24/upgrades.go @@ -24,7 +24,7 @@ func CreateUpgradeHandler( } // We no longer use the KVStore base denoms and instead use the param store for performance reasons. - // We retrieve the base denoms from the KVStore, set them in the param store, then delete them here. + // We retrieve the base denoms from the KVStore, set them in the param store, then delete them from the KVStore here. baseDenoms, err := keepers.ProtoRevKeeper.DeprecatedGetAllBaseDenoms(ctx) if err != nil { return nil, err diff --git a/app/upgrades/v24/upgrades_test.go b/app/upgrades/v24/upgrades_test.go index c843dc797ab..39035098cb7 100644 --- a/app/upgrades/v24/upgrades_test.go +++ b/app/upgrades/v24/upgrades_test.go @@ -15,9 +15,7 @@ import ( ) const ( - v24UpgradeHeight = int64(10) - HistoricalTWAPTimeIndexPrefix = "historical_time_index" - KeySeparator = "|" + v24UpgradeHeight = int64(10) ) type UpgradeTestSuite struct { From 6f5e02c615119acbf3662cd973399fc8df5b6a8d Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Sat, 17 Feb 2024 15:37:23 -0700 Subject: [PATCH 08/20] Revert "clean up" This reverts commit e7e9d2e27ff8534acfd9948a646da356e151511a. --- app/upgrades/v24/upgrades.go | 2 +- app/upgrades/v24/upgrades_test.go | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/upgrades/v24/upgrades.go b/app/upgrades/v24/upgrades.go index 1db047ecdc8..8e97c2531b3 100644 --- a/app/upgrades/v24/upgrades.go +++ b/app/upgrades/v24/upgrades.go @@ -24,7 +24,7 @@ func CreateUpgradeHandler( } // We no longer use the KVStore base denoms and instead use the param store for performance reasons. - // We retrieve the base denoms from the KVStore, set them in the param store, then delete them from the KVStore here. + // We retrieve the base denoms from the KVStore, set them in the param store, then delete them here. baseDenoms, err := keepers.ProtoRevKeeper.DeprecatedGetAllBaseDenoms(ctx) if err != nil { return nil, err diff --git a/app/upgrades/v24/upgrades_test.go b/app/upgrades/v24/upgrades_test.go index 39035098cb7..c843dc797ab 100644 --- a/app/upgrades/v24/upgrades_test.go +++ b/app/upgrades/v24/upgrades_test.go @@ -15,7 +15,9 @@ import ( ) const ( - v24UpgradeHeight = int64(10) + v24UpgradeHeight = int64(10) + HistoricalTWAPTimeIndexPrefix = "historical_time_index" + KeySeparator = "|" ) type UpgradeTestSuite struct { From 7bf614e0164ec4a13d1b0c5ecad945404fb6705a Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Sat, 17 Feb 2024 15:37:48 -0700 Subject: [PATCH 09/20] Revert "clean approach in upgrade handler" This reverts commit 96f9716dc92bcfc666373cfdb749ffb4a2b2e8fb. --- app/upgrades/v24/upgrades.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/upgrades/v24/upgrades.go b/app/upgrades/v24/upgrades.go index 8e97c2531b3..48dcc72bd27 100644 --- a/app/upgrades/v24/upgrades.go +++ b/app/upgrades/v24/upgrades.go @@ -29,7 +29,9 @@ func CreateUpgradeHandler( if err != nil { return nil, err } - keepers.ProtoRevKeeper.SetBaseDenoms(ctx, baseDenoms) + protorevParams := keepers.ProtoRevKeeper.GetParams(ctx) + protorevParams.BaseDenoms = baseDenoms + keepers.ProtoRevKeeper.SetParams(ctx, protorevParams) keepers.ProtoRevKeeper.DeprecatedDeleteBaseDenoms(ctx) return migrations, nil From 7ade80aba8b30ebb5fd9e851d48c73a1096d9a17 Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Sat, 17 Feb 2024 15:38:12 -0700 Subject: [PATCH 10/20] Revert "remove BaseDenom from genState" This reverts commit 0b723b460a8444dbbec2a8cab852379ed3749b66. --- proto/osmosis/protorev/v1beta1/genesis.proto | 19 ++- x/protorev/keeper/genesis.go | 9 ++ x/protorev/keeper/genesis_test.go | 6 + x/protorev/keeper/msg_server.go | 3 + x/protorev/keeper/protorev.go | 7 +- x/protorev/keeper/protorev_test.go | 11 +- x/protorev/types/genesis.go | 6 + x/protorev/types/genesis.pb.go | 119 +++++++++---------- x/protorev/types/params.go | 12 -- 9 files changed, 100 insertions(+), 92 deletions(-) diff --git a/proto/osmosis/protorev/v1beta1/genesis.proto b/proto/osmosis/protorev/v1beta1/genesis.proto index cc2a9160cb1..1df1f0d5a3c 100644 --- a/proto/osmosis/protorev/v1beta1/genesis.proto +++ b/proto/osmosis/protorev/v1beta1/genesis.proto @@ -19,21 +19,20 @@ message GenesisState { (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"token_pair_arb_routes\"" ]; - // DEPRECATED: The base denominations being used to create cyclic arbitrage - // routes via the highest liquidity method. This field is deprecated and will - // be removed in a future version. + // The base denominations being used to create cyclic arbitrage routes via the + // highest liquidity method. repeated BaseDenom base_denoms = 3 [ (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"base_denoms\"", - deprecated = true + (gogoproto.moretags) = "yaml:\"base_denoms\"" ]; - // DEPRECATED: The pool weights that are being used to calculate the weight - // (compute cost) of each route. This field is deprecated and will be removed - // in the next release. It is replaced by the `info_by_pool_type` field. + // The pool weights that are being used to calculate the weight (compute cost) + // of each route. + // + // DEPRECATED: This field is deprecated and will be removed in the next + // release. It is replaced by the `info_by_pool_type` field. PoolWeights pool_weights = 4 [ (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"pool_weights\"", - deprecated = true + (gogoproto.moretags) = "yaml:\"pool_weights\"" ]; // The number of days since module genesis. uint64 days_since_module_genesis = 5 diff --git a/x/protorev/keeper/genesis.go b/x/protorev/keeper/genesis.go index 9f5f0bea25e..0a1dbb53233 100644 --- a/x/protorev/keeper/genesis.go +++ b/x/protorev/keeper/genesis.go @@ -25,6 +25,11 @@ func (k Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState) { } } + // Configure the initial base denoms used for cyclic route building. The order of the list of base + // denoms is the order in which routes will be prioritized i.e. routes will be built and simulated in a + // first come first serve basis that is based on the order of the base denoms. + k.SetBaseDenoms(ctx, genState.BaseDenoms) + // Update the pools on genesis. if err := k.UpdatePools(ctx); err != nil { panic(err) @@ -114,6 +119,10 @@ func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState { } genesis.TokenPairArbRoutes = routes + // Export the base denoms used for cyclic route building. + baseDenoms := k.GetAllBaseDenoms(ctx) + genesis.BaseDenoms = baseDenoms + // Export the developer fees that have been collected. fees, err := k.GetAllDeveloperFees(ctx) if err != nil { diff --git a/x/protorev/keeper/genesis_test.go b/x/protorev/keeper/genesis_test.go index 6470382d3ba..86eb5698f81 100644 --- a/x/protorev/keeper/genesis_test.go +++ b/x/protorev/keeper/genesis_test.go @@ -15,6 +15,12 @@ func (s *KeeperTestSuite) TestInitGenesis() { s.Require().Contains(tokenPairArbRoutes, route) } + baseDenoms := s.App.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) + s.Require().Equal(len(baseDenoms), len(exportedGenesis.BaseDenoms)) + for _, baseDenom := range exportedGenesis.BaseDenoms { + s.Require().Contains(baseDenoms, baseDenom) + } + params := s.App.ProtoRevKeeper.GetParams(s.Ctx) s.Require().Equal(params, exportedGenesis.Params) diff --git a/x/protorev/keeper/msg_server.go b/x/protorev/keeper/msg_server.go index 642ed1b5e68..8cbf3660bfd 100644 --- a/x/protorev/keeper/msg_server.go +++ b/x/protorev/keeper/msg_server.go @@ -146,6 +146,9 @@ func (m MsgServer) SetBaseDenoms(c context.Context, msg *types.MsgSetBaseDenoms) m.k.DeleteAllPoolsForBaseDenom(ctx, baseDenom.Denom) } + // // Delete the old base denoms + // m.k.DeleteBaseDenoms(ctx) + m.k.SetBaseDenoms(ctx, msg.BaseDenoms) // Update all of the pools diff --git a/x/protorev/keeper/protorev.go b/x/protorev/keeper/protorev.go index b91d39f3897..d1a8fd13209 100644 --- a/x/protorev/keeper/protorev.go +++ b/x/protorev/keeper/protorev.go @@ -117,15 +117,14 @@ func (k Keeper) DeprecatedSetBaseDenoms(ctx sdk.Context, baseDenoms []types.Base return nil } -// GetAllBaseDenoms returns all of the base denoms (sorted by priority in descending order) used to build cyclic arbitrage routes func (k Keeper) GetAllBaseDenoms(ctx sdk.Context) []types.BaseDenom { return k.GetParams(ctx).BaseDenoms } -// SetBaseDenoms sets all of the base denoms used to build cyclic arbitrage routes. The base denoms priority -// order is going to match the order of the base denoms in the slice. func (k Keeper) SetBaseDenoms(ctx sdk.Context, newBaseDenoms []types.BaseDenom) { - k.SetParam(ctx, types.ParamStoreKeyBaseDenoms, newBaseDenoms) + params := k.GetParams(ctx) + params.BaseDenoms = newBaseDenoms + k.SetParams(ctx, params) } // DeprecatedDeleteBaseDenoms deletes all of the base denoms. diff --git a/x/protorev/keeper/protorev_test.go b/x/protorev/keeper/protorev_test.go index a8f76f5c691..e056bb1b5a2 100644 --- a/x/protorev/keeper/protorev_test.go +++ b/x/protorev/keeper/protorev_test.go @@ -67,13 +67,12 @@ func (s *KeeperTestSuite) TestGetAllBaseDenoms() { s.Require().Equal(baseDenoms[2].Denom, "ibc/0CD3A0285E1341859B5E86B6AB7682F023D03E97607CCC1DC95706411D866DF7") // Should be able to set the base denoms - newBaseDenoms := []types.BaseDenom{ - {Denom: types.OsmosisDenomination, StepSize: osmomath.NewInt(1_000_000)}, - {Denom: "atom", StepSize: osmomath.NewInt(1_000_000)}, - {Denom: "weth", StepSize: osmomath.NewInt(1_000_000)}} - s.App.ProtoRevKeeper.SetBaseDenoms(s.Ctx, newBaseDenoms) + s.App.ProtoRevKeeper.SetBaseDenoms(s.Ctx, []types.BaseDenom{{Denom: types.OsmosisDenomination}, {Denom: "atom"}, {Denom: "weth"}}) baseDenoms = s.App.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) - s.Require().Equal(newBaseDenoms, baseDenoms) + s.Require().Equal(3, len(baseDenoms)) + s.Require().Equal(baseDenoms[0].Denom, types.OsmosisDenomination) + s.Require().Equal(baseDenoms[1].Denom, "atom") + s.Require().Equal(baseDenoms[2].Denom, "weth") } // TestGetPoolForDenomPair tests the GetPoolForDenomPair, SetPoolForDenomPair, and DeleteAllPoolsForBaseDenom functions. diff --git a/x/protorev/types/genesis.go b/x/protorev/types/genesis.go index 4a5da9632a5..9655408d492 100644 --- a/x/protorev/types/genesis.go +++ b/x/protorev/types/genesis.go @@ -50,6 +50,7 @@ func DefaultGenesis() *GenesisState { return &GenesisState{ Params: DefaultParams(), TokenPairArbRoutes: DefaultTokenPairArbRoutes, + BaseDenoms: DefaultBaseDenoms, InfoByPoolType: DefaultPoolTypeInfo, DaysSinceModuleGenesis: DefaultDaysSinceModuleGenesis, DeveloperFees: DefaultDeveloperFees, @@ -70,6 +71,11 @@ func (gs GenesisState) Validate() error { return err } + // Validate the base denoms + if err := ValidateBaseDenoms(gs.BaseDenoms); err != nil { + return err + } + // Validate the pool type information if err := gs.InfoByPoolType.Validate(); err != nil { return err diff --git a/x/protorev/types/genesis.pb.go b/x/protorev/types/genesis.pb.go index 6657b760fc0..49bf3913ad7 100644 --- a/x/protorev/types/genesis.pb.go +++ b/x/protorev/types/genesis.pb.go @@ -31,14 +31,15 @@ type GenesisState struct { Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` // Token pair arb routes for the protorev module (hot routes). TokenPairArbRoutes []TokenPairArbRoutes `protobuf:"bytes,2,rep,name=token_pair_arb_routes,json=tokenPairArbRoutes,proto3" json:"token_pair_arb_routes" yaml:"token_pair_arb_routes"` - // DEPRECATED: The base denominations being used to create cyclic arbitrage - // routes via the highest liquidity method. This field is deprecated and will - // be removed in a future version. - BaseDenoms []BaseDenom `protobuf:"bytes,3,rep,name=base_denoms,json=baseDenoms,proto3" json:"base_denoms" yaml:"base_denoms"` // Deprecated: Do not use. - // DEPRECATED: The pool weights that are being used to calculate the weight - // (compute cost) of each route. This field is deprecated and will be removed - // in the next release. It is replaced by the `info_by_pool_type` field. - PoolWeights PoolWeights `protobuf:"bytes,4,opt,name=pool_weights,json=poolWeights,proto3" json:"pool_weights" yaml:"pool_weights"` // Deprecated: Do not use. + // The base denominations being used to create cyclic arbitrage routes via the + // highest liquidity method. + BaseDenoms []BaseDenom `protobuf:"bytes,3,rep,name=base_denoms,json=baseDenoms,proto3" json:"base_denoms" yaml:"base_denoms"` + // The pool weights that are being used to calculate the weight (compute cost) + // of each route. + // + // DEPRECATED: This field is deprecated and will be removed in the next + // release. It is replaced by the `info_by_pool_type` field. + PoolWeights PoolWeights `protobuf:"bytes,4,opt,name=pool_weights,json=poolWeights,proto3" json:"pool_weights" yaml:"pool_weights"` // The number of days since module genesis. DaysSinceModuleGenesis uint64 `protobuf:"varint,5,opt,name=days_since_module_genesis,json=daysSinceModuleGenesis,proto3" json:"days_since_module_genesis,omitempty" yaml:"days_since_module_genesis"` // The fees the developer account has accumulated over time. @@ -110,7 +111,6 @@ func (m *GenesisState) GetTokenPairArbRoutes() []TokenPairArbRoutes { return nil } -// Deprecated: Do not use. func (m *GenesisState) GetBaseDenoms() []BaseDenom { if m != nil { return m.BaseDenoms @@ -118,7 +118,6 @@ func (m *GenesisState) GetBaseDenoms() []BaseDenom { return nil } -// Deprecated: Do not use. func (m *GenesisState) GetPoolWeights() PoolWeights { if m != nil { return m.PoolWeights @@ -205,56 +204,56 @@ func init() { } var fileDescriptor_3c77fc2da5752af2 = []byte{ - // 770 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x54, 0xdf, 0x6e, 0xeb, 0x34, - 0x18, 0x6f, 0x38, 0x63, 0x87, 0xe3, 0xee, 0x54, 0x67, 0x1e, 0x9d, 0xdc, 0x6a, 0x4b, 0x43, 0xd8, - 0xa0, 0x42, 0x2c, 0xd1, 0x36, 0xae, 0xb8, 0x40, 0x5a, 0x86, 0x06, 0x08, 0x31, 0x55, 0x59, 0x11, - 0x12, 0x48, 0x58, 0x4e, 0xea, 0x76, 0xd1, 0x92, 0x38, 0x8a, 0xdd, 0xae, 0x7d, 0x00, 0xee, 0x79, - 0x18, 0x1e, 0x62, 0x97, 0x13, 0x57, 0x48, 0x48, 0x15, 0xda, 0xde, 0xa0, 0x4f, 0x80, 0x62, 0xbb, - 0xed, 0xd6, 0x35, 0x70, 0x17, 0x7f, 0xdf, 0xef, 0xcf, 0xf7, 0xf3, 0x9f, 0x80, 0x4f, 0x18, 0x4f, - 0x18, 0x8f, 0xb8, 0x9b, 0xe5, 0x4c, 0xb0, 0x9c, 0x8e, 0xdc, 0xd1, 0x71, 0x40, 0x05, 0x39, 0x76, - 0x07, 0x34, 0xa5, 0x3c, 0xe2, 0x8e, 0x6c, 0x40, 0xa4, 0x71, 0xce, 0x1c, 0xe7, 0x68, 0x5c, 0xf3, - 0xc3, 0x01, 0x1b, 0x30, 0x59, 0x75, 0x8b, 0x2f, 0x05, 0x68, 0x7e, 0x5a, 0xaa, 0xbb, 0x10, 0x50, - 0xc0, 0xc3, 0x72, 0x20, 0xc9, 0x49, 0xa2, 0x0d, 0x9b, 0x8d, 0x50, 0xe2, 0xb0, 0x32, 0x52, 0x0b, - 0xdd, 0x32, 0xd5, 0xca, 0x0d, 0x08, 0xa7, 0x0b, 0x72, 0xc8, 0xa2, 0x54, 0xf5, 0xed, 0xbf, 0x01, - 0xd8, 0xfa, 0x46, 0x85, 0xb9, 0x12, 0x44, 0x50, 0xf8, 0x15, 0xd8, 0x54, 0xda, 0xc8, 0xb0, 0x8c, - 0x76, 0xf5, 0xc4, 0x72, 0xca, 0xc2, 0x39, 0x1d, 0x89, 0xf3, 0x36, 0xee, 0xa6, 0xad, 0x8a, 0xaf, - 0x59, 0xf0, 0x37, 0x03, 0xd4, 0x05, 0xbb, 0xa1, 0x29, 0xce, 0x48, 0x94, 0x63, 0x92, 0x07, 0x38, - 0x67, 0x43, 0x41, 0x39, 0x7a, 0xcf,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0xbc, 0xce, 0x72, 0xd6, 0x8f, 0x04, 0x47, 0x5b, 0xff, 0x77, 0x25, 0x76, 0xf5, 0x95, 0xa8, 0x69, - 0x17, 0xc5, 0xb3, 0xfd, 0xb9, 0x02, 0x1c, 0x82, 0xed, 0x28, 0xed, 0x33, 0x1c, 0x4c, 0x54, 0x28, - 0x31, 0xc9, 0x28, 0x7a, 0x2b, 0x5f, 0x4d, 0xbb, 0xfc, 0xd5, 0x7c, 0x97, 0xf6, 0x99, 0x37, 0x29, - 0xd2, 0x76, 0x27, 0x19, 0xf5, 0x2c, 0xed, 0xa2, 0xcf, 0xf8, 0x85, 0xa0, 0xed, 0xd7, 0xa2, 0x67, - 0x0c, 0x78, 0x0b, 0x60, 0x38, 0x09, 0xe3, 0x28, 0x94, 0x7f, 0x0d, 0x91, 0x93, 0xf0, 0x86, 0xe6, - 0xa8, 0x26, 0x7d, 0x3f, 0x2b, 0xf7, 0x3d, 0x97, 0x9c, 0xb3, 0x3c, 0xe8, 0x2a, 0x86, 0xb7, 0x3f, - 0x9b, 0xb6, 0x1a, 0xca, 0xf5, 0xa5, 0x9e, 0xed, 0xbf, 0x0b, 0x57, 0x09, 0x97, 0x77, 0x0f, 0xa6, - 0x71, 0xff, 0x60, 0x1a, 0xff, 0x3c, 0x98, 0xc6, 0xef, 0x8f, 0x66, 0xe5, 0xfe, 0xd1, 0xac, 0xfc, - 0xf5, 0x68, 0x56, 0x7e, 0xfe, 0x62, 0x10, 0x89, 0xeb, 0x61, 0xe0, 0x84, 0x2c, 0x71, 0xf5, 0x00, - 0x47, 0x31, 0x09, 0xf8, 0x7c, 0xe1, 0x8e, 0x4e, 0x4e, 0xdd, 0xf1, 0xf2, 0xbf, 0x5f, 0x04, 0xe3, - 0xc1, 0xa6, 0x5c, 0x9f, 0xfe, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x95, 0xd3, 0x55, 0x14, 0x99, 0x06, - 0x00, 0x00, + // 771 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x54, 0xcf, 0x4e, 0xe3, 0x46, + 0x18, 0x8f, 0x0b, 0x85, 0x32, 0x81, 0x08, 0x86, 0x06, 0x39, 0x69, 0x71, 0x5c, 0x17, 0xda, 0xa8, + 0x2a, 0xb6, 0x80, 0x9e, 0x7a, 0xa8, 0x84, 0xa9, 0x68, 0xab, 0xaa, 0x28, 0x32, 0xa9, 0x2a, 0xb5, + 0x52, 0xa7, 0x63, 0x67, 0x12, 0x2c, 0x6c, 0x8f, 0xe5, 0x99, 0x84, 0xe4, 0x01, 0x7a, 0xef, 0xc3, + 0xf4, 0x21, 0x38, 0xa2, 0xbd, 0xec, 0x9e, 0xa2, 0x15, 0xbc, 0x41, 0x9e, 0x60, 0xe5, 0x99, 0x49, + 0x02, 0x21, 0xde, 0xbd, 0x79, 0xbe, 0xef, 0xf7, 0xe7, 0xfb, 0xcd, 0x1f, 0x83, 0xaf, 0x28, 0x8b, + 0x29, 0x0b, 0x99, 0x93, 0x66, 0x94, 0xd3, 0x8c, 0x0c, 0x9c, 0xc1, 0xb1, 0x4f, 0x38, 0x3e, 0x76, + 0x7a, 0x24, 0x21, 0x2c, 0x64, 0xb6, 0x68, 0x40, 0x5d, 0xe1, 0xec, 0x29, 0xce, 0x56, 0xb8, 0xfa, + 0xa7, 0x3d, 0xda, 0xa3, 0xa2, 0xea, 0xe4, 0x5f, 0x12, 0x50, 0xff, 0xba, 0x50, 0x77, 0x26, 0x20, + 0x81, 0x87, 0xc5, 0x40, 0x9c, 0xe1, 0x58, 0x19, 0xd6, 0x6b, 0x81, 0xc0, 0x21, 0x69, 0x24, 0x17, + 0xaa, 0x65, 0xc8, 0x95, 0xe3, 0x63, 0x46, 0x66, 0xe4, 0x80, 0x86, 0x89, 0xec, 0x5b, 0xaf, 0x01, + 0xd8, 0xfc, 0x49, 0x86, 0xb9, 0xe2, 0x98, 0x13, 0xf8, 0x03, 0x58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0x50, 0x21, 0xd4, 0xf2, 0xf6, 0xf2, 0xde, 0x55, 0xde, 0xfa, 0x4d, 0x74, 0xd4, 0xb1, 0x43, + 0x04, 0x2a, 0x1d, 0x32, 0x20, 0x11, 0x4d, 0x49, 0x86, 0xba, 0x84, 0x30, 0x7d, 0x4d, 0x6c, 0x56, + 0xcd, 0x56, 0x37, 0x29, 0xcf, 0x3c, 0x0b, 0x71, 0x4e, 0xc3, 0xc4, 0xdd, 0x57, 0xd3, 0x57, 0x95, + 0xe9, 0x33, 0xba, 0xe5, 0x6d, 0xcd, 0x0a, 0x17, 0x84, 0x30, 0x78, 0x09, 0x76, 0x23, 0xcc, 0x09, + 0xe3, 0xc8, 0x8f, 0x68, 0x70, 0x83, 0xae, 0x45, 0x32, 0x7d, 0x5d, 0xcc, 0x6e, 0x4c, 0xc6, 0x8d, + 0xba, 0x94, 0x59, 0x02, 0xb2, 0xbc, 0x1d, 0x59, 0x75, 0xf3, 0xe2, 0xcf, 0xa2, 0x06, 0xff, 0x02, + 0x3b, 0x73, 0x47, 0xdc, 0xe9, 0x64, 0x84, 0x31, 0xfd, 0x13, 0x53, 0x6b, 0x6e, 0xb8, 0xf6, 0x64, + 0xdc, 0xd0, 0x17, 0x87, 0x52, 0x10, 0xeb, 0xd5, 0xff, 0x47, 0x15, 0x15, 0xe9, 0x4c, 0x96, 0xbc, + 0xed, 0x19, 0x4a, 0x55, 0xe0, 0xdf, 0xa0, 0x16, 0xe3, 0x21, 0x12, 0x07, 0x92, 0xd2, 0x30, 0xe1, + 0x0c, 0xe5, 0x1a, 0x62, 0x28, 0x7d, 0x63, 0x71, 0xbb, 0x0b, 0xa1, 0x96, 0x57, 0x8d, 0xf1, 0x30, + 0x3f, 0xf1, 0x96, 0xe8, 0xb4, 0x48, 0x26, 0x22, 0xc0, 0xdf, 0xc1, 0xde, 0x32, 0x12, 0x1f, 0xea, + 0x40, 0x88, 0x7f, 0x31, 0x19, 0x37, 0xf6, 0x8b, 0xc5, 0xf9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0x06, + 0x38, 0x8a, 0xb0, 0xcf, 0xa6, 0x0b, 0x67, 0x70, 0x72, 0xea, 0x0c, 0xe7, 0xff, 0xfc, 0x3c, 0x18, + 0xf3, 0xd7, 0xc4, 0xfa, 0xf4, 0x5d, 0x00, 0x00, 0x00, 0xff, 0xff, 0x1d, 0xaa, 0x99, 0x66, 0x95, + 0x06, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/protorev/types/params.go b/x/protorev/types/params.go index aacf127cd8d..c99ea656841 100644 --- a/x/protorev/types/params.go +++ b/x/protorev/types/params.go @@ -54,18 +54,6 @@ func (p Params) Validate() error { return fmt.Errorf("invalid admin account address: %s", p.Admin) } - if err := ValidateBoolean(p.Enabled); err != nil { - return err - } - - if err := ValidateAccount(p.Admin); err != nil { - return err - } - - if err := ValidateBaseDenoms(p.BaseDenoms); err != nil { - return err - } - return nil } From f213ec1e0ea24bbedab325a81ac541670bd8414f Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Sat, 17 Feb 2024 15:38:20 -0700 Subject: [PATCH 11/20] Revert "add changelog entry" This reverts commit 1297beca8d54400a8ee3d00f194f587fe8c1bb6a. --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 53b2803d2df..b589528d1d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,7 +45,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### State Breaking * [#7250](https://github.com/osmosis-labs/osmosis/pull/7250) Further filter spam gauges from epoch distribution. -* [#7508](https://github.com/osmosis-labs/osmosis/pull/7508) Improve protorev performance by removing iterator and storing base denoms as a parameter. ## v23.0.0 From 22feaf0970ceadca9be5ada9b2ee08548b3854b7 Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Sat, 17 Feb 2024 15:38:26 -0700 Subject: [PATCH 12/20] Revert "delete old KVStore values in the upgrade handler" This reverts commit d9b489a41772c652b3407224cdd9c39528a110fb. --- app/upgrades/v24/upgrades.go | 11 ----- app/upgrades/v24/upgrades_test.go | 74 ------------------------------ x/protorev/keeper/protorev.go | 67 +++++++++++++-------------- x/protorev/keeper/protorev_test.go | 5 ++ x/protorev/types/params.go | 28 ++++++++++- x/protorev/types/validate.go | 7 +-- 6 files changed, 65 insertions(+), 127 deletions(-) delete mode 100644 app/upgrades/v24/upgrades_test.go diff --git a/app/upgrades/v24/upgrades.go b/app/upgrades/v24/upgrades.go index 48dcc72bd27..b784cac77b0 100644 --- a/app/upgrades/v24/upgrades.go +++ b/app/upgrades/v24/upgrades.go @@ -23,17 +23,6 @@ func CreateUpgradeHandler( return nil, err } - // We no longer use the KVStore base denoms and instead use the param store for performance reasons. - // We retrieve the base denoms from the KVStore, set them in the param store, then delete them here. - baseDenoms, err := keepers.ProtoRevKeeper.DeprecatedGetAllBaseDenoms(ctx) - if err != nil { - return nil, err - } - protorevParams := keepers.ProtoRevKeeper.GetParams(ctx) - protorevParams.BaseDenoms = baseDenoms - keepers.ProtoRevKeeper.SetParams(ctx, protorevParams) - keepers.ProtoRevKeeper.DeprecatedDeleteBaseDenoms(ctx) - return migrations, nil } } diff --git a/app/upgrades/v24/upgrades_test.go b/app/upgrades/v24/upgrades_test.go deleted file mode 100644 index c843dc797ab..00000000000 --- a/app/upgrades/v24/upgrades_test.go +++ /dev/null @@ -1,74 +0,0 @@ -package v24_test - -import ( - "testing" - - "github.com/stretchr/testify/suite" - - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - - abci "github.com/cometbft/cometbft/abci/types" - - "github.com/osmosis-labs/osmosis/osmomath" - "github.com/osmosis-labs/osmosis/v23/app/apptesting" - protorevtypes "github.com/osmosis-labs/osmosis/v23/x/protorev/types" -) - -const ( - v24UpgradeHeight = int64(10) - HistoricalTWAPTimeIndexPrefix = "historical_time_index" - KeySeparator = "|" -) - -type UpgradeTestSuite struct { - apptesting.KeeperTestHelper -} - -func TestUpgradeTestSuite(t *testing.T) { - suite.Run(t, new(UpgradeTestSuite)) -} - -func (s *UpgradeTestSuite) TestUpgrade() { - s.Setup() - - // Set the old KVStore base denoms - s.App.ProtoRevKeeper.DeprecatedSetBaseDenoms(s.Ctx, []protorevtypes.BaseDenom{ - {Denom: protorevtypes.OsmosisDenomination, StepSize: osmomath.NewInt(1_000_000)}, - {Denom: "atom", StepSize: osmomath.NewInt(1_000_000)}, - {Denom: "weth", StepSize: osmomath.NewInt(1_000_000)}}) - oldBaseDenoms, err := s.App.ProtoRevKeeper.DeprecatedGetAllBaseDenoms(s.Ctx) - s.Require().NoError(err) - s.Require().Equal(3, len(oldBaseDenoms)) - s.Require().Equal(oldBaseDenoms[0].Denom, protorevtypes.OsmosisDenomination) - s.Require().Equal(oldBaseDenoms[1].Denom, "atom") - s.Require().Equal(oldBaseDenoms[2].Denom, "weth") - - // The new param store should return the default value - newBaseDenoms := s.App.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) - s.Require().Equal(protorevtypes.DefaultBaseDenoms, newBaseDenoms) - - dummyUpgrade(s) - s.Require().NotPanics(func() { - s.App.BeginBlocker(s.Ctx, abci.RequestBeginBlock{}) - }) - - // The new param store should return the old KVStore values - newBaseDenoms = s.App.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) - s.Require().Equal(oldBaseDenoms, newBaseDenoms) - - // The old KVStore base denoms should be deleted - oldBaseDenoms, err = s.App.ProtoRevKeeper.DeprecatedGetAllBaseDenoms(s.Ctx) - s.Require().NoError(err) - s.Require().Empty(oldBaseDenoms) -} - -func dummyUpgrade(s *UpgradeTestSuite) { - s.Ctx = s.Ctx.WithBlockHeight(v24UpgradeHeight - 1) - plan := upgradetypes.Plan{Name: "v24", Height: v24UpgradeHeight} - err := s.App.UpgradeKeeper.ScheduleUpgrade(s.Ctx, plan) - s.Require().NoError(err) - _, exists := s.App.UpgradeKeeper.GetUpgradePlan(s.Ctx) - s.Require().True(exists) - - s.Ctx = s.Ctx.WithBlockHeight(v24UpgradeHeight) -} diff --git a/x/protorev/keeper/protorev.go b/x/protorev/keeper/protorev.go index d1a8fd13209..26a847205cf 100644 --- a/x/protorev/keeper/protorev.go +++ b/x/protorev/keeper/protorev.go @@ -76,46 +76,44 @@ func (k Keeper) DeleteAllTokenPairArbRoutes(ctx sdk.Context) { k.DeleteAllEntriesForKeyPrefix(ctx, types.KeyPrefixTokenPairRoutes) } -// DeprecatedGetAllBaseDenoms returns all of the base denoms (sorted by priority in descending order) used to build cyclic arbitrage routes -// After v24 upgrade, this method should be deleted. We now use the param store. -func (k Keeper) DeprecatedGetAllBaseDenoms(ctx sdk.Context) ([]types.BaseDenom, error) { - baseDenoms := make([]types.BaseDenom, 0) +// // GetAllBaseDenoms returns all of the base denoms (sorted by priority in descending order) used to build cyclic arbitrage routes +// func (k Keeper) GetAllBaseDenoms(ctx sdk.Context) ([]types.BaseDenom, error) { +// baseDenoms := make([]types.BaseDenom, 0) - store := ctx.KVStore(k.storeKey) - iterator := sdk.KVStorePrefixIterator(store, types.KeyPrefixBaseDenoms) +// store := ctx.KVStore(k.storeKey) +// iterator := sdk.KVStorePrefixIterator(store, types.KeyPrefixBaseDenoms) - defer iterator.Close() - for ; iterator.Valid(); iterator.Next() { - baseDenom := types.BaseDenom{} - err := baseDenom.Unmarshal(iterator.Value()) - if err != nil { - return []types.BaseDenom{}, err - } +// defer iterator.Close() +// for ; iterator.Valid(); iterator.Next() { +// baseDenom := types.BaseDenom{} +// err := baseDenom.Unmarshal(iterator.Value()) +// if err != nil { +// return []types.BaseDenom{}, err +// } - baseDenoms = append(baseDenoms, baseDenom) - } +// baseDenoms = append(baseDenoms, baseDenom) +// } - return baseDenoms, nil -} +// return baseDenoms, nil +// } -// DeprecatedSetBaseDenoms sets all of the base denoms used to build cyclic arbitrage routes. The base denoms priority -// order is going to match the order of the base denoms in the slice. -// After v24 upgrade, this method should be deleted. We now use the param store. -func (k Keeper) DeprecatedSetBaseDenoms(ctx sdk.Context, baseDenoms []types.BaseDenom) error { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixBaseDenoms) +// // SetBaseDenoms sets all of the base denoms used to build cyclic arbitrage routes. The base denoms priority +// // order is going to match the order of the base denoms in the slice. +// func (k Keeper) SetBaseDenoms(ctx sdk.Context, baseDenoms []types.BaseDenom) error { +// store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixBaseDenoms) - for i, baseDenom := range baseDenoms { - key := types.GetKeyPrefixBaseDenom(uint64(i)) +// for i, baseDenom := range baseDenoms { +// key := types.GetKeyPrefixBaseDenom(uint64(i)) - bz, err := baseDenom.Marshal() - if err != nil { - return err - } - store.Set(key, bz) - } +// bz, err := baseDenom.Marshal() +// if err != nil { +// return err +// } +// store.Set(key, bz) +// } - return nil -} +// return nil +// } func (k Keeper) GetAllBaseDenoms(ctx sdk.Context) []types.BaseDenom { return k.GetParams(ctx).BaseDenoms @@ -127,9 +125,8 @@ func (k Keeper) SetBaseDenoms(ctx sdk.Context, newBaseDenoms []types.BaseDenom) k.SetParams(ctx, params) } -// DeprecatedDeleteBaseDenoms deletes all of the base denoms. -// After v24 upgrade, this method should be deleted. We now use the param store. -func (k Keeper) DeprecatedDeleteBaseDenoms(ctx sdk.Context) { +// DeleteBaseDenoms deletes all of the base denoms +func (k Keeper) DeleteBaseDenoms(ctx sdk.Context) { k.DeleteAllEntriesForKeyPrefix(ctx, types.KeyPrefixBaseDenoms) } diff --git a/x/protorev/keeper/protorev_test.go b/x/protorev/keeper/protorev_test.go index e056bb1b5a2..1b46b68d9ef 100644 --- a/x/protorev/keeper/protorev_test.go +++ b/x/protorev/keeper/protorev_test.go @@ -66,6 +66,11 @@ func (s *KeeperTestSuite) TestGetAllBaseDenoms() { s.Require().Equal(baseDenoms[1].Denom, "Atom") s.Require().Equal(baseDenoms[2].Denom, "ibc/0CD3A0285E1341859B5E86B6AB7682F023D03E97607CCC1DC95706411D866DF7") + // Should be able to delete all base denoms + s.App.ProtoRevKeeper.DeleteBaseDenoms(s.Ctx) + baseDenoms = s.App.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) + s.Require().Equal(0, len(baseDenoms)) + // Should be able to set the base denoms s.App.ProtoRevKeeper.SetBaseDenoms(s.Ctx, []types.BaseDenom{{Denom: types.OsmosisDenomination}, {Denom: "atom"}, {Denom: "weth"}}) baseDenoms = s.App.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) diff --git a/x/protorev/types/params.go b/x/protorev/types/params.go index c99ea656841..f524b24b8a3 100644 --- a/x/protorev/types/params.go +++ b/x/protorev/types/params.go @@ -44,7 +44,7 @@ func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { return paramtypes.ParamSetPairs{ paramtypes.NewParamSetPair(ParamStoreKeyEnableModule, &p.Enabled, ValidateBoolean), paramtypes.NewParamSetPair(ParamStoreKeyAdminAccount, &p.Admin, ValidateAccount), - paramtypes.NewParamSetPair(ParamStoreKeyBaseDenoms, &p.BaseDenoms, ValidateBaseDenoms), + paramtypes.NewParamSetPair(ParamStoreKeyBaseDenoms, &p.BaseDenoms, ValidateBaseDenom), } } @@ -77,3 +77,29 @@ func ValidateBoolean(i interface{}) error { } return nil } + +func ValidateBaseDenom(i interface{}) error { + denoms, ok := i.([]BaseDenom) + if !ok { + return fmt.Errorf("invalid parameter type: %T", i) + } + + // The first base denom must be the Osmosis denomination + if len(denoms) == 0 || denoms[0].Denom != OsmosisDenomination { + return fmt.Errorf("the first base denom must be the Osmosis denomination") + } + + seenDenoms := make(map[string]bool) + for _, denom := range denoms { + if err := denom.Validate(); err != nil { + return err + } + + // Ensure that the base denom is unique + if seenDenoms[denom.Denom] { + return fmt.Errorf("duplicate base denom %s", denom) + } + seenDenoms[denom.Denom] = true + } + return nil +} diff --git a/x/protorev/types/validate.go b/x/protorev/types/validate.go index 615518a95dc..838a29b3acc 100644 --- a/x/protorev/types/validate.go +++ b/x/protorev/types/validate.go @@ -23,12 +23,7 @@ func (base *BaseDenom) Validate() error { } // ValidateBaseDenoms validates the base denoms that are used to generate highest liquidity routes. -func ValidateBaseDenoms(i interface{}) error { - denoms, ok := i.([]BaseDenom) - if !ok { - return fmt.Errorf("invalid parameter type: %T", i) - } - +func ValidateBaseDenoms(denoms []BaseDenom) error { // The first base denom must be the Osmosis denomination if len(denoms) == 0 || denoms[0].Denom != OsmosisDenomination { return fmt.Errorf("the first base denom must be the Osmosis denomination") From 50fd552b63530e56d7a56280d384b0aa81d2c0e0 Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Sat, 17 Feb 2024 15:38:32 -0700 Subject: [PATCH 13/20] Revert "register param and fix tests" This reverts commit 072eafc9644c9ec152d6d6af152fc313052aae95. --- x/protorev/keeper/protorev_test.go | 4 ++-- x/protorev/types/params.go | 37 ++++-------------------------- x/txfees/keeper/keeper_test.go | 4 ---- 3 files changed, 6 insertions(+), 39 deletions(-) diff --git a/x/protorev/keeper/protorev_test.go b/x/protorev/keeper/protorev_test.go index 1b46b68d9ef..1b28770002a 100644 --- a/x/protorev/keeper/protorev_test.go +++ b/x/protorev/keeper/protorev_test.go @@ -72,10 +72,10 @@ func (s *KeeperTestSuite) TestGetAllBaseDenoms() { s.Require().Equal(0, len(baseDenoms)) // Should be able to set the base denoms - s.App.ProtoRevKeeper.SetBaseDenoms(s.Ctx, []types.BaseDenom{{Denom: types.OsmosisDenomination}, {Denom: "atom"}, {Denom: "weth"}}) + s.App.ProtoRevKeeper.SetBaseDenoms(s.Ctx, []types.BaseDenom{{Denom: "osmo"}, {Denom: "atom"}, {Denom: "weth"}}) baseDenoms = s.App.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) s.Require().Equal(3, len(baseDenoms)) - s.Require().Equal(baseDenoms[0].Denom, types.OsmosisDenomination) + s.Require().Equal(baseDenoms[0].Denom, "osmo") s.Require().Equal(baseDenoms[1].Denom, "atom") s.Require().Equal(baseDenoms[2].Denom, "weth") } diff --git a/x/protorev/types/params.go b/x/protorev/types/params.go index f524b24b8a3..6a3932cfd07 100644 --- a/x/protorev/types/params.go +++ b/x/protorev/types/params.go @@ -17,7 +17,6 @@ var ( ParamStoreKeyEnableModule = []byte("EnableProtoRevModule") ParamStoreKeyAdminAccount = []byte("AdminAccount") - ParamStoreKeyBaseDenoms = []byte("BaseDenoms") ) // ParamKeyTable the param key table for launch module @@ -26,17 +25,16 @@ func ParamKeyTable() paramtypes.KeyTable { } // NewParams creates a new Params instance -func NewParams(enable bool, admin string, baseDenoms []BaseDenom) Params { +func NewParams(enable bool, admin string) Params { return Params{ - Enabled: enable, - Admin: admin, - BaseDenoms: baseDenoms, + Enabled: enable, + Admin: admin, } } // DefaultParams returns a default set of parameters func DefaultParams() Params { - return NewParams(DefaultEnableModule, DefaultAdminAccount, DefaultBaseDenoms) + return NewParams(DefaultEnableModule, DefaultAdminAccount) } // ParamSetPairs get the params.ParamSet @@ -44,7 +42,6 @@ func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { return paramtypes.ParamSetPairs{ paramtypes.NewParamSetPair(ParamStoreKeyEnableModule, &p.Enabled, ValidateBoolean), paramtypes.NewParamSetPair(ParamStoreKeyAdminAccount, &p.Admin, ValidateAccount), - paramtypes.NewParamSetPair(ParamStoreKeyBaseDenoms, &p.BaseDenoms, ValidateBaseDenom), } } @@ -77,29 +74,3 @@ func ValidateBoolean(i interface{}) error { } return nil } - -func ValidateBaseDenom(i interface{}) error { - denoms, ok := i.([]BaseDenom) - if !ok { - return fmt.Errorf("invalid parameter type: %T", i) - } - - // The first base denom must be the Osmosis denomination - if len(denoms) == 0 || denoms[0].Denom != OsmosisDenomination { - return fmt.Errorf("the first base denom must be the Osmosis denomination") - } - - seenDenoms := make(map[string]bool) - for _, denom := range denoms { - if err := denom.Validate(); err != nil { - return err - } - - // Ensure that the base denom is unique - if seenDenoms[denom.Denom] { - return fmt.Errorf("duplicate base denom %s", denom) - } - seenDenoms[denom.Denom] = true - } - return nil -} diff --git a/x/txfees/keeper/keeper_test.go b/x/txfees/keeper/keeper_test.go index 4d4e936db0d..61b204ea902 100644 --- a/x/txfees/keeper/keeper_test.go +++ b/x/txfees/keeper/keeper_test.go @@ -45,10 +45,6 @@ func (s *KeeperTestSuite) SetupTest(isCheckTx bool) { // Configure protorev base denoms baseDenomPriorities := []protorevtypes.BaseDenom{ - { - Denom: protorevtypes.OsmosisDenomination, - StepSize: osmomath.NewInt(1_000_000), - }, { Denom: baseDenom, StepSize: osmomath.NewInt(1_000_000), From 327779803eecfbc2bc8897ca973f922341a7876b Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Sat, 17 Feb 2024 15:39:41 -0700 Subject: [PATCH 14/20] Revert "base denom protorev param performance change" This reverts commit f86211aea3ede4287b3a7fdd2ac9d435c20dc336. --- proto/osmosis/protorev/v1beta1/params.proto | 21 - proto/osmosis/protorev/v1beta1/protorev.proto | 16 + proto/osmosis/protorev/v1beta1/tx.proto | 1 - x/protorev/keeper/epoch_hook.go | 5 +- x/protorev/keeper/epoch_hook_test.go | 3 +- x/protorev/keeper/genesis.go | 9 +- x/protorev/keeper/genesis_test.go | 3 +- x/protorev/keeper/grpc_query.go | 5 +- x/protorev/keeper/grpc_query_test.go | 3 +- x/protorev/keeper/hooks.go | 6 +- x/protorev/keeper/keeper_test.go | 5 +- x/protorev/keeper/msg_server.go | 15 +- x/protorev/keeper/msg_server_test.go | 3 +- x/protorev/keeper/protorev.go | 68 ++-- x/protorev/keeper/protorev_test.go | 12 +- x/protorev/keeper/routes.go | 5 +- x/protorev/types/params.pb.go | 327 +-------------- x/protorev/types/protorev.pb.go | 373 ++++++++++++++---- x/protorev/types/tx.pb.go | 113 +++--- x/txfees/keeper/keeper_test.go | 3 +- 20 files changed, 471 insertions(+), 525 deletions(-) diff --git a/proto/osmosis/protorev/v1beta1/params.proto b/proto/osmosis/protorev/v1beta1/params.proto index 0a8a09412b3..0bbc91f7996 100644 --- a/proto/osmosis/protorev/v1beta1/params.proto +++ b/proto/osmosis/protorev/v1beta1/params.proto @@ -12,25 +12,4 @@ message Params { bool enabled = 1 [ (gogoproto.moretags) = "yaml:\"enabled\"" ]; // The admin account (settings manager) of the protorev module. string admin = 2 [ (gogoproto.moretags) = "yaml:\"admin\"" ]; - // All enabled base denominations for the protorev module. - repeated BaseDenom base_denoms = 3 [ - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"base_denoms\"" - ]; -} - -// BaseDenom represents a single base denom that the module uses for its -// arbitrage trades. It contains the denom name alongside the step size of the -// binary search that is used to find the optimal swap amount -message BaseDenom { - // The denom i.e. name of the base denom (ex. uosmo) - string denom = 1 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; - // The step size of the binary search that is used to find the optimal swap - // amount - string step_size = 2 [ - - (gogoproto.customtype) = "cosmossdk.io/math.Int", - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"step_size\"" - ]; } \ No newline at end of file diff --git a/proto/osmosis/protorev/v1beta1/protorev.proto b/proto/osmosis/protorev/v1beta1/protorev.proto index cd055ab2a9a..ab014b251a3 100644 --- a/proto/osmosis/protorev/v1beta1/protorev.proto +++ b/proto/osmosis/protorev/v1beta1/protorev.proto @@ -168,6 +168,22 @@ message WeightMap { [ (gogoproto.moretags) = "yaml:\"contract_address\"" ]; } +// BaseDenom represents a single base denom that the module uses for its +// arbitrage trades. It contains the denom name alongside the step size of the +// binary search that is used to find the optimal swap amount +message BaseDenom { + // The denom i.e. name of the base denom (ex. uosmo) + string denom = 1 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; + // The step size of the binary search that is used to find the optimal swap + // amount + string step_size = 2 [ + + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"step_size\"" + ]; +} + message AllProtocolRevenue { osmosis.poolmanager.v1beta1.TakerFeesTracker taker_fees_tracker = 1 [ (gogoproto.moretags) = "yaml:\"taker_fees_tracker\"", diff --git a/proto/osmosis/protorev/v1beta1/tx.proto b/proto/osmosis/protorev/v1beta1/tx.proto index 65be3d34110..04ddae78d19 100644 --- a/proto/osmosis/protorev/v1beta1/tx.proto +++ b/proto/osmosis/protorev/v1beta1/tx.proto @@ -6,7 +6,6 @@ import "amino/amino.proto"; import "google/api/annotations.proto"; import "osmosis/protorev/v1beta1/protorev.proto"; import "cosmos_proto/cosmos.proto"; -import "osmosis/protorev/v1beta1/params.proto"; option go_package = "github.com/osmosis-labs/osmosis/v23/x/protorev/types"; diff --git a/x/protorev/keeper/epoch_hook.go b/x/protorev/keeper/epoch_hook.go index 14aa9f038a2..af11d6ed772 100644 --- a/x/protorev/keeper/epoch_hook.go +++ b/x/protorev/keeper/epoch_hook.go @@ -53,7 +53,10 @@ func (k Keeper) UpdatePools(ctx sdk.Context) error { // baseDenomPools maps each base denom to a map of the highest liquidity pools paired with that base denom // ex. {osmo -> {atom : 100, weth : 200}} baseDenomPools := make(map[string]map[string]LiquidityPoolStruct) - baseDenoms := k.GetAllBaseDenoms(ctx) + baseDenoms, err := k.GetAllBaseDenoms(ctx) + if err != nil { + return err + } // Delete any pools that currently exist in the store + initialize baseDenomPools for _, baseDenom := range baseDenoms { diff --git a/x/protorev/keeper/epoch_hook_test.go b/x/protorev/keeper/epoch_hook_test.go index 7e00eca02c2..c2a83d372ba 100644 --- a/x/protorev/keeper/epoch_hook_test.go +++ b/x/protorev/keeper/epoch_hook_test.go @@ -47,7 +47,8 @@ func (s *KeeperTestSuite) TestEpochHook() { totalNumberExpected := 0 expectedToSee := make(map[string]Pool) - baseDenoms := s.App.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) + baseDenoms, err := s.App.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) + s.Require().NoError(err) for _, pool := range s.pools { // Module currently limited to two asset pools // Instantiate asset and amounts for the pool diff --git a/x/protorev/keeper/genesis.go b/x/protorev/keeper/genesis.go index 0a1dbb53233..66e7d344025 100644 --- a/x/protorev/keeper/genesis.go +++ b/x/protorev/keeper/genesis.go @@ -28,7 +28,9 @@ func (k Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState) { // Configure the initial base denoms used for cyclic route building. The order of the list of base // denoms is the order in which routes will be prioritized i.e. routes will be built and simulated in a // first come first serve basis that is based on the order of the base denoms. - k.SetBaseDenoms(ctx, genState.BaseDenoms) + if err := k.SetBaseDenoms(ctx, genState.BaseDenoms); err != nil { + panic(err) + } // Update the pools on genesis. if err := k.UpdatePools(ctx); err != nil { @@ -120,7 +122,10 @@ func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState { genesis.TokenPairArbRoutes = routes // Export the base denoms used for cyclic route building. - baseDenoms := k.GetAllBaseDenoms(ctx) + baseDenoms, err := k.GetAllBaseDenoms(ctx) + if err != nil { + panic(err) + } genesis.BaseDenoms = baseDenoms // Export the developer fees that have been collected. diff --git a/x/protorev/keeper/genesis_test.go b/x/protorev/keeper/genesis_test.go index 86eb5698f81..37e8b2c2c02 100644 --- a/x/protorev/keeper/genesis_test.go +++ b/x/protorev/keeper/genesis_test.go @@ -15,7 +15,8 @@ func (s *KeeperTestSuite) TestInitGenesis() { s.Require().Contains(tokenPairArbRoutes, route) } - baseDenoms := s.App.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) + baseDenoms, err := s.App.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) + s.Require().NoError(err) s.Require().Equal(len(baseDenoms), len(exportedGenesis.BaseDenoms)) for _, baseDenom := range exportedGenesis.BaseDenoms { s.Require().Contains(baseDenoms, baseDenom) diff --git a/x/protorev/keeper/grpc_query.go b/x/protorev/keeper/grpc_query.go index f4656e02e91..9a599ca547d 100644 --- a/x/protorev/keeper/grpc_query.go +++ b/x/protorev/keeper/grpc_query.go @@ -214,7 +214,10 @@ func (q Querier) GetProtoRevBaseDenoms(c context.Context, req *types.QueryGetPro return nil, status.Error(codes.InvalidArgument, "invalid request") } ctx := sdk.UnwrapSDKContext(c) - baseDenoms := q.Keeper.GetAllBaseDenoms(ctx) + baseDenoms, err := q.Keeper.GetAllBaseDenoms(ctx) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } return &types.QueryGetProtoRevBaseDenomsResponse{BaseDenoms: baseDenoms}, nil } diff --git a/x/protorev/keeper/grpc_query_test.go b/x/protorev/keeper/grpc_query_test.go index 24a34bad445..5faebfb78b7 100644 --- a/x/protorev/keeper/grpc_query_test.go +++ b/x/protorev/keeper/grpc_query_test.go @@ -330,7 +330,8 @@ func (s *KeeperTestSuite) TestGetProtoRevMaxPoolPointsPerBlock() { // TestGetProtoRevBaseDenoms tests the query to retrieve the base denoms func (s *KeeperTestSuite) TestGetProtoRevBaseDenoms() { // base denoms already set in setup - baseDenoms := s.App.AppKeepers.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) + baseDenoms, err := s.App.AppKeepers.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) + s.Require().NoError(err) req := &types.QueryGetProtoRevBaseDenomsRequest{} res, err := s.queryClient.GetProtoRevBaseDenoms(sdk.WrapSDKContext(s.Ctx), req) diff --git a/x/protorev/keeper/hooks.go b/x/protorev/keeper/hooks.go index f928622669d..b0724d8897e 100644 --- a/x/protorev/keeper/hooks.go +++ b/x/protorev/keeper/hooks.go @@ -154,7 +154,11 @@ func (k Keeper) StoreJoinExitPoolSwaps(ctx sdk.Context, sender sdk.AccAddress, p // AfterPoolCreatedWithCoins checks if the new pool should be stored as the highest liquidity pool // for any of the base denoms, and stores it if so. func (k Keeper) AfterPoolCreatedWithCoins(ctx sdk.Context, poolId uint64) { - baseDenoms := k.GetAllBaseDenoms(ctx) + baseDenoms, err := k.GetAllBaseDenoms(ctx) + if err != nil { + ctx.Logger().Error("Protorev error getting base denoms in AfterCFMMPoolCreated hook: " + err.Error()) + return + } baseDenomMap := make(map[string]bool) for _, baseDenom := range baseDenoms { diff --git a/x/protorev/keeper/keeper_test.go b/x/protorev/keeper/keeper_test.go index 467a1a20c31..5977f9ea603 100644 --- a/x/protorev/keeper/keeper_test.go +++ b/x/protorev/keeper/keeper_test.go @@ -94,7 +94,8 @@ func (s *KeeperTestSuite) SetupTest() { StepSize: osmomath.NewInt(1_000_000), }, } - s.App.ProtoRevKeeper.SetBaseDenoms(s.Ctx, baseDenomPriorities) + err := s.App.ProtoRevKeeper.SetBaseDenoms(s.Ctx, baseDenomPriorities) + s.Require().NoError(err) encodingConfig := osmosisapp.MakeEncodingConfig() s.clientCtx = client.Context{}. @@ -150,7 +151,7 @@ func (s *KeeperTestSuite) SetupTest() { // Set the Admin Account s.adminAccount = apptesting.CreateRandomAccounts(1)[0] - err := protorev.HandleSetProtoRevAdminAccount(s.Ctx, *s.App.ProtoRevKeeper, &types.SetProtoRevAdminAccountProposal{Account: s.adminAccount.String()}) + err = protorev.HandleSetProtoRevAdminAccount(s.Ctx, *s.App.ProtoRevKeeper, &types.SetProtoRevAdminAccountProposal{Account: s.adminAccount.String()}) s.Require().NoError(err) queryHelper := baseapp.NewQueryServerTestHelper(s.Ctx, s.App.InterfaceRegistry()) diff --git a/x/protorev/keeper/msg_server.go b/x/protorev/keeper/msg_server.go index 8cbf3660bfd..02345a3c0a0 100644 --- a/x/protorev/keeper/msg_server.go +++ b/x/protorev/keeper/msg_server.go @@ -139,17 +139,22 @@ func (m MsgServer) SetBaseDenoms(c context.Context, msg *types.MsgSetBaseDenoms) } // Get the old base denoms - oldBaseDenoms := m.k.GetAllBaseDenoms(ctx) + baseDenoms, err := m.k.GetAllBaseDenoms(ctx) + if err != nil { + return nil, err + } // Delete all pools associated with the base denoms - for _, baseDenom := range oldBaseDenoms { + for _, baseDenom := range baseDenoms { m.k.DeleteAllPoolsForBaseDenom(ctx, baseDenom.Denom) } - // // Delete the old base denoms - // m.k.DeleteBaseDenoms(ctx) + // Delete the old base denoms + m.k.DeleteBaseDenoms(ctx) - m.k.SetBaseDenoms(ctx, msg.BaseDenoms) + if err := m.k.SetBaseDenoms(ctx, msg.BaseDenoms); err != nil { + return nil, err + } // Update all of the pools if err := m.k.UpdatePools(ctx); err != nil { diff --git a/x/protorev/keeper/msg_server_test.go b/x/protorev/keeper/msg_server_test.go index 0d91ef2bc3a..2050932e210 100644 --- a/x/protorev/keeper/msg_server_test.go +++ b/x/protorev/keeper/msg_server_test.go @@ -655,7 +655,8 @@ func (s *KeeperTestSuite) TestMsgSetBaseDenoms() { s.Require().NoError(err) s.Require().Equal(response, &types.MsgSetBaseDenomsResponse{}) - baseDenoms := s.App.AppKeepers.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) + baseDenoms, err := s.App.AppKeepers.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) + s.Require().NoError(err) s.Require().Equal(testCase.baseDenoms, baseDenoms) } else { s.Require().Error(err) diff --git a/x/protorev/keeper/protorev.go b/x/protorev/keeper/protorev.go index 26a847205cf..153ec7b4843 100644 --- a/x/protorev/keeper/protorev.go +++ b/x/protorev/keeper/protorev.go @@ -76,53 +76,43 @@ func (k Keeper) DeleteAllTokenPairArbRoutes(ctx sdk.Context) { k.DeleteAllEntriesForKeyPrefix(ctx, types.KeyPrefixTokenPairRoutes) } -// // GetAllBaseDenoms returns all of the base denoms (sorted by priority in descending order) used to build cyclic arbitrage routes -// func (k Keeper) GetAllBaseDenoms(ctx sdk.Context) ([]types.BaseDenom, error) { -// baseDenoms := make([]types.BaseDenom, 0) +// GetAllBaseDenoms returns all of the base denoms (sorted by priority in descending order) used to build cyclic arbitrage routes +func (k Keeper) GetAllBaseDenoms(ctx sdk.Context) ([]types.BaseDenom, error) { + baseDenoms := make([]types.BaseDenom, 0) -// store := ctx.KVStore(k.storeKey) -// iterator := sdk.KVStorePrefixIterator(store, types.KeyPrefixBaseDenoms) - -// defer iterator.Close() -// for ; iterator.Valid(); iterator.Next() { -// baseDenom := types.BaseDenom{} -// err := baseDenom.Unmarshal(iterator.Value()) -// if err != nil { -// return []types.BaseDenom{}, err -// } - -// baseDenoms = append(baseDenoms, baseDenom) -// } + store := ctx.KVStore(k.storeKey) + iterator := sdk.KVStorePrefixIterator(store, types.KeyPrefixBaseDenoms) -// return baseDenoms, nil -// } + defer iterator.Close() + for ; iterator.Valid(); iterator.Next() { + baseDenom := types.BaseDenom{} + err := baseDenom.Unmarshal(iterator.Value()) + if err != nil { + return []types.BaseDenom{}, err + } -// // SetBaseDenoms sets all of the base denoms used to build cyclic arbitrage routes. The base denoms priority -// // order is going to match the order of the base denoms in the slice. -// func (k Keeper) SetBaseDenoms(ctx sdk.Context, baseDenoms []types.BaseDenom) error { -// store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixBaseDenoms) + baseDenoms = append(baseDenoms, baseDenom) + } -// for i, baseDenom := range baseDenoms { -// key := types.GetKeyPrefixBaseDenom(uint64(i)) + return baseDenoms, nil +} -// bz, err := baseDenom.Marshal() -// if err != nil { -// return err -// } -// store.Set(key, bz) -// } +// SetBaseDenoms sets all of the base denoms used to build cyclic arbitrage routes. The base denoms priority +// order is going to match the order of the base denoms in the slice. +func (k Keeper) SetBaseDenoms(ctx sdk.Context, baseDenoms []types.BaseDenom) error { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixBaseDenoms) -// return nil -// } + for i, baseDenom := range baseDenoms { + key := types.GetKeyPrefixBaseDenom(uint64(i)) -func (k Keeper) GetAllBaseDenoms(ctx sdk.Context) []types.BaseDenom { - return k.GetParams(ctx).BaseDenoms -} + bz, err := baseDenom.Marshal() + if err != nil { + return err + } + store.Set(key, bz) + } -func (k Keeper) SetBaseDenoms(ctx sdk.Context, newBaseDenoms []types.BaseDenom) { - params := k.GetParams(ctx) - params.BaseDenoms = newBaseDenoms - k.SetParams(ctx, params) + return nil } // DeleteBaseDenoms deletes all of the base denoms diff --git a/x/protorev/keeper/protorev_test.go b/x/protorev/keeper/protorev_test.go index 1b28770002a..62e2fa827e8 100644 --- a/x/protorev/keeper/protorev_test.go +++ b/x/protorev/keeper/protorev_test.go @@ -60,7 +60,8 @@ func (s *KeeperTestSuite) TestDeleteAllTokenPairArbRoutes() { // TestGetAllBaseDenoms tests the GetAllBaseDenoms, SetBaseDenoms, and DeleteBaseDenoms functions. func (s *KeeperTestSuite) TestGetAllBaseDenoms() { // Should be initialized on genesis - baseDenoms := s.App.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) + baseDenoms, err := s.App.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) + s.Require().NoError(err) s.Require().Equal(3, len(baseDenoms)) s.Require().Equal(baseDenoms[0].Denom, types.OsmosisDenomination) s.Require().Equal(baseDenoms[1].Denom, "Atom") @@ -68,12 +69,15 @@ func (s *KeeperTestSuite) TestGetAllBaseDenoms() { // Should be able to delete all base denoms s.App.ProtoRevKeeper.DeleteBaseDenoms(s.Ctx) - baseDenoms = s.App.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) + baseDenoms, err = s.App.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) + s.Require().NoError(err) s.Require().Equal(0, len(baseDenoms)) // Should be able to set the base denoms - s.App.ProtoRevKeeper.SetBaseDenoms(s.Ctx, []types.BaseDenom{{Denom: "osmo"}, {Denom: "atom"}, {Denom: "weth"}}) - baseDenoms = s.App.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) + err = s.App.ProtoRevKeeper.SetBaseDenoms(s.Ctx, []types.BaseDenom{{Denom: "osmo"}, {Denom: "atom"}, {Denom: "weth"}}) + s.Require().NoError(err) + baseDenoms, err = s.App.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) + s.Require().NoError(err) s.Require().Equal(3, len(baseDenoms)) s.Require().Equal(baseDenoms[0].Denom, "osmo") s.Require().Equal(baseDenoms[1].Denom, "atom") diff --git a/x/protorev/keeper/routes.go b/x/protorev/keeper/routes.go index 0037a97a678..fd2f5598c56 100644 --- a/x/protorev/keeper/routes.go +++ b/x/protorev/keeper/routes.go @@ -91,7 +91,10 @@ func (k Keeper) BuildHotRoute(ctx sdk.Context, route types.Route, poolId uint64) // and routes are built in a greedy manner. func (k Keeper) BuildHighestLiquidityRoutes(ctx sdk.Context, tokenIn, tokenOut string, poolId uint64) ([]RouteMetaData, error) { routes := make([]RouteMetaData, 0) - baseDenoms := k.GetAllBaseDenoms(ctx) + baseDenoms, err := k.GetAllBaseDenoms(ctx) + if err != nil { + return routes, err + } // Iterate through all denoms greedily. When simulating and executing trades, routes that are closer to the beginning of the list // have priority over those that are later in the list. This way we can build routes that are more likely to succeed and bring in diff --git a/x/protorev/types/params.pb.go b/x/protorev/types/params.pb.go index 08483c1658f..6b5aee04af7 100644 --- a/x/protorev/types/params.pb.go +++ b/x/protorev/types/params.pb.go @@ -4,7 +4,6 @@ package types import ( - cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" _ "github.com/cosmos/cosmos-proto" _ "github.com/cosmos/gogoproto/gogoproto" @@ -31,8 +30,6 @@ type Params struct { Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty" yaml:"enabled"` // The admin account (settings manager) of the protorev module. Admin string `protobuf:"bytes,2,opt,name=admin,proto3" json:"admin,omitempty" yaml:"admin"` - // All enabled base denominations for the protorev module. - BaseDenoms []BaseDenom `protobuf:"bytes,3,rep,name=base_denoms,json=baseDenoms,proto3" json:"base_denoms" yaml:"base_denoms"` } func (m *Params) Reset() { *m = Params{} } @@ -82,67 +79,8 @@ func (m *Params) GetAdmin() string { return "" } -func (m *Params) GetBaseDenoms() []BaseDenom { - if m != nil { - return m.BaseDenoms - } - return nil -} - -// BaseDenom represents a single base denom that the module uses for its -// arbitrage trades. It contains the denom name alongside the step size of the -// binary search that is used to find the optimal swap amount -type BaseDenom struct { - // The denom i.e. name of the base denom (ex. uosmo) - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty" yaml:"denom"` - // The step size of the binary search that is used to find the optimal swap - // amount - StepSize cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=step_size,json=stepSize,proto3,customtype=cosmossdk.io/math.Int" json:"step_size" yaml:"step_size"` -} - -func (m *BaseDenom) Reset() { *m = BaseDenom{} } -func (m *BaseDenom) String() string { return proto.CompactTextString(m) } -func (*BaseDenom) ProtoMessage() {} -func (*BaseDenom) Descriptor() ([]byte, []int) { - return fileDescriptor_72168e5a5a65ae7e, []int{1} -} -func (m *BaseDenom) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *BaseDenom) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BaseDenom.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 *BaseDenom) XXX_Merge(src proto.Message) { - xxx_messageInfo_BaseDenom.Merge(m, src) -} -func (m *BaseDenom) XXX_Size() int { - return m.Size() -} -func (m *BaseDenom) XXX_DiscardUnknown() { - xxx_messageInfo_BaseDenom.DiscardUnknown(m) -} - -var xxx_messageInfo_BaseDenom proto.InternalMessageInfo - -func (m *BaseDenom) GetDenom() string { - if m != nil { - return m.Denom - } - return "" -} - func init() { proto.RegisterType((*Params)(nil), "osmosis.protorev.v1beta1.Params") - proto.RegisterType((*BaseDenom)(nil), "osmosis.protorev.v1beta1.BaseDenom") } func init() { @@ -150,30 +88,22 @@ func init() { } var fileDescriptor_72168e5a5a65ae7e = []byte{ - // 362 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x91, 0xb1, 0x4e, 0xeb, 0x30, - 0x18, 0x85, 0xe3, 0x5b, 0xdd, 0xd2, 0xba, 0x08, 0x55, 0x11, 0x48, 0xa1, 0x43, 0x52, 0x19, 0x81, - 0x3a, 0x80, 0xad, 0xb6, 0x4c, 0x8c, 0x11, 0x0b, 0x4b, 0x85, 0xc2, 0xc6, 0x52, 0x9c, 0xc6, 0x6a, - 0x23, 0x9a, 0x38, 0xaa, 0x4d, 0x45, 0xbb, 0xf2, 0x02, 0x3c, 0x12, 0x63, 0xc7, 0x8e, 0x88, 0x21, - 0x42, 0xed, 0x1b, 0xe4, 0x09, 0x50, 0xec, 0xa4, 0xc0, 0xc0, 0xe6, 0xff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0x64, 0x45, 0x87, 0x6e, 0xfe, 0xc1, 0x8f, 0xd4, 0x39, 0xd2, 0x7f, 0x48, 0x04, 0x8f, - 0x38, 0xe4, 0x24, 0xa2, 0x72, 0x82, 0x6f, 0x62, 0x99, 0xa5, 0x4e, 0x53, 0x07, 0xed, 0xf6, 0x90, - 0x57, 0xcb, 0xcf, 0x77, 0xe1, 0x92, 0xb9, 0x83, 0xd5, 0xc6, 0x06, 0xeb, 0x8d, 0x0d, 0x3e, 0x37, - 0x36, 0x78, 0xdd, 0xda, 0xc6, 0x7a, 0x6b, 0x1b, 0xef, 0x5b, 0xdb, 0xb8, 0xbf, 0x1c, 0x87, 0x72, - 0xf2, 0xe4, 0xe3, 0x11, 0x8f, 0x48, 0x51, 0xfb, 0x62, 0x4a, 0x7d, 0x51, 0x0e, 0x64, 0xde, 0xeb, - 0x93, 0xe7, 0xef, 0x27, 0x97, 0x8b, 0x84, 0x09, 0xbf, 0xaa, 0xe6, 0xfe, 0x57, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x96, 0x8a, 0xd6, 0x63, 0x13, 0x02, 0x00, 0x00, + // 233 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xcd, 0x2f, 0xce, 0xcd, + 0x2f, 0xce, 0x2c, 0xd6, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x2f, 0x4a, 0x2d, 0xd3, 0x2f, 0x33, 0x4c, + 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x03, 0x8b, 0x0b, 0x49, + 0x40, 0x95, 0xe9, 0xc1, 0x94, 0xe9, 0x41, 0x95, 0x49, 0x89, 0xa4, 0xe7, 0xa7, 0xe7, 0x83, 0x45, + 0xf5, 0x41, 0x2c, 0x88, 0x02, 0x29, 0xc9, 0x64, 0xb0, 0x86, 0x78, 0x88, 0x04, 0x84, 0x03, 0x91, + 0x52, 0x8a, 0xe3, 0x62, 0x0b, 0x00, 0x1b, 0x2d, 0xa4, 0xc3, 0xc5, 0x9e, 0x9a, 0x97, 0x98, 0x94, + 0x93, 0x9a, 0x22, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0xe1, 0x24, 0xf4, 0xe9, 0x9e, 0x3c, 0x5f, 0x65, + 0x62, 0x6e, 0x8e, 0x95, 0x12, 0x54, 0x42, 0x29, 0x08, 0xa6, 0x44, 0x48, 0x8d, 0x8b, 0x35, 0x31, + 0x25, 0x37, 0x33, 0x4f, 0x82, 0x49, 0x81, 0x51, 0x83, 0xd3, 0x49, 0xe0, 0xd3, 0x3d, 0x79, 0x1e, + 0x88, 0x5a, 0xb0, 0xb0, 0x52, 0x10, 0x44, 0xda, 0xc9, 0xef, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, + 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, + 0x8f, 0xe5, 0x18, 0xa2, 0x4c, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, + 0xa1, 0xfe, 0xd1, 0xcd, 0x49, 0x4c, 0x2a, 0x86, 0x71, 0xf4, 0xcb, 0x8c, 0x8c, 0xf5, 0x2b, 0x10, + 0x21, 0x51, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0xe6, 0x1b, 0x03, 0x02, 0x00, 0x00, 0xff, + 0xff, 0xed, 0x90, 0x62, 0x56, 0x2a, 0x01, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -196,20 +126,6 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.BaseDenoms) > 0 { - for iNdEx := len(m.BaseDenoms) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.BaseDenoms[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintParams(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } if len(m.Admin) > 0 { i -= len(m.Admin) copy(dAtA[i:], m.Admin) @@ -230,46 +146,6 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *BaseDenom) 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 *BaseDenom) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BaseDenom) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.StepSize.Size() - i -= size - if _, err := m.StepSize.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintParams(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.Denom) > 0 { - i -= len(m.Denom) - copy(dAtA[i:], m.Denom) - i = encodeVarintParams(dAtA, i, uint64(len(m.Denom))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func encodeVarintParams(dAtA []byte, offset int, v uint64) int { offset -= sovParams(v) base := offset @@ -294,27 +170,6 @@ func (m *Params) Size() (n int) { if l > 0 { n += 1 + l + sovParams(uint64(l)) } - if len(m.BaseDenoms) > 0 { - for _, e := range m.BaseDenoms { - l = e.Size() - n += 1 + l + sovParams(uint64(l)) - } - } - return n -} - -func (m *BaseDenom) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Denom) - if l > 0 { - n += 1 + l + sovParams(uint64(l)) - } - l = m.StepSize.Size() - n += 1 + l + sovParams(uint64(l)) return n } @@ -405,156 +260,6 @@ func (m *Params) Unmarshal(dAtA []byte) error { } m.Admin = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BaseDenoms", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthParams - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.BaseDenoms = append(m.BaseDenoms, BaseDenom{}) - if err := m.BaseDenoms[len(m.BaseDenoms)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipParams(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthParams - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *BaseDenom) 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 ErrIntOverflowParams - } - 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: BaseDenom: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BaseDenom: 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 ErrIntOverflowParams - } - 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 ErrInvalidLengthParams - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Denom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StepSize", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - 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 ErrInvalidLengthParams - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.StepSize.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipParams(dAtA[iNdEx:]) diff --git a/x/protorev/types/protorev.pb.go b/x/protorev/types/protorev.pb.go index c898f17f212..f038bd07f87 100644 --- a/x/protorev/types/protorev.pb.go +++ b/x/protorev/types/protorev.pb.go @@ -672,6 +672,57 @@ func (m *WeightMap) GetContractAddress() string { return "" } +// BaseDenom represents a single base denom that the module uses for its +// arbitrage trades. It contains the denom name alongside the step size of the +// binary search that is used to find the optimal swap amount +type BaseDenom struct { + // The denom i.e. name of the base denom (ex. uosmo) + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty" yaml:"denom"` + // The step size of the binary search that is used to find the optimal swap + // amount + StepSize cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=step_size,json=stepSize,proto3,customtype=cosmossdk.io/math.Int" json:"step_size" yaml:"step_size"` +} + +func (m *BaseDenom) Reset() { *m = BaseDenom{} } +func (m *BaseDenom) String() string { return proto.CompactTextString(m) } +func (*BaseDenom) ProtoMessage() {} +func (*BaseDenom) Descriptor() ([]byte, []int) { + return fileDescriptor_1e9f2391fd9fec01, []int{11} +} +func (m *BaseDenom) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BaseDenom) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BaseDenom.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 *BaseDenom) XXX_Merge(src proto.Message) { + xxx_messageInfo_BaseDenom.Merge(m, src) +} +func (m *BaseDenom) XXX_Size() int { + return m.Size() +} +func (m *BaseDenom) XXX_DiscardUnknown() { + xxx_messageInfo_BaseDenom.DiscardUnknown(m) +} + +var xxx_messageInfo_BaseDenom proto.InternalMessageInfo + +func (m *BaseDenom) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + type AllProtocolRevenue struct { TakerFeesTracker types1.TakerFeesTracker `protobuf:"bytes,1,opt,name=taker_fees_tracker,json=takerFeesTracker,proto3" json:"taker_fees_tracker" yaml:"taker_fees_tracker"` CyclicArbTracker CyclicArbTracker `protobuf:"bytes,3,opt,name=cyclic_arb_tracker,json=cyclicArbTracker,proto3" json:"cyclic_arb_tracker" yaml:"cyclic_arb_tracker"` @@ -681,7 +732,7 @@ func (m *AllProtocolRevenue) Reset() { *m = AllProtocolRevenue{} } func (m *AllProtocolRevenue) String() string { return proto.CompactTextString(m) } func (*AllProtocolRevenue) ProtoMessage() {} func (*AllProtocolRevenue) Descriptor() ([]byte, []int) { - return fileDescriptor_1e9f2391fd9fec01, []int{11} + return fileDescriptor_1e9f2391fd9fec01, []int{12} } func (m *AllProtocolRevenue) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -733,7 +784,7 @@ func (m *CyclicArbTracker) Reset() { *m = CyclicArbTracker{} } func (m *CyclicArbTracker) String() string { return proto.CompactTextString(m) } func (*CyclicArbTracker) ProtoMessage() {} func (*CyclicArbTracker) Descriptor() ([]byte, []int) { - return fileDescriptor_1e9f2391fd9fec01, []int{12} + return fileDescriptor_1e9f2391fd9fec01, []int{13} } func (m *CyclicArbTracker) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -788,6 +839,7 @@ func init() { proto.RegisterType((*ConcentratedPoolInfo)(nil), "osmosis.protorev.v1beta1.ConcentratedPoolInfo") proto.RegisterType((*CosmwasmPoolInfo)(nil), "osmosis.protorev.v1beta1.CosmwasmPoolInfo") proto.RegisterType((*WeightMap)(nil), "osmosis.protorev.v1beta1.WeightMap") + proto.RegisterType((*BaseDenom)(nil), "osmosis.protorev.v1beta1.BaseDenom") proto.RegisterType((*AllProtocolRevenue)(nil), "osmosis.protorev.v1beta1.AllProtocolRevenue") proto.RegisterType((*CyclicArbTracker)(nil), "osmosis.protorev.v1beta1.CyclicArbTracker") } @@ -797,78 +849,80 @@ func init() { } var fileDescriptor_1e9f2391fd9fec01 = []byte{ - // 1124 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xbf, 0x6f, 0xdb, 0x46, - 0x14, 0x36, 0x2d, 0xc5, 0xb1, 0x4e, 0x89, 0xa4, 0x9c, 0x9d, 0x44, 0x56, 0x5a, 0xd1, 0xbd, 0x04, - 0xad, 0x52, 0x20, 0x12, 0xec, 0x74, 0x28, 0x52, 0xa4, 0x80, 0x69, 0xc0, 0xa8, 0x5b, 0xd4, 0x36, - 0xce, 0x02, 0x82, 0x76, 0x61, 0x8f, 0xd4, 0x49, 0x26, 0x24, 0xf2, 0x04, 0xde, 0xc9, 0x3f, 0x52, - 0x20, 0xff, 0x40, 0x97, 0x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02, 0x08, 0x17, 0x48, 0x2a, 0xdd, - 0x04, 0x8b, 0x22, 0x2e, 0x68, 0x7b, 0x41, 0x75, 0x7e, 0xd5, 0x68, 0x14, 0xac, 0xa5, 0x71, 0x64, - 0x96, 0x15, 0x27, 0xc9, 0x20, 0x7c, 0x53, 0x3e, 0x6e, 0x07, 0x70, 0x0d, 0x14, 0x54, 0x94, 0x8d, - 0x44, 0x35, 0x27, 0x09, 0xcb, 0xe3, 0xc8, 0xac, 0x4c, 0x13, 0xd8, 0x48, 0x20, 0xac, 0x64, 0x77, - 0x47, 0xe2, 0x59, 0xfe, 0xef, 0x5f, 0x4c, 0x03, 0xfd, 0x6e, 0x80, 0x1b, 0xb2, 0x26, 0xdc, 0x01, - 0x0b, 0x22, 0x24, 0x9d, 0xff, 0xd2, 0x49, 0x3b, 0xc6, 0x59, 0x77, 0x75, 0x27, 0xb7, 0x75, 0x11, - 0x49, 0x46, 0x58, 0xab, 0xc0, 0x1d, 0x50, 0xe0, 0x82, 0x0e, 0x6d, 0xee, 0xbd, 0xa4, 0xba, 0x87, - 0xb5, 0x98, 0xf1, 0x67, 0x64, 0xde, 0x55, 0x03, 0xe4, 0x9d, 0x7e, 0xd3, 0x63, 0x2d, 0x9f, 0x88, - 0x83, 0xe6, 0x76, 0x20, 0x26, 0xfb, 0x4d, 0x79, 0x08, 0x2f, 0xc6, 0xcf, 0xfb, 0xde, 0x4b, 0xaa, - 0xf7, 0xfb, 0x93, 0x01, 0x6e, 0xc8, 0xf2, 0xf0, 0x21, 0xc8, 0xc7, 0xf3, 0xad, 0x1a, 0xab, 0x46, - 0x23, 0x6f, 0x95, 0xc7, 0x91, 0x59, 0x54, 0xec, 0x38, 0x8a, 0xb0, 0x4c, 0xfe, 0x7f, 0x3e, 0xfe, - 0x63, 0x80, 0xb2, 0xf4, 0x71, 0x5f, 0x10, 0xe1, 0x71, 0xe1, 0xb9, 0x1c, 0x7e, 0x05, 0x6e, 0x0e, - 0x43, 0xd6, 0xf5, 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 0x03, 0x54, 0xb2, 0x05, 0xe0, 0xe7, 0x00, 0x4c, - 0x44, 0xaf, 0xfe, 0xc8, 0xe5, 0xe3, 0xfd, 0xe0, 0x42, 0x5a, 0x12, 0xf6, 0xc1, 0xfb, 0x07, 0xea, - 0x6c, 0x10, 0xd7, 0x65, 0xa3, 0x40, 0x78, 0x41, 0xcf, 0xe6, 0x82, 0x84, 0x82, 0xdb, 0xdd, 0x90, - 0xf9, 0x72, 0xa8, 0x39, 0xab, 0x31, 0x8e, 0xcc, 0x47, 0xaa, 0x87, 0x77, 0xc2, 0x11, 0xae, 0xa9, - 0xfc, 0x46, 0x9a, 0xde, 0x97, 0xd9, 0xad, 0x90, 0xf9, 0xd6, 0xce, 0xeb, 0xd3, 0xba, 0xf1, 0xe6, - 0xb4, 0x6e, 0xfc, 0x75, 0x5a, 0x37, 0x7e, 0x3c, 0xab, 0xcf, 0xbd, 0x39, 0xab, 0xcf, 0xbd, 0x3d, - 0xab, 0xcf, 0x7d, 0xfb, 0x49, 0xcf, 0x13, 0x07, 0x23, 0xa7, 0xe9, 0x32, 0xbf, 0xa5, 0xdd, 0x7d, - 0x32, 0x20, 0x0e, 0x4f, 0x16, 0xad, 0xc3, 0xf5, 0xa7, 0xad, 0xe3, 0xc9, 0x2f, 0xae, 0x38, 0x19, - 0x52, 0xee, 0x2c, 0xc8, 0xf5, 0xd3, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x5b, 0x3d, 0x1f, 0xf4, - 0x03, 0x0b, 0x00, 0x00, + // 1156 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x4f, 0x6f, 0x1b, 0xc5, + 0x1b, 0xce, 0xc6, 0x4e, 0x1a, 0x8f, 0x53, 0xdb, 0x99, 0xa4, 0xad, 0xe3, 0xfe, 0x7e, 0xde, 0x30, + 0xad, 0xc0, 0x45, 0xaa, 0xad, 0xa4, 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0x1d, 0x3b, 0x94, + 0xab, 0xb2, 0xb1, 0x96, 0xa9, 0xe5, 0x37, 0xcc, 0xfa, 0xb4, 0x3e, 0xeb, 0x92, 0x65, 0xad, 0xbe, + 0x8a, 0xcc, 0x99, 0x61, 0x64, 0x2e, 0x9d, 0x12, 0xbf, 0xf7, 0x14, 0x8d, 0x04, 0x10, 0xce, 0x91, + 0x54, 0xba, 0x0e, 0x16, 0x44, 0x5c, 0xd0, 0xf6, 0x82, 0xf2, 0xec, 0x9a, 0x51, 0xcb, 0x59, 0xcb, + 0xc3, 0xc8, 0x2c, 0x2a, 0x4e, 0x92, 0x41, 0xf8, 0x96, 0x7c, 0xdc, 0x09, 0xe0, 0x3a, 0xc8, 0xa9, + 0x28, 0x1b, 0x88, 0x72, 0x46, 0x12, 0x56, 0x86, 0x91, 0x59, 0x1a, 0x27, 0xb0, 0x81, 0x40, 0x58, + 0xc9, 0xee, 0x0d, 0xc4, 0xd3, 0xec, 0x9f, 0x3f, 0x99, 0x06, 0xfa, 0xd5, 0x00, 0x73, 0xb2, 0x26, + 0xdc, 0x05, 0xf3, 0x22, 0x24, 0xad, 0x7f, 0xd2, 0x49, 0x33, 0xc6, 0x59, 0x77, 0x74, 0x27, 0xb7, + 0x75, 0x11, 0x49, 0x46, 0x58, 0xab, 0xc0, 0x5d, 0x90, 0xe3, 0x82, 0xf6, 0x6d, 0xee, 0xbd, 0xa0, + 0xba, 0x87, 0xf5, 0x98, 0xf1, 0x7b, 0x64, 0xde, 0x51, 0x03, 0xe4, 0xad, 0x6e, 0xdd, 0x63, 0x0d, + 0x9f, 0x88, 0xc3, 0xfa, 0x4e, 0x20, 0x46, 0xfb, 0x4d, 0x79, 0x08, 0x2f, 0xc4, 0xcf, 0x07, 0xde, + 0x0b, 0xaa, 0xf7, 0xfb, 0x83, 0x01, 0xe6, 0x64, 0x79, 0xf8, 0x00, 0x64, 0xe3, 0xf9, 0x96, 0x8d, + 0x35, 0xa3, 0x96, 0xb5, 0x8a, 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 0x11, 0xb4, 0x95, + 0x08, 0x65, 0xa4, 0x50, 0x75, 0x18, 0x99, 0x15, 0x25, 0x74, 0x05, 0x08, 0x61, 0x38, 0x1e, 0x1d, + 0xed, 0x2a, 0x36, 0xf4, 0x98, 0x70, 0x3f, 0x11, 0xcb, 0x4e, 0xee, 0x6a, 0x02, 0x80, 0x70, 0x21, + 0x89, 0x28, 0x11, 0xf4, 0x63, 0x06, 0x14, 0x76, 0x82, 0x36, 0xb3, 0x4e, 0x63, 0xbf, 0x9a, 0xa7, + 0x7d, 0x0a, 0x9f, 0x83, 0x79, 0xd5, 0xbd, 0x74, 0x29, 0xbf, 0x51, 0x9b, 0xfe, 0x9e, 0x1d, 0x48, + 0x5c, 0xcc, 0x94, 0x1a, 0x13, 0x2f, 0x9c, 0x52, 0x41, 0x58, 0xcb, 0x41, 0x1b, 0x2c, 0x24, 0x9e, + 0x48, 0xff, 0xf2, 0x1b, 0xef, 0x4f, 0x97, 0xb6, 0x34, 0x32, 0x15, 0xbf, 0xa7, 0xc5, 0x8b, 0x17, + 0xfd, 0x46, 0x38, 0x15, 0x85, 0x0c, 0x2c, 0x8e, 0xfb, 0x24, 0xbd, 0xcd, 0x6f, 0xd4, 0xa7, 0x17, + 0xd9, 0x1a, 0x43, 0xa7, 0x85, 0xee, 0xeb, 0x42, 0xcb, 0x97, 0xe7, 0x81, 0xf0, 0x85, 0x02, 0x71, + 0x47, 0x89, 0x9f, 0xd2, 0xfb, 0xb7, 0x76, 0xb4, 0xa5, 0x91, 0xd3, 0x3a, 0x4a, 0x94, 0x10, 0x4e, + 0x45, 0xd1, 0x47, 0xa0, 0x70, 0xd1, 0x63, 0xf8, 0x08, 0xcc, 0x5f, 0x38, 0xc3, 0x4b, 0x23, 0xbf, + 0x93, 0x19, 0x6b, 0x00, 0x7a, 0x06, 0x4a, 0x93, 0x2e, 0xde, 0x84, 0xfe, 0x9d, 0x01, 0x56, 0xae, + 0x32, 0xe8, 0x06, 0x1a, 0xf0, 0x53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b4, + 0x4f, 0xb9, 0x33, 0x2f, 0xd7, 0x4f, 0xfe, 0x0e, 0x00, 0x00, 0xff, 0xff, 0xe2, 0x27, 0xf6, 0x6c, + 0x89, 0x0b, 0x00, 0x00, } func (this *TokenPairArbRoutes) Equal(that interface{}) bool { @@ -1440,6 +1494,46 @@ func (m *WeightMap) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *BaseDenom) 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 *BaseDenom) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BaseDenom) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.StepSize.Size() + i -= size + if _, err := m.StepSize.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintProtorev(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintProtorev(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *AllProtocolRevenue) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1728,6 +1822,21 @@ func (m *WeightMap) Size() (n int) { return n } +func (m *BaseDenom) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovProtorev(uint64(l)) + } + l = m.StepSize.Size() + n += 1 + l + sovProtorev(uint64(l)) + return n +} + func (m *AllProtocolRevenue) Size() (n int) { if m == nil { return 0 @@ -3077,6 +3186,122 @@ func (m *WeightMap) Unmarshal(dAtA []byte) error { } return nil } +func (m *BaseDenom) 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 ErrIntOverflowProtorev + } + 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: BaseDenom: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BaseDenom: 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 ErrIntOverflowProtorev + } + 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 ErrInvalidLengthProtorev + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProtorev + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StepSize", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProtorev + } + 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 ErrInvalidLengthProtorev + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProtorev + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.StepSize.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipProtorev(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthProtorev + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *AllProtocolRevenue) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/protorev/types/tx.pb.go b/x/protorev/types/tx.pb.go index dc3549db35d..a2969bf930b 100644 --- a/x/protorev/types/tx.pb.go +++ b/x/protorev/types/tx.pb.go @@ -609,64 +609,63 @@ func init() { func init() { proto.RegisterFile("osmosis/protorev/v1beta1/tx.proto", fileDescriptor_2783dce032fc6954) } var fileDescriptor_2783dce032fc6954 = []byte{ - // 897 bytes of a gzipped FileDescriptorProto + // 889 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xcf, 0x6f, 0xdc, 0x44, - 0x18, 0xcd, 0xa4, 0x80, 0xe8, 0xa4, 0x40, 0xd7, 0xa4, 0xed, 0xae, 0xd9, 0x7a, 0x37, 0x13, 0xa2, - 0x6e, 0xaa, 0xd6, 0x26, 0xdb, 0xf2, 0x43, 0x96, 0x40, 0x8a, 0xd5, 0x03, 0x3d, 0x04, 0x45, 0x6e, - 0x10, 0x12, 0x07, 0xcc, 0x78, 0x77, 0xe2, 0x58, 0x5d, 0x7b, 0x2c, 0xcf, 0x24, 0xda, 0xbd, 0x72, - 0xe4, 0x84, 0x84, 0xc4, 0x81, 0x7f, 0x01, 0x0e, 0x08, 0x71, 0xe5, 0x1e, 0x6e, 0x15, 0x3d, 0xd0, - 0x0b, 0x2b, 0x94, 0x20, 0x71, 0x45, 0xfb, 0x17, 0x20, 0xcf, 0x78, 0xbd, 0xf5, 0xda, 0x26, 0x49, - 0xf7, 0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0xf7, 0x48, 0x38, 0xa5, 0xb9, 0x37, 0x70, 0x3d, 0x9a, 0x73, 0x1e, 0x76, 0xef, + 0x1b, 0xc3, 0x19, 0x73, 0xea, 0x95, 0x7a, 0xaf, 0xf0, 0xeb, 0xfb, 0xff, 0x05, 0x00, 0x00, 0xff, + 0xff, 0x7f, 0x99, 0x73, 0x79, 0x3b, 0x0b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/txfees/keeper/keeper_test.go b/x/txfees/keeper/keeper_test.go index 61b204ea902..7698f76b567 100644 --- a/x/txfees/keeper/keeper_test.go +++ b/x/txfees/keeper/keeper_test.go @@ -50,7 +50,8 @@ func (s *KeeperTestSuite) SetupTest(isCheckTx bool) { StepSize: osmomath.NewInt(1_000_000), }, } - s.App.ProtoRevKeeper.SetBaseDenoms(s.Ctx, baseDenomPriorities) + err = s.App.ProtoRevKeeper.SetBaseDenoms(s.Ctx, baseDenomPriorities) + s.Require().NoError(err) // Mint some assets to the accounts. for _, acc := range s.TestAccs { From 25f47d8ec1a332f987c8329f3c1f99e60fbf6630 Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Sat, 17 Feb 2024 15:31:52 -0700 Subject: [PATCH 15/20] protorev perf non param --- CHANGELOG.md | 1 + app/upgrades/v24/upgrades.go | 12 + app/upgrades/v24/upgrades_test.go | 41 +++ proto/osmosis/protorev/v1beta1/genesis.proto | 13 +- proto/osmosis/protorev/v1beta1/protorev.proto | 9 + x/protorev/keeper/genesis.go | 4 +- x/protorev/keeper/genesis_test.go | 4 +- x/protorev/keeper/msg_server.go | 3 - x/protorev/keeper/protorev.go | 47 ++- x/protorev/keeper/protorev_test.go | 2 +- x/protorev/types/genesis.go | 6 +- x/protorev/types/genesis.pb.go | 147 ++++---- x/protorev/types/keys.go | 12 +- x/protorev/types/protorev.pb.go | 336 ++++++++++++++---- 14 files changed, 451 insertions(+), 186 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a612af1743..e128ef4be66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * [#7250](https://github.com/osmosis-labs/osmosis/pull/7250) Further filter spam gauges from epoch distribution. * [#7472](https://github.com/osmosis-labs/osmosis/pull/7472) Refactor TWAP keys to only require a single key format. Significantly lowers TWAP-caused writes * [#7499](https://github.com/osmosis-labs/osmosis/pull/7499) Slight speed/gas improvements to CL CreatePosition and AddToPosition +* [#7508](https://github.com/osmosis-labs/osmosis/pull/7508) Improve protorev performance by removing iterator and storing base denoms as a single object rather than an array. ## v23.0.0 diff --git a/app/upgrades/v24/upgrades.go b/app/upgrades/v24/upgrades.go index 2771fa577c5..57fa86f8d46 100644 --- a/app/upgrades/v24/upgrades.go +++ b/app/upgrades/v24/upgrades.go @@ -23,6 +23,18 @@ func CreateUpgradeHandler( return nil, err } + // We no longer use the base denoms array and instead use the repeated base denoms field for performance reasons. + // We retrieve the base denoms array from the KVStore, delete them from the KVStore, and set them as a repeated field. + baseDenoms, err := keepers.ProtoRevKeeper.DeprecatedGetAllBaseDenoms(ctx) + if err != nil { + return nil, err + } + keepers.ProtoRevKeeper.DeprecatedDeleteBaseDenoms(ctx) + err = keepers.ProtoRevKeeper.SetBaseDenoms(ctx, baseDenoms) + if err != nil { + return nil, err + } + // Now that the TWAP keys are refactored, we can delete all time indexed TWAPs // since we only need the pool indexed TWAPs. keepers.TwapKeeper.DeleteAllHistoricalTimeIndexedTWAPs(ctx) diff --git a/app/upgrades/v24/upgrades_test.go b/app/upgrades/v24/upgrades_test.go index c6186cd785c..b4e61b5bbe4 100644 --- a/app/upgrades/v24/upgrades_test.go +++ b/app/upgrades/v24/upgrades_test.go @@ -16,6 +16,7 @@ import ( "github.com/osmosis-labs/osmosis/osmoutils" "github.com/osmosis-labs/osmosis/v23/app/apptesting" + protorevtypes "github.com/osmosis-labs/osmosis/v23/x/protorev/types" "github.com/osmosis-labs/osmosis/v23/x/twap/types" twaptypes "github.com/osmosis-labs/osmosis/v23/x/twap/types" ) @@ -37,6 +38,9 @@ func TestUpgradeTestSuite(t *testing.T) { func (s *UpgradeTestSuite) TestUpgrade() { s.Setup() + // TWAP Setup + // + // Manually set up TWAP records indexed by both pool ID and time. twapStoreKey := s.App.GetKey(twaptypes.ModuleName) store := s.Ctx.KVStore(twapStoreKey) @@ -75,11 +79,35 @@ func (s *UpgradeTestSuite) TestUpgrade() { s.Require().Len(twapRecords, 1) s.Require().Equal(twap, twapRecords[0]) + // PROTOREV Setup + // + + // Set the old KVStore base denoms + s.App.ProtoRevKeeper.DeprecatedSetBaseDenoms(s.Ctx, []protorevtypes.BaseDenom{ + {Denom: protorevtypes.OsmosisDenomination, StepSize: osmomath.NewInt(1_000_000)}, + {Denom: "atom", StepSize: osmomath.NewInt(1_000_000)}, + {Denom: "weth", StepSize: osmomath.NewInt(1_000_000)}}) + oldBaseDenoms, err := s.App.ProtoRevKeeper.DeprecatedGetAllBaseDenoms(s.Ctx) + s.Require().NoError(err) + s.Require().Equal(3, len(oldBaseDenoms)) + s.Require().Equal(oldBaseDenoms[0].Denom, protorevtypes.OsmosisDenomination) + s.Require().Equal(oldBaseDenoms[1].Denom, "atom") + s.Require().Equal(oldBaseDenoms[2].Denom, "weth") + + // The new KVStore should be set to the default + newBaseDenoms, err := s.App.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) + s.Require().NoError(err) + s.Require().Equal(protorevtypes.DefaultBaseDenoms.BaseDenoms, newBaseDenoms) + + // Run the upgrade dummyUpgrade(s) s.Require().NotPanics(func() { s.App.BeginBlocker(s.Ctx, abci.RequestBeginBlock{}) }) + // TWAP Tests + // + // TWAP records indexed by time should be completely removed. twapRecords, err = osmoutils.GatherValuesFromStorePrefix(store, []byte(HistoricalTWAPTimeIndexPrefix), types.ParseTwapFromBz) s.Require().NoError(err) @@ -90,6 +118,19 @@ func (s *UpgradeTestSuite) TestUpgrade() { s.Require().NoError(err) s.Require().Len(twapRecords, 1) s.Require().Equal(twap, twapRecords[0]) + + // PROTOREV Tests + // + + // The new KVStore should return the old KVStore values + newBaseDenoms, err = s.App.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) + s.Require().NoError(err) + s.Require().Equal(oldBaseDenoms, newBaseDenoms) + + // The old KVStore base denoms should be deleted + oldBaseDenoms, err = s.App.ProtoRevKeeper.DeprecatedGetAllBaseDenoms(s.Ctx) + s.Require().NoError(err) + s.Require().Empty(oldBaseDenoms) } func dummyUpgrade(s *UpgradeTestSuite) { diff --git a/proto/osmosis/protorev/v1beta1/genesis.proto b/proto/osmosis/protorev/v1beta1/genesis.proto index 1df1f0d5a3c..df140a57b0b 100644 --- a/proto/osmosis/protorev/v1beta1/genesis.proto +++ b/proto/osmosis/protorev/v1beta1/genesis.proto @@ -21,18 +21,17 @@ message GenesisState { ]; // The base denominations being used to create cyclic arbitrage routes via the // highest liquidity method. - repeated BaseDenom base_denoms = 3 [ + BaseDenoms base_denoms = 3 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"base_denoms\"" ]; - // The pool weights that are being used to calculate the weight (compute cost) - // of each route. - // - // DEPRECATED: This field is deprecated and will be removed in the next - // release. It is replaced by the `info_by_pool_type` field. + // DEPRECATED: The pool weights that are being used to calculate the weight + // (compute cost) of each route. This field is deprecated and will be removed + // in the next release. It is replaced by the `info_by_pool_type` field. PoolWeights pool_weights = 4 [ (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"pool_weights\"" + (gogoproto.moretags) = "yaml:\"pool_weights\"", + deprecated = true ]; // The number of days since module genesis. uint64 days_since_module_genesis = 5 diff --git a/proto/osmosis/protorev/v1beta1/protorev.proto b/proto/osmosis/protorev/v1beta1/protorev.proto index ab014b251a3..cf2339349e8 100644 --- a/proto/osmosis/protorev/v1beta1/protorev.proto +++ b/proto/osmosis/protorev/v1beta1/protorev.proto @@ -184,6 +184,15 @@ message BaseDenom { ]; } +// BaseDenoms represents all of the base denoms that the module uses for its +// arbitrage trades. +message BaseDenoms { + repeated BaseDenom base_denoms = 1 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"base_denoms\"" + ]; +} + message AllProtocolRevenue { osmosis.poolmanager.v1beta1.TakerFeesTracker taker_fees_tracker = 1 [ (gogoproto.moretags) = "yaml:\"taker_fees_tracker\"", diff --git a/x/protorev/keeper/genesis.go b/x/protorev/keeper/genesis.go index 66e7d344025..fa415c11d48 100644 --- a/x/protorev/keeper/genesis.go +++ b/x/protorev/keeper/genesis.go @@ -28,7 +28,7 @@ func (k Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState) { // Configure the initial base denoms used for cyclic route building. The order of the list of base // denoms is the order in which routes will be prioritized i.e. routes will be built and simulated in a // first come first serve basis that is based on the order of the base denoms. - if err := k.SetBaseDenoms(ctx, genState.BaseDenoms); err != nil { + if err := k.SetBaseDenoms(ctx, genState.BaseDenoms.BaseDenoms); err != nil { panic(err) } @@ -126,7 +126,7 @@ func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState { if err != nil { panic(err) } - genesis.BaseDenoms = baseDenoms + genesis.BaseDenoms = types.BaseDenoms{BaseDenoms: baseDenoms} // Export the developer fees that have been collected. fees, err := k.GetAllDeveloperFees(ctx) diff --git a/x/protorev/keeper/genesis_test.go b/x/protorev/keeper/genesis_test.go index 37e8b2c2c02..8816b43f24e 100644 --- a/x/protorev/keeper/genesis_test.go +++ b/x/protorev/keeper/genesis_test.go @@ -17,8 +17,8 @@ func (s *KeeperTestSuite) TestInitGenesis() { baseDenoms, err := s.App.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) s.Require().NoError(err) - s.Require().Equal(len(baseDenoms), len(exportedGenesis.BaseDenoms)) - for _, baseDenom := range exportedGenesis.BaseDenoms { + s.Require().Equal(len(baseDenoms), len(exportedGenesis.BaseDenoms.BaseDenoms)) + for _, baseDenom := range exportedGenesis.BaseDenoms.BaseDenoms { s.Require().Contains(baseDenoms, baseDenom) } diff --git a/x/protorev/keeper/msg_server.go b/x/protorev/keeper/msg_server.go index 02345a3c0a0..b01feb6eed3 100644 --- a/x/protorev/keeper/msg_server.go +++ b/x/protorev/keeper/msg_server.go @@ -149,9 +149,6 @@ func (m MsgServer) SetBaseDenoms(c context.Context, msg *types.MsgSetBaseDenoms) m.k.DeleteAllPoolsForBaseDenom(ctx, baseDenom.Denom) } - // Delete the old base denoms - m.k.DeleteBaseDenoms(ctx) - if err := m.k.SetBaseDenoms(ctx, msg.BaseDenoms); err != nil { return nil, err } diff --git a/x/protorev/keeper/protorev.go b/x/protorev/keeper/protorev.go index 153ec7b4843..adb4f1f5d8f 100644 --- a/x/protorev/keeper/protorev.go +++ b/x/protorev/keeper/protorev.go @@ -76,12 +76,13 @@ func (k Keeper) DeleteAllTokenPairArbRoutes(ctx sdk.Context) { k.DeleteAllEntriesForKeyPrefix(ctx, types.KeyPrefixTokenPairRoutes) } -// GetAllBaseDenoms returns all of the base denoms (sorted by priority in descending order) used to build cyclic arbitrage routes -func (k Keeper) GetAllBaseDenoms(ctx sdk.Context) ([]types.BaseDenom, error) { +// DeprecatedGetAllBaseDenoms returns all of the base denoms (sorted by priority in descending order) used to build cyclic arbitrage routes +// After v24 upgrade, this method should be deleted. We now use the param store. +func (k Keeper) DeprecatedGetAllBaseDenoms(ctx sdk.Context) ([]types.BaseDenom, error) { baseDenoms := make([]types.BaseDenom, 0) store := ctx.KVStore(k.storeKey) - iterator := sdk.KVStorePrefixIterator(store, types.KeyPrefixBaseDenoms) + iterator := sdk.KVStorePrefixIterator(store, types.KeyPrefixDeprecatedBaseDenoms) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { @@ -97,10 +98,11 @@ func (k Keeper) GetAllBaseDenoms(ctx sdk.Context) ([]types.BaseDenom, error) { return baseDenoms, nil } -// SetBaseDenoms sets all of the base denoms used to build cyclic arbitrage routes. The base denoms priority +// DeprecatedSetBaseDenoms sets all of the base denoms used to build cyclic arbitrage routes. The base denoms priority // order is going to match the order of the base denoms in the slice. -func (k Keeper) SetBaseDenoms(ctx sdk.Context, baseDenoms []types.BaseDenom) error { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixBaseDenoms) +// After v24 upgrade, this method should be deleted. We now use the param store. +func (k Keeper) DeprecatedSetBaseDenoms(ctx sdk.Context, baseDenoms []types.BaseDenom) error { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixDeprecatedBaseDenoms) for i, baseDenom := range baseDenoms { key := types.GetKeyPrefixBaseDenom(uint64(i)) @@ -115,9 +117,36 @@ func (k Keeper) SetBaseDenoms(ctx sdk.Context, baseDenoms []types.BaseDenom) err return nil } -// DeleteBaseDenoms deletes all of the base denoms -func (k Keeper) DeleteBaseDenoms(ctx sdk.Context) { - k.DeleteAllEntriesForKeyPrefix(ctx, types.KeyPrefixBaseDenoms) +// GetAllBaseDenoms returns all of the base denoms (sorted by priority in descending order) used to build cyclic arbitrage routes +func (k Keeper) GetAllBaseDenoms(ctx sdk.Context) ([]types.BaseDenom, error) { + store := ctx.KVStore(k.storeKey) + bz := store.Get(types.KeyPrefixBaseDenoms) + baseDenoms := types.BaseDenoms{} + err := baseDenoms.Unmarshal(bz) + if err != nil { + return []types.BaseDenom{}, err + } + return baseDenoms.BaseDenoms, nil +} + +// SetBaseDenoms sets all of the base denoms used to build cyclic arbitrage routes. The base denoms priority +// order is going to match the order of the base denoms in the slice. +func (k Keeper) SetBaseDenoms(ctx sdk.Context, baseDenoms []types.BaseDenom) error { + newBaseDenoms := types.BaseDenoms{BaseDenoms: baseDenoms} + store := ctx.KVStore(k.storeKey) + test, err := newBaseDenoms.Marshal() + if err != nil { + return err + } + + store.Set(types.KeyPrefixBaseDenoms, test) + return nil +} + +// DeprecatedDeleteBaseDenoms deletes all of the base denoms. +// After v24 upgrade, this method should be deleted. We now use the param store. +func (k Keeper) DeprecatedDeleteBaseDenoms(ctx sdk.Context) { + k.DeleteAllEntriesForKeyPrefix(ctx, types.KeyPrefixDeprecatedBaseDenoms) } // GetPoolForDenomPair returns the id of the highest liquidity pool between the base denom and the denom to match diff --git a/x/protorev/keeper/protorev_test.go b/x/protorev/keeper/protorev_test.go index 62e2fa827e8..3d347d5f738 100644 --- a/x/protorev/keeper/protorev_test.go +++ b/x/protorev/keeper/protorev_test.go @@ -68,7 +68,7 @@ func (s *KeeperTestSuite) TestGetAllBaseDenoms() { s.Require().Equal(baseDenoms[2].Denom, "ibc/0CD3A0285E1341859B5E86B6AB7682F023D03E97607CCC1DC95706411D866DF7") // Should be able to delete all base denoms - s.App.ProtoRevKeeper.DeleteBaseDenoms(s.Ctx) + s.App.ProtoRevKeeper.DeprecatedDeleteBaseDenoms(s.Ctx) baseDenoms, err = s.App.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) s.Require().NoError(err) s.Require().Equal(0, len(baseDenoms)) diff --git a/x/protorev/types/genesis.go b/x/protorev/types/genesis.go index 9655408d492..8041701fd9f 100644 --- a/x/protorev/types/genesis.go +++ b/x/protorev/types/genesis.go @@ -12,12 +12,12 @@ var ( // Configure the initial base denoms used for cyclic route building. The order of the list of base // denoms is the order in which routes will be prioritized i.e. routes will be built and simulated in a // first come first serve basis that is based on the order of the base denoms. - DefaultBaseDenoms = []BaseDenom{ + DefaultBaseDenoms = BaseDenoms{[]BaseDenom{ { Denom: OsmosisDenomination, StepSize: osmomath.NewInt(1_000_000), }, - } + }} DefaultPoolTypeInfo = InfoByPoolType{ Balancer: BalancerPoolInfo{ Weight: 2, // it takes around 2 ms to simulate and execute a balancer swap @@ -72,7 +72,7 @@ func (gs GenesisState) Validate() error { } // Validate the base denoms - if err := ValidateBaseDenoms(gs.BaseDenoms); err != nil { + if err := ValidateBaseDenoms(gs.BaseDenoms.BaseDenoms); err != nil { return err } diff --git a/x/protorev/types/genesis.pb.go b/x/protorev/types/genesis.pb.go index 49bf3913ad7..59a4ac71f43 100644 --- a/x/protorev/types/genesis.pb.go +++ b/x/protorev/types/genesis.pb.go @@ -33,13 +33,11 @@ type GenesisState struct { TokenPairArbRoutes []TokenPairArbRoutes `protobuf:"bytes,2,rep,name=token_pair_arb_routes,json=tokenPairArbRoutes,proto3" json:"token_pair_arb_routes" yaml:"token_pair_arb_routes"` // The base denominations being used to create cyclic arbitrage routes via the // highest liquidity method. - BaseDenoms []BaseDenom `protobuf:"bytes,3,rep,name=base_denoms,json=baseDenoms,proto3" json:"base_denoms" yaml:"base_denoms"` - // The pool weights that are being used to calculate the weight (compute cost) - // of each route. - // - // DEPRECATED: This field is deprecated and will be removed in the next - // release. It is replaced by the `info_by_pool_type` field. - PoolWeights PoolWeights `protobuf:"bytes,4,opt,name=pool_weights,json=poolWeights,proto3" json:"pool_weights" yaml:"pool_weights"` + BaseDenoms BaseDenoms `protobuf:"bytes,3,opt,name=base_denoms,json=baseDenoms,proto3" json:"base_denoms" yaml:"base_denoms"` + // DEPRECATED: The pool weights that are being used to calculate the weight + // (compute cost) of each route. This field is deprecated and will be removed + // in the next release. It is replaced by the `info_by_pool_type` field. + PoolWeights PoolWeights `protobuf:"bytes,4,opt,name=pool_weights,json=poolWeights,proto3" json:"pool_weights" yaml:"pool_weights"` // Deprecated: Do not use. // The number of days since module genesis. DaysSinceModuleGenesis uint64 `protobuf:"varint,5,opt,name=days_since_module_genesis,json=daysSinceModuleGenesis,proto3" json:"days_since_module_genesis,omitempty" yaml:"days_since_module_genesis"` // The fees the developer account has accumulated over time. @@ -111,13 +109,14 @@ func (m *GenesisState) GetTokenPairArbRoutes() []TokenPairArbRoutes { return nil } -func (m *GenesisState) GetBaseDenoms() []BaseDenom { +func (m *GenesisState) GetBaseDenoms() BaseDenoms { if m != nil { return m.BaseDenoms } - return nil + return BaseDenoms{} } +// Deprecated: Do not use. func (m *GenesisState) GetPoolWeights() PoolWeights { if m != nil { return m.PoolWeights @@ -204,56 +203,55 @@ func init() { } var fileDescriptor_3c77fc2da5752af2 = []byte{ - // 771 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x54, 0xcf, 0x4e, 0xe3, 0x46, - 0x18, 0x8f, 0x0b, 0x85, 0x32, 0x81, 0x08, 0x86, 0x06, 0x39, 0x69, 0x71, 0x5c, 0x17, 0xda, 0xa8, - 0x2a, 0xb6, 0x80, 0x9e, 0x7a, 0xa8, 0x84, 0xa9, 0x68, 0xab, 0xaa, 0x28, 0x32, 0xa9, 0x2a, 0xb5, - 0x52, 0xa7, 0x63, 0x67, 0x12, 0x2c, 0x6c, 0x8f, 0xe5, 0x99, 0x84, 0xe4, 0x01, 0x7a, 0xef, 0xc3, - 0xf4, 0x21, 0x38, 0xa2, 0xbd, 0xec, 0x9e, 0xa2, 0x15, 0xbc, 0x41, 0x9e, 0x60, 0xe5, 0x99, 0x49, - 0x02, 0x21, 0xde, 0xbd, 0x79, 0xbe, 0xef, 0xf7, 0xe7, 0xfb, 0xcd, 0x1f, 0x83, 0xaf, 0x28, 0x8b, - 0x29, 0x0b, 0x99, 0x93, 0x66, 0x94, 0xd3, 0x8c, 0x0c, 0x9c, 0xc1, 0xb1, 0x4f, 0x38, 0x3e, 0x76, - 0x7a, 0x24, 0x21, 0x2c, 0x64, 0xb6, 0x68, 0x40, 0x5d, 0xe1, 0xec, 0x29, 0xce, 0x56, 0xb8, 0xfa, - 0xa7, 0x3d, 0xda, 0xa3, 0xa2, 0xea, 0xe4, 0x5f, 0x12, 0x50, 0xff, 0xba, 0x50, 0x77, 0x26, 0x20, - 0x81, 0x87, 0xc5, 0x40, 0x9c, 0xe1, 0x58, 0x19, 0xd6, 0x6b, 0x81, 0xc0, 0x21, 0x69, 0x24, 0x17, - 0xaa, 0x65, 0xc8, 0x95, 0xe3, 0x63, 0x46, 0x66, 0xe4, 0x80, 0x86, 0x89, 0xec, 0x5b, 0xaf, 0x01, - 0xd8, 0xfc, 0x49, 0x86, 0xb9, 0xe2, 0x98, 0x13, 0xf8, 0x03, 0x58, 0x93, 0xda, 0xba, 0x66, 0x6a, - 0xcd, 0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de, 0x55, 0xde, 0xfa, 0x4d, 0x74, 0xd4, 0xb1, 0x43, - 0x04, 0x2a, 0x1d, 0x32, 0x20, 0x11, 0x4d, 0x49, 0x86, 0xba, 0x84, 0x30, 0x7d, 0x4d, 0x6c, 0x56, - 0xcd, 0x56, 0x37, 0x29, 0xcf, 0x3c, 0x0b, 0x71, 0x4e, 0xc3, 0xc4, 0xdd, 0x57, 0xd3, 0x57, 0x95, - 0xe9, 0x33, 0xba, 0xe5, 0x6d, 0xcd, 0x0a, 0x17, 0x84, 0x30, 0x78, 0x09, 0x76, 0x23, 0xcc, 0x09, - 0xe3, 0xc8, 0x8f, 0x68, 0x70, 0x83, 0xae, 0x45, 0x32, 0x7d, 0x5d, 0xcc, 0x6e, 0x4c, 0xc6, 0x8d, - 0xba, 0x94, 0x59, 0x02, 0xb2, 0xbc, 0x1d, 0x59, 0x75, 0xf3, 0xe2, 0xcf, 0xa2, 0x06, 0xff, 0x02, - 0x3b, 0x73, 0x47, 0xdc, 0xe9, 0x64, 0x84, 0x31, 0xfd, 0x13, 0x53, 0x6b, 0x6e, 0xb8, 0xf6, 0x64, - 0xdc, 0xd0, 0x17, 0x87, 0x52, 0x10, 0xeb, 0xd5, 0xff, 0x47, 0x15, 0x15, 0xe9, 0x4c, 0x96, 0xbc, - 0xed, 0x19, 0x4a, 0x55, 0xe0, 0xdf, 0xa0, 0x16, 0xe3, 0x21, 0x12, 0x07, 0x92, 0xd2, 0x30, 0xe1, - 0x0c, 0xe5, 0x1a, 0x62, 0x28, 0x7d, 0x63, 0x71, 0xbb, 0x0b, 0xa1, 0x96, 0x57, 0x8d, 0xf1, 0x30, - 0x3f, 0xf1, 0x96, 0xe8, 0xb4, 0x48, 0x26, 0x22, 0xc0, 0xdf, 0xc1, 0xde, 0x32, 0x12, 0x1f, 0xea, - 0x40, 0x88, 0x7f, 0x31, 0x19, 0x37, 0xf6, 0x8b, 0xc5, 0xf9, 0xd0, 0xf2, 0xe0, 0xa2, 0x72, 0x7b,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x0b, 0x67, 0x70, 0x72, 0xea, 0x0c, 0xe7, 0xff, 0xfc, 0x3c, 0x18, - 0xf3, 0xd7, 0xc4, 0xfa, 0xf4, 0x5d, 0x00, 0x00, 0x00, 0xff, 0xff, 0x1d, 0xaa, 0x99, 0x66, 0x95, - 0x06, 0x00, 0x00, + // 768 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x54, 0xdf, 0x6e, 0xf3, 0x34, + 0x14, 0x6f, 0xf8, 0xc6, 0x3e, 0x3e, 0x77, 0xab, 0x36, 0x8f, 0x4e, 0x6e, 0xc5, 0xd2, 0x10, 0x6d, + 0x50, 0x21, 0x96, 0x68, 0x1b, 0x57, 0x5c, 0x20, 0x2d, 0x43, 0x03, 0x84, 0x98, 0xaa, 0xac, 0x08, + 0x09, 0x24, 0x2c, 0x27, 0x75, 0xbb, 0x68, 0x49, 0x1c, 0xc5, 0x6e, 0xd7, 0x3e, 0x00, 0xf7, 0x3c, + 0x0c, 0x0f, 0xb1, 0xcb, 0x89, 0x2b, 0xc4, 0x45, 0x85, 0xb6, 0x37, 0xe8, 0x13, 0xa0, 0xd8, 0x6e, + 0xbb, 0x75, 0x0d, 0xdc, 0xd5, 0xe7, 0xfc, 0xfe, 0x9c, 0x5f, 0x8f, 0x1d, 0xf0, 0x09, 0xe3, 0x09, + 0xe3, 0x11, 0x77, 0xb3, 0x9c, 0x09, 0x96, 0xd3, 0x91, 0x3b, 0x3a, 0x09, 0xa8, 0x20, 0x27, 0xee, + 0x80, 0xa6, 0x94, 0x47, 0xdc, 0x91, 0x0d, 0x88, 0x34, 0xce, 0x99, 0xe3, 0x1c, 0x8d, 0x6b, 0x7e, + 0x38, 0x60, 0x03, 0x26, 0xab, 0x6e, 0xf1, 0x4b, 0x01, 0x9a, 0x9f, 0x96, 0xea, 0x2e, 0x04, 0x14, + 0xf0, 0xa8, 0x1c, 0x48, 0x72, 0x92, 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0x70, 0x95, 0x70, 0x75, 0xff, 0x68, 0x1a, 0x0f, 0x8f, + 0xa6, 0xf1, 0xcf, 0xa3, 0x69, 0xfc, 0xfe, 0x64, 0x56, 0x1e, 0x9e, 0xcc, 0xca, 0x5f, 0x4f, 0x66, + 0xe5, 0xe7, 0x2f, 0x06, 0x91, 0xb8, 0x19, 0x06, 0x4e, 0xc8, 0x12, 0x57, 0x0f, 0x70, 0x1c, 0x93, + 0x80, 0xcf, 0x0f, 0xee, 0xe8, 0xf4, 0xcc, 0x1d, 0x2f, 0x3f, 0xfb, 0x45, 0x30, 0x1e, 0x6c, 0xca, + 0xf3, 0xd9, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x8d, 0xd7, 0x7e, 0x9f, 0x98, 0x06, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -368,20 +366,16 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i-- dAtA[i] = 0x22 - if len(m.BaseDenoms) > 0 { - for iNdEx := len(m.BaseDenoms) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.BaseDenoms[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a + { + size, err := m.BaseDenoms.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x1a if len(m.TokenPairArbRoutes) > 0 { for iNdEx := len(m.TokenPairArbRoutes) - 1; iNdEx >= 0; iNdEx-- { { @@ -434,12 +428,8 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } - if len(m.BaseDenoms) > 0 { - for _, e := range m.BaseDenoms { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } + l = m.BaseDenoms.Size() + n += 1 + l + sovGenesis(uint64(l)) l = m.PoolWeights.Size() n += 1 + l + sovGenesis(uint64(l)) if m.DaysSinceModuleGenesis != 0 { @@ -613,8 +603,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.BaseDenoms = append(m.BaseDenoms, BaseDenom{}) - if err := m.BaseDenoms[len(m.BaseDenoms)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.BaseDenoms.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/protorev/types/keys.go b/x/protorev/types/keys.go index a1d78808335..061ea2b74b5 100644 --- a/x/protorev/types/keys.go +++ b/x/protorev/types/keys.go @@ -22,7 +22,7 @@ const ( const ( prefixTokenPairRoutes = iota + 1 prefixDenomPairToPool - prefixBaseDenoms + prefixDeprecatedBaseDenoms prefixNumberOfTrades prefixProfitsByDenom prefixTradesByRoute @@ -38,6 +38,7 @@ const ( prefixSwapsToBackrun prefixcyclicArbTracker prefixcyclicArbTrackerStartHeight + prefixBaseDenoms ) var ( @@ -48,8 +49,8 @@ var ( // KeyPrefixDenomPairToPool is the prefix that is used to store the pool id for a given denom pair (baseDenom, otherDenom) KeyPrefixDenomPairToPool = []byte{prefixDenomPairToPool} - // KeyPrefixBaseDenoms is the prefix that is used to store the base denoms that are used to create cyclic arbitrage routes - KeyPrefixBaseDenoms = []byte{prefixBaseDenoms} + // DEPRECATED: KeyPrefixDeprecatedBaseDenoms is the prefix that is used to store the base denoms that are used to create cyclic arbitrage routes + KeyPrefixDeprecatedBaseDenoms = []byte{prefixDeprecatedBaseDenoms} // -------------- Keys for statistics stores -------------- // // KeyPrefixNumberOfTrades is the prefix for the store that keeps track of the number of trades executed @@ -97,6 +98,9 @@ var ( // KeyCyclicArbTracker is the prefix for store that keeps track of the height we began tracking cyclic arbitrage KeyCyclicArbTrackerStartHeight = []byte{prefixcyclicArbTrackerStartHeight} + + // KeyPrefixDeprecatedBaseDenoms is the prefix that is used to store the base denoms that are used to create cyclic arbitrage routes + KeyPrefixBaseDenoms = []byte{prefixBaseDenoms} ) // Returns the key needed to fetch the pool id for a given denom @@ -106,7 +110,7 @@ func GetKeyPrefixDenomPairToPool(baseDenom, matchDenom string) []byte { // Returns the key needed to fetch info about base denoms func GetKeyPrefixBaseDenom(priority uint64) []byte { - return append(KeyPrefixBaseDenoms, sdk.Uint64ToBigEndian(priority)...) + return append(KeyPrefixDeprecatedBaseDenoms, sdk.Uint64ToBigEndian(priority)...) } // Returns the key needed to fetch the tokenPair routes for a given pair of tokens diff --git a/x/protorev/types/protorev.pb.go b/x/protorev/types/protorev.pb.go index f038bd07f87..0b6a18a57b5 100644 --- a/x/protorev/types/protorev.pb.go +++ b/x/protorev/types/protorev.pb.go @@ -723,6 +723,52 @@ func (m *BaseDenom) GetDenom() string { return "" } +// BaseDenoms represents all of the base denoms that the module uses for its +// arbitrage trades. +type BaseDenoms struct { + BaseDenoms []BaseDenom `protobuf:"bytes,1,rep,name=base_denoms,json=baseDenoms,proto3" json:"base_denoms" yaml:"base_denoms"` +} + +func (m *BaseDenoms) Reset() { *m = BaseDenoms{} } +func (m *BaseDenoms) String() string { return proto.CompactTextString(m) } +func (*BaseDenoms) ProtoMessage() {} +func (*BaseDenoms) Descriptor() ([]byte, []int) { + return fileDescriptor_1e9f2391fd9fec01, []int{12} +} +func (m *BaseDenoms) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BaseDenoms) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BaseDenoms.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 *BaseDenoms) XXX_Merge(src proto.Message) { + xxx_messageInfo_BaseDenoms.Merge(m, src) +} +func (m *BaseDenoms) XXX_Size() int { + return m.Size() +} +func (m *BaseDenoms) XXX_DiscardUnknown() { + xxx_messageInfo_BaseDenoms.DiscardUnknown(m) +} + +var xxx_messageInfo_BaseDenoms proto.InternalMessageInfo + +func (m *BaseDenoms) GetBaseDenoms() []BaseDenom { + if m != nil { + return m.BaseDenoms + } + return nil +} + type AllProtocolRevenue struct { TakerFeesTracker types1.TakerFeesTracker `protobuf:"bytes,1,opt,name=taker_fees_tracker,json=takerFeesTracker,proto3" json:"taker_fees_tracker" yaml:"taker_fees_tracker"` CyclicArbTracker CyclicArbTracker `protobuf:"bytes,3,opt,name=cyclic_arb_tracker,json=cyclicArbTracker,proto3" json:"cyclic_arb_tracker" yaml:"cyclic_arb_tracker"` @@ -732,7 +778,7 @@ func (m *AllProtocolRevenue) Reset() { *m = AllProtocolRevenue{} } func (m *AllProtocolRevenue) String() string { return proto.CompactTextString(m) } func (*AllProtocolRevenue) ProtoMessage() {} func (*AllProtocolRevenue) Descriptor() ([]byte, []int) { - return fileDescriptor_1e9f2391fd9fec01, []int{12} + return fileDescriptor_1e9f2391fd9fec01, []int{13} } func (m *AllProtocolRevenue) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -784,7 +830,7 @@ func (m *CyclicArbTracker) Reset() { *m = CyclicArbTracker{} } func (m *CyclicArbTracker) String() string { return proto.CompactTextString(m) } func (*CyclicArbTracker) ProtoMessage() {} func (*CyclicArbTracker) Descriptor() ([]byte, []int) { - return fileDescriptor_1e9f2391fd9fec01, []int{13} + return fileDescriptor_1e9f2391fd9fec01, []int{14} } func (m *CyclicArbTracker) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -840,6 +886,7 @@ func init() { proto.RegisterType((*CosmwasmPoolInfo)(nil), "osmosis.protorev.v1beta1.CosmwasmPoolInfo") proto.RegisterType((*WeightMap)(nil), "osmosis.protorev.v1beta1.WeightMap") proto.RegisterType((*BaseDenom)(nil), "osmosis.protorev.v1beta1.BaseDenom") + proto.RegisterType((*BaseDenoms)(nil), "osmosis.protorev.v1beta1.BaseDenoms") proto.RegisterType((*AllProtocolRevenue)(nil), "osmosis.protorev.v1beta1.AllProtocolRevenue") proto.RegisterType((*CyclicArbTracker)(nil), "osmosis.protorev.v1beta1.CyclicArbTracker") } @@ -849,80 +896,81 @@ func init() { } var fileDescriptor_1e9f2391fd9fec01 = []byte{ - // 1156 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x4f, 0x6f, 0x1b, 0xc5, - 0x1b, 0xce, 0xc6, 0x4e, 0x1a, 0x8f, 0x53, 0xdb, 0x99, 0xa4, 0xad, 0xe3, 0xfe, 0x7e, 0xde, 0x30, - 0xad, 0xc0, 0x45, 0xaa, 0xad, 0xa4, 0x1c, 0x50, 0x51, 0x91, 0xb2, 0x41, 0x11, 0x01, 0x91, 0x44, - 0x13, 0x4b, 0x15, 0x5c, 0x96, 0xd9, 0xf5, 0xd8, 0x59, 0xd9, 0xbb, 0x63, 0xed, 0x8c, 0xf3, 0xa7, - 0x48, 0xbd, 0x70, 0xe4, 0xc2, 0x85, 0x1b, 0x07, 0x6e, 0x70, 0xe1, 0x33, 0x70, 0xed, 0xb1, 0xc7, - 0x8a, 0xc3, 0x0a, 0x25, 0x17, 0xc4, 0xd1, 0x9f, 0x00, 0xed, 0xcc, 0xec, 0xda, 0x71, 0xe2, 0x86, - 0x48, 0x88, 0xdb, 0xce, 0xfb, 0x3e, 0xcf, 0xf3, 0xce, 0xfb, 0xbc, 0xb3, 0xb3, 0x0b, 0xde, 0x63, - 0xdc, 0x67, 0xdc, 0xe3, 0x8d, 0x7e, 0xc8, 0x04, 0x0b, 0xe9, 0x51, 0xe3, 0x68, 0xdd, 0xa1, 0x82, - 0xac, 0xa7, 0x81, 0xba, 0x7c, 0x80, 0x65, 0x0d, 0xac, 0xa7, 0x71, 0x0d, 0xac, 0xac, 0xba, 0x32, - 0x65, 0xcb, 0x44, 0x43, 0x2d, 0x14, 0xaa, 0xb2, 0xd2, 0x61, 0x1d, 0xa6, 0xe2, 0xf1, 0x93, 0x8e, - 0x56, 0x15, 0xa6, 0xe1, 0x10, 0x4e, 0xd3, 0x72, 0x2e, 0xf3, 0x02, 0x9d, 0x7f, 0x94, 0xee, 0x89, - 0xb1, 0x9e, 0x4f, 0x02, 0xd2, 0xa1, 0x61, 0x8a, 0xeb, 0xd0, 0x80, 0xa6, 0xdb, 0xa8, 0x3c, 0x4c, - 0xa0, 0xe2, 0xa4, 0x4d, 0x29, 0xbf, 0x1a, 0x85, 0xde, 0x18, 0x00, 0x36, 0x59, 0x97, 0x06, 0xfb, - 0xc4, 0x0b, 0x37, 0x43, 0x07, 0xb3, 0x81, 0xa0, 0x1c, 0x7e, 0x09, 0x00, 0x09, 0x1d, 0x3b, 0x94, - 0xab, 0xb2, 0xb1, 0x96, 0xa9, 0xe5, 0x37, 0xcc, 0xfa, 0xb4, 0x3e, 0xeb, 0x92, 0x65, 0xad, 0xbe, - 0x8a, 0xcc, 0x99, 0x61, 0x64, 0x2e, 0x9d, 0x12, 0xbf, 0xf7, 0x14, 0x8d, 0x04, 0x10, 0xce, 0x91, - 0x54, 0xba, 0x0e, 0x16, 0x44, 0x5c, 0xd0, 0xf6, 0x82, 0xf2, 0xec, 0x9a, 0x51, 0xcb, 0x59, 0xcb, - 0xc3, 0xc8, 0x2c, 0x2a, 0x4e, 0x92, 0x41, 0xf8, 0x96, 0x7c, 0xdc, 0x09, 0xe0, 0x3a, 0xc8, 0xa9, - 0x28, 0x1b, 0x88, 0x72, 0x46, 0x12, 0x56, 0x86, 0x91, 0x59, 0x1a, 0x27, 0xb0, 0x81, 0x40, 0x58, - 0xc9, 0xee, 0x0d, 0xc4, 0xd3, 0xec, 0x9f, 0x3f, 0x99, 0x06, 0xfa, 0xd5, 0x00, 0x73, 0xb2, 0x26, - 0xdc, 0x05, 0xf3, 0x22, 0x24, 0xad, 0x7f, 0xd2, 0x49, 0x33, 0xc6, 0x59, 0x77, 0x74, 0x27, 0xb7, - 0x75, 0x11, 0x49, 0x46, 0x58, 0xab, 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, 0x39, 0x14, 0x1c, - 0x3e, 0x03, 0xb7, 0xb9, 0x20, 0x4e, 0x8f, 0xda, 0xc7, 0x32, 0xa2, 0x67, 0x52, 0x1e, 0x46, 0xe6, - 0x4a, 0x32, 0xd1, 0xb1, 0x34, 0xc2, 0x8b, 0x6a, 0xad, 0xf8, 0x70, 0x0b, 0x14, 0x1d, 0xd2, 0x23, - 0x81, 0x4b, 0xc3, 0x44, 0x60, 0x56, 0x0a, 0x54, 0x86, 0x91, 0x79, 0x57, 0x09, 0x4c, 0x00, 0x10, - 0x2e, 0x24, 0x11, 0x2d, 0xb2, 0x07, 0x96, 0x5d, 0x16, 0xb8, 0x34, 0x10, 0x21, 0x11, 0xb4, 0x95, - 0x08, 0x65, 0xa4, 0x50, 0x75, 0x18, 0x99, 0x15, 0x25, 0x74, 0x05, 0x08, 0x61, 0x38, 0x1e, 0x1d, - 0xed, 0x2a, 0x36, 0xf4, 0x98, 0x70, 0x3f, 0x11, 0xcb, 0x4e, 0xee, 0x6a, 0x02, 0x80, 0x70, 0x21, - 0x89, 0x28, 0x11, 0xf4, 0x63, 0x06, 0x14, 0x76, 0x82, 0x36, 0xb3, 0x4e, 0x63, 0xbf, 0x9a, 0xa7, - 0x7d, 0x0a, 0x9f, 0x83, 0x79, 0xd5, 0xbd, 0x74, 0x29, 0xbf, 0x51, 0x9b, 0xfe, 0x9e, 0x1d, 0x48, - 0x5c, 0xcc, 0x94, 0x1a, 0x13, 0x2f, 0x9c, 0x52, 0x41, 0x58, 0xcb, 0x41, 0x1b, 0x2c, 0x24, 0x9e, - 0x48, 0xff, 0xf2, 0x1b, 0xef, 0x4f, 0x97, 0xb6, 0x34, 0x32, 0x15, 0xbf, 0xa7, 0xc5, 0x8b, 0x17, - 0xfd, 0x46, 0x38, 0x15, 0x85, 0x0c, 0x2c, 0x8e, 0xfb, 0x24, 0xbd, 0xcd, 0x6f, 0xd4, 0xa7, 0x17, - 0xd9, 0x1a, 0x43, 0xa7, 0x85, 0xee, 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 0x69, 0xfa, 0x40, 0x66, 0xb7, 0x43, 0xe6, 0x5b, 0xbb, 0xaf, 0xce, 0xaa, 0xc6, 0xeb, - 0xb3, 0xaa, 0xf1, 0xc7, 0x59, 0xd5, 0xf8, 0xfe, 0xbc, 0x3a, 0xf3, 0xfa, 0xbc, 0x3a, 0xf3, 0xe6, - 0xbc, 0x3a, 0xf3, 0xd5, 0x07, 0x1d, 0x4f, 0x1c, 0x0e, 0x9c, 0xba, 0xcb, 0xfc, 0x86, 0x76, 0xf7, - 0x71, 0x8f, 0x38, 0x3c, 0x59, 0x34, 0x8e, 0x36, 0x9e, 0x34, 0x4e, 0x46, 0x3f, 0xda, 0xe2, 0xb4, - 0x4f, 0xb9, 0x33, 0x2f, 0xd7, 0x4f, 0xfe, 0x0e, 0x00, 0x00, 0xff, 0xff, 0xe2, 0x27, 0xf6, 0x6c, - 0x89, 0x0b, 0x00, 0x00, + // 1180 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xcf, 0x6f, 0x1b, 0x45, + 0x14, 0xce, 0xc6, 0x6e, 0x1a, 0x8f, 0x5b, 0xdb, 0x9d, 0xa6, 0xad, 0xe3, 0x82, 0x37, 0x4c, 0x2b, + 0x70, 0x91, 0x6a, 0x2b, 0x29, 0x07, 0x54, 0x54, 0xa4, 0x6c, 0x50, 0x45, 0x41, 0xb4, 0xd5, 0xc4, + 0x52, 0x05, 0x97, 0x65, 0x76, 0x3d, 0x76, 0x56, 0xf6, 0xee, 0x58, 0x3b, 0xe3, 0x34, 0x29, 0x52, + 0x2f, 0x1c, 0xb9, 0x70, 0xe1, 0xc6, 0x81, 0x1b, 0x5c, 0xf8, 0x1b, 0xb8, 0xf6, 0xd8, 0x63, 0xc5, + 0x61, 0x85, 0xda, 0x0b, 0xe2, 0xe8, 0xbf, 0x00, 0xcd, 0x8f, 0x5d, 0x3b, 0x9b, 0xba, 0x69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0x84, 0xcf, 0xaa, 0xc7, 0x7b, 0x11, 0xdc, 0x04, 0x25, 0x1d, 0x65, + 0x13, 0x51, 0x2f, 0x28, 0xc2, 0xda, 0x34, 0xb1, 0x6b, 0xf3, 0x04, 0x36, 0x11, 0x08, 0x6b, 0xd9, + 0x07, 0x13, 0x71, 0xbb, 0xf8, 0xf7, 0x2f, 0xb6, 0x85, 0x7e, 0xb7, 0xc0, 0x19, 0x55, 0x13, 0xde, + 0x07, 0x2b, 0x22, 0x26, 0xbd, 0xb7, 0x99, 0xa4, 0x2b, 0x71, 0xce, 0x25, 0x33, 0xc9, 0x79, 0x53, + 0x44, 0x91, 0x11, 0x36, 0x2a, 0xf0, 0x3e, 0x28, 0x71, 0x41, 0xc7, 0x2e, 0x0f, 0x9e, 0x50, 0x33, + 0xc3, 0xa6, 0x64, 0xfc, 0x99, 0xd8, 0x97, 0xf4, 0x02, 0xf2, 0xde, 0xb0, 0x1d, 0xb0, 0x4e, 0x48, + 0xc4, 0x5e, 0xfb, 0x5e, 0x24, 0x66, 0xfd, 0x66, 0x3c, 0x84, 0x57, 0xe5, 0xf3, 0x6e, 0xf0, 0x84, + 0x9a, 0x7e, 0x7f, 0xb2, 0xc0, 0x19, 0x55, 0x1e, 0x5e, 0x03, 0x45, 0xb9, 0xbe, 0x75, 0x6b, 0xc3, + 0x6a, 0x15, 0x9d, 0xea, 0x34, 0xb1, 0xcb, 0x9a, 0x2d, 0xa3, 0x08, 0xab, 0xe4, 0xff, 0xe7, 0xe3, + 0x3f, 0x16, 0xa8, 0x2a, 0x1f, 0x77, 0x05, 0x11, 0x01, 0x17, 0x81, 0xcf, 0xe1, 0x97, 0xe0, 0xec, + 0x38, 0x66, 0xfd, 0x40, 0xa4, 0x96, 0xae, 0xb7, 0xcd, 0xee, 0x96, 0x3b, 0x37, 0x73, 0x73, 0x87, + 0x05, 0x91, 0x73, 0xd9, 0x98, 0x59, 0x31, 0x33, 0x68, 0x1e, 0xc2, 0xa9, 0x02, 0x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 0xf5, 0x0b, 0x27, 0x7e, 0xf7, 0x8a, 0xb3, 0x1d, 0x7b, 0x0b, 0x8a, 0x1f, 0xd7, 0x44, 0xb8, 0xe6, + 0xe7, 0x48, 0x5f, 0x14, 0x57, 0x97, 0x6b, 0x05, 0x5c, 0x15, 0x07, 0x47, 0xdb, 0xfc, 0xc3, 0x02, + 0xb5, 0x7c, 0x01, 0xf8, 0x29, 0x00, 0x33, 0xd1, 0x93, 0x7f, 0xed, 0x45, 0xd9, 0x0f, 0x2e, 0x65, + 0x25, 0xe1, 0x10, 0xbc, 0xbb, 0xa7, 0xbf, 0x08, 0xe2, 0xfb, 0x6c, 0x12, 0x89, 0x20, 0x1a, 0xb8, + 0x5c, 0x90, 0x58, 0x70, 0xb7, 0x1f, 0xb3, 0x50, 0xed, 0xa9, 0x82, 0xd3, 0x9a, 0x26, 0xf6, 0x75, + 0x3d, 0xc3, 0x1b, 0xe1, 0x08, 0x37, 0x74, 0x7e, 0x3b, 0x4b, 0xef, 0xaa, 0xec, 0xdd, 0x98, 0x85, + 0xce, 0xfd, 0x67, 0x2f, 0x9b, 0xd6, 0xf3, 0x97, 0x4d, 0xeb, 0xaf, 0x97, 0x4d, 0xeb, 0xc7, 0x57, + 0xcd, 0xa5, 0xe7, 0xaf, 0x9a, 0x4b, 0x2f, 0x5e, 0x35, 0x97, 0xbe, 0xf9, 0x68, 0x10, 0x88, 0xbd, + 0x89, 0xd7, 0xf6, 0x59, 0xd8, 0x31, 0xee, 0xde, 0x1c, 0x11, 0x8f, 0xa7, 0x2f, 0x9d, 0xfd, 0xad, + 0x5b, 0x9d, 0x83, 0xd9, 0xc5, 0x5e, 0x1c, 0x8e, 0x29, 0xf7, 0x56, 0xd4, 0xfb, 0xad, 0x7f, 0x03, + 0x00, 0x00, 0xff, 0xff, 0xfd, 0x90, 0xd6, 0x07, 0xf9, 0x0b, 0x00, 0x00, } func (this *TokenPairArbRoutes) Equal(that interface{}) bool { @@ -1534,6 +1582,43 @@ func (m *BaseDenom) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *BaseDenoms) 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 *BaseDenoms) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BaseDenoms) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.BaseDenoms) > 0 { + for iNdEx := len(m.BaseDenoms) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.BaseDenoms[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintProtorev(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func (m *AllProtocolRevenue) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1837,6 +1922,21 @@ func (m *BaseDenom) Size() (n int) { return n } +func (m *BaseDenoms) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.BaseDenoms) > 0 { + for _, e := range m.BaseDenoms { + l = e.Size() + n += 1 + l + sovProtorev(uint64(l)) + } + } + return n +} + func (m *AllProtocolRevenue) Size() (n int) { if m == nil { return 0 @@ -3302,6 +3402,90 @@ func (m *BaseDenom) Unmarshal(dAtA []byte) error { } return nil } +func (m *BaseDenoms) 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 ErrIntOverflowProtorev + } + 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: BaseDenoms: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BaseDenoms: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BaseDenoms", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProtorev + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthProtorev + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthProtorev + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BaseDenoms = append(m.BaseDenoms, BaseDenom{}) + if err := m.BaseDenoms[len(m.BaseDenoms)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipProtorev(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthProtorev + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *AllProtocolRevenue) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 From 8bd740a11fbfbb95158fb30586ff867a1c4c84ab Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Sat, 17 Feb 2024 16:11:46 -0700 Subject: [PATCH 16/20] remove deprecated delete --- x/protorev/keeper/protorev_test.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/x/protorev/keeper/protorev_test.go b/x/protorev/keeper/protorev_test.go index 3d347d5f738..eb3f8315464 100644 --- a/x/protorev/keeper/protorev_test.go +++ b/x/protorev/keeper/protorev_test.go @@ -67,12 +67,6 @@ func (s *KeeperTestSuite) TestGetAllBaseDenoms() { s.Require().Equal(baseDenoms[1].Denom, "Atom") s.Require().Equal(baseDenoms[2].Denom, "ibc/0CD3A0285E1341859B5E86B6AB7682F023D03E97607CCC1DC95706411D866DF7") - // Should be able to delete all base denoms - s.App.ProtoRevKeeper.DeprecatedDeleteBaseDenoms(s.Ctx) - baseDenoms, err = s.App.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) - s.Require().NoError(err) - s.Require().Equal(0, len(baseDenoms)) - // Should be able to set the base denoms err = s.App.ProtoRevKeeper.SetBaseDenoms(s.Ctx, []types.BaseDenom{{Denom: "osmo"}, {Denom: "atom"}, {Denom: "weth"}}) s.Require().NoError(err) From 489002c959d471a4f6e2432118107a9c649ccbe4 Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Sat, 17 Feb 2024 16:44:45 -0700 Subject: [PATCH 17/20] reset proto --- app/upgrades/v24/upgrades.go | 2 +- proto/osmosis/protorev/v1beta1/genesis.proto | 2 +- x/protorev/keeper/genesis.go | 4 +- x/protorev/keeper/genesis_test.go | 4 +- x/protorev/types/genesis.go | 6 +- x/protorev/types/genesis.pb.go | 136 ++++++++++--------- 6 files changed, 82 insertions(+), 72 deletions(-) diff --git a/app/upgrades/v24/upgrades.go b/app/upgrades/v24/upgrades.go index 57fa86f8d46..4a0bd361219 100644 --- a/app/upgrades/v24/upgrades.go +++ b/app/upgrades/v24/upgrades.go @@ -24,7 +24,7 @@ func CreateUpgradeHandler( } // We no longer use the base denoms array and instead use the repeated base denoms field for performance reasons. - // We retrieve the base denoms array from the KVStore, delete them from the KVStore, and set them as a repeated field. + // We retrieve the old base denoms array from the KVStore, delete the array from the KVStore, and set them as a repeated field in the new KVStore. baseDenoms, err := keepers.ProtoRevKeeper.DeprecatedGetAllBaseDenoms(ctx) if err != nil { return nil, err diff --git a/proto/osmosis/protorev/v1beta1/genesis.proto b/proto/osmosis/protorev/v1beta1/genesis.proto index df140a57b0b..65ad2f7c165 100644 --- a/proto/osmosis/protorev/v1beta1/genesis.proto +++ b/proto/osmosis/protorev/v1beta1/genesis.proto @@ -21,7 +21,7 @@ message GenesisState { ]; // The base denominations being used to create cyclic arbitrage routes via the // highest liquidity method. - BaseDenoms base_denoms = 3 [ + repeated BaseDenom base_denoms = 3 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"base_denoms\"" ]; diff --git a/x/protorev/keeper/genesis.go b/x/protorev/keeper/genesis.go index fa415c11d48..66e7d344025 100644 --- a/x/protorev/keeper/genesis.go +++ b/x/protorev/keeper/genesis.go @@ -28,7 +28,7 @@ func (k Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState) { // Configure the initial base denoms used for cyclic route building. The order of the list of base // denoms is the order in which routes will be prioritized i.e. routes will be built and simulated in a // first come first serve basis that is based on the order of the base denoms. - if err := k.SetBaseDenoms(ctx, genState.BaseDenoms.BaseDenoms); err != nil { + if err := k.SetBaseDenoms(ctx, genState.BaseDenoms); err != nil { panic(err) } @@ -126,7 +126,7 @@ func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState { if err != nil { panic(err) } - genesis.BaseDenoms = types.BaseDenoms{BaseDenoms: baseDenoms} + genesis.BaseDenoms = baseDenoms // Export the developer fees that have been collected. fees, err := k.GetAllDeveloperFees(ctx) diff --git a/x/protorev/keeper/genesis_test.go b/x/protorev/keeper/genesis_test.go index 8816b43f24e..37e8b2c2c02 100644 --- a/x/protorev/keeper/genesis_test.go +++ b/x/protorev/keeper/genesis_test.go @@ -17,8 +17,8 @@ func (s *KeeperTestSuite) TestInitGenesis() { baseDenoms, err := s.App.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) s.Require().NoError(err) - s.Require().Equal(len(baseDenoms), len(exportedGenesis.BaseDenoms.BaseDenoms)) - for _, baseDenom := range exportedGenesis.BaseDenoms.BaseDenoms { + s.Require().Equal(len(baseDenoms), len(exportedGenesis.BaseDenoms)) + for _, baseDenom := range exportedGenesis.BaseDenoms { s.Require().Contains(baseDenoms, baseDenom) } diff --git a/x/protorev/types/genesis.go b/x/protorev/types/genesis.go index 8041701fd9f..9655408d492 100644 --- a/x/protorev/types/genesis.go +++ b/x/protorev/types/genesis.go @@ -12,12 +12,12 @@ var ( // Configure the initial base denoms used for cyclic route building. The order of the list of base // denoms is the order in which routes will be prioritized i.e. routes will be built and simulated in a // first come first serve basis that is based on the order of the base denoms. - DefaultBaseDenoms = BaseDenoms{[]BaseDenom{ + DefaultBaseDenoms = []BaseDenom{ { Denom: OsmosisDenomination, StepSize: osmomath.NewInt(1_000_000), }, - }} + } DefaultPoolTypeInfo = InfoByPoolType{ Balancer: BalancerPoolInfo{ Weight: 2, // it takes around 2 ms to simulate and execute a balancer swap @@ -72,7 +72,7 @@ func (gs GenesisState) Validate() error { } // Validate the base denoms - if err := ValidateBaseDenoms(gs.BaseDenoms.BaseDenoms); err != nil { + if err := ValidateBaseDenoms(gs.BaseDenoms); err != nil { return err } diff --git a/x/protorev/types/genesis.pb.go b/x/protorev/types/genesis.pb.go index 59a4ac71f43..175988652a6 100644 --- a/x/protorev/types/genesis.pb.go +++ b/x/protorev/types/genesis.pb.go @@ -33,7 +33,7 @@ type GenesisState struct { TokenPairArbRoutes []TokenPairArbRoutes `protobuf:"bytes,2,rep,name=token_pair_arb_routes,json=tokenPairArbRoutes,proto3" json:"token_pair_arb_routes" yaml:"token_pair_arb_routes"` // The base denominations being used to create cyclic arbitrage routes via the // highest liquidity method. - BaseDenoms BaseDenoms `protobuf:"bytes,3,opt,name=base_denoms,json=baseDenoms,proto3" json:"base_denoms" yaml:"base_denoms"` + BaseDenoms []BaseDenom `protobuf:"bytes,3,rep,name=base_denoms,json=baseDenoms,proto3" json:"base_denoms" yaml:"base_denoms"` // DEPRECATED: The pool weights that are being used to calculate the weight // (compute cost) of each route. This field is deprecated and will be removed // in the next release. It is replaced by the `info_by_pool_type` field. @@ -109,11 +109,11 @@ func (m *GenesisState) GetTokenPairArbRoutes() []TokenPairArbRoutes { return nil } -func (m *GenesisState) GetBaseDenoms() BaseDenoms { +func (m *GenesisState) GetBaseDenoms() []BaseDenom { if m != nil { return m.BaseDenoms } - return BaseDenoms{} + return nil } // Deprecated: Do not use. @@ -203,55 +203,56 @@ func init() { } var fileDescriptor_3c77fc2da5752af2 = []byte{ - // 768 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x54, 0xdf, 0x6e, 0xf3, 0x34, - 0x14, 0x6f, 0xf8, 0xc6, 0x3e, 0x3e, 0x77, 0xab, 0x36, 0x8f, 0x4e, 0x6e, 0xc5, 0xd2, 0x10, 0x6d, - 0x50, 0x21, 0x96, 0x68, 0x1b, 0x57, 0x5c, 0x20, 0x2d, 0x43, 0x03, 0x84, 0x98, 0xaa, 0xac, 0x08, - 0x09, 0x24, 0x2c, 0x27, 0x75, 0xbb, 0x68, 0x49, 0x1c, 0xc5, 0x6e, 0xd7, 0x3e, 0x00, 0xf7, 0x3c, - 0x0c, 0x0f, 0xb1, 0xcb, 0x89, 0x2b, 0xc4, 0x45, 0x85, 0xb6, 0x37, 0xe8, 0x13, 0xa0, 0xd8, 0x6e, - 0xbb, 0x75, 0x0d, 0xdc, 0xd5, 0xe7, 0xfc, 0xfe, 0x9c, 0x5f, 0x8f, 0x1d, 0xf0, 0x09, 0xe3, 0x09, - 0xe3, 0x11, 0x77, 0xb3, 0x9c, 0x09, 0x96, 0xd3, 0x91, 0x3b, 0x3a, 0x09, 0xa8, 0x20, 0x27, 0xee, - 0x80, 0xa6, 0x94, 0x47, 0xdc, 0x91, 0x0d, 0x88, 0x34, 0xce, 0x99, 0xe3, 0x1c, 0x8d, 0x6b, 0x7e, - 0x38, 0x60, 0x03, 0x26, 0xab, 0x6e, 0xf1, 0x4b, 0x01, 0x9a, 0x9f, 0x96, 0xea, 0x2e, 0x04, 0x14, - 0xf0, 0xa8, 0x1c, 0x48, 0x72, 0x92, 0x68, 0xc3, 0x66, 0x23, 0x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, 0x68, 0x1a, 0x0f, 0x8f, - 0xa6, 0xf1, 0xcf, 0xa3, 0x69, 0xfc, 0xfe, 0x64, 0x56, 0x1e, 0x9e, 0xcc, 0xca, 0x5f, 0x4f, 0x66, - 0xe5, 0xe7, 0x2f, 0x06, 0x91, 0xb8, 0x19, 0x06, 0x4e, 0xc8, 0x12, 0x57, 0x0f, 0x70, 0x1c, 0x93, - 0x80, 0xcf, 0x0f, 0xee, 0xe8, 0xf4, 0xcc, 0x1d, 0x2f, 0x3f, 0xfb, 0x45, 0x30, 0x1e, 0x6c, 0xca, - 0xf3, 0xd9, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x8d, 0xd7, 0x7e, 0x9f, 0x98, 0x06, 0x00, 0x00, + // 769 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x54, 0xdf, 0x6e, 0xeb, 0x34, + 0x18, 0x6f, 0x38, 0x63, 0x87, 0xe3, 0xee, 0x54, 0x9b, 0x47, 0x27, 0xb7, 0x62, 0x69, 0x08, 0x1b, + 0x54, 0x88, 0x25, 0xda, 0xc6, 0x15, 0x17, 0x48, 0xcb, 0xd0, 0x00, 0x21, 0xa6, 0x2a, 0x2b, 0x42, + 0x02, 0x09, 0xe3, 0xa4, 0x6e, 0x17, 0x2d, 0x89, 0xa3, 0xd8, 0xed, 0xda, 0x07, 0xe0, 0x9e, 0x87, + 0xe1, 0x21, 0x76, 0x39, 0x71, 0x05, 0x37, 0x15, 0xda, 0xde, 0xa0, 0x4f, 0x80, 0x62, 0xbb, 0xed, + 0xd6, 0x35, 0x70, 0x17, 0x7f, 0xdf, 0xef, 0xcf, 0xf7, 0xf3, 0x9f, 0x80, 0x8f, 0x19, 0x4f, 0x18, + 0x8f, 0xb8, 0x9b, 0xe5, 0x4c, 0xb0, 0x9c, 0x8e, 0xdc, 0xd1, 0x71, 0x40, 0x05, 0x39, 0x76, 0x07, + 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0x2d, 0x80, 0xe1, 0x24, 0x8c, 0xa3, 0x50, 0xfe, 0x33, 0x44, 0x4e, 0xc2, 0x1b, 0x9a, 0xa3, + 0x9a, 0xf4, 0xfd, 0xb4, 0xdc, 0xf7, 0x5c, 0x72, 0xce, 0xf2, 0xa0, 0xab, 0x18, 0xde, 0xfe, 0x6c, + 0xda, 0x6a, 0x28, 0xd7, 0x97, 0x7a, 0xb6, 0xbf, 0x1d, 0xae, 0x12, 0x2e, 0xef, 0x1e, 0x4c, 0xe3, + 0xfe, 0xc1, 0x34, 0xfe, 0x79, 0x30, 0x8d, 0xdf, 0x1f, 0xcd, 0xca, 0xfd, 0xa3, 0x59, 0xf9, 0xeb, + 0xd1, 0xac, 0xfc, 0xf4, 0xf9, 0x20, 0x12, 0xd7, 0xc3, 0xc0, 0x09, 0x59, 0xe2, 0xea, 0x01, 0x8e, + 0x62, 0x12, 0xf0, 0xf9, 0xc2, 0x1d, 0x9d, 0x9c, 0xba, 0xe3, 0xe5, 0x5f, 0xbf, 0x08, 0xc6, 0x83, + 0x4d, 0xb9, 0x3e, 0xfd, 0x37, 0x00, 0x00, 0xff, 0xff, 0xaf, 0xec, 0x3f, 0x40, 0x97, 0x06, 0x00, + 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -366,16 +367,20 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i-- dAtA[i] = 0x22 - { - size, err := m.BaseDenoms.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if len(m.BaseDenoms) > 0 { + for iNdEx := len(m.BaseDenoms) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.BaseDenoms[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) } - i-- - dAtA[i] = 0x1a if len(m.TokenPairArbRoutes) > 0 { for iNdEx := len(m.TokenPairArbRoutes) - 1; iNdEx >= 0; iNdEx-- { { @@ -428,8 +433,12 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } - l = m.BaseDenoms.Size() - n += 1 + l + sovGenesis(uint64(l)) + if len(m.BaseDenoms) > 0 { + for _, e := range m.BaseDenoms { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } l = m.PoolWeights.Size() n += 1 + l + sovGenesis(uint64(l)) if m.DaysSinceModuleGenesis != 0 { @@ -603,7 +612,8 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.BaseDenoms.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.BaseDenoms = append(m.BaseDenoms, BaseDenom{}) + if err := m.BaseDenoms[len(m.BaseDenoms)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex From 13e0c3268dc0a4b88cc17d9940d064f0dc989260 Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Sat, 17 Feb 2024 16:48:15 -0700 Subject: [PATCH 18/20] final cleanups --- x/protorev/keeper/protorev.go | 14 +++++++------- x/protorev/types/keys.go | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/x/protorev/keeper/protorev.go b/x/protorev/keeper/protorev.go index adb4f1f5d8f..1412cd2d79a 100644 --- a/x/protorev/keeper/protorev.go +++ b/x/protorev/keeper/protorev.go @@ -105,7 +105,7 @@ func (k Keeper) DeprecatedSetBaseDenoms(ctx sdk.Context, baseDenoms []types.Base store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixDeprecatedBaseDenoms) for i, baseDenom := range baseDenoms { - key := types.GetKeyPrefixBaseDenom(uint64(i)) + key := types.DeprecatedGetKeyPrefixBaseDenom(uint64(i)) bz, err := baseDenom.Marshal() if err != nil { @@ -117,6 +117,12 @@ func (k Keeper) DeprecatedSetBaseDenoms(ctx sdk.Context, baseDenoms []types.Base return nil } +// DeprecatedDeleteBaseDenoms deletes all of the base denoms. +// After v24 upgrade, this method should be deleted. We now use the param store. +func (k Keeper) DeprecatedDeleteBaseDenoms(ctx sdk.Context) { + k.DeleteAllEntriesForKeyPrefix(ctx, types.KeyPrefixDeprecatedBaseDenoms) +} + // GetAllBaseDenoms returns all of the base denoms (sorted by priority in descending order) used to build cyclic arbitrage routes func (k Keeper) GetAllBaseDenoms(ctx sdk.Context) ([]types.BaseDenom, error) { store := ctx.KVStore(k.storeKey) @@ -143,12 +149,6 @@ func (k Keeper) SetBaseDenoms(ctx sdk.Context, baseDenoms []types.BaseDenom) err return nil } -// DeprecatedDeleteBaseDenoms deletes all of the base denoms. -// After v24 upgrade, this method should be deleted. We now use the param store. -func (k Keeper) DeprecatedDeleteBaseDenoms(ctx sdk.Context) { - k.DeleteAllEntriesForKeyPrefix(ctx, types.KeyPrefixDeprecatedBaseDenoms) -} - // GetPoolForDenomPair returns the id of the highest liquidity pool between the base denom and the denom to match func (k Keeper) GetPoolForDenomPair(ctx sdk.Context, baseDenom, denomToMatch string) (uint64, error) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixDenomPairToPool) diff --git a/x/protorev/types/keys.go b/x/protorev/types/keys.go index 061ea2b74b5..4630d20ed8e 100644 --- a/x/protorev/types/keys.go +++ b/x/protorev/types/keys.go @@ -99,7 +99,7 @@ var ( // KeyCyclicArbTracker is the prefix for store that keeps track of the height we began tracking cyclic arbitrage KeyCyclicArbTrackerStartHeight = []byte{prefixcyclicArbTrackerStartHeight} - // KeyPrefixDeprecatedBaseDenoms is the prefix that is used to store the base denoms that are used to create cyclic arbitrage routes + // KeyPrefixBaseDenoms is the prefix that is used to store the base denoms that are used to create cyclic arbitrage routes KeyPrefixBaseDenoms = []byte{prefixBaseDenoms} ) @@ -109,7 +109,7 @@ func GetKeyPrefixDenomPairToPool(baseDenom, matchDenom string) []byte { } // Returns the key needed to fetch info about base denoms -func GetKeyPrefixBaseDenom(priority uint64) []byte { +func DeprecatedGetKeyPrefixBaseDenom(priority uint64) []byte { return append(KeyPrefixDeprecatedBaseDenoms, sdk.Uint64ToBigEndian(priority)...) } From bff8cb1e0a8d9eb063e92243a5bb1fc09a90ec2a Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Sat, 17 Feb 2024 19:19:55 -0700 Subject: [PATCH 19/20] quick test fix --- app/upgrades/v24/upgrades_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/upgrades/v24/upgrades_test.go b/app/upgrades/v24/upgrades_test.go index b4e61b5bbe4..978f3ac97e3 100644 --- a/app/upgrades/v24/upgrades_test.go +++ b/app/upgrades/v24/upgrades_test.go @@ -97,7 +97,7 @@ func (s *UpgradeTestSuite) TestUpgrade() { // The new KVStore should be set to the default newBaseDenoms, err := s.App.ProtoRevKeeper.GetAllBaseDenoms(s.Ctx) s.Require().NoError(err) - s.Require().Equal(protorevtypes.DefaultBaseDenoms.BaseDenoms, newBaseDenoms) + s.Require().Equal(protorevtypes.DefaultBaseDenoms, newBaseDenoms) // Run the upgrade dummyUpgrade(s) From a838fc1f5aa81585f315c47972eed9045e7b877a Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Tue, 20 Feb 2024 15:50:28 -0700 Subject: [PATCH 20/20] reserve pool_weights proto field --- proto/osmosis/protorev/v1beta1/genesis.proto | 12 +- x/protorev/types/genesis.pb.go | 155 ++++++------------- 2 files changed, 52 insertions(+), 115 deletions(-) diff --git a/proto/osmosis/protorev/v1beta1/genesis.proto b/proto/osmosis/protorev/v1beta1/genesis.proto index 65ad2f7c165..3d25ca9c9a9 100644 --- a/proto/osmosis/protorev/v1beta1/genesis.proto +++ b/proto/osmosis/protorev/v1beta1/genesis.proto @@ -25,14 +25,10 @@ message GenesisState { (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"base_denoms\"" ]; - // DEPRECATED: The pool weights that are being used to calculate the weight - // (compute cost) of each route. This field is deprecated and will be removed - // in the next release. It is replaced by the `info_by_pool_type` field. - PoolWeights pool_weights = 4 [ - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"pool_weights\"", - deprecated = true - ]; + // DEPRECATED: pool_weights are weights that are being used to calculate the + // compute cost of each route. This field is deprecated. + // It is replaced by the `info_by_pool_type` field. + reserved 4; // The number of days since module genesis. uint64 days_since_module_genesis = 5 [ (gogoproto.moretags) = "yaml:\"days_since_module_genesis\"" ]; diff --git a/x/protorev/types/genesis.pb.go b/x/protorev/types/genesis.pb.go index 175988652a6..689a68228b3 100644 --- a/x/protorev/types/genesis.pb.go +++ b/x/protorev/types/genesis.pb.go @@ -34,10 +34,6 @@ type GenesisState struct { // The base denominations being used to create cyclic arbitrage routes via the // highest liquidity method. BaseDenoms []BaseDenom `protobuf:"bytes,3,rep,name=base_denoms,json=baseDenoms,proto3" json:"base_denoms" yaml:"base_denoms"` - // DEPRECATED: The pool weights that are being used to calculate the weight - // (compute cost) of each route. This field is deprecated and will be removed - // in the next release. It is replaced by the `info_by_pool_type` field. - PoolWeights PoolWeights `protobuf:"bytes,4,opt,name=pool_weights,json=poolWeights,proto3" json:"pool_weights" yaml:"pool_weights"` // Deprecated: Do not use. // The number of days since module genesis. DaysSinceModuleGenesis uint64 `protobuf:"varint,5,opt,name=days_since_module_genesis,json=daysSinceModuleGenesis,proto3" json:"days_since_module_genesis,omitempty" yaml:"days_since_module_genesis"` // The fees the developer account has accumulated over time. @@ -116,14 +112,6 @@ func (m *GenesisState) GetBaseDenoms() []BaseDenom { return nil } -// Deprecated: Do not use. -func (m *GenesisState) GetPoolWeights() PoolWeights { - if m != nil { - return m.PoolWeights - } - return PoolWeights{} -} - func (m *GenesisState) GetDaysSinceModuleGenesis() uint64 { if m != nil { return m.DaysSinceModuleGenesis @@ -203,56 +191,54 @@ func init() { } var fileDescriptor_3c77fc2da5752af2 = []byte{ - // 769 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x54, 0xdf, 0x6e, 0xeb, 0x34, - 0x18, 0x6f, 0x38, 0x63, 0x87, 0xe3, 0xee, 0x54, 0x9b, 0x47, 0x27, 0xb7, 0x62, 0x69, 0x08, 0x1b, - 0x54, 0x88, 0x25, 0xda, 0xc6, 0x15, 0x17, 0x48, 0xcb, 0xd0, 0x00, 0x21, 0xa6, 0x2a, 0x2b, 0x42, - 0x02, 0x09, 0xe3, 0xa4, 0x6e, 0x17, 0x2d, 0x89, 0xa3, 0xd8, 0xed, 0xda, 0x07, 0xe0, 0x9e, 0x87, - 0xe1, 0x21, 0x76, 0x39, 0x71, 0x05, 0x37, 0x15, 0xda, 0xde, 0xa0, 0x4f, 0x80, 0x62, 0xbb, 0xed, - 0xd6, 0x35, 0x70, 0x17, 0x7f, 0xdf, 0xef, 0xcf, 0xf7, 0xf3, 0x9f, 0x80, 0x8f, 0x19, 0x4f, 0x18, - 0x8f, 0xb8, 0x9b, 0xe5, 0x4c, 0xb0, 0x9c, 0x8e, 0xdc, 0xd1, 0x71, 0x40, 0x05, 0x39, 0x76, 0x07, - 0x34, 0xa5, 0x3c, 0xe2, 0x8e, 0x6c, 0x40, 0xa4, 0x71, 0xce, 0x1c, 0xe7, 0x68, 0x5c, 0xf3, 0xfd, - 0x01, 0x1b, 0x30, 0x59, 0x75, 0x8b, 0x2f, 0x05, 0x68, 0x7e, 0x52, 0xaa, 0xbb, 0x10, 0x50, 0xc0, - 0xc3, 0x72, 0x20, 0xc9, 0x49, 0xa2, 0x0d, 0x9b, 0x8d, 0x50, 0xe2, 0xb0, 0x32, 0x52, 0x0b, 0xdd, - 0x32, 0xd5, 0xca, 0x0d, 0x08, 0xa7, 0x0b, 0x72, 0xc8, 0xa2, 0x54, 0xf5, 0xed, 0xbf, 0x01, 0xd8, - 0xfa, 0x5a, 0x85, 0xb9, 0x12, 0x44, 0x50, 0xf8, 0x25, 0xd8, 0x54, 0xda, 0xc8, 0xb0, 0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0x01, 0x8e, - 0x62, 0x12, 0xf0, 0xf9, 0xc2, 0x1d, 0x9d, 0x9c, 0xba, 0xe3, 0xe5, 0x5f, 0xbf, 0x08, 0xc6, 0x83, - 0x4d, 0xb9, 0x3e, 0xfd, 0x37, 0x00, 0x00, 0xff, 0xff, 0xaf, 0xec, 0x3f, 0x40, 0x97, 0x06, 0x00, - 0x00, + // 744 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x54, 0x4d, 0x6f, 0xdb, 0x36, + 0x18, 0xb6, 0x16, 0xe7, 0x8b, 0x4e, 0x8c, 0x84, 0x9b, 0x03, 0xd9, 0x58, 0x64, 0x4d, 0xcb, 0x36, + 0x63, 0x58, 0x24, 0x24, 0xd9, 0x69, 0x87, 0x01, 0x51, 0x86, 0xec, 0x0b, 0x0b, 0x0c, 0xc5, 0xbb, + 0xb4, 0x40, 0x59, 0x4a, 0xa6, 0x1d, 0x21, 0x92, 0x28, 0x88, 0xb4, 0x6b, 0xff, 0x80, 0xde, 0xfb, + 0x63, 0xfa, 0x23, 0x72, 0x0c, 0x7a, 0xea, 0xc9, 0x28, 0x92, 0x7f, 0xe0, 0x43, 0xcf, 0x85, 0x48, + 0xda, 0x69, 0x1c, 0x0b, 0xbd, 0x99, 0xef, 0xfb, 0x7c, 0xbc, 0x8f, 0xf9, 0x52, 0xe0, 0x47, 0xca, + 0x62, 0xca, 0x42, 0xe6, 0xa4, 0x19, 0xe5, 0x34, 0x23, 0x43, 0x67, 0x78, 0xe4, 0x13, 0x8e, 0x8f, + 0x9c, 0x3e, 0x49, 0x08, 0x0b, 0x99, 0x2d, 0x1a, 0x50, 0x57, 0x38, 0x7b, 0x86, 0xb3, 0x15, 0xae, + 0xf1, 0x4d, 0x9f, 0xf6, 0xa9, 0xa8, 0x3a, 0xf9, 0x2f, 0x09, 0x68, 0xfc, 0x54, 0xa8, 0x3b, 0x17, + 0x90, 0x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a5, 0xf7, 0xf7, 0x46, 0xe9, 0xd9, 0xaf, 0xfd, 0x90, 0x5f, 0x0d, 0x7c, + 0x3b, 0xa0, 0xb1, 0xa3, 0xc6, 0x38, 0x8c, 0xb0, 0xcf, 0x66, 0x07, 0x67, 0x78, 0x7c, 0xe2, 0x8c, + 0x1e, 0x3e, 0xc9, 0x79, 0x3c, 0xe6, 0xaf, 0x89, 0xf3, 0xc9, 0xa7, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xbf, 0x75, 0x74, 0x5b, 0x34, 0x06, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -357,16 +343,6 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x28 } - { - size, err := m.PoolWeights.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 if len(m.BaseDenoms) > 0 { for iNdEx := len(m.BaseDenoms) - 1; iNdEx >= 0; iNdEx-- { { @@ -439,8 +415,6 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } - l = m.PoolWeights.Size() - n += 1 + l + sovGenesis(uint64(l)) if m.DaysSinceModuleGenesis != 0 { n += 1 + sovGenesis(uint64(m.DaysSinceModuleGenesis)) } @@ -617,39 +591,6 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PoolWeights", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.PoolWeights.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex case 5: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field DaysSinceModuleGenesis", wireType)