Skip to content

Commit 3c0a15c

Browse files
committed
fix: persist DA included height in syncer for full nodes
Full nodes syncing from DA were not persisting the DAIncludedHeightKey metadata, causing the E2E test to fail when querying this value. The submitter (sequencer) already persists this key when verifying DA inclusion. This change adds the same logic to the syncer so full nodes also track which blocks have been DA included.
1 parent 955a170 commit 3c0a15c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

block/internal/syncing/syncer.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,13 @@ func (s *Syncer) processHeightEvent(event *common.DAHeightEvent) {
464464

465465
// only save to p2p stores if the event came from DA
466466
if event.Source == common.SourceDA {
467+
// Persist DA included height for full nodes syncing from DA
468+
bz := make([]byte, 8)
469+
binary.LittleEndian.PutUint64(bz, height)
470+
if err := s.store.SetMetadata(s.ctx, store.DAIncludedHeightKey, bz); err != nil {
471+
s.logger.Error().Err(err).Uint64("height", height).Msg("failed to persist DA included height")
472+
}
473+
467474
g, ctx := errgroup.WithContext(s.ctx)
468475
g.Go(func() error {
469476
// broadcast header locally only — prevents spamming the p2p network with old height notifications,

0 commit comments

Comments
 (0)