@@ -196,7 +196,14 @@ func TestDARetriever_ProcessBlobs_HeaderAndData_Success(t *testing.T) {
196196 assert .Equal (t , uint64 (2 ), events [0 ].Header .Height ())
197197 assert .Equal (t , uint64 (2 ), events [0 ].Data .Height ())
198198 assert .Equal (t , uint64 (77 ), events [0 ].DaHeight )
199- assert .Equal (t , uint64 (77 ), events [0 ].HeaderDaIncludedHeight )
199+
200+ hHeight , ok := r .cache .GetHeaderDAIncluded (events [0 ].Header .Hash ().String ())
201+ assert .True (t , ok )
202+ assert .Equal (t , uint64 (77 ), hHeight )
203+
204+ dHeight , ok := r .cache .GetDataDAIncluded (events [0 ].Data .DACommitment ().String ())
205+ assert .True (t , ok )
206+ assert .Equal (t , uint64 (77 ), dHeight )
200207}
201208
202209func TestDARetriever_ProcessBlobs_HeaderOnly_EmptyDataExpected (t * testing.T ) {
@@ -217,6 +224,14 @@ func TestDARetriever_ProcessBlobs_HeaderOnly_EmptyDataExpected(t *testing.T) {
217224 assert .Equal (t , uint64 (3 ), events [0 ].Header .Height ())
218225 assert .NotNil (t , events [0 ].Data )
219226 assert .Equal (t , uint64 (88 ), events [0 ].DaHeight )
227+
228+ hHeight , ok := r .cache .GetHeaderDAIncluded (events [0 ].Header .Hash ().String ())
229+ assert .True (t , ok )
230+ assert .Equal (t , uint64 (88 ), hHeight )
231+
232+ // empty data is not marked as data included (the submitter components does handle the empty data case)
233+ _ , ok = r .cache .GetDataDAIncluded (events [0 ].Data .DACommitment ().String ())
234+ assert .False (t , ok )
220235}
221236
222237func TestDARetriever_TryDecodeHeaderAndData_Basic (t * testing.T ) {
@@ -346,8 +361,6 @@ func TestDARetriever_ProcessBlobs_CrossDAHeightMatching(t *testing.T) {
346361
347362 // Verify header is stored in pending headers
348363 require .Contains (t , r .pendingHeaders , uint64 (5 ), "header should be stored as pending" )
349- require .Contains (t , r .headerDAHeights , uint64 (5 ), "header DA height should be tracked" )
350- assert .Equal (t , uint64 (100 ), r .headerDAHeights [5 ])
351364
352365 // Process data from DA height 102
353366 events2 := r .processBlobs (context .Background (), [][]byte {dataBin }, 102 )
@@ -357,12 +370,10 @@ func TestDARetriever_ProcessBlobs_CrossDAHeightMatching(t *testing.T) {
357370 assert .Equal (t , uint64 (5 ), event .Header .Height ())
358371 assert .Equal (t , uint64 (5 ), event .Data .Height ())
359372 assert .Equal (t , uint64 (102 ), event .DaHeight , "DaHeight should be the height where data was processed" )
360- assert .Equal (t , uint64 (100 ), event .HeaderDaIncludedHeight , "HeaderDaIncludedHeight should be where header was included" )
361373
362374 // Verify pending maps are cleared
363375 require .NotContains (t , r .pendingHeaders , uint64 (5 ), "header should be removed from pending" )
364376 require .NotContains (t , r .pendingData , uint64 (5 ), "data should be removed from pending" )
365- require .NotContains (t , r .headerDAHeights , uint64 (5 ), "header DA height should be removed" )
366377}
367378
368379func TestDARetriever_ProcessBlobs_MultipleHeadersCrossDAHeightMatching (t * testing.T ) {
@@ -393,9 +404,6 @@ func TestDARetriever_ProcessBlobs_MultipleHeadersCrossDAHeightMatching(t *testin
393404 require .Contains (t , r .pendingHeaders , uint64 (3 ), "header 3 should be pending" )
394405 require .Contains (t , r .pendingHeaders , uint64 (4 ), "header 4 should be pending" )
395406 require .Contains (t , r .pendingHeaders , uint64 (5 ), "header 5 should be pending" )
396- assert .Equal (t , uint64 (200 ), r .headerDAHeights [3 ])
397- assert .Equal (t , uint64 (200 ), r .headerDAHeights [4 ])
398- assert .Equal (t , uint64 (200 ), r .headerDAHeights [5 ])
399407
400408 // Process some data from DA height 203 - should create partial events
401409 events2 := r .processBlobs (context .Background (), [][]byte {data3Bin , data5Bin }, 203 )
@@ -410,13 +418,11 @@ func TestDARetriever_ProcessBlobs_MultipleHeadersCrossDAHeightMatching(t *testin
410418 assert .Equal (t , uint64 (3 ), events2 [0 ].Header .Height ())
411419 assert .Equal (t , uint64 (3 ), events2 [0 ].Data .Height ())
412420 assert .Equal (t , uint64 (203 ), events2 [0 ].DaHeight )
413- assert .Equal (t , uint64 (200 ), events2 [0 ].HeaderDaIncludedHeight )
414421
415422 // Verify event for height 5
416423 assert .Equal (t , uint64 (5 ), events2 [1 ].Header .Height ())
417424 assert .Equal (t , uint64 (5 ), events2 [1 ].Data .Height ())
418425 assert .Equal (t , uint64 (203 ), events2 [1 ].DaHeight )
419- assert .Equal (t , uint64 (200 ), events2 [1 ].HeaderDaIncludedHeight )
420426
421427 // Verify header 4 is still pending (no matching data yet)
422428 require .Contains (t , r .pendingHeaders , uint64 (4 ), "header 4 should still be pending" )
@@ -431,11 +437,9 @@ func TestDARetriever_ProcessBlobs_MultipleHeadersCrossDAHeightMatching(t *testin
431437 assert .Equal (t , uint64 (4 ), events3 [0 ].Header .Height ())
432438 assert .Equal (t , uint64 (4 ), events3 [0 ].Data .Height ())
433439 assert .Equal (t , uint64 (205 ), events3 [0 ].DaHeight )
434- assert .Equal (t , uint64 (200 ), events3 [0 ].HeaderDaIncludedHeight )
435440
436441 // Verify all pending maps are now clear
437442 require .NotContains (t , r .pendingHeaders , uint64 (4 ), "header 4 should be removed from pending" )
438443 require .Len (t , r .pendingHeaders , 0 , "all headers should be processed" )
439444 require .Len (t , r .pendingData , 0 , "all data should be processed" )
440- require .Len (t , r .headerDAHeights , 0 , "all header DA heights should be cleared" )
441445}
0 commit comments