mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-03-30 15:08:33 +00:00
Decrement estimatedHeaderUpperBound from mempool's MaxBlockMass (#2009)
This commit is contained in:
parent
a4669f3fb5
commit
99bb21c512
@ -567,7 +567,7 @@ func (flow *handleIBDFlow) receiveAndInsertPruningPointUTXOSet(
|
||||
|
||||
receivedChunkCount++
|
||||
if receivedChunkCount%ibdBatchSize == 0 {
|
||||
log.Debugf("Received %d UTXO set chunks so far, totaling in %d UTXOs",
|
||||
log.Infof("Received %d UTXO set chunks so far, totaling in %d UTXOs",
|
||||
receivedChunkCount, receivedUTXOCount)
|
||||
|
||||
requestNextPruningPointUTXOSetChunkMessage := appmessage.NewMsgRequestNextPruningPointUTXOSetChunk()
|
||||
|
@ -5,6 +5,7 @@ import (
|
||||
"github.com/kaspanet/kaspad/domain/dagconfig"
|
||||
"github.com/kaspanet/kaspad/domain/miningmanager/blocktemplatebuilder"
|
||||
mempoolpkg "github.com/kaspanet/kaspad/domain/miningmanager/mempool"
|
||||
"github.com/pkg/errors"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
@ -21,7 +22,15 @@ func (f *factory) NewMiningManager(consensusReference consensusreference.Consens
|
||||
mempoolConfig *mempoolpkg.Config) MiningManager {
|
||||
|
||||
mempool := mempoolpkg.New(mempoolConfig, consensusReference)
|
||||
blockTemplateBuilder := blocktemplatebuilder.New(consensusReference, mempool, params.MaxBlockMass, params.CoinbasePayloadScriptPublicKeyMaxLength)
|
||||
// In the current pruning window (according to 06/04/2022) the header with the most mass weighted 5294 grams.
|
||||
// We take a 10x factor for safety.
|
||||
// TODO: Remove this behaviour once `ignoreHeaderMass` is set to true in all networks.
|
||||
const estimatedHeaderUpperBound = 60000
|
||||
if estimatedHeaderUpperBound > params.MaxBlockMass {
|
||||
panic(errors.Errorf("Estimated header mass upper bound is higher than the max block mass allowed"))
|
||||
}
|
||||
maxBlockMass := params.MaxBlockMass - estimatedHeaderUpperBound
|
||||
blockTemplateBuilder := blocktemplatebuilder.New(consensusReference, mempool, maxBlockMass, params.CoinbasePayloadScriptPublicKeyMaxLength)
|
||||
|
||||
return &miningManager{
|
||||
consensusReference: consensusReference,
|
||||
|
Loading…
x
Reference in New Issue
Block a user