Skip to content

Commit

Permalink
add missing genesis block end in datastream (#1170)
Browse files Browse the repository at this point in the history
  • Loading branch information
hexoscott authored and Stefan-Ethernal committed Sep 20, 2024
1 parent 4f4fd11 commit 0908273
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion zk/datastream/server/datastream_populate.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ func (srv *DataStreamServer) WriteGenesisToStream(
l2BlockBookmark := newL2BlockBookmarkEntryProto(genesis.NumberU64())

l2Block := newL2BlockProto(genesis, genesis.Hash().Bytes(), batchNo, ger, 0, 0, common.Hash{}, 0, common.Hash{})
l2BlockEnd := newL2BlockEndProto(0)
batchStart := newBatchStartProto(batchNo, srv.chainId, GenesisForkId, datastream.BatchType_BATCH_TYPE_REGULAR)

ler, err := utils.GetBatchLocalExitRootFromSCStorageForLatestBlock(0, reader, tx)
Expand All @@ -394,7 +395,7 @@ func (srv *DataStreamServer) WriteGenesisToStream(
}
batchEnd := newBatchEndProto(ler, genesis.Root(), 0)

if err = srv.commitEntriesToStreamProto([]DataStreamEntryProto{batchBookmark, batchStart, l2BlockBookmark, l2Block, batchEnd}); err != nil {
if err = srv.commitEntriesToStreamProto([]DataStreamEntryProto{batchBookmark, batchStart, l2BlockBookmark, l2Block, l2BlockEnd, batchEnd}); err != nil {
return err
}

Expand Down

0 comments on commit 0908273

Please sign in to comment.