diff --git a/consensus/blake3pow/blake3pow.go b/consensus/blake3pow/blake3pow.go index 264950f7e3..7f91e9d9ea 100644 --- a/consensus/blake3pow/blake3pow.go +++ b/consensus/blake3pow/blake3pow.go @@ -41,7 +41,7 @@ const ( type Config struct { PowMode Mode - DurationLimit []*big.Int + DurationLimit *big.Int // When set, notifications sent by the remote sealer will // be block header JSON objects instead of work package arrays. diff --git a/consensus/blake3pow/consensus.go b/consensus/blake3pow/consensus.go index a04e0ae4ea..d05180f839 100644 --- a/consensus/blake3pow/consensus.go +++ b/consensus/blake3pow/consensus.go @@ -355,7 +355,7 @@ func (blake3pow *Blake3pow) CalcDifficulty(chain consensus.ChainHeaderReader, pa // (2 if len(parent_uncles) else 1) - (block_timestamp - parent_timestamp) // duration_limit x.Sub(bigTime, bigParentTime) - x.Div(x, blake3pow.config.DurationLimit[nodeCtx]) + x.Div(x, blake3pow.config.DurationLimit) if parent.UncleHash() == types.EmptyUncleHash { x.Sub(big1, x) } else { diff --git a/params/protocol_params.go b/params/protocol_params.go index 898c984e9f..f1b5065cc8 100644 --- a/params/protocol_params.go +++ b/params/protocol_params.go @@ -152,13 +152,13 @@ const ( ) var ( - DifficultyBoundDivisor = big.NewInt(2048) // The bound divisor of the difficulty, used in the update calculations. - ZoneMinDifficulty = big.NewInt(131072) // The minimum difficulty in a zone. Prime & regions should be multiples of this value - MinimumDifficulty = ZoneMinDifficulty // The minimum that the difficulty may ever be. - GenesisDifficulty = ZoneMinDifficulty // Difficulty of the Genesis block. - DurationLimit = []*big.Int{big.NewInt(1000), big.NewInt(100), big.NewInt(10)} // The decision boundary on the blocktime duration used to determine whether difficulty should go up or not. - GardenDurationLimit = []*big.Int{big.NewInt(150), big.NewInt(30), big.NewInt(3)} // The decision boundary on the blocktime duration used to determine whether difficulty should go up or not. - OrchardDurationLimit = []*big.Int{big.NewInt(150), big.NewInt(30), big.NewInt(3)} // The decision boundary on the blocktime duration used to determine whether difficulty should go up or not. - LocalDurationLimit = []*big.Int{big.NewInt(24), big.NewInt(7), big.NewInt(2)} // The decision boundary on the blocktime duration used to determine whether difficulty should go up or not. + DifficultyBoundDivisor = big.NewInt(2048) // The bound divisor of the difficulty, used in the update calculations. + ZoneMinDifficulty = big.NewInt(131072) // The minimum difficulty in a zone. Prime & regions should be multiples of this value + MinimumDifficulty = ZoneMinDifficulty // The minimum that the difficulty may ever be. + GenesisDifficulty = ZoneMinDifficulty // Difficulty of the Genesis block. + DurationLimit = big.NewInt(10) // The decision boundary on the blocktime duration used to determine whether difficulty should go up or not. + GardenDurationLimit = big.NewInt(3) // The decision boundary on the blocktime duration used to determine whether difficulty should go up or not. + OrchardDurationLimit = big.NewInt(3) // The decision boundary on the blocktime duration used to determine whether difficulty should go up or not. + LocalDurationLimit = big.NewInt(2) // The decision boundary on the blocktime duration used to determine whether difficulty should go up or not. TimeFactor = big.NewInt(7) )