Skip to content

Commit 4fa8ee6

Browse files
Zachinquarantineblakehhuynh
authored andcommitted
cmd/puppeth, cmd/utils: finalize removal of gasTarget flag (ethereum#24370)
This PR fully removes the --miner.gastarget flag, as previously it was only hidden from the geth --help command, but could still be used.
1 parent f6d5974 commit 4fa8ee6

File tree

5 files changed

+3
-27
lines changed

5 files changed

+3
-27
lines changed

cmd/geth/main.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ var (
121121
utils.MiningEnabledFlag,
122122
utils.MinerThreadsFlag,
123123
utils.MinerNotifyFlag,
124-
utils.LegacyMinerGasTargetFlag,
125124
utils.MinerGasLimitFlag,
126125
utils.MinerGasPriceFlag,
127126
utils.MinerEtherbaseFlag,

cmd/puppeth/module_node.go

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ ADD genesis.json /genesis.json
4242
RUN \
4343
echo 'geth --cache 512 init /genesis.json' > geth.sh && \{{if .Unlock}}
4444
echo 'mkdir -p /root/.ethereum/keystore/ && cp /signer.json /root/.ethereum/keystore/' >> geth.sh && \{{end}}
45-
echo $'exec geth --networkid {{.NetworkID}} --cache 512 --port {{.Port}} --nat extip:{{.IP}} --maxpeers {{.Peers}} {{.LightFlag}} --ethstats \'{{.Ethstats}}\' {{if .Bootnodes}}--bootnodes {{.Bootnodes}}{{end}} {{if .Etherbase}}--miner.etherbase {{.Etherbase}} --mine --miner.threads 1{{end}} {{if .Unlock}}--unlock 0 --password /signer.pass --mine{{end}} --miner.gastarget {{.GasTarget}} --miner.gaslimit {{.GasLimit}} --miner.gasprice {{.GasPrice}}' >> geth.sh
45+
echo $'exec geth --networkid {{.NetworkID}} --cache 512 --port {{.Port}} --nat extip:{{.IP}} --maxpeers {{.Peers}} {{.LightFlag}} --ethstats \'{{.Ethstats}}\' {{if .Bootnodes}}--bootnodes {{.Bootnodes}}{{end}} {{if .Etherbase}}--miner.etherbase {{.Etherbase}} --mine --miner.threads 1{{end}} {{if .Unlock}}--unlock 0 --password /signer.pass --mine{{end}} --miner.gaslimit {{.GasLimit}} --miner.gasprice {{.GasPrice}}' >> geth.sh
4646
4747
ENTRYPOINT ["/bin/sh", "geth.sh"]
4848
`
@@ -68,7 +68,6 @@ services:
6868
- LIGHT_PEERS={{.LightPeers}}
6969
- STATS_NAME={{.Ethstats}}
7070
- MINER_NAME={{.Etherbase}}
71-
- GAS_TARGET={{.GasTarget}}
7271
- GAS_LIMIT={{.GasLimit}}
7372
- GAS_PRICE={{.GasPrice}}
7473
logging:
@@ -106,7 +105,6 @@ func deployNode(client *sshClient, network string, bootnodes []string, config *n
106105
"Bootnodes": strings.Join(bootnodes, ","),
107106
"Ethstats": config.ethstats,
108107
"Etherbase": config.etherbase,
109-
"GasTarget": uint64(1000000 * config.gasTarget),
110108
"GasLimit": uint64(1000000 * config.gasLimit),
111109
"GasPrice": uint64(1000000000 * config.gasPrice),
112110
"Unlock": config.keyJSON != "",
@@ -125,7 +123,6 @@ func deployNode(client *sshClient, network string, bootnodes []string, config *n
125123
"LightPeers": config.peersLight,
126124
"Ethstats": getEthName(config.ethstats),
127125
"Etherbase": config.etherbase,
128-
"GasTarget": config.gasTarget,
129126
"GasLimit": config.gasLimit,
130127
"GasPrice": config.gasPrice,
131128
})
@@ -164,7 +161,6 @@ type nodeInfos struct {
164161
etherbase string
165162
keyJSON string
166163
keyPass string
167-
gasTarget float64
168164
gasLimit float64
169165
gasPrice float64
170166
}
@@ -179,10 +175,9 @@ func (info *nodeInfos) Report() map[string]string {
179175
"Peer count (light nodes)": strconv.Itoa(info.peersLight),
180176
"Ethstats username": info.ethstats,
181177
}
182-
if info.gasTarget > 0 {
178+
if info.gasLimit > 0 {
183179
// Miner or signer node
184180
report["Gas price (minimum accepted)"] = fmt.Sprintf("%0.3f GWei", info.gasPrice)
185-
report["Gas floor (baseline target)"] = fmt.Sprintf("%0.3f MGas", info.gasTarget)
186181
report["Gas ceil (target maximum)"] = fmt.Sprintf("%0.3f MGas", info.gasLimit)
187182

188183
if info.etherbase != "" {
@@ -223,7 +218,6 @@ func checkNode(client *sshClient, network string, boot bool) (*nodeInfos, error)
223218
// Resolve a few types from the environmental variables
224219
totalPeers, _ := strconv.Atoi(infos.envvars["TOTAL_PEERS"])
225220
lightPeers, _ := strconv.Atoi(infos.envvars["LIGHT_PEERS"])
226-
gasTarget, _ := strconv.ParseFloat(infos.envvars["GAS_TARGET"], 64)
227221
gasLimit, _ := strconv.ParseFloat(infos.envvars["GAS_LIMIT"], 64)
228222
gasPrice, _ := strconv.ParseFloat(infos.envvars["GAS_PRICE"], 64)
229223

@@ -263,7 +257,6 @@ func checkNode(client *sshClient, network string, boot bool) (*nodeInfos, error)
263257
etherbase: infos.envvars["MINER_NAME"],
264258
keyJSON: keyJSON,
265259
keyPass: keyPass,
266-
gasTarget: gasTarget,
267260
gasLimit: gasLimit,
268261
gasPrice: gasPrice,
269262
}

cmd/puppeth/wizard_node.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func (w *wizard) deployNode(boot bool) {
5050
if boot {
5151
infos = &nodeInfos{port: 30303, peersTotal: 512, peersLight: 256}
5252
} else {
53-
infos = &nodeInfos{port: 30303, peersTotal: 50, peersLight: 0, gasTarget: 7.5, gasLimit: 10, gasPrice: 1}
53+
infos = &nodeInfos{port: 30303, peersTotal: 50, peersLight: 0, gasLimit: 10, gasPrice: 1}
5454
}
5555
}
5656
existed := err == nil
@@ -148,10 +148,6 @@ func (w *wizard) deployNode(boot bool) {
148148
}
149149
}
150150
// Establish the gas dynamics to be enforced by the signer
151-
fmt.Println()
152-
fmt.Printf("What gas limit should empty blocks target (MGas)? (default = %0.3f)\n", infos.gasTarget)
153-
infos.gasTarget = w.readDefaultFloat(infos.gasTarget)
154-
155151
fmt.Println()
156152
fmt.Printf("What gas limit should full blocks target (MGas)? (default = %0.3f)\n", infos.gasLimit)
157153
infos.gasLimit = w.readDefaultFloat(infos.gasLimit)

cmd/utils/flags.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1649,9 +1649,6 @@ func setMiner(ctx *cli.Context, cfg *miner.Config) {
16491649
if ctx.IsSet(MinerNoVerifyFlag.Name) {
16501650
cfg.Noverify = ctx.Bool(MinerNoVerifyFlag.Name)
16511651
}
1652-
if ctx.IsSet(LegacyMinerGasTargetFlag.Name) {
1653-
log.Warn("The generic --miner.gastarget flag is deprecated and will be removed in the future!")
1654-
}
16551652
}
16561653

16571654
func setRequiredBlocks(ctx *cli.Context, cfg *ethconfig.Config) {

cmd/utils/flags_legacy.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ package utils
1919
import (
2020
"fmt"
2121

22-
"github.com/ethereum/go-ethereum/eth/ethconfig"
2322
"github.com/ethereum/go-ethereum/internal/flags"
2423
"github.com/urfave/cli/v2"
2524
)
@@ -33,7 +32,6 @@ var ShowDeprecated = &cli.Command{
3332
}
3433

3534
var DeprecatedFlags = []cli.Flag{
36-
LegacyMinerGasTargetFlag,
3735
NoUSBFlag,
3836
}
3937

@@ -44,13 +42,6 @@ var (
4442
Usage: "Disables monitoring for and managing USB hardware wallets (deprecated)",
4543
Category: flags.DeprecatedCategory,
4644
}
47-
// (Deprecated July 2021, shown in aliased flags section)
48-
LegacyMinerGasTargetFlag = &cli.Uint64Flag{
49-
Name: "miner.gastarget",
50-
Usage: "Target gas floor for mined blocks (deprecated)",
51-
Value: ethconfig.Defaults.Miner.GasFloor,
52-
Category: flags.DeprecatedCategory,
53-
}
5445
)
5546

5647
// showDeprecated displays deprecated flags that will be soon removed from the codebase.

0 commit comments

Comments
 (0)