-
Notifications
You must be signed in to change notification settings - Fork 21.5k
Description
System information
Geth version: 1.9.5
OS & Version: OSX
Commit hash : stable
Expected behaviour
Mainnet to sync from hardcoded checkpoint in light mode
Actual behaviour
Mainnet in lightmode does not sync from hardcoded checkpoint, starts from 0 every time.
Steps to reproduce the behaviour
- clear your geth blocks or data directory
- ./geth --syncmode light
Backtrace (with verbosity enabled)
DEBUG[09-27|14:29:16.259|light/lightchain.go:379] Inserted new header number=1 hash=88e96d…406cb6
Note that if you have a hardcoded checkpoint you should never see that message if checkpointing is enabled.
I get the:
DEBUG[09-27|14:29:01.460|les/sync.go:130] Disable checkpoint syncing reason="empty checkpoint"
message meaning it will disable checkpoint and fall back to lightSync mode:
Line 129 in 32b07e8
| mode = lightSync |
where it will completely disable checkpointing, hardcoded/oracle or whatever.
Note the fix is to simply post (hack imo) a checkpoint on the mainnet oracle https://etherscan.io/address/0x9a9070028361f7aabeb3f2f2dc07f82c4a98a02a#events which was created 80 days ago but no checkpoints posted. Rinkeby has checkpoints and thus even though the checkpoints are older than the hardcoded one, it still relies on the hardcoded checkpoint because of the fact that checkpoints response is not empty.
The proper fix likely is to re-validate the logic that you should probably fallback to legacy checkpoint mode if no oracle checkpoints exists (what you had before this bug existed).