Skip to content

Commit

Permalink
crazy tesT
Browse files Browse the repository at this point in the history
  • Loading branch information
roy-dydx committed Mar 23, 2024
1 parent e786b7a commit 30970b5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 36 deletions.
2 changes: 2 additions & 0 deletions protocol/app/datadog.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ func initDatadogProfiler(logger log.Logger, ddAgentHost string, ddAgentPort uint
profiler.CPUProfile,
profiler.HeapProfile,
profiler.MutexProfile,
profiler.GoroutineProfile,
profiler.BlockProfile,
),
)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions protocol/cmd/dydxprotocold/cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ func initTendermintConfig() *tmcfg.Config {
// goroutine profiling showed that we were using exactly 900 threads (the default) which was throttling
// the maximum amount of load that the process could take. As of the last load test, at max QPS we were
// seeing ~1700 threads being used.
cfg.RPC.MaxOpenConnections = 4000
cfg.RPC.GRPCMaxOpenConnections = 4000
cfg.RPC.MaxOpenConnections = 10000
cfg.RPC.GRPCMaxOpenConnections = 10000

// Mempool config.
// We specifically are using a number greater than max QPS (currently set at 5000) * ShortBlockWindow to prevent
Expand Down
34 changes: 0 additions & 34 deletions protocol/x/clob/memclob/memclob.go
Original file line number Diff line number Diff line change
Expand Up @@ -603,40 +603,6 @@ func (m *MemClobPriceTimePriority) PlaceOrder(
return orderSizeOptimisticallyFilledFromMatchingQuantums, orderStatus, offchainUpdates, nil
}

// The taker order has unfilled size which will be added to the orderbook as a maker order.
// Verify the maker order can be added to the orderbook by performing the add-to-orderbook
// collateralization check.
addOrderOrderStatus := m.addOrderToOrderbookCollateralizationCheck(
ctx,
order,
)

// If the add order to orderbook collateralization check failed, we cannot add the order to the orderbook.
if !addOrderOrderStatus.IsSuccess() {
if m.generateOffchainUpdates {
// Send an off-chain update message indicating the order should be removed from the orderbook
// on the Indexer.
if message, success := off_chain_updates.CreateOrderRemoveMessage(
ctx,
order.OrderId,
addOrderOrderStatus,
nil,
ocutypes.OrderRemoveV1_ORDER_REMOVAL_STATUS_BEST_EFFORT_CANCELED,
); success {
offchainUpdates.AddRemoveMessage(order.OrderId, message)
}
}

// remove stateful orders which fail collateralization check while being added to orderbook
if order.IsStatefulOrder() && !m.operationsToPropose.IsOrderRemovalInOperationsQueue(order.OrderId) {
m.operationsToPropose.MustAddOrderRemovalToOperationsQueue(
order.OrderId,
types.OrderRemoval_REMOVAL_REASON_UNDERCOLLATERALIZED,
)
}
return orderSizeOptimisticallyFilledFromMatchingQuantums, addOrderOrderStatus, offchainUpdates, nil
}

// If this is a Short-Term order and it's not in the operations queue, add the TX bytes to the
// operations to propose.
if order.IsShortTermOrder() &&
Expand Down

0 comments on commit 30970b5

Please sign in to comment.