Skip to content

Commit

Permalink
client: Fix skeleton reset scenario when head announced before subcha…
Browse files Browse the repository at this point in the history
…in 0 tail (#2408)
  • Loading branch information
g11tech authored Nov 7, 2022
1 parent 4d8bbd1 commit fd121be
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/client/lib/sync/skeleton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,14 @@ export class Skeleton extends MetaDBManager {
// Not a noop / double head announce, abort with a reorg
if (force) {
this.config.logger.warn(
`Beacon chain reorged tail=${lastchain.tail} head=${lastchain.head} newHead=${number}`
`Skeleton setHead before tail, resetting skeleton tail=${lastchain.tail} head=${lastchain.head} newHead=${number}`
)
lastchain.head = number
lastchain.tail = number
lastchain.next = head.header.parentHash
} else {
this.config.logger.warn(
`Skeleton announcement before tail, will reset skeleton tail=${lastchain.tail} head=${lastchain.head} newHead=${number}`
)
}
return true
Expand Down

0 comments on commit fd121be

Please sign in to comment.