mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-03-30 15:08:33 +00:00
Ignore header mass in devnet and testnet (#1879)
This commit is contained in:
parent
df573bba63
commit
f3d76d6565
@ -307,6 +307,7 @@ func (f *factory) NewConsensus(config *Config, db infrastructuredatabase.Databas
|
||||
config.MaxBlockParents,
|
||||
config.TimestampDeviationTolerance,
|
||||
config.TargetTimePerBlock,
|
||||
config.IgnoreHeaderMass,
|
||||
|
||||
dbManager,
|
||||
difficultyManager,
|
||||
|
@ -220,7 +220,9 @@ func (v *blockValidator) validateGasLimit(block *externalapi.DomainBlock) error
|
||||
|
||||
func (v *blockValidator) checkBlockMass(block *externalapi.DomainBlock) error {
|
||||
mass := uint64(0)
|
||||
mass += v.headerEstimatedSerializedSize(block.Header)
|
||||
if !v.ignoreHeaderMass {
|
||||
mass += v.headerEstimatedSerializedSize(block.Header)
|
||||
}
|
||||
|
||||
for _, transaction := range block.Transactions {
|
||||
v.transactionValidator.PopulateMass(transaction)
|
||||
|
@ -22,6 +22,7 @@ type blockValidator struct {
|
||||
maxBlockParents externalapi.KType
|
||||
timestampDeviationTolerance int
|
||||
targetTimePerBlock time.Duration
|
||||
ignoreHeaderMass bool
|
||||
|
||||
databaseContext model.DBReader
|
||||
difficultyManager model.DifficultyManager
|
||||
@ -58,6 +59,7 @@ func New(powMax *big.Int,
|
||||
maxBlockParents externalapi.KType,
|
||||
timestampDeviationTolerance int,
|
||||
targetTimePerBlock time.Duration,
|
||||
ignoreHeaderMass bool,
|
||||
|
||||
databaseContext model.DBReader,
|
||||
|
||||
@ -94,6 +96,7 @@ func New(powMax *big.Int,
|
||||
maxBlockMass: maxBlockMass,
|
||||
mergeSetSizeLimit: mergeSetSizeLimit,
|
||||
maxBlockParents: maxBlockParents,
|
||||
ignoreHeaderMass: ignoreHeaderMass,
|
||||
|
||||
timestampDeviationTolerance: timestampDeviationTolerance,
|
||||
targetTimePerBlock: targetTimePerBlock,
|
||||
|
@ -188,6 +188,8 @@ type Params struct {
|
||||
FixedSubsidySwitchHashRateThreshold *big.Int
|
||||
|
||||
DisallowDirectBlocksOnTopOfGenesis bool
|
||||
|
||||
IgnoreHeaderMass bool
|
||||
}
|
||||
|
||||
// NormalizeRPCServerAddress returns addr with the current network default
|
||||
@ -280,11 +282,11 @@ var MainnetParams = Params{
|
||||
// TestnetParams defines the network parameters for the test Kaspa network.
|
||||
var TestnetParams = Params{
|
||||
K: defaultGHOSTDAGK,
|
||||
Name: "kaspa-testnet-6",
|
||||
Name: "kaspa-testnet-7",
|
||||
Net: appmessage.Testnet,
|
||||
RPCPort: "16210",
|
||||
DefaultPort: "16211",
|
||||
DNSSeeds: []string{"testnet-6-dnsseed.daglabs-dev.com"},
|
||||
DNSSeeds: []string{"testnet-7-dnsseed.daglabs-dev.com"},
|
||||
|
||||
// DAG parameters
|
||||
GenesisBlock: &testnetGenesisBlock,
|
||||
@ -337,6 +339,7 @@ var TestnetParams = Params{
|
||||
PruningProofM: defaultPruningProofM,
|
||||
FixedSubsidySwitchPruningPointInterval: defaultFixedSubsidySwitchPruningPointInterval,
|
||||
FixedSubsidySwitchHashRateThreshold: big.NewInt(150_000_000_000),
|
||||
IgnoreHeaderMass: true,
|
||||
}
|
||||
|
||||
// SimnetParams defines the network parameters for the simulation test Kaspa
|
||||
@ -465,6 +468,7 @@ var DevnetParams = Params{
|
||||
PruningProofM: defaultPruningProofM,
|
||||
FixedSubsidySwitchPruningPointInterval: defaultFixedSubsidySwitchPruningPointInterval,
|
||||
FixedSubsidySwitchHashRateThreshold: big.NewInt(150_000_000_000),
|
||||
IgnoreHeaderMass: true,
|
||||
}
|
||||
|
||||
var (
|
||||
|
Loading…
x
Reference in New Issue
Block a user