Skip to content

checkpointing broken in lightmode on mainnet #20134

@sidhujag

Description

@sidhujag

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

  1. clear your geth blocks or data directory
  2. ./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:

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions