diff --git a/CHANGELOG.md b/CHANGELOG.md index 8daf6f260b5..9016e905dae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * [#5532](https://github.com/osmosis-labs/osmosis/pull/5532) fix: Fix x/tokenfactory genesis import denoms reset x/bank existing denom metadata * [#5874](https://github.com/osmosis-labs/osmosis/pull/5874) Remove Partial Migration from superfluid migration to CL +* [#5901](https://github.com/osmosis-labs/osmosis/pull/5901) Adding support for CW pools in ProtoRev ### BugFix diff --git a/app/upgrades/v17/upgrades.go b/app/upgrades/v17/upgrades.go index b20040732bf..f29292499ac 100644 --- a/app/upgrades/v17/upgrades.go +++ b/app/upgrades/v17/upgrades.go @@ -7,6 +7,7 @@ import ( "github.com/osmosis-labs/osmosis/v17/app/keepers" "github.com/osmosis-labs/osmosis/v17/app/upgrades" + "github.com/osmosis-labs/osmosis/v17/x/protorev/types" ) func CreateUpgradeHandler( @@ -23,6 +24,14 @@ func CreateUpgradeHandler( return nil, err } + // Reset the pool weights upon upgrade. This will add support for CW pools on ProtoRev. + keepers.ProtoRevKeeper.SetPoolWeights(ctx, types.PoolWeights{ + BalancerWeight: 1, + StableWeight: 4, + ConcentratedWeight: 300, + CosmwasmWeight: 300, + }) + return migrations, nil } } diff --git a/proto/osmosis/protorev/v1beta1/protorev.proto b/proto/osmosis/protorev/v1beta1/protorev.proto index 7cba8161560..c3dbda4db31 100644 --- a/proto/osmosis/protorev/v1beta1/protorev.proto +++ b/proto/osmosis/protorev/v1beta1/protorev.proto @@ -87,6 +87,9 @@ message PoolWeights { // The weight of a concentrated pool uint64 concentrated_weight = 3 [ (gogoproto.moretags) = "yaml:\"concentrated_weight\"" ]; + // The weight of a cosmwasm pool + uint64 cosmwasm_weight = 4 + [ (gogoproto.moretags) = "yaml:\"cosmwasm_weight\"" ]; } // BaseDenom represents a single base denom that the module uses for its diff --git a/x/protorev/keeper/atom b/x/protorev/keeper/atom deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/x/protorev/keeper/keeper_test.go b/x/protorev/keeper/keeper_test.go index 5c219d9e790..1c378d5a025 100644 --- a/x/protorev/keeper/keeper_test.go +++ b/x/protorev/keeper/keeper_test.go @@ -140,6 +140,8 @@ func (s *KeeperTestSuite) SetupTest() { sdk.NewCoin("hook", sdk.NewInt(9000000000000000000)), sdk.NewCoin("eth", sdk.NewInt(9000000000000000000)), sdk.NewCoin("gamm/pool/1", sdk.NewInt(9000000000000000000)), + sdk.NewCoin(apptesting.DefaultTransmuterDenomA, sdk.NewInt(9000000000000000000)), + sdk.NewCoin(apptesting.DefaultTransmuterDenomB, sdk.NewInt(9000000000000000000)), ) s.fundAllAccountsWith() s.Commit() @@ -896,6 +898,10 @@ func (s *KeeperTestSuite) setUpPools() { // Pool 49 s.PrepareConcentratedPoolWithCoinsAndFullRangePosition("epochTwo", "uosmo") + // Create a cosmwasm pool for testing + // Pool 50 + s.PrepareCosmWasmPool() + // Set all of the pool info into the stores err := s.App.ProtoRevKeeper.UpdatePools(s.Ctx) s.Require().NoError(err) diff --git a/x/protorev/keeper/msg_server_test.go b/x/protorev/keeper/msg_server_test.go index 6cfedc8b0a0..9ca1a591079 100644 --- a/x/protorev/keeper/msg_server_test.go +++ b/x/protorev/keeper/msg_server_test.go @@ -481,6 +481,7 @@ func (s *KeeperTestSuite) TestMsgSetPoolWeights() { StableWeight: 1, BalancerWeight: 2, ConcentratedWeight: 3, + CosmwasmWeight: 4, }, false, false, @@ -492,6 +493,7 @@ func (s *KeeperTestSuite) TestMsgSetPoolWeights() { StableWeight: 0, BalancerWeight: 2, ConcentratedWeight: 1, + CosmwasmWeight: 4, }, false, false, @@ -500,7 +502,8 @@ func (s *KeeperTestSuite) TestMsgSetPoolWeights() { "Invalid message (unset pool weight)", s.adminAccount.String(), types.PoolWeights{ - StableWeight: 1, + StableWeight: 1, + CosmwasmWeight: 4, }, false, false, @@ -512,6 +515,7 @@ func (s *KeeperTestSuite) TestMsgSetPoolWeights() { StableWeight: 1, BalancerWeight: 2, ConcentratedWeight: 3, + CosmwasmWeight: 4, }, true, false, @@ -523,6 +527,7 @@ func (s *KeeperTestSuite) TestMsgSetPoolWeights() { StableWeight: 1, BalancerWeight: 2, ConcentratedWeight: 3, + CosmwasmWeight: 4, }, true, true, diff --git a/x/protorev/keeper/posthandler_test.go b/x/protorev/keeper/posthandler_test.go index 3d816f29a78..725652e7e66 100644 --- a/x/protorev/keeper/posthandler_test.go +++ b/x/protorev/keeper/posthandler_test.go @@ -340,7 +340,7 @@ func (s *KeeperTestSuite) TestAnteHandle() { params: param{ trades: []types.Trade{ { - Pool: 50, + Pool: 51, TokenOut: "ibc/0CD3A0285E1341859B5E86B6AB7682F023D03E97607CCC1DC95706411D866DF7", TokenIn: "uosmo", }, diff --git a/x/protorev/keeper/routes.go b/x/protorev/keeper/routes.go index dd8aae71b8d..404b6576ee8 100644 --- a/x/protorev/keeper/routes.go +++ b/x/protorev/keeper/routes.go @@ -174,6 +174,8 @@ func (k Keeper) CalculateRoutePoolPoints(ctx sdk.Context, route poolmanagertypes totalWeight += poolWeights.StableWeight case poolmanagertypes.Concentrated: totalWeight += poolWeights.ConcentratedWeight + case poolmanagertypes.CosmWasm: + totalWeight += poolWeights.CosmwasmWeight default: return 0, fmt.Errorf("invalid pool type") } diff --git a/x/protorev/keeper/routes_test.go b/x/protorev/keeper/routes_test.go index a13f2aceb14..296b52d3a2f 100644 --- a/x/protorev/keeper/routes_test.go +++ b/x/protorev/keeper/routes_test.go @@ -347,12 +347,29 @@ func (s *KeeperTestSuite) TestCalculateRoutePoolPoints() { expectedRoutePoolPoints: 11, expectedPass: false, }, + { + description: "Valid route with a cosmwasm pool", + route: []poolmanagertypes.SwapAmountInRoute{{PoolId: 1, TokenOutDenom: ""}, {PoolId: 50, TokenOutDenom: ""}, {PoolId: 2, TokenOutDenom: ""}}, + expectedRoutePoolPoints: 8, + expectedPass: true, + }, + { + description: "Valid route with cw pool, balancer, stable swap and cl pool", + route: []poolmanagertypes.SwapAmountInRoute{{PoolId: 1, TokenOutDenom: ""}, {PoolId: 50, TokenOutDenom: ""}, {PoolId: 40, TokenOutDenom: ""}, {PoolId: 49, TokenOutDenom: ""}}, + expectedRoutePoolPoints: 10, + expectedPass: true, + }, } for _, tc := range cases { s.Run(tc.description, func() { s.SetupTest() - s.App.ProtoRevKeeper.SetPoolWeights(s.Ctx, types.PoolWeights{StableWeight: 3, BalancerWeight: 2, ConcentratedWeight: 1}) + s.App.ProtoRevKeeper.SetPoolWeights(s.Ctx, types.PoolWeights{ + StableWeight: 3, + BalancerWeight: 2, + ConcentratedWeight: 1, + CosmwasmWeight: 4, + }) routePoolPoints, err := s.App.ProtoRevKeeper.CalculateRoutePoolPoints(s.Ctx, tc.route) if tc.expectedPass { diff --git a/x/protorev/types/genesis.go b/x/protorev/types/genesis.go index dd302e10205..cb7466f5ce0 100644 --- a/x/protorev/types/genesis.go +++ b/x/protorev/types/genesis.go @@ -20,6 +20,10 @@ var ( StableWeight: 5, // it takes around 5 ms to simulate and execute a stable swap BalancerWeight: 2, // it takes around 2 ms to simulate and execute a balancer swap ConcentratedWeight: 2, // it takes around 2 ms to simulate and execute a concentrated swap + + // TODO: This is a temporary weight until we can get a more accurate weight for cosmwasm swaps + // ref: https://github.com/osmosis-labs/osmosis/issues/5858 + CosmwasmWeight: 5, // it takes around 5 ms to simulate and execute a cosmwasm swap } DefaultDaysSinceModuleGenesis = uint64(0) DefaultDeveloperFees = []sdk.Coin{} diff --git a/x/protorev/types/msg_test.go b/x/protorev/types/msg_test.go index 7d145bf6333..32dcdc40371 100644 --- a/x/protorev/types/msg_test.go +++ b/x/protorev/types/msg_test.go @@ -520,6 +520,7 @@ func TestMsgSetPoolWeights(t *testing.T) { BalancerWeight: 1, StableWeight: 1, ConcentratedWeight: 1, + CosmwasmWeight: 1, }, false, }, @@ -530,6 +531,7 @@ func TestMsgSetPoolWeights(t *testing.T) { BalancerWeight: 0, StableWeight: 1, ConcentratedWeight: 1, + CosmwasmWeight: 1, }, false, }, @@ -540,6 +542,7 @@ func TestMsgSetPoolWeights(t *testing.T) { BalancerWeight: 1, StableWeight: 1, ConcentratedWeight: 1, + CosmwasmWeight: 1, }, true, }, diff --git a/x/protorev/types/protorev.pb.go b/x/protorev/types/protorev.pb.go index 6a6e913fd0f..d6409e24beb 100644 --- a/x/protorev/types/protorev.pb.go +++ b/x/protorev/types/protorev.pb.go @@ -275,6 +275,8 @@ type PoolWeights struct { BalancerWeight uint64 `protobuf:"varint,2,opt,name=balancer_weight,json=balancerWeight,proto3" json:"balancer_weight,omitempty" yaml:"balancer_weight"` // The weight of a concentrated pool ConcentratedWeight uint64 `protobuf:"varint,3,opt,name=concentrated_weight,json=concentratedWeight,proto3" json:"concentrated_weight,omitempty" yaml:"concentrated_weight"` + // The weight of a cosmwasm pool + CosmwasmWeight uint64 `protobuf:"varint,4,opt,name=cosmwasm_weight,json=cosmwasmWeight,proto3" json:"cosmwasm_weight,omitempty" yaml:"cosmwasm_weight"` } func (m *PoolWeights) Reset() { *m = PoolWeights{} } @@ -331,6 +333,13 @@ func (m *PoolWeights) GetConcentratedWeight() uint64 { return 0 } +func (m *PoolWeights) GetCosmwasmWeight() uint64 { + if m != nil { + return m.CosmwasmWeight + } + return 0 +} + // 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 @@ -396,49 +405,50 @@ func init() { } var fileDescriptor_1e9f2391fd9fec01 = []byte{ - // 661 bytes of a gzipped FileDescriptorProto + // 682 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x54, 0xbf, 0x6f, 0xd3, 0x40, - 0x14, 0xce, 0x35, 0xe9, 0x8f, 0x5c, 0x7f, 0xa4, 0xb8, 0xa5, 0xb8, 0x19, 0xec, 0xe8, 0x90, 0x4a, + 0x14, 0xce, 0x35, 0xe9, 0x8f, 0x5c, 0xdb, 0xa4, 0xb8, 0xa5, 0xb8, 0x19, 0xec, 0xe8, 0x90, 0x4a, 0x96, 0xda, 0x0a, 0x20, 0x21, 0x55, 0x62, 0xc0, 0x65, 0xa9, 0x90, 0xda, 0xea, 0x5a, 0x09, 0xc1, - 0x62, 0x9d, 0x9d, 0x6b, 0x6a, 0x35, 0xf1, 0x45, 0xbe, 0x4b, 0xa1, 0xfd, 0x2b, 0x18, 0x60, 0xe7, - 0x2f, 0x61, 0xee, 0xd8, 0xb1, 0x62, 0xb0, 0x50, 0xba, 0x30, 0x7b, 0x65, 0x41, 0xbe, 0x3b, 0x3b, - 0x51, 0x05, 0x12, 0x0c, 0x30, 0xf9, 0xbd, 0xef, 0xbd, 0xef, 0x7b, 0xf7, 0xde, 0xbb, 0x33, 0x7c, - 0xc4, 0xf8, 0x80, 0xf1, 0x88, 0xbb, 0xc3, 0x84, 0x09, 0x96, 0xd0, 0x73, 0xf7, 0xbc, 0x13, 0x50, - 0x41, 0x3a, 0x25, 0xe0, 0x48, 0xc3, 0x30, 0x75, 0xa2, 0x53, 0xe2, 0x3a, 0xb1, 0xb9, 0x19, 0xca, - 0x90, 0x2f, 0x03, 0xae, 0x72, 0x54, 0x56, 0x73, 0xbd, 0xc7, 0x7a, 0x4c, 0xe1, 0xb9, 0xa5, 0x51, - 0x4b, 0xe5, 0xb8, 0x01, 0xe1, 0xb4, 0x2c, 0x17, 0xb2, 0x28, 0x56, 0x71, 0x74, 0x03, 0xa0, 0x71, - 0xcc, 0xce, 0x68, 0x7c, 0x48, 0xa2, 0xe4, 0x45, 0x12, 0x60, 0x36, 0x12, 0x94, 0x1b, 0x6f, 0x20, - 0x24, 0x49, 0xe0, 0x27, 0xd2, 0x33, 0x41, 0xab, 0xda, 0x5e, 0x7c, 0x6c, 0x3b, 0xbf, 0x3b, 0x96, - 0x23, 0x59, 0xde, 0xe6, 0x55, 0x6a,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0x01, 0x60, 0x43, 0x0e, - 0xf6, 0x48, 0x10, 0x11, 0x71, 0x11, 0x85, 0xdc, 0x78, 0x05, 0xe7, 0x87, 0x09, 0x3b, 0x89, 0x44, - 0x31, 0xe3, 0x4d, 0x47, 0xdf, 0xce, 0xfc, 0xe6, 0x95, 0xe3, 0xdd, 0x65, 0x51, 0xec, 0x6d, 0xe8, - 0xe9, 0xae, 0xe8, 0x1e, 0x14, 0x0f, 0xe1, 0x42, 0xc1, 0xe0, 0x70, 0x35, 0x1e, 0x0d, 0x02, 0x9a, - 0xf8, 0xec, 0xc4, 0xd7, 0x9b, 0x53, 0x1d, 0xed, 0xfd, 0xf5, 0x98, 0x1f, 0xa8, 0x22, 0x77, 0xf5, - 0x10, 0x5e, 0x51, 0xd0, 0xc1, 0xc9, 0xb1, 0x5a, 0xea, 0x16, 0x9c, 0x95, 0xb7, 0xd5, 0xac, 0xb6, - 0xaa, 0xed, 0x9a, 0xb7, 0x9a, 0xa5, 0xf6, 0x92, 0xe2, 0x4a, 0x18, 0x61, 0x15, 0x46, 0x63, 0x00, - 0x17, 0x0f, 0x19, 0xeb, 0xbf, 0xa6, 0x51, 0xef, 0x54, 0x70, 0xe3, 0x39, 0x5c, 0xe6, 0x82, 0x04, - 0x7d, 0xea, 0xbf, 0x93, 0x88, 0x5e, 0x92, 0x99, 0xa5, 0xf6, 0x7a, 0xb1, 0xe2, 0xa9, 0x30, 0xc2, - 0x4b, 0xca, 0x57, 0x7c, 0x63, 0x17, 0x36, 0x02, 0xd2, 0x27, 0x71, 0x48, 0x93, 0x42, 0x60, 0x46, - 0x0a, 0x34, 0xb3, 0xd4, 0xde, 0x50, 0x02, 0x77, 0x12, 0x10, 0x5e, 0x29, 0x10, 0x2d, 0x72, 0x00, - 0xd7, 0x42, 0x16, 0x87, 0x34, 0x16, 0x09, 0x11, 0xb4, 0x5b, 0x08, 0x55, 0xa5, 0x90, 0x95, 0xa5, - 0x76, 0x53, 0x09, 0xfd, 0x22, 0x09,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x25, 0xa2, 0x97, 0x64, 0x66, 0xa9, 0xbd, 0x56, 0xac, 0x78, 0x22, + 0x8d, 0xf0, 0x92, 0x8a, 0x15, 0xdf, 0xd8, 0x81, 0xf5, 0x80, 0xf4, 0x48, 0x1c, 0xd2, 0xa4, 0x10, + 0x98, 0x91, 0x02, 0x8d, 0x2c, 0xb5, 0xd7, 0x95, 0xc0, 0x54, 0x01, 0xc2, 0xb5, 0x02, 0xd1, 0x22, + 0xfb, 0x70, 0x35, 0x64, 0x71, 0x48, 0x63, 0x91, 0x10, 0x41, 0x3b, 0x85, 0x50, 0x59, 0x0a, 0x59, + 0x59, 0x6a, 0x37, 0x94, 0xd0, 0x2f, 0x8a, 0x10, 0x36, 0x26, 0xd1, 0xf1, 0xad, 0x72, 0x3f, 0xcf, + 0x09, 0xef, 0x17, 0x62, 0x95, 0xe9, 0x5b, 0x4d, 0x15, 0x20, 0x5c, 0x2b, 0x10, 0x25, 0x82, 0x3e, + 0x00, 0x58, 0xf5, 0x08, 0xa7, 0x2f, 0x69, 0xcc, 0xfa, 0xb9, 0xbf, 0x9d, 0xfc, 0x20, 0xfd, 0xa9, + 0x4e, 0xfa, 0x2b, 0x61, 0x84, 0x55, 0xfa, 0x9f, 0xff, 0xb9, 0xbc, 0xbd, 0xab, 0x5b, 0x0b, 0x5c, + 0xdf, 0x5a, 0xe0, 0xdb, 0xad, 0x05, 0xde, 0xdf, 0x59, 0xa5, 0xeb, 0x3b, 0xab, 0x74, 0x73, 0x67, + 0x95, 0xde, 0x3e, 0x9d, 0xd0, 0xd7, 0x5f, 0x88, 0xad, 0x1e, 0x09, 0x78, 0x11, 0xb8, 0x67, 0xed, + 0x67, 0xee, 0xbb, 0xf1, 0xe7, 0x5b, 0x76, 0x0c, 0xe6, 0x64, 0xfc, 0xe4, 0x67, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x25, 0xcc, 0x13, 0x2b, 0xdf, 0x05, 0x00, 0x00, } func (this *TokenPairArbRoutes) Equal(that interface{}) bool { @@ -763,6 +773,11 @@ func (m *PoolWeights) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.CosmwasmWeight != 0 { + i = encodeVarintProtorev(dAtA, i, uint64(m.CosmwasmWeight)) + i-- + dAtA[i] = 0x20 + } if m.ConcentratedWeight != 0 { i = encodeVarintProtorev(dAtA, i, uint64(m.ConcentratedWeight)) i-- @@ -931,6 +946,9 @@ func (m *PoolWeights) Size() (n int) { if m.ConcentratedWeight != 0 { n += 1 + sovProtorev(uint64(m.ConcentratedWeight)) } + if m.CosmwasmWeight != 0 { + n += 1 + sovProtorev(uint64(m.CosmwasmWeight)) + } return n } @@ -1634,6 +1652,25 @@ func (m *PoolWeights) Unmarshal(dAtA []byte) error { break } } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CosmwasmWeight", wireType) + } + m.CosmwasmWeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProtorev + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CosmwasmWeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipProtorev(dAtA[iNdEx:]) diff --git a/x/protorev/types/validate.go b/x/protorev/types/validate.go index 65f75253999..ce8df75707b 100644 --- a/x/protorev/types/validate.go +++ b/x/protorev/types/validate.go @@ -49,7 +49,7 @@ func (pw *PoolWeights) Validate() error { return fmt.Errorf("pool weights cannot be nil") } - if pw.BalancerWeight == 0 || pw.StableWeight == 0 || pw.ConcentratedWeight == 0 { + if pw.BalancerWeight == 0 || pw.StableWeight == 0 || pw.ConcentratedWeight == 0 || pw.CosmwasmWeight == 0 { return fmt.Errorf("pool weights cannot be 0") }