diff --git a/proto/src/proto/datastream/v1/datastream.proto b/proto/src/proto/datastream/v1/datastream.proto index 9cdd0266c1..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 { @@ -86,4 +91,5 @@ enum BatchType { BATCH_TYPE_REGULAR = 1; BATCH_TYPE_FORCED = 2; BATCH_TYPE_INJECTED = 3; + BATCH_TYPE_INVALID = 4; } diff --git a/sequencer/sequencer.go b/sequencer/sequencer.go index eaeab94f33..dbee34221e 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 c3aa6c814f..0b6024f3f5 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") @@ -626,6 +683,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 02a0e2267f..1c9535ee38 100644 --- a/state/datastream/datastream.pb.go +++ b/state/datastream/datastream.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.32.0 -// protoc v4.25.3 +// protoc-gen-go v1.34.1 +// protoc v5.27.0 // source: datastream.proto package datastream @@ -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, } ) @@ -134,6 +137,7 @@ const ( BatchType_BATCH_TYPE_REGULAR BatchType = 1 BatchType_BATCH_TYPE_FORCED BatchType = 2 BatchType_BATCH_TYPE_INJECTED BatchType = 3 + BatchType_BATCH_TYPE_INVALID BatchType = 4 ) // Enum value maps for BatchType. @@ -143,12 +147,14 @@ var ( 1: "BATCH_TYPE_REGULAR", 2: "BATCH_TYPE_FORCED", 3: "BATCH_TYPE_INJECTED", + 4: "BATCH_TYPE_INVALID", } BatchType_value = map[string]int32{ "BATCH_TYPE_UNSPECIFIED": 0, "BATCH_TYPE_REGULAR": 1, "BATCH_TYPE_FORCED": 2, "BATCH_TYPE_INJECTED": 3, + "BATCH_TYPE_INVALID": 4, } ) @@ -480,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 @@ -497,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) } @@ -510,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 { @@ -523,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 { @@ -593,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) } @@ -606,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 { @@ -619,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 { @@ -690,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) } @@ -703,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 { @@ -716,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 { @@ -744,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) } @@ -757,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 { @@ -770,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 { @@ -837,77 +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, 0x6f, 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, 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 ( @@ -923,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 @@ -931,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() } @@ -994,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: @@ -1006,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: @@ -1018,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: @@ -1030,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 @@ -1048,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 7ec0d496ea..ee79039ed3 100644 --- a/test/config/debug.node.config.toml +++ b/test/config/debug.node.config.toml @@ -111,7 +111,7 @@ StateConsistencyCheckInterval = "5s" [Sequencer.StreamServer] Port = 6900 Filename = "/datastreamer/datastream.bin" - Version = 1 + Version = 4 WriteTimeout = "5s" InactivityTimeout = "120s" InactivityCheckInterval = "5s" diff --git a/test/config/test.node.config.toml b/test/config/test.node.config.toml index d13ff02ca5..040ef7058c 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 = 1 + Version = 4 ChainID = 1337 WriteTimeout = "5s" InactivityTimeout = "120s" diff --git a/tools/datastreamer/config/default.go b/tools/datastreamer/config/default.go index 74c6f35b24..dc7aa3bacf 100644 --- a/tools/datastreamer/config/default.go +++ b/tools/datastreamer/config/default.go @@ -9,7 +9,7 @@ StreamType = 1 [Offline] Port = 6901 Filename = "datastreamer.bin" -Version = 1 +Version = 4 ChainID = 1440 UpgradeEtrogBatchNumber = 0 diff --git a/tools/datastreamer/config/tool.config.toml b/tools/datastreamer/config/tool.config.toml index 60d04aafb3..8309edfe76 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 WriteTimeout = "5s" InactivityTimeout = "120s" diff --git a/tools/datastreamer/main.go b/tools/datastreamer/main.go index c6b43155f8..b0bc2680a0 100644 --- a/tools/datastreamer/main.go +++ b/tools/datastreamer/main.go @@ -297,7 +297,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) @@ -424,6 +424,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 } @@ -505,6 +514,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 } @@ -761,6 +779,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)