@ -33,7 +33,7 @@ func VerifyEip1559Header(config *params.ChainConfig, parent, header *types.Heade
// Verify that the gas limit remains within allowed bounds
// Verify that the gas limit remains within allowed bounds
parentGasLimit := parent . GasLimit
parentGasLimit := parent . GasLimit
if ! config . IsLondon ( parent . Number ) {
if ! config . IsLondon ( parent . Number ) {
parentGasLimit = parent . GasLimit * params . ElasticityMultiplier
parentGasLimit = parent . GasLimit * config . ElasticityMultiplier ( )
}
}
if err := VerifyGaslimit ( parentGasLimit , header . GasLimit ) ; err != nil {
if err := VerifyGaslimit ( parentGasLimit , header . GasLimit ) ; err != nil {
return err
return err
@ -58,7 +58,7 @@ func CalcBaseFee(config *params.ChainConfig, parent *types.Header) *big.Int {
return new ( big . Int ) . SetUint64 ( params . InitialBaseFee )
return new ( big . Int ) . SetUint64 ( params . InitialBaseFee )
}
}
parentGasTarget := parent . GasLimit / params . ElasticityMultiplier
parentGasTarget := parent . GasLimit / config . ElasticityMultiplier ( )
// If the parent gasUsed is the same as the target, the baseFee remains unchanged.
// If the parent gasUsed is the same as the target, the baseFee remains unchanged.
if parent . GasUsed == parentGasTarget {
if parent . GasUsed == parentGasTarget {
return new ( big . Int ) . Set ( parent . BaseFee )
return new ( big . Int ) . Set ( parent . BaseFee )
@ -75,7 +75,7 @@ func CalcBaseFee(config *params.ChainConfig, parent *types.Header) *big.Int {
num . SetUint64 ( parent . GasUsed - parentGasTarget )
num . SetUint64 ( parent . GasUsed - parentGasTarget )
num . Mul ( num , parent . BaseFee )
num . Mul ( num , parent . BaseFee )
num . Div ( num , denom . SetUint64 ( parentGasTarget ) )
num . Div ( num , denom . SetUint64 ( parentGasTarget ) )
num . Div ( num , denom . SetUint64 ( params . BaseFeeChangeDenominator ) )
num . Div ( num , denom . SetUint64 ( config . BaseFeeChangeDenominator ( ) ) )
baseFeeDelta := math . BigMax ( num , common . Big1 )
baseFeeDelta := math . BigMax ( num , common . Big1 )
return num . Add ( parent . BaseFee , baseFeeDelta )
return num . Add ( parent . BaseFee , baseFeeDelta )
@ -85,7 +85,7 @@ func CalcBaseFee(config *params.ChainConfig, parent *types.Header) *big.Int {
num . SetUint64 ( parentGasTarget - parent . GasUsed )
num . SetUint64 ( parentGasTarget - parent . GasUsed )
num . Mul ( num , parent . BaseFee )
num . Mul ( num , parent . BaseFee )
num . Div ( num , denom . SetUint64 ( parentGasTarget ) )
num . Div ( num , denom . SetUint64 ( parentGasTarget ) )
num . Div ( num , denom . SetUint64 ( params . BaseFeeChangeDenominator ) )
num . Div ( num , denom . SetUint64 ( config . BaseFeeChangeDenominator ( ) ) )
baseFee := num . Sub ( parent . BaseFee , num )
baseFee := num . Sub ( parent . BaseFee , num )
return math . BigMax ( baseFee , common . Big0 )
return math . BigMax ( baseFee , common . Big0 )