Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stagedsync: polygon sync stage fix nil panic when downloading state s…
…ync events (#10469) Problem: - we were using `ReadHeaderByNumber` to get the latest sprint start block header needed for fetching state sync events - `ReadHeaderByNumber` uses `ReadCanonicalHash` to get the hash and then calls `ReadHeader(hash, number)` - `ReadHeaderByNumber` returns nil when there is no canonical header for a given height - since we are syncing there will be no canonical hash hence we were getting nil panics - the fix is to switch to using `rawdb.ReadHeader(hash, number)` in a backward fashion until we reach the latest sprint block start header
- Loading branch information