go-ethereum
go-ethereum copied to clipboard
node: drop support for static & trusted node list files
Note if this is merged these files will go silently ignored. Alternatively we can raise an error in case these files exist as a first step and remove support in the next version.
Deprecated 4 years ago as part of #18199
I feel slightly unsure to remove this feature. If we remove it, we absolutely have to keep the warning at least.
I modified it so that now there's an error logged in case one of these files exist in the datadir (if none was set through config). They are not parsed anymore.
I forked this, and added a commit on top: https://github.com/holiman/go-ethereum/commit/025eb50a756212ba4b44ab100121c7ca87ad5a07 . That's what I would do ...
With my changes, here's how it looks if the warns trigger:
Run "./build/bin/geth" to launch geth.
INFO [09-28|10:19:18.350] Starting Geth on Ethereum mainnet...
INFO [09-28|10:19:18.350] Bumping default cache on mainnet provided=1024 updated=4096
INFO [09-28|10:19:18.352] Maximum peer count ETH=0 LES=0 total=0
WARN [09-28|10:19:18.353] Using deprecated resource file, please move this file to the 'geth' subdirectory of datadir. file=/home/user/.ethereum/nodekey
ERROR[09-28|10:19:18.353] Ignoring deprecated node list. Please use the TOML config file instead. path=/home/user/.ethereum/geth/static-nodes.json
ERROR[09-28|10:19:18.353] Ignoring deprecated node list. Please use the TOML config file instead. path=/home/user/.ethereum/geth/trusted-nodes.json
This log message kind of sucks. I think we should add the policy where log messages intended for humans should not be phrased in this 'machine event' style.
How about:
The static-nodes.json file is deprecated and ignored. Use P2P.StaticNodes in config.toml instead.
You mean The static-nodes.json file is deprecated and ignored. Use P2P.StaticNodes in config.toml instead.
instead of
Ignoring deprecated node list. Please use the TOML config file instead. path=/home/user/.ethereum/geth/static-nodes.json
?
Or do you mean to print that thing out as a raw terminal printout? Because that I don't agree with.
Yes I mean changing the log message, replacing the Ignoring deprecated node list...
Updated:
[user@work go-ethereum]$ geth --nodiscover --maxpeers 0
INFO [10-05|13:51:20.127] Starting Geth on Ethereum mainnet...
INFO [10-05|13:51:20.128] Bumping default cache on mainnet provided=1024 updated=4096
INFO [10-05|13:51:20.129] Maximum peer count ETH=0 LES=0 total=0
ERROR[10-05|13:51:20.130] The static-nodes.json file is deprecated and ignored. Use P2P.StaticNodes in config.toml instead.
ERROR[10-05|13:51:20.130] The trusted-nodes.json file is deprecated and ignored. Use P2P.TruestdNodes in config.toml instead.
I'll push it to this PR, hope that's ok