Skip to content

Commit f75d951

Browse files
committed
moved safe tag calculation to tracker
1 parent 426d268 commit f75d951

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

chains/heads/tracker.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ type ChainConfig interface {
5151
FinalityDepth() uint32
5252
SafeDepth() uint32
5353
FinalityTagEnabled() bool
54+
SafeTagEnabled() bool
5455
FinalizedBlockOffset() uint32
5556
}
5657

@@ -401,7 +402,7 @@ func (t *tracker[HTH, S, ID, BHASH]) backfillLoop(ctx context.Context) {
401402
}
402403

403404
func (t *tracker[HTH, S, ID, BHASH]) LatestSafeBlock(ctx context.Context) (safe HTH, err error) {
404-
if t.config.FinalityTagEnabled() {
405+
if t.config.FinalityTagEnabled() && t.config.SafeTagEnabled() {
405406
latestSafe, err2 := t.client.LatestSafeBlock(ctx)
406407
if err2 != nil {
407408
return latestSafe, fmt.Errorf("failed to get latest finalized block: %w", err2)

0 commit comments

Comments
 (0)