mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-28 12:11:44 +00:00
Remove ConsensusParams.TxSize and ConsensusParams.BlockGossip (#2364)
* remove ConsensusParams.TxSize and ConsensusParams.BlockGossip Refs #2347 * block part size is now fixed Refs #2347 * use max data size, not max bytes for tx limit Refs #2347
This commit is contained in:
committed by
Ethan Buchman
parent
33b4617e9a
commit
0e1cd88863
@ -204,6 +204,28 @@ func (b *Block) StringShort() string {
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// MaxDataBytes returns the maximum size of block's data.
|
||||
func MaxDataBytes(maxBytes, valsCount, evidenceCount int) int {
|
||||
return maxBytes -
|
||||
MaxAminoOverheadForBlock -
|
||||
MaxHeaderBytes -
|
||||
(valsCount * MaxVoteBytes) -
|
||||
(evidenceCount * MaxEvidenceBytes)
|
||||
}
|
||||
|
||||
// MaxDataBytesUnknownEvidence returns the maximum size of block's data when
|
||||
// evidence count is unknown. MaxEvidenceBytesPerBlock will be used as the size
|
||||
// of evidence.
|
||||
func MaxDataBytesUnknownEvidence(maxBytes, valsCount int) int {
|
||||
return maxBytes -
|
||||
MaxAminoOverheadForBlock -
|
||||
MaxHeaderBytes -
|
||||
(valsCount * MaxVoteBytes) -
|
||||
MaxEvidenceBytesPerBlock(maxBytes)
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// Header defines the structure of a Tendermint block header
|
||||
// TODO: limit header size
|
||||
// NOTE: changes to the Header should be duplicated in the abci Header
|
||||
|
Reference in New Issue
Block a user