File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -130,7 +130,12 @@ func (l *L1Listener) watchL1Block(ctx context.Context) error {
130130 ticker := time .NewTicker (checkInterval )
131131 defer ticker .Stop ()
132132
133- currentBlockNo := 0
133+ // TODO: change it to the store to not miss blocks, if oracle is down
134+ currentBlockNo , err := l .l1Client .BlockNumber (ctx )
135+ if err != nil {
136+ l .logger .Error ("failed to get block number" , "error" , err )
137+ return err
138+ }
134139 for {
135140 select {
136141 case <- ctx .Done ():
@@ -181,7 +186,7 @@ func (l *L1Listener) watchL1Block(ctx context.Context) error {
181186 )
182187 }
183188
184- currentBlockNo = int ( blockNum )
189+ currentBlockNo = blockNum
185190 }
186191 }
187192}
Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ func TestL1Listener(t *testing.T) {
9393
9494 // ensure no winner is sent for the previous block
9595 select {
96- case <- time .After (5 * time .Second ):
96+ case <- time .After (10 * time .Second ):
9797 t .Fatal ("timeout waiting for winner" )
9898 case update := <- rec .updates :
9999 if update .blockNum .Int64 () != 11 {
You can’t perform that action at this time.
0 commit comments