Skip to content

Commit 873cd2c

Browse files
change the boc batch limit
1 parent 08f8d92 commit 873cd2c

File tree

4 files changed

+4
-11
lines changed

4 files changed

+4
-11
lines changed

api/openapi.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@
424424
"format": "cell",
425425
"type": "string"
426426
},
427-
"maxItems": 10,
427+
"maxItems": 5,
428428
"type": "array"
429429
},
430430
"boc": {

api/openapi.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3180,7 +3180,7 @@ components:
31803180
format: cell
31813181
batch:
31823182
type: array
3183-
maxItems: 10
3183+
maxItems: 5
31843184
items:
31853185
type: string
31863186
format: cell

pkg/api/event_handlers.go

+1-8
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ import (
2929
"github.com/tonkeeper/opentonapi/pkg/wallet"
3030
)
3131

32-
const maxBatchSize = 5
33-
3432
var (
3533
mempoolBatchSize = promauto.NewHistogram(prometheus.HistogramOpts{
3634
Name: "mempool_messages_batch_size",
@@ -104,12 +102,7 @@ func (h *Handler) SendBlockchainMessage(ctx context.Context, request *oas.SendBl
104102
h.blacklistedBocCache.Set(checksum, struct{}{}, cache.WithExpiration(time.Minute))
105103
return nil
106104
}
107-
var (
108-
copies []blockchain.ExtInMsgCopy
109-
)
110-
if len(request.Batch) > maxBatchSize {
111-
return toError(http.StatusBadRequest, fmt.Errorf("batch size must be less than %v", maxBatchSize))
112-
}
105+
copies := make([]blockchain.ExtInMsgCopy, 0, len(request.Batch))
113106
for _, msgBoc := range request.Batch {
114107
m, err := decodeMessage(msgBoc)
115108
if err != nil {

pkg/oas/oas_validators_gen.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)