mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-29 04:31:44 +00:00
Bucky/fix evidence halt (#34)
* consensus: createProposalBlock function * blockExecutor.CreateProposalBlock - factored out of consensus pkg into a method on blockExec - new private interfaces for mempool ("txNotifier") and evpool with one function each - consensus tests still require more mempool methods * failing test for CreateProposalBlock * Fix bug in include evidece into block * evidence: change maxBytes to maxSize * MaxEvidencePerBlock - changed to return both the max number and the max bytes - preparation for #2590 * changelog * fix linter * Fix from review Co-Authored-By: ebuchman <ethan@coinculture.info>
This commit is contained in:
@ -133,10 +133,11 @@ func validateBlock(stateDB dbm.DB, state State, block *types.Block) error {
|
||||
}
|
||||
|
||||
// Limit the amount of evidence
|
||||
maxEvidenceBytes := types.MaxEvidenceBytesPerBlock(state.ConsensusParams.BlockSize.MaxBytes)
|
||||
evidenceBytes := int64(len(block.Evidence.Evidence)) * types.MaxEvidenceBytes
|
||||
if evidenceBytes > maxEvidenceBytes {
|
||||
return types.NewErrEvidenceOverflow(maxEvidenceBytes, evidenceBytes)
|
||||
maxNumEvidence, _ := types.MaxEvidencePerBlock(state.ConsensusParams.BlockSize.MaxBytes)
|
||||
numEvidence := int64(len(block.Evidence.Evidence))
|
||||
if numEvidence > maxNumEvidence {
|
||||
return types.NewErrEvidenceOverflow(maxNumEvidence, numEvidence)
|
||||
|
||||
}
|
||||
|
||||
// Validate all evidence.
|
||||
|
Reference in New Issue
Block a user