mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-29 20:51:45 +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
@ -950,22 +950,15 @@ func (cs *ConsensusState) createProposalBlock() (block *types.Block, blockParts
|
||||
|
||||
maxBytes := cs.state.ConsensusParams.BlockSize.MaxBytes
|
||||
// bound evidence to 1/10th of the block
|
||||
evidence := cs.evpool.PendingEvidence(maxBytes / 10)
|
||||
evidence := cs.evpool.PendingEvidence(types.MaxEvidenceBytesPerBlock(maxBytes))
|
||||
// Mempool validated transactions
|
||||
txs := cs.mempool.ReapMaxBytes(maxDataBytes(maxBytes, cs.state.Validators.Size(), len(evidence)))
|
||||
txs := cs.mempool.ReapMaxBytes(types.MaxDataBytes(maxBytes, cs.state.Validators.Size(), len(evidence)))
|
||||
proposerAddr := cs.privValidator.GetAddress()
|
||||
block, parts := cs.state.MakeBlock(cs.Height, txs, commit, evidence, proposerAddr)
|
||||
|
||||
return block, parts
|
||||
}
|
||||
|
||||
func maxDataBytes(maxBytes, valsCount, evidenceCount int) int {
|
||||
return maxBytes -
|
||||
types.MaxAminoOverheadForBlock -
|
||||
types.MaxHeaderBytes -
|
||||
(valsCount * types.MaxVoteBytes) -
|
||||
(evidenceCount * types.MaxEvidenceBytes)
|
||||
}
|
||||
|
||||
// Enter: `timeoutPropose` after entering Propose.
|
||||
// Enter: proposal block and POL is ready.
|
||||
|
Reference in New Issue
Block a user