use BlockGasLimit instead of residual for partitioning

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
vyzo 2020-08-11 12:43:44 +03:00 committed by Jakub Sztandera
parent 28fe602a9b
commit 8eff3a25f9
No known key found for this signature in database
GPG Key ID: 9A9AF56F8B3879BA

View File

@ -104,13 +104,12 @@ func (mp *MessagePool) selectMessagesOptimal(curTs, ts *types.TipSet, tq float64
} }
// 3. Parition chains into blocks (without trimming) // 3. Parition chains into blocks (without trimming)
// we use the residual gas limit from the priority message selection as those message // we use the full blockGasLimit (as opposed to the residual gas limit from the
// will be unconditionally included // priority message selection) as we have to account for what other miners are doing
residualGasLimit := gasLimit
nextChain := 0 nextChain := 0
partitions := make([][]*msgChain, MaxBlocks) partitions := make([][]*msgChain, MaxBlocks)
for i := 0; i < MaxBlocks && nextChain < len(chains); i++ { for i := 0; i < MaxBlocks && nextChain < len(chains); i++ {
gasLimit := residualGasLimit gasLimit := int64(build.BlockGasLimit)
for nextChain < len(chains) { for nextChain < len(chains) {
chain := chains[nextChain] chain := chains[nextChain]
partitions[i] = append(partitions[i], chain) partitions[i] = append(partitions[i], chain)