@@ -493,29 +493,31 @@ func GenerateDataStreamFile(ctx context.Context, streamServer *datastreamer.Stre
493
493
}
494
494
495
495
if len (batch .L2Blocks ) == 0 {
496
- // Empty batch
497
- // Check if there is a GER update
498
- if batch .GlobalExitRoot != currentGER && batch .GlobalExitRoot != (common.Hash {}) {
499
- updateGER := & datastream.UpdateGER {
500
- BatchNumber : batch .BatchNumber ,
501
- Timestamp : uint64 (batch .Timestamp .Unix ()),
502
- GlobalExitRoot : batch .GlobalExitRoot .Bytes (),
503
- Coinbase : batch .Coinbase .Bytes (),
504
- ForkId : batch .ForkID ,
505
- ChainId : chainID ,
506
- StateRoot : batch .StateRoot .Bytes (),
507
- }
496
+ if ! batch .WIP && batch .ForkID < FORKID_ETROG {
497
+ // Empty batch
498
+ // Check if there is a GER update
499
+ if batch .GlobalExitRoot != currentGER && batch .GlobalExitRoot != (common.Hash {}) {
500
+ updateGER := & datastream.UpdateGER {
501
+ BatchNumber : batch .BatchNumber ,
502
+ Timestamp : uint64 (batch .Timestamp .Unix ()),
503
+ GlobalExitRoot : batch .GlobalExitRoot .Bytes (),
504
+ Coinbase : batch .Coinbase .Bytes (),
505
+ ForkId : batch .ForkID ,
506
+ ChainId : chainID ,
507
+ StateRoot : batch .StateRoot .Bytes (),
508
+ }
508
509
509
- marshalledUpdateGER , err := proto .Marshal (updateGER )
510
- if err != nil {
511
- return err
512
- }
510
+ marshalledUpdateGER , err := proto .Marshal (updateGER )
511
+ if err != nil {
512
+ return err
513
+ }
513
514
514
- _ , err = streamServer .AddStreamEntry (datastreamer .EntryType (datastream .EntryType_ENTRY_TYPE_UPDATE_GER ), marshalledUpdateGER )
515
- if err != nil {
516
- return err
515
+ _ , err = streamServer .AddStreamEntry (datastreamer .EntryType (datastream .EntryType_ENTRY_TYPE_UPDATE_GER ), marshalledUpdateGER )
516
+ if err != nil {
517
+ return err
518
+ }
519
+ currentGER = batch .GlobalExitRoot
517
520
}
518
- currentGER = batch .GlobalExitRoot
519
521
}
520
522
} else {
521
523
for blockIndex , l2Block := range batch .L2Blocks {
0 commit comments