cs: limit max bit array size and block parts count

This commit is contained in:
Anton Kaliaev
2019-10-29 11:00:56 -07:00
committed by Jack Zampolin
parent c207fa6eff
commit c38dbdb640
3 changed files with 18 additions and 0 deletions
+3
View File
@@ -14,6 +14,9 @@ const (
// BlockPartSizeBytes is the size of one block part.
BlockPartSizeBytes = 65536 // 64kB
// MaxBlockPartsCount is the maximum count of block parts.
MaxBlockPartsCount = MaxBlockSizeBytes / BlockPartSizeBytes
)
// ConsensusParams contains consensus critical parameters that determine the
+6
View File
@@ -11,6 +11,12 @@ import (
cmn "github.com/tendermint/tendermint/libs/common"
)
const (
// MaxVotesCount is the maximum votes count. Used in ValidateBasic funcs for
// protection against DOS attacks.
MaxVotesCount = 10000
)
// UNSTABLE
// XXX: duplicate of p2p.ID to avoid dependence between packages.
// Perhaps we can have a minimal types package containing this (and other things?)