aboutsummaryrefslogtreecommitdiffstats
path: root/eth
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2018-08-29 17:21:12 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-08-29 17:40:12 +0800
commite8f229b82ef99213f8f84b8a71f752b236024494 (patch)
tree62f4d24ddfcb9fba0573531995739bcfdbf8b143 /eth
parentc1c003e4ff36c22d67662ca661fc78cde850d401 (diff)
downloaddexon-e8f229b82ef99213f8f84b8a71f752b236024494.tar
dexon-e8f229b82ef99213f8f84b8a71f752b236024494.tar.gz
dexon-e8f229b82ef99213f8f84b8a71f752b236024494.tar.bz2
dexon-e8f229b82ef99213f8f84b8a71f752b236024494.tar.lz
dexon-e8f229b82ef99213f8f84b8a71f752b236024494.tar.xz
dexon-e8f229b82ef99213f8f84b8a71f752b236024494.tar.zst
dexon-e8f229b82ef99213f8f84b8a71f752b236024494.zip
cmd, core, eth, miner, params: configurable gas floor and ceil
Diffstat (limited to 'eth')
-rw-r--r--eth/backend.go2
-rw-r--r--eth/config.go6
-rw-r--r--eth/gasprice/gasprice.go2
-rw-r--r--eth/gen_config.go12
4 files changed, 19 insertions, 3 deletions
diff --git a/eth/backend.go b/eth/backend.go
index 3032e1a6d..9926225f2 100644
--- a/eth/backend.go
+++ b/eth/backend.go
@@ -173,7 +173,7 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
return nil, err
}
- eth.miner = miner.New(eth, eth.chainConfig, eth.EventMux(), eth.engine, config.MinerRecommit)
+ eth.miner = miner.New(eth, eth.chainConfig, eth.EventMux(), eth.engine, config.MinerRecommit, config.MinerGasFloor, config.MinerGasCeil)
eth.miner.SetExtra(makeExtraData(config.MinerExtraData))
eth.APIBackend = &EthAPIBackend{eth, nil}
diff --git a/eth/config.go b/eth/config.go
index 517d7d8f3..f1a402e37 100644
--- a/eth/config.go
+++ b/eth/config.go
@@ -48,7 +48,9 @@ var DefaultConfig = Config{
DatabaseCache: 768,
TrieCache: 256,
TrieTimeout: 60 * time.Minute,
- MinerGasPrice: big.NewInt(18 * params.Shannon),
+ MinerGasFloor: 8000000,
+ MinerGasCeil: 8000000,
+ MinerGasPrice: big.NewInt(params.GWei),
MinerRecommit: 3 * time.Second,
TxPool: core.DefaultTxPoolConfig,
@@ -99,6 +101,8 @@ type Config struct {
Etherbase common.Address `toml:",omitempty"`
MinerNotify []string `toml:",omitempty"`
MinerExtraData []byte `toml:",omitempty"`
+ MinerGasFloor uint64
+ MinerGasCeil uint64
MinerGasPrice *big.Int
MinerRecommit time.Duration
MinerNoverify bool
diff --git a/eth/gasprice/gasprice.go b/eth/gasprice/gasprice.go
index 54325692c..3b8db78a1 100644
--- a/eth/gasprice/gasprice.go
+++ b/eth/gasprice/gasprice.go
@@ -29,7 +29,7 @@ import (
"github.com/ethereum/go-ethereum/rpc"
)
-var maxPrice = big.NewInt(500 * params.Shannon)
+var maxPrice = big.NewInt(500 * params.GWei)
type Config struct {
Blocks int
diff --git a/eth/gen_config.go b/eth/gen_config.go
index df4ffeb11..d401a917d 100644
--- a/eth/gen_config.go
+++ b/eth/gen_config.go
@@ -33,6 +33,8 @@ func (c Config) MarshalTOML() (interface{}, error) {
Etherbase common.Address `toml:",omitempty"`
MinerNotify []string `toml:",omitempty"`
MinerExtraData hexutil.Bytes `toml:",omitempty"`
+ MinerGasFloor uint64
+ MinerGasCeil uint64
MinerGasPrice *big.Int
MinerRecommit time.Duration
MinerNoverify bool
@@ -57,6 +59,8 @@ func (c Config) MarshalTOML() (interface{}, error) {
enc.Etherbase = c.Etherbase
enc.MinerNotify = c.MinerNotify
enc.MinerExtraData = c.MinerExtraData
+ enc.MinerGasFloor = c.MinerGasFloor
+ enc.MinerGasCeil = c.MinerGasCeil
enc.MinerGasPrice = c.MinerGasPrice
enc.MinerRecommit = c.MinerRecommit
enc.MinerNoverify = c.MinerNoverify
@@ -85,6 +89,8 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error {
Etherbase *common.Address `toml:",omitempty"`
MinerNotify []string `toml:",omitempty"`
MinerExtraData *hexutil.Bytes `toml:",omitempty"`
+ MinerGasFloor *uint64
+ MinerGasCeil *uint64
MinerGasPrice *big.Int
MinerRecommit *time.Duration
MinerNoverify *bool
@@ -140,6 +146,12 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error {
if dec.MinerExtraData != nil {
c.MinerExtraData = *dec.MinerExtraData
}
+ if dec.MinerGasFloor != nil {
+ c.MinerGasFloor = *dec.MinerGasFloor
+ }
+ if dec.MinerGasCeil != nil {
+ c.MinerGasCeil = *dec.MinerGasCeil
+ }
if dec.MinerGasPrice != nil {
c.MinerGasPrice = dec.MinerGasPrice
}