Skip to content

Commit adf3ad4

Browse files
shrenujbKefancao
andauthored
Increase ShortBlockWindow to 30 due to decreased blocktimes (#3226)
Signed-off-by: Shrenuj Bansal <[email protected]> Co-authored-by: Kefan Cao <[email protected]>
1 parent e58cce2 commit adf3ad4

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

protocol/cmd/dydxprotocold/cmd/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ func initTendermintConfig() *tmcfg.Config {
101101
// a users rate limit if the entry is evicted from the mempool cache as it would be possible for the transaction
102102
// to go through `CheckTx` again causing it to hit rate limit code against the users account.
103103
cfg.Mempool.CacheSize = 5000 * int(clobtypes.ShortBlockWindow)
104-
cfg.Mempool.Size = 50000
105-
cfg.Mempool.TTLNumBlocks = 20 //nolint:staticcheck
104+
cfg.Mempool.Size = 100000
105+
cfg.Mempool.TTLNumBlocks = 40 //nolint:staticcheck
106106
cfg.Mempool.KeepInvalidTxsInCache = true
107107

108108
// Enable pex.

protocol/x/clob/e2e/app_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,13 @@ var (
7878
},
7979
testapp.DefaultGenesis(),
8080
))
81-
PlaceOrder_Alice_Num0_Id0_Clob0_Buy5_Price10_GTB27 = *clobtypes.NewMsgPlaceOrder(testapp.MustScaleOrder(
81+
PlaceOrder_Alice_Num0_Id0_Clob0_Buy5_Price10_GTB47 = *clobtypes.NewMsgPlaceOrder(testapp.MustScaleOrder(
8282
clobtypes.Order{
8383
OrderId: clobtypes.OrderId{SubaccountId: constants.Alice_Num0, ClientId: 0, ClobPairId: 0},
8484
Side: clobtypes.Order_SIDE_BUY,
8585
Quantums: 5,
8686
Subticks: 10,
87-
GoodTilOneof: &clobtypes.Order_GoodTilBlock{GoodTilBlock: 27},
87+
GoodTilOneof: &clobtypes.Order_GoodTilBlock{GoodTilBlock: 47},
8888
},
8989
testapp.DefaultGenesis(),
9090
))
@@ -175,13 +175,13 @@ var (
175175
},
176176
20,
177177
)
178-
CancelOrder_Alice_Num0_Id0_Clob0_GTB27 = *clobtypes.NewMsgCancelOrderShortTerm(
178+
CancelOrder_Alice_Num0_Id0_Clob0_GTB47 = *clobtypes.NewMsgCancelOrderShortTerm(
179179
clobtypes.OrderId{
180180
SubaccountId: constants.Alice_Num0,
181181
ClientId: 0,
182182
ClobPairId: 0,
183183
},
184-
27,
184+
47,
185185
)
186186
CancelOrder_Alice_Num0_Id0_Clob0_GTB23 = *clobtypes.NewMsgCancelOrderShortTerm(
187187
clobtypes.OrderId{
@@ -275,15 +275,15 @@ var (
275275
},
276276
5,
277277
)
278-
BatchCancel_Alice_Num0_Clob0_1_2_3_GTB27 = *clobtypes.NewMsgBatchCancel(
278+
BatchCancel_Alice_Num0_Clob0_1_2_3_GTB47 = *clobtypes.NewMsgBatchCancel(
279279
constants.Alice_Num0,
280280
[]clobtypes.OrderBatch{
281281
{
282282
ClobPairId: 0,
283283
ClientIds: []uint32{1, 2, 3},
284284
},
285285
},
286-
27,
286+
47,
287287
)
288288
BatchCancel_Alice_Num0_Clob0_1_2_3_GTB20 = *clobtypes.NewMsgBatchCancel(
289289
constants.Alice_Num0,

protocol/x/clob/e2e/rate_limit_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ func TestRateLimitingShortTermOrders_GuardedAgainstReplayAttacks(t *testing.T) {
706706
},
707707
},
708708
replayLessGTB: &PlaceOrder_Alice_Num0_Id0_Clob0_Buy5_Price10_GTB5,
709-
replayGreaterGTB: &PlaceOrder_Alice_Num0_Id0_Clob0_Buy5_Price10_GTB27,
709+
replayGreaterGTB: &PlaceOrder_Alice_Num0_Id0_Clob0_Buy5_Price10_GTB47,
710710
firstValidGTB: &PlaceOrder_Alice_Num0_Id0_Clob0_Buy5_Price10_GTB20,
711711
secondValidGTB: &PlaceOrder_Alice_Num0_Id0_Clob1_Buy5_Price10_GTB20,
712712
},
@@ -720,7 +720,7 @@ func TestRateLimitingShortTermOrders_GuardedAgainstReplayAttacks(t *testing.T) {
720720
},
721721
},
722722
replayLessGTB: &CancelOrder_Alice_Num0_Id0_Clob0_GTB5,
723-
replayGreaterGTB: &CancelOrder_Alice_Num0_Id0_Clob0_GTB27,
723+
replayGreaterGTB: &CancelOrder_Alice_Num0_Id0_Clob0_GTB47,
724724
firstValidGTB: &CancelOrder_Alice_Num0_Id0_Clob0_GTB20,
725725
secondValidGTB: &CancelOrder_Alice_Num0_Id1_Clob0_GTB20,
726726
},
@@ -734,7 +734,7 @@ func TestRateLimitingShortTermOrders_GuardedAgainstReplayAttacks(t *testing.T) {
734734
},
735735
},
736736
replayLessGTB: &BatchCancel_Alice_Num0_Clob0_1_2_3_GTB5,
737-
replayGreaterGTB: &BatchCancel_Alice_Num0_Clob0_1_2_3_GTB27,
737+
replayGreaterGTB: &BatchCancel_Alice_Num0_Clob0_1_2_3_GTB47,
738738
firstValidGTB: &BatchCancel_Alice_Num0_Clob0_1_2_3_GTB20,
739739
secondValidGTB: &BatchCancel_Alice_Num0_Clob1_1_2_3_GTB20,
740740
},

protocol/x/clob/types/constants.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66

77
// ShortBlockWindow represents the maximum number of blocks past the current block height that a
88
// `MsgPlaceOrder` or `MsgCancelOrder` message will be considered valid by the validator.
9-
const ShortBlockWindow uint32 = 20
9+
const ShortBlockWindow uint32 = 40
1010

1111
// MaxMsgBatchCancelBatchSize represents the maximum number of cancels that a MsgBatchCancel
1212
// can have in one Msg.

0 commit comments

Comments
 (0)