Add more comments about the hard-coded limits (#4100)

* crypto: expose MaxAunts for documentation purposes

* types: update godoc for new maxes

* docs: make hard-coded limits more explicit

* wal: add todo to clarify max size

* shorten lines in test
This commit is contained in:
Ethan Buchman
2019-11-01 15:16:53 -07:00
committed by Marko
parent b2475227a5
commit cbd5e031d6
9 changed files with 32 additions and 13 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ const (
// BlockPartSizeBytes is the size of one block part.
BlockPartSizeBytes = 65536 // 64kB
// MaxBlockPartsCount is the maximum count of block parts.
// MaxBlockPartsCount is the maximum number of block parts.
MaxBlockPartsCount = (MaxBlockSizeBytes / BlockPartSizeBytes) + 1
)
+2
View File
@@ -52,6 +52,8 @@ type ValidatorSet struct {
// the new ValidatorSet will have an empty list of Validators.
// The addresses of validators in `valz` must be unique otherwise the
// function panics.
// Note the validator set size has an implied limit equal to that of the MaxVotesCount -
// commits by a validator set larger than this will fail validation.
func NewValidatorSet(valz []*Validator) *ValidatorSet {
vals := &ValidatorSet{}
err := vals.updateWithChangeSet(valz, false)
+3 -2
View File
@@ -12,8 +12,9 @@ import (
)
const (
// MaxVotesCount is the maximum votes count. Used in ValidateBasic funcs for
// protection against DOS attacks.
// MaxVotesCount is the maximum number of votes in a set. Used in ValidateBasic funcs for
// protection against DOS attacks. Note this implies a corresponding equal limit to
// the number of validators.
MaxVotesCount = 10000
)