mirror of https://github.com/poanetwork/quorum.git
increased the minimum gas limit for the network
This commit is contained in:
parent
df4267a256
commit
d78cd97995
|
@ -107,12 +107,12 @@ func (v *BlockValidator) ValidateState(block, parent *types.Block, statedb *stat
|
|||
// The result may be modified by the caller.
|
||||
// This is miner strategy, not consensus protocol.
|
||||
func CalcGasLimit(parent *types.Block) *big.Int {
|
||||
// contrib = (parentGasUsed * 3 / 2) / 1024
|
||||
// contrib = (parentGasUsed * 3 / 2) / 4096
|
||||
contrib := new(big.Int).Mul(parent.GasUsed(), big.NewInt(3))
|
||||
contrib = contrib.Div(contrib, big.NewInt(2))
|
||||
contrib = contrib.Div(contrib, params.GasLimitBoundDivisor)
|
||||
|
||||
// decay = parentGasLimit / 1024 -1
|
||||
// decay = parentGasLimit / 4096 - 1
|
||||
decay := new(big.Int).Div(parent.GasLimit(), params.GasLimitBoundDivisor)
|
||||
decay.Sub(decay, big.NewInt(1))
|
||||
|
||||
|
@ -128,7 +128,7 @@ func CalcGasLimit(parent *types.Block) *big.Int {
|
|||
gl.Set(math.BigMax(gl, params.MinGasLimit))
|
||||
|
||||
// however, if we're now below the target (TargetGasLimit) we increase the
|
||||
// limit as much as we can (parentGasLimit / 1024 -1)
|
||||
// limit as much as we can (parentGasLimit / 4096 -1)
|
||||
if gl.Cmp(params.TargetGasLimit) < 0 {
|
||||
gl.Add(parent.GasLimit(), decay)
|
||||
gl.Set(math.BigMin(gl, params.TargetGasLimit))
|
||||
|
|
|
@ -74,9 +74,9 @@ const (
|
|||
)
|
||||
|
||||
var (
|
||||
GasLimitBoundDivisor = big.NewInt(1024) // The bound divisor of the gas limit, used in update calculations.
|
||||
MinGasLimit = big.NewInt(5000) // Minimum the gas limit may ever be.
|
||||
GenesisGasLimit = big.NewInt(4712388) // Gas limit of the Genesis block.
|
||||
GasLimitBoundDivisor = big.NewInt(4096) // The bound divisor of the gas limit, used in update calculations.
|
||||
MinGasLimit = big.NewInt(700000000) // Minimum the gas limit may ever be.
|
||||
GenesisGasLimit = big.NewInt(800000000) // Gas limit of the Genesis block.
|
||||
TargetGasLimit = new(big.Int).Set(GenesisGasLimit) // The artificial target
|
||||
DifficultyBoundDivisor = big.NewInt(2048) // The bound divisor of the difficulty, used in the update calculations.
|
||||
GenesisDifficulty = big.NewInt(131072) // Difficulty of the Genesis block.
|
||||
|
|
|
@ -28,7 +28,7 @@ const (
|
|||
|
||||
QuorumVersionMajor = 2
|
||||
QuorumVersionMinor = 0
|
||||
QuorumVersionPatch = 1
|
||||
QuorumVersionPatch = 2
|
||||
)
|
||||
|
||||
// Version holds the textual version string.
|
||||
|
|
Loading…
Reference in New Issue