Skip to content

Commit abd0349

Browse files
committed
feedback
1 parent a8963d4 commit abd0349

File tree

5 files changed

+532
-78
lines changed

5 files changed

+532
-78
lines changed

apps/grpc/single/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
2222
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
2323
github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g=
2424
github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s=
25-
github.com/celestiaorg/go-header v0.7.3 h1:3+kIa+YXT789gPGRh3a55qmdYq3yTTBIqTyum26AvN0=
26-
github.com/celestiaorg/go-header v0.7.3/go.mod h1:eX9iTSPthVEAlEDLux40ZT/olXPGhpxHd+mEzJeDhd0=
2725
github.com/celestiaorg/go-libp2p-messenger v0.2.2 h1:osoUfqjss7vWTIZrrDSy953RjQz+ps/vBFE7bychLEc=
2826
github.com/celestiaorg/go-libp2p-messenger v0.2.2/go.mod h1:oTCRV5TfdO7V/k6nkx7QjQzGrWuJbupv+0o1cgnY2i4=
2927
github.com/celestiaorg/go-square/v3 v3.0.2 h1:eSQOgNII8inK9IhiBZ+6GADQeWbRq4HYY72BOgcduA4=
@@ -176,6 +174,8 @@ github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCV
176174
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
177175
github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
178176
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
177+
github.com/julienrbrt/go-header v0.0.0-20251008134330-747c8c192fa8 h1:F+gOiipBxG43s+Ho+ri9T8IwumjWjp1XUon4DLWjxfQ=
178+
github.com/julienrbrt/go-header v0.0.0-20251008134330-747c8c192fa8/go.mod h1:eX9iTSPthVEAlEDLux40ZT/olXPGhpxHd+mEzJeDhd0=
179179
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
180180
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
181181
github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=

block/internal/syncing/syncer.go

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -268,18 +268,11 @@ func (s *Syncer) processLoop() {
268268

269269
func (s *Syncer) startSyncWorkers() {
270270
s.wg.Add(2)
271-
go s.daWorker()
272-
go s.pendingWorker()
271+
go s.daWorkerLoop()
272+
go s.pendingWorkerLoop()
273273
}
274274

275275
func (s *Syncer) startP2PListeners() error {
276-
if s.headerStore == nil {
277-
return errors.New("header store not configured")
278-
}
279-
if s.dataStore == nil {
280-
return errors.New("data store not configured")
281-
}
282-
283276
headerNotifier := s.headerStore.Notifier()
284277
if headerNotifier == nil {
285278
return errors.New("header notifier not configured")
@@ -324,22 +317,15 @@ func (s *Syncer) consumeNotifierEvents(sub *syncnotifier.Subscription, expected
324317
logger.Debug().Str("received_type", string(evt.Type)).Msg("ignoring notifier event with unexpected type")
325318
continue
326319
}
327-
s.handleNotifierEvent(evt)
320+
s.logger.Debug().Str("event_type", string(evt.Type)).Str("source", string(evt.Source)).Uint64("height", evt.Height).Msg("received store event")
321+
s.tryFetchFromP2P()
328322
}
329323
}
330324
}
331325

332-
func (s *Syncer) handleNotifierEvent(evt syncnotifier.Event) {
333-
s.logger.Debug().Str("event_type", string(evt.Type)).Str("source", string(evt.Source)).Uint64("height", evt.Height).Msg("received store event")
334-
s.tryFetchFromP2P()
335-
}
336-
337-
func (s *Syncer) daWorker() {
326+
func (s *Syncer) daWorkerLoop() {
338327
defer s.wg.Done()
339-
s.daWorkerLoop()
340-
}
341328

342-
func (s *Syncer) daWorkerLoop() {
343329
if !s.waitForGenesis() {
344330
return
345331
}
@@ -363,12 +349,9 @@ func (s *Syncer) daWorkerLoop() {
363349
}
364350
}
365351

366-
func (s *Syncer) pendingWorker() {
352+
func (s *Syncer) pendingWorkerLoop() {
367353
defer s.wg.Done()
368-
s.pendingWorkerLoop()
369-
}
370354

371-
func (s *Syncer) pendingWorkerLoop() {
372355
if !s.waitForGenesis() {
373356
return
374357
}

codecov.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ ignore:
1717
- "execution/evm" # EVM is covered in e2e/integration tests
1818
- "**/metrics.go"
1919
- "client" # TODO: add more tests
20+
- "block/internal/**/*_mock.go"

0 commit comments

Comments
 (0)