mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-10-14 00:59: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++
|
receivedChunkCount++
|
||||||
if receivedChunkCount%ibdBatchSize == 0 {
|
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)
|
receivedChunkCount, receivedUTXOCount)
|
||||||
|
|
||||||
requestNextPruningPointUTXOSetChunkMessage := appmessage.NewMsgRequestNextPruningPointUTXOSetChunk()
|
requestNextPruningPointUTXOSetChunkMessage := appmessage.NewMsgRequestNextPruningPointUTXOSetChunk()
|
||||||
|
@ -5,6 +5,7 @@ import (
|
|||||||
"github.com/kaspanet/kaspad/domain/dagconfig"
|
"github.com/kaspanet/kaspad/domain/dagconfig"
|
||||||
"github.com/kaspanet/kaspad/domain/miningmanager/blocktemplatebuilder"
|
"github.com/kaspanet/kaspad/domain/miningmanager/blocktemplatebuilder"
|
||||||
mempoolpkg "github.com/kaspanet/kaspad/domain/miningmanager/mempool"
|
mempoolpkg "github.com/kaspanet/kaspad/domain/miningmanager/mempool"
|
||||||
|
"github.com/pkg/errors"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
@ -21,7 +22,15 @@ func (f *factory) NewMiningManager(consensusReference consensusreference.Consens
|
|||||||
mempoolConfig *mempoolpkg.Config) MiningManager {
|
mempoolConfig *mempoolpkg.Config) MiningManager {
|
||||||
|
|
||||||
mempool := mempoolpkg.New(mempoolConfig, consensusReference)
|
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{
|
return &miningManager{
|
||||||
consensusReference: consensusReference,
|
consensusReference: consensusReference,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user