Skip to content

Commit ffc9ff4

Browse files
committed
cleanup (syncer should not care about da included height)
1 parent 2485ab5 commit ffc9ff4

2 files changed

Lines changed: 2 additions & 26 deletions

File tree

block/internal/submitting/submitter.go

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -129,19 +129,11 @@ func (s *Submitter) Start(ctx context.Context) error {
129129
// Start DA submission loop if signer is available (aggregator nodes only)
130130
if s.signer != nil {
131131
s.logger.Info().Msg("starting DA submission loop")
132-
s.wg.Add(1)
133-
go func() {
134-
defer s.wg.Done()
135-
s.daSubmissionLoop()
136-
}()
132+
s.wg.Go(s.daSubmissionLoop)
137133
}
138134

139135
// Start DA inclusion processing loop (both sync and aggregator nodes)
140-
s.wg.Add(1)
141-
go func() {
142-
defer s.wg.Done()
143-
s.processDAInclusionLoop()
144-
}()
136+
s.wg.Go(s.processDAInclusionLoop)
145137

146138
return nil
147139
}

block/internal/syncing/syncer.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -777,22 +777,6 @@ func (s *Syncer) TrySyncNextBlock(ctx context.Context, event *common.DAHeightEve
777777
return fmt.Errorf("failed to commit batch: %w", err)
778778
}
779779

780-
// Persist DA height mapping for blocks synced from DA
781-
// This ensures consistency with the sequencer's submitter which also persists this mapping
782-
// Note: P2P hints are already persisted via store_adapter.Append when items have DAHint set
783-
// But DaHeight from events always take precedence as they are authoritative (comes from DA)
784-
if event.DaHeight > 0 {
785-
daHeightBytes := make([]byte, 8)
786-
binary.LittleEndian.PutUint64(daHeightBytes, event.DaHeight)
787-
788-
if err := s.store.SetMetadata(ctx, store.GetHeightToDAHeightHeaderKey(nextHeight), daHeightBytes); err != nil {
789-
s.logger.Warn().Err(err).Uint64("height", nextHeight).Msg("failed to persist header DA height mapping")
790-
}
791-
if err := s.store.SetMetadata(ctx, store.GetHeightToDAHeightDataKey(nextHeight), daHeightBytes); err != nil {
792-
s.logger.Warn().Err(err).Uint64("height", nextHeight).Msg("failed to persist data DA height mapping")
793-
}
794-
}
795-
796780
// Update in-memory state after successful commit
797781
s.SetLastState(newState)
798782
s.metrics.Height.Set(float64(newState.LastBlockHeight))

0 commit comments

Comments
 (0)