From 9d447606191433766935196a669181844d808748 Mon Sep 17 00:00:00 2001 From: Anmol Agrawal Date: Wed, 5 Nov 2025 14:34:53 -0500 Subject: [PATCH 1/8] set cap on expired orders processed per block --- .github/workflows/protocol-build-and-push.yml | 1 + protocol/x/clob/abci.go | 10 ++ protocol/x/clob/flags/flags.go | 18 +++ protocol/x/clob/flags/flags_test.go | 14 +++ .../x/clob/keeper/stateful_order_state.go | 12 +- .../clob/keeper/stateful_order_state_test.go | 117 ++++++++++++++++++ 6 files changed, 171 insertions(+), 1 deletion(-) diff --git a/.github/workflows/protocol-build-and-push.yml b/.github/workflows/protocol-build-and-push.yml index 3e9adfcf809..b143f9452d8 100644 --- a/.github/workflows/protocol-build-and-push.yml +++ b/.github/workflows/protocol-build-and-push.yml @@ -6,6 +6,7 @@ on: # yamllint disable-line rule:truthy - main - 'release/protocol/v[0-9]+.[0-9]+.x' # e.g. release/protocol/v0.1.x - 'release/protocol/v[0-9]+.x' # e.g. release/protocol/v1.x + - 'anmol/eng-1296' jobs: build-and-push-dev: diff --git a/protocol/x/clob/abci.go b/protocol/x/clob/abci.go index 1060aba6943..f29dab24bdb 100644 --- a/protocol/x/clob/abci.go +++ b/protocol/x/clob/abci.go @@ -80,6 +80,16 @@ func EndBlocker( // Prune expired stateful orders completely from state. expiredStatefulOrderIds := keeper.RemoveExpiredStatefulOrders(ctx, ctx.BlockTime()) + + // Track the total number of expired orders removed for telemetry. + telemetry.SetGauge( + float32(len(expiredStatefulOrderIds)), + types.ModuleName, + metrics.EndBlocker, + "expired_orders_removed", + metrics.Count, + ) + for _, orderId := range expiredStatefulOrderIds { // Remove the order fill amount from state. keeper.RemoveOrderFillAmount(ctx, orderId) diff --git a/protocol/x/clob/flags/flags.go b/protocol/x/clob/flags/flags.go index 902d4eae634..a441ace3636 100644 --- a/protocol/x/clob/flags/flags.go +++ b/protocol/x/clob/flags/flags.go @@ -14,6 +14,7 @@ type ClobFlags struct { MaxLiquidationAttemptsPerBlock uint32 MaxDeleveragingAttemptsPerBlock uint32 MaxDeleveragingSubaccountsToIterate uint32 + MaxStatefulOrderRemovalsPerBlock uint32 MevTelemetryEnabled bool MevTelemetryHosts []string @@ -26,6 +27,7 @@ const ( MaxLiquidationAttemptsPerBlock = "max-liquidation-attempts-per-block" MaxDeleveragingAttemptsPerBlock = "max-deleveraging-attempts-per-block" MaxDeleveragingSubaccountsToIterate = "max-deleveraging-subaccounts-to-iterate" + MaxStatefulOrderRemovalsPerBlock = "max-stateful-order-removals-per-block" // Mev. MevTelemetryEnabled = "mev-telemetry-enabled" @@ -39,6 +41,7 @@ const ( DefaultMaxLiquidationAttemptsPerBlock = 50 DefaultMaxDeleveragingAttemptsPerBlock = 10 DefaultMaxDeleveragingSubaccountsToIterate = 500 + DefaultMaxStatefulOrderRemovalsPerBlock = 100 DefaultMevTelemetryEnabled = false DefaultMevTelemetryHostsFlag = "" @@ -75,6 +78,14 @@ func AddClobFlagsToCmd(cmd *cobra.Command) { DefaultMaxDeleveragingSubaccountsToIterate, ), ) + cmd.Flags().Uint32( + MaxStatefulOrderRemovalsPerBlock, + DefaultMaxStatefulOrderRemovalsPerBlock, + fmt.Sprintf( + "Sets the maximum number of expired stateful orders to remove per block. Default = %d", + DefaultMaxStatefulOrderRemovalsPerBlock, + ), + ) cmd.Flags().Bool( MevTelemetryEnabled, DefaultMevTelemetryEnabled, @@ -97,6 +108,7 @@ func GetDefaultClobFlags() ClobFlags { MaxLiquidationAttemptsPerBlock: DefaultMaxLiquidationAttemptsPerBlock, MaxDeleveragingAttemptsPerBlock: DefaultMaxDeleveragingAttemptsPerBlock, MaxDeleveragingSubaccountsToIterate: DefaultMaxDeleveragingSubaccountsToIterate, + MaxStatefulOrderRemovalsPerBlock: DefaultMaxStatefulOrderRemovalsPerBlock, MevTelemetryEnabled: DefaultMevTelemetryEnabled, MevTelemetryHosts: DefaultMevTelemetryHosts, MevTelemetryIdentifier: DefaultMevTelemetryIdentifier, @@ -148,5 +160,11 @@ func GetClobFlagValuesFromOptions( } } + if option := appOpts.Get(MaxStatefulOrderRemovalsPerBlock); option != nil { + if v, err := cast.ToUint32E(option); err == nil { + result.MaxStatefulOrderRemovalsPerBlock = v + } + } + return result } diff --git a/protocol/x/clob/flags/flags_test.go b/protocol/x/clob/flags/flags_test.go index df53ed75e7b..6d4f90fff48 100644 --- a/protocol/x/clob/flags/flags_test.go +++ b/protocol/x/clob/flags/flags_test.go @@ -30,6 +30,9 @@ func TestAddFlagsToCommand(t *testing.T) { fmt.Sprintf("Has %s flag", flags.MevTelemetryIdentifier): { flagName: flags.MevTelemetryIdentifier, }, + fmt.Sprintf("Has %s flag", flags.MaxStatefulOrderRemovalsPerBlock): { + flagName: flags.MaxStatefulOrderRemovalsPerBlock, + }, } for name, tc := range tests { @@ -48,6 +51,7 @@ func TestGetFlagValuesFromOptions(t *testing.T) { expectedMaxLiquidationAttemptsPerBlock uint32 expectedMaxDeleveragingAttemptsPerBlock uint32 expectedMaxDeleveragingSubaccountsToIterate uint32 + expectedMaxStatefulOrderRemovalsPerBlock uint32 expectedMevTelemetryHosts []string expectedMevTelemetryIdentifier string }{ @@ -55,6 +59,7 @@ func TestGetFlagValuesFromOptions(t *testing.T) { expectedMaxLiquidationAttemptsPerBlock: flags.DefaultMaxLiquidationAttemptsPerBlock, expectedMaxDeleveragingAttemptsPerBlock: flags.DefaultMaxDeleveragingAttemptsPerBlock, expectedMaxDeleveragingSubaccountsToIterate: flags.DefaultMaxDeleveragingSubaccountsToIterate, + expectedMaxStatefulOrderRemovalsPerBlock: flags.DefaultMaxStatefulOrderRemovalsPerBlock, expectedMevTelemetryHosts: flags.DefaultMevTelemetryHosts, expectedMevTelemetryIdentifier: flags.DefaultMevTelemetryIdentifier, }, @@ -63,12 +68,14 @@ func TestGetFlagValuesFromOptions(t *testing.T) { flags.MaxLiquidationAttemptsPerBlock: uint32(50), flags.MaxDeleveragingAttemptsPerBlock: uint32(25), flags.MaxDeleveragingSubaccountsToIterate: uint32(100), + flags.MaxStatefulOrderRemovalsPerBlock: uint32(75), flags.MevTelemetryHosts: "https://localhost:13137", flags.MevTelemetryIdentifier: "node-agent-01", }, expectedMaxLiquidationAttemptsPerBlock: uint32(50), expectedMaxDeleveragingAttemptsPerBlock: uint32(25), expectedMaxDeleveragingSubaccountsToIterate: uint32(100), + expectedMaxStatefulOrderRemovalsPerBlock: uint32(75), expectedMevTelemetryHosts: []string{"https://localhost:13137"}, expectedMevTelemetryIdentifier: "node-agent-01", }, @@ -77,12 +84,14 @@ func TestGetFlagValuesFromOptions(t *testing.T) { flags.MaxLiquidationAttemptsPerBlock: uint32(50), flags.MaxDeleveragingAttemptsPerBlock: uint32(25), flags.MaxDeleveragingSubaccountsToIterate: uint32(100), + flags.MaxStatefulOrderRemovalsPerBlock: uint32(75), flags.MevTelemetryHosts: "https://localhost:13137,https://example.dev:443", flags.MevTelemetryIdentifier: "node-agent-01", }, expectedMaxLiquidationAttemptsPerBlock: uint32(50), expectedMaxDeleveragingAttemptsPerBlock: uint32(25), expectedMaxDeleveragingSubaccountsToIterate: uint32(100), + expectedMaxStatefulOrderRemovalsPerBlock: uint32(75), expectedMevTelemetryHosts: []string{"https://localhost:13137", "https://example.dev:443"}, expectedMevTelemetryIdentifier: "node-agent-01", }, @@ -122,6 +131,11 @@ func TestGetFlagValuesFromOptions(t *testing.T) { tc.expectedMaxDeleveragingSubaccountsToIterate, flags.MaxDeleveragingSubaccountsToIterate, ) + require.Equal( + t, + tc.expectedMaxStatefulOrderRemovalsPerBlock, + flags.MaxStatefulOrderRemovalsPerBlock, + ) }) } } diff --git a/protocol/x/clob/keeper/stateful_order_state.go b/protocol/x/clob/keeper/stateful_order_state.go index e1218bc0cf4..3c79d75d6f8 100644 --- a/protocol/x/clob/keeper/stateful_order_state.go +++ b/protocol/x/clob/keeper/stateful_order_state.go @@ -208,6 +208,9 @@ func (k Keeper) AddStatefulOrderIdExpiration( // RemoveExpiredStatefulOrders removes the stateful order id expirations up to `blockTime` and // returns the removed order ids as a slice. +// To prevent slowdowns from processing too many expired orders at once, this function will +// process at most `MaxStatefulOrderRemovalsPerBlock` orders per block. Any remaining expired +// orders will be processed in subsequent blocks. func (k Keeper) RemoveExpiredStatefulOrders(ctx sdk.Context, blockTime time.Time) ( expiredOrderIds []types.OrderId, ) { @@ -220,11 +223,18 @@ func (k Keeper) RemoveExpiredStatefulOrders(ctx sdk.Context, blockTime time.Time ), ) defer it.Close() - for ; it.Valid(); it.Next() { + + // Process at most MaxStatefulOrderRemovalsPerBlock orders per block to prevent + // EndBlocker from being slowed down by a surge of expired orders. + maxRemovals := k.Flags.MaxStatefulOrderRemovalsPerBlock + numRemoved := uint32(0) + + for ; it.Valid() && numRemoved < maxRemovals; it.Next() { var orderId types.OrderId k.cdc.MustUnmarshal(it.Value(), &orderId) expiredOrderIds = append(expiredOrderIds, orderId) store.Delete(it.Key()) + numRemoved++ } return expiredOrderIds } diff --git a/protocol/x/clob/keeper/stateful_order_state_test.go b/protocol/x/clob/keeper/stateful_order_state_test.go index be1ec6ca36d..067bd272437 100644 --- a/protocol/x/clob/keeper/stateful_order_state_test.go +++ b/protocol/x/clob/keeper/stateful_order_state_test.go @@ -864,6 +864,123 @@ func TestRemoveExpiredStatefulOrders(t *testing.T) { } } +func TestRemoveExpiredStatefulOrders_WithCap(t *testing.T) { + tests := map[string]struct { + // Setup. + timeSlicesToOrderIds map[time.Time][]types.OrderId + maxStatefulOrderRemovalsPerBlock uint32 + + // Parameters. + blockTime time.Time + + expectedFirstBatchCount int + expectedSecondBatchCount int + expectedTotalOrderIds []types.OrderId + }{ + "Respects cap when more orders expire than max": { + timeSlicesToOrderIds: map[time.Time][]types.OrderId{ + constants.Time_21st_Feb_2021: { + constants.ConditionalOrder_Alice_Num0_Id0_Clob0_Buy5_Price10_GTBT15_StopLoss20.OrderId, + constants.ConditionalOrder_Alice_Num1_Id0_Clob0_Sell5_Price10_GTB15.OrderId, + constants.LongTermOrder_Alice_Num0_Id0_Clob0_Buy5_Price10_GTBT20.OrderId, + }, + }, + maxStatefulOrderRemovalsPerBlock: 2, + + blockTime: constants.Time_21st_Feb_2021.Add(1_000_000_000_000), + expectedFirstBatchCount: 2, + expectedSecondBatchCount: 1, + expectedTotalOrderIds: []types.OrderId{ + constants.ConditionalOrder_Alice_Num0_Id0_Clob0_Buy5_Price10_GTBT15_StopLoss20.OrderId, + constants.ConditionalOrder_Alice_Num1_Id0_Clob0_Sell5_Price10_GTB15.OrderId, + constants.LongTermOrder_Alice_Num0_Id0_Clob0_Buy5_Price10_GTBT20.OrderId, + }, + }, + "Removes all orders when count is below cap": { + timeSlicesToOrderIds: map[time.Time][]types.OrderId{ + constants.Time_21st_Feb_2021: { + constants.ConditionalOrder_Alice_Num0_Id0_Clob0_Buy5_Price10_GTBT15_StopLoss20.OrderId, + constants.ConditionalOrder_Alice_Num1_Id0_Clob0_Sell5_Price10_GTB15.OrderId, + }, + }, + maxStatefulOrderRemovalsPerBlock: 10, + + blockTime: constants.Time_21st_Feb_2021.Add(1_000_000_000_000), + expectedFirstBatchCount: 2, + expectedSecondBatchCount: 0, + expectedTotalOrderIds: []types.OrderId{ + constants.ConditionalOrder_Alice_Num0_Id0_Clob0_Buy5_Price10_GTBT15_StopLoss20.OrderId, + constants.ConditionalOrder_Alice_Num1_Id0_Clob0_Sell5_Price10_GTB15.OrderId, + }, + }, + "Processes orders across multiple time slices respecting cap": { + timeSlicesToOrderIds: map[time.Time][]types.OrderId{ + constants.Time_21st_Feb_2021: { + constants.ConditionalOrder_Alice_Num0_Id0_Clob0_Buy5_Price10_GTBT15_StopLoss20.OrderId, + constants.ConditionalOrder_Alice_Num1_Id0_Clob0_Sell5_Price10_GTB15.OrderId, + }, + constants.Time_21st_Feb_2021.Add(1): { + constants.LongTermOrder_Alice_Num0_Id0_Clob0_Buy5_Price10_GTBT20.OrderId, + constants.ConditionalOrder_Alice_Num1_Id1_Clob0_Sell50_Price5_GTB30.OrderId, + }, + constants.Time_21st_Feb_2021.Add(2): { + constants.LongTermOrder_Alice_Num1_Id1_Clob0_Sell25_Price30_GTBT10.OrderId, + }, + }, + maxStatefulOrderRemovalsPerBlock: 3, + + blockTime: constants.Time_21st_Feb_2021.Add(1_000_000_000_000), + expectedFirstBatchCount: 3, + expectedSecondBatchCount: 2, + expectedTotalOrderIds: []types.OrderId{ + constants.ConditionalOrder_Alice_Num0_Id0_Clob0_Buy5_Price10_GTBT15_StopLoss20.OrderId, + constants.ConditionalOrder_Alice_Num1_Id0_Clob0_Sell5_Price10_GTB15.OrderId, + constants.LongTermOrder_Alice_Num0_Id0_Clob0_Buy5_Price10_GTBT20.OrderId, + constants.ConditionalOrder_Alice_Num1_Id1_Clob0_Sell50_Price5_GTB30.OrderId, + constants.LongTermOrder_Alice_Num1_Id1_Clob0_Sell25_Price30_GTBT10.OrderId, + }, + }, + } + + for name, tc := range tests { + t.Run(name, func(t *testing.T) { + // Setup keeper state and test parameters. + memClob := memclob.NewMemClobPriceTimePriority(false) + ks := keepertest.NewClobKeepersTestContext(t, memClob, &mocks.BankKeeper{}, &mocks.IndexerEventManager{}) + + // Set the max stateful order removals per block flag. + ks.ClobKeeper.Flags.MaxStatefulOrderRemovalsPerBlock = tc.maxStatefulOrderRemovalsPerBlock + + // Create all order IDs in state. + for timestamp, orderIds := range tc.timeSlicesToOrderIds { + for _, orderId := range orderIds { + ks.ClobKeeper.AddStatefulOrderIdExpiration(ks.Ctx, timestamp, orderId) + } + } + + // Run the test - first batch should respect the cap. + firstBatchExpiredOrderIds := ks.ClobKeeper.RemoveExpiredStatefulOrders(ks.Ctx, tc.blockTime) + + // Verify the first batch removed the expected number of orders and respects the cap. + require.Equal(t, tc.expectedFirstBatchCount, len(firstBatchExpiredOrderIds), + "First batch should contain exactly %d orders", tc.expectedFirstBatchCount) + require.LessOrEqual(t, len(firstBatchExpiredOrderIds), int(tc.maxStatefulOrderRemovalsPerBlock)) + + // Run again to get the second batch (remaining orders). + secondBatchExpiredOrderIds := ks.ClobKeeper.RemoveExpiredStatefulOrders(ks.Ctx, tc.blockTime) + + // Verify the second batch removed the expected number of remaining orders. + require.Equal(t, tc.expectedSecondBatchCount, len(secondBatchExpiredOrderIds), + "Second batch should contain exactly %d orders", tc.expectedSecondBatchCount) + + // Verify that all orders across both batches match the expected total. + allExpiredOrderIds := append(firstBatchExpiredOrderIds, secondBatchExpiredOrderIds...) + require.ElementsMatch(t, tc.expectedTotalOrderIds, allExpiredOrderIds, + "Total orders across both batches should match expected") + }) + } +} + func TestRemoveLongTermOrder_PanicsIfNotFound(t *testing.T) { // Setup keeper state and test parameters. memClob := memclob.NewMemClobPriceTimePriority(false) From bf38bbfd29c064766516c46ad392e734c66dc01d Mon Sep 17 00:00:00 2001 From: Anmol Agrawal Date: Thu, 6 Nov 2025 11:39:48 -0500 Subject: [PATCH 2/8] make expiry order cap gov-protected protocol level constant --- .../src/codegen/dydxprotocol/bundle.ts | 536 +++++++------- .../dydxprotocol/clob/block_limits_config.ts | 67 ++ .../codegen/dydxprotocol/clob/query.lcd.ts | 10 +- .../dydxprotocol/clob/query.rpc.Query.ts | 16 +- .../src/codegen/dydxprotocol/clob/query.ts | 108 +++ .../codegen/dydxprotocol/clob/tx.rpc.msg.ts | 12 +- .../src/codegen/dydxprotocol/clob/tx.ts | 132 ++++ .../v4-protos/src/codegen/gogoproto/bundle.ts | 4 +- .../v4-protos/src/codegen/google/bundle.ts | 22 +- .../clob/block_limits_config.proto | 15 + proto/dydxprotocol/clob/query.proto | 17 + proto/dydxprotocol/clob/tx.proto | 22 + protocol/mocks/ClobKeeper.go | 66 +- protocol/mocks/QueryClient.go | 85 ++- protocol/x/clob/client/cli/query.go | 1 + .../cli/query_block_limits_configuration.go | 35 + protocol/x/clob/flags/flags.go | 18 - protocol/x/clob/flags/flags_test.go | 14 - protocol/x/clob/keeper/block_limits_config.go | 58 ++ .../grpc_query_block_limits_configuration.go | 26 + ...c_query_block_limits_configuration_test.go | 44 ++ .../msg_server_update_block_limits_config.go | 32 + .../x/clob/keeper/stateful_order_state.go | 16 +- .../clob/keeper/stateful_order_state_test.go | 14 +- protocol/x/clob/types/block_limits_config.go | 8 + .../x/clob/types/block_limits_config.pb.go | 310 +++++++++ .../clob/types/block_limits_config_keeper.go | 27 + protocol/x/clob/types/clob_keeper.go | 1 + protocol/x/clob/types/errors.go | 5 + protocol/x/clob/types/keys.go | 3 + .../message_update_block_limits_config.go | 26 + protocol/x/clob/types/query.pb.go | 658 +++++++++++++----- protocol/x/clob/types/query.pb.gw.go | 65 ++ protocol/x/clob/types/tx.pb.go | 557 ++++++++++++--- 34 files changed, 2412 insertions(+), 618 deletions(-) create mode 100644 indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/block_limits_config.ts create mode 100644 proto/dydxprotocol/clob/block_limits_config.proto create mode 100644 protocol/x/clob/client/cli/query_block_limits_configuration.go create mode 100644 protocol/x/clob/keeper/block_limits_config.go create mode 100644 protocol/x/clob/keeper/grpc_query_block_limits_configuration.go create mode 100644 protocol/x/clob/keeper/grpc_query_block_limits_configuration_test.go create mode 100644 protocol/x/clob/keeper/msg_server_update_block_limits_config.go create mode 100644 protocol/x/clob/types/block_limits_config.go create mode 100644 protocol/x/clob/types/block_limits_config.pb.go create mode 100644 protocol/x/clob/types/block_limits_config_keeper.go create mode 100644 protocol/x/clob/types/message_update_block_limits_config.go diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/bundle.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/bundle.ts index bf83b08c999..732e33b5d52 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/bundle.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/bundle.ts @@ -23,170 +23,171 @@ import * as _26 from "./bridge/genesis"; import * as _27 from "./bridge/params"; import * as _28 from "./bridge/query"; import * as _29 from "./bridge/tx"; -import * as _30 from "./clob/block_rate_limit_config"; -import * as _31 from "./clob/clob_pair"; -import * as _32 from "./clob/equity_tier_limit_config"; -import * as _33 from "./clob/finalize_block"; -import * as _34 from "./clob/genesis"; -import * as _35 from "./clob/liquidations_config"; -import * as _36 from "./clob/liquidations"; -import * as _37 from "./clob/matches"; -import * as _38 from "./clob/mev"; -import * as _39 from "./clob/operation"; -import * as _40 from "./clob/order_removals"; -import * as _41 from "./clob/order"; -import * as _42 from "./clob/process_proposer_matches_events"; -import * as _43 from "./clob/query"; -import * as _44 from "./clob/streaming"; -import * as _45 from "./clob/tx"; -import * as _46 from "./daemons/bridge/bridge"; -import * as _47 from "./daemons/liquidation/liquidation"; -import * as _48 from "./daemons/pricefeed/price_feed"; -import * as _49 from "./delaymsg/block_message_ids"; -import * as _50 from "./delaymsg/delayed_message"; -import * as _51 from "./delaymsg/genesis"; -import * as _52 from "./delaymsg/query"; -import * as _53 from "./delaymsg/tx"; -import * as _54 from "./epochs/epoch_info"; -import * as _55 from "./epochs/genesis"; -import * as _56 from "./epochs/query"; -import * as _57 from "./feetiers/genesis"; -import * as _58 from "./feetiers/params"; -import * as _59 from "./feetiers/per_market_fee_discount"; -import * as _60 from "./feetiers/query"; -import * as _61 from "./feetiers/staking_tier"; -import * as _62 from "./feetiers/tx"; -import * as _63 from "./govplus/genesis"; -import * as _64 from "./govplus/query"; -import * as _65 from "./govplus/tx"; -import * as _66 from "./indexer/events/events"; -import * as _67 from "./indexer/indexer_manager/event"; -import * as _68 from "./indexer/off_chain_updates/off_chain_updates"; -import * as _69 from "./indexer/protocol/v1/clob"; -import * as _70 from "./indexer/protocol/v1/perpetual"; -import * as _71 from "./indexer/protocol/v1/subaccount"; -import * as _72 from "./indexer/protocol/v1/vault"; -import * as _73 from "./indexer/redis/redis_order"; -import * as _74 from "./indexer/shared/removal_reason"; -import * as _75 from "./indexer/socks/messages"; -import * as _76 from "./listing/genesis"; -import * as _77 from "./listing/params"; -import * as _78 from "./listing/query"; -import * as _79 from "./listing/tx"; -import * as _80 from "./perpetuals/genesis"; -import * as _81 from "./perpetuals/params"; -import * as _82 from "./perpetuals/perpetual"; -import * as _83 from "./perpetuals/query"; -import * as _84 from "./perpetuals/tx"; -import * as _85 from "./prices/genesis"; -import * as _86 from "./prices/market_param"; -import * as _87 from "./prices/market_price"; -import * as _88 from "./prices/query"; -import * as _89 from "./prices/streaming"; -import * as _90 from "./prices/tx"; -import * as _91 from "./ratelimit/capacity"; -import * as _92 from "./ratelimit/genesis"; -import * as _93 from "./ratelimit/limit_params"; -import * as _94 from "./ratelimit/pending_send_packet"; -import * as _95 from "./ratelimit/query"; -import * as _96 from "./ratelimit/tx"; -import * as _97 from "./revshare/genesis"; -import * as _98 from "./revshare/params"; -import * as _99 from "./revshare/query"; -import * as _100 from "./revshare/revshare"; -import * as _101 from "./revshare/tx"; -import * as _102 from "./rewards/genesis"; -import * as _103 from "./rewards/params"; -import * as _104 from "./rewards/query"; -import * as _105 from "./rewards/reward_share"; -import * as _106 from "./rewards/tx"; -import * as _107 from "./sending/genesis"; -import * as _108 from "./sending/query"; -import * as _109 from "./sending/transfer"; -import * as _110 from "./sending/tx"; -import * as _111 from "./stats/genesis"; -import * as _112 from "./stats/params"; -import * as _113 from "./stats/query"; -import * as _114 from "./stats/stats"; -import * as _115 from "./stats/tx"; -import * as _116 from "./subaccounts/asset_position"; -import * as _117 from "./subaccounts/genesis"; -import * as _118 from "./subaccounts/leverage"; -import * as _119 from "./subaccounts/perpetual_position"; -import * as _120 from "./subaccounts/query"; -import * as _121 from "./subaccounts/streaming"; -import * as _122 from "./subaccounts/subaccount"; -import * as _123 from "./vault/genesis"; -import * as _124 from "./vault/params"; -import * as _125 from "./vault/query"; -import * as _126 from "./vault/share"; -import * as _127 from "./vault/tx"; -import * as _128 from "./vault/vault"; -import * as _129 from "./vest/genesis"; -import * as _130 from "./vest/query"; -import * as _131 from "./vest/tx"; -import * as _132 from "./vest/vest_entry"; -import * as _140 from "./accountplus/query.lcd"; -import * as _141 from "./affiliates/query.lcd"; -import * as _142 from "./assets/query.lcd"; -import * as _143 from "./blocktime/query.lcd"; -import * as _144 from "./bridge/query.lcd"; -import * as _145 from "./clob/query.lcd"; -import * as _146 from "./delaymsg/query.lcd"; -import * as _147 from "./epochs/query.lcd"; -import * as _148 from "./feetiers/query.lcd"; -import * as _149 from "./listing/query.lcd"; -import * as _150 from "./perpetuals/query.lcd"; -import * as _151 from "./prices/query.lcd"; -import * as _152 from "./ratelimit/query.lcd"; -import * as _153 from "./revshare/query.lcd"; -import * as _154 from "./rewards/query.lcd"; -import * as _155 from "./stats/query.lcd"; -import * as _156 from "./subaccounts/query.lcd"; -import * as _157 from "./vault/query.lcd"; -import * as _158 from "./vest/query.lcd"; -import * as _159 from "./accountplus/query.rpc.Query"; -import * as _160 from "./affiliates/query.rpc.Query"; -import * as _161 from "./assets/query.rpc.Query"; -import * as _162 from "./blocktime/query.rpc.Query"; -import * as _163 from "./bridge/query.rpc.Query"; -import * as _164 from "./clob/query.rpc.Query"; -import * as _165 from "./delaymsg/query.rpc.Query"; -import * as _166 from "./epochs/query.rpc.Query"; -import * as _167 from "./feetiers/query.rpc.Query"; -import * as _168 from "./govplus/query.rpc.Query"; -import * as _169 from "./listing/query.rpc.Query"; -import * as _170 from "./perpetuals/query.rpc.Query"; -import * as _171 from "./prices/query.rpc.Query"; -import * as _172 from "./ratelimit/query.rpc.Query"; -import * as _173 from "./revshare/query.rpc.Query"; -import * as _174 from "./rewards/query.rpc.Query"; -import * as _175 from "./sending/query.rpc.Query"; -import * as _176 from "./stats/query.rpc.Query"; -import * as _177 from "./subaccounts/query.rpc.Query"; -import * as _178 from "./vault/query.rpc.Query"; -import * as _179 from "./vest/query.rpc.Query"; -import * as _180 from "./accountplus/tx.rpc.msg"; -import * as _181 from "./affiliates/tx.rpc.msg"; -import * as _182 from "./blocktime/tx.rpc.msg"; -import * as _183 from "./bridge/tx.rpc.msg"; -import * as _184 from "./clob/tx.rpc.msg"; -import * as _185 from "./delaymsg/tx.rpc.msg"; -import * as _186 from "./feetiers/tx.rpc.msg"; -import * as _187 from "./govplus/tx.rpc.msg"; -import * as _188 from "./listing/tx.rpc.msg"; -import * as _189 from "./perpetuals/tx.rpc.msg"; -import * as _190 from "./prices/tx.rpc.msg"; -import * as _191 from "./ratelimit/tx.rpc.msg"; -import * as _192 from "./revshare/tx.rpc.msg"; -import * as _193 from "./rewards/tx.rpc.msg"; -import * as _194 from "./sending/tx.rpc.msg"; -import * as _195 from "./stats/tx.rpc.msg"; -import * as _196 from "./vault/tx.rpc.msg"; -import * as _197 from "./vest/tx.rpc.msg"; -import * as _198 from "./lcd"; -import * as _199 from "./rpc.query"; -import * as _200 from "./rpc.tx"; +import * as _30 from "./clob/block_limits_config"; +import * as _31 from "./clob/block_rate_limit_config"; +import * as _32 from "./clob/clob_pair"; +import * as _33 from "./clob/equity_tier_limit_config"; +import * as _34 from "./clob/finalize_block"; +import * as _35 from "./clob/genesis"; +import * as _36 from "./clob/liquidations_config"; +import * as _37 from "./clob/liquidations"; +import * as _38 from "./clob/matches"; +import * as _39 from "./clob/mev"; +import * as _40 from "./clob/operation"; +import * as _41 from "./clob/order_removals"; +import * as _42 from "./clob/order"; +import * as _43 from "./clob/process_proposer_matches_events"; +import * as _44 from "./clob/query"; +import * as _45 from "./clob/streaming"; +import * as _46 from "./clob/tx"; +import * as _47 from "./daemons/bridge/bridge"; +import * as _48 from "./daemons/liquidation/liquidation"; +import * as _49 from "./daemons/pricefeed/price_feed"; +import * as _50 from "./delaymsg/block_message_ids"; +import * as _51 from "./delaymsg/delayed_message"; +import * as _52 from "./delaymsg/genesis"; +import * as _53 from "./delaymsg/query"; +import * as _54 from "./delaymsg/tx"; +import * as _55 from "./epochs/epoch_info"; +import * as _56 from "./epochs/genesis"; +import * as _57 from "./epochs/query"; +import * as _58 from "./feetiers/genesis"; +import * as _59 from "./feetiers/params"; +import * as _60 from "./feetiers/per_market_fee_discount"; +import * as _61 from "./feetiers/query"; +import * as _62 from "./feetiers/staking_tier"; +import * as _63 from "./feetiers/tx"; +import * as _64 from "./govplus/genesis"; +import * as _65 from "./govplus/query"; +import * as _66 from "./govplus/tx"; +import * as _67 from "./indexer/events/events"; +import * as _68 from "./indexer/indexer_manager/event"; +import * as _69 from "./indexer/off_chain_updates/off_chain_updates"; +import * as _70 from "./indexer/protocol/v1/clob"; +import * as _71 from "./indexer/protocol/v1/perpetual"; +import * as _72 from "./indexer/protocol/v1/subaccount"; +import * as _73 from "./indexer/protocol/v1/vault"; +import * as _74 from "./indexer/redis/redis_order"; +import * as _75 from "./indexer/shared/removal_reason"; +import * as _76 from "./indexer/socks/messages"; +import * as _77 from "./listing/genesis"; +import * as _78 from "./listing/params"; +import * as _79 from "./listing/query"; +import * as _80 from "./listing/tx"; +import * as _81 from "./perpetuals/genesis"; +import * as _82 from "./perpetuals/params"; +import * as _83 from "./perpetuals/perpetual"; +import * as _84 from "./perpetuals/query"; +import * as _85 from "./perpetuals/tx"; +import * as _86 from "./prices/genesis"; +import * as _87 from "./prices/market_param"; +import * as _88 from "./prices/market_price"; +import * as _89 from "./prices/query"; +import * as _90 from "./prices/streaming"; +import * as _91 from "./prices/tx"; +import * as _92 from "./ratelimit/capacity"; +import * as _93 from "./ratelimit/genesis"; +import * as _94 from "./ratelimit/limit_params"; +import * as _95 from "./ratelimit/pending_send_packet"; +import * as _96 from "./ratelimit/query"; +import * as _97 from "./ratelimit/tx"; +import * as _98 from "./revshare/genesis"; +import * as _99 from "./revshare/params"; +import * as _100 from "./revshare/query"; +import * as _101 from "./revshare/revshare"; +import * as _102 from "./revshare/tx"; +import * as _103 from "./rewards/genesis"; +import * as _104 from "./rewards/params"; +import * as _105 from "./rewards/query"; +import * as _106 from "./rewards/reward_share"; +import * as _107 from "./rewards/tx"; +import * as _108 from "./sending/genesis"; +import * as _109 from "./sending/query"; +import * as _110 from "./sending/transfer"; +import * as _111 from "./sending/tx"; +import * as _112 from "./stats/genesis"; +import * as _113 from "./stats/params"; +import * as _114 from "./stats/query"; +import * as _115 from "./stats/stats"; +import * as _116 from "./stats/tx"; +import * as _117 from "./subaccounts/asset_position"; +import * as _118 from "./subaccounts/genesis"; +import * as _119 from "./subaccounts/leverage"; +import * as _120 from "./subaccounts/perpetual_position"; +import * as _121 from "./subaccounts/query"; +import * as _122 from "./subaccounts/streaming"; +import * as _123 from "./subaccounts/subaccount"; +import * as _124 from "./vault/genesis"; +import * as _125 from "./vault/params"; +import * as _126 from "./vault/query"; +import * as _127 from "./vault/share"; +import * as _128 from "./vault/tx"; +import * as _129 from "./vault/vault"; +import * as _130 from "./vest/genesis"; +import * as _131 from "./vest/query"; +import * as _132 from "./vest/tx"; +import * as _133 from "./vest/vest_entry"; +import * as _141 from "./accountplus/query.lcd"; +import * as _142 from "./affiliates/query.lcd"; +import * as _143 from "./assets/query.lcd"; +import * as _144 from "./blocktime/query.lcd"; +import * as _145 from "./bridge/query.lcd"; +import * as _146 from "./clob/query.lcd"; +import * as _147 from "./delaymsg/query.lcd"; +import * as _148 from "./epochs/query.lcd"; +import * as _149 from "./feetiers/query.lcd"; +import * as _150 from "./listing/query.lcd"; +import * as _151 from "./perpetuals/query.lcd"; +import * as _152 from "./prices/query.lcd"; +import * as _153 from "./ratelimit/query.lcd"; +import * as _154 from "./revshare/query.lcd"; +import * as _155 from "./rewards/query.lcd"; +import * as _156 from "./stats/query.lcd"; +import * as _157 from "./subaccounts/query.lcd"; +import * as _158 from "./vault/query.lcd"; +import * as _159 from "./vest/query.lcd"; +import * as _160 from "./accountplus/query.rpc.Query"; +import * as _161 from "./affiliates/query.rpc.Query"; +import * as _162 from "./assets/query.rpc.Query"; +import * as _163 from "./blocktime/query.rpc.Query"; +import * as _164 from "./bridge/query.rpc.Query"; +import * as _165 from "./clob/query.rpc.Query"; +import * as _166 from "./delaymsg/query.rpc.Query"; +import * as _167 from "./epochs/query.rpc.Query"; +import * as _168 from "./feetiers/query.rpc.Query"; +import * as _169 from "./govplus/query.rpc.Query"; +import * as _170 from "./listing/query.rpc.Query"; +import * as _171 from "./perpetuals/query.rpc.Query"; +import * as _172 from "./prices/query.rpc.Query"; +import * as _173 from "./ratelimit/query.rpc.Query"; +import * as _174 from "./revshare/query.rpc.Query"; +import * as _175 from "./rewards/query.rpc.Query"; +import * as _176 from "./sending/query.rpc.Query"; +import * as _177 from "./stats/query.rpc.Query"; +import * as _178 from "./subaccounts/query.rpc.Query"; +import * as _179 from "./vault/query.rpc.Query"; +import * as _180 from "./vest/query.rpc.Query"; +import * as _181 from "./accountplus/tx.rpc.msg"; +import * as _182 from "./affiliates/tx.rpc.msg"; +import * as _183 from "./blocktime/tx.rpc.msg"; +import * as _184 from "./bridge/tx.rpc.msg"; +import * as _185 from "./clob/tx.rpc.msg"; +import * as _186 from "./delaymsg/tx.rpc.msg"; +import * as _187 from "./feetiers/tx.rpc.msg"; +import * as _188 from "./govplus/tx.rpc.msg"; +import * as _189 from "./listing/tx.rpc.msg"; +import * as _190 from "./perpetuals/tx.rpc.msg"; +import * as _191 from "./prices/tx.rpc.msg"; +import * as _192 from "./ratelimit/tx.rpc.msg"; +import * as _193 from "./revshare/tx.rpc.msg"; +import * as _194 from "./rewards/tx.rpc.msg"; +import * as _195 from "./sending/tx.rpc.msg"; +import * as _196 from "./stats/tx.rpc.msg"; +import * as _197 from "./vault/tx.rpc.msg"; +import * as _198 from "./vest/tx.rpc.msg"; +import * as _199 from "./lcd"; +import * as _200 from "./rpc.query"; +import * as _201 from "./rpc.tx"; export namespace dydxprotocol { export const accountplus = { ..._5, ..._6, @@ -194,33 +195,33 @@ export namespace dydxprotocol { ..._8, ..._9, ..._10, - ..._140, - ..._159, - ..._180 + ..._141, + ..._160, + ..._181 }; export const affiliates = { ..._11, ..._12, ..._13, ..._14, - ..._141, - ..._160, - ..._181 + ..._142, + ..._161, + ..._182 }; export const assets = { ..._15, ..._16, ..._17, ..._18, - ..._142, - ..._161 + ..._143, + ..._162 }; export const blocktime = { ..._19, ..._20, ..._21, ..._22, ..._23, - ..._143, - ..._162, - ..._182 + ..._144, + ..._163, + ..._183 }; export const bridge = { ..._24, ..._25, @@ -228,9 +229,9 @@ export namespace dydxprotocol { ..._27, ..._28, ..._29, - ..._144, - ..._163, - ..._183 + ..._145, + ..._164, + ..._184 }; export const clob = { ..._30, ..._31, @@ -248,171 +249,172 @@ export namespace dydxprotocol { ..._43, ..._44, ..._45, - ..._145, - ..._164, - ..._184 + ..._46, + ..._146, + ..._165, + ..._185 }; export namespace daemons { - export const bridge = { ..._46 + export const bridge = { ..._47 }; - export const liquidation = { ..._47 + export const liquidation = { ..._48 }; - export const pricefeed = { ..._48 + export const pricefeed = { ..._49 }; } - export const delaymsg = { ..._49, - ..._50, + export const delaymsg = { ..._50, ..._51, ..._52, ..._53, - ..._146, - ..._165, - ..._185 + ..._54, + ..._147, + ..._166, + ..._186 }; - export const epochs = { ..._54, - ..._55, + export const epochs = { ..._55, ..._56, - ..._147, - ..._166 + ..._57, + ..._148, + ..._167 }; - export const feetiers = { ..._57, - ..._58, + export const feetiers = { ..._58, ..._59, ..._60, ..._61, ..._62, - ..._148, - ..._167, - ..._186 - }; - export const govplus = { ..._63, - ..._64, - ..._65, + ..._63, + ..._149, ..._168, ..._187 }; + export const govplus = { ..._64, + ..._65, + ..._66, + ..._169, + ..._188 + }; export namespace indexer { - export const events = { ..._66 + export const events = { ..._67 }; - export const indexer_manager = { ..._67 + export const indexer_manager = { ..._68 }; - export const off_chain_updates = { ..._68 + export const off_chain_updates = { ..._69 }; export namespace protocol { - export const v1 = { ..._69, - ..._70, + export const v1 = { ..._70, ..._71, - ..._72 + ..._72, + ..._73 }; } - export const redis = { ..._73 + export const redis = { ..._74 }; - export const shared = { ..._74 + export const shared = { ..._75 }; - export const socks = { ..._75 + export const socks = { ..._76 }; } - export const listing = { ..._76, - ..._77, + export const listing = { ..._77, ..._78, ..._79, - ..._149, - ..._169, - ..._188 + ..._80, + ..._150, + ..._170, + ..._189 }; - export const perpetuals = { ..._80, - ..._81, + export const perpetuals = { ..._81, ..._82, ..._83, ..._84, - ..._150, - ..._170, - ..._189 + ..._85, + ..._151, + ..._171, + ..._190 }; - export const prices = { ..._85, - ..._86, + export const prices = { ..._86, ..._87, ..._88, ..._89, ..._90, - ..._151, - ..._171, - ..._190 + ..._91, + ..._152, + ..._172, + ..._191 }; - export const ratelimit = { ..._91, - ..._92, + export const ratelimit = { ..._92, ..._93, ..._94, ..._95, ..._96, - ..._152, - ..._172, - ..._191 + ..._97, + ..._153, + ..._173, + ..._192 }; - export const revshare = { ..._97, - ..._98, + export const revshare = { ..._98, ..._99, ..._100, ..._101, - ..._153, - ..._173, - ..._192 + ..._102, + ..._154, + ..._174, + ..._193 }; - export const rewards = { ..._102, - ..._103, + export const rewards = { ..._103, ..._104, ..._105, ..._106, - ..._154, - ..._174, - ..._193 + ..._107, + ..._155, + ..._175, + ..._194 }; - export const sending = { ..._107, - ..._108, + export const sending = { ..._108, ..._109, ..._110, - ..._175, - ..._194 + ..._111, + ..._176, + ..._195 }; - export const stats = { ..._111, - ..._112, + export const stats = { ..._112, ..._113, ..._114, ..._115, - ..._155, - ..._176, - ..._195 + ..._116, + ..._156, + ..._177, + ..._196 }; - export const subaccounts = { ..._116, - ..._117, + export const subaccounts = { ..._117, ..._118, ..._119, ..._120, ..._121, ..._122, - ..._156, - ..._177 + ..._123, + ..._157, + ..._178 }; - export const vault = { ..._123, - ..._124, + export const vault = { ..._124, ..._125, ..._126, ..._127, ..._128, - ..._157, - ..._178, - ..._196 - }; - export const vest = { ..._129, - ..._130, - ..._131, - ..._132, + ..._129, ..._158, ..._179, ..._197 }; - export const ClientFactory = { ..._198, - ..._199, - ..._200 + export const vest = { ..._130, + ..._131, + ..._132, + ..._133, + ..._159, + ..._180, + ..._198 + }; + export const ClientFactory = { ..._199, + ..._200, + ..._201 }; } \ No newline at end of file diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/block_limits_config.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/block_limits_config.ts new file mode 100644 index 00000000000..4533292e79e --- /dev/null +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/block_limits_config.ts @@ -0,0 +1,67 @@ +import * as _m0 from "protobufjs/minimal"; +import { DeepPartial } from "../../helpers"; +/** BlockLimitsConfig stores global per-block limits for the CLOB module. */ + +export interface BlockLimitsConfig { + /** + * The maximum number of expired stateful orders that can be removed from + * state in a single block. This prevents performance degradation when + * processing a large number of expired orders. + */ + maxStatefulOrderRemovalsPerBlock: number; +} +/** BlockLimitsConfig stores global per-block limits for the CLOB module. */ + +export interface BlockLimitsConfigSDKType { + /** + * The maximum number of expired stateful orders that can be removed from + * state in a single block. This prevents performance degradation when + * processing a large number of expired orders. + */ + max_stateful_order_removals_per_block: number; +} + +function createBaseBlockLimitsConfig(): BlockLimitsConfig { + return { + maxStatefulOrderRemovalsPerBlock: 0 + }; +} + +export const BlockLimitsConfig = { + encode(message: BlockLimitsConfig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.maxStatefulOrderRemovalsPerBlock !== 0) { + writer.uint32(8).uint32(message.maxStatefulOrderRemovalsPerBlock); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): BlockLimitsConfig { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBlockLimitsConfig(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.maxStatefulOrderRemovalsPerBlock = reader.uint32(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromPartial(object: DeepPartial): BlockLimitsConfig { + const message = createBaseBlockLimitsConfig(); + message.maxStatefulOrderRemovalsPerBlock = object.maxStatefulOrderRemovalsPerBlock ?? 0; + return message; + } + +}; \ No newline at end of file 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 4eae538a656..d083692ec70 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, QueryNextClobPairIdRequest, QueryNextClobPairIdResponseSDKType, QueryLeverageRequest, QueryLeverageResponseSDKType } from "./query"; +import { QueryGetClobPairRequest, QueryClobPairResponseSDKType, QueryAllClobPairRequest, QueryClobPairAllResponseSDKType, QueryEquityTierLimitConfigurationRequest, QueryEquityTierLimitConfigurationResponseSDKType, QueryBlockRateLimitConfigurationRequest, QueryBlockRateLimitConfigurationResponseSDKType, QueryLiquidationsConfigurationRequest, QueryLiquidationsConfigurationResponseSDKType, QueryBlockLimitsConfigurationRequest, QueryBlockLimitsConfigurationResponseSDKType, QueryNextClobPairIdRequest, QueryNextClobPairIdResponseSDKType, QueryLeverageRequest, QueryLeverageResponseSDKType } 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.blockLimitsConfiguration = this.blockLimitsConfiguration.bind(this); this.nextClobPairId = this.nextClobPairId.bind(this); this.leverage = this.leverage.bind(this); } @@ -63,6 +64,13 @@ export class LCDQueryClient { const endpoint = `dydxprotocol/clob/liquidations_config`; return await this.req.get(endpoint); } + /* Queries BlockLimitsConfiguration. */ + + + async blockLimitsConfiguration(_params: QueryBlockLimitsConfigurationRequest = {}): Promise { + const endpoint = `dydxprotocol/clob/block_limits_config`; + return await this.req.get(endpoint); + } /* Queries the next clob pair id. */ 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 b4fc8ac682d..f82df5683f7 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, QueryNextClobPairIdRequest, QueryNextClobPairIdResponse, QueryLeverageRequest, QueryLeverageResponse, StreamOrderbookUpdatesRequest, StreamOrderbookUpdatesResponse } from "./query"; +import { QueryGetClobPairRequest, QueryClobPairResponse, QueryAllClobPairRequest, QueryClobPairAllResponse, MevNodeToNodeCalculationRequest, MevNodeToNodeCalculationResponse, QueryEquityTierLimitConfigurationRequest, QueryEquityTierLimitConfigurationResponse, QueryBlockRateLimitConfigurationRequest, QueryBlockRateLimitConfigurationResponse, QueryLiquidationsConfigurationRequest, QueryLiquidationsConfigurationResponse, QueryBlockLimitsConfigurationRequest, QueryBlockLimitsConfigurationResponse, QueryStatefulOrderRequest, QueryStatefulOrderResponse, QueryNextClobPairIdRequest, QueryNextClobPairIdResponse, QueryLeverageRequest, QueryLeverageResponse, StreamOrderbookUpdatesRequest, StreamOrderbookUpdatesResponse } from "./query"; /** Query defines the gRPC querier service. */ export interface Query { @@ -22,6 +22,9 @@ export interface Query { /** Queries LiquidationsConfiguration. */ liquidationsConfiguration(request?: QueryLiquidationsConfigurationRequest): Promise; + /** Queries BlockLimitsConfiguration. */ + + blockLimitsConfiguration(request?: QueryBlockLimitsConfigurationRequest): Promise; /** Queries the stateful order for a given order id. */ statefulOrder(request: QueryStatefulOrderRequest): Promise; @@ -49,6 +52,7 @@ export class QueryClientImpl implements Query { this.equityTierLimitConfiguration = this.equityTierLimitConfiguration.bind(this); this.blockRateLimitConfiguration = this.blockRateLimitConfiguration.bind(this); this.liquidationsConfiguration = this.liquidationsConfiguration.bind(this); + this.blockLimitsConfiguration = this.blockLimitsConfiguration.bind(this); this.statefulOrder = this.statefulOrder.bind(this); this.nextClobPairId = this.nextClobPairId.bind(this); this.leverage = this.leverage.bind(this); @@ -93,6 +97,12 @@ export class QueryClientImpl implements Query { return promise.then(data => QueryLiquidationsConfigurationResponse.decode(new _m0.Reader(data))); } + blockLimitsConfiguration(request: QueryBlockLimitsConfigurationRequest = {}): Promise { + const data = QueryBlockLimitsConfigurationRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.clob.Query", "BlockLimitsConfiguration", data); + return promise.then(data => QueryBlockLimitsConfigurationResponse.decode(new _m0.Reader(data))); + } + statefulOrder(request: QueryStatefulOrderRequest): Promise { const data = QueryStatefulOrderRequest.encode(request).finish(); const promise = this.rpc.request("dydxprotocol.clob.Query", "StatefulOrder", data); @@ -146,6 +156,10 @@ export const createRpcQueryExtension = (base: QueryClient) => { return queryService.liquidationsConfiguration(request); }, + blockLimitsConfiguration(request?: QueryBlockLimitsConfigurationRequest): Promise { + return queryService.blockLimitsConfiguration(request); + }, + statefulOrder(request: QueryStatefulOrderRequest): Promise { return queryService.statefulOrder(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 8163ff0c9c8..18a154679ff 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/query.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/query.ts @@ -6,6 +6,7 @@ import { ClobPair, ClobPairSDKType } from "./clob_pair"; import { EquityTierLimitConfiguration, EquityTierLimitConfigurationSDKType } from "./equity_tier_limit_config"; import { BlockRateLimitConfiguration, BlockRateLimitConfigurationSDKType } from "./block_rate_limit_config"; import { LiquidationsConfig, LiquidationsConfigSDKType } from "./liquidations_config"; +import { BlockLimitsConfig, BlockLimitsConfigSDKType } from "./block_limits_config"; import { StreamSubaccountUpdate, StreamSubaccountUpdateSDKType } from "../subaccounts/streaming"; import { StreamPriceUpdate, StreamPriceUpdateSDKType } from "../prices/streaming"; import { OffChainUpdateV1, OffChainUpdateV1SDKType } from "../indexer/off_chain_updates/off_chain_updates"; @@ -246,6 +247,34 @@ export interface QueryLiquidationsConfigurationResponse { export interface QueryLiquidationsConfigurationResponseSDKType { liquidations_config?: LiquidationsConfigSDKType; } +/** + * QueryBlockLimitsConfigurationRequest is a request message for + * BlockLimitsConfiguration. + */ + +export interface QueryBlockLimitsConfigurationRequest {} +/** + * QueryBlockLimitsConfigurationRequest is a request message for + * BlockLimitsConfiguration. + */ + +export interface QueryBlockLimitsConfigurationRequestSDKType {} +/** + * QueryBlockLimitsConfigurationResponse is a response message that contains + * the BlockLimitsConfiguration. + */ + +export interface QueryBlockLimitsConfigurationResponse { + blockLimitsConfig?: BlockLimitsConfig; +} +/** + * QueryBlockLimitsConfigurationResponse is a response message that contains + * the BlockLimitsConfiguration. + */ + +export interface QueryBlockLimitsConfigurationResponseSDKType { + block_limits_config?: BlockLimitsConfigSDKType; +} /** QueryNextClobPairIdRequest is a request message for the next clob pair id */ export interface QueryNextClobPairIdRequest {} @@ -1277,6 +1306,85 @@ export const QueryLiquidationsConfigurationResponse = { }; +function createBaseQueryBlockLimitsConfigurationRequest(): QueryBlockLimitsConfigurationRequest { + return {}; +} + +export const QueryBlockLimitsConfigurationRequest = { + encode(_: QueryBlockLimitsConfigurationRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryBlockLimitsConfigurationRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBlockLimitsConfigurationRequest(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromPartial(_: DeepPartial): QueryBlockLimitsConfigurationRequest { + const message = createBaseQueryBlockLimitsConfigurationRequest(); + return message; + } + +}; + +function createBaseQueryBlockLimitsConfigurationResponse(): QueryBlockLimitsConfigurationResponse { + return { + blockLimitsConfig: undefined + }; +} + +export const QueryBlockLimitsConfigurationResponse = { + encode(message: QueryBlockLimitsConfigurationResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.blockLimitsConfig !== undefined) { + BlockLimitsConfig.encode(message.blockLimitsConfig, writer.uint32(10).fork()).ldelim(); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryBlockLimitsConfigurationResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBlockLimitsConfigurationResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.blockLimitsConfig = BlockLimitsConfig.decode(reader, reader.uint32()); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromPartial(object: DeepPartial): QueryBlockLimitsConfigurationResponse { + const message = createBaseQueryBlockLimitsConfigurationResponse(); + message.blockLimitsConfig = object.blockLimitsConfig !== undefined && object.blockLimitsConfig !== null ? BlockLimitsConfig.fromPartial(object.blockLimitsConfig) : undefined; + return message; + } + +}; + function createBaseQueryNextClobPairIdRequest(): QueryNextClobPairIdRequest { return {}; } diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/tx.rpc.msg.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/tx.rpc.msg.ts index 815b80be641..47496c52d8f 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/tx.rpc.msg.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/tx.rpc.msg.ts @@ -1,6 +1,6 @@ import { Rpc } from "../../helpers"; import * as _m0 from "protobufjs/minimal"; -import { MsgProposedOperations, MsgProposedOperationsResponse, MsgPlaceOrder, MsgPlaceOrderResponse, MsgCancelOrder, MsgCancelOrderResponse, MsgBatchCancel, MsgBatchCancelResponse, MsgCreateClobPair, MsgCreateClobPairResponse, MsgUpdateClobPair, MsgUpdateClobPairResponse, MsgUpdateEquityTierLimitConfiguration, MsgUpdateEquityTierLimitConfigurationResponse, MsgUpdateBlockRateLimitConfiguration, MsgUpdateBlockRateLimitConfigurationResponse, MsgUpdateLiquidationsConfig, MsgUpdateLiquidationsConfigResponse, MsgUpdateLeverage, MsgUpdateLeverageResponse } from "./tx"; +import { MsgProposedOperations, MsgProposedOperationsResponse, MsgPlaceOrder, MsgPlaceOrderResponse, MsgCancelOrder, MsgCancelOrderResponse, MsgBatchCancel, MsgBatchCancelResponse, MsgCreateClobPair, MsgCreateClobPairResponse, MsgUpdateClobPair, MsgUpdateClobPairResponse, MsgUpdateEquityTierLimitConfiguration, MsgUpdateEquityTierLimitConfigurationResponse, MsgUpdateBlockRateLimitConfiguration, MsgUpdateBlockRateLimitConfigurationResponse, MsgUpdateLiquidationsConfig, MsgUpdateLiquidationsConfigResponse, MsgUpdateBlockLimitsConfig, MsgUpdateBlockLimitsConfigResponse, MsgUpdateLeverage, MsgUpdateLeverageResponse } from "./tx"; /** Msg defines the Msg service. */ export interface Msg { @@ -44,6 +44,9 @@ export interface Msg { /** UpdateLiquidationsConfig updates the liquidations configuration in state. */ updateLiquidationsConfig(request: MsgUpdateLiquidationsConfig): Promise; + /** UpdateBlockLimitsConfig updates the block limits configuration in state. */ + + updateBlockLimitsConfig(request: MsgUpdateBlockLimitsConfig): Promise; /** * UpdateLeverage allows accounts to update their desired leverage for * clob pairs. @@ -65,6 +68,7 @@ export class MsgClientImpl implements Msg { this.updateEquityTierLimitConfiguration = this.updateEquityTierLimitConfiguration.bind(this); this.updateBlockRateLimitConfiguration = this.updateBlockRateLimitConfiguration.bind(this); this.updateLiquidationsConfig = this.updateLiquidationsConfig.bind(this); + this.updateBlockLimitsConfig = this.updateBlockLimitsConfig.bind(this); this.updateLeverage = this.updateLeverage.bind(this); } @@ -122,6 +126,12 @@ export class MsgClientImpl implements Msg { return promise.then(data => MsgUpdateLiquidationsConfigResponse.decode(new _m0.Reader(data))); } + updateBlockLimitsConfig(request: MsgUpdateBlockLimitsConfig): Promise { + const data = MsgUpdateBlockLimitsConfig.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.clob.Msg", "UpdateBlockLimitsConfig", data); + return promise.then(data => MsgUpdateBlockLimitsConfigResponse.decode(new _m0.Reader(data))); + } + updateLeverage(request: MsgUpdateLeverage): Promise { const data = MsgUpdateLeverage.encode(request).finish(); const promise = this.rpc.request("dydxprotocol.clob.Msg", "UpdateLeverage", data); diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/tx.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/tx.ts index 85f2ebc96e0..d07b2d97c66 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/tx.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/tx.ts @@ -4,6 +4,7 @@ import { ClobPair, ClobPairSDKType } from "./clob_pair"; import { EquityTierLimitConfiguration, EquityTierLimitConfigurationSDKType } from "./equity_tier_limit_config"; import { BlockRateLimitConfiguration, BlockRateLimitConfigurationSDKType } from "./block_rate_limit_config"; import { LiquidationsConfig, LiquidationsConfigSDKType } from "./liquidations_config"; +import { BlockLimitsConfig, BlockLimitsConfigSDKType } from "./block_limits_config"; import { ClobMatch, ClobMatchSDKType } from "./matches"; import { OrderRemoval, OrderRemovalSDKType } from "./order_removals"; import * as _m0 from "protobufjs/minimal"; @@ -382,6 +383,48 @@ export interface MsgUpdateLiquidationsConfigResponse {} /** MsgUpdateLiquidationsConfig is the Msg/LiquidationsConfig response type. */ export interface MsgUpdateLiquidationsConfigResponseSDKType {} +/** + * MsgUpdateBlockLimitsConfig is a request type for updating the block limits + * configuration. + */ + +export interface MsgUpdateBlockLimitsConfig { + /** Authority is the address that may send this message. */ + authority: string; + /** + * Defines the block limits configuration to update to. All fields must be + * set. + */ + + blockLimitsConfig?: BlockLimitsConfig; +} +/** + * MsgUpdateBlockLimitsConfig is a request type for updating the block limits + * configuration. + */ + +export interface MsgUpdateBlockLimitsConfigSDKType { + /** Authority is the address that may send this message. */ + authority: string; + /** + * Defines the block limits configuration to update to. All fields must be + * set. + */ + + block_limits_config?: BlockLimitsConfigSDKType; +} +/** + * MsgUpdateBlockLimitsConfigResponse is a response type for updating the + * block limits configuration. + */ + +export interface MsgUpdateBlockLimitsConfigResponse {} +/** + * MsgUpdateBlockLimitsConfigResponse is a response type for updating the + * block limits configuration. + */ + +export interface MsgUpdateBlockLimitsConfigResponseSDKType {} /** LeverageEntry represents a single clob pair leverage setting. */ export interface LeverageEntry { @@ -1385,6 +1428,95 @@ export const MsgUpdateLiquidationsConfigResponse = { }; +function createBaseMsgUpdateBlockLimitsConfig(): MsgUpdateBlockLimitsConfig { + return { + authority: "", + blockLimitsConfig: undefined + }; +} + +export const MsgUpdateBlockLimitsConfig = { + encode(message: MsgUpdateBlockLimitsConfig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + + if (message.blockLimitsConfig !== undefined) { + BlockLimitsConfig.encode(message.blockLimitsConfig, writer.uint32(18).fork()).ldelim(); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateBlockLimitsConfig { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateBlockLimitsConfig(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + + case 2: + message.blockLimitsConfig = BlockLimitsConfig.decode(reader, reader.uint32()); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromPartial(object: DeepPartial): MsgUpdateBlockLimitsConfig { + const message = createBaseMsgUpdateBlockLimitsConfig(); + message.authority = object.authority ?? ""; + message.blockLimitsConfig = object.blockLimitsConfig !== undefined && object.blockLimitsConfig !== null ? BlockLimitsConfig.fromPartial(object.blockLimitsConfig) : undefined; + return message; + } + +}; + +function createBaseMsgUpdateBlockLimitsConfigResponse(): MsgUpdateBlockLimitsConfigResponse { + return {}; +} + +export const MsgUpdateBlockLimitsConfigResponse = { + encode(_: MsgUpdateBlockLimitsConfigResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateBlockLimitsConfigResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateBlockLimitsConfigResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromPartial(_: DeepPartial): MsgUpdateBlockLimitsConfigResponse { + const message = createBaseMsgUpdateBlockLimitsConfigResponse(); + return message; + } + +}; + function createBaseLeverageEntry(): LeverageEntry { return { clobPairId: 0, diff --git a/indexer/packages/v4-protos/src/codegen/gogoproto/bundle.ts b/indexer/packages/v4-protos/src/codegen/gogoproto/bundle.ts index c96e8e29e0e..5f64831aaaf 100644 --- a/indexer/packages/v4-protos/src/codegen/gogoproto/bundle.ts +++ b/indexer/packages/v4-protos/src/codegen/gogoproto/bundle.ts @@ -1,3 +1,3 @@ -import * as _133 from "./gogo"; -export const gogoproto = { ..._133 +import * as _134 from "./gogo"; +export const gogoproto = { ..._134 }; \ No newline at end of file diff --git a/indexer/packages/v4-protos/src/codegen/google/bundle.ts b/indexer/packages/v4-protos/src/codegen/google/bundle.ts index 859b1b03068..3e68cdbb00f 100644 --- a/indexer/packages/v4-protos/src/codegen/google/bundle.ts +++ b/indexer/packages/v4-protos/src/codegen/google/bundle.ts @@ -1,16 +1,16 @@ -import * as _134 from "./api/annotations"; -import * as _135 from "./api/http"; -import * as _136 from "./protobuf/descriptor"; -import * as _137 from "./protobuf/duration"; -import * as _138 from "./protobuf/timestamp"; -import * as _139 from "./protobuf/any"; +import * as _135 from "./api/annotations"; +import * as _136 from "./api/http"; +import * as _137 from "./protobuf/descriptor"; +import * as _138 from "./protobuf/duration"; +import * as _139 from "./protobuf/timestamp"; +import * as _140 from "./protobuf/any"; export namespace google { - export const api = { ..._134, - ..._135 + export const api = { ..._135, + ..._136 }; - export const protobuf = { ..._136, - ..._137, + export const protobuf = { ..._137, ..._138, - ..._139 + ..._139, + ..._140 }; } \ No newline at end of file diff --git a/proto/dydxprotocol/clob/block_limits_config.proto b/proto/dydxprotocol/clob/block_limits_config.proto new file mode 100644 index 00000000000..c359b6b90a3 --- /dev/null +++ b/proto/dydxprotocol/clob/block_limits_config.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +package dydxprotocol.clob; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/clob/types"; + +// BlockLimitsConfig stores global per-block limits for the CLOB module. +message BlockLimitsConfig { + // The maximum number of expired stateful orders that can be removed from + // state in a single block. This prevents performance degradation when + // processing a large number of expired orders. + uint32 max_stateful_order_removals_per_block = 1; +} + diff --git a/proto/dydxprotocol/clob/query.proto b/proto/dydxprotocol/clob/query.proto index 93d1ae5fc2f..78b7d384aee 100644 --- a/proto/dydxprotocol/clob/query.proto +++ b/proto/dydxprotocol/clob/query.proto @@ -10,6 +10,7 @@ import "dydxprotocol/clob/equity_tier_limit_config.proto"; import "dydxprotocol/clob/order.proto"; import "dydxprotocol/clob/matches.proto"; import "dydxprotocol/clob/liquidations_config.proto"; +import "dydxprotocol/clob/block_limits_config.proto"; import "dydxprotocol/clob/mev.proto"; import "dydxprotocol/indexer/off_chain_updates/off_chain_updates.proto"; import "dydxprotocol/subaccounts/streaming.proto"; @@ -57,6 +58,12 @@ service Query { option (google.api.http).get = "/dydxprotocol/clob/liquidations_config"; } + // Queries BlockLimitsConfiguration. + rpc BlockLimitsConfiguration(QueryBlockLimitsConfigurationRequest) + returns (QueryBlockLimitsConfigurationResponse) { + option (google.api.http).get = "/dydxprotocol/clob/block_limits_config"; + } + // Queries the stateful order for a given order id. rpc StatefulOrder(QueryStatefulOrderRequest) returns (QueryStatefulOrderResponse) {} @@ -175,6 +182,16 @@ message QueryLiquidationsConfigurationResponse { LiquidationsConfig liquidations_config = 1 [ (gogoproto.nullable) = false ]; } +// QueryBlockLimitsConfigurationRequest is a request message for +// BlockLimitsConfiguration. +message QueryBlockLimitsConfigurationRequest {} + +// QueryBlockLimitsConfigurationResponse is a response message that contains +// the BlockLimitsConfiguration. +message QueryBlockLimitsConfigurationResponse { + BlockLimitsConfig block_limits_config = 1 [ (gogoproto.nullable) = false ]; +} + // QueryNextClobPairIdRequest is a request message for the next clob pair id message QueryNextClobPairIdRequest {} diff --git a/proto/dydxprotocol/clob/tx.proto b/proto/dydxprotocol/clob/tx.proto index 1f742f4dbdf..707e741d6f5 100644 --- a/proto/dydxprotocol/clob/tx.proto +++ b/proto/dydxprotocol/clob/tx.proto @@ -11,6 +11,7 @@ import "dydxprotocol/clob/matches.proto"; import "dydxprotocol/clob/order.proto"; import "dydxprotocol/clob/order_removals.proto"; import "dydxprotocol/clob/liquidations_config.proto"; +import "dydxprotocol/clob/block_limits_config.proto"; import "dydxprotocol/subaccounts/subaccount.proto"; // this line is used by starport scaffolding # proto/tx/import @@ -47,6 +48,9 @@ service Msg { // UpdateLiquidationsConfig updates the liquidations configuration in state. rpc UpdateLiquidationsConfig(MsgUpdateLiquidationsConfig) returns (MsgUpdateLiquidationsConfigResponse); + // UpdateBlockLimitsConfig updates the block limits configuration in state. + rpc UpdateBlockLimitsConfig(MsgUpdateBlockLimitsConfig) + returns (MsgUpdateBlockLimitsConfigResponse); // UpdateLeverage allows accounts to update their desired leverage for // clob pairs. rpc UpdateLeverage(MsgUpdateLeverage) returns (MsgUpdateLeverageResponse); @@ -215,6 +219,24 @@ message MsgUpdateLiquidationsConfig { // MsgUpdateLiquidationsConfig is the Msg/LiquidationsConfig response type. message MsgUpdateLiquidationsConfigResponse {} +// MsgUpdateBlockLimitsConfig is a request type for updating the block limits +// configuration. +message MsgUpdateBlockLimitsConfig { + option (cosmos.msg.v1.signer) = "authority"; + + // Authority is the address that may send this message. + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // Defines the block limits configuration to update to. All fields must be + // set. + BlockLimitsConfig block_limits_config = 2 + [ (gogoproto.nullable) = false ]; +} + +// MsgUpdateBlockLimitsConfigResponse is a response type for updating the +// block limits configuration. +message MsgUpdateBlockLimitsConfigResponse {} + // LeverageEntry represents a single clob pair leverage setting. message LeverageEntry { // The clob pair ID. diff --git a/protocol/mocks/ClobKeeper.go b/protocol/mocks/ClobKeeper.go index 9bb590daf75..391fb70e4b7 100644 --- a/protocol/mocks/ClobKeeper.go +++ b/protocol/mocks/ClobKeeper.go @@ -239,6 +239,24 @@ func (_m *ClobKeeper) GetBankruptcyPriceInQuoteQuantums(ctx types.Context, subac return r0, r1 } +// GetBlockLimitsConfig provides a mock function with given fields: ctx +func (_m *ClobKeeper) GetBlockLimitsConfig(ctx types.Context) clobtypes.BlockLimitsConfig { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for GetBlockLimitsConfig") + } + + var r0 clobtypes.BlockLimitsConfig + if rf, ok := ret.Get(0).(func(types.Context) clobtypes.BlockLimitsConfig); ok { + r0 = rf(ctx) + } else { + r0 = ret.Get(0).(clobtypes.BlockLimitsConfig) + } + + return r0 +} + // GetBlockRateLimitConfiguration provides a mock function with given fields: ctx func (_m *ClobKeeper) GetBlockRateLimitConfiguration(ctx types.Context) clobtypes.BlockRateLimitConfiguration { ret := _m.Called(ctx) @@ -335,36 +353,6 @@ func (_m *ClobKeeper) GetIndexerEventManager() indexer_manager.IndexerEventManag return r0 } -// GetLeverage provides a mock function with given fields: ctx, subaccountId -func (_m *ClobKeeper) GetLeverage(ctx types.Context, subaccountId *subaccountstypes.SubaccountId) (map[uint32]uint32, bool) { - ret := _m.Called(ctx, subaccountId) - - if len(ret) == 0 { - panic("no return value specified for GetLeverage") - } - - var r0 map[uint32]uint32 - var r1 bool - if rf, ok := ret.Get(0).(func(types.Context, *subaccountstypes.SubaccountId) (map[uint32]uint32, bool)); ok { - return rf(ctx, subaccountId) - } - if rf, ok := ret.Get(0).(func(types.Context, *subaccountstypes.SubaccountId) map[uint32]uint32); ok { - r0 = rf(ctx, subaccountId) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(map[uint32]uint32) - } - } - - if rf, ok := ret.Get(1).(func(types.Context, *subaccountstypes.SubaccountId) bool); ok { - r1 = rf(ctx, subaccountId) - } else { - r1 = ret.Get(1).(bool) - } - - return r0, r1 -} - // GetLiquidationInsuranceFundDelta provides a mock function with given fields: ctx, subaccountId, perpetualId, isBuy, fillAmount, subticks func (_m *ClobKeeper) GetLiquidationInsuranceFundDelta(ctx types.Context, subaccountId subaccountstypes.SubaccountId, perpetualId uint32, isBuy bool, fillAmount uint64, subticks clobtypes.Subticks) (*big.Int, error) { ret := _m.Called(ctx, subaccountId, perpetualId, isBuy, fillAmount, subticks) @@ -1195,6 +1183,24 @@ func (_m *ClobKeeper) UnsafeMigrateOrderExpirationState(ctx types.Context) { _m.Called(ctx) } +// UpdateBlockLimitsConfig provides a mock function with given fields: ctx, config +func (_m *ClobKeeper) UpdateBlockLimitsConfig(ctx types.Context, config clobtypes.BlockLimitsConfig) error { + ret := _m.Called(ctx, config) + + if len(ret) == 0 { + panic("no return value specified for UpdateBlockLimitsConfig") + } + + var r0 error + if rf, ok := ret.Get(0).(func(types.Context, clobtypes.BlockLimitsConfig) error); ok { + r0 = rf(ctx, config) + } else { + r0 = ret.Error(0) + } + + return r0 +} + // UpdateClobPair provides a mock function with given fields: ctx, clobPair func (_m *ClobKeeper) UpdateClobPair(ctx types.Context, clobPair clobtypes.ClobPair) error { ret := _m.Called(ctx, clobPair) diff --git a/protocol/mocks/QueryClient.go b/protocol/mocks/QueryClient.go index 453e06a6d77..80c04c0a644 100644 --- a/protocol/mocks/QueryClient.go +++ b/protocol/mocks/QueryClient.go @@ -252,6 +252,43 @@ func (_m *QueryClient) AllPerpetuals(ctx context.Context, in *perpetualstypes.Qu return r0, r1 } +// BlockLimitsConfiguration provides a mock function with given fields: ctx, in, opts +func (_m *QueryClient) BlockLimitsConfiguration(ctx context.Context, in *clobtypes.QueryBlockLimitsConfigurationRequest, opts ...grpc.CallOption) (*clobtypes.QueryBlockLimitsConfigurationResponse, 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 BlockLimitsConfiguration") + } + + var r0 *clobtypes.QueryBlockLimitsConfigurationResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *clobtypes.QueryBlockLimitsConfigurationRequest, ...grpc.CallOption) (*clobtypes.QueryBlockLimitsConfigurationResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *clobtypes.QueryBlockLimitsConfigurationRequest, ...grpc.CallOption) *clobtypes.QueryBlockLimitsConfigurationResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*clobtypes.QueryBlockLimitsConfigurationResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *clobtypes.QueryBlockLimitsConfigurationRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + // BlockRateLimitConfiguration provides a mock function with given fields: ctx, in, opts func (_m *QueryClient) BlockRateLimitConfiguration(ctx context.Context, in *clobtypes.QueryBlockRateLimitConfigurationRequest, opts ...grpc.CallOption) (*clobtypes.QueryBlockRateLimitConfigurationResponse, error) { _va := make([]interface{}, len(opts)) @@ -511,8 +548,8 @@ func (_m *QueryClient) GetWithdrawalAndTransfersBlockedInfo(ctx context.Context, return r0, r1 } -// LiquidateSubaccounts provides a mock function with given fields: ctx, in, opts -func (_m *QueryClient) LiquidateSubaccounts(ctx context.Context, in *liquidationapi.LiquidateSubaccountsRequest, opts ...grpc.CallOption) (*liquidationapi.LiquidateSubaccountsResponse, error) { +// Leverage provides a mock function with given fields: ctx, in, opts +func (_m *QueryClient) Leverage(ctx context.Context, in *clobtypes.QueryLeverageRequest, opts ...grpc.CallOption) (*clobtypes.QueryLeverageResponse, error) { _va := make([]interface{}, len(opts)) for _i := range opts { _va[_i] = opts[_i] @@ -523,23 +560,23 @@ func (_m *QueryClient) LiquidateSubaccounts(ctx context.Context, in *liquidation ret := _m.Called(_ca...) if len(ret) == 0 { - panic("no return value specified for LiquidateSubaccounts") + panic("no return value specified for Leverage") } - var r0 *liquidationapi.LiquidateSubaccountsResponse + var r0 *clobtypes.QueryLeverageResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *liquidationapi.LiquidateSubaccountsRequest, ...grpc.CallOption) (*liquidationapi.LiquidateSubaccountsResponse, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *clobtypes.QueryLeverageRequest, ...grpc.CallOption) (*clobtypes.QueryLeverageResponse, error)); ok { return rf(ctx, in, opts...) } - if rf, ok := ret.Get(0).(func(context.Context, *liquidationapi.LiquidateSubaccountsRequest, ...grpc.CallOption) *liquidationapi.LiquidateSubaccountsResponse); ok { + if rf, ok := ret.Get(0).(func(context.Context, *clobtypes.QueryLeverageRequest, ...grpc.CallOption) *clobtypes.QueryLeverageResponse); ok { r0 = rf(ctx, in, opts...) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*liquidationapi.LiquidateSubaccountsResponse) + r0 = ret.Get(0).(*clobtypes.QueryLeverageResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *liquidationapi.LiquidateSubaccountsRequest, ...grpc.CallOption) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *clobtypes.QueryLeverageRequest, ...grpc.CallOption) error); ok { r1 = rf(ctx, in, opts...) } else { r1 = ret.Error(1) @@ -548,8 +585,8 @@ func (_m *QueryClient) LiquidateSubaccounts(ctx context.Context, in *liquidation return r0, r1 } -// LiquidationsConfiguration provides a mock function with given fields: ctx, in, opts -func (_m *QueryClient) LiquidationsConfiguration(ctx context.Context, in *clobtypes.QueryLiquidationsConfigurationRequest, opts ...grpc.CallOption) (*clobtypes.QueryLiquidationsConfigurationResponse, error) { +// LiquidateSubaccounts provides a mock function with given fields: ctx, in, opts +func (_m *QueryClient) LiquidateSubaccounts(ctx context.Context, in *liquidationapi.LiquidateSubaccountsRequest, opts ...grpc.CallOption) (*liquidationapi.LiquidateSubaccountsResponse, error) { _va := make([]interface{}, len(opts)) for _i := range opts { _va[_i] = opts[_i] @@ -560,23 +597,23 @@ func (_m *QueryClient) LiquidationsConfiguration(ctx context.Context, in *clobty ret := _m.Called(_ca...) if len(ret) == 0 { - panic("no return value specified for LiquidationsConfiguration") + panic("no return value specified for LiquidateSubaccounts") } - var r0 *clobtypes.QueryLiquidationsConfigurationResponse + var r0 *liquidationapi.LiquidateSubaccountsResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *clobtypes.QueryLiquidationsConfigurationRequest, ...grpc.CallOption) (*clobtypes.QueryLiquidationsConfigurationResponse, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *liquidationapi.LiquidateSubaccountsRequest, ...grpc.CallOption) (*liquidationapi.LiquidateSubaccountsResponse, error)); ok { return rf(ctx, in, opts...) } - if rf, ok := ret.Get(0).(func(context.Context, *clobtypes.QueryLiquidationsConfigurationRequest, ...grpc.CallOption) *clobtypes.QueryLiquidationsConfigurationResponse); ok { + if rf, ok := ret.Get(0).(func(context.Context, *liquidationapi.LiquidateSubaccountsRequest, ...grpc.CallOption) *liquidationapi.LiquidateSubaccountsResponse); ok { r0 = rf(ctx, in, opts...) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*clobtypes.QueryLiquidationsConfigurationResponse) + r0 = ret.Get(0).(*liquidationapi.LiquidateSubaccountsResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *clobtypes.QueryLiquidationsConfigurationRequest, ...grpc.CallOption) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *liquidationapi.LiquidateSubaccountsRequest, ...grpc.CallOption) error); ok { r1 = rf(ctx, in, opts...) } else { r1 = ret.Error(1) @@ -585,8 +622,8 @@ func (_m *QueryClient) LiquidationsConfiguration(ctx context.Context, in *clobty return r0, r1 } -// Leverage provides a mock function with given fields: ctx, in, opts -func (_m *QueryClient) Leverage(ctx context.Context, in *clobtypes.QueryLeverageRequest, opts ...grpc.CallOption) (*clobtypes.QueryLeverageResponse, error) { +// LiquidationsConfiguration provides a mock function with given fields: ctx, in, opts +func (_m *QueryClient) LiquidationsConfiguration(ctx context.Context, in *clobtypes.QueryLiquidationsConfigurationRequest, opts ...grpc.CallOption) (*clobtypes.QueryLiquidationsConfigurationResponse, error) { _va := make([]interface{}, len(opts)) for _i := range opts { _va[_i] = opts[_i] @@ -597,23 +634,23 @@ func (_m *QueryClient) Leverage(ctx context.Context, in *clobtypes.QueryLeverage ret := _m.Called(_ca...) if len(ret) == 0 { - panic("no return value specified for Leverage") + panic("no return value specified for LiquidationsConfiguration") } - var r0 *clobtypes.QueryLeverageResponse + var r0 *clobtypes.QueryLiquidationsConfigurationResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *clobtypes.QueryLeverageRequest, ...grpc.CallOption) (*clobtypes.QueryLeverageResponse, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *clobtypes.QueryLiquidationsConfigurationRequest, ...grpc.CallOption) (*clobtypes.QueryLiquidationsConfigurationResponse, error)); ok { return rf(ctx, in, opts...) } - if rf, ok := ret.Get(0).(func(context.Context, *clobtypes.QueryLeverageRequest, ...grpc.CallOption) *clobtypes.QueryLeverageResponse); ok { + if rf, ok := ret.Get(0).(func(context.Context, *clobtypes.QueryLiquidationsConfigurationRequest, ...grpc.CallOption) *clobtypes.QueryLiquidationsConfigurationResponse); ok { r0 = rf(ctx, in, opts...) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*clobtypes.QueryLeverageResponse) + r0 = ret.Get(0).(*clobtypes.QueryLiquidationsConfigurationResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *clobtypes.QueryLeverageRequest, ...grpc.CallOption) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *clobtypes.QueryLiquidationsConfigurationRequest, ...grpc.CallOption) error); ok { r1 = rf(ctx, in, opts...) } else { r1 = ret.Error(1) diff --git a/protocol/x/clob/client/cli/query.go b/protocol/x/clob/client/cli/query.go index e10888a1219..4d84589e8d8 100644 --- a/protocol/x/clob/client/cli/query.go +++ b/protocol/x/clob/client/cli/query.go @@ -26,6 +26,7 @@ func GetQueryCmd(queryRoute string) *cobra.Command { cmd.AddCommand(CmdGetBlockRateLimitConfiguration()) cmd.AddCommand(CmdGetEquityTierLimitConfig()) cmd.AddCommand(CmdGetLiquidationsConfiguration()) + cmd.AddCommand(CmdGetBlockLimitsConfiguration()) cmd.AddCommand(CmdQueryStatefulOrder()) cmd.AddCommand(CmdQueryLeverage()) diff --git a/protocol/x/clob/client/cli/query_block_limits_configuration.go b/protocol/x/clob/client/cli/query_block_limits_configuration.go new file mode 100644 index 00000000000..c36317e43c6 --- /dev/null +++ b/protocol/x/clob/client/cli/query_block_limits_configuration.go @@ -0,0 +1,35 @@ +package cli + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/dydxprotocol/v4-chain/protocol/x/clob/types" + "github.com/spf13/cobra" +) + +func CmdGetBlockLimitsConfiguration() *cobra.Command { + cmd := &cobra.Command{ + Use: "get-block-limits-config", + Short: "get the block limits configuration", + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx := client.GetClientContextFromCmd(cmd) + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryBlockLimitsConfigurationRequest{} + + res, err := queryClient.BlockLimitsConfiguration(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/protocol/x/clob/flags/flags.go b/protocol/x/clob/flags/flags.go index a441ace3636..902d4eae634 100644 --- a/protocol/x/clob/flags/flags.go +++ b/protocol/x/clob/flags/flags.go @@ -14,7 +14,6 @@ type ClobFlags struct { MaxLiquidationAttemptsPerBlock uint32 MaxDeleveragingAttemptsPerBlock uint32 MaxDeleveragingSubaccountsToIterate uint32 - MaxStatefulOrderRemovalsPerBlock uint32 MevTelemetryEnabled bool MevTelemetryHosts []string @@ -27,7 +26,6 @@ const ( MaxLiquidationAttemptsPerBlock = "max-liquidation-attempts-per-block" MaxDeleveragingAttemptsPerBlock = "max-deleveraging-attempts-per-block" MaxDeleveragingSubaccountsToIterate = "max-deleveraging-subaccounts-to-iterate" - MaxStatefulOrderRemovalsPerBlock = "max-stateful-order-removals-per-block" // Mev. MevTelemetryEnabled = "mev-telemetry-enabled" @@ -41,7 +39,6 @@ const ( DefaultMaxLiquidationAttemptsPerBlock = 50 DefaultMaxDeleveragingAttemptsPerBlock = 10 DefaultMaxDeleveragingSubaccountsToIterate = 500 - DefaultMaxStatefulOrderRemovalsPerBlock = 100 DefaultMevTelemetryEnabled = false DefaultMevTelemetryHostsFlag = "" @@ -78,14 +75,6 @@ func AddClobFlagsToCmd(cmd *cobra.Command) { DefaultMaxDeleveragingSubaccountsToIterate, ), ) - cmd.Flags().Uint32( - MaxStatefulOrderRemovalsPerBlock, - DefaultMaxStatefulOrderRemovalsPerBlock, - fmt.Sprintf( - "Sets the maximum number of expired stateful orders to remove per block. Default = %d", - DefaultMaxStatefulOrderRemovalsPerBlock, - ), - ) cmd.Flags().Bool( MevTelemetryEnabled, DefaultMevTelemetryEnabled, @@ -108,7 +97,6 @@ func GetDefaultClobFlags() ClobFlags { MaxLiquidationAttemptsPerBlock: DefaultMaxLiquidationAttemptsPerBlock, MaxDeleveragingAttemptsPerBlock: DefaultMaxDeleveragingAttemptsPerBlock, MaxDeleveragingSubaccountsToIterate: DefaultMaxDeleveragingSubaccountsToIterate, - MaxStatefulOrderRemovalsPerBlock: DefaultMaxStatefulOrderRemovalsPerBlock, MevTelemetryEnabled: DefaultMevTelemetryEnabled, MevTelemetryHosts: DefaultMevTelemetryHosts, MevTelemetryIdentifier: DefaultMevTelemetryIdentifier, @@ -160,11 +148,5 @@ func GetClobFlagValuesFromOptions( } } - if option := appOpts.Get(MaxStatefulOrderRemovalsPerBlock); option != nil { - if v, err := cast.ToUint32E(option); err == nil { - result.MaxStatefulOrderRemovalsPerBlock = v - } - } - return result } diff --git a/protocol/x/clob/flags/flags_test.go b/protocol/x/clob/flags/flags_test.go index 6d4f90fff48..df53ed75e7b 100644 --- a/protocol/x/clob/flags/flags_test.go +++ b/protocol/x/clob/flags/flags_test.go @@ -30,9 +30,6 @@ func TestAddFlagsToCommand(t *testing.T) { fmt.Sprintf("Has %s flag", flags.MevTelemetryIdentifier): { flagName: flags.MevTelemetryIdentifier, }, - fmt.Sprintf("Has %s flag", flags.MaxStatefulOrderRemovalsPerBlock): { - flagName: flags.MaxStatefulOrderRemovalsPerBlock, - }, } for name, tc := range tests { @@ -51,7 +48,6 @@ func TestGetFlagValuesFromOptions(t *testing.T) { expectedMaxLiquidationAttemptsPerBlock uint32 expectedMaxDeleveragingAttemptsPerBlock uint32 expectedMaxDeleveragingSubaccountsToIterate uint32 - expectedMaxStatefulOrderRemovalsPerBlock uint32 expectedMevTelemetryHosts []string expectedMevTelemetryIdentifier string }{ @@ -59,7 +55,6 @@ func TestGetFlagValuesFromOptions(t *testing.T) { expectedMaxLiquidationAttemptsPerBlock: flags.DefaultMaxLiquidationAttemptsPerBlock, expectedMaxDeleveragingAttemptsPerBlock: flags.DefaultMaxDeleveragingAttemptsPerBlock, expectedMaxDeleveragingSubaccountsToIterate: flags.DefaultMaxDeleveragingSubaccountsToIterate, - expectedMaxStatefulOrderRemovalsPerBlock: flags.DefaultMaxStatefulOrderRemovalsPerBlock, expectedMevTelemetryHosts: flags.DefaultMevTelemetryHosts, expectedMevTelemetryIdentifier: flags.DefaultMevTelemetryIdentifier, }, @@ -68,14 +63,12 @@ func TestGetFlagValuesFromOptions(t *testing.T) { flags.MaxLiquidationAttemptsPerBlock: uint32(50), flags.MaxDeleveragingAttemptsPerBlock: uint32(25), flags.MaxDeleveragingSubaccountsToIterate: uint32(100), - flags.MaxStatefulOrderRemovalsPerBlock: uint32(75), flags.MevTelemetryHosts: "https://localhost:13137", flags.MevTelemetryIdentifier: "node-agent-01", }, expectedMaxLiquidationAttemptsPerBlock: uint32(50), expectedMaxDeleveragingAttemptsPerBlock: uint32(25), expectedMaxDeleveragingSubaccountsToIterate: uint32(100), - expectedMaxStatefulOrderRemovalsPerBlock: uint32(75), expectedMevTelemetryHosts: []string{"https://localhost:13137"}, expectedMevTelemetryIdentifier: "node-agent-01", }, @@ -84,14 +77,12 @@ func TestGetFlagValuesFromOptions(t *testing.T) { flags.MaxLiquidationAttemptsPerBlock: uint32(50), flags.MaxDeleveragingAttemptsPerBlock: uint32(25), flags.MaxDeleveragingSubaccountsToIterate: uint32(100), - flags.MaxStatefulOrderRemovalsPerBlock: uint32(75), flags.MevTelemetryHosts: "https://localhost:13137,https://example.dev:443", flags.MevTelemetryIdentifier: "node-agent-01", }, expectedMaxLiquidationAttemptsPerBlock: uint32(50), expectedMaxDeleveragingAttemptsPerBlock: uint32(25), expectedMaxDeleveragingSubaccountsToIterate: uint32(100), - expectedMaxStatefulOrderRemovalsPerBlock: uint32(75), expectedMevTelemetryHosts: []string{"https://localhost:13137", "https://example.dev:443"}, expectedMevTelemetryIdentifier: "node-agent-01", }, @@ -131,11 +122,6 @@ func TestGetFlagValuesFromOptions(t *testing.T) { tc.expectedMaxDeleveragingSubaccountsToIterate, flags.MaxDeleveragingSubaccountsToIterate, ) - require.Equal( - t, - tc.expectedMaxStatefulOrderRemovalsPerBlock, - flags.MaxStatefulOrderRemovalsPerBlock, - ) }) } } diff --git a/protocol/x/clob/keeper/block_limits_config.go b/protocol/x/clob/keeper/block_limits_config.go new file mode 100644 index 00000000000..fb812690f3c --- /dev/null +++ b/protocol/x/clob/keeper/block_limits_config.go @@ -0,0 +1,58 @@ +package keeper + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/dydxprotocol/v4-chain/protocol/x/clob/types" +) + +// GetBlockLimitsConfig gets the block limits config from state. +// If the config has not been set yet, returns the default config (no cap). +// This allows for backward compatibility with chains that existed before this parameter was added. +func (k Keeper) GetBlockLimitsConfig( + ctx sdk.Context, +) (config types.BlockLimitsConfig) { + store := ctx.KVStore(k.storeKey) + b := store.Get([]byte(types.BlockLimitsConfigKey)) + + // If not found in state, return default config (0 means no cap). + // This provides backward compatibility - governance can set it later if needed. + if b == nil { + return types.BlockLimitsConfig_Default + } + + k.cdc.MustUnmarshal(b, &config) + + return config +} + +// setBlockLimitsConfig sets the passed-in block limits config in state. +// It returns an error if the provided block limits config fails validation. +func (k Keeper) setBlockLimitsConfig( + ctx sdk.Context, + config types.BlockLimitsConfig, +) error { + // Validate the block limits config before writing it to state. + if err := config.Validate(); err != nil { + return err + } + + store := ctx.KVStore(k.storeKey) + b := k.cdc.MustMarshal(&config) + store.Set([]byte(types.BlockLimitsConfigKey), b) + + return nil +} + +// UpdateBlockLimitsConfig updates the block limits config in state. +// This is the only way to set the block limits config - via governance proposal. +func (k Keeper) UpdateBlockLimitsConfig( + ctx sdk.Context, + config types.BlockLimitsConfig, +) error { + // Write the block limits config to state. + if err := k.setBlockLimitsConfig(ctx, config); err != nil { + return err + } + + return nil +} diff --git a/protocol/x/clob/keeper/grpc_query_block_limits_configuration.go b/protocol/x/clob/keeper/grpc_query_block_limits_configuration.go new file mode 100644 index 00000000000..740f313b80d --- /dev/null +++ b/protocol/x/clob/keeper/grpc_query_block_limits_configuration.go @@ -0,0 +1,26 @@ +package keeper + +import ( + "context" + + "github.com/dydxprotocol/v4-chain/protocol/lib" + "github.com/dydxprotocol/v4-chain/protocol/x/clob/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +// BlockLimitsConfiguration returns the block limits configuration. +func (k Keeper) BlockLimitsConfiguration( + c context.Context, + req *types.QueryBlockLimitsConfigurationRequest, +) (*types.QueryBlockLimitsConfigurationResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := lib.UnwrapSDKContext(c, types.ModuleName) + blockLimitsConfig := k.GetBlockLimitsConfig(ctx) + return &types.QueryBlockLimitsConfigurationResponse{ + BlockLimitsConfig: blockLimitsConfig, + }, nil +} diff --git a/protocol/x/clob/keeper/grpc_query_block_limits_configuration_test.go b/protocol/x/clob/keeper/grpc_query_block_limits_configuration_test.go new file mode 100644 index 00000000000..1946f45661b --- /dev/null +++ b/protocol/x/clob/keeper/grpc_query_block_limits_configuration_test.go @@ -0,0 +1,44 @@ +package keeper_test + +import ( + "testing" + + testApp "github.com/dydxprotocol/v4-chain/protocol/testutil/app" + "github.com/dydxprotocol/v4-chain/protocol/x/clob/types" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func TestBlockLimitsConfiguration(t *testing.T) { + tests := map[string]struct { + req *types.QueryBlockLimitsConfigurationRequest + res *types.QueryBlockLimitsConfigurationResponse + err error + }{ + "success": { + req: &types.QueryBlockLimitsConfigurationRequest{}, + res: &types.QueryBlockLimitsConfigurationResponse{ + BlockLimitsConfig: types.BlockLimitsConfig_Default, + }, + }, + "failure: nil request": { + req: nil, + err: status.Error(codes.InvalidArgument, "invalid request"), + }, + } + for name, tc := range tests { + t.Run(name, func(t *testing.T) { + tApp := testApp.NewTestAppBuilder(t).Build() + ctx := tApp.InitChain() + res, err := tApp.App.ClobKeeper.BlockLimitsConfiguration(ctx, tc.req) + + if tc.err != nil { + require.ErrorIs(t, err, tc.err) + } else { + require.NoError(t, err) + require.Equal(t, tc.res, res) + } + }) + } +} diff --git a/protocol/x/clob/keeper/msg_server_update_block_limits_config.go b/protocol/x/clob/keeper/msg_server_update_block_limits_config.go new file mode 100644 index 00000000000..578824ef777 --- /dev/null +++ b/protocol/x/clob/keeper/msg_server_update_block_limits_config.go @@ -0,0 +1,32 @@ +package keeper + +import ( + "context" + + errorsmod "cosmossdk.io/errors" + + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/dydxprotocol/v4-chain/protocol/lib" + "github.com/dydxprotocol/v4-chain/protocol/x/clob/types" +) + +// UpdateBlockLimitsConfig updates the block limits config in state. +func (k msgServer) UpdateBlockLimitsConfig( + goCtx context.Context, + msg *types.MsgUpdateBlockLimitsConfig, +) (resp *types.MsgUpdateBlockLimitsConfigResponse, err error) { + ctx := lib.UnwrapSDKContext(goCtx, types.ModuleName) + + if !k.Keeper.HasAuthority(msg.Authority) { + return nil, errorsmod.Wrapf( + govtypes.ErrInvalidSigner, + "invalid authority %s", + msg.Authority, + ) + } + + if err := k.Keeper.UpdateBlockLimitsConfig(ctx, msg.BlockLimitsConfig); err != nil { + return nil, err + } + return &types.MsgUpdateBlockLimitsConfigResponse{}, nil +} diff --git a/protocol/x/clob/keeper/stateful_order_state.go b/protocol/x/clob/keeper/stateful_order_state.go index 3c79d75d6f8..5a31b5809ac 100644 --- a/protocol/x/clob/keeper/stateful_order_state.go +++ b/protocol/x/clob/keeper/stateful_order_state.go @@ -224,12 +224,20 @@ func (k Keeper) RemoveExpiredStatefulOrders(ctx sdk.Context, blockTime time.Time ) defer it.Close() - // Process at most MaxStatefulOrderRemovalsPerBlock orders per block to prevent - // EndBlocker from being slowed down by a surge of expired orders. - maxRemovals := k.Flags.MaxStatefulOrderRemovalsPerBlock + // Check if there's a cap on order removals per block. + // A value of 0 means no cap (process all expired orders). + // This is retrieved from on-chain governance-controlled config. + blockLimitsConfig := k.GetBlockLimitsConfig(ctx) + maxRemovals := blockLimitsConfig.MaxStatefulOrderRemovalsPerBlock + hasCap := maxRemovals > 0 numRemoved := uint32(0) - for ; it.Valid() && numRemoved < maxRemovals; it.Next() { + // Process orders up to the cap (if set), otherwise process all + for ; it.Valid(); it.Next() { + // If there's a cap and we've reached it, stop processing + if hasCap && numRemoved >= maxRemovals { + break + } var orderId types.OrderId k.cdc.MustUnmarshal(it.Value(), &orderId) expiredOrderIds = append(expiredOrderIds, orderId) diff --git a/protocol/x/clob/keeper/stateful_order_state_test.go b/protocol/x/clob/keeper/stateful_order_state_test.go index 067bd272437..f496386e52c 100644 --- a/protocol/x/clob/keeper/stateful_order_state_test.go +++ b/protocol/x/clob/keeper/stateful_order_state_test.go @@ -836,6 +836,9 @@ func TestRemoveExpiredStatefulOrders(t *testing.T) { memClob := memclob.NewMemClobPriceTimePriority(false) ks := keepertest.NewClobKeepersTestContext(t, memClob, &mocks.BankKeeper{}, &mocks.IndexerEventManager{}) + // Note: We don't set BlockLimitsConfig, so it uses the default (no cap). + // This simulates the behavior of existing chains before this parameter was added. + // Create all order IDs in state. for timestamp, orderIds := range tc.timeSlicesToOrderIds { for _, orderId := range orderIds { @@ -948,8 +951,15 @@ func TestRemoveExpiredStatefulOrders_WithCap(t *testing.T) { memClob := memclob.NewMemClobPriceTimePriority(false) ks := keepertest.NewClobKeepersTestContext(t, memClob, &mocks.BankKeeper{}, &mocks.IndexerEventManager{}) - // Set the max stateful order removals per block flag. - ks.ClobKeeper.Flags.MaxStatefulOrderRemovalsPerBlock = tc.maxStatefulOrderRemovalsPerBlock + // Set the max stateful order removals per block config on-chain via UpdateBlockLimitsConfig + // (simulating what governance would do). + err := ks.ClobKeeper.UpdateBlockLimitsConfig( + ks.Ctx, + types.BlockLimitsConfig{ + MaxStatefulOrderRemovalsPerBlock: tc.maxStatefulOrderRemovalsPerBlock, + }, + ) + require.NoError(t, err) // Create all order IDs in state. for timestamp, orderIds := range tc.timeSlicesToOrderIds { diff --git a/protocol/x/clob/types/block_limits_config.go b/protocol/x/clob/types/block_limits_config.go new file mode 100644 index 00000000000..73ede106b0e --- /dev/null +++ b/protocol/x/clob/types/block_limits_config.go @@ -0,0 +1,8 @@ +package types + +// Validate checks that the BlockLimitsConfig is valid. +// Note: MaxStatefulOrderRemovalsPerBlock can be 0, which means no cap (process all expired orders). +func (config *BlockLimitsConfig) Validate() error { + // No validation needed - 0 is a valid value meaning "no cap" + return nil +} diff --git a/protocol/x/clob/types/block_limits_config.pb.go b/protocol/x/clob/types/block_limits_config.pb.go new file mode 100644 index 00000000000..a46b9a302a2 --- /dev/null +++ b/protocol/x/clob/types/block_limits_config.pb.go @@ -0,0 +1,310 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: dydxprotocol/clob/block_limits_config.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// BlockLimitsConfig stores global per-block limits for the CLOB module. +type BlockLimitsConfig struct { + // The maximum number of expired stateful orders that can be removed from + // state in a single block. This prevents performance degradation when + // processing a large number of expired orders. + MaxStatefulOrderRemovalsPerBlock uint32 `protobuf:"varint,1,opt,name=max_stateful_order_removals_per_block,json=maxStatefulOrderRemovalsPerBlock,proto3" json:"max_stateful_order_removals_per_block,omitempty"` +} + +func (m *BlockLimitsConfig) Reset() { *m = BlockLimitsConfig{} } +func (m *BlockLimitsConfig) String() string { return proto.CompactTextString(m) } +func (*BlockLimitsConfig) ProtoMessage() {} +func (*BlockLimitsConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_882b42be478a422d, []int{0} +} +func (m *BlockLimitsConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BlockLimitsConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BlockLimitsConfig.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 *BlockLimitsConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlockLimitsConfig.Merge(m, src) +} +func (m *BlockLimitsConfig) XXX_Size() int { + return m.Size() +} +func (m *BlockLimitsConfig) XXX_DiscardUnknown() { + xxx_messageInfo_BlockLimitsConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_BlockLimitsConfig proto.InternalMessageInfo + +func (m *BlockLimitsConfig) GetMaxStatefulOrderRemovalsPerBlock() uint32 { + if m != nil { + return m.MaxStatefulOrderRemovalsPerBlock + } + return 0 +} + +func init() { + proto.RegisterType((*BlockLimitsConfig)(nil), "dydxprotocol.clob.BlockLimitsConfig") +} + +func init() { + proto.RegisterFile("dydxprotocol/clob/block_limits_config.proto", fileDescriptor_882b42be478a422d) +} + +var fileDescriptor_882b42be478a422d = []byte{ + // 229 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x4e, 0xa9, 0x4c, 0xa9, + 0x28, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0xce, 0xcf, 0xd1, 0x4f, 0xce, 0xc9, 0x4f, 0xd2, 0x4f, 0xca, + 0xc9, 0x4f, 0xce, 0x8e, 0xcf, 0xc9, 0xcc, 0xcd, 0x2c, 0x29, 0x8e, 0x4f, 0xce, 0xcf, 0x4b, 0xcb, + 0x4c, 0xd7, 0x03, 0xab, 0x10, 0x12, 0x44, 0x56, 0xac, 0x07, 0x52, 0x2c, 0x25, 0x92, 0x9e, 0x9f, + 0x9e, 0x0f, 0x16, 0xd2, 0x07, 0xb1, 0x20, 0x0a, 0x95, 0x52, 0xb8, 0x04, 0x9d, 0x40, 0xa6, 0xf8, + 0x80, 0x0d, 0x71, 0x06, 0x9b, 0x21, 0xe4, 0xcf, 0xa5, 0x9a, 0x9b, 0x58, 0x11, 0x5f, 0x5c, 0x92, + 0x58, 0x92, 0x9a, 0x56, 0x9a, 0x13, 0x9f, 0x5f, 0x94, 0x92, 0x5a, 0x14, 0x5f, 0x94, 0x9a, 0x9b, + 0x5f, 0x96, 0x98, 0x53, 0x1c, 0x5f, 0x90, 0x5a, 0x14, 0x0f, 0xb6, 0x5a, 0x82, 0x51, 0x81, 0x51, + 0x83, 0x37, 0x48, 0x21, 0x37, 0xb1, 0x22, 0x18, 0xaa, 0xd6, 0x1f, 0xa4, 0x34, 0x08, 0xaa, 0x32, + 0x20, 0xb5, 0x08, 0x6c, 0xb8, 0x53, 0xc0, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, + 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, + 0x44, 0x99, 0xa5, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xa3, 0x78, 0xb0, + 0xcc, 0x44, 0x37, 0x39, 0x23, 0x31, 0x33, 0x4f, 0x1f, 0x2e, 0x52, 0x01, 0xf1, 0x74, 0x49, 0x65, + 0x41, 0x6a, 0x71, 0x12, 0x1b, 0x58, 0xd8, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0xc8, 0x4b, 0x59, + 0xc3, 0x16, 0x01, 0x00, 0x00, +} + +func (m *BlockLimitsConfig) 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 *BlockLimitsConfig) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BlockLimitsConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.MaxStatefulOrderRemovalsPerBlock != 0 { + i = encodeVarintBlockLimitsConfig(dAtA, i, uint64(m.MaxStatefulOrderRemovalsPerBlock)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintBlockLimitsConfig(dAtA []byte, offset int, v uint64) int { + offset -= sovBlockLimitsConfig(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *BlockLimitsConfig) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.MaxStatefulOrderRemovalsPerBlock != 0 { + n += 1 + sovBlockLimitsConfig(uint64(m.MaxStatefulOrderRemovalsPerBlock)) + } + return n +} + +func sovBlockLimitsConfig(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozBlockLimitsConfig(x uint64) (n int) { + return sovBlockLimitsConfig(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *BlockLimitsConfig) 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 ErrIntOverflowBlockLimitsConfig + } + 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: BlockLimitsConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BlockLimitsConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxStatefulOrderRemovalsPerBlock", wireType) + } + m.MaxStatefulOrderRemovalsPerBlock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBlockLimitsConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxStatefulOrderRemovalsPerBlock |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipBlockLimitsConfig(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthBlockLimitsConfig + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipBlockLimitsConfig(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowBlockLimitsConfig + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowBlockLimitsConfig + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowBlockLimitsConfig + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthBlockLimitsConfig + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupBlockLimitsConfig + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthBlockLimitsConfig + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthBlockLimitsConfig = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowBlockLimitsConfig = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupBlockLimitsConfig = fmt.Errorf("proto: unexpected end of group") +) diff --git a/protocol/x/clob/types/block_limits_config_keeper.go b/protocol/x/clob/types/block_limits_config_keeper.go new file mode 100644 index 00000000000..1d810807bbc --- /dev/null +++ b/protocol/x/clob/types/block_limits_config_keeper.go @@ -0,0 +1,27 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var ( + // BlockLimitsConfig_Default uses 0 for MaxStatefulOrderRemovalsPerBlock, + // which means "no cap" - process all expired orders. + // This provides backward compatibility with existing chains. + // Governance can set a specific cap later if needed. + BlockLimitsConfig_Default = BlockLimitsConfig{ + MaxStatefulOrderRemovalsPerBlock: 0, + } +) + +// BlockLimitsConfigKeeper is an interface that encapsulates all reads and writes to the +// block limits configuration values written to state. +type BlockLimitsConfigKeeper interface { + GetBlockLimitsConfig( + ctx sdk.Context, + ) BlockLimitsConfig + UpdateBlockLimitsConfig( + ctx sdk.Context, + config BlockLimitsConfig, + ) error +} diff --git a/protocol/x/clob/types/clob_keeper.go b/protocol/x/clob/types/clob_keeper.go index 8d307660f8e..a0c538bf344 100644 --- a/protocol/x/clob/types/clob_keeper.go +++ b/protocol/x/clob/types/clob_keeper.go @@ -13,6 +13,7 @@ import ( type ClobKeeper interface { LiquidationsKeeper LiquidationsConfigKeeper + BlockLimitsConfigKeeper IsInMemStructuresInitialized() bool Initialize(ctx sdk.Context) diff --git a/protocol/x/clob/types/errors.go b/protocol/x/clob/types/errors.go index 039f6775714..0df907e1aa0 100644 --- a/protocol/x/clob/types/errors.go +++ b/protocol/x/clob/types/errors.go @@ -348,6 +348,11 @@ var ( 1022, "Liquidation conflicts with ClobPair status", ) + ErrInvalidBlockLimitsConfig = errorsmod.Register( + ModuleName, + 1023, + "Proposed BlockLimitsConfig is invalid", + ) // Advanced order type errors. ErrFokOrderCouldNotBeFullyFilled = errorsmod.Register( diff --git a/protocol/x/clob/types/keys.go b/protocol/x/clob/types/keys.go index cc1656af7c4..d3aed7c5204 100644 --- a/protocol/x/clob/types/keys.go +++ b/protocol/x/clob/types/keys.go @@ -42,6 +42,9 @@ const ( // BlockRateLimitConfigKey is the key to retrieve the block rate limit configuration. BlockRateLimitConfigKey = "RateLimCfg" + // BlockLimitsConfigKey is the key to retrieve the block limits configuration. + BlockLimitsConfigKey = "BlockLimCfg" + // ClobPairKeyPrefix is the prefix to retrieve all ClobPair ClobPairKeyPrefix = "Clob:" diff --git a/protocol/x/clob/types/message_update_block_limits_config.go b/protocol/x/clob/types/message_update_block_limits_config.go new file mode 100644 index 00000000000..d64ec389f83 --- /dev/null +++ b/protocol/x/clob/types/message_update_block_limits_config.go @@ -0,0 +1,26 @@ +package types + +import ( + errorsmod "cosmossdk.io/errors" + "fmt" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var _ sdk.Msg = &MsgUpdateBlockLimitsConfig{} + +// ValidateBasic validates the message's BlockLimitsConfig. Returns an error if the authority +// is empty or if the BlockLimitsConfig is invalid. +func (msg *MsgUpdateBlockLimitsConfig) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.Authority); err != nil { + return errorsmod.Wrap( + ErrInvalidAuthority, + fmt.Sprintf( + "authority '%s' must be a valid bech32 address, but got error '%v'", + msg.Authority, + err.Error(), + ), + ) + } + + return msg.BlockLimitsConfig.Validate() +} diff --git a/protocol/x/clob/types/query.pb.go b/protocol/x/clob/types/query.pb.go index ec414e75611..dc23548a439 100644 --- a/protocol/x/clob/types/query.pb.go +++ b/protocol/x/clob/types/query.pb.go @@ -767,6 +767,90 @@ func (m *QueryLiquidationsConfigurationResponse) GetLiquidationsConfig() Liquida return LiquidationsConfig{} } +// QueryBlockLimitsConfigurationRequest is a request message for +// BlockLimitsConfiguration. +type QueryBlockLimitsConfigurationRequest struct { +} + +func (m *QueryBlockLimitsConfigurationRequest) Reset() { *m = QueryBlockLimitsConfigurationRequest{} } +func (m *QueryBlockLimitsConfigurationRequest) String() string { return proto.CompactTextString(m) } +func (*QueryBlockLimitsConfigurationRequest) ProtoMessage() {} +func (*QueryBlockLimitsConfigurationRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_3365c195b25c5bc0, []int{14} +} +func (m *QueryBlockLimitsConfigurationRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryBlockLimitsConfigurationRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBlockLimitsConfigurationRequest.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 *QueryBlockLimitsConfigurationRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBlockLimitsConfigurationRequest.Merge(m, src) +} +func (m *QueryBlockLimitsConfigurationRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryBlockLimitsConfigurationRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBlockLimitsConfigurationRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBlockLimitsConfigurationRequest proto.InternalMessageInfo + +// QueryBlockLimitsConfigurationResponse is a response message that contains +// the BlockLimitsConfiguration. +type QueryBlockLimitsConfigurationResponse struct { + BlockLimitsConfig BlockLimitsConfig `protobuf:"bytes,1,opt,name=block_limits_config,json=blockLimitsConfig,proto3" json:"block_limits_config"` +} + +func (m *QueryBlockLimitsConfigurationResponse) Reset() { *m = QueryBlockLimitsConfigurationResponse{} } +func (m *QueryBlockLimitsConfigurationResponse) String() string { return proto.CompactTextString(m) } +func (*QueryBlockLimitsConfigurationResponse) ProtoMessage() {} +func (*QueryBlockLimitsConfigurationResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_3365c195b25c5bc0, []int{15} +} +func (m *QueryBlockLimitsConfigurationResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryBlockLimitsConfigurationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBlockLimitsConfigurationResponse.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 *QueryBlockLimitsConfigurationResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBlockLimitsConfigurationResponse.Merge(m, src) +} +func (m *QueryBlockLimitsConfigurationResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryBlockLimitsConfigurationResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBlockLimitsConfigurationResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBlockLimitsConfigurationResponse proto.InternalMessageInfo + +func (m *QueryBlockLimitsConfigurationResponse) GetBlockLimitsConfig() BlockLimitsConfig { + if m != nil { + return m.BlockLimitsConfig + } + return BlockLimitsConfig{} +} + // QueryNextClobPairIdRequest is a request message for the next clob pair id type QueryNextClobPairIdRequest struct { } @@ -775,7 +859,7 @@ func (m *QueryNextClobPairIdRequest) Reset() { *m = QueryNextClobPairIdR func (m *QueryNextClobPairIdRequest) String() string { return proto.CompactTextString(m) } func (*QueryNextClobPairIdRequest) ProtoMessage() {} func (*QueryNextClobPairIdRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3365c195b25c5bc0, []int{14} + return fileDescriptor_3365c195b25c5bc0, []int{16} } func (m *QueryNextClobPairIdRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -813,7 +897,7 @@ func (m *QueryNextClobPairIdResponse) Reset() { *m = QueryNextClobPairId func (m *QueryNextClobPairIdResponse) String() string { return proto.CompactTextString(m) } func (*QueryNextClobPairIdResponse) ProtoMessage() {} func (*QueryNextClobPairIdResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3365c195b25c5bc0, []int{15} + return fileDescriptor_3365c195b25c5bc0, []int{17} } func (m *QueryNextClobPairIdResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -861,7 +945,7 @@ func (m *QueryLeverageRequest) Reset() { *m = QueryLeverageRequest{} } func (m *QueryLeverageRequest) String() string { return proto.CompactTextString(m) } func (*QueryLeverageRequest) ProtoMessage() {} func (*QueryLeverageRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3365c195b25c5bc0, []int{16} + return fileDescriptor_3365c195b25c5bc0, []int{18} } func (m *QueryLeverageRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -914,7 +998,7 @@ func (m *QueryLeverageResponse) Reset() { *m = QueryLeverageResponse{} } func (m *QueryLeverageResponse) String() string { return proto.CompactTextString(m) } func (*QueryLeverageResponse) ProtoMessage() {} func (*QueryLeverageResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3365c195b25c5bc0, []int{17} + return fileDescriptor_3365c195b25c5bc0, []int{19} } func (m *QueryLeverageResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -962,7 +1046,7 @@ func (m *ClobPairLeverageInfo) Reset() { *m = ClobPairLeverageInfo{} } func (m *ClobPairLeverageInfo) String() string { return proto.CompactTextString(m) } func (*ClobPairLeverageInfo) ProtoMessage() {} func (*ClobPairLeverageInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_3365c195b25c5bc0, []int{18} + return fileDescriptor_3365c195b25c5bc0, []int{20} } func (m *ClobPairLeverageInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1024,7 +1108,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{19} + return fileDescriptor_3365c195b25c5bc0, []int{21} } func (m *StreamOrderbookUpdatesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1092,7 +1176,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{20} + return fileDescriptor_3365c195b25c5bc0, []int{22} } func (m *StreamOrderbookUpdatesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1152,7 +1236,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{21} + return fileDescriptor_3365c195b25c5bc0, []int{23} } func (m *StreamUpdate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1293,7 +1377,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{22} + return fileDescriptor_3365c195b25c5bc0, []int{24} } func (m *StreamOrderbookUpdate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1353,7 +1437,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{23} + return fileDescriptor_3365c195b25c5bc0, []int{25} } func (m *StreamOrderbookFill) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1424,7 +1508,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{24} + return fileDescriptor_3365c195b25c5bc0, []int{26} } func (m *StreamTakerOrder) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1527,7 +1611,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{25} + return fileDescriptor_3365c195b25c5bc0, []int{27} } func (m *StreamTakerOrderStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1593,6 +1677,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((*QueryBlockLimitsConfigurationRequest)(nil), "dydxprotocol.clob.QueryBlockLimitsConfigurationRequest") + proto.RegisterType((*QueryBlockLimitsConfigurationResponse)(nil), "dydxprotocol.clob.QueryBlockLimitsConfigurationResponse") proto.RegisterType((*QueryNextClobPairIdRequest)(nil), "dydxprotocol.clob.QueryNextClobPairIdRequest") proto.RegisterType((*QueryNextClobPairIdResponse)(nil), "dydxprotocol.clob.QueryNextClobPairIdResponse") proto.RegisterType((*QueryLeverageRequest)(nil), "dydxprotocol.clob.QueryLeverageRequest") @@ -1610,128 +1696,133 @@ func init() { func init() { proto.RegisterFile("dydxprotocol/clob/query.proto", fileDescriptor_3365c195b25c5bc0) } var fileDescriptor_3365c195b25c5bc0 = []byte{ - // 1933 bytes of a gzipped FileDescriptorProto + // 2001 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x58, 0x4d, 0x6c, 0xdc, 0xc6, - 0x15, 0x5e, 0x4a, 0xb2, 0x2d, 0xbd, 0x95, 0x14, 0x69, 0x2c, 0x3b, 0xca, 0x4a, 0x5e, 0xc9, 0xb4, - 0xad, 0x1f, 0xc7, 0x5e, 0xca, 0x8a, 0x11, 0xa4, 0x76, 0x91, 0xc2, 0x72, 0x6a, 0x4b, 0xa8, 0x95, - 0x6c, 0x68, 0xc7, 0x31, 0xda, 0xa0, 0x04, 0x97, 0x9c, 0x5d, 0x0d, 0x44, 0x72, 0x28, 0x72, 0xb8, - 0x95, 0x60, 0x18, 0x05, 0x7a, 0xc8, 0xa5, 0x2d, 0x50, 0x20, 0x87, 0x1e, 0x8a, 0x9e, 0x7a, 0x2e, - 0xd0, 0x4b, 0x8f, 0x45, 0xdb, 0x5b, 0x8e, 0x01, 0xda, 0x43, 0x0f, 0x45, 0x51, 0xd8, 0x3d, 0xf7, - 0x52, 0xa0, 0xe7, 0x80, 0x33, 0xc3, 0x5d, 0x72, 0x49, 0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0e, 0x34, 0xda, 0x6e, 0x1b, 0xd6, 0x81, 0x49, 0x3c, 0x23, 0xf2, 0x6d, 0x93, 0xe1, 0x30, 0x4f, - 0x91, 0xf2, 0x1b, 0x19, 0xf9, 0x30, 0x6a, 0x99, 0x96, 0x45, 0x23, 0x8f, 0x85, 0x5a, 0xc8, 0x02, - 0x6c, 0xba, 0xc4, 0x4b, 0x60, 0x6c, 0x96, 0x73, 0xf6, 0x7e, 0x4b, 0xd6, 0x2b, 0x19, 0x56, 0x3f, - 0x20, 0x16, 0xce, 0xe9, 0x53, 0x37, 0xe1, 0xed, 0x4f, 0xe3, 0x58, 0x3f, 0xc4, 0xec, 0xbe, 0x43, - 0x5b, 0x4d, 0x93, 0x04, 0x3a, 0x3e, 0x8a, 0x70, 0xc8, 0xd0, 0x2c, 0x8c, 0x11, 0x7b, 0x51, 0x59, - 0x55, 0x36, 0x66, 0xf4, 0x31, 0x62, 0xab, 0x9f, 0xc3, 0x05, 0xce, 0xda, 0xe7, 0x0b, 0x7d, 0xea, - 0x85, 0x18, 0x7d, 0x08, 0x53, 0xbd, 0x60, 0x72, 0xfe, 0xea, 0xf6, 0x52, 0x23, 0x97, 0x94, 0x8d, - 0x44, 0x6e, 0x67, 0xe2, 0xeb, 0x7f, 0xad, 0x54, 0xf4, 0x49, 0x4b, 0xae, 0x55, 0x53, 0x62, 0xb8, - 0xe7, 0x38, 0x83, 0x18, 0x1e, 0x00, 0xf4, 0x93, 0x4f, 0xea, 0x5e, 0x6b, 0x88, 0x4c, 0x6d, 0xc4, - 0x99, 0xda, 0x10, 0x37, 0x41, 0x66, 0x6a, 0xa3, 0x69, 0x76, 0xb0, 0x94, 0xd5, 0x53, 0x92, 0xea, - 0xef, 0x14, 0x58, 0xcc, 0x80, 0xbf, 0xe7, 0x38, 0x65, 0xf8, 0xc7, 0x5f, 0x13, 0x3f, 0x7a, 0x98, - 0x01, 0x39, 0xc6, 0x41, 0xae, 0x9f, 0x0a, 0x52, 0x18, 0xcf, 0xa0, 0xfc, 0xa7, 0x02, 0x2b, 0xfb, - 0xb8, 0xfb, 0x31, 0xb5, 0xf1, 0x13, 0x1a, 0xff, 0xbd, 0x6f, 0x3a, 0x56, 0xe4, 0xf0, 0xcd, 0xe4, - 0x44, 0xbe, 0x80, 0x8b, 0xe2, 0xaa, 0xf9, 0x01, 0xf5, 0x69, 0x88, 0x03, 0x43, 0x26, 0x75, 0xef, - 0x74, 0xf2, 0xc8, 0x9f, 0x9a, 0x4e, 0x9c, 0xd4, 0x34, 0xd8, 0xc7, 0xdd, 0x7d, 0xc1, 0xad, 0x2f, - 0x70, 0x2d, 0x4d, 0xa9, 0x44, 0x52, 0xd1, 0x8f, 0xe0, 0x42, 0x37, 0x61, 0x36, 0x5c, 0xdc, 0x35, - 0x5c, 0xcc, 0x02, 0x62, 0x85, 0x3d, 0xaf, 0xf2, 0xca, 0x33, 0x80, 0xf7, 0x05, 0xbb, 0x7e, 0xbe, - 0x9b, 0x36, 0x29, 0x88, 0xea, 0x7f, 0x15, 0x58, 0x2d, 0x77, 0x4f, 0x06, 0xa3, 0x03, 0xe7, 0x02, - 0x1c, 0x46, 0x0e, 0x0b, 0x65, 0x28, 0x1e, 0x9e, 0x66, 0xb3, 0x40, 0x4b, 0xcc, 0x70, 0xcf, 0xb3, - 0x9f, 0x52, 0x27, 0x72, 0x71, 0x13, 0x07, 0x71, 0xe8, 0x64, 0xd8, 0x12, 0xed, 0x35, 0x13, 0xce, - 0x17, 0x70, 0xa1, 0x55, 0x98, 0xee, 0x25, 0x83, 0xd1, 0xcb, 0x7f, 0x48, 0x82, 0xbd, 0x67, 0xa3, - 0x39, 0x18, 0x77, 0x71, 0x97, 0x9f, 0xc8, 0x98, 0x1e, 0xff, 0x44, 0x17, 0xe1, 0x6c, 0x97, 0x2b, - 0x59, 0x1c, 0x5f, 0x55, 0x36, 0x26, 0x74, 0xb9, 0x52, 0xaf, 0xc3, 0x06, 0x4f, 0xba, 0xef, 0xf3, - 0x77, 0xec, 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0x20, 0x37, 0xa2, 0x1b, 0x22, 0xbf, 0x55, 0x60, + 0x3a, 0x3b, 0x09, 0x91, 0x42, 0x1d, 0xb9, 0xf3, 0x54, 0xb9, 0x3a, 0x28, 0x3b, 0xda, 0xbc, 0x2e, + 0x4e, 0x64, 0x95, 0xac, 0xe4, 0x9c, 0x48, 0xcf, 0xe4, 0x45, 0xbe, 0x56, 0x60, 0x2c, 0x19, 0x53, + 0xc8, 0x5a, 0x61, 0x1e, 0x65, 0x27, 0xb0, 0xe2, 0x27, 0xbf, 0x7b, 0xc8, 0x52, 0x6f, 0x09, 0x34, + 0x55, 0x72, 0x3d, 0x2f, 0xbf, 0x90, 0x59, 0x7b, 0x2e, 0x26, 0xb8, 0x17, 0xda, 0x73, 0x39, 0xb2, + 0xbd, 0x20, 0x3f, 0x4e, 0xea, 0x68, 0x77, 0xb7, 0x4f, 0x36, 0x07, 0xed, 0x9c, 0x93, 0x69, 0xa8, + 0x7c, 0xf3, 0x0d, 0x24, 0x24, 0xe8, 0x4d, 0x65, 0x7b, 0xff, 0x9b, 0x57, 0x15, 0xe5, 0xe5, 0xab, + 0x8a, 0xf2, 0xaf, 0x57, 0x15, 0xe5, 0x97, 0xaf, 0x2b, 0x43, 0x2f, 0x5f, 0x57, 0x86, 0xfe, 0xfe, + 0xba, 0x32, 0xf4, 0xc5, 0x07, 0x0d, 0x87, 0x1f, 0x44, 0xb5, 0xaa, 0xc5, 0xbc, 0xac, 0x4b, 0xad, + 0x5b, 0x37, 0x44, 0x9b, 0xa7, 0xb5, 0x29, 0xc7, 0xd2, 0x4d, 0x7e, 0xd2, 0xa4, 0x61, 0xed, 0xac, + 0x20, 0xbf, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x89, 0xf4, 0xd8, 0x38, 0x24, 0x19, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1758,6 +1849,8 @@ type QueryClient interface { BlockRateLimitConfiguration(ctx context.Context, in *QueryBlockRateLimitConfigurationRequest, opts ...grpc.CallOption) (*QueryBlockRateLimitConfigurationResponse, error) // Queries LiquidationsConfiguration. LiquidationsConfiguration(ctx context.Context, in *QueryLiquidationsConfigurationRequest, opts ...grpc.CallOption) (*QueryLiquidationsConfigurationResponse, error) + // Queries BlockLimitsConfiguration. + BlockLimitsConfiguration(ctx context.Context, in *QueryBlockLimitsConfigurationRequest, opts ...grpc.CallOption) (*QueryBlockLimitsConfigurationResponse, 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. @@ -1831,6 +1924,15 @@ func (c *queryClient) LiquidationsConfiguration(ctx context.Context, in *QueryLi return out, nil } +func (c *queryClient) BlockLimitsConfiguration(ctx context.Context, in *QueryBlockLimitsConfigurationRequest, opts ...grpc.CallOption) (*QueryBlockLimitsConfigurationResponse, error) { + out := new(QueryBlockLimitsConfigurationResponse) + err := c.cc.Invoke(ctx, "/dydxprotocol.clob.Query/BlockLimitsConfiguration", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) StatefulOrder(ctx context.Context, in *QueryStatefulOrderRequest, opts ...grpc.CallOption) (*QueryStatefulOrderResponse, error) { out := new(QueryStatefulOrderResponse) err := c.cc.Invoke(ctx, "/dydxprotocol.clob.Query/StatefulOrder", in, out, opts...) @@ -1904,6 +2006,8 @@ type QueryServer interface { BlockRateLimitConfiguration(context.Context, *QueryBlockRateLimitConfigurationRequest) (*QueryBlockRateLimitConfigurationResponse, error) // Queries LiquidationsConfiguration. LiquidationsConfiguration(context.Context, *QueryLiquidationsConfigurationRequest) (*QueryLiquidationsConfigurationResponse, error) + // Queries BlockLimitsConfiguration. + BlockLimitsConfiguration(context.Context, *QueryBlockLimitsConfigurationRequest) (*QueryBlockLimitsConfigurationResponse, error) // Queries the stateful order for a given order id. StatefulOrder(context.Context, *QueryStatefulOrderRequest) (*QueryStatefulOrderResponse, error) // Queries the next clob pair id. @@ -1937,6 +2041,9 @@ func (*UnimplementedQueryServer) BlockRateLimitConfiguration(ctx context.Context func (*UnimplementedQueryServer) LiquidationsConfiguration(ctx context.Context, req *QueryLiquidationsConfigurationRequest) (*QueryLiquidationsConfigurationResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method LiquidationsConfiguration not implemented") } +func (*UnimplementedQueryServer) BlockLimitsConfiguration(ctx context.Context, req *QueryBlockLimitsConfigurationRequest) (*QueryBlockLimitsConfigurationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BlockLimitsConfiguration not implemented") +} func (*UnimplementedQueryServer) StatefulOrder(ctx context.Context, req *QueryStatefulOrderRequest) (*QueryStatefulOrderResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method StatefulOrder not implemented") } @@ -2062,6 +2169,24 @@ func _Query_LiquidationsConfiguration_Handler(srv interface{}, ctx context.Conte return interceptor(ctx, in, info, handler) } +func _Query_BlockLimitsConfiguration_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryBlockLimitsConfigurationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).BlockLimitsConfiguration(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/dydxprotocol.clob.Query/BlockLimitsConfiguration", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).BlockLimitsConfiguration(ctx, req.(*QueryBlockLimitsConfigurationRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_StatefulOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryStatefulOrderRequest) if err := dec(in); err != nil { @@ -2165,6 +2290,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "LiquidationsConfiguration", Handler: _Query_LiquidationsConfiguration_Handler, }, + { + MethodName: "BlockLimitsConfiguration", + Handler: _Query_BlockLimitsConfiguration_Handler, + }, { MethodName: "StatefulOrder", Handler: _Query_StatefulOrder_Handler, @@ -2705,6 +2834,62 @@ func (m *QueryLiquidationsConfigurationResponse) MarshalToSizedBuffer(dAtA []byt return len(dAtA) - i, nil } +func (m *QueryBlockLimitsConfigurationRequest) 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 *QueryBlockLimitsConfigurationRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBlockLimitsConfigurationRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryBlockLimitsConfigurationResponse) 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 *QueryBlockLimitsConfigurationResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBlockLimitsConfigurationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.BlockLimitsConfig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func (m *QueryNextClobPairIdRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2892,20 +3077,20 @@ func (m *StreamOrderbookUpdatesRequest) MarshalToSizedBuffer(dAtA []byte) (int, dAtA[i] = 0x20 } if len(m.MarketIds) > 0 { - dAtA12 := make([]byte, len(m.MarketIds)*10) - var j11 int + dAtA13 := make([]byte, len(m.MarketIds)*10) + var j12 int for _, num := range m.MarketIds { for num >= 1<<7 { - dAtA12[j11] = uint8(uint64(num)&0x7f | 0x80) + dAtA13[j12] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j11++ + j12++ } - dAtA12[j11] = uint8(num) - j11++ + dAtA13[j12] = uint8(num) + j12++ } - i -= j11 - copy(dAtA[i:], dAtA12[:j11]) - i = encodeVarintQuery(dAtA, i, uint64(j11)) + i -= j12 + copy(dAtA[i:], dAtA13[:j12]) + i = encodeVarintQuery(dAtA, i, uint64(j12)) i-- dAtA[i] = 0x1a } @@ -2924,20 +3109,20 @@ func (m *StreamOrderbookUpdatesRequest) MarshalToSizedBuffer(dAtA []byte) (int, } } if len(m.ClobPairId) > 0 { - dAtA14 := make([]byte, len(m.ClobPairId)*10) - var j13 int + dAtA15 := make([]byte, len(m.ClobPairId)*10) + var j14 int for _, num := range m.ClobPairId { for num >= 1<<7 { - dAtA14[j13] = uint8(uint64(num)&0x7f | 0x80) + dAtA15[j14] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j13++ + j14++ } - dAtA14[j13] = uint8(num) - j13++ + dAtA15[j14] = uint8(num) + j14++ } - i -= j13 - copy(dAtA[i:], dAtA14[:j13]) - i = encodeVarintQuery(dAtA, i, uint64(j13)) + i -= j14 + copy(dAtA[i:], dAtA15[:j14]) + i = encodeVarintQuery(dAtA, i, uint64(j14)) i-- dAtA[i] = 0xa } @@ -3196,20 +3381,20 @@ func (m *StreamOrderbookFill) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l if len(m.FillAmounts) > 0 { - dAtA21 := make([]byte, len(m.FillAmounts)*10) - var j20 int + dAtA22 := make([]byte, len(m.FillAmounts)*10) + var j21 int for _, num := range m.FillAmounts { for num >= 1<<7 { - dAtA21[j20] = uint8(uint64(num)&0x7f | 0x80) + dAtA22[j21] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j20++ + j21++ } - dAtA21[j20] = uint8(num) - j20++ + dAtA22[j21] = uint8(num) + j21++ } - i -= j20 - copy(dAtA[i:], dAtA21[:j20]) - i = encodeVarintQuery(dAtA, i, uint64(j20)) + i -= j21 + copy(dAtA[i:], dAtA22[:j21]) + i = encodeVarintQuery(dAtA, i, uint64(j21)) i-- dAtA[i] = 0x1a } @@ -3570,6 +3755,26 @@ func (m *QueryLiquidationsConfigurationResponse) Size() (n int) { return n } +func (m *QueryBlockLimitsConfigurationRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryBlockLimitsConfigurationResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.BlockLimitsConfig.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + func (m *QueryNextClobPairIdRequest) Size() (n int) { if m == nil { return 0 @@ -5137,6 +5342,139 @@ func (m *QueryLiquidationsConfigurationResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryBlockLimitsConfigurationRequest) 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: QueryBlockLimitsConfigurationRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBlockLimitsConfigurationRequest: 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 *QueryBlockLimitsConfigurationResponse) 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: QueryBlockLimitsConfigurationResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBlockLimitsConfigurationResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockLimitsConfig", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.BlockLimitsConfig.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + 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 *QueryNextClobPairIdRequest) 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 8443afadd51..b6f355c57f8 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_BlockLimitsConfiguration_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryBlockLimitsConfigurationRequest + var metadata runtime.ServerMetadata + + msg, err := client.BlockLimitsConfiguration(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_BlockLimitsConfiguration_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryBlockLimitsConfigurationRequest + var metadata runtime.ServerMetadata + + msg, err := server.BlockLimitsConfiguration(ctx, &protoReq) + return msg, metadata, err + +} + 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 @@ -449,6 +467,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_BlockLimitsConfiguration_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_BlockLimitsConfiguration_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_BlockLimitsConfiguration_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + 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() @@ -656,6 +697,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_BlockLimitsConfiguration_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_BlockLimitsConfiguration_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_BlockLimitsConfiguration_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + 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() @@ -712,6 +773,8 @@ var ( 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_BlockLimitsConfiguration_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"dydxprotocol", "clob", "block_limits_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))) pattern_Query_Leverage_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4}, []string{"dydxprotocol", "clob", "leverage", "owner", "number"}, "", runtime.AssumeColonVerbOpt(false))) @@ -730,6 +793,8 @@ var ( forward_Query_LiquidationsConfiguration_0 = runtime.ForwardResponseMessage + forward_Query_BlockLimitsConfiguration_0 = runtime.ForwardResponseMessage + forward_Query_NextClobPairId_0 = runtime.ForwardResponseMessage forward_Query_Leverage_0 = runtime.ForwardResponseMessage diff --git a/protocol/x/clob/types/tx.pb.go b/protocol/x/clob/types/tx.pb.go index 23f9da0fe67..66878e55892 100644 --- a/protocol/x/clob/types/tx.pb.go +++ b/protocol/x/clob/types/tx.pb.go @@ -1091,6 +1091,101 @@ func (m *MsgUpdateLiquidationsConfigResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateLiquidationsConfigResponse proto.InternalMessageInfo +// MsgUpdateBlockLimitsConfig is a request type for updating the block limits +// configuration. +type MsgUpdateBlockLimitsConfig struct { + // Authority is the address that may send this message. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // Defines the block limits configuration to update to. All fields must be + // set. + BlockLimitsConfig BlockLimitsConfig `protobuf:"bytes,2,opt,name=block_limits_config,json=blockLimitsConfig,proto3" json:"block_limits_config"` +} + +func (m *MsgUpdateBlockLimitsConfig) Reset() { *m = MsgUpdateBlockLimitsConfig{} } +func (m *MsgUpdateBlockLimitsConfig) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateBlockLimitsConfig) ProtoMessage() {} +func (*MsgUpdateBlockLimitsConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_19b9e2c0de4ab64a, []int{20} +} +func (m *MsgUpdateBlockLimitsConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateBlockLimitsConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateBlockLimitsConfig.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 *MsgUpdateBlockLimitsConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateBlockLimitsConfig.Merge(m, src) +} +func (m *MsgUpdateBlockLimitsConfig) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateBlockLimitsConfig) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateBlockLimitsConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateBlockLimitsConfig proto.InternalMessageInfo + +func (m *MsgUpdateBlockLimitsConfig) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgUpdateBlockLimitsConfig) GetBlockLimitsConfig() BlockLimitsConfig { + if m != nil { + return m.BlockLimitsConfig + } + return BlockLimitsConfig{} +} + +// MsgUpdateBlockLimitsConfigResponse is a response type for updating the +// block limits configuration. +type MsgUpdateBlockLimitsConfigResponse struct { +} + +func (m *MsgUpdateBlockLimitsConfigResponse) Reset() { *m = MsgUpdateBlockLimitsConfigResponse{} } +func (m *MsgUpdateBlockLimitsConfigResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateBlockLimitsConfigResponse) ProtoMessage() {} +func (*MsgUpdateBlockLimitsConfigResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_19b9e2c0de4ab64a, []int{21} +} +func (m *MsgUpdateBlockLimitsConfigResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateBlockLimitsConfigResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateBlockLimitsConfigResponse.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 *MsgUpdateBlockLimitsConfigResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateBlockLimitsConfigResponse.Merge(m, src) +} +func (m *MsgUpdateBlockLimitsConfigResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateBlockLimitsConfigResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateBlockLimitsConfigResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateBlockLimitsConfigResponse proto.InternalMessageInfo + // LeverageEntry represents a single clob pair leverage setting. type LeverageEntry struct { // The clob pair ID. @@ -1103,7 +1198,7 @@ func (m *LeverageEntry) Reset() { *m = LeverageEntry{} } func (m *LeverageEntry) String() string { return proto.CompactTextString(m) } func (*LeverageEntry) ProtoMessage() {} func (*LeverageEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_19b9e2c0de4ab64a, []int{20} + return fileDescriptor_19b9e2c0de4ab64a, []int{22} } func (m *LeverageEntry) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1159,7 +1254,7 @@ func (m *MsgUpdateLeverage) Reset() { *m = MsgUpdateLeverage{} } func (m *MsgUpdateLeverage) String() string { return proto.CompactTextString(m) } func (*MsgUpdateLeverage) ProtoMessage() {} func (*MsgUpdateLeverage) Descriptor() ([]byte, []int) { - return fileDescriptor_19b9e2c0de4ab64a, []int{21} + return fileDescriptor_19b9e2c0de4ab64a, []int{23} } func (m *MsgUpdateLeverage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1210,7 +1305,7 @@ func (m *MsgUpdateLeverageResponse) Reset() { *m = MsgUpdateLeverageResp func (m *MsgUpdateLeverageResponse) String() string { return proto.CompactTextString(m) } func (*MsgUpdateLeverageResponse) ProtoMessage() {} func (*MsgUpdateLeverageResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_19b9e2c0de4ab64a, []int{22} + return fileDescriptor_19b9e2c0de4ab64a, []int{24} } func (m *MsgUpdateLeverageResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1260,6 +1355,8 @@ func init() { proto.RegisterType((*MsgUpdateBlockRateLimitConfigurationResponse)(nil), "dydxprotocol.clob.MsgUpdateBlockRateLimitConfigurationResponse") proto.RegisterType((*MsgUpdateLiquidationsConfig)(nil), "dydxprotocol.clob.MsgUpdateLiquidationsConfig") proto.RegisterType((*MsgUpdateLiquidationsConfigResponse)(nil), "dydxprotocol.clob.MsgUpdateLiquidationsConfigResponse") + proto.RegisterType((*MsgUpdateBlockLimitsConfig)(nil), "dydxprotocol.clob.MsgUpdateBlockLimitsConfig") + proto.RegisterType((*MsgUpdateBlockLimitsConfigResponse)(nil), "dydxprotocol.clob.MsgUpdateBlockLimitsConfigResponse") proto.RegisterType((*LeverageEntry)(nil), "dydxprotocol.clob.LeverageEntry") proto.RegisterType((*MsgUpdateLeverage)(nil), "dydxprotocol.clob.MsgUpdateLeverage") proto.RegisterType((*MsgUpdateLeverageResponse)(nil), "dydxprotocol.clob.MsgUpdateLeverageResponse") @@ -1268,86 +1365,90 @@ func init() { func init() { proto.RegisterFile("dydxprotocol/clob/tx.proto", fileDescriptor_19b9e2c0de4ab64a) } var fileDescriptor_19b9e2c0de4ab64a = []byte{ - // 1250 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0xcd, 0x6f, 0x1b, 0x45, - 0x14, 0xf7, 0xb6, 0x40, 0xeb, 0x17, 0x3b, 0x4d, 0xa7, 0x29, 0x71, 0xb7, 0xc4, 0x71, 0x4c, 0x12, - 0xb9, 0xd0, 0xd8, 0x25, 0x54, 0x01, 0x15, 0xf1, 0xe5, 0x28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f7, 0xa9, 0xe3, 0xa9, 0x1e, - 0x76, 0x2c, 0x55, 0x0f, 0xec, 0xb8, 0x95, 0x4b, 0x41, 0x3d, 0x4c, 0x67, 0xa6, 0xc5, 0xf7, 0x29, - 0x54, 0x37, 0x11, 0x88, 0xef, 0x62, 0xc7, 0x62, 0x4e, 0xba, 0x68, 0x2e, 0xc1, 0x9e, 0x4f, 0x48, - 0x39, 0xce, 0x5d, 0x7d, 0x13, 0x60, 0xa8, 0x0b, 0xd5, 0xa0, 0xc4, 0xaf, 0x46, 0x14, 0x58, 0x59, - 0x81, 0xa8, 0xf4, 0xd7, 0x0d, 0x34, 0x0d, 0xa0, 0x9b, 0x04, 0x07, 0x71, 0x33, 0x07, 0xcb, 0x4a, - 0x91, 0xed, 0xac, 0x1b, 0x6e, 0xfd, 0x89, 0x14, 0x10, 0x29, 0xb0, 0x15, 0x11, 0x89, 0xb6, 0x60, - 0x52, 0x08, 0xd1, 0x1d, 0xe8, 0x3a, 0xc6, 0x06, 0x36, 0xc2, 0xa2, 0xcf, 0x0f, 0x52, 0x41, 0x3c, - 0xbc, 0x9d, 0x48, 0x10, 0xad, 0xc3, 0x75, 0x41, 0xe1, 0x9e, 0x46, 0x4c, 0x6c, 0x8c, 0x44, 0x99, - 0x72, 0x8d, 0x6b, 0x7b, 0x18, 0x48, 0x45, 0x0d, 0xe6, 0x13, 0xdb, 0xf8, 0xff, 0x36, 0x98, 0xb8, - 0x73, 0xbc, 0x3e, 0x9f, 0x4b, 0x50, 0x12, 0xbb, 0x83, 0x7f, 0xa9, 0x83, 0xe6, 0x1e, 0x56, 0xe5, - 0x2b, 0x19, 0x96, 0x37, 0x7d, 0xcc, 0x5a, 0x41, 0x61, 0x60, 0xf4, 0x2e, 0xc8, 0x02, 0x99, 0xec, - 0xce, 0xda, 0xfe, 0x15, 0xb7, 0x70, 0xdf, 0x0b, 0x82, 0x28, 0xad, 0x15, 0x94, 0x29, 0x4e, 0x5c, - 0xc0, 0x66, 0x27, 0x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 0xc6, - 0x5b, 0x79, 0x76, 0x72, 0x04, 0xe5, 0xf7, 0x2f, 0x28, 0xc8, 0xfd, 0x7b, 0x2c, 0x41, 0x25, 0xb3, - 0x87, 0x37, 0xf3, 0xb4, 0x27, 0xf1, 0xf2, 0xf2, 0x3f, 0xc3, 0x27, 0xab, 0x85, 0x77, 0xc0, 0xdc, - 0x6a, 0x89, 0x50, 0xf9, 0xd5, 0x72, 0xb6, 0x0f, 0xb5, 0x3b, 0x4f, 0x4f, 0xaa, 0xd2, 0xb3, 0x93, - 0xaa, 0xf4, 0xe7, 0x49, 0x55, 0xfa, 0xe6, 0xb4, 0x5a, 0x78, 0x76, 0x5a, 0x2d, 0x3c, 0x3f, 0xad, - 0x16, 0x3e, 0x5f, 0xee, 0x11, 0x6f, 0x7f, 0xd0, 0x6d, 0xea, 0xd4, 0x8a, 0xff, 0x68, 0x70, 0x78, - 0x7f, 0x51, 0xdf, 0xd7, 0x48, 0xbf, 0xc5, 0x77, 0x8e, 0xc2, 0x5f, 0x30, 0x8e, 0x6d, 0xec, 0x76, - 0x5f, 0x0a, 0xb6, 0xdf, 0xfc, 0x3b, 0x00, 0x00, 0xff, 0xff, 0xcd, 0x24, 0x47, 0xbc, 0xe3, 0x10, - 0x00, 0x00, + // 1316 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0xcd, 0x6f, 0x1b, 0xc5, + 0x1b, 0xf6, 0xb6, 0xbf, 0x1f, 0x6d, 0xde, 0xd8, 0x69, 0x32, 0x49, 0x89, 0xbb, 0x21, 0x8e, 0xb3, + 0x38, 0x91, 0x4b, 0x1b, 0xbb, 0x84, 0x12, 0x50, 0x11, 0x5f, 0x8e, 0x52, 0x25, 0x22, 0x21, 0xce, + 0x26, 0x08, 0x54, 0x90, 0x56, 0xeb, 0xdd, 0x89, 0x33, 0xea, 0xae, 0x67, 0xb3, 0xbb, 0x0e, 0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 0x7d, 0x2f, 0x80, 0x34, 0x44, 0x2b, 0x7e, 0x7b, + 0x90, 0xd3, 0x41, 0x96, 0xe2, 0x07, 0x17, 0xb5, 0x64, 0x29, 0x7e, 0x27, 0xc0, 0xfc, 0xf9, 0xad, + 0xf1, 0xad, 0x41, 0x71, 0x06, 0x18, 0x8a, 0xef, 0x5f, 0xd0, 0x90, 0xe5, 0xf7, 0x48, 0x80, 0x62, + 0x66, 0xb3, 0xaa, 0x0d, 0xf2, 0x9e, 0xc4, 0x8b, 0x2b, 0xcf, 0x87, 0x67, 0x49, 0x7c, 0x05, 0xd3, + 0x59, 0x3d, 0x64, 0xe9, 0x5c, 0x82, 0x3c, 0x5c, 0x7c, 0xf3, 0xb9, 0xe0, 0xc9, 0x72, 0x65, 0x57, + 0xf0, 0xc0, 0x72, 0x8d, 0x50, 0x83, 0xcb, 0xb5, 0xff, 0x22, 0x6c, 0x34, 0x9f, 0x9c, 0x96, 0x84, + 0xa7, 0xa7, 0x25, 0xe1, 0xaf, 0xd3, 0x92, 0xf0, 0xcd, 0x59, 0x29, 0xf7, 0xf4, 0xac, 0x94, 0x7b, + 0x76, 0x56, 0xca, 0x3d, 0x58, 0x69, 0x13, 0xf7, 0xa0, 0xdb, 0xaa, 0x69, 0xd4, 0x8c, 0xff, 0x96, + 0x73, 0x74, 0x77, 0x49, 0x3b, 0x50, 0x49, 0xa7, 0xce, 0x66, 0x8e, 0xc3, 0x1f, 0x96, 0x4e, 0x2c, + 0xec, 0xb4, 0x5e, 0xf2, 0xa7, 0xdf, 0xf8, 0x27, 0x00, 0x00, 0xff, 0xff, 0xff, 0xd0, 0x15, 0xb7, + 0x7a, 0x12, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1386,6 +1487,8 @@ type MsgClient interface { UpdateBlockRateLimitConfiguration(ctx context.Context, in *MsgUpdateBlockRateLimitConfiguration, opts ...grpc.CallOption) (*MsgUpdateBlockRateLimitConfigurationResponse, error) // UpdateLiquidationsConfig updates the liquidations configuration in state. UpdateLiquidationsConfig(ctx context.Context, in *MsgUpdateLiquidationsConfig, opts ...grpc.CallOption) (*MsgUpdateLiquidationsConfigResponse, error) + // UpdateBlockLimitsConfig updates the block limits configuration in state. + UpdateBlockLimitsConfig(ctx context.Context, in *MsgUpdateBlockLimitsConfig, opts ...grpc.CallOption) (*MsgUpdateBlockLimitsConfigResponse, error) // UpdateLeverage allows accounts to update their desired leverage for // clob pairs. UpdateLeverage(ctx context.Context, in *MsgUpdateLeverage, opts ...grpc.CallOption) (*MsgUpdateLeverageResponse, error) @@ -1480,6 +1583,15 @@ func (c *msgClient) UpdateLiquidationsConfig(ctx context.Context, in *MsgUpdateL return out, nil } +func (c *msgClient) UpdateBlockLimitsConfig(ctx context.Context, in *MsgUpdateBlockLimitsConfig, opts ...grpc.CallOption) (*MsgUpdateBlockLimitsConfigResponse, error) { + out := new(MsgUpdateBlockLimitsConfigResponse) + err := c.cc.Invoke(ctx, "/dydxprotocol.clob.Msg/UpdateBlockLimitsConfig", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *msgClient) UpdateLeverage(ctx context.Context, in *MsgUpdateLeverage, opts ...grpc.CallOption) (*MsgUpdateLeverageResponse, error) { out := new(MsgUpdateLeverageResponse) err := c.cc.Invoke(ctx, "/dydxprotocol.clob.Msg/UpdateLeverage", in, out, opts...) @@ -1515,6 +1627,8 @@ type MsgServer interface { UpdateBlockRateLimitConfiguration(context.Context, *MsgUpdateBlockRateLimitConfiguration) (*MsgUpdateBlockRateLimitConfigurationResponse, error) // UpdateLiquidationsConfig updates the liquidations configuration in state. UpdateLiquidationsConfig(context.Context, *MsgUpdateLiquidationsConfig) (*MsgUpdateLiquidationsConfigResponse, error) + // UpdateBlockLimitsConfig updates the block limits configuration in state. + UpdateBlockLimitsConfig(context.Context, *MsgUpdateBlockLimitsConfig) (*MsgUpdateBlockLimitsConfigResponse, error) // UpdateLeverage allows accounts to update their desired leverage for // clob pairs. UpdateLeverage(context.Context, *MsgUpdateLeverage) (*MsgUpdateLeverageResponse, error) @@ -1551,6 +1665,9 @@ func (*UnimplementedMsgServer) UpdateBlockRateLimitConfiguration(ctx context.Con func (*UnimplementedMsgServer) UpdateLiquidationsConfig(ctx context.Context, req *MsgUpdateLiquidationsConfig) (*MsgUpdateLiquidationsConfigResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateLiquidationsConfig not implemented") } +func (*UnimplementedMsgServer) UpdateBlockLimitsConfig(ctx context.Context, req *MsgUpdateBlockLimitsConfig) (*MsgUpdateBlockLimitsConfigResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateBlockLimitsConfig not implemented") +} func (*UnimplementedMsgServer) UpdateLeverage(ctx context.Context, req *MsgUpdateLeverage) (*MsgUpdateLeverageResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateLeverage not implemented") } @@ -1721,6 +1838,24 @@ func _Msg_UpdateLiquidationsConfig_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } +func _Msg_UpdateBlockLimitsConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateBlockLimitsConfig) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateBlockLimitsConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/dydxprotocol.clob.Msg/UpdateBlockLimitsConfig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateBlockLimitsConfig(ctx, req.(*MsgUpdateBlockLimitsConfig)) + } + return interceptor(ctx, in, info, handler) +} + func _Msg_UpdateLeverage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgUpdateLeverage) if err := dec(in); err != nil { @@ -1779,6 +1914,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "UpdateLiquidationsConfig", Handler: _Msg_UpdateLiquidationsConfig_Handler, }, + { + MethodName: "UpdateBlockLimitsConfig", + Handler: _Msg_UpdateBlockLimitsConfig_Handler, + }, { MethodName: "UpdateLeverage", Handler: _Msg_UpdateLeverage_Handler, @@ -2548,6 +2687,69 @@ func (m *MsgUpdateLiquidationsConfigResponse) MarshalToSizedBuffer(dAtA []byte) return len(dAtA) - i, nil } +func (m *MsgUpdateBlockLimitsConfig) 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 *MsgUpdateBlockLimitsConfig) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateBlockLimitsConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.BlockLimitsConfig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateBlockLimitsConfigResponse) 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 *MsgUpdateBlockLimitsConfigResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateBlockLimitsConfigResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *LeverageEntry) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2977,6 +3179,30 @@ func (m *MsgUpdateLiquidationsConfigResponse) Size() (n int) { return n } +func (m *MsgUpdateBlockLimitsConfig) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.BlockLimitsConfig.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateBlockLimitsConfigResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *LeverageEntry) Size() (n int) { if m == nil { return 0 @@ -4834,6 +5060,171 @@ func (m *MsgUpdateLiquidationsConfigResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgUpdateBlockLimitsConfig) 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 ErrIntOverflowTx + } + 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: MsgUpdateBlockLimitsConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateBlockLimitsConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockLimitsConfig", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.BlockLimitsConfig.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateBlockLimitsConfigResponse) 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 ErrIntOverflowTx + } + 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: MsgUpdateBlockLimitsConfigResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateBlockLimitsConfigResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *LeverageEntry) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 From e6d6c6406180b1cbe9a58bb01c6178a1ef390a6b Mon Sep 17 00:00:00 2001 From: Anmol Agrawal Date: Fri, 7 Nov 2025 13:34:24 -0500 Subject: [PATCH 3/8] fix linting issues --- .../clob/block_limits_config.proto | 1 - proto/dydxprotocol/clob/tx.proto | 3 +-- protocol/x/clob/module_test.go | 19 ++++++++++--------- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/proto/dydxprotocol/clob/block_limits_config.proto b/proto/dydxprotocol/clob/block_limits_config.proto index c359b6b90a3..e6531498c2c 100644 --- a/proto/dydxprotocol/clob/block_limits_config.proto +++ b/proto/dydxprotocol/clob/block_limits_config.proto @@ -12,4 +12,3 @@ message BlockLimitsConfig { // processing a large number of expired orders. uint32 max_stateful_order_removals_per_block = 1; } - diff --git a/proto/dydxprotocol/clob/tx.proto b/proto/dydxprotocol/clob/tx.proto index 707e741d6f5..70dff6f1b1d 100644 --- a/proto/dydxprotocol/clob/tx.proto +++ b/proto/dydxprotocol/clob/tx.proto @@ -229,8 +229,7 @@ message MsgUpdateBlockLimitsConfig { // Defines the block limits configuration to update to. All fields must be // set. - BlockLimitsConfig block_limits_config = 2 - [ (gogoproto.nullable) = false ]; + BlockLimitsConfig block_limits_config = 2 [ (gogoproto.nullable) = false ]; } // MsgUpdateBlockLimitsConfigResponse is a response type for updating the diff --git a/protocol/x/clob/module_test.go b/protocol/x/clob/module_test.go index 5cffd04b568..bb1431349c3 100644 --- a/protocol/x/clob/module_test.go +++ b/protocol/x/clob/module_test.go @@ -150,7 +150,7 @@ func TestAppModuleBasic_RegisterInterfaces(t *testing.T) { // due to it using an unexported method on the interface thus we use reflection to access the field // directly that contains the registrations. fv := reflect.ValueOf(registry).Elem().FieldByName("implInterfaces") - require.Len(t, fv.MapKeys(), 20) + require.Len(t, fv.MapKeys(), 22) } func TestAppModuleBasic_DefaultGenesis(t *testing.T) { @@ -255,14 +255,15 @@ func TestAppModuleBasic_GetQueryCmd(t *testing.T) { cmd := am.GetQueryCmd() require.Equal(t, "clob", cmd.Use) - require.Equal(t, 7, len(cmd.Commands())) - require.Equal(t, "get-block-rate-limit-config", cmd.Commands()[0].Name()) - require.Equal(t, "get-equity-tier-limit-config", cmd.Commands()[1].Name()) - require.Equal(t, "get-liquidations-config", cmd.Commands()[2].Name()) - require.Equal(t, "leverage", cmd.Commands()[3].Name()) - require.Equal(t, "list-clob-pair", cmd.Commands()[4].Name()) - require.Equal(t, "show-clob-pair", cmd.Commands()[5].Name()) - require.Equal(t, "stateful-order", cmd.Commands()[6].Name()) + require.Equal(t, 8, len(cmd.Commands())) + require.Equal(t, "get-block-limits-config", cmd.Commands()[0].Name()) + require.Equal(t, "get-block-rate-limit-config", cmd.Commands()[1].Name()) + require.Equal(t, "get-equity-tier-limit-config", cmd.Commands()[2].Name()) + require.Equal(t, "get-liquidations-config", cmd.Commands()[3].Name()) + require.Equal(t, "leverage", cmd.Commands()[4].Name()) + require.Equal(t, "list-clob-pair", cmd.Commands()[5].Name()) + require.Equal(t, "show-clob-pair", cmd.Commands()[6].Name()) + require.Equal(t, "stateful-order", cmd.Commands()[7].Name()) } func TestAppModule_Name(t *testing.T) { From 8341eb0b2511ab40d15e78d7d42ae99a2d21f417 Mon Sep 17 00:00:00 2001 From: Anmol Agrawal Date: Mon, 10 Nov 2025 11:03:01 -0500 Subject: [PATCH 4/8] reset tx place order --- .../clob/block_limits_config.proto | 2 -- .../x/clob/types/block_limits_config.pb.go | 26 +++++++++---------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/proto/dydxprotocol/clob/block_limits_config.proto b/proto/dydxprotocol/clob/block_limits_config.proto index e6531498c2c..0dd5236bc95 100644 --- a/proto/dydxprotocol/clob/block_limits_config.proto +++ b/proto/dydxprotocol/clob/block_limits_config.proto @@ -1,8 +1,6 @@ syntax = "proto3"; package dydxprotocol.clob; -import "gogoproto/gogo.proto"; - option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/clob/types"; // BlockLimitsConfig stores global per-block limits for the CLOB module. diff --git a/protocol/x/clob/types/block_limits_config.pb.go b/protocol/x/clob/types/block_limits_config.pb.go index a46b9a302a2..086aaa3ed2b 100644 --- a/protocol/x/clob/types/block_limits_config.pb.go +++ b/protocol/x/clob/types/block_limits_config.pb.go @@ -5,7 +5,6 @@ package types import ( fmt "fmt" - _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" io "io" math "math" @@ -80,22 +79,21 @@ func init() { } var fileDescriptor_882b42be478a422d = []byte{ - // 229 bytes of a gzipped FileDescriptorProto + // 216 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x4e, 0xa9, 0x4c, 0xa9, 0x28, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0xce, 0xcf, 0xd1, 0x4f, 0xce, 0xc9, 0x4f, 0xd2, 0x4f, 0xca, 0xc9, 0x4f, 0xce, 0x8e, 0xcf, 0xc9, 0xcc, 0xcd, 0x2c, 0x29, 0x8e, 0x4f, 0xce, 0xcf, 0x4b, 0xcb, - 0x4c, 0xd7, 0x03, 0xab, 0x10, 0x12, 0x44, 0x56, 0xac, 0x07, 0x52, 0x2c, 0x25, 0x92, 0x9e, 0x9f, - 0x9e, 0x0f, 0x16, 0xd2, 0x07, 0xb1, 0x20, 0x0a, 0x95, 0x52, 0xb8, 0x04, 0x9d, 0x40, 0xa6, 0xf8, - 0x80, 0x0d, 0x71, 0x06, 0x9b, 0x21, 0xe4, 0xcf, 0xa5, 0x9a, 0x9b, 0x58, 0x11, 0x5f, 0x5c, 0x92, - 0x58, 0x92, 0x9a, 0x56, 0x9a, 0x13, 0x9f, 0x5f, 0x94, 0x92, 0x5a, 0x14, 0x5f, 0x94, 0x9a, 0x9b, - 0x5f, 0x96, 0x98, 0x53, 0x1c, 0x5f, 0x90, 0x5a, 0x14, 0x0f, 0xb6, 0x5a, 0x82, 0x51, 0x81, 0x51, - 0x83, 0x37, 0x48, 0x21, 0x37, 0xb1, 0x22, 0x18, 0xaa, 0xd6, 0x1f, 0xa4, 0x34, 0x08, 0xaa, 0x32, - 0x20, 0xb5, 0x08, 0x6c, 0xb8, 0x53, 0xc0, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, - 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, - 0x44, 0x99, 0xa5, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xa3, 0x78, 0xb0, - 0xcc, 0x44, 0x37, 0x39, 0x23, 0x31, 0x33, 0x4f, 0x1f, 0x2e, 0x52, 0x01, 0xf1, 0x74, 0x49, 0x65, - 0x41, 0x6a, 0x71, 0x12, 0x1b, 0x58, 0xd8, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0xc8, 0x4b, 0x59, - 0xc3, 0x16, 0x01, 0x00, 0x00, + 0x4c, 0xd7, 0x03, 0xab, 0x10, 0x12, 0x44, 0x56, 0xac, 0x07, 0x52, 0xac, 0x94, 0xc2, 0x25, 0xe8, + 0x04, 0x52, 0xef, 0x03, 0x56, 0xee, 0x0c, 0x56, 0x2d, 0xe4, 0xcf, 0xa5, 0x9a, 0x9b, 0x58, 0x11, + 0x5f, 0x5c, 0x92, 0x58, 0x92, 0x9a, 0x56, 0x9a, 0x13, 0x9f, 0x5f, 0x94, 0x92, 0x5a, 0x14, 0x5f, + 0x94, 0x9a, 0x9b, 0x5f, 0x96, 0x98, 0x53, 0x1c, 0x5f, 0x90, 0x5a, 0x14, 0x0f, 0xb6, 0x44, 0x82, + 0x51, 0x81, 0x51, 0x83, 0x37, 0x48, 0x21, 0x37, 0xb1, 0x22, 0x18, 0xaa, 0xd6, 0x1f, 0xa4, 0x34, + 0x08, 0xaa, 0x32, 0x20, 0xb5, 0x08, 0x6c, 0xb8, 0x53, 0xc0, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, + 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, + 0x1e, 0xcb, 0x31, 0x44, 0x99, 0xa5, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, + 0xa3, 0x78, 0xa5, 0xcc, 0x44, 0x37, 0x39, 0x23, 0x31, 0x33, 0x4f, 0x1f, 0x2e, 0x52, 0x01, 0xf1, + 0x5e, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0x58, 0xd8, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, + 0x3b, 0x66, 0x7e, 0x91, 0x00, 0x01, 0x00, 0x00, } func (m *BlockLimitsConfig) Marshal() (dAtA []byte, err error) { From 0947a813584c01550fa18a1c9591c78fb4cfc153 Mon Sep 17 00:00:00 2001 From: Anmol Agrawal Date: Mon, 10 Nov 2025 11:24:29 -0500 Subject: [PATCH 5/8] fix tests --- protocol/app/msgs/all_msgs.go | 2 ++ protocol/app/msgs/normal_msgs.go | 18 ++++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/protocol/app/msgs/all_msgs.go b/protocol/app/msgs/all_msgs.go index 06a6dba8e65..0992e69817c 100644 --- a/protocol/app/msgs/all_msgs.go +++ b/protocol/app/msgs/all_msgs.go @@ -210,6 +210,8 @@ var ( "/dydxprotocol.clob.MsgUpdateLiquidationsConfigResponse": {}, "/dydxprotocol.clob.MsgUpdateLeverage": {}, "/dydxprotocol.clob.MsgUpdateLeverageResponse": {}, + "/dydxprotocol.clob.MsgUpdateBlockLimitsConfig": {}, + "/dydxprotocol.clob.MsgUpdateBlockLimitsConfigResponse": {}, // delaymsg "/dydxprotocol.delaymsg.MsgDelayMessage": {}, diff --git a/protocol/app/msgs/normal_msgs.go b/protocol/app/msgs/normal_msgs.go index 244fb57efa8..c77385111f5 100644 --- a/protocol/app/msgs/normal_msgs.go +++ b/protocol/app/msgs/normal_msgs.go @@ -226,14 +226,16 @@ var ( "/dydxprotocol.accountplus.TxExtension": nil, // clob - "/dydxprotocol.clob.MsgBatchCancel": &clob.MsgBatchCancel{}, - "/dydxprotocol.clob.MsgBatchCancelResponse": nil, - "/dydxprotocol.clob.MsgCancelOrder": &clob.MsgCancelOrder{}, - "/dydxprotocol.clob.MsgCancelOrderResponse": nil, - "/dydxprotocol.clob.MsgPlaceOrder": &clob.MsgPlaceOrder{}, - "/dydxprotocol.clob.MsgPlaceOrderResponse": nil, - "/dydxprotocol.clob.MsgUpdateLeverage": &clob.MsgUpdateLeverage{}, - "/dydxprotocol.clob.MsgUpdateLeverageResponse": nil, + "/dydxprotocol.clob.MsgBatchCancel": &clob.MsgBatchCancel{}, + "/dydxprotocol.clob.MsgBatchCancelResponse": nil, + "/dydxprotocol.clob.MsgCancelOrder": &clob.MsgCancelOrder{}, + "/dydxprotocol.clob.MsgCancelOrderResponse": nil, + "/dydxprotocol.clob.MsgPlaceOrder": &clob.MsgPlaceOrder{}, + "/dydxprotocol.clob.MsgPlaceOrderResponse": nil, + "/dydxprotocol.clob.MsgUpdateLeverage": &clob.MsgUpdateLeverage{}, + "/dydxprotocol.clob.MsgUpdateLeverageResponse": nil, + "/dydxprotocol.clob.MsgUpdateBlockLimitsConfig": &clob.MsgUpdateBlockLimitsConfig{}, + "/dydxprotocol.clob.MsgUpdateBlockLimitsConfigResponse": nil, // listing "/dydxprotocol.listing.MsgCreateMarketPermissionless": &listing.MsgCreateMarketPermissionless{}, From 547d3e05dff09ed85f6056a59e36296153b20993 Mon Sep 17 00:00:00 2001 From: Anmol Agrawal Date: Mon, 10 Nov 2025 12:09:41 -0500 Subject: [PATCH 6/8] fix tests --- protocol/app/msgs/internal_msgs.go | 2 ++ protocol/app/msgs/normal_msgs.go | 18 ++++++++---------- protocol/lib/ante/internal_msg.go | 1 + 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/protocol/app/msgs/internal_msgs.go b/protocol/app/msgs/internal_msgs.go index 94ec2ac61a6..782af759132 100644 --- a/protocol/app/msgs/internal_msgs.go +++ b/protocol/app/msgs/internal_msgs.go @@ -150,6 +150,8 @@ var ( "/dydxprotocol.clob.MsgUpdateEquityTierLimitConfigurationResponse": nil, "/dydxprotocol.clob.MsgUpdateLiquidationsConfig": &clob.MsgUpdateLiquidationsConfig{}, "/dydxprotocol.clob.MsgUpdateLiquidationsConfigResponse": nil, + "/dydxprotocol.clob.MsgUpdateBlockLimitsConfig": &clob.MsgUpdateBlockLimitsConfig{}, + "/dydxprotocol.clob.MsgUpdateBlockLimitsConfigResponse": nil, // delaymsg "/dydxprotocol.delaymsg.MsgDelayMessage": &delaymsg.MsgDelayMessage{}, diff --git a/protocol/app/msgs/normal_msgs.go b/protocol/app/msgs/normal_msgs.go index c77385111f5..244fb57efa8 100644 --- a/protocol/app/msgs/normal_msgs.go +++ b/protocol/app/msgs/normal_msgs.go @@ -226,16 +226,14 @@ var ( "/dydxprotocol.accountplus.TxExtension": nil, // clob - "/dydxprotocol.clob.MsgBatchCancel": &clob.MsgBatchCancel{}, - "/dydxprotocol.clob.MsgBatchCancelResponse": nil, - "/dydxprotocol.clob.MsgCancelOrder": &clob.MsgCancelOrder{}, - "/dydxprotocol.clob.MsgCancelOrderResponse": nil, - "/dydxprotocol.clob.MsgPlaceOrder": &clob.MsgPlaceOrder{}, - "/dydxprotocol.clob.MsgPlaceOrderResponse": nil, - "/dydxprotocol.clob.MsgUpdateLeverage": &clob.MsgUpdateLeverage{}, - "/dydxprotocol.clob.MsgUpdateLeverageResponse": nil, - "/dydxprotocol.clob.MsgUpdateBlockLimitsConfig": &clob.MsgUpdateBlockLimitsConfig{}, - "/dydxprotocol.clob.MsgUpdateBlockLimitsConfigResponse": nil, + "/dydxprotocol.clob.MsgBatchCancel": &clob.MsgBatchCancel{}, + "/dydxprotocol.clob.MsgBatchCancelResponse": nil, + "/dydxprotocol.clob.MsgCancelOrder": &clob.MsgCancelOrder{}, + "/dydxprotocol.clob.MsgCancelOrderResponse": nil, + "/dydxprotocol.clob.MsgPlaceOrder": &clob.MsgPlaceOrder{}, + "/dydxprotocol.clob.MsgPlaceOrderResponse": nil, + "/dydxprotocol.clob.MsgUpdateLeverage": &clob.MsgUpdateLeverage{}, + "/dydxprotocol.clob.MsgUpdateLeverageResponse": nil, // listing "/dydxprotocol.listing.MsgCreateMarketPermissionless": &listing.MsgCreateMarketPermissionless{}, diff --git a/protocol/lib/ante/internal_msg.go b/protocol/lib/ante/internal_msg.go index dc6ef13006f..a02b1102bf7 100644 --- a/protocol/lib/ante/internal_msg.go +++ b/protocol/lib/ante/internal_msg.go @@ -91,6 +91,7 @@ func IsInternalMsg(msg sdk.Msg) bool { *clob.MsgUpdateClobPair, *clob.MsgUpdateEquityTierLimitConfiguration, *clob.MsgUpdateLiquidationsConfig, + *clob.MsgUpdateBlockLimitsConfig, // delaymsg *delaymsg.MsgDelayMessage, From e1c394734f9b2b7799c864a22600f400badc4b24 Mon Sep 17 00:00:00 2001 From: Anmol Agrawal Date: Mon, 10 Nov 2025 13:09:26 -0500 Subject: [PATCH 7/8] fix internal msg test --- protocol/app/msgs/internal_msgs_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/protocol/app/msgs/internal_msgs_test.go b/protocol/app/msgs/internal_msgs_test.go index 3fb3a56e8f1..3d55789b1ae 100644 --- a/protocol/app/msgs/internal_msgs_test.go +++ b/protocol/app/msgs/internal_msgs_test.go @@ -98,6 +98,8 @@ func TestInternalMsgSamples_Gov_Key(t *testing.T) { // clob "/dydxprotocol.clob.MsgCreateClobPair", "/dydxprotocol.clob.MsgCreateClobPairResponse", + "/dydxprotocol.clob.MsgUpdateBlockLimitsConfig", + "/dydxprotocol.clob.MsgUpdateBlockLimitsConfigResponse", "/dydxprotocol.clob.MsgUpdateBlockRateLimitConfiguration", "/dydxprotocol.clob.MsgUpdateBlockRateLimitConfigurationResponse", "/dydxprotocol.clob.MsgUpdateClobPair", From c369ff1ef58742eeba9f891532b6d97774bfd216 Mon Sep 17 00:00:00 2001 From: Anmol Agrawal Date: Mon, 10 Nov 2025 16:57:29 -0500 Subject: [PATCH 8/8] delete unused error --- protocol/x/clob/keeper/block_limits_config.go | 5 ---- protocol/x/clob/types/block_limits_config.go | 8 ------ protocol/x/clob/types/errors.go | 5 ---- .../message_update_block_limits_config.go | 26 ------------------- 4 files changed, 44 deletions(-) delete mode 100644 protocol/x/clob/types/block_limits_config.go delete mode 100644 protocol/x/clob/types/message_update_block_limits_config.go diff --git a/protocol/x/clob/keeper/block_limits_config.go b/protocol/x/clob/keeper/block_limits_config.go index fb812690f3c..60c15602579 100644 --- a/protocol/x/clob/keeper/block_limits_config.go +++ b/protocol/x/clob/keeper/block_limits_config.go @@ -31,11 +31,6 @@ func (k Keeper) setBlockLimitsConfig( ctx sdk.Context, config types.BlockLimitsConfig, ) error { - // Validate the block limits config before writing it to state. - if err := config.Validate(); err != nil { - return err - } - store := ctx.KVStore(k.storeKey) b := k.cdc.MustMarshal(&config) store.Set([]byte(types.BlockLimitsConfigKey), b) diff --git a/protocol/x/clob/types/block_limits_config.go b/protocol/x/clob/types/block_limits_config.go deleted file mode 100644 index 73ede106b0e..00000000000 --- a/protocol/x/clob/types/block_limits_config.go +++ /dev/null @@ -1,8 +0,0 @@ -package types - -// Validate checks that the BlockLimitsConfig is valid. -// Note: MaxStatefulOrderRemovalsPerBlock can be 0, which means no cap (process all expired orders). -func (config *BlockLimitsConfig) Validate() error { - // No validation needed - 0 is a valid value meaning "no cap" - return nil -} diff --git a/protocol/x/clob/types/errors.go b/protocol/x/clob/types/errors.go index 0df907e1aa0..039f6775714 100644 --- a/protocol/x/clob/types/errors.go +++ b/protocol/x/clob/types/errors.go @@ -348,11 +348,6 @@ var ( 1022, "Liquidation conflicts with ClobPair status", ) - ErrInvalidBlockLimitsConfig = errorsmod.Register( - ModuleName, - 1023, - "Proposed BlockLimitsConfig is invalid", - ) // Advanced order type errors. ErrFokOrderCouldNotBeFullyFilled = errorsmod.Register( diff --git a/protocol/x/clob/types/message_update_block_limits_config.go b/protocol/x/clob/types/message_update_block_limits_config.go deleted file mode 100644 index d64ec389f83..00000000000 --- a/protocol/x/clob/types/message_update_block_limits_config.go +++ /dev/null @@ -1,26 +0,0 @@ -package types - -import ( - errorsmod "cosmossdk.io/errors" - "fmt" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -var _ sdk.Msg = &MsgUpdateBlockLimitsConfig{} - -// ValidateBasic validates the message's BlockLimitsConfig. Returns an error if the authority -// is empty or if the BlockLimitsConfig is invalid. -func (msg *MsgUpdateBlockLimitsConfig) ValidateBasic() error { - if _, err := sdk.AccAddressFromBech32(msg.Authority); err != nil { - return errorsmod.Wrap( - ErrInvalidAuthority, - fmt.Sprintf( - "authority '%s' must be a valid bech32 address, but got error '%v'", - msg.Authority, - err.Error(), - ), - ) - } - - return msg.BlockLimitsConfig.Validate() -}