@@ -10,9 +10,6 @@ import (
10
10
"github.com/celestiaorg/go-header"
11
11
)
12
12
13
- // TODO:
14
- // * Flush
15
-
16
13
// subjectiveTail returns the current Tail header.
17
14
// Lazily fetching it if it doesn't exist locally or moving it to a different height.
18
15
// Moving is done if either parameters are changed or tail moved outside a pruning window.
@@ -84,9 +81,6 @@ func (s *Syncer[H]) subjectiveTail(ctx context.Context, head H) (H, error) {
84
81
if err := s .store .Append (ctx , tail ); err != nil {
85
82
return tail , fmt .Errorf ("appending tail header: %w" , err )
86
83
}
87
-
88
- time .Sleep (time .Millisecond * 1000 )
89
- // TODO: Flush
90
84
}
91
85
92
86
if err := s .moveTail (ctx , tail ); err != nil {
@@ -110,7 +104,7 @@ func (s *Syncer[H]) moveTail(ctx context.Context, new H) error {
110
104
111
105
switch {
112
106
case old .Height () < new .Height ():
113
- log .Infof ("move tail up from %d to %d, pruning the diff..." , old , new )
107
+ log .Infof ("move tail up from %d to %d, pruning the diff..." , old . Height () , new . Height () )
114
108
err := s .store .DeleteTo (ctx , new .Height ())
115
109
if err != nil {
116
110
return fmt .Errorf (
@@ -120,7 +114,7 @@ func (s *Syncer[H]) moveTail(ctx context.Context, new H) error {
120
114
)
121
115
}
122
116
case old .Height () > new .Height ():
123
- log .Infof ("move tail down from %d to %d, syncing the diff..." , old , new )
117
+ log .Infof ("move tail down from %d to %d, syncing the diff..." , old . Height () , new . Height () )
124
118
125
119
// TODO(@Wondertan): This works but it assumes this code is only run before syncing routine starts.
126
120
// If run after, it may race with other in prog syncs.
0 commit comments