change TARGET_GASUSED from 8m to 10m
This commit is contained in:
@@ -563,7 +563,7 @@ func TestCalcGasLimitAndBaseFee(t *testing.T) {
|
||||
new(big.Int).SetUint64(params.EIP1559ForkBlockNumber),
|
||||
nil,
|
||||
8000000,
|
||||
8000000,
|
||||
10000000,
|
||||
new(big.Int).SetUint64(params.EIP1559InitialBaseFee),
|
||||
new(big.Int).SetUint64((params.EIP1559ForkBlockNumber + (params.EIP1559ForkFinalizedBlockNumber-params.EIP1559ForkBlockNumber)/2) - 1),
|
||||
(params.MaxGasEIP1559 * 3) / 4,
|
||||
@@ -578,14 +578,14 @@ func TestCalcGasLimitAndBaseFee(t *testing.T) {
|
||||
new(big.Int).SetUint64(params.EIP1559InitialBaseFee),
|
||||
new(big.Int).SetUint64((params.EIP1559ForkBlockNumber + (params.EIP1559ForkFinalizedBlockNumber-params.EIP1559ForkBlockNumber)/2) - 1),
|
||||
(params.MaxGasEIP1559 * 3) / 4,
|
||||
new(big.Int).SetUint64(984375000),
|
||||
new(big.Int).SetUint64(962500000),
|
||||
},
|
||||
{
|
||||
params.EIP1559ChainConfig,
|
||||
new(big.Int).SetUint64(params.EIP1559ForkBlockNumber),
|
||||
nil,
|
||||
8000000,
|
||||
8000000,
|
||||
10000000,
|
||||
big.NewInt(1100000000),
|
||||
new(big.Int).SetUint64((params.EIP1559ForkBlockNumber + (params.EIP1559ForkFinalizedBlockNumber-params.EIP1559ForkBlockNumber)/2) - 1),
|
||||
(params.MaxGasEIP1559 * 3) / 4,
|
||||
@@ -596,11 +596,11 @@ func TestCalcGasLimitAndBaseFee(t *testing.T) {
|
||||
new(big.Int).SetUint64(params.EIP1559ForkBlockNumber),
|
||||
nil,
|
||||
8000000,
|
||||
7000000,
|
||||
9000000,
|
||||
big.NewInt(1100000000),
|
||||
new(big.Int).SetUint64((params.EIP1559ForkBlockNumber + (params.EIP1559ForkFinalizedBlockNumber-params.EIP1559ForkBlockNumber)/2) - 1),
|
||||
(params.MaxGasEIP1559 * 3) / 4,
|
||||
new(big.Int).SetUint64(1082812500),
|
||||
new(big.Int).SetUint64(1086250000),
|
||||
},
|
||||
// At and beyond EIP1559 finalization the GasLimit (for the EIP1559 pool) is the entire MaxGasEIP1559
|
||||
{
|
||||
@@ -608,22 +608,22 @@ func TestCalcGasLimitAndBaseFee(t *testing.T) {
|
||||
new(big.Int).SetUint64(params.EIP1559ForkBlockNumber),
|
||||
new(big.Int).SetUint64(params.EIP1559ForkFinalizedBlockNumber),
|
||||
8000000,
|
||||
7000000,
|
||||
big.NewInt(1082812500),
|
||||
9000000,
|
||||
big.NewInt(1086250000),
|
||||
new(big.Int).SetUint64(params.EIP1559ForkFinalizedBlockNumber - 1),
|
||||
params.MaxGasEIP1559,
|
||||
new(big.Int).SetUint64(1065893554),
|
||||
new(big.Int).SetUint64(1072671875),
|
||||
},
|
||||
{
|
||||
params.EIP1559FinalizedChainConfig,
|
||||
new(big.Int).SetUint64(params.EIP1559ForkBlockNumber),
|
||||
new(big.Int).SetUint64(params.EIP1559ForkFinalizedBlockNumber),
|
||||
8000000,
|
||||
7000000,
|
||||
big.NewInt(1065893554),
|
||||
9000000,
|
||||
big.NewInt(1072671875),
|
||||
new(big.Int).SetUint64(params.EIP1559ForkFinalizedBlockNumber + 1),
|
||||
params.MaxGasEIP1559,
|
||||
new(big.Int).SetUint64(1049238967),
|
||||
new(big.Int).SetUint64(1059263476),
|
||||
},
|
||||
{
|
||||
params.EIP1559FinalizedChainConfig,
|
||||
@@ -631,10 +631,10 @@ func TestCalcGasLimitAndBaseFee(t *testing.T) {
|
||||
new(big.Int).SetUint64(params.EIP1559ForkFinalizedBlockNumber),
|
||||
8000000,
|
||||
params.TargetGasUsed + 1000,
|
||||
big.NewInt(1049238967),
|
||||
big.NewInt(1059263476),
|
||||
new(big.Int).SetUint64(params.EIP1559ForkFinalizedBlockNumber + 10000),
|
||||
params.MaxGasEIP1559,
|
||||
new(big.Int).SetUint64(1049255361),
|
||||
new(big.Int).SetUint64(1059276716),
|
||||
},
|
||||
{
|
||||
params.EIP1559FinalizedChainConfig,
|
||||
@@ -642,10 +642,10 @@ func TestCalcGasLimitAndBaseFee(t *testing.T) {
|
||||
new(big.Int).SetUint64(params.EIP1559ForkFinalizedBlockNumber),
|
||||
8000000,
|
||||
params.MaxGasEIP1559,
|
||||
big.NewInt(1049238967),
|
||||
big.NewInt(1059276716),
|
||||
new(big.Int).SetUint64(params.EIP1559ForkFinalizedBlockNumber + 10000),
|
||||
params.MaxGasEIP1559,
|
||||
new(big.Int).SetUint64(1180393837),
|
||||
new(big.Int).SetUint64(1138722469),
|
||||
},
|
||||
{
|
||||
params.EIP1559FinalizedChainConfig,
|
||||
|
||||
@@ -142,11 +142,10 @@ const (
|
||||
|
||||
EIP1559InitialBaseFee uint64 = 1000000000 // Wei used as the initial BaseFee
|
||||
EIP1559ForkBlockNumber uint64 = 100000000 // TBD
|
||||
EIP1559ForkFinalizedBlockNumber = EIP1559ForkBlockNumber + (MaxGasEIP1559 / (10 * SlackCoefficient))
|
||||
EIP1559ForkFinalizedBlockNumber = EIP1559ForkBlockNumber + (MaxGasEIP1559 / 20)
|
||||
BaseFeeMaxChangeDenominator uint64 = 8
|
||||
SlackCoefficient uint64 = 2
|
||||
TargetGasUsed uint64 = 8000000
|
||||
MaxGasEIP1559 = SlackCoefficient * TargetGasUsed
|
||||
TargetGasUsed uint64 = 10000000
|
||||
MaxGasEIP1559 = 16000000
|
||||
EIP1559DecayRange = EIP1559ForkFinalizedBlockNumber - EIP1559ForkBlockNumber
|
||||
EIP1559GasIncrementAmount = (MaxGasEIP1559 / 2) / EIP1559DecayRange // We need to shift (MaxGasEIP1559 / 2) gas from the legacy pool into the EIP1559 pool over the EIP1559DecayRange
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user