From 9746252efe04c78ca321cabddb62c2acafbebb9c Mon Sep 17 00:00:00 2001 From: Valentin Staykov <79150443+V-Staykov@users.noreply.github.com> Date: Fri, 26 Jul 2024 14:52:59 +0300 Subject: [PATCH] fixed using correct blocks root for batch end (#853) --- zk/datastream/client/stream_client.go | 2 +- zk/datastream/server/data_stream_server.go | 4 ++-- zk/datastream/types/batch_proto.go | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/zk/datastream/client/stream_client.go b/zk/datastream/client/stream_client.go index a056320724b..1a3eb848e19 100644 --- a/zk/datastream/client/stream_client.go +++ b/zk/datastream/client/stream_client.go @@ -259,7 +259,7 @@ func (c *StreamClient) ReadAllEntriesToChannel() error { } // reset the channels as there could be data ahead of the bookmark we want to track here. - c.resetChannels() + // c.resetChannels() return err2 } diff --git a/zk/datastream/server/data_stream_server.go b/zk/datastream/server/data_stream_server.go index 80c40073204..47a357c6fe8 100644 --- a/zk/datastream/server/data_stream_server.go +++ b/zk/datastream/server/data_stream_server.go @@ -181,8 +181,8 @@ func createBlockWithBatchCheckStreamEntriesProto( if err != nil { return nil, err } - blockRoot := block.Root() - if endEntriesProto, err = addBatchEndEntriesProto(lastBatchNumber, &blockRoot, gers, &localExitRoot); err != nil { + lastBlockRoot := lastBlock.Root() + if endEntriesProto, err = addBatchEndEntriesProto(lastBatchNumber, &lastBlockRoot, gers, &localExitRoot); err != nil { return nil, err } } diff --git a/zk/datastream/types/batch_proto.go b/zk/datastream/types/batch_proto.go index 8fedd06d616..a3c390be89a 100644 --- a/zk/datastream/types/batch_proto.go +++ b/zk/datastream/types/batch_proto.go @@ -77,6 +77,7 @@ func UnmarshalBatchEnd(data []byte) (*BatchEnd, error) { } return &BatchEnd{ + Number: batchEnd.Number, LocalExitRoot: libcommon.BytesToHash(batchEnd.LocalExitRoot), StateRoot: libcommon.BytesToHash(batchEnd.StateRoot), Debug: ProcessDebug(batchEnd.Debug),