From b0e5bda3816d5e17c0a6b6c1865ec421bf38d6e9 Mon Sep 17 00:00:00 2001 From: Shrenuj Bansal Date: Tue, 19 Nov 2024 17:50:11 -0500 Subject: [PATCH 01/12] Add upgrade to set market, perpetual and clob ids to a fixed number Signed-off-by: Shrenuj Bansal --- proto/dydxprotocol/clob/query.proto | 12 + proto/dydxprotocol/perpetuals/query.proto | 11 + proto/dydxprotocol/prices/query.proto | 11 + protocol/app/upgrades/v7.0.3/constants.go | 20 + protocol/app/upgrades/v7.0.3/upgrade.go | 53 ++ .../upgrades/v7.0.3/upgrade_container_test.go | 77 +++ .../upgrades/v7.0/upgrade_container_test.go | 19 +- .../x/clob/keeper/grpc_query_clob_pair.go | 11 + protocol/x/clob/types/clob_keeper.go | 1 + protocol/x/clob/types/query.pb.go | 541 ++++++++++++++---- protocol/x/clob/types/query.pb.gw.go | 65 +++ .../perpetuals/keeper/grpc_query_perpetual.go | 14 + protocol/x/perpetuals/types/query.pb.go | 409 +++++++++++-- protocol/x/perpetuals/types/query.pb.gw.go | 65 +++ protocol/x/perpetuals/types/types.go | 1 + protocol/x/prices/keeper/grpc_query_market.go | 11 + protocol/x/prices/types/query.pb.go | 389 +++++++++++-- protocol/x/prices/types/query.pb.gw.go | 65 +++ protocol/x/prices/types/types.go | 2 + 19 files changed, 1570 insertions(+), 207 deletions(-) create mode 100644 protocol/app/upgrades/v7.0.3/constants.go create mode 100644 protocol/app/upgrades/v7.0.3/upgrade.go create mode 100644 protocol/app/upgrades/v7.0.3/upgrade_container_test.go diff --git a/proto/dydxprotocol/clob/query.proto b/proto/dydxprotocol/clob/query.proto index 9d47ea46419..62dd1995a87 100644 --- a/proto/dydxprotocol/clob/query.proto +++ b/proto/dydxprotocol/clob/query.proto @@ -60,6 +60,12 @@ service Query { rpc StatefulOrder(QueryStatefulOrderRequest) returns (QueryStatefulOrderResponse) {} + // Queries the next clob pair id. + rpc NextClobPairId(QueryNextClobPairIdRequest) + returns (QueryNextClobPairIdResponse) { + option (google.api.http).get = "/dydxprotocol/clob/next_clob_pair_id"; + } + // GRPC Streams // Streams orderbook updates. Updates contain orderbook data @@ -162,6 +168,12 @@ message QueryLiquidationsConfigurationResponse { LiquidationsConfig liquidations_config = 1 [ (gogoproto.nullable) = false ]; } +// QueryNextClobPairIdRequest is a request message for the next clob pair id +message QueryNextClobPairIdRequest {} + +// QueryNextClobPairIdResponse is a response message for the next clob pair id +message QueryNextClobPairIdResponse { uint32 next_clob_pair_id = 1; } + // StreamOrderbookUpdatesRequest is a request message for the // StreamOrderbookUpdates method. message StreamOrderbookUpdatesRequest { diff --git a/proto/dydxprotocol/perpetuals/query.proto b/proto/dydxprotocol/perpetuals/query.proto index 8433b112f8c..b849a707fd5 100644 --- a/proto/dydxprotocol/perpetuals/query.proto +++ b/proto/dydxprotocol/perpetuals/query.proto @@ -44,6 +44,11 @@ service Query { rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { option (google.api.http).get = "/dydxprotocol/perpetuals/params"; } + + // Queries the next perpetual id. + rpc NextPerpetualId(QueryNextPerpetualIdRequest) returns (QueryNextPerpetualIdResponse) { + option (google.api.http).get = "/dydxprotocol/perpetuals/next_perpetual_id"; + } } // Queries a Perpetual by id. @@ -104,4 +109,10 @@ message QueryParamsResponse { Params params = 1 [ (gogoproto.nullable) = false ]; } +// QueryNextPerpetualIdRequest is the request type for the NextPerpetualId RPC +message QueryNextPerpetualIdRequest {} + +// QueryNextPerpetualIdResponse is the response type for the NextPerpetualId RPC +message QueryNextPerpetualIdResponse { uint32 next_perpetual_id = 1; } + // this line is used by starport scaffolding # 3 diff --git a/proto/dydxprotocol/prices/query.proto b/proto/dydxprotocol/prices/query.proto index 624db55dd57..1fc4ef1f07f 100644 --- a/proto/dydxprotocol/prices/query.proto +++ b/proto/dydxprotocol/prices/query.proto @@ -32,6 +32,11 @@ service Query { returns (QueryAllMarketParamsResponse) { option (google.api.http).get = "/dydxprotocol/prices/params/market"; } + + // Queries the next market id. + rpc NextMarketId(QueryNextMarketIdRequest) returns (QueryNextMarketIdResponse) { + option (google.api.http).get = "/dydxprotocol/prices/next_market_id"; + } } // QueryMarketPriceRequest is request type for the Query/Params `MarketPrice` @@ -79,3 +84,9 @@ message QueryAllMarketParamsResponse { repeated MarketParam market_params = 1 [ (gogoproto.nullable) = false ]; cosmos.base.query.v1beta1.PageResponse pagination = 2; } + +// QueryNextMarketIdRequest is request type for the Query/Params `NextMarketId` +message QueryNextMarketIdRequest {} + +// QueryNextMarketIdResponse is response type for the Query/Params `NextMarketId` +message QueryNextMarketIdResponse { uint32 next_market_id = 1; } diff --git a/protocol/app/upgrades/v7.0.3/constants.go b/protocol/app/upgrades/v7.0.3/constants.go new file mode 100644 index 00000000000..6fa36c8276e --- /dev/null +++ b/protocol/app/upgrades/v7.0.3/constants.go @@ -0,0 +1,20 @@ +package v_7_0 + +import ( + store "cosmossdk.io/store/types" + "github.com/dydxprotocol/v4-chain/protocol/app/upgrades" + affiliatetypes "github.com/dydxprotocol/v4-chain/protocol/x/affiliates/types" +) + +const ( + UpgradeName = "v7.0" +) + +var Upgrade = upgrades.Upgrade{ + UpgradeName: UpgradeName, + StoreUpgrades: store.StoreUpgrades{ + Added: []string{ + affiliatetypes.StoreKey, + }, + }, +} diff --git a/protocol/app/upgrades/v7.0.3/upgrade.go b/protocol/app/upgrades/v7.0.3/upgrade.go new file mode 100644 index 00000000000..1aeeb8688db --- /dev/null +++ b/protocol/app/upgrades/v7.0.3/upgrade.go @@ -0,0 +1,53 @@ +package v_7_0_3 + +import ( + "context" + "fmt" + + clobtypes "github.com/dydxprotocol/v4-chain/protocol/x/clob/types" + perptypes "github.com/dydxprotocol/v4-chain/protocol/x/perpetuals/types" + + upgradetypes "cosmossdk.io/x/upgrade/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + "github.com/dydxprotocol/v4-chain/protocol/lib" + pricestypes "github.com/dydxprotocol/v4-chain/protocol/x/prices/types" +) + +const ( + ID_NUM = 200 +) + +// Set market, perpetual, and clob ids to a set number +// This is done so that the ids are consistent for convenience +func setMarketListingBaseIds( + ctx sdk.Context, + pricesKeeper pricestypes.PricesKeeper, + perpetualsKeeper perptypes.PerpetualsKeeper, + clobKeeper clobtypes.ClobKeeper, +) { + // Set all ids to a set number + pricesKeeper.SetNextMarketID(ctx, ID_NUM) + + perpetualsKeeper.SetNextPerpetualID(ctx, ID_NUM) + + clobKeeper.SetNextClobPairID(ctx, ID_NUM) +} + +func CreateUpgradeHandler( + mm *module.Manager, + configurator module.Configurator, + pricesKeeper pricestypes.PricesKeeper, + perpetualsKeeper perptypes.PerpetualsKeeper, + clobKeeper clobtypes.ClobKeeper, +) upgradetypes.UpgradeHandler { + return func(ctx context.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { + sdkCtx := lib.UnwrapSDKContext(ctx, "app/upgrades") + sdkCtx.Logger().Info(fmt.Sprintf("Running %s Upgrade...", UpgradeName)) + + // Set market, perpetual, and clob ids to a set number + setMarketListingBaseIds(sdkCtx, pricesKeeper, perpetualsKeeper, clobKeeper) + + return mm.RunMigrations(ctx, configurator, vm) + } +} diff --git a/protocol/app/upgrades/v7.0.3/upgrade_container_test.go b/protocol/app/upgrades/v7.0.3/upgrade_container_test.go new file mode 100644 index 00000000000..26bce038330 --- /dev/null +++ b/protocol/app/upgrades/v7.0.3/upgrade_container_test.go @@ -0,0 +1,77 @@ +//go:build all || container_test + +package v_7_0_3_test + +import ( + "testing" + + v_7_0_3 "github.com/dydxprotocol/v4-chain/protocol/app/upgrades/v7.0.3" + perptypes "github.com/dydxprotocol/v4-chain/protocol/x/perpetuals/types" + pricetypes "github.com/dydxprotocol/v4-chain/protocol/x/prices/types" + + v_7_0 "github.com/dydxprotocol/v4-chain/protocol/app/upgrades/v7.0" + "github.com/dydxprotocol/v4-chain/protocol/testing/containertest" + "github.com/dydxprotocol/v4-chain/protocol/testutil/constants" + "github.com/stretchr/testify/require" +) + +func TestStateUpgrade(t *testing.T) { + testnet, err := containertest.NewTestnetWithPreupgradeGenesis() + require.NoError(t, err, "failed to create testnet - is docker daemon running?") + err = testnet.Start() + require.NoError(t, err) + defer testnet.MustCleanUp() + node := testnet.Nodes["alice"] + nodeAddress := constants.AliceAccAddress.String() + + preUpgradeSetups(node, t) + preUpgradeChecks(node, t) + + err = containertest.UpgradeTestnet(nodeAddress, t, node, v_7_0.UpgradeName) + require.NoError(t, err) + + postUpgradeChecks(node, t) +} + +func preUpgradeSetups(node *containertest.Node, t *testing.T) {} + +func preUpgradeChecks(node *containertest.Node, t *testing.T) { + // Add test for your upgrade handler logic below +} + +func postUpgradeChecks(node *containertest.Node, t *testing.T) { + // Check that the listing module state has been initialized with the hard cap and default deposit params. + postUpgradeMarketIdsCheck(node, t) +} + +func postUpgradeMarketIdsCheck(node *containertest.Node, t *testing.T) { + // query the next market id + resp, err := containertest.Query( + node, + pricetypes.NewQueryClient, + pricetypes.NextMarketId, + pricetypes.QueryNextMarketIdRequest{}, + ) + require.NoError(t, err) + require.Equal(t, uint32(v_7_0_3.ID_NUM), resp.NextMarketId) + + // query the next perpetual id + resp, err = containertest.Query( + node, + perptypes.NewQueryClient, + perptypes.NextPerpetualId, + perptypes.QueryNextPerpetualIdRequest{}, + ) + require.NoError(t, err) + require.Equal(t, uint32(v_7_0_3.ID_NUM), resp.NextPerpetualId) + + // query the next clob pair id + resp, err = containertest.Query( + node, + clobtypes.NewQueryClient, + clobtypes.NextClobPairId, + clobtypes.QueryNextClobPairIdRequest{}, + ) + require.NoError(t, err) + require.Equal(t, uint32(v_7_0_3.ID_NUM), resp.NextClobPairId) +} diff --git a/protocol/app/upgrades/v7.0/upgrade_container_test.go b/protocol/app/upgrades/v7.0/upgrade_container_test.go index d65a77d5684..cefaf80a757 100644 --- a/protocol/app/upgrades/v7.0/upgrade_container_test.go +++ b/protocol/app/upgrades/v7.0/upgrade_container_test.go @@ -1,6 +1,6 @@ //go:build all || container_test -package v_7_0_test +package v_7_0_3_test import ( "math/big" @@ -11,7 +11,6 @@ import ( "github.com/cosmos/gogoproto/proto" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - v_7_0 "github.com/dydxprotocol/v4-chain/protocol/app/upgrades/v7.0" "github.com/dydxprotocol/v4-chain/protocol/dtypes" "github.com/dydxprotocol/v4-chain/protocol/testing/containertest" "github.com/dydxprotocol/v4-chain/protocol/testutil/constants" @@ -38,7 +37,7 @@ func TestStateUpgrade(t *testing.T) { preUpgradeSetups(node, t) preUpgradeChecks(node, t) - err = containertest.UpgradeTestnet(nodeAddress, t, node, v_7_0.UpgradeName) + err = containertest.UpgradeTestnet(nodeAddress, t, node, v_7_0_3.UpgradeName) require.NoError(t, err) postUpgradeChecks(node, t) @@ -51,18 +50,12 @@ func preUpgradeChecks(node *containertest.Node, t *testing.T) { } func postUpgradeChecks(node *containertest.Node, t *testing.T) { - // Check that vault quoting params are successfully migrated to vault params. - postUpgradeVaultParamsCheck(node, t) - // Check that vault shares are successfully migrated to megavault shares. - postUpgradeMegavaultSharesCheck(node, t) - // Check that megavault module account is successfully initialized. - postUpgradeMegavaultModuleAccCheck(node, t) - - // Check that the affiliates module has been initialized with the default tiers. - postUpgradeAffiliatesModuleTiersCheck(node, t) // Check that the listing module state has been initialized with the hard cap and default deposit params. - postUpgradeListingModuleStateCheck(node, t) + postUpgradeMarketIdsCheck(node, t) +} + +func postUpgradeMarketIdsCheck(node *containertest.Node, t *testing.T) { } func postUpgradeVaultParamsCheck(node *containertest.Node, t *testing.T) { diff --git a/protocol/x/clob/keeper/grpc_query_clob_pair.go b/protocol/x/clob/keeper/grpc_query_clob_pair.go index f1597111aac..ed9bf4d8909 100644 --- a/protocol/x/clob/keeper/grpc_query_clob_pair.go +++ b/protocol/x/clob/keeper/grpc_query_clob_pair.go @@ -58,3 +58,14 @@ func (k Keeper) ClobPair(c context.Context, req *types.QueryGetClobPairRequest) return &types.QueryClobPairResponse{ClobPair: val}, nil } + +func (k Keeper) NextClobPairId( + c context.Context, + request *types.QueryNextClobPairIdRequest, +) (*types.QueryNextClobPairIdResponse, error) { + ctx := lib.UnwrapSDKContext(c, types.ModuleName) + nextId := k.GetNextClobPairID(ctx) + return &types.QueryNextClobPairIdResponse{ + NextClobPairId: nextId, + }, nil +} diff --git a/protocol/x/clob/types/clob_keeper.go b/protocol/x/clob/types/clob_keeper.go index f5bbe110e05..770eaf491f5 100644 --- a/protocol/x/clob/types/clob_keeper.go +++ b/protocol/x/clob/types/clob_keeper.go @@ -152,4 +152,5 @@ type ClobKeeper interface { ResetAllDeliveredOrderIds(ctx sdk.Context) // Migrate order expiration state (for upgrading to 5.2 only) UnsafeMigrateOrderExpirationState(ctx sdk.Context) + SetNextClobPairID(ctx sdk.Context, nextID uint32) } diff --git a/protocol/x/clob/types/query.pb.go b/protocol/x/clob/types/query.pb.go index 4f4d01af143..5d6f5df715c 100644 --- a/protocol/x/clob/types/query.pb.go +++ b/protocol/x/clob/types/query.pb.go @@ -766,6 +766,88 @@ func (m *QueryLiquidationsConfigurationResponse) GetLiquidationsConfig() Liquida return LiquidationsConfig{} } +// QueryNextClobPairIdRequest is a request message for the next clob pair id +type QueryNextClobPairIdRequest struct { +} + +func (m *QueryNextClobPairIdRequest) Reset() { *m = QueryNextClobPairIdRequest{} } +func (m *QueryNextClobPairIdRequest) String() string { return proto.CompactTextString(m) } +func (*QueryNextClobPairIdRequest) ProtoMessage() {} +func (*QueryNextClobPairIdRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_3365c195b25c5bc0, []int{14} +} +func (m *QueryNextClobPairIdRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryNextClobPairIdRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryNextClobPairIdRequest.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 *QueryNextClobPairIdRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryNextClobPairIdRequest.Merge(m, src) +} +func (m *QueryNextClobPairIdRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryNextClobPairIdRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryNextClobPairIdRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryNextClobPairIdRequest proto.InternalMessageInfo + +// QueryNextClobPairIdResponse is a response message for the next clob pair id +type QueryNextClobPairIdResponse struct { + NextClobPairId uint32 `protobuf:"varint,1,opt,name=next_clob_pair_id,json=nextClobPairId,proto3" json:"next_clob_pair_id,omitempty"` +} + +func (m *QueryNextClobPairIdResponse) Reset() { *m = QueryNextClobPairIdResponse{} } +func (m *QueryNextClobPairIdResponse) String() string { return proto.CompactTextString(m) } +func (*QueryNextClobPairIdResponse) ProtoMessage() {} +func (*QueryNextClobPairIdResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_3365c195b25c5bc0, []int{15} +} +func (m *QueryNextClobPairIdResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryNextClobPairIdResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryNextClobPairIdResponse.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 *QueryNextClobPairIdResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryNextClobPairIdResponse.Merge(m, src) +} +func (m *QueryNextClobPairIdResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryNextClobPairIdResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryNextClobPairIdResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryNextClobPairIdResponse proto.InternalMessageInfo + +func (m *QueryNextClobPairIdResponse) GetNextClobPairId() uint32 { + if m != nil { + return m.NextClobPairId + } + return 0 +} + // StreamOrderbookUpdatesRequest is a request message for the // StreamOrderbookUpdates method. type StreamOrderbookUpdatesRequest struct { @@ -779,7 +861,7 @@ func (m *StreamOrderbookUpdatesRequest) Reset() { *m = StreamOrderbookUp func (m *StreamOrderbookUpdatesRequest) String() string { return proto.CompactTextString(m) } func (*StreamOrderbookUpdatesRequest) ProtoMessage() {} func (*StreamOrderbookUpdatesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3365c195b25c5bc0, []int{14} + return fileDescriptor_3365c195b25c5bc0, []int{16} } func (m *StreamOrderbookUpdatesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -833,7 +915,7 @@ func (m *StreamOrderbookUpdatesResponse) Reset() { *m = StreamOrderbookU func (m *StreamOrderbookUpdatesResponse) String() string { return proto.CompactTextString(m) } func (*StreamOrderbookUpdatesResponse) ProtoMessage() {} func (*StreamOrderbookUpdatesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3365c195b25c5bc0, []int{15} + return fileDescriptor_3365c195b25c5bc0, []int{17} } func (m *StreamOrderbookUpdatesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -892,7 +974,7 @@ func (m *StreamUpdate) Reset() { *m = StreamUpdate{} } func (m *StreamUpdate) String() string { return proto.CompactTextString(m) } func (*StreamUpdate) ProtoMessage() {} func (*StreamUpdate) Descriptor() ([]byte, []int) { - return fileDescriptor_3365c195b25c5bc0, []int{16} + return fileDescriptor_3365c195b25c5bc0, []int{18} } func (m *StreamUpdate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1021,7 +1103,7 @@ func (m *StreamOrderbookUpdate) Reset() { *m = StreamOrderbookUpdate{} } func (m *StreamOrderbookUpdate) String() string { return proto.CompactTextString(m) } func (*StreamOrderbookUpdate) ProtoMessage() {} func (*StreamOrderbookUpdate) Descriptor() ([]byte, []int) { - return fileDescriptor_3365c195b25c5bc0, []int{17} + return fileDescriptor_3365c195b25c5bc0, []int{19} } func (m *StreamOrderbookUpdate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1081,7 +1163,7 @@ func (m *StreamOrderbookFill) Reset() { *m = StreamOrderbookFill{} } func (m *StreamOrderbookFill) String() string { return proto.CompactTextString(m) } func (*StreamOrderbookFill) ProtoMessage() {} func (*StreamOrderbookFill) Descriptor() ([]byte, []int) { - return fileDescriptor_3365c195b25c5bc0, []int{18} + return fileDescriptor_3365c195b25c5bc0, []int{20} } func (m *StreamOrderbookFill) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1152,7 +1234,7 @@ func (m *StreamTakerOrder) Reset() { *m = StreamTakerOrder{} } func (m *StreamTakerOrder) String() string { return proto.CompactTextString(m) } func (*StreamTakerOrder) ProtoMessage() {} func (*StreamTakerOrder) Descriptor() ([]byte, []int) { - return fileDescriptor_3365c195b25c5bc0, []int{19} + return fileDescriptor_3365c195b25c5bc0, []int{21} } func (m *StreamTakerOrder) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1255,7 +1337,7 @@ func (m *StreamTakerOrderStatus) Reset() { *m = StreamTakerOrderStatus{} func (m *StreamTakerOrderStatus) String() string { return proto.CompactTextString(m) } func (*StreamTakerOrderStatus) ProtoMessage() {} func (*StreamTakerOrderStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_3365c195b25c5bc0, []int{20} + return fileDescriptor_3365c195b25c5bc0, []int{22} } func (m *StreamTakerOrderStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1321,6 +1403,8 @@ func init() { proto.RegisterType((*QueryStatefulOrderResponse)(nil), "dydxprotocol.clob.QueryStatefulOrderResponse") proto.RegisterType((*QueryLiquidationsConfigurationRequest)(nil), "dydxprotocol.clob.QueryLiquidationsConfigurationRequest") proto.RegisterType((*QueryLiquidationsConfigurationResponse)(nil), "dydxprotocol.clob.QueryLiquidationsConfigurationResponse") + proto.RegisterType((*QueryNextClobPairIdRequest)(nil), "dydxprotocol.clob.QueryNextClobPairIdRequest") + proto.RegisterType((*QueryNextClobPairIdResponse)(nil), "dydxprotocol.clob.QueryNextClobPairIdResponse") proto.RegisterType((*StreamOrderbookUpdatesRequest)(nil), "dydxprotocol.clob.StreamOrderbookUpdatesRequest") proto.RegisterType((*StreamOrderbookUpdatesResponse)(nil), "dydxprotocol.clob.StreamOrderbookUpdatesResponse") proto.RegisterType((*StreamUpdate)(nil), "dydxprotocol.clob.StreamUpdate") @@ -1333,111 +1417,115 @@ func init() { func init() { proto.RegisterFile("dydxprotocol/clob/query.proto", fileDescriptor_3365c195b25c5bc0) } var fileDescriptor_3365c195b25c5bc0 = []byte{ - // 1661 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x58, 0xc1, 0x4f, 0xdc, 0x46, - 0x17, 0x5f, 0xb3, 0x84, 0xc0, 0xdb, 0x40, 0x60, 0x08, 0xc9, 0x66, 0x21, 0x0b, 0x71, 0xbe, 0x90, - 0x85, 0x7c, 0x59, 0x03, 0x89, 0xa2, 0x7c, 0xe1, 0x53, 0x3e, 0x01, 0xdf, 0x47, 0x88, 0x14, 0xbe, - 0x10, 0x43, 0x12, 0xd4, 0x46, 0xb2, 0xbc, 0xf6, 0xb0, 0x58, 0xd8, 0x9e, 0xc5, 0x1e, 0xaf, 0x40, - 0x55, 0x55, 0xa9, 0x87, 0x5c, 0xda, 0x4a, 0x91, 0x7a, 0xe8, 0xa1, 0x52, 0x2f, 0x3d, 0xf5, 0x50, - 0xa9, 0x97, 0x1e, 0xab, 0xb6, 0xb7, 0x1c, 0x23, 0xf5, 0xd2, 0x43, 0x55, 0x55, 0x49, 0xcf, 0xfd, - 0x1b, 0x2a, 0xcf, 0x8c, 0x77, 0xbd, 0xbb, 0xf6, 0x42, 0xb8, 0x80, 0xfd, 0xe6, 0xbd, 0x37, 0xbf, - 0xf7, 0xde, 0x6f, 0xde, 0x3c, 0x2f, 0x5c, 0x32, 0x0f, 0xcd, 0x83, 0x9a, 0x47, 0x28, 0x31, 0x88, -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66, 0x61, 0xfe, 0x1d, - 0x2c, 0x38, 0x80, 0x39, 0x69, 0x79, 0xe3, 0xd5, 0x9b, 0xa2, 0xf4, 0xfa, 0x4d, 0x51, 0xfa, 0xe3, - 0x4d, 0x51, 0x7a, 0xf9, 0xb6, 0x98, 0x79, 0xfd, 0xb6, 0x98, 0xf9, 0xf5, 0x6d, 0x31, 0xf3, 0xde, - 0xed, 0xaa, 0x45, 0x77, 0x83, 0x4a, 0xd9, 0x20, 0x4e, 0x6b, 0xf2, 0xea, 0xb7, 0x6e, 0xb0, 0x0b, - 0x5f, 0x69, 0x48, 0x0e, 0x78, 0x42, 0xe9, 0x61, 0x0d, 0xfb, 0x95, 0x3e, 0x26, 0xbe, 0xf9, 0x77, - 0x00, 0x00, 0x00, 0xff, 0xff, 0xa1, 0x46, 0x6b, 0x53, 0x00, 0x14, 0x00, 0x00, + // 1723 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x58, 0xcf, 0x4f, 0xdc, 0xda, + 0x15, 0x1e, 0x33, 0x84, 0x07, 0x67, 0x02, 0x0f, 0x2e, 0x8f, 0xbc, 0x79, 0x03, 0x19, 0x88, 0xdf, + 0x0b, 0x99, 0xe1, 0xbd, 0x8c, 0x81, 0xf7, 0xf4, 0x94, 0x86, 0x2a, 0x15, 0xd0, 0x12, 0x90, 0x42, + 0x42, 0x0c, 0x49, 0x50, 0x1b, 0xc9, 0xf2, 0xd8, 0x97, 0xc1, 0xc2, 0xf6, 0x1d, 0xec, 0xeb, 0x11, + 0xa8, 0xaa, 0x2a, 0x75, 0x91, 0x4d, 0x5b, 0x29, 0x52, 0x17, 0x5d, 0x54, 0x5d, 0x75, 0xd5, 0x45, + 0xa5, 0x6e, 0xba, 0xec, 0xaf, 0x5d, 0x96, 0x91, 0xba, 0xe9, 0xa2, 0xaa, 0xaa, 0xa4, 0xeb, 0xfe, + 0x0d, 0x95, 0xef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xe9, 0x7e, 0xc0, 0x5a, 0xd4, 0x81, 0x85, 0xbd, 0x47, 0x61, 0x83, 0xda, 0x64, 0x2d, + 0x23, 0xf0, 0xe2, 0x75, 0x95, 0x7f, 0x23, 0x41, 0xfd, 0x12, 0xca, 0x22, 0x4b, 0x2e, 0x94, 0xf3, + 0xfa, 0x9e, 0xe0, 0x81, 0x92, 0x91, 0xb6, 0x41, 0xae, 0x45, 0x7a, 0x66, 0x70, 0x96, 0x8e, 0x5c, + 0x87, 0x3b, 0x0c, 0xdc, 0x46, 0x48, 0x1a, 0x55, 0xa7, 0x38, 0x3f, 0x90, 0x5f, 0x4b, 0x22, 0xea, + 0x81, 0xba, 0x22, 0x8e, 0x13, 0xf8, 0x34, 0xe7, 0x4e, 0x10, 0x61, 0x34, 0x32, 0xc2, 0x18, 0xe0, + 0x58, 0x44, 0xc1, 0xc9, 0xdd, 0xa7, 0x22, 0x1f, 0xc2, 0x67, 0x0c, 0xd8, 0x3e, 0xd5, 0x29, 0x3e, + 0x0a, 0xec, 0x27, 0xe1, 0x3d, 0x10, 0x9d, 0xab, 0x35, 0x18, 0x65, 0xf7, 0x42, 0x54, 0xf3, 0xd2, + 0x6a, 0x25, 0x63, 0x6b, 0x66, 0xb2, 0x63, 0x46, 0x5c, 0x22, 0xfc, 0x55, 0xfe, 0x93, 0x04, 0x95, + 0x2c, 0xd7, 0x22, 0xca, 0x43, 0xf8, 0x98, 0xfb, 0x6e, 0xdb, 0xba, 0x81, 0x1d, 0xec, 0x52, 0xb1, + 0x45, 0x3d, 0x63, 0x8b, 0x47, 0xc4, 0x6d, 0x1d, 0x60, 0xcf, 0x61, 0x2e, 0xf6, 0x22, 0x03, 0xb1, + 0xe3, 0x04, 0x49, 0x48, 0xd1, 0x3c, 0x94, 0x8e, 0x2c, 0xdb, 0xd6, 0x74, 0x27, 0xec, 0xe9, 0x8c, + 0x93, 0xc3, 0x2a, 0x84, 0xa2, 0x75, 0x26, 0x41, 0x73, 0x30, 0x46, 0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0xcb, 0x1d, 0xfb, 0xd0, 0xbd, 0x3c, 0x04, 0x17, 0xcd, 0x94, 0x95, 0xef, 0x5c, 0xc1, 0x52, + 0x20, 0x6f, 0x30, 0xe4, 0x35, 0xb4, 0xa8, 0x5c, 0xea, 0xd7, 0x19, 0xe4, 0xc2, 0x78, 0x62, 0x32, + 0x47, 0x5f, 0xe5, 0xed, 0x9d, 0xf5, 0x6d, 0x50, 0xb9, 0x7b, 0x49, 0x6d, 0x81, 0xae, 0x80, 0x7e, + 0x2b, 0xc1, 0x44, 0x72, 0x06, 0x45, 0xb9, 0x3e, 0x32, 0x27, 0xd9, 0x4a, 0xe3, 0xb2, 0xea, 0x62, + 0xcf, 0xaf, 0x58, 0x46, 0x16, 0xd1, 0x17, 0x19, 0x19, 0x49, 0xcd, 0xbc, 0xe8, 0xa7, 0x51, 0xc7, + 0xef, 0x1f, 0x25, 0xd1, 0xf2, 0x65, 0xc7, 0xb2, 0x68, 0x0e, 0xae, 0xac, 0x7c, 0x80, 0x05, 0x07, + 0xbb, 0x2c, 0x6d, 0xec, 0xbd, 0x79, 0x57, 0x95, 0xde, 0xbe, 0xab, 0x4a, 0xff, 0x79, 0x57, 0x95, + 0x5e, 0xbf, 0xaf, 0x16, 0xde, 0xbe, 0xaf, 0x16, 0xfe, 0xf9, 0xbe, 0x5a, 0xf8, 0xe1, 0xb7, 0x2d, + 0x8b, 0x1e, 0x07, 0xcd, 0x86, 0x41, 0x9c, 0x64, 0x28, 0x9d, 0x6f, 0xee, 0xb2, 0x81, 0x44, 0xe9, + 0x4a, 0xce, 0x78, 0x78, 0xf4, 0xbc, 0x8d, 0xfd, 0xe6, 0x08, 0x13, 0x7f, 0xfd, 0xff, 0x00, 0x00, + 0x00, 0xff, 0xff, 0x73, 0xde, 0x4d, 0xf8, 0x08, 0x15, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1466,6 +1554,8 @@ type QueryClient interface { LiquidationsConfiguration(ctx context.Context, in *QueryLiquidationsConfigurationRequest, opts ...grpc.CallOption) (*QueryLiquidationsConfigurationResponse, error) // Queries the stateful order for a given order id. StatefulOrder(ctx context.Context, in *QueryStatefulOrderRequest, opts ...grpc.CallOption) (*QueryStatefulOrderResponse, error) + // Queries the next clob pair id. + NextClobPairId(ctx context.Context, in *QueryNextClobPairIdRequest, opts ...grpc.CallOption) (*QueryNextClobPairIdResponse, error) // Streams orderbook updates. Updates contain orderbook data // such as order placements, updates, and fills. StreamOrderbookUpdates(ctx context.Context, in *StreamOrderbookUpdatesRequest, opts ...grpc.CallOption) (Query_StreamOrderbookUpdatesClient, error) @@ -1542,6 +1632,15 @@ func (c *queryClient) StatefulOrder(ctx context.Context, in *QueryStatefulOrderR return out, nil } +func (c *queryClient) NextClobPairId(ctx context.Context, in *QueryNextClobPairIdRequest, opts ...grpc.CallOption) (*QueryNextClobPairIdResponse, error) { + out := new(QueryNextClobPairIdResponse) + err := c.cc.Invoke(ctx, "/dydxprotocol.clob.Query/NextClobPairId", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) StreamOrderbookUpdates(ctx context.Context, in *StreamOrderbookUpdatesRequest, opts ...grpc.CallOption) (Query_StreamOrderbookUpdatesClient, error) { stream, err := c.cc.NewStream(ctx, &_Query_serviceDesc.Streams[0], "/dydxprotocol.clob.Query/StreamOrderbookUpdates", opts...) if err != nil { @@ -1590,6 +1689,8 @@ type QueryServer interface { LiquidationsConfiguration(context.Context, *QueryLiquidationsConfigurationRequest) (*QueryLiquidationsConfigurationResponse, error) // Queries the stateful order for a given order id. StatefulOrder(context.Context, *QueryStatefulOrderRequest) (*QueryStatefulOrderResponse, error) + // Queries the next clob pair id. + NextClobPairId(context.Context, *QueryNextClobPairIdRequest) (*QueryNextClobPairIdResponse, error) // Streams orderbook updates. Updates contain orderbook data // such as order placements, updates, and fills. StreamOrderbookUpdates(*StreamOrderbookUpdatesRequest, Query_StreamOrderbookUpdatesServer) error @@ -1620,6 +1721,9 @@ func (*UnimplementedQueryServer) LiquidationsConfiguration(ctx context.Context, func (*UnimplementedQueryServer) StatefulOrder(ctx context.Context, req *QueryStatefulOrderRequest) (*QueryStatefulOrderResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method StatefulOrder not implemented") } +func (*UnimplementedQueryServer) NextClobPairId(ctx context.Context, req *QueryNextClobPairIdRequest) (*QueryNextClobPairIdResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method NextClobPairId not implemented") +} func (*UnimplementedQueryServer) StreamOrderbookUpdates(req *StreamOrderbookUpdatesRequest, srv Query_StreamOrderbookUpdatesServer) error { return status.Errorf(codes.Unimplemented, "method StreamOrderbookUpdates not implemented") } @@ -1754,6 +1858,24 @@ func _Query_StatefulOrder_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } +func _Query_NextClobPairId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryNextClobPairIdRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).NextClobPairId(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/dydxprotocol.clob.Query/NextClobPairId", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).NextClobPairId(ctx, req.(*QueryNextClobPairIdRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_StreamOrderbookUpdates_Handler(srv interface{}, stream grpc.ServerStream) error { m := new(StreamOrderbookUpdatesRequest) if err := stream.RecvMsg(m); err != nil { @@ -1807,6 +1929,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "StatefulOrder", Handler: _Query_StatefulOrder_Handler, }, + { + MethodName: "NextClobPairId", + Handler: _Query_NextClobPairId_Handler, + }, }, Streams: []grpc.StreamDesc{ { @@ -2335,6 +2461,57 @@ func (m *QueryLiquidationsConfigurationResponse) MarshalToSizedBuffer(dAtA []byt return len(dAtA) - i, nil } +func (m *QueryNextClobPairIdRequest) 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 *QueryNextClobPairIdRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryNextClobPairIdRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryNextClobPairIdResponse) 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 *QueryNextClobPairIdResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryNextClobPairIdResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.NextClobPairId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.NextClobPairId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func (m *StreamOrderbookUpdatesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2995,6 +3172,27 @@ func (m *QueryLiquidationsConfigurationResponse) Size() (n int) { return n } +func (m *QueryNextClobPairIdRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryNextClobPairIdResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.NextClobPairId != 0 { + n += 1 + sovQuery(uint64(m.NextClobPairId)) + } + return n +} + func (m *StreamOrderbookUpdatesRequest) Size() (n int) { if m == nil { return 0 @@ -4473,6 +4671,125 @@ func (m *QueryLiquidationsConfigurationResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryNextClobPairIdRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryNextClobPairIdRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryNextClobPairIdRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryNextClobPairIdResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryNextClobPairIdResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryNextClobPairIdResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NextClobPairId", wireType) + } + m.NextClobPairId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NextClobPairId |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *StreamOrderbookUpdatesRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/protocol/x/clob/types/query.pb.gw.go b/protocol/x/clob/types/query.pb.gw.go index b11d7c9bc3f..a7f5cf7e958 100644 --- a/protocol/x/clob/types/query.pb.gw.go +++ b/protocol/x/clob/types/query.pb.gw.go @@ -211,6 +211,24 @@ func local_request_Query_LiquidationsConfiguration_0(ctx context.Context, marsha } +func request_Query_NextClobPairId_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryNextClobPairIdRequest + var metadata runtime.ServerMetadata + + msg, err := client.NextClobPairId(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_NextClobPairId_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryNextClobPairIdRequest + var metadata runtime.ServerMetadata + + msg, err := server.NextClobPairId(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -355,6 +373,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_NextClobPairId_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_NextClobPairId_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_NextClobPairId_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -516,6 +557,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_NextClobPairId_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_NextClobPairId_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_NextClobPairId_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -531,6 +592,8 @@ var ( pattern_Query_BlockRateLimitConfiguration_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"dydxprotocol", "clob", "block_rate"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_LiquidationsConfiguration_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"dydxprotocol", "clob", "liquidations_config"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_NextClobPairId_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"dydxprotocol", "clob", "next_clob_pair_id"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -545,4 +608,6 @@ var ( forward_Query_BlockRateLimitConfiguration_0 = runtime.ForwardResponseMessage forward_Query_LiquidationsConfiguration_0 = runtime.ForwardResponseMessage + + forward_Query_NextClobPairId_0 = runtime.ForwardResponseMessage ) diff --git a/protocol/x/perpetuals/keeper/grpc_query_perpetual.go b/protocol/x/perpetuals/keeper/grpc_query_perpetual.go index 124660d6ff1..87e381f4b6d 100644 --- a/protocol/x/perpetuals/keeper/grpc_query_perpetual.go +++ b/protocol/x/perpetuals/keeper/grpc_query_perpetual.go @@ -71,3 +71,17 @@ func (k Keeper) Perpetual(c context.Context, req *types.QueryPerpetualRequest) ( return &types.QueryPerpetualResponse{Perpetual: val}, nil } + +func (k Keeper) NextPerpetualId( + c context.Context, + req *types.QueryNextPerpetualIdRequest, +) ( + *types.QueryNextPerpetualIdResponse, + error, +) { + ctx := lib.UnwrapSDKContext(c, types.ModuleName) + + return &types.QueryNextPerpetualIdResponse{ + NextPerpetualId: k.GetNextPerpetualID(ctx), + }, nil +} diff --git a/protocol/x/perpetuals/types/query.pb.go b/protocol/x/perpetuals/types/query.pb.go index b2e55e80e7e..831f4f58c1d 100644 --- a/protocol/x/perpetuals/types/query.pb.go +++ b/protocol/x/perpetuals/types/query.pb.go @@ -566,6 +566,88 @@ func (m *QueryParamsResponse) GetParams() Params { return Params{} } +// QueryNextPerpetualIdRequest is the request type for the NextPerpetualId RPC +type QueryNextPerpetualIdRequest struct { +} + +func (m *QueryNextPerpetualIdRequest) Reset() { *m = QueryNextPerpetualIdRequest{} } +func (m *QueryNextPerpetualIdRequest) String() string { return proto.CompactTextString(m) } +func (*QueryNextPerpetualIdRequest) ProtoMessage() {} +func (*QueryNextPerpetualIdRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_13b6d29860ccef6b, []int{12} +} +func (m *QueryNextPerpetualIdRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryNextPerpetualIdRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryNextPerpetualIdRequest.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 *QueryNextPerpetualIdRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryNextPerpetualIdRequest.Merge(m, src) +} +func (m *QueryNextPerpetualIdRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryNextPerpetualIdRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryNextPerpetualIdRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryNextPerpetualIdRequest proto.InternalMessageInfo + +// QueryNextPerpetualIdResponse is the response type for the NextPerpetualId RPC +type QueryNextPerpetualIdResponse struct { + NextPerpetualId uint32 `protobuf:"varint,1,opt,name=next_perpetual_id,json=nextPerpetualId,proto3" json:"next_perpetual_id,omitempty"` +} + +func (m *QueryNextPerpetualIdResponse) Reset() { *m = QueryNextPerpetualIdResponse{} } +func (m *QueryNextPerpetualIdResponse) String() string { return proto.CompactTextString(m) } +func (*QueryNextPerpetualIdResponse) ProtoMessage() {} +func (*QueryNextPerpetualIdResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_13b6d29860ccef6b, []int{13} +} +func (m *QueryNextPerpetualIdResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryNextPerpetualIdResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryNextPerpetualIdResponse.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 *QueryNextPerpetualIdResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryNextPerpetualIdResponse.Merge(m, src) +} +func (m *QueryNextPerpetualIdResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryNextPerpetualIdResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryNextPerpetualIdResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryNextPerpetualIdResponse proto.InternalMessageInfo + +func (m *QueryNextPerpetualIdResponse) GetNextPerpetualId() uint32 { + if m != nil { + return m.NextPerpetualId + } + return 0 +} + func init() { proto.RegisterType((*QueryPerpetualRequest)(nil), "dydxprotocol.perpetuals.QueryPerpetualRequest") proto.RegisterType((*QueryPerpetualResponse)(nil), "dydxprotocol.perpetuals.QueryPerpetualResponse") @@ -579,6 +661,8 @@ func init() { proto.RegisterType((*QueryPremiumSamplesResponse)(nil), "dydxprotocol.perpetuals.QueryPremiumSamplesResponse") proto.RegisterType((*QueryParamsRequest)(nil), "dydxprotocol.perpetuals.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "dydxprotocol.perpetuals.QueryParamsResponse") + proto.RegisterType((*QueryNextPerpetualIdRequest)(nil), "dydxprotocol.perpetuals.QueryNextPerpetualIdRequest") + proto.RegisterType((*QueryNextPerpetualIdResponse)(nil), "dydxprotocol.perpetuals.QueryNextPerpetualIdResponse") } func init() { @@ -586,52 +670,56 @@ func init() { } var fileDescriptor_13b6d29860ccef6b = []byte{ - // 716 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0xbf, 0x53, 0x13, 0x41, - 0x14, 0xc7, 0xb3, 0x51, 0x71, 0x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bf, 0x21, 0x18, 0x49, 0xce, 0x1c, 0x9e, - 0xef, 0xf1, 0x49, 0x8f, 0xce, 0xae, 0x51, 0x1a, 0xa4, 0x44, 0x93, 0xda, 0x92, 0x74, 0x16, 0xcf, - 0x64, 0x9b, 0x9b, 0x9c, 0x78, 0xbc, 0x83, 0xa0, 0x90, 0x1e, 0x47, 0xbc, 0xd0, 0x97, 0x6c, 0x7a, - 0xb4, 0x8d, 0xc5, 0xc1, 0x8a, 0xfa, 0xf6, 0xf5, 0xd0, 0x42, 0xc0, 0x1f, 0x11, 0x0c, 0xa9, 0xd1, - 0xc3, 0xf7, 0x7a, 0x48, 0x26, 0xe7, 0xdd, 0xb8, 0xdf, 0x5f, 0xb2, 0xe6, 0x2a, 0x4a, 0xae, 0x5b, - 0x78, 0x8a, 0x1c, 0xff, 0xaf, 0x63, 0x69, 0x6d, 0x77, 0xdf, 0x44, 0x7b, 0xfb, 0x26, 0xfa, 0xb3, - 0x6f, 0xa2, 0x4f, 0x07, 0x66, 0x6e, 0xef, 0xc0, 0xcc, 0xfd, 0x3a, 0x30, 0x73, 0x6f, 0x9e, 0xb8, - 0x4c, 0x6c, 0x34, 0x2a, 0x76, 0x95, 0xfb, 0xe9, 0x26, 0x5b, 0x8b, 0x0f, 0xaa, 0x1b, 0x0e, 0xab, - 0x93, 0xf6, 0xc9, 0x76, 0xb2, 0xb1, 0x68, 0x06, 0x34, 0xaa, 0x0c, 0xc9, 0xe0, 0xc2, 0xff, 0x00, - 0x00, 0x00, 0xff, 0xff, 0xd7, 0x45, 0x0d, 0x89, 0x94, 0x09, 0x00, 0x00, + // 780 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0xbf, 0x6f, 0xd3, 0x4c, + 0x1c, 0xc6, 0xe3, 0xbc, 0x2f, 0x95, 0xfa, 0xa5, 0x4d, 0xd4, 0xa3, 0x40, 0x31, 0x6d, 0x0a, 0xa6, + 0x34, 0x25, 0x14, 0x1f, 0x4d, 0x0b, 0x2c, 0x30, 0xd0, 0xa1, 0x08, 0x84, 0x50, 0x09, 0xa5, 0x03, + 0x4b, 0x70, 0x92, 0x93, 0x6b, 0xc9, 0xf1, 0xb9, 0xf1, 0xa5, 0x4a, 0x84, 0x58, 0x98, 0x19, 0x90, + 0x98, 0x99, 0x80, 0xb1, 0x0b, 0x03, 0x33, 0x63, 0xc7, 0x4a, 0x2c, 0x4c, 0x08, 0xb5, 0xfc, 0x21, + 0x28, 0x77, 0x67, 0x27, 0x4e, 0xed, 0x3a, 0xa9, 0xba, 0x45, 0xfe, 0xfe, 0x78, 0x3e, 0xf7, 0xd8, + 0xf7, 0x28, 0x70, 0xad, 0xd6, 0xae, 0xb5, 0xdc, 0x06, 0x65, 0xb4, 0x4a, 0x6d, 0xec, 0x92, 0x86, + 0x4b, 0x58, 0xd3, 0xb0, 0x3d, 0xbc, 0xdd, 0x24, 0x8d, 0xb6, 0xce, 0x2b, 0xe8, 0x62, 0x6f, 0x93, + 0xde, 0x6d, 0x52, 0x27, 0x4d, 0x6a, 0x52, 0x5e, 0xc0, 0x9d, 0x5f, 0xa2, 0x5d, 0x9d, 0x36, 0x29, + 0x35, 0x6d, 0x82, 0x0d, 0xd7, 0xc2, 0x86, 0xe3, 0x50, 0x66, 0x30, 0x8b, 0x3a, 0x9e, 0xac, 0x16, + 0xaa, 0xd4, 0xab, 0x53, 0x0f, 0x57, 0x0c, 0x8f, 0x08, 0x15, 0xbc, 0xb3, 0x54, 0x21, 0xcc, 0x58, + 0xc2, 0xae, 0x61, 0x5a, 0x0e, 0x6f, 0x96, 0xbd, 0x73, 0x71, 0x74, 0xae, 0xd1, 0x30, 0xea, 0xfe, + 0xc6, 0x7c, 0x6c, 0x97, 0xff, 0x53, 0x34, 0x6a, 0x79, 0x38, 0xff, 0xbc, 0x23, 0xb8, 0xee, 0x3f, + 0x2f, 0x91, 0xed, 0x26, 0xf1, 0x18, 0x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 0xca, 0x08, 0x2f, 0x2e, 0xff, 0x0b, + 0x00, 0x00, 0xff, 0xff, 0x50, 0x66, 0xce, 0xd7, 0xb4, 0x0a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -658,6 +746,8 @@ type QueryClient interface { PremiumSamples(ctx context.Context, in *QueryPremiumSamplesRequest, opts ...grpc.CallOption) (*QueryPremiumSamplesResponse, error) // Queries the perpetual params. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // Queries the next perpetual id. + NextPerpetualId(ctx context.Context, in *QueryNextPerpetualIdRequest, opts ...grpc.CallOption) (*QueryNextPerpetualIdResponse, error) } type queryClient struct { @@ -722,6 +812,15 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . return out, nil } +func (c *queryClient) NextPerpetualId(ctx context.Context, in *QueryNextPerpetualIdRequest, opts ...grpc.CallOption) (*QueryNextPerpetualIdResponse, error) { + out := new(QueryNextPerpetualIdResponse) + err := c.cc.Invoke(ctx, "/dydxprotocol.perpetuals.Query/NextPerpetualId", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // Queries a Perpetual by id. @@ -736,6 +835,8 @@ type QueryServer interface { PremiumSamples(context.Context, *QueryPremiumSamplesRequest) (*QueryPremiumSamplesResponse, error) // Queries the perpetual params. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // Queries the next perpetual id. + NextPerpetualId(context.Context, *QueryNextPerpetualIdRequest) (*QueryNextPerpetualIdResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -760,6 +861,9 @@ func (*UnimplementedQueryServer) PremiumSamples(ctx context.Context, req *QueryP func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } +func (*UnimplementedQueryServer) NextPerpetualId(ctx context.Context, req *QueryNextPerpetualIdRequest) (*QueryNextPerpetualIdResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method NextPerpetualId not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -873,6 +977,24 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } +func _Query_NextPerpetualId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryNextPerpetualIdRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).NextPerpetualId(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/dydxprotocol.perpetuals.Query/NextPerpetualId", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).NextPerpetualId(ctx, req.(*QueryNextPerpetualIdRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "dydxprotocol.perpetuals.Query", HandlerType: (*QueryServer)(nil), @@ -901,6 +1023,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "Params", Handler: _Query_Params_Handler, }, + { + MethodName: "NextPerpetualId", + Handler: _Query_NextPerpetualId_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "dydxprotocol/perpetuals/query.proto", @@ -1303,6 +1429,57 @@ func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *QueryNextPerpetualIdRequest) 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 *QueryNextPerpetualIdRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryNextPerpetualIdRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryNextPerpetualIdResponse) 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 *QueryNextPerpetualIdResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryNextPerpetualIdResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.NextPerpetualId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.NextPerpetualId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -1461,6 +1638,27 @@ func (m *QueryParamsResponse) Size() (n int) { return n } +func (m *QueryNextPerpetualIdRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryNextPerpetualIdResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.NextPerpetualId != 0 { + n += 1 + sovQuery(uint64(m.NextPerpetualId)) + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -2430,6 +2628,125 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryNextPerpetualIdRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryNextPerpetualIdRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryNextPerpetualIdRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryNextPerpetualIdResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryNextPerpetualIdResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryNextPerpetualIdResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NextPerpetualId", wireType) + } + m.NextPerpetualId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NextPerpetualId |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/protocol/x/perpetuals/types/query.pb.gw.go b/protocol/x/perpetuals/types/query.pb.gw.go index 21cbd1bbde7..62a41fc9faf 100644 --- a/protocol/x/perpetuals/types/query.pb.gw.go +++ b/protocol/x/perpetuals/types/query.pb.gw.go @@ -213,6 +213,24 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal } +func request_Query_NextPerpetualId_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryNextPerpetualIdRequest + var metadata runtime.ServerMetadata + + msg, err := client.NextPerpetualId(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_NextPerpetualId_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryNextPerpetualIdRequest + var metadata runtime.ServerMetadata + + msg, err := server.NextPerpetualId(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -357,6 +375,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_NextPerpetualId_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_NextPerpetualId_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_NextPerpetualId_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -518,6 +559,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_NextPerpetualId_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_NextPerpetualId_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_NextPerpetualId_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -533,6 +594,8 @@ var ( pattern_Query_PremiumSamples_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"dydxprotocol", "perpetuals", "premium_samples"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"dydxprotocol", "perpetuals", "params"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_NextPerpetualId_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"dydxprotocol", "perpetuals", "next_perpetual_id"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -547,4 +610,6 @@ var ( forward_Query_PremiumSamples_0 = runtime.ForwardResponseMessage forward_Query_Params_0 = runtime.ForwardResponseMessage + + forward_Query_NextPerpetualId_0 = runtime.ForwardResponseMessage ) diff --git a/protocol/x/perpetuals/types/types.go b/protocol/x/perpetuals/types/types.go index 7268ec81a9a..0e6d28da92b 100644 --- a/protocol/x/perpetuals/types/types.go +++ b/protocol/x/perpetuals/types/types.go @@ -118,6 +118,7 @@ type PerpetualsKeeper interface { ctx sdk.Context, perpetual Perpetual, ) error + SetNextPerpetualID(ctx sdk.Context, nextID uint32) } // OpenInterestDelta represents a (perpId, openInterestDelta) tuple. diff --git a/protocol/x/prices/keeper/grpc_query_market.go b/protocol/x/prices/keeper/grpc_query_market.go index 11edcf7b677..fe3c2976f50 100644 --- a/protocol/x/prices/keeper/grpc_query_market.go +++ b/protocol/x/prices/keeper/grpc_query_market.go @@ -121,3 +121,14 @@ func (k Keeper) MarketParam( return &types.QueryMarketParamResponse{MarketParam: val}, nil } + +func (k Keeper) NextMarketId( + c context.Context, + req *types.QueryNextMarketIdRequest, +) ( + *types.QueryNextMarketIdResponse, + error, +) { + ctx := lib.UnwrapSDKContext(c, types.ModuleName) + return &types.QueryNextMarketIdResponse{NextMarketId: k.GetNextMarketID(ctx)}, nil +} diff --git a/protocol/x/prices/types/query.pb.go b/protocol/x/prices/types/query.pb.go index d3579b39978..9a5129fd11f 100644 --- a/protocol/x/prices/types/query.pb.go +++ b/protocol/x/prices/types/query.pb.go @@ -414,6 +414,88 @@ func (m *QueryAllMarketParamsResponse) GetPagination() *query.PageResponse { return nil } +// QueryNextMarketIdRequest is request type for the Query/Params `NextMarketId` +type QueryNextMarketIdRequest struct { +} + +func (m *QueryNextMarketIdRequest) Reset() { *m = QueryNextMarketIdRequest{} } +func (m *QueryNextMarketIdRequest) String() string { return proto.CompactTextString(m) } +func (*QueryNextMarketIdRequest) ProtoMessage() {} +func (*QueryNextMarketIdRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_c306b315383f34f4, []int{8} +} +func (m *QueryNextMarketIdRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryNextMarketIdRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryNextMarketIdRequest.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 *QueryNextMarketIdRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryNextMarketIdRequest.Merge(m, src) +} +func (m *QueryNextMarketIdRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryNextMarketIdRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryNextMarketIdRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryNextMarketIdRequest proto.InternalMessageInfo + +// QueryNextMarketIdResponse is response type for the Query/Params `NextMarketId` +type QueryNextMarketIdResponse struct { + NextMarketId uint32 `protobuf:"varint,1,opt,name=next_market_id,json=nextMarketId,proto3" json:"next_market_id,omitempty"` +} + +func (m *QueryNextMarketIdResponse) Reset() { *m = QueryNextMarketIdResponse{} } +func (m *QueryNextMarketIdResponse) String() string { return proto.CompactTextString(m) } +func (*QueryNextMarketIdResponse) ProtoMessage() {} +func (*QueryNextMarketIdResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c306b315383f34f4, []int{9} +} +func (m *QueryNextMarketIdResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryNextMarketIdResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryNextMarketIdResponse.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 *QueryNextMarketIdResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryNextMarketIdResponse.Merge(m, src) +} +func (m *QueryNextMarketIdResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryNextMarketIdResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryNextMarketIdResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryNextMarketIdResponse proto.InternalMessageInfo + +func (m *QueryNextMarketIdResponse) GetNextMarketId() uint32 { + if m != nil { + return m.NextMarketId + } + return 0 +} + func init() { proto.RegisterType((*QueryMarketPriceRequest)(nil), "dydxprotocol.prices.QueryMarketPriceRequest") proto.RegisterType((*QueryMarketPriceResponse)(nil), "dydxprotocol.prices.QueryMarketPriceResponse") @@ -423,47 +505,53 @@ func init() { proto.RegisterType((*QueryMarketParamResponse)(nil), "dydxprotocol.prices.QueryMarketParamResponse") proto.RegisterType((*QueryAllMarketParamsRequest)(nil), "dydxprotocol.prices.QueryAllMarketParamsRequest") proto.RegisterType((*QueryAllMarketParamsResponse)(nil), "dydxprotocol.prices.QueryAllMarketParamsResponse") + proto.RegisterType((*QueryNextMarketIdRequest)(nil), "dydxprotocol.prices.QueryNextMarketIdRequest") + proto.RegisterType((*QueryNextMarketIdResponse)(nil), "dydxprotocol.prices.QueryNextMarketIdResponse") } func init() { proto.RegisterFile("dydxprotocol/prices/query.proto", fileDescriptor_c306b315383f34f4) } var fileDescriptor_c306b315383f34f4 = []byte{ - // 556 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x54, 0xcd, 0x6e, 0x13, 0x31, - 0x10, 0xce, 0x86, 0xc2, 0xc1, 0x49, 0x41, 0x32, 0x48, 0x44, 0x69, 0xd9, 0x46, 0x06, 0xf5, 0x4f, - 0xd4, 0x26, 0x85, 0x03, 0x57, 0x7a, 0x00, 0x21, 0x84, 0x54, 0x72, 0xe4, 0x82, 0x9c, 0x5d, 0x6b, - 0x6b, 0x91, 0x5d,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0x09, 0xc0, 0x7b, 0x8b, 0x9b, 0x55, 0x5f, 0x65, 0xbb, 0x7b, 0x81, 0x8a, 0x82, 0xe2, 0x6d, 0x4d, - 0xf1, 0x16, 0x5c, 0xf9, 0x0b, 0x45, 0xc5, 0xae, 0x61, 0x79, 0xe5, 0x20, 0x9a, 0x75, 0x11, 0x0e, - 0xa2, 0xd9, 0x47, 0x81, 0x88, 0x66, 0xb4, 0x05, 0x37, 0x2a, 0x19, 0x99, 0xad, 0x2a, 0x69, 0xf7, - 0xb9, 0xa4, 0x9d, 0xd9, 0x1c, 0x27, 0xed, 0xec, 0x0b, 0x71, 0xd3, 0xae, 0xb4, 0xeb, 0x68, 0x5b, - 0x33, 0xbd, 0x03, 0xd1, 0xf9, 0x4c, 0xf7, 0x7a, 0x27, 0x63, 0xdf, 0x3b, 0x1d, 0xfb, 0xde, 0x8f, - 0xb1, 0xef, 0xbd, 0x9f, 0xf8, 0xb5, 0xd3, 0x89, 0x5f, 0xfb, 0x36, 0xf1, 0x6b, 0x2f, 0x1f, 0x46, - 0x3c, 0x3f, 0x18, 0xf6, 0x71, 0x20, 0xe2, 0xf2, 0x3b, 0x47, 0x0f, 0x76, 0x82, 0x03, 0xca, 0x13, - 0xf2, 0x27, 0x72, 0x3c, 0x7d, 0x3b, 0x1f, 0xa5, 0x4c, 0xf6, 0xaf, 0xe8, 0xc4, 0xfd, 0xdf, 0x01, - 0x00, 0x00, 0xff, 0xff, 0xe8, 0x38, 0x1f, 0x8e, 0x24, 0x07, 0x00, 0x00, + // 616 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x54, 0x4d, 0x4f, 0x13, 0x41, + 0x18, 0xee, 0x56, 0xe5, 0x30, 0x2d, 0x98, 0x8c, 0x26, 0xd6, 0x05, 0x97, 0x66, 0x41, 0xbe, 0x94, + 0x1d, 0x8b, 0x1e, 0xbc, 0xc2, 0x41, 0x43,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, 0xf3, 0x00, 0xc7, 0x09, 0x3a, 0xad, 0xf4, + 0x46, 0x97, 0x67, 0xfd, 0x94, 0xb0, 0xc6, 0x8c, 0x68, 0x3c, 0xfe, 0x17, 0x00, 0x00, 0xff, 0xff, + 0x50, 0x4b, 0x00, 0xa4, 0x20, 0x08, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -486,6 +574,8 @@ type QueryClient interface { MarketParam(ctx context.Context, in *QueryMarketParamRequest, opts ...grpc.CallOption) (*QueryMarketParamResponse, error) // Queries a list of MarketParam items. AllMarketParams(ctx context.Context, in *QueryAllMarketParamsRequest, opts ...grpc.CallOption) (*QueryAllMarketParamsResponse, error) + // Queries the next market id. + NextMarketId(ctx context.Context, in *QueryNextMarketIdRequest, opts ...grpc.CallOption) (*QueryNextMarketIdResponse, error) } type queryClient struct { @@ -532,6 +622,15 @@ func (c *queryClient) AllMarketParams(ctx context.Context, in *QueryAllMarketPar return out, nil } +func (c *queryClient) NextMarketId(ctx context.Context, in *QueryNextMarketIdRequest, opts ...grpc.CallOption) (*QueryNextMarketIdResponse, error) { + out := new(QueryNextMarketIdResponse) + err := c.cc.Invoke(ctx, "/dydxprotocol.prices.Query/NextMarketId", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // Queries a MarketPrice by id. @@ -542,6 +641,8 @@ type QueryServer interface { MarketParam(context.Context, *QueryMarketParamRequest) (*QueryMarketParamResponse, error) // Queries a list of MarketParam items. AllMarketParams(context.Context, *QueryAllMarketParamsRequest) (*QueryAllMarketParamsResponse, error) + // Queries the next market id. + NextMarketId(context.Context, *QueryNextMarketIdRequest) (*QueryNextMarketIdResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -560,6 +661,9 @@ func (*UnimplementedQueryServer) MarketParam(ctx context.Context, req *QueryMark func (*UnimplementedQueryServer) AllMarketParams(ctx context.Context, req *QueryAllMarketParamsRequest) (*QueryAllMarketParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AllMarketParams not implemented") } +func (*UnimplementedQueryServer) NextMarketId(ctx context.Context, req *QueryNextMarketIdRequest) (*QueryNextMarketIdResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method NextMarketId not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -637,6 +741,24 @@ func _Query_AllMarketParams_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } +func _Query_NextMarketId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryNextMarketIdRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).NextMarketId(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/dydxprotocol.prices.Query/NextMarketId", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).NextMarketId(ctx, req.(*QueryNextMarketIdRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "dydxprotocol.prices.Query", HandlerType: (*QueryServer)(nil), @@ -657,6 +779,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "AllMarketParams", Handler: _Query_AllMarketParams_Handler, }, + { + MethodName: "NextMarketId", + Handler: _Query_NextMarketId_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "dydxprotocol/prices/query.proto", @@ -952,6 +1078,57 @@ func (m *QueryAllMarketParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, e return len(dAtA) - i, nil } +func (m *QueryNextMarketIdRequest) 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 *QueryNextMarketIdRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryNextMarketIdRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryNextMarketIdResponse) 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 *QueryNextMarketIdResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryNextMarketIdResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.NextMarketId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.NextMarketId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -1073,6 +1250,27 @@ func (m *QueryAllMarketParamsResponse) Size() (n int) { return n } +func (m *QueryNextMarketIdRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryNextMarketIdResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.NextMarketId != 0 { + n += 1 + sovQuery(uint64(m.NextMarketId)) + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1795,6 +1993,125 @@ func (m *QueryAllMarketParamsResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryNextMarketIdRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryNextMarketIdRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryNextMarketIdRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryNextMarketIdResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryNextMarketIdResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryNextMarketIdResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NextMarketId", wireType) + } + m.NextMarketId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NextMarketId |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/protocol/x/prices/types/query.pb.gw.go b/protocol/x/prices/types/query.pb.gw.go index 401252770f4..2e78d40c061 100644 --- a/protocol/x/prices/types/query.pb.gw.go +++ b/protocol/x/prices/types/query.pb.gw.go @@ -213,6 +213,24 @@ func local_request_Query_AllMarketParams_0(ctx context.Context, marshaler runtim } +func request_Query_NextMarketId_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryNextMarketIdRequest + var metadata runtime.ServerMetadata + + msg, err := client.NextMarketId(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_NextMarketId_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryNextMarketIdRequest + var metadata runtime.ServerMetadata + + msg, err := server.NextMarketId(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -311,6 +329,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_NextMarketId_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_NextMarketId_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_NextMarketId_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -432,6 +473,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_NextMarketId_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_NextMarketId_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_NextMarketId_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -443,6 +504,8 @@ var ( pattern_Query_MarketParam_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"dydxprotocol", "prices", "params", "market", "id"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_AllMarketParams_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"dydxprotocol", "prices", "params", "market"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_NextMarketId_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"dydxprotocol", "prices", "next_market_id"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -453,4 +516,6 @@ var ( forward_Query_MarketParam_0 = runtime.ForwardResponseMessage forward_Query_AllMarketParams_0 = runtime.ForwardResponseMessage + + forward_Query_NextMarketId_0 = runtime.ForwardResponseMessage ) diff --git a/protocol/x/prices/types/types.go b/protocol/x/prices/types/types.go index 87d9fec885d..8f225e7580c 100644 --- a/protocol/x/prices/types/types.go +++ b/protocol/x/prices/types/types.go @@ -57,4 +57,6 @@ type PricesKeeper interface { GetCurrencyPairFromID(ctx context.Context, id uint64) (cp slinkytypes.CurrencyPair, found bool) GetIDForCurrencyPair(ctx context.Context, cp slinkytypes.CurrencyPair) (uint64, bool) GetPriceForCurrencyPair(ctx context.Context, cp slinkytypes.CurrencyPair) (oracletypes.QuotePrice, error) + + SetNextMarketID(ctx sdk.Context, nextID uint32) } From 7cf3fcd15fca474638583e6f281191b9d42c102c Mon Sep 17 00:00:00 2001 From: Shrenuj Bansal Date: Wed, 20 Nov 2024 14:47:58 -0500 Subject: [PATCH 02/12] Upgrade handler to set market, perp and clob pair id to fixed number --- .../codegen/dydxprotocol/clob/query.lcd.ts | 10 +- .../dydxprotocol/clob/query.rpc.Query.ts | 16 +- .../src/codegen/dydxprotocol/clob/query.ts | 97 ++++++++ .../dydxprotocol/perpetuals/query.lcd.ts | 10 +- .../perpetuals/query.rpc.Query.ts | 16 +- .../codegen/dydxprotocol/perpetuals/query.ts | 97 ++++++++ .../codegen/dydxprotocol/prices/query.lcd.ts | 10 +- .../dydxprotocol/prices/query.rpc.Query.ts | 16 +- .../src/codegen/dydxprotocol/prices/query.ts | 97 ++++++++ protocol/app/upgrades.go | 17 +- .../upgrades/v7.0/upgrade_container_test.go | 234 ------------------ .../upgrades/{v7.0.3 => v7.1}/constants.go | 4 +- .../app/upgrades/{v7.0.3 => v7.1}/upgrade.go | 2 +- .../upgrade_container_test.go | 46 ++-- protocol/testing/version/VERSION_CURRENT | 2 +- .../version/VERSION_FULL_NAME_PREUPGRADE | 2 +- protocol/testing/version/VERSION_PREUPGRADE | 2 +- 17 files changed, 408 insertions(+), 270 deletions(-) delete mode 100644 protocol/app/upgrades/v7.0/upgrade_container_test.go rename protocol/app/upgrades/{v7.0.3 => v7.1}/constants.go (90%) rename protocol/app/upgrades/{v7.0.3 => v7.1}/upgrade.go (98%) rename protocol/app/upgrades/{v7.0.3 => v7.1}/upgrade_container_test.go (57%) diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/query.lcd.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/query.lcd.ts index 4ef29497240..034cbad3db2 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/query.lcd.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/query.lcd.ts @@ -1,6 +1,6 @@ import { setPaginationParams } from "../../helpers"; import { LCDClient } from "@osmonauts/lcd"; -import { QueryGetClobPairRequest, QueryClobPairResponseSDKType, QueryAllClobPairRequest, QueryClobPairAllResponseSDKType, QueryEquityTierLimitConfigurationRequest, QueryEquityTierLimitConfigurationResponseSDKType, QueryBlockRateLimitConfigurationRequest, QueryBlockRateLimitConfigurationResponseSDKType, QueryLiquidationsConfigurationRequest, QueryLiquidationsConfigurationResponseSDKType } from "./query"; +import { QueryGetClobPairRequest, QueryClobPairResponseSDKType, QueryAllClobPairRequest, QueryClobPairAllResponseSDKType, QueryEquityTierLimitConfigurationRequest, QueryEquityTierLimitConfigurationResponseSDKType, QueryBlockRateLimitConfigurationRequest, QueryBlockRateLimitConfigurationResponseSDKType, QueryLiquidationsConfigurationRequest, QueryLiquidationsConfigurationResponseSDKType, QueryNextClobPairIdRequest, QueryNextClobPairIdResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; @@ -15,6 +15,7 @@ export class LCDQueryClient { this.equityTierLimitConfiguration = this.equityTierLimitConfiguration.bind(this); this.blockRateLimitConfiguration = this.blockRateLimitConfiguration.bind(this); this.liquidationsConfiguration = this.liquidationsConfiguration.bind(this); + this.nextClobPairId = this.nextClobPairId.bind(this); } /* Queries a ClobPair by id. */ @@ -61,5 +62,12 @@ export class LCDQueryClient { const endpoint = `dydxprotocol/clob/liquidations_config`; return await this.req.get(endpoint); } + /* Queries the next clob pair id. */ + + + async nextClobPairId(_params: QueryNextClobPairIdRequest = {}): Promise { + const endpoint = `dydxprotocol/clob/next_clob_pair_id`; + return await this.req.get(endpoint); + } } \ No newline at end of file diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/query.rpc.Query.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/query.rpc.Query.ts index 5f49481ef31..5c87afce0f1 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/query.rpc.Query.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/query.rpc.Query.ts @@ -1,7 +1,7 @@ import { Rpc } from "../../helpers"; import * as _m0 from "protobufjs/minimal"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { QueryGetClobPairRequest, QueryClobPairResponse, QueryAllClobPairRequest, QueryClobPairAllResponse, MevNodeToNodeCalculationRequest, MevNodeToNodeCalculationResponse, QueryEquityTierLimitConfigurationRequest, QueryEquityTierLimitConfigurationResponse, QueryBlockRateLimitConfigurationRequest, QueryBlockRateLimitConfigurationResponse, QueryLiquidationsConfigurationRequest, QueryLiquidationsConfigurationResponse, QueryStatefulOrderRequest, QueryStatefulOrderResponse, StreamOrderbookUpdatesRequest, StreamOrderbookUpdatesResponse } from "./query"; +import { QueryGetClobPairRequest, QueryClobPairResponse, QueryAllClobPairRequest, QueryClobPairAllResponse, MevNodeToNodeCalculationRequest, MevNodeToNodeCalculationResponse, QueryEquityTierLimitConfigurationRequest, QueryEquityTierLimitConfigurationResponse, QueryBlockRateLimitConfigurationRequest, QueryBlockRateLimitConfigurationResponse, QueryLiquidationsConfigurationRequest, QueryLiquidationsConfigurationResponse, QueryStatefulOrderRequest, QueryStatefulOrderResponse, QueryNextClobPairIdRequest, QueryNextClobPairIdResponse, StreamOrderbookUpdatesRequest, StreamOrderbookUpdatesResponse } from "./query"; /** Query defines the gRPC querier service. */ export interface Query { @@ -25,6 +25,9 @@ export interface Query { /** Queries the stateful order for a given order id. */ statefulOrder(request: QueryStatefulOrderRequest): Promise; + /** Queries the next clob pair id. */ + + nextClobPairId(request?: QueryNextClobPairIdRequest): Promise; /** * Streams orderbook updates. Updates contain orderbook data * such as order placements, updates, and fills. @@ -44,6 +47,7 @@ export class QueryClientImpl implements Query { this.blockRateLimitConfiguration = this.blockRateLimitConfiguration.bind(this); this.liquidationsConfiguration = this.liquidationsConfiguration.bind(this); this.statefulOrder = this.statefulOrder.bind(this); + this.nextClobPairId = this.nextClobPairId.bind(this); this.streamOrderbookUpdates = this.streamOrderbookUpdates.bind(this); } @@ -91,6 +95,12 @@ export class QueryClientImpl implements Query { return promise.then(data => QueryStatefulOrderResponse.decode(new _m0.Reader(data))); } + nextClobPairId(request: QueryNextClobPairIdRequest = {}): Promise { + const data = QueryNextClobPairIdRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.clob.Query", "NextClobPairId", data); + return promise.then(data => QueryNextClobPairIdResponse.decode(new _m0.Reader(data))); + } + streamOrderbookUpdates(request: StreamOrderbookUpdatesRequest): Promise { const data = StreamOrderbookUpdatesRequest.encode(request).finish(); const promise = this.rpc.request("dydxprotocol.clob.Query", "StreamOrderbookUpdates", data); @@ -130,6 +140,10 @@ export const createRpcQueryExtension = (base: QueryClient) => { return queryService.statefulOrder(request); }, + nextClobPairId(request?: QueryNextClobPairIdRequest): Promise { + return queryService.nextClobPairId(request); + }, + streamOrderbookUpdates(request: StreamOrderbookUpdatesRequest): Promise { return queryService.streamOrderbookUpdates(request); } diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/query.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/query.ts index 41ca0c872ab..a2abeab07e7 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/query.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/query.ts @@ -245,6 +245,24 @@ export interface QueryLiquidationsConfigurationResponse { export interface QueryLiquidationsConfigurationResponseSDKType { liquidations_config?: LiquidationsConfigSDKType; } +/** QueryNextClobPairIdRequest is a request message for the next clob pair id */ + +export interface QueryNextClobPairIdRequest {} +/** QueryNextClobPairIdRequest is a request message for the next clob pair id */ + +export interface QueryNextClobPairIdRequestSDKType {} +/** QueryNextClobPairIdResponse is a response message for the next clob pair id */ + +export interface QueryNextClobPairIdResponse { + /** QueryNextClobPairIdResponse is a response message for the next clob pair id */ + nextClobPairId: number; +} +/** QueryNextClobPairIdResponse is a response message for the next clob pair id */ + +export interface QueryNextClobPairIdResponseSDKType { + /** QueryNextClobPairIdResponse is a response message for the next clob pair id */ + next_clob_pair_id: number; +} /** * StreamOrderbookUpdatesRequest is a request message for the * StreamOrderbookUpdates method. @@ -1188,6 +1206,85 @@ export const QueryLiquidationsConfigurationResponse = { }; +function createBaseQueryNextClobPairIdRequest(): QueryNextClobPairIdRequest { + return {}; +} + +export const QueryNextClobPairIdRequest = { + encode(_: QueryNextClobPairIdRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryNextClobPairIdRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryNextClobPairIdRequest(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromPartial(_: DeepPartial): QueryNextClobPairIdRequest { + const message = createBaseQueryNextClobPairIdRequest(); + return message; + } + +}; + +function createBaseQueryNextClobPairIdResponse(): QueryNextClobPairIdResponse { + return { + nextClobPairId: 0 + }; +} + +export const QueryNextClobPairIdResponse = { + encode(message: QueryNextClobPairIdResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.nextClobPairId !== 0) { + writer.uint32(8).uint32(message.nextClobPairId); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryNextClobPairIdResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryNextClobPairIdResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.nextClobPairId = reader.uint32(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromPartial(object: DeepPartial): QueryNextClobPairIdResponse { + const message = createBaseQueryNextClobPairIdResponse(); + message.nextClobPairId = object.nextClobPairId ?? 0; + return message; + } + +}; + function createBaseStreamOrderbookUpdatesRequest(): StreamOrderbookUpdatesRequest { return { clobPairId: [], diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/query.lcd.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/query.lcd.ts index bf75ee98d49..a0bdc49c4bd 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/query.lcd.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/query.lcd.ts @@ -1,6 +1,6 @@ import { setPaginationParams } from "../../helpers"; import { LCDClient } from "@osmonauts/lcd"; -import { QueryPerpetualRequest, QueryPerpetualResponseSDKType, QueryAllPerpetualsRequest, QueryAllPerpetualsResponseSDKType, QueryAllLiquidityTiersRequest, QueryAllLiquidityTiersResponseSDKType, QueryPremiumVotesRequest, QueryPremiumVotesResponseSDKType, QueryPremiumSamplesRequest, QueryPremiumSamplesResponseSDKType, QueryParamsRequest, QueryParamsResponseSDKType } from "./query"; +import { QueryPerpetualRequest, QueryPerpetualResponseSDKType, QueryAllPerpetualsRequest, QueryAllPerpetualsResponseSDKType, QueryAllLiquidityTiersRequest, QueryAllLiquidityTiersResponseSDKType, QueryPremiumVotesRequest, QueryPremiumVotesResponseSDKType, QueryPremiumSamplesRequest, QueryPremiumSamplesResponseSDKType, QueryParamsRequest, QueryParamsResponseSDKType, QueryNextPerpetualIdRequest, QueryNextPerpetualIdResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; @@ -16,6 +16,7 @@ export class LCDQueryClient { this.premiumVotes = this.premiumVotes.bind(this); this.premiumSamples = this.premiumSamples.bind(this); this.params = this.params.bind(this); + this.nextPerpetualId = this.nextPerpetualId.bind(this); } /* Queries a Perpetual by id. */ @@ -79,5 +80,12 @@ export class LCDQueryClient { const endpoint = `dydxprotocol/perpetuals/params`; return await this.req.get(endpoint); } + /* Queries the next perpetual id. */ + + + async nextPerpetualId(_params: QueryNextPerpetualIdRequest = {}): Promise { + const endpoint = `dydxprotocol/perpetuals/next_perpetual_id`; + return await this.req.get(endpoint); + } } \ No newline at end of file diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/query.rpc.Query.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/query.rpc.Query.ts index afd777b2df5..64c43f1b96b 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/query.rpc.Query.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/query.rpc.Query.ts @@ -1,7 +1,7 @@ import { Rpc } from "../../helpers"; import * as _m0 from "protobufjs/minimal"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { QueryPerpetualRequest, QueryPerpetualResponse, QueryAllPerpetualsRequest, QueryAllPerpetualsResponse, QueryAllLiquidityTiersRequest, QueryAllLiquidityTiersResponse, QueryPremiumVotesRequest, QueryPremiumVotesResponse, QueryPremiumSamplesRequest, QueryPremiumSamplesResponse, QueryParamsRequest, QueryParamsResponse } from "./query"; +import { QueryPerpetualRequest, QueryPerpetualResponse, QueryAllPerpetualsRequest, QueryAllPerpetualsResponse, QueryAllLiquidityTiersRequest, QueryAllLiquidityTiersResponse, QueryPremiumVotesRequest, QueryPremiumVotesResponse, QueryPremiumSamplesRequest, QueryPremiumSamplesResponse, QueryParamsRequest, QueryParamsResponse, QueryNextPerpetualIdRequest, QueryNextPerpetualIdResponse } from "./query"; /** Query defines the gRPC querier service. */ export interface Query { @@ -22,6 +22,9 @@ export interface Query { /** Queries the perpetual params. */ params(request?: QueryParamsRequest): Promise; + /** Queries the next perpetual id. */ + + nextPerpetualId(request?: QueryNextPerpetualIdRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -34,6 +37,7 @@ export class QueryClientImpl implements Query { this.premiumVotes = this.premiumVotes.bind(this); this.premiumSamples = this.premiumSamples.bind(this); this.params = this.params.bind(this); + this.nextPerpetualId = this.nextPerpetualId.bind(this); } perpetual(request: QueryPerpetualRequest): Promise { @@ -76,6 +80,12 @@ export class QueryClientImpl implements Query { return promise.then(data => QueryParamsResponse.decode(new _m0.Reader(data))); } + nextPerpetualId(request: QueryNextPerpetualIdRequest = {}): Promise { + const data = QueryNextPerpetualIdRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.perpetuals.Query", "NextPerpetualId", data); + return promise.then(data => QueryNextPerpetualIdResponse.decode(new _m0.Reader(data))); + } + } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -103,6 +113,10 @@ export const createRpcQueryExtension = (base: QueryClient) => { params(request?: QueryParamsRequest): Promise { return queryService.params(request); + }, + + nextPerpetualId(request?: QueryNextPerpetualIdRequest): Promise { + return queryService.nextPerpetualId(request); } }; diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/query.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/query.ts index 4dda168b08b..8fd1e273c66 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/query.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/query.ts @@ -141,6 +141,24 @@ export interface QueryParamsResponse { export interface QueryParamsResponseSDKType { params?: ParamsSDKType; } +/** QueryNextPerpetualIdRequest is the request type for the NextPerpetualId RPC */ + +export interface QueryNextPerpetualIdRequest {} +/** QueryNextPerpetualIdRequest is the request type for the NextPerpetualId RPC */ + +export interface QueryNextPerpetualIdRequestSDKType {} +/** QueryNextPerpetualIdResponse is the response type for the NextPerpetualId RPC */ + +export interface QueryNextPerpetualIdResponse { + /** QueryNextPerpetualIdResponse is the response type for the NextPerpetualId RPC */ + nextPerpetualId: number; +} +/** QueryNextPerpetualIdResponse is the response type for the NextPerpetualId RPC */ + +export interface QueryNextPerpetualIdResponseSDKType { + /** QueryNextPerpetualIdResponse is the response type for the NextPerpetualId RPC */ + next_perpetual_id: number; +} function createBaseQueryPerpetualRequest(): QueryPerpetualRequest { return { @@ -667,4 +685,83 @@ export const QueryParamsResponse = { return message; } +}; + +function createBaseQueryNextPerpetualIdRequest(): QueryNextPerpetualIdRequest { + return {}; +} + +export const QueryNextPerpetualIdRequest = { + encode(_: QueryNextPerpetualIdRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryNextPerpetualIdRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryNextPerpetualIdRequest(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromPartial(_: DeepPartial): QueryNextPerpetualIdRequest { + const message = createBaseQueryNextPerpetualIdRequest(); + return message; + } + +}; + +function createBaseQueryNextPerpetualIdResponse(): QueryNextPerpetualIdResponse { + return { + nextPerpetualId: 0 + }; +} + +export const QueryNextPerpetualIdResponse = { + encode(message: QueryNextPerpetualIdResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.nextPerpetualId !== 0) { + writer.uint32(8).uint32(message.nextPerpetualId); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryNextPerpetualIdResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryNextPerpetualIdResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.nextPerpetualId = reader.uint32(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromPartial(object: DeepPartial): QueryNextPerpetualIdResponse { + const message = createBaseQueryNextPerpetualIdResponse(); + message.nextPerpetualId = object.nextPerpetualId ?? 0; + return message; + } + }; \ No newline at end of file diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/prices/query.lcd.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/prices/query.lcd.ts index 0f78eab48a6..aa78b042eec 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/prices/query.lcd.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/prices/query.lcd.ts @@ -1,6 +1,6 @@ import { setPaginationParams } from "../../helpers"; import { LCDClient } from "@osmonauts/lcd"; -import { QueryMarketPriceRequest, QueryMarketPriceResponseSDKType, QueryAllMarketPricesRequest, QueryAllMarketPricesResponseSDKType, QueryMarketParamRequest, QueryMarketParamResponseSDKType, QueryAllMarketParamsRequest, QueryAllMarketParamsResponseSDKType } from "./query"; +import { QueryMarketPriceRequest, QueryMarketPriceResponseSDKType, QueryAllMarketPricesRequest, QueryAllMarketPricesResponseSDKType, QueryMarketParamRequest, QueryMarketParamResponseSDKType, QueryAllMarketParamsRequest, QueryAllMarketParamsResponseSDKType, QueryNextMarketIdRequest, QueryNextMarketIdResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; @@ -14,6 +14,7 @@ export class LCDQueryClient { this.allMarketPrices = this.allMarketPrices.bind(this); this.marketParam = this.marketParam.bind(this); this.allMarketParams = this.allMarketParams.bind(this); + this.nextMarketId = this.nextMarketId.bind(this); } /* Queries a MarketPrice by id. */ @@ -63,5 +64,12 @@ export class LCDQueryClient { const endpoint = `dydxprotocol/prices/params/market`; return await this.req.get(endpoint, options); } + /* Queries the next market id. */ + + + async nextMarketId(_params: QueryNextMarketIdRequest = {}): Promise { + const endpoint = `dydxprotocol/prices/next_market_id`; + return await this.req.get(endpoint); + } } \ No newline at end of file diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/prices/query.rpc.Query.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/prices/query.rpc.Query.ts index 2c24a6d01a3..e6b955ad291 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/prices/query.rpc.Query.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/prices/query.rpc.Query.ts @@ -1,7 +1,7 @@ import { Rpc } from "../../helpers"; import * as _m0 from "protobufjs/minimal"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { QueryMarketPriceRequest, QueryMarketPriceResponse, QueryAllMarketPricesRequest, QueryAllMarketPricesResponse, QueryMarketParamRequest, QueryMarketParamResponse, QueryAllMarketParamsRequest, QueryAllMarketParamsResponse } from "./query"; +import { QueryMarketPriceRequest, QueryMarketPriceResponse, QueryAllMarketPricesRequest, QueryAllMarketPricesResponse, QueryMarketParamRequest, QueryMarketParamResponse, QueryAllMarketParamsRequest, QueryAllMarketParamsResponse, QueryNextMarketIdRequest, QueryNextMarketIdResponse } from "./query"; /** Query defines the gRPC querier service. */ export interface Query { @@ -16,6 +16,9 @@ export interface Query { /** Queries a list of MarketParam items. */ allMarketParams(request?: QueryAllMarketParamsRequest): Promise; + /** Queries the next market id. */ + + nextMarketId(request?: QueryNextMarketIdRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -26,6 +29,7 @@ export class QueryClientImpl implements Query { this.allMarketPrices = this.allMarketPrices.bind(this); this.marketParam = this.marketParam.bind(this); this.allMarketParams = this.allMarketParams.bind(this); + this.nextMarketId = this.nextMarketId.bind(this); } marketPrice(request: QueryMarketPriceRequest): Promise { @@ -56,6 +60,12 @@ export class QueryClientImpl implements Query { return promise.then(data => QueryAllMarketParamsResponse.decode(new _m0.Reader(data))); } + nextMarketId(request: QueryNextMarketIdRequest = {}): Promise { + const data = QueryNextMarketIdRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.prices.Query", "NextMarketId", data); + return promise.then(data => QueryNextMarketIdResponse.decode(new _m0.Reader(data))); + } + } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -75,6 +85,10 @@ export const createRpcQueryExtension = (base: QueryClient) => { allMarketParams(request?: QueryAllMarketParamsRequest): Promise { return queryService.allMarketParams(request); + }, + + nextMarketId(request?: QueryNextMarketIdRequest): Promise { + return queryService.nextMarketId(request); } }; diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/prices/query.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/prices/query.ts index 4c7a38db92f..2730923e0f0 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/prices/query.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/prices/query.ts @@ -151,6 +151,24 @@ export interface QueryAllMarketParamsResponseSDKType { market_params: MarketParamSDKType[]; pagination?: PageResponseSDKType; } +/** QueryNextMarketIdRequest is request type for the Query/Params `NextMarketId` */ + +export interface QueryNextMarketIdRequest {} +/** QueryNextMarketIdRequest is request type for the Query/Params `NextMarketId` */ + +export interface QueryNextMarketIdRequestSDKType {} +/** QueryNextMarketIdResponse is response type for the Query/Params `NextMarketId` */ + +export interface QueryNextMarketIdResponse { + /** QueryNextMarketIdResponse is response type for the Query/Params `NextMarketId` */ + nextMarketId: number; +} +/** QueryNextMarketIdResponse is response type for the Query/Params `NextMarketId` */ + +export interface QueryNextMarketIdResponseSDKType { + /** QueryNextMarketIdResponse is response type for the Query/Params `NextMarketId` */ + next_market_id: number; +} function createBaseQueryMarketPriceRequest(): QueryMarketPriceRequest { return { @@ -530,4 +548,83 @@ export const QueryAllMarketParamsResponse = { return message; } +}; + +function createBaseQueryNextMarketIdRequest(): QueryNextMarketIdRequest { + return {}; +} + +export const QueryNextMarketIdRequest = { + encode(_: QueryNextMarketIdRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryNextMarketIdRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryNextMarketIdRequest(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromPartial(_: DeepPartial): QueryNextMarketIdRequest { + const message = createBaseQueryNextMarketIdRequest(); + return message; + } + +}; + +function createBaseQueryNextMarketIdResponse(): QueryNextMarketIdResponse { + return { + nextMarketId: 0 + }; +} + +export const QueryNextMarketIdResponse = { + encode(message: QueryNextMarketIdResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.nextMarketId !== 0) { + writer.uint32(8).uint32(message.nextMarketId); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryNextMarketIdResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryNextMarketIdResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.nextMarketId = reader.uint32(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromPartial(object: DeepPartial): QueryNextMarketIdResponse { + const message = createBaseQueryNextMarketIdResponse(); + message.nextMarketId = object.nextMarketId ?? 0; + return message; + } + }; \ No newline at end of file diff --git a/protocol/app/upgrades.go b/protocol/app/upgrades.go index 207a5ba8159..34922cb12fc 100644 --- a/protocol/app/upgrades.go +++ b/protocol/app/upgrades.go @@ -3,7 +3,7 @@ package app import ( "fmt" - v7_0 "github.com/dydxprotocol/v4-chain/protocol/app/upgrades/v7.0" + v7_1 "github.com/dydxprotocol/v4-chain/protocol/app/upgrades/v7.1" upgradetypes "cosmossdk.io/x/upgrade/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -14,7 +14,7 @@ var ( // `Upgrades` defines the upgrade handlers and store loaders for the application. // New upgrades should be added to this slice after they are implemented. Upgrades = []upgrades.Upgrade{ - v7_0.Upgrade, + v7_1.Upgrade, } Forks = []upgrades.Fork{} ) @@ -22,18 +22,17 @@ var ( // setupUpgradeHandlers registers the upgrade handlers to perform custom upgrade // logic and state migrations for software upgrades. func (app *App) setupUpgradeHandlers() { - if app.UpgradeKeeper.HasHandler(v7_0.UpgradeName) { - panic(fmt.Sprintf("Cannot register duplicate upgrade handler '%s'", v7_0.UpgradeName)) + if app.UpgradeKeeper.HasHandler(v7_1.UpgradeName) { + panic(fmt.Sprintf("Cannot register duplicate upgrade handler '%s'", v7_1.UpgradeName)) } app.UpgradeKeeper.SetUpgradeHandler( - v7_0.UpgradeName, - v7_0.CreateUpgradeHandler( + v7_1.UpgradeName, + v7_1.CreateUpgradeHandler( app.ModuleManager, app.configurator, - app.AccountKeeper, app.PricesKeeper, - app.VaultKeeper, - app.ListingKeeper, + app.PerpetualsKeeper, + app.ClobKeeper, ), ) } diff --git a/protocol/app/upgrades/v7.0/upgrade_container_test.go b/protocol/app/upgrades/v7.0/upgrade_container_test.go deleted file mode 100644 index cefaf80a757..00000000000 --- a/protocol/app/upgrades/v7.0/upgrade_container_test.go +++ /dev/null @@ -1,234 +0,0 @@ -//go:build all || container_test - -package v_7_0_3_test - -import ( - "math/big" - "testing" - - listingtypes "github.com/dydxprotocol/v4-chain/protocol/x/listing/types" - - "github.com/cosmos/gogoproto/proto" - - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/dydxprotocol/v4-chain/protocol/dtypes" - "github.com/dydxprotocol/v4-chain/protocol/testing/containertest" - "github.com/dydxprotocol/v4-chain/protocol/testutil/constants" - affiliatestypes "github.com/dydxprotocol/v4-chain/protocol/x/affiliates/types" - vaulttypes "github.com/dydxprotocol/v4-chain/protocol/x/vault/types" - "github.com/stretchr/testify/require" -) - -const ( - AliceBobBTCQuantums = 1_000_000 - CarlDaveBTCQuantums = 2_000_000 - CarlDaveETHQuantums = 4_000_000 -) - -func TestStateUpgrade(t *testing.T) { - testnet, err := containertest.NewTestnetWithPreupgradeGenesis() - require.NoError(t, err, "failed to create testnet - is docker daemon running?") - err = testnet.Start() - require.NoError(t, err) - defer testnet.MustCleanUp() - node := testnet.Nodes["alice"] - nodeAddress := constants.AliceAccAddress.String() - - preUpgradeSetups(node, t) - preUpgradeChecks(node, t) - - err = containertest.UpgradeTestnet(nodeAddress, t, node, v_7_0_3.UpgradeName) - require.NoError(t, err) - - postUpgradeChecks(node, t) -} - -func preUpgradeSetups(node *containertest.Node, t *testing.T) {} - -func preUpgradeChecks(node *containertest.Node, t *testing.T) { - // Add test for your upgrade handler logic below -} - -func postUpgradeChecks(node *containertest.Node, t *testing.T) { - - // Check that the listing module state has been initialized with the hard cap and default deposit params. - postUpgradeMarketIdsCheck(node, t) -} - -func postUpgradeMarketIdsCheck(node *containertest.Node, t *testing.T) { -} - -func postUpgradeVaultParamsCheck(node *containertest.Node, t *testing.T) { - // Check that a vault with quoting params is successfully migrated and the quoting params are - // successfully migrated to the vault params. - expectedQuotingParams := &vaulttypes.QuotingParams{ - Layers: 3, - SpreadMinPpm: 1500, - SpreadBufferPpm: 500, - SkewFactorPpm: 1000000, - OrderSizePctPpm: 50000, - OrderExpirationSeconds: 30, - ActivationThresholdQuoteQuantums: dtypes.NewIntFromUint64(500_000_000), - } - - checkVaultParams(node, t, 0, vaulttypes.VaultStatus_VAULT_STATUS_QUOTING, expectedQuotingParams) - - // Check that a vault without quoting params is successfully migrated and the quoting params are - // not set in the migrated vault params. - checkVaultParams(node, t, 1, vaulttypes.VaultStatus_VAULT_STATUS_QUOTING, nil) -} - -func checkVaultParams( - node *containertest.Node, - t *testing.T, - vaultNumber uint32, - expectedStatus vaulttypes.VaultStatus, - expectedQuotingParams *vaulttypes.QuotingParams, -) { - resp, err := containertest.Query( - node, - vaulttypes.NewQueryClient, - vaulttypes.QueryClient.VaultParams, - &vaulttypes.QueryVaultParamsRequest{ - Type: vaulttypes.VaultType_VAULT_TYPE_CLOB, - Number: vaultNumber, - }, - ) - require.NoError(t, err) - require.NotNil(t, resp) - - vaultParamsResp := vaulttypes.QueryVaultParamsResponse{} - err = proto.UnmarshalText(resp.String(), &vaultParamsResp) - require.NoError(t, err) - - require.Equal(t, expectedStatus, vaultParamsResp.VaultParams.Status) - require.Equal(t, expectedQuotingParams, vaultParamsResp.VaultParams.QuotingParams) -} - -func postUpgradeMegavaultSharesCheck(node *containertest.Node, t *testing.T) { - // Alice equity = vault_0_equity * 1 + vault_1_equity * 1/3 + vault_2_equity * 123_456/556_677 - // = 1_000 + 2_000 * 1/3 + 3_000 * 123_456/556_677 - // ~= 2331.98605 - // Bob equity = vault_1_equity * 1/3 + vault_2_equity * 433_221/556_677 - // = 2_000 * 1/3 + 3_000 * 433_221/556_677 - // ~= 3001.34728 - // Carl equity = vault_1_equity * 1/3 - // = 2_000 * 1/3 - // ~= 666.66667 - // 0.001 USDC in equity should be granted 1 megavault share and round down to nearest integer. - expectedOwnerShares := map[string]*big.Int{ - constants.AliceAccAddress.String(): big.NewInt(2_331_986), - constants.BobAccAddress.String(): big.NewInt(3_001_347), - constants.CarlAccAddress.String(): big.NewInt(666_666), - } - // 2_331_986 + 3_001_347 + 666_666 = 5_999_999 - expectedTotalShares := big.NewInt(5_999_999) - - // Check MegaVault total shares. - resp, err := containertest.Query( - node, - vaulttypes.NewQueryClient, - vaulttypes.QueryClient.MegavaultTotalShares, - &vaulttypes.QueryMegavaultTotalSharesRequest{}, - ) - require.NoError(t, err) - require.NotNil(t, resp) - - totalSharesResp := vaulttypes.QueryMegavaultTotalSharesResponse{} - err = proto.UnmarshalText(resp.String(), &totalSharesResp) - require.NoError(t, err) - - require.Equal( - t, - expectedTotalShares, - totalSharesResp.TotalShares.NumShares.BigInt(), - ) - - // Check MegaVault owner shares. - resp, err = containertest.Query( - node, - vaulttypes.NewQueryClient, - vaulttypes.QueryClient.MegavaultAllOwnerShares, - &vaulttypes.QueryMegavaultAllOwnerSharesRequest{}, - ) - require.NoError(t, err) - require.NotNil(t, resp) - - allOwnerSharesResp := vaulttypes.QueryMegavaultAllOwnerSharesResponse{} - err = proto.UnmarshalText(resp.String(), &allOwnerSharesResp) - require.NoError(t, err) - - require.Len(t, allOwnerSharesResp.OwnerShares, 3) - gotOwnerShares := make(map[string]*big.Int) - for _, ownerShare := range allOwnerSharesResp.OwnerShares { - gotOwnerShares[ownerShare.Owner] = ownerShare.Shares.NumShares.BigInt() - } - for owner, expectedShares := range expectedOwnerShares { - require.Contains(t, gotOwnerShares, owner) - require.Equal(t, expectedShares, gotOwnerShares[owner]) - } -} - -func postUpgradeAffiliatesModuleTiersCheck(node *containertest.Node, t *testing.T) { - resp, err := containertest.Query( - node, - affiliatestypes.NewQueryClient, - affiliatestypes.QueryClient.AllAffiliateTiers, - &affiliatestypes.AllAffiliateTiersRequest{}, - ) - require.NoError(t, err) - require.NotNil(t, resp) - - affiliateTiersResp := affiliatestypes.AllAffiliateTiersResponse{} - err = proto.UnmarshalText(resp.String(), &affiliateTiersResp) - require.NoError(t, err) - require.Equal(t, affiliatestypes.DefaultAffiliateTiers, affiliateTiersResp.Tiers) -} - -func postUpgradeMegavaultModuleAccCheck(node *containertest.Node, t *testing.T) { - resp, err := containertest.Query( - node, - authtypes.NewQueryClient, - authtypes.QueryClient.ModuleAccountByName, - &authtypes.QueryModuleAccountByNameRequest{ - Name: vaulttypes.MegavaultAccountName, - }, - ) - require.NoError(t, err) - require.NotNil(t, resp) - - moduleAccResp := authtypes.QueryModuleAccountByNameResponse{} - err = proto.UnmarshalText(resp.String(), &moduleAccResp) - require.NoError(t, err) -} - -func postUpgradeListingModuleStateCheck(node *containertest.Node, t *testing.T) { - // Check that the listing module state has been initialized with the hard cap and default deposit params. - resp, err := containertest.Query( - node, - listingtypes.NewQueryClient, - listingtypes.QueryClient.ListingVaultDepositParams, - &listingtypes.QueryListingVaultDepositParams{}, - ) - require.NoError(t, err) - require.NotNil(t, resp) - - listingVaultDepositParamsResp := listingtypes.QueryListingVaultDepositParamsResponse{} - err = proto.UnmarshalText(resp.String(), &listingVaultDepositParamsResp) - require.NoError(t, err) - require.Equal(t, listingtypes.DefaultParams(), listingVaultDepositParamsResp.Params) - - resp, err = containertest.Query( - node, - listingtypes.NewQueryClient, - listingtypes.QueryClient.MarketsHardCap, - &listingtypes.QueryMarketsHardCap{}, - ) - require.NoError(t, err) - require.NotNil(t, resp) - - marketsHardCapResp := listingtypes.QueryMarketsHardCapResponse{} - err = proto.UnmarshalText(resp.String(), &marketsHardCapResp) - require.NoError(t, err) - require.Equal(t, uint32(500), marketsHardCapResp.HardCap) -} diff --git a/protocol/app/upgrades/v7.0.3/constants.go b/protocol/app/upgrades/v7.1/constants.go similarity index 90% rename from protocol/app/upgrades/v7.0.3/constants.go rename to protocol/app/upgrades/v7.1/constants.go index 6fa36c8276e..5f84fefec0b 100644 --- a/protocol/app/upgrades/v7.0.3/constants.go +++ b/protocol/app/upgrades/v7.1/constants.go @@ -1,4 +1,4 @@ -package v_7_0 +package v_7_1 import ( store "cosmossdk.io/store/types" @@ -7,7 +7,7 @@ import ( ) const ( - UpgradeName = "v7.0" + UpgradeName = "v7.1" ) var Upgrade = upgrades.Upgrade{ diff --git a/protocol/app/upgrades/v7.0.3/upgrade.go b/protocol/app/upgrades/v7.1/upgrade.go similarity index 98% rename from protocol/app/upgrades/v7.0.3/upgrade.go rename to protocol/app/upgrades/v7.1/upgrade.go index 1aeeb8688db..2cda3140116 100644 --- a/protocol/app/upgrades/v7.0.3/upgrade.go +++ b/protocol/app/upgrades/v7.1/upgrade.go @@ -1,4 +1,4 @@ -package v_7_0_3 +package v_7_1 import ( "context" diff --git a/protocol/app/upgrades/v7.0.3/upgrade_container_test.go b/protocol/app/upgrades/v7.1/upgrade_container_test.go similarity index 57% rename from protocol/app/upgrades/v7.0.3/upgrade_container_test.go rename to protocol/app/upgrades/v7.1/upgrade_container_test.go index 26bce038330..2c52befc4ec 100644 --- a/protocol/app/upgrades/v7.0.3/upgrade_container_test.go +++ b/protocol/app/upgrades/v7.1/upgrade_container_test.go @@ -1,15 +1,16 @@ -//go:build all || container_test - -package v_7_0_3_test +package v_7_1_test import ( "testing" - v_7_0_3 "github.com/dydxprotocol/v4-chain/protocol/app/upgrades/v7.0.3" + "github.com/cosmos/gogoproto/proto" + + v_7_1 "github.com/dydxprotocol/v4-chain/protocol/app/upgrades/v7.1" + clobtypes "github.com/dydxprotocol/v4-chain/protocol/x/clob/types" + perptypes "github.com/dydxprotocol/v4-chain/protocol/x/perpetuals/types" pricetypes "github.com/dydxprotocol/v4-chain/protocol/x/prices/types" - v_7_0 "github.com/dydxprotocol/v4-chain/protocol/app/upgrades/v7.0" "github.com/dydxprotocol/v4-chain/protocol/testing/containertest" "github.com/dydxprotocol/v4-chain/protocol/testutil/constants" "github.com/stretchr/testify/require" @@ -27,7 +28,7 @@ func TestStateUpgrade(t *testing.T) { preUpgradeSetups(node, t) preUpgradeChecks(node, t) - err = containertest.UpgradeTestnet(nodeAddress, t, node, v_7_0.UpgradeName) + err = containertest.UpgradeTestnet(nodeAddress, t, node, v_7_1.UpgradeName) require.NoError(t, err) postUpgradeChecks(node, t) @@ -49,29 +50,44 @@ func postUpgradeMarketIdsCheck(node *containertest.Node, t *testing.T) { resp, err := containertest.Query( node, pricetypes.NewQueryClient, - pricetypes.NextMarketId, - pricetypes.QueryNextMarketIdRequest{}, + pricetypes.QueryClient.NextMarketId, + &pricetypes.QueryNextMarketIdRequest{}, ) require.NoError(t, err) - require.Equal(t, uint32(v_7_0_3.ID_NUM), resp.NextMarketId) + require.NotNil(t, resp) + + nextMarketIdResp := pricetypes.QueryNextMarketIdResponse{} + err = proto.UnmarshalText(resp.String(), &nextMarketIdResp) + require.NoError(t, err) + require.Equal(t, uint32(v_7_1.ID_NUM), nextMarketIdResp.NextMarketId) // query the next perpetual id resp, err = containertest.Query( node, perptypes.NewQueryClient, - perptypes.NextPerpetualId, - perptypes.QueryNextPerpetualIdRequest{}, + perptypes.QueryClient.NextPerpetualId, + &perptypes.QueryNextPerpetualIdRequest{}, ) require.NoError(t, err) - require.Equal(t, uint32(v_7_0_3.ID_NUM), resp.NextPerpetualId) + require.NotNil(t, resp) + + nextPerpIdResp := perptypes.QueryNextPerpetualIdResponse{} + err = proto.UnmarshalText(resp.String(), &nextPerpIdResp) + require.NoError(t, err) + require.Equal(t, uint32(v_7_1.ID_NUM), nextPerpIdResp.NextPerpetualId) // query the next clob pair id resp, err = containertest.Query( node, clobtypes.NewQueryClient, - clobtypes.NextClobPairId, - clobtypes.QueryNextClobPairIdRequest{}, + clobtypes.QueryClient.NextClobPairId, + &clobtypes.QueryNextClobPairIdRequest{}, ) require.NoError(t, err) - require.Equal(t, uint32(v_7_0_3.ID_NUM), resp.NextClobPairId) + require.NotNil(t, resp) + + nextClobPairIdResp := clobtypes.QueryNextClobPairIdResponse{} + err = proto.UnmarshalText(resp.String(), &nextClobPairIdResp) + require.NoError(t, err) + require.Equal(t, uint32(v_7_1.ID_NUM), nextClobPairIdResp.NextClobPairId) } diff --git a/protocol/testing/version/VERSION_CURRENT b/protocol/testing/version/VERSION_CURRENT index 5593dc1fd46..9a0daa352b7 100644 --- a/protocol/testing/version/VERSION_CURRENT +++ b/protocol/testing/version/VERSION_CURRENT @@ -1 +1 @@ -v7.0 \ No newline at end of file +v7.1 \ No newline at end of file diff --git a/protocol/testing/version/VERSION_FULL_NAME_PREUPGRADE b/protocol/testing/version/VERSION_FULL_NAME_PREUPGRADE index 5d112be4c5c..d4a02f34471 100644 --- a/protocol/testing/version/VERSION_FULL_NAME_PREUPGRADE +++ b/protocol/testing/version/VERSION_FULL_NAME_PREUPGRADE @@ -1 +1 @@ -v6.0.0-dev999 \ No newline at end of file +v7.0.2 \ No newline at end of file diff --git a/protocol/testing/version/VERSION_PREUPGRADE b/protocol/testing/version/VERSION_PREUPGRADE index 9f925ba24c9..5593dc1fd46 100644 --- a/protocol/testing/version/VERSION_PREUPGRADE +++ b/protocol/testing/version/VERSION_PREUPGRADE @@ -1 +1 @@ -v6.0.0 \ No newline at end of file +v7.0 \ No newline at end of file From 7993aa054c91e1be629d9bdb09ce5000fcc452bc Mon Sep 17 00:00:00 2001 From: Shrenuj Bansal Date: Mon, 25 Nov 2024 14:21:30 -0500 Subject: [PATCH 03/12] mockery stuff Signed-off-by: Shrenuj Bansal --- .../src/codegen/dydxprotocol/prices/query.ts | 20 +++- proto/dydxprotocol/perpetuals/query.proto | 3 +- proto/dydxprotocol/prices/query.proto | 6 +- protocol/mocks/ClobKeeper.go | 5 + protocol/mocks/PerpetualsKeeper.go | 9 +- protocol/mocks/PricesKeeper.go | 5 + protocol/mocks/QueryClient.go | 111 ++++++++++++++++++ protocol/mocks/QueryServer.go | 30 +++++ protocol/x/prices/types/query.pb.go | 3 +- 9 files changed, 182 insertions(+), 10 deletions(-) diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/prices/query.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/prices/query.ts index 2730923e0f0..525f64b6b0a 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/prices/query.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/prices/query.ts @@ -157,16 +157,28 @@ export interface QueryNextMarketIdRequest {} /** QueryNextMarketIdRequest is request type for the Query/Params `NextMarketId` */ export interface QueryNextMarketIdRequestSDKType {} -/** QueryNextMarketIdResponse is response type for the Query/Params `NextMarketId` */ +/** + * QueryNextMarketIdResponse is response type for the Query/Params + * `NextMarketId` + */ export interface QueryNextMarketIdResponse { - /** QueryNextMarketIdResponse is response type for the Query/Params `NextMarketId` */ + /** + * QueryNextMarketIdResponse is response type for the Query/Params + * `NextMarketId` + */ nextMarketId: number; } -/** QueryNextMarketIdResponse is response type for the Query/Params `NextMarketId` */ +/** + * QueryNextMarketIdResponse is response type for the Query/Params + * `NextMarketId` + */ export interface QueryNextMarketIdResponseSDKType { - /** QueryNextMarketIdResponse is response type for the Query/Params `NextMarketId` */ + /** + * QueryNextMarketIdResponse is response type for the Query/Params + * `NextMarketId` + */ next_market_id: number; } diff --git a/proto/dydxprotocol/perpetuals/query.proto b/proto/dydxprotocol/perpetuals/query.proto index b849a707fd5..b69c4420504 100644 --- a/proto/dydxprotocol/perpetuals/query.proto +++ b/proto/dydxprotocol/perpetuals/query.proto @@ -46,7 +46,8 @@ service Query { } // Queries the next perpetual id. - rpc NextPerpetualId(QueryNextPerpetualIdRequest) returns (QueryNextPerpetualIdResponse) { + rpc NextPerpetualId(QueryNextPerpetualIdRequest) + returns (QueryNextPerpetualIdResponse) { option (google.api.http).get = "/dydxprotocol/perpetuals/next_perpetual_id"; } } diff --git a/proto/dydxprotocol/prices/query.proto b/proto/dydxprotocol/prices/query.proto index 1fc4ef1f07f..fc55b304e85 100644 --- a/proto/dydxprotocol/prices/query.proto +++ b/proto/dydxprotocol/prices/query.proto @@ -34,7 +34,8 @@ service Query { } // Queries the next market id. - rpc NextMarketId(QueryNextMarketIdRequest) returns (QueryNextMarketIdResponse) { + rpc NextMarketId(QueryNextMarketIdRequest) + returns (QueryNextMarketIdResponse) { option (google.api.http).get = "/dydxprotocol/prices/next_market_id"; } } @@ -88,5 +89,6 @@ message QueryAllMarketParamsResponse { // QueryNextMarketIdRequest is request type for the Query/Params `NextMarketId` message QueryNextMarketIdRequest {} -// QueryNextMarketIdResponse is response type for the Query/Params `NextMarketId` +// QueryNextMarketIdResponse is response type for the Query/Params +// `NextMarketId` message QueryNextMarketIdResponse { uint32 next_market_id = 1; } diff --git a/protocol/mocks/ClobKeeper.go b/protocol/mocks/ClobKeeper.go index 2a7b5cfd9ce..4b786d6b814 100644 --- a/protocol/mocks/ClobKeeper.go +++ b/protocol/mocks/ClobKeeper.go @@ -1134,6 +1134,11 @@ func (_m *ClobKeeper) SetLongTermOrderPlacement(ctx types.Context, order clobtyp _m.Called(ctx, order, blockHeight) } +// SetNextClobPairID provides a mock function with given fields: ctx, nextID +func (_m *ClobKeeper) SetNextClobPairID(ctx types.Context, nextID uint32) { + _m.Called(ctx, nextID) +} + // UnsafeMigrateOrderExpirationState provides a mock function with given fields: ctx func (_m *ClobKeeper) UnsafeMigrateOrderExpirationState(ctx types.Context) { _m.Called(ctx) diff --git a/protocol/mocks/PerpetualsKeeper.go b/protocol/mocks/PerpetualsKeeper.go index 38721a5f1e9..e856f54ced8 100644 --- a/protocol/mocks/PerpetualsKeeper.go +++ b/protocol/mocks/PerpetualsKeeper.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.44.1. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package mocks @@ -393,6 +393,11 @@ func (_m *PerpetualsKeeper) SetLiquidityTier(ctx types.Context, id uint32, name return r0, r1 } +// SetNextPerpetualID provides a mock function with given fields: ctx, nextID +func (_m *PerpetualsKeeper) SetNextPerpetualID(ctx types.Context, nextID uint32) { + _m.Called(ctx, nextID) +} + // SetParams provides a mock function with given fields: ctx, params func (_m *PerpetualsKeeper) SetParams(ctx types.Context, params perpetualstypes.Params) error { ret := _m.Called(ctx, params) @@ -469,4 +474,4 @@ func NewPerpetualsKeeper(t interface { t.Cleanup(func() { mock.AssertExpectations(t) }) return mock -} \ No newline at end of file +} diff --git a/protocol/mocks/PricesKeeper.go b/protocol/mocks/PricesKeeper.go index 4776407623a..6f7a5121191 100644 --- a/protocol/mocks/PricesKeeper.go +++ b/protocol/mocks/PricesKeeper.go @@ -418,6 +418,11 @@ func (_m *PricesKeeper) PerformStatefulPriceUpdateValidation(ctx types.Context, return r0 } +// SetNextMarketID provides a mock function with given fields: ctx, nextID +func (_m *PricesKeeper) SetNextMarketID(ctx types.Context, nextID uint32) { + _m.Called(ctx, nextID) +} + // UpdateMarketPrices provides a mock function with given fields: ctx, updates func (_m *PricesKeeper) UpdateMarketPrices(ctx types.Context, updates []*pricestypes.MsgUpdateMarketPrices_MarketPrice) error { ret := _m.Called(ctx, updates) diff --git a/protocol/mocks/QueryClient.go b/protocol/mocks/QueryClient.go index e8c611ebb3e..862029d0bda 100644 --- a/protocol/mocks/QueryClient.go +++ b/protocol/mocks/QueryClient.go @@ -696,6 +696,117 @@ func (_m *QueryClient) MevNodeToNodeCalculation(ctx context.Context, in *clobtyp return r0, r1 } +// NextClobPairId provides a mock function with given fields: ctx, in, opts +func (_m *QueryClient) NextClobPairId(ctx context.Context, in *clobtypes.QueryNextClobPairIdRequest, opts ...grpc.CallOption) (*clobtypes.QueryNextClobPairIdResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for NextClobPairId") + } + + var r0 *clobtypes.QueryNextClobPairIdResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *clobtypes.QueryNextClobPairIdRequest, ...grpc.CallOption) (*clobtypes.QueryNextClobPairIdResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *clobtypes.QueryNextClobPairIdRequest, ...grpc.CallOption) *clobtypes.QueryNextClobPairIdResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*clobtypes.QueryNextClobPairIdResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *clobtypes.QueryNextClobPairIdRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// NextMarketId provides a mock function with given fields: ctx, in, opts +func (_m *QueryClient) NextMarketId(ctx context.Context, in *pricestypes.QueryNextMarketIdRequest, opts ...grpc.CallOption) (*pricestypes.QueryNextMarketIdResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for NextMarketId") + } + + var r0 *pricestypes.QueryNextMarketIdResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *pricestypes.QueryNextMarketIdRequest, ...grpc.CallOption) (*pricestypes.QueryNextMarketIdResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *pricestypes.QueryNextMarketIdRequest, ...grpc.CallOption) *pricestypes.QueryNextMarketIdResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*pricestypes.QueryNextMarketIdResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *pricestypes.QueryNextMarketIdRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// NextPerpetualId provides a mock function with given fields: ctx, in, opts +func (_m *QueryClient) NextPerpetualId(ctx context.Context, in *perpetualstypes.QueryNextPerpetualIdRequest, opts ...grpc.CallOption) (*perpetualstypes.QueryNextPerpetualIdResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for NextPerpetualId") + } + + var r0 *perpetualstypes.QueryNextPerpetualIdResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *perpetualstypes.QueryNextPerpetualIdRequest, ...grpc.CallOption) (*perpetualstypes.QueryNextPerpetualIdResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *perpetualstypes.QueryNextPerpetualIdRequest, ...grpc.CallOption) *perpetualstypes.QueryNextPerpetualIdResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*perpetualstypes.QueryNextPerpetualIdResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *perpetualstypes.QueryNextPerpetualIdRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + // Params provides a mock function with given fields: ctx, in, opts func (_m *QueryClient) Params(ctx context.Context, in *perpetualstypes.QueryParamsRequest, opts ...grpc.CallOption) (*perpetualstypes.QueryParamsResponse, error) { _va := make([]interface{}, len(opts)) diff --git a/protocol/mocks/QueryServer.go b/protocol/mocks/QueryServer.go index 4a7770a9204..2e1187a66b5 100644 --- a/protocol/mocks/QueryServer.go +++ b/protocol/mocks/QueryServer.go @@ -135,6 +135,36 @@ func (_m *QueryServer) MarketPrice(_a0 context.Context, _a1 *types.QueryMarketPr return r0, r1 } +// NextMarketId provides a mock function with given fields: _a0, _a1 +func (_m *QueryServer) NextMarketId(_a0 context.Context, _a1 *types.QueryNextMarketIdRequest) (*types.QueryNextMarketIdResponse, error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for NextMarketId") + } + + var r0 *types.QueryNextMarketIdResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.QueryNextMarketIdRequest) (*types.QueryNextMarketIdResponse, error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *types.QueryNextMarketIdRequest) *types.QueryNextMarketIdResponse); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.QueryNextMarketIdResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *types.QueryNextMarketIdRequest) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + // NewQueryServer creates a new instance of QueryServer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewQueryServer(t interface { diff --git a/protocol/x/prices/types/query.pb.go b/protocol/x/prices/types/query.pb.go index 9a5129fd11f..dabafa61970 100644 --- a/protocol/x/prices/types/query.pb.go +++ b/protocol/x/prices/types/query.pb.go @@ -451,7 +451,8 @@ func (m *QueryNextMarketIdRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryNextMarketIdRequest proto.InternalMessageInfo -// QueryNextMarketIdResponse is response type for the Query/Params `NextMarketId` +// QueryNextMarketIdResponse is response type for the Query/Params +// `NextMarketId` type QueryNextMarketIdResponse struct { NextMarketId uint32 `protobuf:"varint,1,opt,name=next_market_id,json=nextMarketId,proto3" json:"next_market_id,omitempty"` } From 9b3b96a2aac6581b52c426cd3b9148c34a796e3c Mon Sep 17 00:00:00 2001 From: Shrenuj Bansal Date: Tue, 26 Nov 2024 13:20:28 -0500 Subject: [PATCH 04/12] move upgrade handlers to v8.0 Signed-off-by: Shrenuj Bansal --- protocol/app/upgrades.go | 12 +-- protocol/app/upgrades/v7.1/constants.go | 20 ---- protocol/app/upgrades/v7.1/upgrade.go | 53 ----------- .../upgrades/v7.1/upgrade_container_test.go | 93 ------------------- protocol/app/upgrades/v8.0/upgrade.go | 46 ++++++++- protocol/testing/version/VERSION_CURRENT | 2 +- .../version/VERSION_FULL_NAME_PREUPGRADE | 2 +- 7 files changed, 53 insertions(+), 175 deletions(-) delete mode 100644 protocol/app/upgrades/v7.1/constants.go delete mode 100644 protocol/app/upgrades/v7.1/upgrade.go delete mode 100644 protocol/app/upgrades/v7.1/upgrade_container_test.go diff --git a/protocol/app/upgrades.go b/protocol/app/upgrades.go index 34922cb12fc..90e4a4d0cc3 100644 --- a/protocol/app/upgrades.go +++ b/protocol/app/upgrades.go @@ -3,7 +3,7 @@ package app import ( "fmt" - v7_1 "github.com/dydxprotocol/v4-chain/protocol/app/upgrades/v7.1" + v_8_0 "github.com/dydxprotocol/v4-chain/protocol/app/upgrades/v8.0" upgradetypes "cosmossdk.io/x/upgrade/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -14,7 +14,7 @@ var ( // `Upgrades` defines the upgrade handlers and store loaders for the application. // New upgrades should be added to this slice after they are implemented. Upgrades = []upgrades.Upgrade{ - v7_1.Upgrade, + v_8_0.Upgrade, } Forks = []upgrades.Fork{} ) @@ -22,12 +22,12 @@ var ( // setupUpgradeHandlers registers the upgrade handlers to perform custom upgrade // logic and state migrations for software upgrades. func (app *App) setupUpgradeHandlers() { - if app.UpgradeKeeper.HasHandler(v7_1.UpgradeName) { - panic(fmt.Sprintf("Cannot register duplicate upgrade handler '%s'", v7_1.UpgradeName)) + if app.UpgradeKeeper.HasHandler(v_8_0.UpgradeName) { + panic(fmt.Sprintf("Cannot register duplicate upgrade handler '%s'", v_8_0.UpgradeName)) } app.UpgradeKeeper.SetUpgradeHandler( - v7_1.UpgradeName, - v7_1.CreateUpgradeHandler( + v_8_0.UpgradeName, + v_8_0.CreateUpgradeHandler( app.ModuleManager, app.configurator, app.PricesKeeper, diff --git a/protocol/app/upgrades/v7.1/constants.go b/protocol/app/upgrades/v7.1/constants.go deleted file mode 100644 index 5f84fefec0b..00000000000 --- a/protocol/app/upgrades/v7.1/constants.go +++ /dev/null @@ -1,20 +0,0 @@ -package v_7_1 - -import ( - store "cosmossdk.io/store/types" - "github.com/dydxprotocol/v4-chain/protocol/app/upgrades" - affiliatetypes "github.com/dydxprotocol/v4-chain/protocol/x/affiliates/types" -) - -const ( - UpgradeName = "v7.1" -) - -var Upgrade = upgrades.Upgrade{ - UpgradeName: UpgradeName, - StoreUpgrades: store.StoreUpgrades{ - Added: []string{ - affiliatetypes.StoreKey, - }, - }, -} diff --git a/protocol/app/upgrades/v7.1/upgrade.go b/protocol/app/upgrades/v7.1/upgrade.go deleted file mode 100644 index 2cda3140116..00000000000 --- a/protocol/app/upgrades/v7.1/upgrade.go +++ /dev/null @@ -1,53 +0,0 @@ -package v_7_1 - -import ( - "context" - "fmt" - - clobtypes "github.com/dydxprotocol/v4-chain/protocol/x/clob/types" - perptypes "github.com/dydxprotocol/v4-chain/protocol/x/perpetuals/types" - - upgradetypes "cosmossdk.io/x/upgrade/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - "github.com/dydxprotocol/v4-chain/protocol/lib" - pricestypes "github.com/dydxprotocol/v4-chain/protocol/x/prices/types" -) - -const ( - ID_NUM = 200 -) - -// Set market, perpetual, and clob ids to a set number -// This is done so that the ids are consistent for convenience -func setMarketListingBaseIds( - ctx sdk.Context, - pricesKeeper pricestypes.PricesKeeper, - perpetualsKeeper perptypes.PerpetualsKeeper, - clobKeeper clobtypes.ClobKeeper, -) { - // Set all ids to a set number - pricesKeeper.SetNextMarketID(ctx, ID_NUM) - - perpetualsKeeper.SetNextPerpetualID(ctx, ID_NUM) - - clobKeeper.SetNextClobPairID(ctx, ID_NUM) -} - -func CreateUpgradeHandler( - mm *module.Manager, - configurator module.Configurator, - pricesKeeper pricestypes.PricesKeeper, - perpetualsKeeper perptypes.PerpetualsKeeper, - clobKeeper clobtypes.ClobKeeper, -) upgradetypes.UpgradeHandler { - return func(ctx context.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { - sdkCtx := lib.UnwrapSDKContext(ctx, "app/upgrades") - sdkCtx.Logger().Info(fmt.Sprintf("Running %s Upgrade...", UpgradeName)) - - // Set market, perpetual, and clob ids to a set number - setMarketListingBaseIds(sdkCtx, pricesKeeper, perpetualsKeeper, clobKeeper) - - return mm.RunMigrations(ctx, configurator, vm) - } -} diff --git a/protocol/app/upgrades/v7.1/upgrade_container_test.go b/protocol/app/upgrades/v7.1/upgrade_container_test.go deleted file mode 100644 index 2c52befc4ec..00000000000 --- a/protocol/app/upgrades/v7.1/upgrade_container_test.go +++ /dev/null @@ -1,93 +0,0 @@ -package v_7_1_test - -import ( - "testing" - - "github.com/cosmos/gogoproto/proto" - - v_7_1 "github.com/dydxprotocol/v4-chain/protocol/app/upgrades/v7.1" - clobtypes "github.com/dydxprotocol/v4-chain/protocol/x/clob/types" - - perptypes "github.com/dydxprotocol/v4-chain/protocol/x/perpetuals/types" - pricetypes "github.com/dydxprotocol/v4-chain/protocol/x/prices/types" - - "github.com/dydxprotocol/v4-chain/protocol/testing/containertest" - "github.com/dydxprotocol/v4-chain/protocol/testutil/constants" - "github.com/stretchr/testify/require" -) - -func TestStateUpgrade(t *testing.T) { - testnet, err := containertest.NewTestnetWithPreupgradeGenesis() - require.NoError(t, err, "failed to create testnet - is docker daemon running?") - err = testnet.Start() - require.NoError(t, err) - defer testnet.MustCleanUp() - node := testnet.Nodes["alice"] - nodeAddress := constants.AliceAccAddress.String() - - preUpgradeSetups(node, t) - preUpgradeChecks(node, t) - - err = containertest.UpgradeTestnet(nodeAddress, t, node, v_7_1.UpgradeName) - require.NoError(t, err) - - postUpgradeChecks(node, t) -} - -func preUpgradeSetups(node *containertest.Node, t *testing.T) {} - -func preUpgradeChecks(node *containertest.Node, t *testing.T) { - // Add test for your upgrade handler logic below -} - -func postUpgradeChecks(node *containertest.Node, t *testing.T) { - // Check that the listing module state has been initialized with the hard cap and default deposit params. - postUpgradeMarketIdsCheck(node, t) -} - -func postUpgradeMarketIdsCheck(node *containertest.Node, t *testing.T) { - // query the next market id - resp, err := containertest.Query( - node, - pricetypes.NewQueryClient, - pricetypes.QueryClient.NextMarketId, - &pricetypes.QueryNextMarketIdRequest{}, - ) - require.NoError(t, err) - require.NotNil(t, resp) - - nextMarketIdResp := pricetypes.QueryNextMarketIdResponse{} - err = proto.UnmarshalText(resp.String(), &nextMarketIdResp) - require.NoError(t, err) - require.Equal(t, uint32(v_7_1.ID_NUM), nextMarketIdResp.NextMarketId) - - // query the next perpetual id - resp, err = containertest.Query( - node, - perptypes.NewQueryClient, - perptypes.QueryClient.NextPerpetualId, - &perptypes.QueryNextPerpetualIdRequest{}, - ) - require.NoError(t, err) - require.NotNil(t, resp) - - nextPerpIdResp := perptypes.QueryNextPerpetualIdResponse{} - err = proto.UnmarshalText(resp.String(), &nextPerpIdResp) - require.NoError(t, err) - require.Equal(t, uint32(v_7_1.ID_NUM), nextPerpIdResp.NextPerpetualId) - - // query the next clob pair id - resp, err = containertest.Query( - node, - clobtypes.NewQueryClient, - clobtypes.QueryClient.NextClobPairId, - &clobtypes.QueryNextClobPairIdRequest{}, - ) - require.NoError(t, err) - require.NotNil(t, resp) - - nextClobPairIdResp := clobtypes.QueryNextClobPairIdResponse{} - err = proto.UnmarshalText(resp.String(), &nextClobPairIdResp) - require.NoError(t, err) - require.Equal(t, uint32(v_7_1.ID_NUM), nextClobPairIdResp.NextClobPairId) -} diff --git a/protocol/app/upgrades/v8.0/upgrade.go b/protocol/app/upgrades/v8.0/upgrade.go index 12707b727b6..62e4b731ca3 100644 --- a/protocol/app/upgrades/v8.0/upgrade.go +++ b/protocol/app/upgrades/v8.0/upgrade.go @@ -2,8 +2,16 @@ package v_8_0 import ( "bytes" + "context" "fmt" + upgradetypes "cosmossdk.io/x/upgrade/types" + "github.com/cosmos/cosmos-sdk/types/module" + "github.com/dydxprotocol/v4-chain/protocol/lib" + clobtypes "github.com/dydxprotocol/v4-chain/protocol/x/clob/types" + perptypes "github.com/dydxprotocol/v4-chain/protocol/x/perpetuals/types" + pricestypes "github.com/dydxprotocol/v4-chain/protocol/x/prices/types" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" accountpluskeeper "github.com/dydxprotocol/v4-chain/protocol/x/accountplus/keeper" @@ -60,4 +68,40 @@ func migrateAccountplusAccountState(ctx sdk.Context, k accountpluskeeper.Keeper) ctx.Logger().Info("Successfully migrated accountplus AccountState keys") } -// TODO: Scaffolding for upgrade: https://linear.app/dydx/issue/OTE-886/v8-upgrade-handler-scaffold +const ( + ID_NUM = 200 +) + +// Set market, perpetual, and clob ids to a set number +// This is done so that the ids are consistent for convenience +func setMarketListingBaseIds( + ctx sdk.Context, + pricesKeeper pricestypes.PricesKeeper, + perpetualsKeeper perptypes.PerpetualsKeeper, + clobKeeper clobtypes.ClobKeeper, +) { + // Set all ids to a set number + pricesKeeper.SetNextMarketID(ctx, ID_NUM) + + perpetualsKeeper.SetNextPerpetualID(ctx, ID_NUM) + + clobKeeper.SetNextClobPairID(ctx, ID_NUM) +} + +func CreateUpgradeHandler( + mm *module.Manager, + configurator module.Configurator, + pricesKeeper pricestypes.PricesKeeper, + perpetualsKeeper perptypes.PerpetualsKeeper, + clobKeeper clobtypes.ClobKeeper, +) upgradetypes.UpgradeHandler { + return func(ctx context.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { + sdkCtx := lib.UnwrapSDKContext(ctx, "app/upgrades") + sdkCtx.Logger().Info(fmt.Sprintf("Running %s Upgrade...", UpgradeName)) + + // Set market, perpetual, and clob ids to a set number + setMarketListingBaseIds(sdkCtx, pricesKeeper, perpetualsKeeper, clobKeeper) + + return mm.RunMigrations(ctx, configurator, vm) + } +} diff --git a/protocol/testing/version/VERSION_CURRENT b/protocol/testing/version/VERSION_CURRENT index 9a0daa352b7..d46924618c1 100644 --- a/protocol/testing/version/VERSION_CURRENT +++ b/protocol/testing/version/VERSION_CURRENT @@ -1 +1 @@ -v7.1 \ No newline at end of file +v8.0 \ No newline at end of file diff --git a/protocol/testing/version/VERSION_FULL_NAME_PREUPGRADE b/protocol/testing/version/VERSION_FULL_NAME_PREUPGRADE index d4a02f34471..5d112be4c5c 100644 --- a/protocol/testing/version/VERSION_FULL_NAME_PREUPGRADE +++ b/protocol/testing/version/VERSION_FULL_NAME_PREUPGRADE @@ -1 +1 @@ -v7.0.2 \ No newline at end of file +v6.0.0-dev999 \ No newline at end of file From fd976422777b74010485ef980ef77e940f32d415 Mon Sep 17 00:00:00 2001 From: Shrenuj Bansal Date: Tue, 26 Nov 2024 14:05:37 -0500 Subject: [PATCH 05/12] add files Signed-off-by: Shrenuj Bansal --- protocol/app/upgrades/v8.0/constants.go | 20 ++++ .../upgrades/v8.0/upgrade_container_test.go | 93 +++++++++++++++++++ 2 files changed, 113 insertions(+) create mode 100644 protocol/app/upgrades/v8.0/constants.go create mode 100644 protocol/app/upgrades/v8.0/upgrade_container_test.go diff --git a/protocol/app/upgrades/v8.0/constants.go b/protocol/app/upgrades/v8.0/constants.go new file mode 100644 index 00000000000..644d31c87cd --- /dev/null +++ b/protocol/app/upgrades/v8.0/constants.go @@ -0,0 +1,20 @@ +package v_8_0 + +import ( + store "cosmossdk.io/store/types" + "github.com/dydxprotocol/v4-chain/protocol/app/upgrades" + affiliatetypes "github.com/dydxprotocol/v4-chain/protocol/x/affiliates/types" +) + +const ( + UpgradeName = "v8.0" +) + +var Upgrade = upgrades.Upgrade{ + UpgradeName: UpgradeName, + StoreUpgrades: store.StoreUpgrades{ + Added: []string{ + affiliatetypes.StoreKey, + }, + }, +} diff --git a/protocol/app/upgrades/v8.0/upgrade_container_test.go b/protocol/app/upgrades/v8.0/upgrade_container_test.go new file mode 100644 index 00000000000..5cb69acc65b --- /dev/null +++ b/protocol/app/upgrades/v8.0/upgrade_container_test.go @@ -0,0 +1,93 @@ +package v_8_0_test + +import ( + "testing" + + "github.com/cosmos/gogoproto/proto" + + v_7_1 "github.com/dydxprotocol/v4-chain/protocol/app/upgrades/v7.1" + clobtypes "github.com/dydxprotocol/v4-chain/protocol/x/clob/types" + + perptypes "github.com/dydxprotocol/v4-chain/protocol/x/perpetuals/types" + pricetypes "github.com/dydxprotocol/v4-chain/protocol/x/prices/types" + + "github.com/dydxprotocol/v4-chain/protocol/testing/containertest" + "github.com/dydxprotocol/v4-chain/protocol/testutil/constants" + "github.com/stretchr/testify/require" +) + +func TestStateUpgrade(t *testing.T) { + testnet, err := containertest.NewTestnetWithPreupgradeGenesis() + require.NoError(t, err, "failed to create testnet - is docker daemon running?") + err = testnet.Start() + require.NoError(t, err) + defer testnet.MustCleanUp() + node := testnet.Nodes["alice"] + nodeAddress := constants.AliceAccAddress.String() + + preUpgradeSetups(node, t) + preUpgradeChecks(node, t) + + err = containertest.UpgradeTestnet(nodeAddress, t, node, UpgradeName) + require.NoError(t, err) + + postUpgradeChecks(node, t) +} + +func preUpgradeSetups(node *containertest.Node, t *testing.T) {} + +func preUpgradeChecks(node *containertest.Node, t *testing.T) { + // Add test for your upgrade handler logic below +} + +func postUpgradeChecks(node *containertest.Node, t *testing.T) { + // Check that the listing module state has been initialized with the hard cap and default deposit params. + postUpgradeMarketIdsCheck(node, t) +} + +func postUpgradeMarketIdsCheck(node *containertest.Node, t *testing.T) { + // query the next market id + resp, err := containertest.Query( + node, + pricetypes.NewQueryClient, + pricetypes.QueryClient.NextMarketId, + &pricetypes.QueryNextMarketIdRequest{}, + ) + require.NoError(t, err) + require.NotNil(t, resp) + + nextMarketIdResp := pricetypes.QueryNextMarketIdResponse{} + err = proto.UnmarshalText(resp.String(), &nextMarketIdResp) + require.NoError(t, err) + require.Equal(t, uint32(v_7_1.ID_NUM), nextMarketIdResp.NextMarketId) + + // query the next perpetual id + resp, err = containertest.Query( + node, + perptypes.NewQueryClient, + perptypes.QueryClient.NextPerpetualId, + &perptypes.QueryNextPerpetualIdRequest{}, + ) + require.NoError(t, err) + require.NotNil(t, resp) + + nextPerpIdResp := perptypes.QueryNextPerpetualIdResponse{} + err = proto.UnmarshalText(resp.String(), &nextPerpIdResp) + require.NoError(t, err) + require.Equal(t, uint32(v_7_1.ID_NUM), nextPerpIdResp.NextPerpetualId) + + // query the next clob pair id + resp, err = containertest.Query( + node, + clobtypes.NewQueryClient, + clobtypes.QueryClient.NextClobPairId, + &clobtypes.QueryNextClobPairIdRequest{}, + ) + require.NoError(t, err) + require.NotNil(t, resp) + + nextClobPairIdResp := clobtypes.QueryNextClobPairIdResponse{} + err = proto.UnmarshalText(resp.String(), &nextClobPairIdResp) + require.NoError(t, err) + require.Equal(t, uint32(v_7_1.ID_NUM), nextClobPairIdResp.NextClobPairId) +} From e85ee6447ca65447b24e18d1c340b05323f9f42a Mon Sep 17 00:00:00 2001 From: Shrenuj Bansal Date: Tue, 26 Nov 2024 14:16:58 -0500 Subject: [PATCH 06/12] fix sumthin Signed-off-by: Shrenuj Bansal --- protocol/app/upgrades/v8.0/upgrade_container_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/protocol/app/upgrades/v8.0/upgrade_container_test.go b/protocol/app/upgrades/v8.0/upgrade_container_test.go index 5cb69acc65b..af746ae81c2 100644 --- a/protocol/app/upgrades/v8.0/upgrade_container_test.go +++ b/protocol/app/upgrades/v8.0/upgrade_container_test.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/gogoproto/proto" - v_7_1 "github.com/dydxprotocol/v4-chain/protocol/app/upgrades/v7.1" + v_8_0 "github.com/dydxprotocol/v4-chain/protocol/app/upgrades/v8.0" clobtypes "github.com/dydxprotocol/v4-chain/protocol/x/clob/types" perptypes "github.com/dydxprotocol/v4-chain/protocol/x/perpetuals/types" @@ -28,7 +28,7 @@ func TestStateUpgrade(t *testing.T) { preUpgradeSetups(node, t) preUpgradeChecks(node, t) - err = containertest.UpgradeTestnet(nodeAddress, t, node, UpgradeName) + err = containertest.UpgradeTestnet(nodeAddress, t, node, v_8_0.UpgradeName) require.NoError(t, err) postUpgradeChecks(node, t) From 77bab9378529075f2cd3d50986fe28285cbc52ea Mon Sep 17 00:00:00 2001 From: Shrenuj Bansal Date: Tue, 26 Nov 2024 14:24:50 -0500 Subject: [PATCH 07/12] moar 8.0 replace Signed-off-by: Shrenuj Bansal --- protocol/app/upgrades/v8.0/upgrade_container_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/protocol/app/upgrades/v8.0/upgrade_container_test.go b/protocol/app/upgrades/v8.0/upgrade_container_test.go index af746ae81c2..5f053d87bfe 100644 --- a/protocol/app/upgrades/v8.0/upgrade_container_test.go +++ b/protocol/app/upgrades/v8.0/upgrade_container_test.go @@ -59,7 +59,7 @@ func postUpgradeMarketIdsCheck(node *containertest.Node, t *testing.T) { nextMarketIdResp := pricetypes.QueryNextMarketIdResponse{} err = proto.UnmarshalText(resp.String(), &nextMarketIdResp) require.NoError(t, err) - require.Equal(t, uint32(v_7_1.ID_NUM), nextMarketIdResp.NextMarketId) + require.Equal(t, uint32(v_8_0.ID_NUM), nextMarketIdResp.NextMarketId) // query the next perpetual id resp, err = containertest.Query( @@ -74,7 +74,7 @@ func postUpgradeMarketIdsCheck(node *containertest.Node, t *testing.T) { nextPerpIdResp := perptypes.QueryNextPerpetualIdResponse{} err = proto.UnmarshalText(resp.String(), &nextPerpIdResp) require.NoError(t, err) - require.Equal(t, uint32(v_7_1.ID_NUM), nextPerpIdResp.NextPerpetualId) + require.Equal(t, uint32(v_8_0.ID_NUM), nextPerpIdResp.NextPerpetualId) // query the next clob pair id resp, err = containertest.Query( @@ -89,5 +89,5 @@ func postUpgradeMarketIdsCheck(node *containertest.Node, t *testing.T) { nextClobPairIdResp := clobtypes.QueryNextClobPairIdResponse{} err = proto.UnmarshalText(resp.String(), &nextClobPairIdResp) require.NoError(t, err) - require.Equal(t, uint32(v_7_1.ID_NUM), nextClobPairIdResp.NextClobPairId) + require.Equal(t, uint32(v_8_0.ID_NUM), nextClobPairIdResp.NextClobPairId) } From 5162057918f9f0fa0eadb540e1af8972b89b427a Mon Sep 17 00:00:00 2001 From: Shrenuj Bansal Date: Tue, 26 Nov 2024 16:13:52 -0500 Subject: [PATCH 08/12] fix import cycle Signed-off-by: Shrenuj Bansal --- protocol/app/upgrades/v8.0/constants.go | 9 ++------- protocol/app/upgrades/v8.0/migrate_accountplus_test.go | 6 ++++-- protocol/app/upgrades/v8.0/upgrade.go | 2 +- protocol/app/upgrades/v8.0/upgrade_container_test.go | 3 ++- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/protocol/app/upgrades/v8.0/constants.go b/protocol/app/upgrades/v8.0/constants.go index 644d31c87cd..27951ed50eb 100644 --- a/protocol/app/upgrades/v8.0/constants.go +++ b/protocol/app/upgrades/v8.0/constants.go @@ -3,7 +3,6 @@ package v_8_0 import ( store "cosmossdk.io/store/types" "github.com/dydxprotocol/v4-chain/protocol/app/upgrades" - affiliatetypes "github.com/dydxprotocol/v4-chain/protocol/x/affiliates/types" ) const ( @@ -11,10 +10,6 @@ const ( ) var Upgrade = upgrades.Upgrade{ - UpgradeName: UpgradeName, - StoreUpgrades: store.StoreUpgrades{ - Added: []string{ - affiliatetypes.StoreKey, - }, - }, + UpgradeName: UpgradeName, + StoreUpgrades: store.StoreUpgrades{}, } diff --git a/protocol/app/upgrades/v8.0/migrate_accountplus_test.go b/protocol/app/upgrades/v8.0/migrate_accountplus_test.go index 88be8a4994c..ce46cbf01ea 100644 --- a/protocol/app/upgrades/v8.0/migrate_accountplus_test.go +++ b/protocol/app/upgrades/v8.0/migrate_accountplus_test.go @@ -1,8 +1,10 @@ -package v_8_0 +package v_8_0_test import ( "testing" + v_8_0 "github.com/dydxprotocol/v4-chain/protocol/app/upgrades/v8.0" + "cosmossdk.io/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" testapp "github.com/dydxprotocol/v4-chain/protocol/testutil/app" @@ -54,7 +56,7 @@ func (s *UpgradeTestSuite) TestUpgrade_MigrateAccountplusAccountState() { } // Migrate - migrateAccountplusAccountState(ctx, s.tApp.App.AccountPlusKeeper) + v_8_0.MigrateAccountplusAccountState(ctx, s.tApp.App.AccountPlusKeeper) // Verify that unprefixed keys are deleted and prefixed keys exist for _, addr := range addresses { diff --git a/protocol/app/upgrades/v8.0/upgrade.go b/protocol/app/upgrades/v8.0/upgrade.go index 62e4b731ca3..b1edbb9e1cc 100644 --- a/protocol/app/upgrades/v8.0/upgrade.go +++ b/protocol/app/upgrades/v8.0/upgrade.go @@ -19,7 +19,7 @@ import ( ) // Migrate accountplus AccountState in kvstore from non-prefixed keys to prefixed keys -func migrateAccountplusAccountState(ctx sdk.Context, k accountpluskeeper.Keeper) { +func MigrateAccountplusAccountState(ctx sdk.Context, k accountpluskeeper.Keeper) { ctx.Logger().Info("Migrating accountplus module AccountState in kvstore from non-prefixed keys to prefixed keys") store := ctx.KVStore(k.GetStoreKey()) diff --git a/protocol/app/upgrades/v8.0/upgrade_container_test.go b/protocol/app/upgrades/v8.0/upgrade_container_test.go index 5f053d87bfe..b82f03ed23e 100644 --- a/protocol/app/upgrades/v8.0/upgrade_container_test.go +++ b/protocol/app/upgrades/v8.0/upgrade_container_test.go @@ -3,9 +3,10 @@ package v_8_0_test import ( "testing" + v_8_0 "github.com/dydxprotocol/v4-chain/protocol/app/upgrades/v8.0" + "github.com/cosmos/gogoproto/proto" - v_8_0 "github.com/dydxprotocol/v4-chain/protocol/app/upgrades/v8.0" clobtypes "github.com/dydxprotocol/v4-chain/protocol/x/clob/types" perptypes "github.com/dydxprotocol/v4-chain/protocol/x/perpetuals/types" From 6375908c034545e306e762300d0c4a03edbeb359 Mon Sep 17 00:00:00 2001 From: Shrenuj Bansal Date: Tue, 26 Nov 2024 16:49:33 -0500 Subject: [PATCH 09/12] change preupgrade name Signed-off-by: Shrenuj Bansal --- protocol/testing/version/VERSION_FULL_NAME_PREUPGRADE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocol/testing/version/VERSION_FULL_NAME_PREUPGRADE b/protocol/testing/version/VERSION_FULL_NAME_PREUPGRADE index 5d112be4c5c..d4a02f34471 100644 --- a/protocol/testing/version/VERSION_FULL_NAME_PREUPGRADE +++ b/protocol/testing/version/VERSION_FULL_NAME_PREUPGRADE @@ -1 +1 @@ -v6.0.0-dev999 \ No newline at end of file +v7.0.2 \ No newline at end of file From c723ddcc54ff39c65305927b0bf9b00e041049b9 Mon Sep 17 00:00:00 2001 From: Shrenuj Bansal Date: Tue, 26 Nov 2024 19:59:01 -0500 Subject: [PATCH 10/12] update preupgrade genesis to v7 Signed-off-by: Shrenuj Bansal --- .../containertest/preupgrade_genesis.json | 291 +++++++++--------- 1 file changed, 154 insertions(+), 137 deletions(-) diff --git a/protocol/testing/containertest/preupgrade_genesis.json b/protocol/testing/containertest/preupgrade_genesis.json index 612ed3f5f53..5638c4f3d4c 100644 --- a/protocol/testing/containertest/preupgrade_genesis.json +++ b/protocol/testing/containertest/preupgrade_genesis.json @@ -1,11 +1,57 @@ { - "app_name": "dydxprotocold", - "app_version": "6.0.0-dev999", "genesis_time": "2023-01-01T00:00:00Z", "chain_id": "localdydxprotocol", - "initial_height": 1, - "app_hash": null, + "initial_height": "1", + "consensus_params": { + "block": { + "max_bytes": "4194304", + "max_gas": "-1" + }, + "evidence": { + "max_age_num_blocks": "100000", + "max_age_duration": "172800000000000", + "max_bytes": "1048576" + }, + "validator": { + "pub_key_types": [ + "ed25519" + ] + }, + "version": { + "app": "0" + }, + "abci": { + "vote_extensions_enable_height": "1" + } + }, + "app_hash": "", "app_state": { + "affiliates": { + "affiliate_tiers": { + "tiers": [ + { + "req_referred_volume_quote_quantums": "0", + "req_staked_whole_coins": 0, + "taker_fee_share_ppm": 50000 + }, + { + "req_referred_volume_quote_quantums": "1000000000000", + "req_staked_whole_coins": 200, + "taker_fee_share_ppm": 100000 + }, + { + "req_referred_volume_quote_quantums": "5000000000000", + "req_staked_whole_coins": 1000, + "taker_fee_share_ppm": 125000 + }, + { + "req_referred_volume_quote_quantums": "25000000000000", + "req_staked_whole_coins": 5000, + "taker_fee_share_ppm": 150000 + } + ] + } + }, "assets": { "assets": [ { @@ -775,7 +821,12 @@ "validator_slash_events": [] }, "dydxaccountplus": { - "accounts": [] + "accounts": [], + "params": { + "is_smart_account_active": false + }, + "next_authenticator_id": "0", + "authenticator_data": [] }, "epochs": { "epoch_info_list": [ @@ -1159,8 +1210,8 @@ "amount": "10000000" } ], - "max_deposit_period": "300s", - "voting_period": "300s", + "max_deposit_period": "120s", + "voting_period": "120s", "quorum": "0.334000000000000000", "threshold": "0.500000000000000000", "veto_threshold": "0.334000000000000000", @@ -1246,7 +1297,12 @@ } }, "listing": { - "hard_cap_for_markets": 0 + "hard_cap_for_markets": 500, + "listing_vault_deposit_params": { + "new_vault_deposit_amount": "10000000000", + "main_vault_deposit_amount": "0", + "num_blocks_to_lock_shares": 2592000 + } }, "marketmap": { "market_map": { @@ -1426,21 +1482,20 @@ } ] }, - "POL/USD": { + "MATIC/USD": { "ticker": { "currency_pair": { - "Base": "POL", + "Base": "MATIC", "Quote": "USD" }, - "decimals": "10", - "min_provider_count": "3", - "enabled": true, - "metadata_JSON": "" + "decimals": 10, + "min_provider_count": 3, + "enabled": true }, "provider_configs": [ { "name": "binance_ws", - "off_chain_ticker": "POLUSDT", + "off_chain_ticker": "MATICUSDT", "normalize_by_pair": { "Base": "USDT", "Quote": "USD" @@ -1448,7 +1503,7 @@ }, { "name": "bybit_ws", - "off_chain_ticker": "POLUSDT", + "off_chain_ticker": "MATICUSDT", "normalize_by_pair": { "Base": "USDT", "Quote": "USD" @@ -1456,15 +1511,39 @@ }, { "name": "coinbase_ws", - "off_chain_ticker": "POL-USD" + "off_chain_ticker": "MATIC-USD" }, { - "name": "crypto_dot_com_ws", - "off_chain_ticker": "POL_USD" + "name": "gate_ws", + "off_chain_ticker": "MATIC_USDT", + "normalize_by_pair": { + "Base": "USDT", + "Quote": "USD" + } + }, + { + "name": "huobi_ws", + "off_chain_ticker": "maticusdt", + "normalize_by_pair": { + "Base": "USDT", + "Quote": "USD" + } + }, + { + "name": "kraken_api", + "off_chain_ticker": "MATICUSD" + }, + { + "name": "kucoin_ws", + "off_chain_ticker": "MATIC-USDT", + "normalize_by_pair": { + "Base": "USDT", + "Quote": "USD" + } }, { "name": "okx_ws", - "off_chain_ticker": "POL-USDT", + "off_chain_ticker": "MATIC-USDT", "normalize_by_pair": { "Base": "USDT", "Quote": "USD" @@ -3345,7 +3424,7 @@ }, { "params": { - "ticker": "POL-USD", + "ticker": "MATIC-USD", "id": 3, "market_id": 3, "atomic_resolution": -5, @@ -3680,7 +3759,7 @@ "market_id": 33, "atomic_resolution": -10, "default_funding_ppm": 0, - "liquidity_tier": 4, + "liquidity_tier": 7, "market_type": 1 } } @@ -3691,17 +3770,15 @@ "name": "Large-Cap", "initial_margin_ppm": 50000, "maintenance_fraction_ppm": 600000, - "base_position_notional": 1000000000000, "impact_notional": 10000000000, "open_interest_lower_cap": 0, "open_interest_upper_cap": 0 }, { "id": 1, - "name": "Mid-Cap", + "name": "Small-Cap", "initial_margin_ppm": 100000, "maintenance_fraction_ppm": 500000, - "base_position_notional": 250000000000, "impact_notional": 5000000000, "open_interest_lower_cap": 20000000000000, "open_interest_upper_cap": 50000000000000 @@ -3711,7 +3788,6 @@ "name": "Long-Tail", "initial_margin_ppm": 200000, "maintenance_fraction_ppm": 500000, - "base_position_notional": 100000000000, "impact_notional": 2500000000, "open_interest_lower_cap": 5000000000000, "open_interest_upper_cap": 10000000000000 @@ -3721,25 +3797,49 @@ "name": "Safety", "initial_margin_ppm": 1000000, "maintenance_fraction_ppm": 200000, - "base_position_notional": 1000000000, "impact_notional": 2500000000, "open_interest_lower_cap": 2000000000000, "open_interest_upper_cap": 5000000000000 }, { "id": 4, + "name": "Isolated", + "initial_margin_ppm": 50000, + "maintenance_fraction_ppm": 600000, + "impact_notional": 2500000000, + "open_interest_lower_cap": 500000000000, + "open_interest_upper_cap": 1000000000000 + }, + { + "id": 5, + "name": "Mid-Cap", + "initial_margin_ppm": 50000, + "maintenance_fraction_ppm": 600000, + "impact_notional": 5000000000, + "open_interest_lower_cap": 40000000000000, + "open_interest_upper_cap": 100000000000000 + }, + { + "id": 6, + "name": "FX", + "initial_margin_ppm": 10000, + "maintenance_fraction_ppm": 500000, + "impact_notional": 2500000000, + "open_interest_lower_cap": 500000000000, + "open_interest_upper_cap": 1000000000000 + }, + { + "id": 7, "name": "test-usd-100x-liq-tier-linear", "initial_margin_ppm": 10007, "maintenance_fraction_ppm": 500009, - "base_position_notional": 1000000000039, "impact_notional": 50000000000 }, { - "id": 5, + "id": 8, "name": "test-usd-100x-liq-tier-nonlinear", "initial_margin_ppm": 10007, "maintenance_fraction_ppm": 500009, - "base_position_notional": 100000007, "impact_notional": 50000000000 } ], @@ -3776,12 +3876,12 @@ "exchange_config_json": "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"LINKUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Bybit\",\"ticker\":\"LINKUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"CoinbasePro\",\"ticker\":\"LINK-USD\"},{\"exchangeName\":\"Kraken\",\"ticker\":\"LINKUSD\"},{\"exchangeName\":\"Kucoin\",\"ticker\":\"LINK-USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Okx\",\"ticker\":\"LINK-USDT\",\"adjustByMarket\":\"USDT-USD\"}]}" }, { - "pair": "POL-USD", + "pair": "MATIC-USD", "id": 3, "exponent": -10, "min_exchanges": 3, "min_price_change_ppm": 2500, - "exchange_config_json": "{\"exchanges\":[{\"exchangeName\":\"Bybit\",\"ticker\":\"POLUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"CoinbasePro\",\"ticker\":\"POL-USD\"},{\"exchangeName\":\"CryptoCom\",\"ticker\":\"POL_USD\"},{\"exchangeName\":\"Okx\",\"ticker\":\"POL-USDT\",\"adjustByMarket\":\"USDT-USD\"}]}" + "exchange_config_json": "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"MATICUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Bybit\",\"ticker\":\"MATICUSDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"CoinbasePro\",\"ticker\":\"MATIC-USD\"},{\"exchangeName\":\"Gate\",\"ticker\":\"MATIC_USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Huobi\",\"ticker\":\"maticusdt\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Kraken\",\"ticker\":\"MATICUSD\"},{\"exchangeName\":\"Kucoin\",\"ticker\":\"MATIC-USDT\",\"adjustByMarket\":\"USDT-USD\"},{\"exchangeName\":\"Okx\",\"ticker\":\"MATIC-USDT\",\"adjustByMarket\":\"USDT-USD\"}]}" }, { "pair": "CRV-USD", @@ -4331,21 +4431,7 @@ "asset_positions": [ { "asset_id": 0, - "quantums": "2000000000", - "index": 0 - } - ] - }, - { - "id": { - "owner": "dydx190te44zcctdgk0qmqtenve2m00g3r2dn7ntd72", - "number": 0 - }, - "margin_enabled": true, - "asset_positions": [ - { - "asset_id": 0, - "quantums": "3000000000", + "quantums": "1000000000", "index": 0 } ] @@ -4363,31 +4449,25 @@ }, "upgrade": {}, "vault": { + "total_shares": { + "num_shares": "2000000000" + }, + "owner_shares": [ + { + "owner": "dydx199tqg4wdlnu4qjlxchpd7seg454937hjrknju4", + "shares": { + "num_shares": "2000000000" + } + } + ], "vaults": [ { "vault_id": { "type": "VAULT_TYPE_CLOB", "number": 0 }, - "total_shares": { - "num_shares": "1000000000" - }, - "owner_shares": [ - { - "owner": "dydx199tqg4wdlnu4qjlxchpd7seg454937hjrknju4", - "shares": { - "num_shares": "1000000000" - } - } - ], - "quoting_params": { - "layers": 3, - "spread_min_ppm": 1500, - "spread_buffer_ppm": 500, - "skew_factor_ppm": 1000000, - "order_size_pct_ppm": 50000, - "order_expiration_seconds": 30, - "activation_threshold_quote_quantums": "500000000" + "vault_params": { + "status": "VAULT_STATUS_QUOTING" } }, { @@ -4395,52 +4475,9 @@ "type": "VAULT_TYPE_CLOB", "number": 1 }, - "total_shares": { - "num_shares": "3000000000" - }, - "owner_shares": [ - { - "owner": "dydx199tqg4wdlnu4qjlxchpd7seg454937hjrknju4", - "shares": { - "num_shares": "1000000000" - } - }, - { - "owner": "dydx10fx7sy6ywd5senxae9dwytf8jxek3t2gcen2vs", - "shares": { - "num_shares": "1000000000" - } - }, - { - "owner": "dydx1fjg6zp6vv8t9wvy4lps03r5l4g7tkjw9wvmh70", - "shares": { - "num_shares": "1000000000" - } - } - ] - }, - { - "vault_id": { - "type": "VAULT_TYPE_CLOB", - "number": 2 - }, - "total_shares": { - "num_shares": "556677" - }, - "owner_shares": [ - { - "owner": "dydx199tqg4wdlnu4qjlxchpd7seg454937hjrknju4", - "shares": { - "num_shares": "123456" - } - }, - { - "owner": "dydx10fx7sy6ywd5senxae9dwytf8jxek3t2gcen2vs", - "shares": { - "num_shares": "433221" - } - } - ] + "vault_params": { + "status": "VAULT_STATUS_QUOTING" + } } ], "default_quoting_params": { @@ -4451,6 +4488,10 @@ "order_size_pct_ppm": 100000, "order_expiration_seconds": 60, "activation_threshold_quote_quantums": "1000000000" + }, + "all_owner_share_unlocks": [], + "operator_params": { + "operator": "dydx10d07y265gmmuvt4z0w9aw880jnsr700jnmapky" } }, "vest": { @@ -4471,29 +4512,5 @@ } ] } - }, - "consensus": { - "params": { - "block": { - "max_bytes": "4194304", - "max_gas": "-1" - }, - "evidence": { - "max_age_num_blocks": "100000", - "max_age_duration": "172800000000000", - "max_bytes": "1048576" - }, - "validator": { - "pub_key_types": [ - "ed25519" - ] - }, - "version": { - "app": "0" - }, - "abci": { - "vote_extensions_enable_height": "1" - } - } } -} \ No newline at end of file +} From efc9b74e61fbf13fac985f21ab48e4ba5a6ab516 Mon Sep 17 00:00:00 2001 From: Shrenuj Bansal Date: Wed, 27 Nov 2024 01:41:34 -0500 Subject: [PATCH 11/12] add build flag Signed-off-by: Shrenuj Bansal --- protocol/app/upgrades/v8.0/upgrade_container_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/protocol/app/upgrades/v8.0/upgrade_container_test.go b/protocol/app/upgrades/v8.0/upgrade_container_test.go index b82f03ed23e..90846694fc6 100644 --- a/protocol/app/upgrades/v8.0/upgrade_container_test.go +++ b/protocol/app/upgrades/v8.0/upgrade_container_test.go @@ -1,3 +1,5 @@ +//go:build all || container_test + package v_8_0_test import ( From 77b5c5c88ad70f914f5b788107042df09e64221d Mon Sep 17 00:00:00 2001 From: Shrenuj Bansal Date: Wed, 27 Nov 2024 12:01:04 -0500 Subject: [PATCH 12/12] move starting ids to 300 Signed-off-by: Shrenuj Bansal --- protocol/app/upgrades/v8.0/upgrade.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocol/app/upgrades/v8.0/upgrade.go b/protocol/app/upgrades/v8.0/upgrade.go index b1edbb9e1cc..dbce44bb9d1 100644 --- a/protocol/app/upgrades/v8.0/upgrade.go +++ b/protocol/app/upgrades/v8.0/upgrade.go @@ -69,7 +69,7 @@ func MigrateAccountplusAccountState(ctx sdk.Context, k accountpluskeeper.Keeper) } const ( - ID_NUM = 200 + ID_NUM = 300 ) // Set market, perpetual, and clob ids to a set number