Skip to content

Commit

Permalink
change the boc batch limit
Browse files Browse the repository at this point in the history
  • Loading branch information
zakhar-petukhov committed Jan 13, 2025
1 parent 08f8d92 commit 873cd2c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 11 deletions.
2 changes: 1 addition & 1 deletion api/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@
"format": "cell",
"type": "string"
},
"maxItems": 10,
"maxItems": 5,
"type": "array"
},
"boc": {
Expand Down
2 changes: 1 addition & 1 deletion api/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3180,7 +3180,7 @@ components:
format: cell
batch:
type: array
maxItems: 10
maxItems: 5
items:
type: string
format: cell
Expand Down
9 changes: 1 addition & 8 deletions pkg/api/event_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ import (
"github.com/tonkeeper/opentonapi/pkg/wallet"
)

const maxBatchSize = 5

var (
mempoolBatchSize = promauto.NewHistogram(prometheus.HistogramOpts{
Name: "mempool_messages_batch_size",
Expand Down Expand Up @@ -104,12 +102,7 @@ func (h *Handler) SendBlockchainMessage(ctx context.Context, request *oas.SendBl
h.blacklistedBocCache.Set(checksum, struct{}{}, cache.WithExpiration(time.Minute))
return nil
}
var (
copies []blockchain.ExtInMsgCopy
)
if len(request.Batch) > maxBatchSize {
return toError(http.StatusBadRequest, fmt.Errorf("batch size must be less than %v", maxBatchSize))
}
copies := make([]blockchain.ExtInMsgCopy, 0, len(request.Batch))
for _, msgBoc := range request.Batch {
m, err := decodeMessage(msgBoc)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/oas/oas_validators_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 873cd2c

Please sign in to comment.