Skip to content

Commit

Permalink
fix(proposer): SplitRangeBasedOnSafeHeads fallback (#274)
Browse files Browse the repository at this point in the history
  • Loading branch information
ratankaliani authored Dec 13, 2024
1 parent 7c80711 commit dc97c3c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions proposer/op/proposer/range.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,14 @@ func (l *L2OutputSubmitter) GetRangeProofBoundaries(ctx context.Context) error {
var spans []Span
// If the safeDB is activated, we use the safeHead based range splitting algorithm.
// Otherwise, we use the simple range splitting algorithm.
spans = l.SplitRangeBasic(newL2StartBlock, newL2EndBlock)
if safeDBActivated {
spans, err = l.SplitRangeBasedOnSafeHeads(ctx, newL2StartBlock, newL2EndBlock)
if err != nil {
return fmt.Errorf("failed to split range based on safe heads: %w", err)
safeHeadSpans, err := l.SplitRangeBasedOnSafeHeads(ctx, newL2StartBlock, newL2EndBlock)
if err == nil {
spans = safeHeadSpans
} else {
l.Log.Warn("failed to split range based on safe heads, using basic range splitting", "err", err)
}
} else {
spans = l.SplitRangeBasic(newL2StartBlock, newL2EndBlock)
}


Expand Down

0 comments on commit dc97c3c

Please sign in to comment.