From 55eb238c19c26ae77c471773043dd5bcc5948a57 Mon Sep 17 00:00:00 2001 From: Mohammed Affan Date: Wed, 16 Oct 2024 13:30:49 -0400 Subject: [PATCH] [OTE-877] deprecate OI indexer update event (#2499) (cherry picked from commit 4208b7beb05d5576f3aaf3c4d2dc2f762870529f) # Conflicts: # protocol/indexer/events/events.pb.go --- .../dydxprotocol/indexer/events/events.ts | 32 +++- .../dydxprotocol/indexer/events/events.proto | 4 + protocol/indexer/events/events.pb.go | 165 +++++++++++++++++- protocol/x/clob/e2e/long_term_orders_test.go | 64 ------- protocol/x/clob/e2e/short_term_orders_test.go | 55 ------ protocol/x/perpetuals/abci.go | 1 - protocol/x/perpetuals/abci_test.go | 4 - protocol/x/perpetuals/keeper/perpetual.go | 45 ----- .../x/perpetuals/keeper/perpetual_test.go | 26 --- protocol/x/perpetuals/types/types.go | 1 - 10 files changed, 191 insertions(+), 206 deletions(-) diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/indexer/events/events.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/indexer/events/events.ts index 81bf376329..7815ffb32b 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/indexer/events/events.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/indexer/events/events.ts @@ -1365,31 +1365,47 @@ export interface AddressTradingRewardSDKType { denom_amount: Uint8Array; } -/** OpenInterestUpdateEventV1 is used for open interest update events */ +/** + * OpenInterestUpdateEventV1 is used for open interest update events + * Deprecated. + */ + +/** @deprecated */ export interface OpenInterestUpdateEventV1 { - /** The list of all open interest updates in the block. */ openInterestUpdates: OpenInterestUpdate[]; } -/** OpenInterestUpdateEventV1 is used for open interest update events */ +/** + * OpenInterestUpdateEventV1 is used for open interest update events + * Deprecated. + */ + +/** @deprecated */ export interface OpenInterestUpdateEventV1SDKType { - /** The list of all open interest updates in the block. */ open_interest_updates: OpenInterestUpdateSDKType[]; } -/** OpenInterestUpdate contains a single open interest update for a perpetual */ +/** + * OpenInterestUpdate contains a single open interest update for a perpetual + * Deprecated. + */ + +/** @deprecated */ export interface OpenInterestUpdate { - /** The ID of the perpetual market. */ perpetualId: number; /** The new open interest value for the perpetual market. */ openInterest: Uint8Array; } -/** OpenInterestUpdate contains a single open interest update for a perpetual */ +/** + * OpenInterestUpdate contains a single open interest update for a perpetual + * Deprecated. + */ + +/** @deprecated */ export interface OpenInterestUpdateSDKType { - /** The ID of the perpetual market. */ perpetual_id: number; /** The new open interest value for the perpetual market. */ diff --git a/proto/dydxprotocol/indexer/events/events.proto b/proto/dydxprotocol/indexer/events/events.proto index 2b6b1eec7e..8f2a6ce88f 100644 --- a/proto/dydxprotocol/indexer/events/events.proto +++ b/proto/dydxprotocol/indexer/events/events.proto @@ -531,14 +531,18 @@ message AddressTradingReward { } // OpenInterestUpdateEventV1 is used for open interest update events +// Deprecated. message OpenInterestUpdateEventV1 { // The list of all open interest updates in the block. + option deprecated = true; repeated OpenInterestUpdate open_interest_updates = 1; } // OpenInterestUpdate contains a single open interest update for a perpetual +// Deprecated. message OpenInterestUpdate { // The ID of the perpetual market. + option deprecated = true; uint32 perpetual_id = 1; // The new open interest value for the perpetual market. diff --git a/protocol/indexer/events/events.pb.go b/protocol/indexer/events/events.pb.go index 61d702ee01..f4db3b4981 100644 --- a/protocol/indexer/events/events.pb.go +++ b/protocol/indexer/events/events.pb.go @@ -2334,8 +2334,10 @@ func (m *AddressTradingReward) GetOwner() string { } // OpenInterestUpdateEventV1 is used for open interest update events +// Deprecated. +// +// Deprecated: Do not use. type OpenInterestUpdateEventV1 struct { - // The list of all open interest updates in the block. OpenInterestUpdates []*OpenInterestUpdate `protobuf:"bytes,1,rep,name=open_interest_updates,json=openInterestUpdates,proto3" json:"open_interest_updates,omitempty"` } @@ -2380,8 +2382,10 @@ func (m *OpenInterestUpdateEventV1) GetOpenInterestUpdates() []*OpenInterestUpda } // OpenInterestUpdate contains a single open interest update for a perpetual +// Deprecated. +// +// Deprecated: Do not use. type OpenInterestUpdate struct { - // The ID of the perpetual market. PerpetualId uint32 `protobuf:"varint,1,opt,name=perpetual_id,json=perpetualId,proto3" json:"perpetual_id,omitempty"` // The new open interest value for the perpetual market. OpenInterest github_com_dydxprotocol_v4_chain_protocol_dtypes.SerializableInt `protobuf:"bytes,2,opt,name=open_interest,json=openInterest,proto3,customtype=github.com/dydxprotocol/v4-chain/protocol/dtypes.SerializableInt" json:"open_interest"` @@ -2576,6 +2580,7 @@ func init() { } var fileDescriptor_6331dfb59c6fd2bb = []byte{ +<<<<<<< HEAD // 2322 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x59, 0xcd, 0x6f, 0x23, 0x49, 0x15, 0x4f, 0xdb, 0x8e, 0xe3, 0x3c, 0xc7, 0x19, 0xbb, 0xc6, 0xc9, 0x38, 0x09, 0x64, 0x86, 0x96, @@ -2723,6 +2728,162 @@ var fileDescriptor_6331dfb59c6fd2bb = []byte{ 0xb1, 0x3c, 0xf1, 0xf7, 0x17, 0xcb, 0x13, 0x0f, 0xdf, 0x1b, 0x3f, 0x78, 0xdd, 0x1f, 0xef, 0x4f, 0xb2, 0x82, 0xf1, 0xb5, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x6f, 0xa5, 0x55, 0x11, 0xe2, 0x1f, 0x00, 0x00, +======= + // 2441 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x5a, 0xcd, 0x6f, 0x24, 0x47, + 0x15, 0x77, 0xcf, 0x8c, 0xc7, 0xe3, 0x37, 0x1e, 0xef, 0x4c, 0xed, 0xd8, 0x3b, 0xb6, 0x61, 0x77, + 0x69, 0x09, 0x69, 0x95, 0x8f, 0xf1, 0xae, 0x49, 0xa2, 0x28, 0x07, 0x84, 0xc7, 0x1f, 0xf1, 0x58, + 0xb6, 0x77, 0xd2, 0xfe, 0x48, 0xb2, 0xa0, 0x34, 0xe5, 0xee, 0x9a, 0x71, 0xc9, 0xfd, 0xb5, 0x5d, + 0x3d, 0xde, 0x78, 0x11, 0x37, 0x44, 0x38, 0x20, 0x81, 0x84, 0x38, 0x70, 0x40, 0xe2, 0xc2, 0x25, + 0x12, 0x07, 0x24, 0xc4, 0x8d, 0x03, 0xe2, 0x92, 0x1b, 0x11, 0x27, 0x04, 0x52, 0x84, 0x92, 0x03, + 0xff, 0x06, 0xaa, 0x8f, 0xee, 0xf9, 0x1e, 0xcf, 0xc6, 0x8e, 0x84, 0x10, 0x27, 0x4f, 0xbd, 0x57, + 0xef, 0xf7, 0x5e, 0xbd, 0xf7, 0xaa, 0xea, 0xd5, 0x6b, 0xc3, 0x03, 0xfb, 0xd2, 0xfe, 0x30, 0x08, + 0xfd, 0xc8, 0xb7, 0x7c, 0x67, 0x95, 0x7a, 0x36, 0xf9, 0x90, 0x84, 0xab, 0xe4, 0x82, 0x78, 0x11, + 0x53, 0x7f, 0xaa, 0x82, 0x8d, 0x56, 0xba, 0x67, 0x56, 0xd5, 0xcc, 0xaa, 0x9c, 0xb2, 0xbc, 0x64, + 0xf9, 0xcc, 0xf5, 0x99, 0x29, 0xf8, 0xab, 0x72, 0x20, 0xe5, 0x96, 0xcb, 0x2d, 0xbf, 0xe5, 0x4b, + 0x3a, 0xff, 0xa5, 0xa8, 0x0f, 0x87, 0xea, 0x65, 0x67, 0x38, 0x24, 0xf6, 0x6a, 0x48, 0x5c, 0xff, + 0x02, 0x3b, 0x66, 0x48, 0x30, 0xf3, 0x3d, 0x25, 0xf1, 0xf2, 0x50, 0x89, 0x84, 0x70, 0xf1, 0x68, + 0xd5, 0x72, 0xfc, 0xd3, 0xb1, 0xf0, 0xdd, 0x93, 0x03, 0x12, 0x06, 0x24, 0x6a, 0x63, 0x47, 0x49, + 0x3c, 0xba, 0x52, 0x82, 0xb5, 0x4f, 0xb1, 0x65, 0xf9, 0x6d, 0x2f, 0x52, 0x22, 0xaf,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, + 0x13, 0xab, 0x9c, 0xad, 0x55, 0xfe, 0xf6, 0x87, 0x57, 0xcb, 0xea, 0x02, 0x59, 0x97, 0x9c, 0xc3, + 0x28, 0xa4, 0x5e, 0x6b, 0x67, 0xca, 0x88, 0xa7, 0xd6, 0x72, 0x90, 0x65, 0xc2, 0x48, 0xfd, 0xe3, + 0x34, 0xdc, 0x3a, 0x0a, 0xb1, 0xc7, 0x9a, 0x24, 0x8c, 0xfd, 0xd0, 0x82, 0x32, 0x23, 0x9e, 0x4d, + 0x42, 0xf3, 0xe6, 0x0c, 0x37, 0x90, 0x84, 0xec, 0xa6, 0x21, 0x17, 0xee, 0x84, 0xc4, 0xa2, 0x01, + 0x25, 0x5e, 0xd4, 0xa7, 0x2b, 0x75, 0x1d, 0x5d, 0x0b, 0x09, 0x6a, 0x8f, 0xba, 0x25, 0xc8, 0x61, + 0xc6, 0xe4, 0x31, 0x92, 0x16, 0x29, 0x39, 0x23, 0xc6, 0x75, 0x1b, 0x2d, 0x42, 0x16, 0xbb, 0x7c, + 0x9a, 0xd8, 0x89, 0x19, 0x43, 0x8d, 0x50, 0x0d, 0xb2, 0xd2, 0xee, 0xca, 0xb4, 0x30, 0xe8, 0xa5, + 0xb1, 0x49, 0xd1, 0x13, 0x78, 0x43, 0x49, 0xa2, 0x1d, 0x98, 0x4d, 0xec, 0xa9, 0x64, 0x5f, 0x18, + 0xa6, 0x23, 0xac, 0x7f, 0x94, 0x81, 0xe2, 0xe3, 0xd0, 0x26, 0xe1, 0x36, 0x75, 0x9c, 0x38, 0x5a, + 0xc7, 0x90, 0x77, 0xf1, 0x39, 0x09, 0x4d, 0x9f, 0x73, 0xc6, 0x27, 0xef, 0x10, 0xc7, 0x09, 0x3c, + 0x75, 0x71, 0x80, 0x00, 0x12, 0x14, 0xb4, 0x0d, 0xd3, 0x12, 0x30, 0xf5, 0x65, 0x00, 0x77, 0xa6, + 0x0c, 0x29, 0x8e, 0x3e, 0x80, 0x92, 0x43, 0x9f, 0xb6, 0xa9, 0x8d, 0x23, 0xea, 0x7b, 0xca, 0x48, + 0x79, 0xdc, 0xad, 0x8e, 0xf5, 0xc2, 0x5e, 0x47, 0x4a, 0x40, 0x8a, 0xd3, 0xae, 0xe8, 0xf4, 0x51, + 0xd1, 0x3d, 0xc8, 0x37, 0xa9, 0xe3, 0x98, 0x2a, 0x7c, 0x69, 0x11, 0x3e, 0xe0, 0xa4, 0x75, 0x19, + 0x42, 0x71, 0x7b, 0x70, 0xff, 0x34, 0x09, 0x11, 0x51, 0x44, 0xfc, 0xf6, 0x38, 0x27, 0xe1, 0x36, + 0x21, 0x9c, 0x19, 0x25, 0xcc, 0xac, 0x64, 0x46, 0x31, 0xf3, 0x15, 0x40, 0x91, 0x1f, 0x61, 0xc7, + 0xe4, 0x68, 0xc4, 0x36, 0x85, 0x54, 0x65, 0x46, 0x68, 0x28, 0x0a, 0xce, 0xb6, 0x60, 0xec, 0x73, + 0xfa, 0xc0, 0x6c, 0x01, 0x53, 0xc9, 0x0d, 0xcc, 0x3e, 0x12, 0xb3, 0xab, 0x70, 0x1b, 0x37, 0x9b, + 0xd4, 0xa1, 0x38, 0x22, 0x66, 0x48, 0x2e, 0x4c, 0x51, 0xba, 0x55, 0x66, 0xe5, 0x19, 0x9c, 0xb0, + 0x0c, 0x72, 0x71, 0xc8, 0x19, 0xb5, 0x02, 0xe4, 0xa3, 0x4e, 0x94, 0xf5, 0x9f, 0xa6, 0xe1, 0xf6, + 0x26, 0x71, 0xc8, 0x05, 0x09, 0x71, 0xab, 0xab, 0x7e, 0xf8, 0x2e, 0x40, 0xec, 0x21, 0x72, 0xbd, + 0x0d, 0x1b, 0xa7, 0x44, 0x07, 0x8e, 0x83, 0xfb, 0xcd, 0x26, 0x23, 0x51, 0x44, 0xbd, 0xd6, 0xb5, + 0x76, 0x68, 0x0c, 0xde, 0x81, 0x1b, 0x28, 0xe5, 0xd2, 0x83, 0xa5, 0x5c, 0x5f, 0xa8, 0x33, 0x03, + 0xa1, 0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b, 0x3f, 0x01, 0x00, 0x00, 0xff, + 0xff, 0x35, 0x4a, 0x0d, 0x23, 0x85, 0x21, 0x00, 0x00, +>>>>>>> 4208b7be ([OTE-877] deprecate OI indexer update event (#2499)) } func (m *FundingUpdateV1) Marshal() (dAtA []byte, err error) { diff --git a/protocol/x/clob/e2e/long_term_orders_test.go b/protocol/x/clob/e2e/long_term_orders_test.go index 3d0b69226b..685d2383f3 100644 --- a/protocol/x/clob/e2e/long_term_orders_test.go +++ b/protocol/x/clob/e2e/long_term_orders_test.go @@ -824,22 +824,6 @@ func TestPlaceLongTermOrder(t *testing.T) { EventIndex: 2, Version: indexerevents.OrderFillEventVersion, }, - { - Subtype: indexerevents.SubtypeOpenInterestUpdate, - OrderingWithinBlock: &indexer_manager.IndexerTendermintEvent_BlockEvent_{ - BlockEvent: indexer_manager.IndexerTendermintEvent_BLOCK_EVENT_END_BLOCK, - }, - Version: indexerevents.OpenInterestUpdateVersion, - DataBytes: indexer_manager.GetBytes( - &indexerevents.OpenInterestUpdateEventV1{ - OpenInterestUpdates: []*indexerevents.OpenInterestUpdate{ - { - PerpetualId: Clob_0.MustGetPerpetualId(), - OpenInterest: dtypes.NewInt(10_000_000_000), - }, - }, - }), - }, }, TxHashes: []string{ string(lib.GetTxHash(testtx.MustGetTxBytes(&clobtypes.MsgProposedOperations{ @@ -1167,22 +1151,6 @@ func TestPlaceLongTermOrder(t *testing.T) { EventIndex: 2, Version: indexerevents.OrderFillEventVersion, }, - { - Subtype: indexerevents.SubtypeOpenInterestUpdate, - OrderingWithinBlock: &indexer_manager.IndexerTendermintEvent_BlockEvent_{ - BlockEvent: indexer_manager.IndexerTendermintEvent_BLOCK_EVENT_END_BLOCK, - }, - Version: indexerevents.OpenInterestUpdateVersion, - DataBytes: indexer_manager.GetBytes( - &indexerevents.OpenInterestUpdateEventV1{ - OpenInterestUpdates: []*indexerevents.OpenInterestUpdate{ - { - PerpetualId: Clob_0.MustGetPerpetualId(), - OpenInterest: dtypes.NewInt(10_000_000_000), - }, - }, - }), - }, }, TxHashes: []string{ string(lib.GetTxHash(testtx.MustGetTxBytes(&clobtypes.MsgProposedOperations{ @@ -1337,22 +1305,6 @@ func TestPlaceLongTermOrder(t *testing.T) { EventIndex: 2, Version: indexerevents.OrderFillEventVersion, }, - { - Subtype: indexerevents.SubtypeOpenInterestUpdate, - OrderingWithinBlock: &indexer_manager.IndexerTendermintEvent_BlockEvent_{ - BlockEvent: indexer_manager.IndexerTendermintEvent_BLOCK_EVENT_END_BLOCK, - }, - Version: indexerevents.OpenInterestUpdateVersion, - DataBytes: indexer_manager.GetBytes( - &indexerevents.OpenInterestUpdateEventV1{ - OpenInterestUpdates: []*indexerevents.OpenInterestUpdate{ - { - PerpetualId: Clob_0.MustGetPerpetualId(), - OpenInterest: dtypes.NewInt(20_000_000_000), - }, - }, - }), - }, }, TxHashes: []string{ string(lib.GetTxHash(testtx.MustGetTxBytes(&clobtypes.MsgProposedOperations{ @@ -1735,22 +1687,6 @@ func TestRegression_InvalidTimeInForce(t *testing.T) { EventIndex: 2, Version: indexerevents.OrderFillEventVersion, }, - { - Subtype: indexerevents.SubtypeOpenInterestUpdate, - OrderingWithinBlock: &indexer_manager.IndexerTendermintEvent_BlockEvent_{ - BlockEvent: indexer_manager.IndexerTendermintEvent_BLOCK_EVENT_END_BLOCK, - }, - Version: indexerevents.OpenInterestUpdateVersion, - DataBytes: indexer_manager.GetBytes( - &indexerevents.OpenInterestUpdateEventV1{ - OpenInterestUpdates: []*indexerevents.OpenInterestUpdate{ - { - PerpetualId: Clob_0.MustGetPerpetualId(), - OpenInterest: dtypes.NewInt(10_000_000_000), - }, - }, - }), - }, }, TxHashes: []string{ string(lib.GetTxHash(testtx.MustGetTxBytes(&clobtypes.MsgProposedOperations{ diff --git a/protocol/x/clob/e2e/short_term_orders_test.go b/protocol/x/clob/e2e/short_term_orders_test.go index 8a3ee3e374..48fae5483c 100644 --- a/protocol/x/clob/e2e/short_term_orders_test.go +++ b/protocol/x/clob/e2e/short_term_orders_test.go @@ -8,7 +8,6 @@ import ( "github.com/stretchr/testify/require" "golang.org/x/exp/slices" - "github.com/dydxprotocol/v4-chain/protocol/dtypes" "github.com/dydxprotocol/v4-chain/protocol/indexer" indexerevents "github.com/dydxprotocol/v4-chain/protocol/indexer/events" "github.com/dydxprotocol/v4-chain/protocol/indexer/indexer_manager" @@ -218,24 +217,6 @@ func TestPlaceOrder(t *testing.T) { ), ), }, - { - Subtype: indexerevents.SubtypeOpenInterestUpdate, - OrderingWithinBlock: &indexer_manager.IndexerTendermintEvent_BlockEvent_{ - BlockEvent: indexer_manager.IndexerTendermintEvent_BLOCK_EVENT_END_BLOCK, - }, - Version: indexerevents.OpenInterestUpdateVersion, - DataBytes: indexer_manager.GetBytes( - &indexerevents.OpenInterestUpdateEventV1{ - OpenInterestUpdates: []*indexerevents.OpenInterestUpdate{ - { - PerpetualId: Clob_0.MustGetPerpetualId(), - OpenInterest: dtypes.NewIntFromUint64( - PlaceOrder_Alice_Num0_Id0_Clob0_Buy5_Price10_GTB20.Order.GetBigQuantums().Uint64(), - ), - }, - }, - }), - }, }, TxHashes: []string{string(lib.GetTxHash(testtx.MustGetTxBytes(&clobtypes.MsgProposedOperations{ OperationsQueue: []clobtypes.OperationRaw{ @@ -397,24 +378,6 @@ func TestPlaceOrder(t *testing.T) { ), ), }, - { - Subtype: indexerevents.SubtypeOpenInterestUpdate, - OrderingWithinBlock: &indexer_manager.IndexerTendermintEvent_BlockEvent_{ - BlockEvent: indexer_manager.IndexerTendermintEvent_BLOCK_EVENT_END_BLOCK, - }, - Version: indexerevents.OpenInterestUpdateVersion, - DataBytes: indexer_manager.GetBytes( - &indexerevents.OpenInterestUpdateEventV1{ - OpenInterestUpdates: []*indexerevents.OpenInterestUpdate{ - { - PerpetualId: Clob_0.MustGetPerpetualId(), - OpenInterest: dtypes.NewIntFromUint64( - PlaceOrder_Bob_Num0_Id0_Clob0_Sell5_Price10_GTB20.Order.GetBigQuantums().Uint64(), - ), - }, - }, - }), - }, }, TxHashes: []string{string(lib.GetTxHash(testtx.MustGetTxBytes(&clobtypes.MsgProposedOperations{ OperationsQueue: []clobtypes.OperationRaw{ @@ -576,24 +539,6 @@ func TestPlaceOrder(t *testing.T) { ), ), }, - { - Subtype: indexerevents.SubtypeOpenInterestUpdate, - OrderingWithinBlock: &indexer_manager.IndexerTendermintEvent_BlockEvent_{ - BlockEvent: indexer_manager.IndexerTendermintEvent_BLOCK_EVENT_END_BLOCK, - }, - Version: indexerevents.OpenInterestUpdateVersion, - DataBytes: indexer_manager.GetBytes( - &indexerevents.OpenInterestUpdateEventV1{ - OpenInterestUpdates: []*indexerevents.OpenInterestUpdate{ - { - PerpetualId: Clob_0.MustGetPerpetualId(), - OpenInterest: dtypes.NewIntFromUint64( - PlaceOrder_Bob_Num0_Id0_Clob0_Sell5_Price10_GTB20.Order.GetBigQuantums().Uint64(), - ), - }, - }, - }), - }, }, TxHashes: []string{string(lib.GetTxHash(testtx.MustGetTxBytes(&clobtypes.MsgProposedOperations{ OperationsQueue: []clobtypes.OperationRaw{ diff --git a/protocol/x/perpetuals/abci.go b/protocol/x/perpetuals/abci.go index e8149df9a9..57a34f9e0c 100644 --- a/protocol/x/perpetuals/abci.go +++ b/protocol/x/perpetuals/abci.go @@ -15,5 +15,4 @@ func EndBlocker(ctx sdk.Context, k types.PerpetualsKeeper) { // first so that new samples are processed in `MaybeProcessNewFundingTickEpoch`. k.MaybeProcessNewFundingSampleEpoch(ctx) k.MaybeProcessNewFundingTickEpoch(ctx) - k.SendOIUpdatesToIndexer(ctx) } diff --git a/protocol/x/perpetuals/abci_test.go b/protocol/x/perpetuals/abci_test.go index e50a03080f..04ed81320f 100644 --- a/protocol/x/perpetuals/abci_test.go +++ b/protocol/x/perpetuals/abci_test.go @@ -28,10 +28,6 @@ func TestEndBlocker(t *testing.T) { "MaybeProcessNewFundingSampleEpoch", ctx, ).Return(nil) - mck.On( - "SendOIUpdatesToIndexer", - ctx, - ) }, expectedErr: nil, }, diff --git a/protocol/x/perpetuals/keeper/perpetual.go b/protocol/x/perpetuals/keeper/perpetual.go index c288f17982..834f67e96a 100644 --- a/protocol/x/perpetuals/keeper/perpetual.go +++ b/protocol/x/perpetuals/keeper/perpetual.go @@ -1,7 +1,6 @@ package keeper import ( - "encoding/binary" "fmt" "math/big" "math/rand" @@ -1041,14 +1040,6 @@ func (k Keeper) ModifyOpenInterest( perpetual.OpenInterest = dtypes.NewIntFromBigInt(bigOpenInterest) k.setPerpetual(ctx, perpetual) - if ctx.ExecMode() == sdk.ExecModeFinalize { - updatedOIStore := prefix.NewStore(ctx.TransientStore(k.transientStoreKey), []byte(types.UpdatedOIKeyPrefix)) - openInterestInBytes, err := perpetual.OpenInterest.Marshal() - if err != nil { - return err - } - updatedOIStore.Set(lib.Uint32ToKey(perpetualId), openInterestInBytes) - } return nil } @@ -1481,42 +1472,6 @@ func (k Keeper) IsPositionUpdatable( return true, nil } -func (k Keeper) SendOIUpdatesToIndexer(ctx sdk.Context) { - updatedOIStore := prefix.NewStore(ctx.TransientStore(k.transientStoreKey), []byte(types.UpdatedOIKeyPrefix)) - iterator := updatedOIStore.Iterator(nil, nil) - defer iterator.Close() - - OIMessageArray := make([]*indexerevents.OpenInterestUpdate, 0) - - for ; iterator.Valid(); iterator.Next() { - openInterestSerializableInt := dtypes.SerializableInt{} - if err := openInterestSerializableInt.Unmarshal(iterator.Value()); err != nil { - panic(errorsmod.Wrap(err, "failed to unmarshal open interest")) - } - OIMessage := indexerevents.OpenInterestUpdate{ - PerpetualId: binary.BigEndian.Uint32(iterator.Key()), - OpenInterest: openInterestSerializableInt, - } - OIMessageArray = append(OIMessageArray, &OIMessage) - } - - if len(OIMessageArray) == 0 { - return - } - - k.GetIndexerEventManager().AddBlockEvent( - ctx, - indexerevents.SubtypeOpenInterestUpdate, - indexer_manager.IndexerTendermintEvent_BLOCK_EVENT_END_BLOCK, - indexerevents.OpenInterestUpdateVersion, - indexer_manager.GetBytes( - &indexerevents.OpenInterestUpdateEventV1{ - OpenInterestUpdates: OIMessageArray, - }, - ), - ) -} - // GetNextPerpetualID returns the next perpetual id to be used from the module store func (k Keeper) GetNextPerpetualID(ctx sdk.Context) uint32 { store := ctx.KVStore(k.storeKey) diff --git a/protocol/x/perpetuals/keeper/perpetual_test.go b/protocol/x/perpetuals/keeper/perpetual_test.go index e3859b83e4..30cce2fa32 100644 --- a/protocol/x/perpetuals/keeper/perpetual_test.go +++ b/protocol/x/perpetuals/keeper/perpetual_test.go @@ -3013,32 +3013,6 @@ func TestIsPositionUpdatable(t *testing.T) { } } -func TestModifyOpenInterest_store(t *testing.T) { - pc := keepertest.PerpetualsKeepers(t) - perps := keepertest.CreateLiquidityTiersAndNPerpetuals(t, pc.Ctx, pc.PerpetualsKeeper, pc.PricesKeeper, 100) - pc.Ctx = pc.Ctx.WithExecMode(sdk.ExecModeFinalize) - for _, perp := range perps { - openInterestDeltaBaseQuantums := big.NewInt(2_000_000 * (int64(perp.Params.Id))) - - err := pc.PerpetualsKeeper.ModifyOpenInterest( - pc.Ctx, - perp.Params.Id, - openInterestDeltaBaseQuantums, - ) - require.NoError(t, err) - } - - transientStore := prefix.NewStore(pc.Ctx.TransientStore(pc.TransientStoreKey), []byte(types.UpdatedOIKeyPrefix)) - for _, perp := range perps { - perpetualObject, err := pc.PerpetualsKeeper.GetPerpetual(pc.Ctx, perp.Params.Id) - require.NoError(t, err) - serializedOpenInterest := dtypes.SerializableInt{} - err = serializedOpenInterest.Unmarshal(transientStore.Get(lib.Uint32ToKey(perpetualObject.Params.Id))) - require.NoError(t, err) - require.Equal(t, perpetualObject.OpenInterest, serializedOpenInterest) - } -} - func TestIsIsolatedPerpetual(t *testing.T) { testCases := map[string]struct { perp types.Perpetual diff --git a/protocol/x/perpetuals/types/types.go b/protocol/x/perpetuals/types/types.go index 0da2437d97..7268ec81a9 100644 --- a/protocol/x/perpetuals/types/types.go +++ b/protocol/x/perpetuals/types/types.go @@ -114,7 +114,6 @@ type PerpetualsKeeper interface { ctx sdk.Context, ) []Perpetual GetAllLiquidityTiers(ctx sdk.Context) (list []LiquidityTier) - SendOIUpdatesToIndexer(ctx sdk.Context) ValidateAndSetPerpetual( ctx sdk.Context, perpetual Perpetual,