mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-10 15:07:24 +00:00
evidence: cap evidence to an absolute number (#4780)
The number of evidence that can be committed in a single block is capped by a new evidence parameter called MaxNum
This commit is contained in:
@@ -146,6 +146,7 @@ type EvidenceParams struct {
|
||||
// Note: must be greater than 0
|
||||
MaxAgeNumBlocks int64 `protobuf:"varint,1,opt,name=max_age_num_blocks,json=maxAgeNumBlocks,proto3" json:"max_age_num_blocks,omitempty"`
|
||||
MaxAgeDuration time.Duration `protobuf:"bytes,2,opt,name=max_age_duration,json=maxAgeDuration,proto3,stdduration" json:"max_age_duration"`
|
||||
MaxNumEvidence uint32 `protobuf:"varint,1,opt,name=max_num_evidence,json=maxNumEvidence,proto3" json:"max_num_evidence,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
@@ -189,6 +190,13 @@ func (m *EvidenceParams) GetMaxAgeDuration() time.Duration {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *EvidenceParams) GetMaxNumEvidence() uint32 {
|
||||
if m != nil {
|
||||
return m.MaxNumEvidence
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// ValidatorParams restrict the public key types validators can use.
|
||||
// NOTE: uses ABCI pubkey naming, not Amino names.
|
||||
type ValidatorParams struct {
|
||||
|
||||
@@ -33,6 +33,7 @@ message EvidenceParams {
|
||||
int64 max_age_num_blocks = 1;
|
||||
google.protobuf.Duration max_age_duration = 2
|
||||
[(gogoproto.nullable) = false, (gogoproto.stdduration) = true];
|
||||
uint32 max_num = 3;
|
||||
}
|
||||
|
||||
// ValidatorParams restrict the public key types validators can use.
|
||||
|
||||
Reference in New Issue
Block a user