Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bor.milestone flag #8384

Merged
merged 1 commit into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ var (
WithHeimdallMilestones = cli.BoolFlag{
Name: "bor.milestone",
Usage: "Enabling bor milestone processing",
Value: false,
Value: true,
}

// HeimdallgRPCAddressFlag flag for heimdall gRPC address
Expand Down
13 changes: 7 additions & 6 deletions eth/stagedsync/stage_bor_heimdall.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,13 @@ func BorHeimdallForward(
if minedHeadNumber := minedHeader.Number.Uint64(); minedHeadNumber > headNumber {
// Whitelist service is called to check if the bor chain is
// on the cannonical chain according to milestones

if !service.IsValidChain(minedHeadNumber, []*types.Header{minedHeader}) {
logger.Debug("[BorHeimdall] Verification failed for mined header", "hash", minedHeader.Hash(), "height", minedHeadNumber, "err", err)
dataflow.HeaderDownloadStates.AddChange(minedHeadNumber, dataflow.HeaderInvalidated)
s.state.UnwindTo(minedHeadNumber-1, minedHeader.Hash())
return err
if service != nil {
if !service.IsValidChain(minedHeadNumber, []*types.Header{minedHeader}) {
logger.Debug("[BorHeimdall] Verification failed for mined header", "hash", minedHeader.Hash(), "height", minedHeadNumber, "err", err)
dataflow.HeaderDownloadStates.AddChange(minedHeadNumber, dataflow.HeaderInvalidated)
s.state.UnwindTo(minedHeadNumber-1, minedHeader.Hash())
return err
}
}
} else {
return fmt.Errorf("attempting to mine %d, which is behind current head: %d", minedHeadNumber, headNumber)
Expand Down
Loading