From 094a3d3c13dd4d2606182eb4b822a7928588a846 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toni=20Ram=C3=ADrez?= <58293609+ToniRamirezM@users.noreply.github.com> Date: Tue, 6 Aug 2024 13:06:56 +0200 Subject: [PATCH] add l2blockend to DS (#3751) (#3752) * add l2blockend to DS --- .../src/proto/datastream/v1/datastream.proto | 5 + sequencer/sequencer.go | 24 +- state/datastream.go | 75 ++++- state/datastream/datastream.pb.go | 303 +++++++++++------- test/config/debug.node.config.toml | 2 +- test/config/test.node.config.toml | 2 +- tools/datastreamer/README.md | 4 +- tools/datastreamer/config/default.go | 2 +- tools/datastreamer/config/tool.config.toml | 2 +- tools/datastreamer/main.go | 35 +- 10 files changed, 325 insertions(+), 129 deletions(-) diff --git a/proto/src/proto/datastream/v1/datastream.proto b/proto/src/proto/datastream/v1/datastream.proto index 31e1bec711..f514a03db4 100644 --- a/proto/src/proto/datastream/v1/datastream.proto +++ b/proto/src/proto/datastream/v1/datastream.proto @@ -36,6 +36,10 @@ message L2Block { Debug debug = 14; } +message L2BlockEnd { + uint64 number = 1; +} + message Transaction { uint64 l2block_number = 1; uint64 index = 2; @@ -79,6 +83,7 @@ enum EntryType { ENTRY_TYPE_TRANSACTION = 3; ENTRY_TYPE_BATCH_END = 4; ENTRY_TYPE_UPDATE_GER = 5; + ENTRY_TYPE_L2_BLOCK_END = 6; } enum BatchType { diff --git a/sequencer/sequencer.go b/sequencer/sequencer.go index 3f57d9cc85..6f0d458982 100644 --- a/sequencer/sequencer.go +++ b/sequencer/sequencer.go @@ -86,7 +86,7 @@ func (s *Sequencer) Start(ctx context.Context) { } if s.streamServer != nil { - go s.sendDataToStreamer(s.cfg.StreamServer.ChainID) + go s.sendDataToStreamer(s.cfg.StreamServer.ChainID, s.cfg.StreamServer.Version) } s.workerReadyTxsCond = newTimeoutCond(&sync.Mutex{}) @@ -129,7 +129,7 @@ func (s *Sequencer) checkStateInconsistency(ctx context.Context) { } func (s *Sequencer) updateDataStreamerFile(ctx context.Context, chainID uint64) { - err := state.GenerateDataStreamFile(ctx, s.streamServer, s.stateIntf, true, nil, chainID, s.cfg.StreamServer.UpgradeEtrogBatchNumber) + err := state.GenerateDataStreamFile(ctx, s.streamServer, s.stateIntf, true, nil, chainID, s.cfg.StreamServer.UpgradeEtrogBatchNumber, s.cfg.StreamServer.Version) if err != nil { log.Fatalf("failed to generate data streamer file, error: %v", err) } @@ -241,7 +241,7 @@ func (s *Sequencer) addTxToWorker(ctx context.Context, tx pool.Transaction) erro } // sendDataToStreamer sends data to the data stream server -func (s *Sequencer) sendDataToStreamer(chainID uint64) { +func (s *Sequencer) sendDataToStreamer(chainID uint64, version uint8) { var err error for { // Read error from previous iteration @@ -369,6 +369,24 @@ func (s *Sequencer) sendDataToStreamer(chainID uint64) { } } + if version >= state.DSVersion4 { + streamL2BlockEnd := &datastream.L2BlockEnd{ + Number: l2Block.L2BlockNumber, + } + + marshalledL2BlockEnd, err := proto.Marshal(streamL2BlockEnd) + if err != nil { + log.Errorf("failed to marshal l2block %d, error: %v", l2Block.L2BlockNumber, err) + continue + } + + _, err = s.streamServer.AddStreamEntry(datastreamer.EntryType(datastream.EntryType_ENTRY_TYPE_L2_BLOCK_END), marshalledL2BlockEnd) + if err != nil { + log.Errorf("failed to add stream entry for l2blockEnd %d, error: %v", l2Block.L2BlockNumber, err) + continue + } + } + err = s.streamServer.CommitAtomicOp() if err != nil { log.Errorf("failed to commit atomic op for l2block %d, error: %v ", l2Block.L2BlockNumber, err) diff --git a/state/datastream.go b/state/datastream.go index 236a69df43..f4f16965de 100644 --- a/state/datastream.go +++ b/state/datastream.go @@ -23,6 +23,10 @@ const ( SystemSC = "0x000000000000000000000000000000005ca1ab1e" // posConstant is the constant used to compute the position of the intermediate state root posConstant = 1 + // DSVersion3 is the first protobuf version + DSVersion3 uint8 = 3 + // DSVersion4 is the second protobuf version, includes l2BlockEnd + DSVersion4 uint8 = 4 ) // DSBatch represents a data stream batch @@ -87,7 +91,7 @@ type DSState interface { } // GenerateDataStreamFile generates or resumes a data stream file -func GenerateDataStreamFile(ctx context.Context, streamServer *datastreamer.StreamServer, stateDB DSState, readWIPBatch bool, imStateRoots *map[uint64][]byte, chainID uint64, upgradeEtrogBatchNumber uint64) error { +func GenerateDataStreamFile(ctx context.Context, streamServer *datastreamer.StreamServer, stateDB DSState, readWIPBatch bool, imStateRoots *map[uint64][]byte, chainID uint64, upgradeEtrogBatchNumber uint64, version uint8) error { header := streamServer.GetHeader() var currentBatchNumber uint64 = 0 @@ -177,6 +181,22 @@ func GenerateDataStreamFile(ctx context.Context, streamServer *datastreamer.Stre return err } + if version >= DSVersion4 { + genesisBlockEnd := &datastream.L2BlockEnd{ + Number: genesisL2Block.L2BlockNumber, + } + + marshalledGenesisBlockEnd, err := proto.Marshal(genesisBlockEnd) + if err != nil { + return err + } + + _, err = streamServer.AddStreamEntry(datastreamer.EntryType(datastream.EntryType_ENTRY_TYPE_L2_BLOCK_END), marshalledGenesisBlockEnd) + if err != nil { + return err + } + } + genesisBatchEnd := &datastream.BatchEnd{ Number: genesisL2Block.BatchNumber, LocalExitRoot: common.Hash{}.Bytes(), @@ -249,6 +269,43 @@ func GenerateDataStreamFile(ctx context.Context, streamServer *datastreamer.Stre currentBatchNumber = l2Block.BatchNumber previousTimestamp = l2Block.Timestamp lastAddedL2BlockNumber = currentL2BlockNumber + + case datastreamer.EntryType(datastream.EntryType_ENTRY_TYPE_L2_BLOCK_END): + log.Info("Latest entry type is L2BlockEnd") + + l2BlockEnd := &datastream.L2BlockEnd{} + if err := proto.Unmarshal(latestEntry.Data, l2BlockEnd); err != nil { + return err + } + + currentL2BlockNumber := l2BlockEnd.Number + + // Getting the l2 block is needed in order to get the batch number and the timestamp + bookMark := &datastream.BookMark{ + Type: datastream.BookmarkType_BOOKMARK_TYPE_L2_BLOCK, + Value: currentL2BlockNumber, + } + + marshalledBookMark, err := proto.Marshal(bookMark) + if err != nil { + return err + } + + l2BlockEntry, err := streamServer.GetFirstEventAfterBookmark(marshalledBookMark) + if err != nil { + return err + } + + l2Block := &datastream.L2Block{} + + if err := proto.Unmarshal(l2BlockEntry.Data, l2Block); err != nil { + return err + } + + currentBatchNumber = l2Block.BatchNumber + previousTimestamp = l2Block.Timestamp + lastAddedL2BlockNumber = currentL2BlockNumber + case datastreamer.EntryType(datastream.EntryType_ENTRY_TYPE_TRANSACTION): log.Info("Latest entry type is Transaction") @@ -607,6 +664,22 @@ func GenerateDataStreamFile(ctx context.Context, streamServer *datastreamer.Stre } currentGER = l2Block.GlobalExitRoot + + if version >= DSVersion4 { + streamL2BlockEnd := &datastream.L2BlockEnd{ + Number: l2Block.L2BlockNumber, + } + + marshalledL2BlockEnd, err := proto.Marshal(streamL2BlockEnd) + if err != nil { + return err + } + + _, err = streamServer.AddStreamEntry(datastreamer.EntryType(datastream.EntryType_ENTRY_TYPE_L2_BLOCK_END), marshalledL2BlockEnd) + if err != nil { + return err + } + } } } diff --git a/state/datastream/datastream.pb.go b/state/datastream/datastream.pb.go index 5515469731..1c9535ee38 100644 --- a/state/datastream/datastream.pb.go +++ b/state/datastream/datastream.pb.go @@ -72,12 +72,13 @@ func (BookmarkType) EnumDescriptor() ([]byte, []int) { type EntryType int32 const ( - EntryType_ENTRY_TYPE_UNSPECIFIED EntryType = 0 - EntryType_ENTRY_TYPE_BATCH_START EntryType = 1 - EntryType_ENTRY_TYPE_L2_BLOCK EntryType = 2 - EntryType_ENTRY_TYPE_TRANSACTION EntryType = 3 - EntryType_ENTRY_TYPE_BATCH_END EntryType = 4 - EntryType_ENTRY_TYPE_UPDATE_GER EntryType = 5 + EntryType_ENTRY_TYPE_UNSPECIFIED EntryType = 0 + EntryType_ENTRY_TYPE_BATCH_START EntryType = 1 + EntryType_ENTRY_TYPE_L2_BLOCK EntryType = 2 + EntryType_ENTRY_TYPE_TRANSACTION EntryType = 3 + EntryType_ENTRY_TYPE_BATCH_END EntryType = 4 + EntryType_ENTRY_TYPE_UPDATE_GER EntryType = 5 + EntryType_ENTRY_TYPE_L2_BLOCK_END EntryType = 6 ) // Enum value maps for EntryType. @@ -89,14 +90,16 @@ var ( 3: "ENTRY_TYPE_TRANSACTION", 4: "ENTRY_TYPE_BATCH_END", 5: "ENTRY_TYPE_UPDATE_GER", + 6: "ENTRY_TYPE_L2_BLOCK_END", } EntryType_value = map[string]int32{ - "ENTRY_TYPE_UNSPECIFIED": 0, - "ENTRY_TYPE_BATCH_START": 1, - "ENTRY_TYPE_L2_BLOCK": 2, - "ENTRY_TYPE_TRANSACTION": 3, - "ENTRY_TYPE_BATCH_END": 4, - "ENTRY_TYPE_UPDATE_GER": 5, + "ENTRY_TYPE_UNSPECIFIED": 0, + "ENTRY_TYPE_BATCH_START": 1, + "ENTRY_TYPE_L2_BLOCK": 2, + "ENTRY_TYPE_TRANSACTION": 3, + "ENTRY_TYPE_BATCH_END": 4, + "ENTRY_TYPE_UPDATE_GER": 5, + "ENTRY_TYPE_L2_BLOCK_END": 6, } ) @@ -483,6 +486,53 @@ func (x *L2Block) GetDebug() *Debug { return nil } +type L2BlockEnd struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Number uint64 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"` +} + +func (x *L2BlockEnd) Reset() { + *x = L2BlockEnd{} + if protoimpl.UnsafeEnabled { + mi := &file_datastream_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *L2BlockEnd) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*L2BlockEnd) ProtoMessage() {} + +func (x *L2BlockEnd) ProtoReflect() protoreflect.Message { + mi := &file_datastream_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use L2BlockEnd.ProtoReflect.Descriptor instead. +func (*L2BlockEnd) Descriptor() ([]byte, []int) { + return file_datastream_proto_rawDescGZIP(), []int{3} +} + +func (x *L2BlockEnd) GetNumber() uint64 { + if x != nil { + return x.Number + } + return 0 +} + type Transaction struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -500,7 +550,7 @@ type Transaction struct { func (x *Transaction) Reset() { *x = Transaction{} if protoimpl.UnsafeEnabled { - mi := &file_datastream_proto_msgTypes[3] + mi := &file_datastream_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -513,7 +563,7 @@ func (x *Transaction) String() string { func (*Transaction) ProtoMessage() {} func (x *Transaction) ProtoReflect() protoreflect.Message { - mi := &file_datastream_proto_msgTypes[3] + mi := &file_datastream_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -526,7 +576,7 @@ func (x *Transaction) ProtoReflect() protoreflect.Message { // Deprecated: Use Transaction.ProtoReflect.Descriptor instead. func (*Transaction) Descriptor() ([]byte, []int) { - return file_datastream_proto_rawDescGZIP(), []int{3} + return file_datastream_proto_rawDescGZIP(), []int{4} } func (x *Transaction) GetL2BlockNumber() uint64 { @@ -596,7 +646,7 @@ type UpdateGER struct { func (x *UpdateGER) Reset() { *x = UpdateGER{} if protoimpl.UnsafeEnabled { - mi := &file_datastream_proto_msgTypes[4] + mi := &file_datastream_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -609,7 +659,7 @@ func (x *UpdateGER) String() string { func (*UpdateGER) ProtoMessage() {} func (x *UpdateGER) ProtoReflect() protoreflect.Message { - mi := &file_datastream_proto_msgTypes[4] + mi := &file_datastream_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -622,7 +672,7 @@ func (x *UpdateGER) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateGER.ProtoReflect.Descriptor instead. func (*UpdateGER) Descriptor() ([]byte, []int) { - return file_datastream_proto_rawDescGZIP(), []int{4} + return file_datastream_proto_rawDescGZIP(), []int{5} } func (x *UpdateGER) GetBatchNumber() uint64 { @@ -693,7 +743,7 @@ type BookMark struct { func (x *BookMark) Reset() { *x = BookMark{} if protoimpl.UnsafeEnabled { - mi := &file_datastream_proto_msgTypes[5] + mi := &file_datastream_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -706,7 +756,7 @@ func (x *BookMark) String() string { func (*BookMark) ProtoMessage() {} func (x *BookMark) ProtoReflect() protoreflect.Message { - mi := &file_datastream_proto_msgTypes[5] + mi := &file_datastream_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -719,7 +769,7 @@ func (x *BookMark) ProtoReflect() protoreflect.Message { // Deprecated: Use BookMark.ProtoReflect.Descriptor instead. func (*BookMark) Descriptor() ([]byte, []int) { - return file_datastream_proto_rawDescGZIP(), []int{5} + return file_datastream_proto_rawDescGZIP(), []int{6} } func (x *BookMark) GetType() BookmarkType { @@ -747,7 +797,7 @@ type Debug struct { func (x *Debug) Reset() { *x = Debug{} if protoimpl.UnsafeEnabled { - mi := &file_datastream_proto_msgTypes[6] + mi := &file_datastream_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -760,7 +810,7 @@ func (x *Debug) String() string { func (*Debug) ProtoMessage() {} func (x *Debug) ProtoReflect() protoreflect.Message { - mi := &file_datastream_proto_msgTypes[6] + mi := &file_datastream_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -773,7 +823,7 @@ func (x *Debug) ProtoReflect() protoreflect.Message { // Deprecated: Use Debug.ProtoReflect.Descriptor instead. func (*Debug) Descriptor() ([]byte, []int) { - return file_datastream_proto_rawDescGZIP(), []int{6} + return file_datastream_proto_rawDescGZIP(), []int{7} } func (x *Debug) GetMessage() string { @@ -840,79 +890,83 @@ var file_datastream_proto_rawDesc = []byte{ 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2a, 0x0a, 0x05, 0x64, 0x65, 0x62, 0x75, 0x67, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x62, 0x75, 0x67, 0x52, 0x05, - 0x64, 0x65, 0x62, 0x75, 0x67, 0x22, 0x94, 0x02, 0x0a, 0x0b, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x0a, 0x0e, 0x6c, 0x32, 0x62, 0x6c, 0x6f, 0x63, 0x6b, - 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x6c, - 0x32, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, - 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x69, 0x6e, 0x64, - 0x65, 0x78, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x12, 0x18, 0x0a, - 0x07, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, - 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x12, 0x43, 0x0a, 0x1e, 0x65, 0x66, 0x66, 0x65, 0x63, - 0x74, 0x69, 0x76, 0x65, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x5f, 0x70, - 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x1b, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x47, 0x61, 0x73, 0x50, 0x72, 0x69, - 0x63, 0x65, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x12, 0x22, 0x0a, 0x0d, - 0x69, 0x6d, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x69, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, - 0x12, 0x2a, 0x0a, 0x05, 0x64, 0x65, 0x62, 0x75, 0x67, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x14, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, - 0x44, 0x65, 0x62, 0x75, 0x67, 0x52, 0x05, 0x64, 0x65, 0x62, 0x75, 0x67, 0x22, 0x91, 0x02, 0x0a, - 0x09, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, 0x45, 0x52, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x61, - 0x74, 0x63, 0x68, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x0b, 0x62, 0x61, 0x74, 0x63, 0x68, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1c, 0x0a, - 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x28, 0x0a, 0x10, 0x67, - 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x45, 0x78, 0x69, - 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, - 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, - 0x65, 0x12, 0x17, 0x0a, 0x07, 0x66, 0x6f, 0x72, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6b, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, - 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x63, 0x68, - 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, - 0x6f, 0x6f, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2a, 0x0a, 0x05, 0x64, 0x65, 0x62, 0x75, 0x67, 0x18, 0x08, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, - 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x62, 0x75, 0x67, 0x52, 0x05, 0x64, 0x65, 0x62, 0x75, 0x67, - 0x22, 0x51, 0x0a, 0x08, 0x42, 0x6f, 0x6f, 0x6b, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x2f, 0x0a, 0x04, - 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x64, 0x61, 0x74, - 0x61, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6f, 0x6f, 0x6b, 0x6d, - 0x61, 0x72, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x22, 0x21, 0x0a, 0x05, 0x44, 0x65, 0x62, 0x75, 0x67, 0x12, 0x18, 0x0a, 0x07, - 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2a, 0x62, 0x0a, 0x0c, 0x42, 0x6f, 0x6f, 0x6b, 0x6d, 0x61, - 0x72, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x19, 0x42, 0x4f, 0x4f, 0x4b, 0x4d, 0x41, - 0x52, 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, - 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, 0x42, 0x4f, 0x4f, 0x4b, 0x4d, 0x41, 0x52, - 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x41, 0x54, 0x43, 0x48, 0x10, 0x01, 0x12, 0x1a, - 0x0a, 0x16, 0x42, 0x4f, 0x4f, 0x4b, 0x4d, 0x41, 0x52, 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, - 0x4c, 0x32, 0x5f, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x10, 0x02, 0x2a, 0xad, 0x01, 0x0a, 0x09, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x16, 0x45, 0x4e, 0x54, 0x52, - 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, - 0x45, 0x44, 0x10, 0x00, 0x12, 0x1a, 0x0a, 0x16, 0x45, 0x4e, 0x54, 0x52, 0x59, 0x5f, 0x54, 0x59, - 0x50, 0x45, 0x5f, 0x42, 0x41, 0x54, 0x43, 0x48, 0x5f, 0x53, 0x54, 0x41, 0x52, 0x54, 0x10, 0x01, - 0x12, 0x17, 0x0a, 0x13, 0x45, 0x4e, 0x54, 0x52, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4c, - 0x32, 0x5f, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x10, 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x45, 0x4e, 0x54, - 0x52, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x41, 0x43, 0x54, - 0x49, 0x4f, 0x4e, 0x10, 0x03, 0x12, 0x18, 0x0a, 0x14, 0x45, 0x4e, 0x54, 0x52, 0x59, 0x5f, 0x54, - 0x59, 0x50, 0x45, 0x5f, 0x42, 0x41, 0x54, 0x43, 0x48, 0x5f, 0x45, 0x4e, 0x44, 0x10, 0x04, 0x12, - 0x19, 0x0a, 0x15, 0x45, 0x4e, 0x54, 0x52, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x50, - 0x44, 0x41, 0x54, 0x45, 0x5f, 0x47, 0x45, 0x52, 0x10, 0x05, 0x2a, 0x87, 0x01, 0x0a, 0x09, 0x42, - 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x16, 0x42, 0x41, 0x54, 0x43, - 0x48, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, - 0x45, 0x44, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x42, 0x41, 0x54, 0x43, 0x48, 0x5f, 0x54, 0x59, - 0x50, 0x45, 0x5f, 0x52, 0x45, 0x47, 0x55, 0x4c, 0x41, 0x52, 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, - 0x42, 0x41, 0x54, 0x43, 0x48, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x4f, 0x52, 0x43, 0x45, - 0x44, 0x10, 0x02, 0x12, 0x17, 0x0a, 0x13, 0x42, 0x41, 0x54, 0x43, 0x48, 0x5f, 0x54, 0x59, 0x50, - 0x45, 0x5f, 0x49, 0x4e, 0x4a, 0x45, 0x43, 0x54, 0x45, 0x44, 0x10, 0x03, 0x12, 0x16, 0x0a, 0x12, - 0x42, 0x41, 0x54, 0x43, 0x48, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, - 0x49, 0x44, 0x10, 0x04, 0x42, 0x38, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x30, 0x78, 0x50, 0x6f, 0x6c, 0x79, 0x67, 0x6f, 0x6e, 0x48, 0x65, 0x72, 0x6d, - 0x65, 0x7a, 0x2f, 0x7a, 0x6b, 0x65, 0x76, 0x6d, 0x2d, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x73, 0x74, - 0x61, 0x74, 0x65, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x64, 0x65, 0x62, 0x75, 0x67, 0x22, 0x24, 0x0a, 0x0a, 0x4c, 0x32, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x45, 0x6e, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x94, 0x02, 0x0a, 0x0b, + 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x0a, 0x0e, 0x6c, + 0x32, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x0d, 0x6c, 0x32, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, + 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x73, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x12, 0x43, 0x0a, + 0x1e, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x70, + 0x72, 0x69, 0x63, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x1b, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, + 0x47, 0x61, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, + 0x67, 0x65, 0x12, 0x22, 0x0a, 0x0d, 0x69, 0x6d, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, + 0x6f, 0x6f, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x69, 0x6d, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2a, 0x0a, 0x05, 0x64, 0x65, 0x62, 0x75, 0x67, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x72, 0x65, + 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x62, 0x75, 0x67, 0x52, 0x05, 0x64, 0x65, 0x62, + 0x75, 0x67, 0x22, 0x91, 0x02, 0x0a, 0x09, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, 0x45, 0x52, + 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x61, 0x74, 0x63, 0x68, 0x4e, 0x75, 0x6d, + 0x62, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x12, 0x28, 0x0a, 0x10, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x5f, 0x65, 0x78, 0x69, 0x74, + 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x67, 0x6c, 0x6f, + 0x62, 0x61, 0x6c, 0x45, 0x78, 0x69, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x63, + 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x63, + 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x66, 0x6f, 0x72, 0x6b, 0x5f, + 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6b, 0x49, 0x64, + 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x73, + 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2a, 0x0a, 0x05, 0x64, 0x65, + 0x62, 0x75, 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x64, 0x61, 0x74, 0x61, + 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x62, 0x75, 0x67, 0x52, + 0x05, 0x64, 0x65, 0x62, 0x75, 0x67, 0x22, 0x51, 0x0a, 0x08, 0x42, 0x6f, 0x6f, 0x6b, 0x4d, 0x61, + 0x72, 0x6b, 0x12, 0x2f, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x1b, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x76, 0x31, + 0x2e, 0x42, 0x6f, 0x6f, 0x6b, 0x6d, 0x61, 0x72, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x21, 0x0a, 0x05, 0x44, 0x65, 0x62, + 0x75, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2a, 0x62, 0x0a, 0x0c, + 0x42, 0x6f, 0x6f, 0x6b, 0x6d, 0x61, 0x72, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x19, + 0x42, 0x4f, 0x4f, 0x4b, 0x4d, 0x41, 0x52, 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, + 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, 0x42, + 0x4f, 0x4f, 0x4b, 0x4d, 0x41, 0x52, 0x4b, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x41, 0x54, + 0x43, 0x48, 0x10, 0x01, 0x12, 0x1a, 0x0a, 0x16, 0x42, 0x4f, 0x4f, 0x4b, 0x4d, 0x41, 0x52, 0x4b, + 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4c, 0x32, 0x5f, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x10, 0x02, + 0x2a, 0xca, 0x01, 0x0a, 0x09, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, + 0x0a, 0x16, 0x45, 0x4e, 0x54, 0x52, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, + 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1a, 0x0a, 0x16, 0x45, 0x4e, + 0x54, 0x52, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x41, 0x54, 0x43, 0x48, 0x5f, 0x53, + 0x54, 0x41, 0x52, 0x54, 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x45, 0x4e, 0x54, 0x52, 0x59, 0x5f, + 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4c, 0x32, 0x5f, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x10, 0x02, 0x12, + 0x1a, 0x0a, 0x16, 0x45, 0x4e, 0x54, 0x52, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x54, 0x52, + 0x41, 0x4e, 0x53, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x03, 0x12, 0x18, 0x0a, 0x14, 0x45, + 0x4e, 0x54, 0x52, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x41, 0x54, 0x43, 0x48, 0x5f, + 0x45, 0x4e, 0x44, 0x10, 0x04, 0x12, 0x19, 0x0a, 0x15, 0x45, 0x4e, 0x54, 0x52, 0x59, 0x5f, 0x54, + 0x59, 0x50, 0x45, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5f, 0x47, 0x45, 0x52, 0x10, 0x05, + 0x12, 0x1b, 0x0a, 0x17, 0x45, 0x4e, 0x54, 0x52, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4c, + 0x32, 0x5f, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x5f, 0x45, 0x4e, 0x44, 0x10, 0x06, 0x2a, 0x87, 0x01, + 0x0a, 0x09, 0x42, 0x61, 0x74, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x16, 0x42, + 0x41, 0x54, 0x43, 0x48, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, + 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x42, 0x41, 0x54, 0x43, 0x48, + 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x52, 0x45, 0x47, 0x55, 0x4c, 0x41, 0x52, 0x10, 0x01, 0x12, + 0x15, 0x0a, 0x11, 0x42, 0x41, 0x54, 0x43, 0x48, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x4f, + 0x52, 0x43, 0x45, 0x44, 0x10, 0x02, 0x12, 0x17, 0x0a, 0x13, 0x42, 0x41, 0x54, 0x43, 0x48, 0x5f, + 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4e, 0x4a, 0x45, 0x43, 0x54, 0x45, 0x44, 0x10, 0x03, 0x12, + 0x16, 0x0a, 0x12, 0x42, 0x41, 0x54, 0x43, 0x48, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4e, + 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x04, 0x42, 0x38, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x30, 0x78, 0x50, 0x6f, 0x6c, 0x79, 0x67, 0x6f, 0x6e, 0x48, + 0x65, 0x72, 0x6d, 0x65, 0x7a, 0x2f, 0x7a, 0x6b, 0x65, 0x76, 0x6d, 0x2d, 0x6e, 0x6f, 0x64, 0x65, + 0x2f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x72, 0x65, 0x61, + 0x6d, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -928,7 +982,7 @@ func file_datastream_proto_rawDescGZIP() []byte { } var file_datastream_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_datastream_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_datastream_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_datastream_proto_goTypes = []interface{}{ (BookmarkType)(0), // 0: datastream.v1.BookmarkType (EntryType)(0), // 1: datastream.v1.EntryType @@ -936,24 +990,25 @@ var file_datastream_proto_goTypes = []interface{}{ (*BatchStart)(nil), // 3: datastream.v1.BatchStart (*BatchEnd)(nil), // 4: datastream.v1.BatchEnd (*L2Block)(nil), // 5: datastream.v1.L2Block - (*Transaction)(nil), // 6: datastream.v1.Transaction - (*UpdateGER)(nil), // 7: datastream.v1.UpdateGER - (*BookMark)(nil), // 8: datastream.v1.BookMark - (*Debug)(nil), // 9: datastream.v1.Debug + (*L2BlockEnd)(nil), // 6: datastream.v1.L2BlockEnd + (*Transaction)(nil), // 7: datastream.v1.Transaction + (*UpdateGER)(nil), // 8: datastream.v1.UpdateGER + (*BookMark)(nil), // 9: datastream.v1.BookMark + (*Debug)(nil), // 10: datastream.v1.Debug } var file_datastream_proto_depIdxs = []int32{ - 2, // 0: datastream.v1.BatchStart.type:type_name -> datastream.v1.BatchType - 9, // 1: datastream.v1.BatchStart.debug:type_name -> datastream.v1.Debug - 9, // 2: datastream.v1.BatchEnd.debug:type_name -> datastream.v1.Debug - 9, // 3: datastream.v1.L2Block.debug:type_name -> datastream.v1.Debug - 9, // 4: datastream.v1.Transaction.debug:type_name -> datastream.v1.Debug - 9, // 5: datastream.v1.UpdateGER.debug:type_name -> datastream.v1.Debug - 0, // 6: datastream.v1.BookMark.type:type_name -> datastream.v1.BookmarkType - 7, // [7:7] is the sub-list for method output_type - 7, // [7:7] is the sub-list for method input_type - 7, // [7:7] is the sub-list for extension type_name - 7, // [7:7] is the sub-list for extension extendee - 0, // [0:7] is the sub-list for field type_name + 2, // 0: datastream.v1.BatchStart.type:type_name -> datastream.v1.BatchType + 10, // 1: datastream.v1.BatchStart.debug:type_name -> datastream.v1.Debug + 10, // 2: datastream.v1.BatchEnd.debug:type_name -> datastream.v1.Debug + 10, // 3: datastream.v1.L2Block.debug:type_name -> datastream.v1.Debug + 10, // 4: datastream.v1.Transaction.debug:type_name -> datastream.v1.Debug + 10, // 5: datastream.v1.UpdateGER.debug:type_name -> datastream.v1.Debug + 0, // 6: datastream.v1.BookMark.type:type_name -> datastream.v1.BookmarkType + 7, // [7:7] is the sub-list for method output_type + 7, // [7:7] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name } func init() { file_datastream_proto_init() } @@ -999,7 +1054,7 @@ func file_datastream_proto_init() { } } file_datastream_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Transaction); i { + switch v := v.(*L2BlockEnd); i { case 0: return &v.state case 1: @@ -1011,7 +1066,7 @@ func file_datastream_proto_init() { } } file_datastream_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateGER); i { + switch v := v.(*Transaction); i { case 0: return &v.state case 1: @@ -1023,7 +1078,7 @@ func file_datastream_proto_init() { } } file_datastream_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BookMark); i { + switch v := v.(*UpdateGER); i { case 0: return &v.state case 1: @@ -1035,6 +1090,18 @@ func file_datastream_proto_init() { } } file_datastream_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BookMark); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_datastream_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Debug); i { case 0: return &v.state @@ -1053,7 +1120,7 @@ func file_datastream_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_datastream_proto_rawDesc, NumEnums: 3, - NumMessages: 7, + NumMessages: 8, NumExtensions: 0, NumServices: 0, }, diff --git a/test/config/debug.node.config.toml b/test/config/debug.node.config.toml index 94f4d05ed4..42ab8ca363 100644 --- a/test/config/debug.node.config.toml +++ b/test/config/debug.node.config.toml @@ -125,7 +125,7 @@ StateConsistencyCheckInterval = "5s" [Sequencer.StreamServer] Port = 6900 Filename = "/datastreamer/datastream.bin" - Version = 3 + Version = 4 ChainID = 1337 WriteTimeout = "5s" Enabled = false diff --git a/test/config/test.node.config.toml b/test/config/test.node.config.toml index 11b4f6c2e3..26f39ddb8f 100644 --- a/test/config/test.node.config.toml +++ b/test/config/test.node.config.toml @@ -126,7 +126,7 @@ StateConsistencyCheckInterval = "5s" [Sequencer.StreamServer] Port = 6900 Filename = "/datastreamer/datastream.bin" - Version = 3 + Version = 4 ChainID = 1337 WriteTimeout = "5s" Enabled = true diff --git a/tools/datastreamer/README.md b/tools/datastreamer/README.md index f1b43385bd..d80cf689c7 100644 --- a/tools/datastreamer/README.md +++ b/tools/datastreamer/README.md @@ -14,7 +14,7 @@ StreamType = 1 [Offline] Port = 6901 Filename = "datastream.bin" -Version = 3 +Version = 4 ChainID = 1440 UpgradeEtrogBatchNumber = 0 @@ -44,7 +44,7 @@ Outputs = ["stdout"] - It is used to work with local datastream files. This section is also used during local data stream file generation. - Port: The data stream library requires a port, this must be a free port in the machine where the tool is running. - Filename: Full path and file name of the datastream to generate or query. - - Version: It will be added to the data stream file header. Current version is 3. It is only for information, but it is recommended to properly set it to the correct value. + - Version: It will be added to the data stream file header. Current version is 4. Supported versions are 3 and 4. Version 4 includes a l2BlockEnd entry at the end of every l2block that version 3 lacks. - ChainID: L2 Chain ID. It is used during data stream files generation. - UpgradeEtrogBatchMNumber: Only useful for chains that started before Fork ID Etrog. This value must be the batch number of the firtst etrog batch. The reason for this is that the first batch for an upgrade to Etrog contains a transaction generated by the rollup smart contract that must be handled in a special way as it has not been sequenced by the sequencer, but synchronized from L1. - **StateDB Section**: diff --git a/tools/datastreamer/config/default.go b/tools/datastreamer/config/default.go index 7682b66dcf..ae75782c77 100644 --- a/tools/datastreamer/config/default.go +++ b/tools/datastreamer/config/default.go @@ -9,7 +9,7 @@ StreamType = 1 [Offline] Port = 6901 Filename = "datastream.bin" -Version = 3 +Version = 4 ChainID = 1440 WriteTimeout = "5s" UpgradeEtrogBatchNumber = 0 diff --git a/tools/datastreamer/config/tool.config.toml b/tools/datastreamer/config/tool.config.toml index 34044c2f1f..0b7843e368 100644 --- a/tools/datastreamer/config/tool.config.toml +++ b/tools/datastreamer/config/tool.config.toml @@ -5,7 +5,7 @@ StreamType = 1 [Offline] Port = 6901 Filename = "datastream.bin" -Version = 3 +Version = 4 ChainID = 1440 UpgradeEtrogBatchNumber = 0 diff --git a/tools/datastreamer/main.go b/tools/datastreamer/main.go index 9777cb6b36..41cd929755 100644 --- a/tools/datastreamer/main.go +++ b/tools/datastreamer/main.go @@ -356,7 +356,7 @@ func generate(cliCtx *cli.Context) error { } } - err = state.GenerateDataStreamFile(cliCtx.Context, streamServer, stateDB, false, &imStateRoots, c.Offline.ChainID, c.Offline.UpgradeEtrogBatchNumber) + err = state.GenerateDataStreamFile(cliCtx.Context, streamServer, stateDB, false, &imStateRoots, c.Offline.ChainID, c.Offline.UpgradeEtrogBatchNumber, c.Offline.Version) if err != nil { log.Error(err) os.Exit(1) @@ -483,6 +483,15 @@ func decodeL2Block(cliCtx *cli.Context) error { i++ } + if c.Offline.Version >= state.DSVersion4 { + l2BlockEnd, err := client.ExecCommandGetEntry(secondEntry.Number) + if err != nil { + log.Error(err) + os.Exit(1) + } + printEntry(l2BlockEnd) + } + return nil } @@ -564,6 +573,15 @@ func decodeL2BlockOffline(cliCtx *cli.Context) error { i++ } + if c.Offline.Version >= state.DSVersion4 { + l2BlockEnd, err := streamServer.GetEntry(secondEntry.Number) + if err != nil { + log.Error(err) + os.Exit(1) + } + printEntry(l2BlockEnd) + } + return nil } @@ -956,6 +974,21 @@ func printEntry(entry datastreamer.FileEntry) { printColored(color.FgHiWhite, fmt.Sprintf("%s\n", l2Block.Debug)) } + case datastreamer.EntryType(datastream.EntryType_ENTRY_TYPE_L2_BLOCK_END): + l2BlockEnd := &datastream.L2BlockEnd{} + err := proto.Unmarshal(entry.Data, l2BlockEnd) + if err != nil { + log.Error(err) + os.Exit(1) + } + + printColored(color.FgGreen, "Entry Type......: ") + printColored(color.FgHiYellow, "L2 Block End\n") + printColored(color.FgGreen, "Entry Number....: ") + printColored(color.FgHiWhite, fmt.Sprintf("%d\n", entry.Number)) + printColored(color.FgGreen, "L2 Block Number.: ") + printColored(color.FgHiWhite, fmt.Sprintf("%d\n", l2BlockEnd.Number)) + case datastreamer.EntryType(datastream.EntryType_ENTRY_TYPE_BATCH_START): batch := &datastream.BatchStart{} err := proto.Unmarshal(entry.Data, batch)