Skip to content

Commit 40f762f

Browse files
committed
comments
1 parent c579bea commit 40f762f

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

block/internal/syncing/syncer.go

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,6 @@ type daHandler interface {
2929
}
3030

3131
// Syncer handles block synchronization from DA and P2P sources.
32-
// It is responsible for:
33-
// - Retrieving blocks from DA layer
34-
// - Retrieving blocks from P2P network
35-
// - Validating and applying blocks to update state
36-
// - Tracking DA inclusion for finality
37-
// Note: DA submission is handled by the Executor, not the Syncer
3832
type Syncer struct {
3933
// Core components
4034
store store.Store
@@ -83,10 +77,6 @@ type Syncer struct {
8377
wg sync.WaitGroup
8478
}
8579

86-
// HeightEvent represents a block height event with header and data
87-
// This is an alias to the common.HeightEvent type for backward compatibility
88-
type HeightEvent = common.HeightEvent
89-
9080
// NewSyncer creates a new block syncer
9181
func NewSyncer(
9282
store store.Store,
@@ -114,7 +104,7 @@ func NewSyncer(
114104
dataStore: dataStore,
115105
lastStateMtx: &sync.RWMutex{},
116106
daStateMtx: &sync.RWMutex{},
117-
heightInCh: make(chan HeightEvent, 10000),
107+
heightInCh: make(chan common.HeightEvent, 10000),
118108
headerStoreCh: make(chan struct{}, 1),
119109
dataStoreCh: make(chan struct{}, 1),
120110
daIncluderCh: make(chan struct{}, 1),

block/internal/syncing/syncer_logic_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ func TestProcessHeightEvent_SyncsAndUpdatesState(t *testing.T) {
109109
mockExec.EXPECT().ExecuteTxs(mock.Anything, mock.Anything, uint64(1), mock.Anything, lastState.AppHash).
110110
Return([]byte("app1"), uint64(1024), nil).Once()
111111

112-
evt := HeightEvent{Header: hdr, Data: data, DaHeight: 1}
112+
evt := common.HeightEvent{Header: hdr, Data: data, DaHeight: 1}
113113
s.processHeightEvent(&evt)
114114

115115
h, err := st.Height(context.Background())
@@ -155,7 +155,7 @@ func TestDAInclusion_AdvancesHeight(t *testing.T) {
155155
// Expect ExecuteTxs call for height 1
156156
mockExec.EXPECT().ExecuteTxs(mock.Anything, mock.Anything, uint64(1), mock.Anything, st0.AppHash).
157157
Return([]byte("app1"), uint64(1024), nil).Once()
158-
evt1 := HeightEvent{Header: hdr1, Data: data1, DaHeight: 10}
158+
evt1 := common.HeightEvent{Header: hdr1, Data: data1, DaHeight: 10}
159159
s.processHeightEvent(&evt1)
160160

161161
st1, _ := st.GetState(context.Background())
@@ -164,7 +164,7 @@ func TestDAInclusion_AdvancesHeight(t *testing.T) {
164164
// Expect ExecuteTxs call for height 2
165165
mockExec.EXPECT().ExecuteTxs(mock.Anything, mock.Anything, uint64(2), mock.Anything, st1.AppHash).
166166
Return([]byte("app2"), uint64(1024), nil).Once()
167-
evt2 := HeightEvent{Header: hdr2, Data: data2, DaHeight: 11}
167+
evt2 := common.HeightEvent{Header: hdr2, Data: data2, DaHeight: 11}
168168
s.processHeightEvent(&evt2)
169169

170170
// Mark DA inclusion in cache (as DA retrieval would)

0 commit comments

Comments
 (0)