Commit cb9a019
authored
stagedsync: polygon sync stage fix nil panic when downloading state sync 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 header1 parent 653c5e2 commit cb9a019
1 file changed
+7
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
322 | 322 | | |
323 | 323 | | |
324 | 324 | | |
325 | | - | |
326 | | - | |
327 | | - | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
328 | 332 | | |
329 | 333 | | |
330 | 334 | | |
| |||
0 commit comments