Skip to content

Commit 85ede14

Browse files
committed
cmd: retire whisper flags (ethereum#22421)
1 parent cfb7250 commit 85ede14

File tree

5 files changed

+2
-62
lines changed

5 files changed

+2
-62
lines changed

cmd/XDC/config.go

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ var (
4646
Name: "dumpconfig",
4747
Usage: "Show configuration values",
4848
ArgsUsage: "",
49-
Flags: append(append(nodeFlags, rpcFlags...), whisperFlags...),
49+
Flags: append(nodeFlags, rpcFlags...),
5050
Category: "MISCELLANEOUS COMMANDS",
5151
Description: `The dumpconfig command shows configuration values.`,
5252
}
@@ -88,19 +88,8 @@ type Bootnodes struct {
8888
Testnet []string
8989
}
9090

91-
// whisper has been deprecated, but clients out there might still have [Shh]
92-
// in their config, which will crash. Cut them some slack by keeping the
93-
// config, and displaying a message that those config switches are ineffectual.
94-
// To be removed circa Q1 2021 -- @gballet.
95-
type whisperDeprecatedConfig struct {
96-
MaxMessageSize uint32 `toml:",omitempty"`
97-
MinimumAcceptedPOW float64 `toml:",omitempty"`
98-
RestrictConnectionBetweenLightClients bool `toml:",omitempty"`
99-
}
100-
10191
type XDCConfig struct {
10292
Eth ethconfig.Config
103-
Shh whisperDeprecatedConfig
10493
Node node.Config
10594
Ethstats ethstatsConfig
10695
XDCX XDCx.Config
@@ -150,10 +139,6 @@ func makeConfigNode(ctx *cli.Context) (*node.Node, XDCConfig) {
150139
if err := loadConfig(file, &cfg); err != nil {
151140
utils.Fatalf("%v", err)
152141
}
153-
154-
if cfg.Shh != (whisperDeprecatedConfig{}) {
155-
log.Warn("Deprecated whisper config detected. Whisper has been moved to github.com/ethereum/whisper")
156-
}
157142
}
158143
if ctx.GlobalIsSet(utils.StakingEnabledFlag.Name) {
159144
cfg.StakeEnable = ctx.GlobalBool(utils.StakingEnabledFlag.Name)
@@ -224,7 +209,6 @@ func makeConfigNode(ctx *cli.Context) (*node.Node, XDCConfig) {
224209
cfg.Ethstats.URL = ctx.GlobalString(utils.EthStatsURLFlag.Name)
225210
}
226211

227-
utils.SetShhConfig(ctx, stack)
228212
utils.SetXDCXConfig(ctx, &cfg.XDCX, cfg.Node.DataDir)
229213
return stack, cfg
230214
}
@@ -242,15 +226,6 @@ func applyValues(values []string, params *[]string) {
242226

243227
}
244228

245-
// checkWhisper returns true in case one of the whisper flags is set.
246-
func checkWhisper(ctx *cli.Context) {
247-
for _, flag := range whisperFlags {
248-
if ctx.GlobalIsSet(flag.GetName()) {
249-
log.Warn("deprecated whisper flag detected. Whisper has been moved to github.com/ethereum/whisper")
250-
}
251-
}
252-
}
253-
254229
func makeFullNode(ctx *cli.Context) (*node.Node, XDCConfig) {
255230
stack, cfg := makeConfigNode(ctx)
256231

@@ -259,7 +234,6 @@ func makeFullNode(ctx *cli.Context) (*node.Node, XDCConfig) {
259234
utils.RegisterXDCXService(stack, &cfg.XDCX)
260235
utils.RegisterEthService(stack, &cfg.Eth)
261236

262-
checkWhisper(ctx)
263237
// Add the Ethereum Stats daemon if requested.
264238
if cfg.Ethstats.URL != "" {
265239
utils.RegisterEthStatsService(stack, cfg.Ethstats.URL)

cmd/XDC/consolecmd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ var (
3838
Action: utils.MigrateFlags(localConsole),
3939
Name: "console",
4040
Usage: "Start an interactive JavaScript environment",
41-
Flags: append(append(append(nodeFlags, rpcFlags...), consoleFlags...), whisperFlags...),
41+
Flags: append(append(nodeFlags, rpcFlags...), consoleFlags...),
4242
Category: "CONSOLE COMMANDS",
4343
Description: `
4444
The XDC console is an interactive shell for the JavaScript runtime environment

cmd/XDC/main.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,6 @@ var (
160160
utils.IPCPathFlag,
161161
utils.RPCGlobalTxFeeCap,
162162
}
163-
164-
whisperFlags = []cli.Flag{
165-
utils.WhisperEnabledFlag,
166-
utils.WhisperMaxMessageSizeFlag,
167-
utils.WhisperMinPOWFlag,
168-
}
169163
)
170164

171165
func init() {
@@ -198,7 +192,6 @@ func init() {
198192
app.Flags = append(app.Flags, rpcFlags...)
199193
app.Flags = append(app.Flags, consoleFlags...)
200194
app.Flags = append(app.Flags, debug.Flags...)
201-
app.Flags = append(app.Flags, whisperFlags...)
202195

203196
app.Before = func(ctx *cli.Context) error {
204197
runtime.GOMAXPROCS(runtime.NumCPU())

cmd/XDC/usage.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,10 +217,6 @@ var AppHelpFlagGroups = []flagGroup{
217217
//utils.NoCompactionFlag,
218218
}, debug.Flags...),
219219
},
220-
//{
221-
// Name: "WHISPER (deprecated)",
222-
// Flags: whisperFlags,
223-
//},
224220
{
225221
Name: "DEPRECATED",
226222
Flags: []cli.Flag{

cmd/utils/flags.go

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -590,20 +590,6 @@ var (
590590
Usage: "Gas price below which gpo will ignore transactions",
591591
Value: ethconfig.Defaults.GPO.IgnorePrice.Int64(),
592592
}
593-
WhisperEnabledFlag = cli.BoolFlag{
594-
Name: "shh",
595-
Usage: "Enable Whisper",
596-
}
597-
WhisperMaxMessageSizeFlag = cli.IntFlag{
598-
Name: "shh.maxmessagesize",
599-
Usage: "Max message size accepted",
600-
Value: 1024 * 1024,
601-
}
602-
WhisperMinPOWFlag = cli.Float64Flag{
603-
Name: "shh.pow",
604-
Usage: "Minimum POW accepted",
605-
Value: 0.2,
606-
}
607593
XDCXDataDirFlag = DirectoryFlag{
608594
Name: "XDCx.datadir",
609595
Usage: "Data directory for the XDCX databases",
@@ -1143,15 +1129,6 @@ func checkExclusive(ctx *cli.Context, args ...interface{}) {
11431129
}
11441130
}
11451131

1146-
// SetShhConfig applies shh-related command line flags to the config.
1147-
func SetShhConfig(ctx *cli.Context, stack *node.Node) {
1148-
if ctx.GlobalIsSet(WhisperEnabledFlag.Name) ||
1149-
ctx.GlobalIsSet(WhisperMaxMessageSizeFlag.Name) ||
1150-
ctx.GlobalIsSet(WhisperMinPOWFlag.Name) {
1151-
log.Warn("Whisper support has been deprecated and the code has been moved to github.com/ethereum/whisper")
1152-
}
1153-
}
1154-
11551132
func SetXDCXConfig(ctx *cli.Context, cfg *XDCx.Config, XDCDataDir string) {
11561133
if ctx.GlobalIsSet(XDCXDataDirFlag.Name) {
11571134
cfg.DataDir = ctx.GlobalString(XDCXDataDirFlag.Name)

0 commit comments

Comments
 (0)