@@ -11,7 +11,6 @@ import (
11
11
"github.com/tendermint/tendermint/libs/bytes"
12
12
cmtmath "github.com/tendermint/tendermint/libs/math"
13
13
cmtquery "github.com/tendermint/tendermint/libs/pubsub/query"
14
- "github.com/tendermint/tendermint/pkg/consts"
15
14
ctypes "github.com/tendermint/tendermint/rpc/core/types"
16
15
rpctypes "github.com/tendermint/tendermint/rpc/jsonrpc/types"
17
16
blockidxnull "github.com/tendermint/tendermint/state/indexer/block/null"
@@ -333,6 +332,10 @@ func EncodeDataRootTuple(height uint64, dataRoot [32]byte) ([]byte, error) {
333
332
return append (paddedHeight , dataRoot [:]... ), nil
334
333
}
335
334
335
+ // dataCommitmentBlocksLimit The maximum number of blocks to be used to create a data commitment.
336
+ // It's a local parameter to protect the API from creating unnecessarily large commitments.
337
+ const dataCommitmentBlocksLimit = 10_000 // ~33 hours of blocks assuming 12-second blocks.
338
+
336
339
// validateDataCommitmentRange runs basic checks on the asc sorted list of
337
340
// heights that will be used subsequently in generating data commitments over
338
341
// the defined set of heights.
@@ -342,8 +345,8 @@ func validateDataCommitmentRange(start uint64, end uint64) error {
342
345
}
343
346
env := GetEnvironment ()
344
347
heightsRange := end - start
345
- if heightsRange > uint64 (consts . DataCommitmentBlocksLimit ) {
346
- return fmt .Errorf ("the query exceeds the limit of allowed blocks %d" , consts . DataCommitmentBlocksLimit )
348
+ if heightsRange > uint64 (dataCommitmentBlocksLimit ) {
349
+ return fmt .Errorf ("the query exceeds the limit of allowed blocks %d" , dataCommitmentBlocksLimit )
347
350
}
348
351
if heightsRange == 0 {
349
352
return fmt .Errorf ("cannot create the data commitments for an empty set of blocks" )
0 commit comments