From 8eff3a25f9f04a769e2fea2fa8d14b459b755d5e Mon Sep 17 00:00:00 2001 From: vyzo Date: Tue, 11 Aug 2020 12:43:44 +0300 Subject: [PATCH] use BlockGasLimit instead of residual for partitioning Signed-off-by: Jakub Sztandera --- chain/messagepool/selection.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/chain/messagepool/selection.go b/chain/messagepool/selection.go index 2e44c896e..aba54cd96 100644 --- a/chain/messagepool/selection.go +++ b/chain/messagepool/selection.go @@ -104,13 +104,12 @@ func (mp *MessagePool) selectMessagesOptimal(curTs, ts *types.TipSet, tq float64 } // 3. Parition chains into blocks (without trimming) - // we use the residual gas limit from the priority message selection as those message - // will be unconditionally included - residualGasLimit := gasLimit + // we use the full blockGasLimit (as opposed to the residual gas limit from the + // priority message selection) as we have to account for what other miners are doing nextChain := 0 partitions := make([][]*msgChain, MaxBlocks) for i := 0; i < MaxBlocks && nextChain < len(chains); i++ { - gasLimit := residualGasLimit + gasLimit := int64(build.BlockGasLimit) for nextChain < len(chains) { chain := chains[nextChain] partitions[i] = append(partitions[i], chain)