go-ethereum icon indicating copy to clipboard operation
go-ethereum copied to clipboard

node: drop support for static & trusted node list files

Open s1na opened this issue 2 years ago • 2 comments

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

s1na avatar Aug 26 '22 13:08 s1na

I feel slightly unsure to remove this feature. If we remove it, we absolutely have to keep the warning at least.

fjl avatar Aug 30 '22 12:08 fjl

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.

s1na avatar Aug 31 '22 13:08 s1na

I forked this, and added a commit on top: https://github.com/holiman/go-ethereum/commit/025eb50a756212ba4b44ab100121c7ca87ad5a07 . That's what I would do ...

holiman avatar Sep 28 '22 08:09 holiman

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

holiman avatar Sep 28 '22 08:09 holiman

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.

fjl avatar Sep 28 '22 11:09 fjl

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.

holiman avatar Sep 28 '22 13:09 holiman

Yes I mean changing the log message, replacing the Ignoring deprecated node list...

fjl avatar Sep 28 '22 14:09 fjl

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

holiman avatar Oct 05 '22 11:10 holiman