@@ -196,7 +196,14 @@ func TestDARetriever_ProcessBlobs_HeaderAndData_Success(t *testing.T) {
196
196
assert .Equal (t , uint64 (2 ), events [0 ].Header .Height ())
197
197
assert .Equal (t , uint64 (2 ), events [0 ].Data .Height ())
198
198
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 )
200
207
}
201
208
202
209
func TestDARetriever_ProcessBlobs_HeaderOnly_EmptyDataExpected (t * testing.T ) {
@@ -217,6 +224,14 @@ func TestDARetriever_ProcessBlobs_HeaderOnly_EmptyDataExpected(t *testing.T) {
217
224
assert .Equal (t , uint64 (3 ), events [0 ].Header .Height ())
218
225
assert .NotNil (t , events [0 ].Data )
219
226
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 )
220
235
}
221
236
222
237
func TestDARetriever_TryDecodeHeaderAndData_Basic (t * testing.T ) {
@@ -346,8 +361,6 @@ func TestDARetriever_ProcessBlobs_CrossDAHeightMatching(t *testing.T) {
346
361
347
362
// Verify header is stored in pending headers
348
363
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 ])
351
364
352
365
// Process data from DA height 102
353
366
events2 := r .processBlobs (context .Background (), [][]byte {dataBin }, 102 )
@@ -357,12 +370,10 @@ func TestDARetriever_ProcessBlobs_CrossDAHeightMatching(t *testing.T) {
357
370
assert .Equal (t , uint64 (5 ), event .Header .Height ())
358
371
assert .Equal (t , uint64 (5 ), event .Data .Height ())
359
372
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" )
361
373
362
374
// Verify pending maps are cleared
363
375
require .NotContains (t , r .pendingHeaders , uint64 (5 ), "header should be removed from pending" )
364
376
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" )
366
377
}
367
378
368
379
func TestDARetriever_ProcessBlobs_MultipleHeadersCrossDAHeightMatching (t * testing.T ) {
@@ -393,9 +404,6 @@ func TestDARetriever_ProcessBlobs_MultipleHeadersCrossDAHeightMatching(t *testin
393
404
require .Contains (t , r .pendingHeaders , uint64 (3 ), "header 3 should be pending" )
394
405
require .Contains (t , r .pendingHeaders , uint64 (4 ), "header 4 should be pending" )
395
406
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 ])
399
407
400
408
// Process some data from DA height 203 - should create partial events
401
409
events2 := r .processBlobs (context .Background (), [][]byte {data3Bin , data5Bin }, 203 )
@@ -410,13 +418,11 @@ func TestDARetriever_ProcessBlobs_MultipleHeadersCrossDAHeightMatching(t *testin
410
418
assert .Equal (t , uint64 (3 ), events2 [0 ].Header .Height ())
411
419
assert .Equal (t , uint64 (3 ), events2 [0 ].Data .Height ())
412
420
assert .Equal (t , uint64 (203 ), events2 [0 ].DaHeight )
413
- assert .Equal (t , uint64 (200 ), events2 [0 ].HeaderDaIncludedHeight )
414
421
415
422
// Verify event for height 5
416
423
assert .Equal (t , uint64 (5 ), events2 [1 ].Header .Height ())
417
424
assert .Equal (t , uint64 (5 ), events2 [1 ].Data .Height ())
418
425
assert .Equal (t , uint64 (203 ), events2 [1 ].DaHeight )
419
- assert .Equal (t , uint64 (200 ), events2 [1 ].HeaderDaIncludedHeight )
420
426
421
427
// Verify header 4 is still pending (no matching data yet)
422
428
require .Contains (t , r .pendingHeaders , uint64 (4 ), "header 4 should still be pending" )
@@ -431,11 +437,9 @@ func TestDARetriever_ProcessBlobs_MultipleHeadersCrossDAHeightMatching(t *testin
431
437
assert .Equal (t , uint64 (4 ), events3 [0 ].Header .Height ())
432
438
assert .Equal (t , uint64 (4 ), events3 [0 ].Data .Height ())
433
439
assert .Equal (t , uint64 (205 ), events3 [0 ].DaHeight )
434
- assert .Equal (t , uint64 (200 ), events3 [0 ].HeaderDaIncludedHeight )
435
440
436
441
// Verify all pending maps are now clear
437
442
require .NotContains (t , r .pendingHeaders , uint64 (4 ), "header 4 should be removed from pending" )
438
443
require .Len (t , r .pendingHeaders , 0 , "all headers should be processed" )
439
444
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" )
441
445
}
0 commit comments