mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 02:40:45 +00:00
test(params): move params.V2TestsGasLimit to engine_v2_tests package (#2028)
- V2TestsGasLimit should be changed to const - V2TestsGasLimit is only used by engine_v2_tests package
This commit is contained in:
parent
2e2d12304e
commit
872c1248f3
4 changed files with 18 additions and 21 deletions
|
|
@ -37,6 +37,8 @@ type signersList map[string]bool
|
||||||
|
|
||||||
const GAP = int(450)
|
const GAP = int(450)
|
||||||
|
|
||||||
|
const testGasLimit uint64 = 1200000000 // The gas limit used in the v2 consensus tests
|
||||||
|
|
||||||
var (
|
var (
|
||||||
acc1Key, _ = crypto.HexToECDSA("8a1f9a8f95be41cd7ccb6168179afb4504aefe388d1e14474d32c45c72ce7b7a")
|
acc1Key, _ = crypto.HexToECDSA("8a1f9a8f95be41cd7ccb6168179afb4504aefe388d1e14474d32c45c72ce7b7a")
|
||||||
acc2Key, _ = crypto.HexToECDSA("49a7b37aa6f6645917e7b807e9d1c00d4fa71f18343b0d4122a4d2df64dd6fee")
|
acc2Key, _ = crypto.HexToECDSA("49a7b37aa6f6645917e7b807e9d1c00d4fa71f18343b0d4122a4d2df64dd6fee")
|
||||||
|
|
@ -872,7 +874,7 @@ func createBlockFromHeader(bc *core.BlockChain, customHeader *types.Header, txs
|
||||||
Coinbase: customHeader.Coinbase,
|
Coinbase: customHeader.Coinbase,
|
||||||
Difficulty: difficulty,
|
Difficulty: difficulty,
|
||||||
Number: customHeader.Number,
|
Number: customHeader.Number,
|
||||||
GasLimit: params.V2TestsGasLimit,
|
GasLimit: testGasLimit,
|
||||||
Time: uint64(time.Now().Unix() - 1000000 + int64(customHeader.Number.Uint64()*10)),
|
Time: uint64(time.Now().Unix() - 1000000 + int64(customHeader.Number.Uint64()*10)),
|
||||||
Extra: customHeader.Extra,
|
Extra: customHeader.Extra,
|
||||||
Validator: customHeader.Validator,
|
Validator: customHeader.Validator,
|
||||||
|
|
|
||||||
|
|
@ -150,7 +150,7 @@ func TestPrepareFail(t *testing.T) {
|
||||||
notReadyToProposeHeader := &types.Header{
|
notReadyToProposeHeader := &types.Header{
|
||||||
ParentHash: currentBlock.Hash(),
|
ParentHash: currentBlock.Hash(),
|
||||||
Number: big.NewInt(int64(901)),
|
Number: big.NewInt(int64(901)),
|
||||||
GasLimit: params.V2TestsGasLimit,
|
GasLimit: testGasLimit,
|
||||||
Time: tstamp,
|
Time: tstamp,
|
||||||
Coinbase: signer,
|
Coinbase: signer,
|
||||||
}
|
}
|
||||||
|
|
@ -161,7 +161,7 @@ func TestPrepareFail(t *testing.T) {
|
||||||
notReadyToMine := &types.Header{
|
notReadyToMine := &types.Header{
|
||||||
ParentHash: currentBlock.Hash(),
|
ParentHash: currentBlock.Hash(),
|
||||||
Number: big.NewInt(int64(901)),
|
Number: big.NewInt(int64(901)),
|
||||||
GasLimit: params.V2TestsGasLimit,
|
GasLimit: testGasLimit,
|
||||||
Time: tstamp,
|
Time: tstamp,
|
||||||
Coinbase: signer,
|
Coinbase: signer,
|
||||||
}
|
}
|
||||||
|
|
@ -175,7 +175,7 @@ func TestPrepareFail(t *testing.T) {
|
||||||
header901WithoutCoinbase := &types.Header{
|
header901WithoutCoinbase := &types.Header{
|
||||||
ParentHash: currentBlock.Hash(),
|
ParentHash: currentBlock.Hash(),
|
||||||
Number: big.NewInt(int64(901)),
|
Number: big.NewInt(int64(901)),
|
||||||
GasLimit: params.V2TestsGasLimit,
|
GasLimit: testGasLimit,
|
||||||
Time: tstamp,
|
Time: tstamp,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -196,7 +196,7 @@ func TestPrepareHappyPath(t *testing.T) {
|
||||||
header901 := &types.Header{
|
header901 := &types.Header{
|
||||||
ParentHash: currentBlock.Hash(),
|
ParentHash: currentBlock.Hash(),
|
||||||
Number: big.NewInt(int64(901)),
|
Number: big.NewInt(int64(901)),
|
||||||
GasLimit: params.V2TestsGasLimit,
|
GasLimit: testGasLimit,
|
||||||
Time: tstamp,
|
Time: tstamp,
|
||||||
Coinbase: signer,
|
Coinbase: signer,
|
||||||
}
|
}
|
||||||
|
|
@ -276,7 +276,7 @@ func TestUpdateMultipleMasterNodes(t *testing.T) {
|
||||||
header1800 := &types.Header{
|
header1800 := &types.Header{
|
||||||
ParentHash: parentBlock.Hash(),
|
ParentHash: parentBlock.Hash(),
|
||||||
Number: big.NewInt(int64(1800)),
|
Number: big.NewInt(int64(1800)),
|
||||||
GasLimit: params.V2TestsGasLimit,
|
GasLimit: testGasLimit,
|
||||||
Time: tstamp,
|
Time: tstamp,
|
||||||
Coinbase: voterAddr,
|
Coinbase: voterAddr,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ func TestHookPenaltyV2Mining(t *testing.T) {
|
||||||
headerMining := &types.Header{
|
headerMining := &types.Header{
|
||||||
ParentHash: header2100.ParentHash,
|
ParentHash: header2100.ParentHash,
|
||||||
Number: header2100.Number,
|
Number: header2100.Number,
|
||||||
GasLimit: params.V2TestsGasLimit,
|
GasLimit: testGasLimit,
|
||||||
Time: header2100.Time,
|
Time: header2100.Time,
|
||||||
Coinbase: acc1Addr,
|
Coinbase: acc1Addr,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,11 +18,6 @@ package params
|
||||||
|
|
||||||
import "math/big"
|
import "math/big"
|
||||||
|
|
||||||
var (
|
|
||||||
TargetGasLimit uint64 = XDCGenesisGasLimit // The artificial target
|
|
||||||
V2TestsGasLimit uint64 = 1200000000 // The gas limit used in the v2 consensus tests
|
|
||||||
)
|
|
||||||
|
|
||||||
const (
|
const (
|
||||||
GasLimitBoundDivisor uint64 = 1024 // The bound divisor of the gas limit, used in update calculations.
|
GasLimitBoundDivisor uint64 = 1024 // The bound divisor of the gas limit, used in update calculations.
|
||||||
MinGasLimit uint64 = 5000 // Minimum the gas limit may ever be.
|
MinGasLimit uint64 = 5000 // Minimum the gas limit may ever be.
|
||||||
|
|
@ -97,16 +92,7 @@ const (
|
||||||
// up to half the consumed gas could be refunded. Redefined as 1/5th in EIP-3529
|
// up to half the consumed gas could be refunded. Redefined as 1/5th in EIP-3529
|
||||||
RefundQuotient uint64 = 2
|
RefundQuotient uint64 = 2
|
||||||
RefundQuotientEIP3529 uint64 = 5
|
RefundQuotientEIP3529 uint64 = 5
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
DifficultyBoundDivisor = big.NewInt(2048) // The bound divisor of the difficulty, used in the update calculations.
|
|
||||||
GenesisDifficulty = big.NewInt(131072) // Difficulty of the Genesis block.
|
|
||||||
MinimumDifficulty = big.NewInt(131072) // The minimum that the difficulty may ever be.
|
|
||||||
DurationLimit = big.NewInt(13) // The decision boundary on the blocktime duration used to determine whether difficulty should go up or not.
|
|
||||||
)
|
|
||||||
|
|
||||||
const (
|
|
||||||
NetSstoreNoopGas uint64 = 200 // Once per SSTORE operation if the value doesn't change.
|
NetSstoreNoopGas uint64 = 200 // Once per SSTORE operation if the value doesn't change.
|
||||||
NetSstoreInitGas uint64 = 20000 // Once per SSTORE operation from clean zero.
|
NetSstoreInitGas uint64 = 20000 // Once per SSTORE operation from clean zero.
|
||||||
NetSstoreCleanGas uint64 = 5000 // Once per SSTORE operation from clean non-zero.
|
NetSstoreCleanGas uint64 = 5000 // Once per SSTORE operation from clean non-zero.
|
||||||
|
|
@ -175,3 +161,12 @@ const (
|
||||||
Bn256PairingPerPointGasByzantium uint64 = 80000 // Byzantium per-point price for an elliptic curve pairing check
|
Bn256PairingPerPointGasByzantium uint64 = 80000 // Byzantium per-point price for an elliptic curve pairing check
|
||||||
Bn256PairingPerPointGasIstanbul uint64 = 34000 // Per-point price for an elliptic curve pairing check
|
Bn256PairingPerPointGasIstanbul uint64 = 34000 // Per-point price for an elliptic curve pairing check
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
DifficultyBoundDivisor = big.NewInt(2048) // The bound divisor of the difficulty, used in the update calculations.
|
||||||
|
GenesisDifficulty = big.NewInt(131072) // Difficulty of the Genesis block.
|
||||||
|
MinimumDifficulty = big.NewInt(131072) // The minimum that the difficulty may ever be.
|
||||||
|
DurationLimit = big.NewInt(13) // The decision boundary on the blocktime duration used to determine whether difficulty should go up or not.
|
||||||
|
|
||||||
|
TargetGasLimit uint64 = XDCGenesisGasLimit // The artificial target
|
||||||
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue