aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/utils
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 /cmd/utils
parentc1c003e4ff36c22d67662ca661fc78cde850d401 (diff)
downloadgo-tangerine-e8f229b82ef99213f8f84b8a71f752b236024494.tar
go-tangerine-e8f229b82ef99213f8f84b8a71f752b236024494.tar.gz
go-tangerine-e8f229b82ef99213f8f84b8a71f752b236024494.tar.bz2
go-tangerine-e8f229b82ef99213f8f84b8a71f752b236024494.tar.lz
go-tangerine-e8f229b82ef99213f8f84b8a71f752b236024494.tar.xz
go-tangerine-e8f229b82ef99213f8f84b8a71f752b236024494.tar.zst
go-tangerine-e8f229b82ef99213f8f84b8a71f752b236024494.zip
cmd, core, eth, miner, params: configurable gas floor and ceil
Diffstat (limited to 'cmd/utils')
-rw-r--r--cmd/utils/flags.go27
1 files changed, 16 insertions, 11 deletions
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go
index 13430ad56..495bfe13e 100644
--- a/cmd/utils/flags.go
+++ b/cmd/utils/flags.go
@@ -329,12 +329,17 @@ var (
MinerGasTargetFlag = cli.Uint64Flag{
Name: "miner.gastarget",
Usage: "Target gas floor for mined blocks",
- Value: params.GenesisGasLimit,
+ Value: eth.DefaultConfig.MinerGasFloor,
}
MinerLegacyGasTargetFlag = cli.Uint64Flag{
Name: "targetgaslimit",
Usage: "Target gas floor for mined blocks (deprecated, use --miner.gastarget)",
- Value: params.GenesisGasLimit,
+ Value: eth.DefaultConfig.MinerGasFloor,
+ }
+ MinerGasLimitFlag = cli.Uint64Flag{
+ Name: "miner.gaslimit",
+ Usage: "Target gas ceiling for mined blocks",
+ Value: eth.DefaultConfig.MinerGasCeil,
}
MinerGasPriceFlag = BigFlag{
Name: "miner.gasprice",
@@ -1146,6 +1151,15 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) {
if ctx.GlobalIsSet(MinerExtraDataFlag.Name) {
cfg.MinerExtraData = []byte(ctx.GlobalString(MinerExtraDataFlag.Name))
}
+ if ctx.GlobalIsSet(MinerLegacyGasTargetFlag.Name) {
+ cfg.MinerGasFloor = ctx.GlobalUint64(MinerLegacyGasTargetFlag.Name)
+ }
+ if ctx.GlobalIsSet(MinerGasTargetFlag.Name) {
+ cfg.MinerGasFloor = ctx.GlobalUint64(MinerGasTargetFlag.Name)
+ }
+ if ctx.GlobalIsSet(MinerGasLimitFlag.Name) {
+ cfg.MinerGasCeil = ctx.GlobalUint64(MinerGasLimitFlag.Name)
+ }
if ctx.GlobalIsSet(MinerLegacyGasPriceFlag.Name) {
cfg.MinerGasPrice = GlobalBig(ctx, MinerLegacyGasPriceFlag.Name)
}
@@ -1270,15 +1284,6 @@ func RegisterEthStatsService(stack *node.Node, url string) {
}
}
-// SetupNetwork configures the system for either the main net or some test network.
-func SetupNetwork(ctx *cli.Context) {
- // TODO(fjl): move target gas limit into config
- params.TargetGasLimit = ctx.GlobalUint64(MinerLegacyGasTargetFlag.Name)
- if ctx.GlobalIsSet(MinerGasTargetFlag.Name) {
- params.TargetGasLimit = ctx.GlobalUint64(MinerGasTargetFlag.Name)
- }
-}
-
func SetupMetrics(ctx *cli.Context) {
if metrics.Enabled {
log.Info("Enabling metrics collection")