Merge pull request #47 from bas-vk/quorum-gaslimit

params: raise gas limit parameter values
This commit is contained in:
Samer Falah 2017-02-08 13:48:49 -05:00 committed by GitHub
commit 95d4681c8d
4 changed files with 15 additions and 6 deletions

View File

@ -460,7 +460,7 @@ func calcDifficultyFrontier(time, parentTime uint64, parentNumber, parentDiff *b
// 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)

View File

@ -232,7 +232,7 @@ func TestNetGenesisBlock() string {
"timestamp": "0x00",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"extraData": "0x",
"gasLimit": "0x2FEFD8",
"gasLimit": "0x2FAF0800",
"alloc": {
"0000000000000000000000000000000000000001": { "balance": "1" },
"0000000000000000000000000000000000000002": { "balance": "1" },

View File

@ -40,8 +40,8 @@ var (
EcrecoverGas = big.NewInt(3000) //
Sha256WordGas = big.NewInt(12) //
MinGasLimit = big.NewInt(5000) // Minimum the gas limit may ever be.
GenesisGasLimit = big.NewInt(4712388) // Gas limit of the Genesis block.
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
Sha3Gas = big.NewInt(30) // Once per SHA3 operation.
@ -53,7 +53,7 @@ var (
SstoreRefundGas = big.NewInt(15000) // Once per SSTORE operation if the zeroness changes to zero.
JumpdestGas = big.NewInt(1) // Refunded gas, once per SSTORE operation if the zeroness changes to zero.
IdentityGas = big.NewInt(15) //
GasLimitBoundDivisor = big.NewInt(1024) // The bound divisor of the gas limit, used in update calculations.
GasLimitBoundDivisor = big.NewInt(4096) // The bound divisor of the gas limit, used in update calculations.
EpochDuration = big.NewInt(30000) // Duration between proof-of-work epochs.
CallGas = big.NewInt(40) // Once per CALL operation & message call transaction.
CreateDataGas = big.NewInt(200) //
@ -71,5 +71,4 @@ var (
SuicideRefundGas = big.NewInt(24000) // Refunded following a suicide operation.
MemoryGas = big.NewInt(3) // Times the address of the (highest referenced byte in memory + 1). NOTE: referencing happens on read, write and in instructions such as RETURN and CALL.
TxDataNonZeroGas = big.NewInt(68) // Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions.
)

View File

@ -25,6 +25,7 @@ import (
"net/http"
"os"
"path/filepath"
"github.com/ethereum/go-ethereum/params"
)
var (
@ -62,6 +63,15 @@ var (
VmSkipTests = []string{}
)
func init() {
// Quorum uses different gas limit parameter values as Ethereum.
// By overwriting these custom parameters to Ethereum values it's
// possible to use the test data from Ethereum.
params.MinGasLimit.SetString("5000", 10)
params.TargetGasLimit.SetString("4712388", 10)
params.GasLimitBoundDivisor.SetString("1024", 10)
}
func readJson(reader io.Reader, value interface{}) error {
data, err := ioutil.ReadAll(reader)
if err != nil {