diff --git a/gointerfaces/txpool/txpool.pb.go b/gointerfaces/txpool/txpool.pb.go index 2dd38f2ff..040ae6bbf 100644 --- a/gointerfaces/txpool/txpool.pb.go +++ b/gointerfaces/txpool/txpool.pb.go @@ -539,6 +539,99 @@ func (x *AllReply) GetTxs() []*AllReply_Tx { return nil } +type StatusRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *StatusRequest) Reset() { + *x = StatusRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_txpool_txpool_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StatusRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StatusRequest) ProtoMessage() {} + +func (x *StatusRequest) ProtoReflect() protoreflect.Message { + mi := &file_txpool_txpool_proto_msgTypes[9] + 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 StatusRequest.ProtoReflect.Descriptor instead. +func (*StatusRequest) Descriptor() ([]byte, []int) { + return file_txpool_txpool_proto_rawDescGZIP(), []int{9} +} + +type StatusReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PendingCount uint32 `protobuf:"varint,1,opt,name=pendingCount,proto3" json:"pendingCount,omitempty"` + QueuedCount uint32 `protobuf:"varint,2,opt,name=queuedCount,proto3" json:"queuedCount,omitempty"` +} + +func (x *StatusReply) Reset() { + *x = StatusReply{} + if protoimpl.UnsafeEnabled { + mi := &file_txpool_txpool_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StatusReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StatusReply) ProtoMessage() {} + +func (x *StatusReply) ProtoReflect() protoreflect.Message { + mi := &file_txpool_txpool_proto_msgTypes[10] + 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 StatusReply.ProtoReflect.Descriptor instead. +func (*StatusReply) Descriptor() ([]byte, []int) { + return file_txpool_txpool_proto_rawDescGZIP(), []int{10} +} + +func (x *StatusReply) GetPendingCount() uint32 { + if x != nil { + return x.PendingCount + } + return 0 +} + +func (x *StatusReply) GetQueuedCount() uint32 { + if x != nil { + return x.QueuedCount + } + return 0 +} + type AllReply_Tx struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -552,7 +645,7 @@ type AllReply_Tx struct { func (x *AllReply_Tx) Reset() { *x = AllReply_Tx{} if protoimpl.UnsafeEnabled { - mi := &file_txpool_txpool_proto_msgTypes[9] + mi := &file_txpool_txpool_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -565,7 +658,7 @@ func (x *AllReply_Tx) String() string { func (*AllReply_Tx) ProtoMessage() {} func (x *AllReply_Tx) ProtoReflect() protoreflect.Message { - mi := &file_txpool_txpool_proto_msgTypes[9] + mi := &file_txpool_txpool_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -642,37 +735,46 @@ var file_txpool_txpool_proto_rawDesc = []byte{ 0x6e, 0x64, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x6c, 0x70, 0x54, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x72, 0x6c, 0x70, 0x54, 0x78, 0x22, 0x1f, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x00, 0x12, - 0x0a, 0x0a, 0x06, 0x51, 0x55, 0x45, 0x55, 0x45, 0x44, 0x10, 0x01, 0x2a, 0x6c, 0x0a, 0x0c, 0x49, - 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x0b, 0x0a, 0x07, 0x53, - 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x41, 0x4c, 0x52, 0x45, - 0x41, 0x44, 0x59, 0x5f, 0x45, 0x58, 0x49, 0x53, 0x54, 0x53, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, - 0x46, 0x45, 0x45, 0x5f, 0x54, 0x4f, 0x4f, 0x5f, 0x4c, 0x4f, 0x57, 0x10, 0x02, 0x12, 0x09, 0x0a, - 0x05, 0x53, 0x54, 0x41, 0x4c, 0x45, 0x10, 0x03, 0x12, 0x0b, 0x0a, 0x07, 0x49, 0x4e, 0x56, 0x41, - 0x4c, 0x49, 0x44, 0x10, 0x04, 0x12, 0x12, 0x0a, 0x0e, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, - 0x4c, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x05, 0x32, 0xca, 0x02, 0x0a, 0x06, 0x54, 0x78, - 0x70, 0x6f, 0x6f, 0x6c, 0x12, 0x36, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, - 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x13, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, - 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x31, 0x0a, 0x0b, - 0x46, 0x69, 0x6e, 0x64, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x12, 0x10, 0x2e, 0x74, 0x78, - 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x54, 0x78, 0x48, 0x61, 0x73, 0x68, 0x65, 0x73, 0x1a, 0x10, 0x2e, - 0x74, 0x78, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x54, 0x78, 0x48, 0x61, 0x73, 0x68, 0x65, 0x73, 0x12, - 0x2b, 0x0a, 0x03, 0x41, 0x64, 0x64, 0x12, 0x12, 0x2e, 0x74, 0x78, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, - 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x10, 0x2e, 0x74, 0x78, 0x70, - 0x6f, 0x6f, 0x6c, 0x2e, 0x41, 0x64, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x46, 0x0a, 0x0c, - 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1b, 0x2e, 0x74, - 0x78, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x74, 0x78, 0x70, 0x6f, - 0x6f, 0x6c, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, - 0x65, 0x70, 0x6c, 0x79, 0x12, 0x2b, 0x0a, 0x03, 0x41, 0x6c, 0x6c, 0x12, 0x12, 0x2e, 0x74, 0x78, - 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x41, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x10, 0x2e, 0x74, 0x78, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x41, 0x6c, 0x6c, 0x52, 0x65, 0x70, 0x6c, - 0x79, 0x12, 0x33, 0x0a, 0x05, 0x4f, 0x6e, 0x41, 0x64, 0x64, 0x12, 0x14, 0x2e, 0x74, 0x78, 0x70, - 0x6f, 0x6f, 0x6c, 0x2e, 0x4f, 0x6e, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x12, 0x2e, 0x74, 0x78, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x4f, 0x6e, 0x41, 0x64, 0x64, 0x52, - 0x65, 0x70, 0x6c, 0x79, 0x30, 0x01, 0x42, 0x11, 0x5a, 0x0f, 0x2e, 0x2f, 0x74, 0x78, 0x70, 0x6f, - 0x6f, 0x6c, 0x3b, 0x74, 0x78, 0x70, 0x6f, 0x6f, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x0a, 0x0a, 0x06, 0x51, 0x55, 0x45, 0x55, 0x45, 0x44, 0x10, 0x01, 0x22, 0x0f, 0x0a, 0x0d, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x53, 0x0a, 0x0b, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x22, 0x0a, 0x0c, 0x70, + 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x0c, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, + 0x20, 0x0a, 0x0b, 0x71, 0x75, 0x65, 0x75, 0x65, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x71, 0x75, 0x65, 0x75, 0x65, 0x64, 0x43, 0x6f, 0x75, 0x6e, + 0x74, 0x2a, 0x6c, 0x0a, 0x0c, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x00, 0x12, 0x12, + 0x0a, 0x0e, 0x41, 0x4c, 0x52, 0x45, 0x41, 0x44, 0x59, 0x5f, 0x45, 0x58, 0x49, 0x53, 0x54, 0x53, + 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x46, 0x45, 0x45, 0x5f, 0x54, 0x4f, 0x4f, 0x5f, 0x4c, 0x4f, + 0x57, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x53, 0x54, 0x41, 0x4c, 0x45, 0x10, 0x03, 0x12, 0x0b, + 0x0a, 0x07, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x04, 0x12, 0x12, 0x0a, 0x0e, 0x49, + 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x05, 0x32, + 0x80, 0x03, 0x0a, 0x06, 0x54, 0x78, 0x70, 0x6f, 0x6f, 0x6c, 0x12, 0x36, 0x0a, 0x07, 0x56, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x13, 0x2e, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, + 0x6c, 0x79, 0x12, 0x31, 0x0a, 0x0b, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, + 0x6e, 0x12, 0x10, 0x2e, 0x74, 0x78, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x54, 0x78, 0x48, 0x61, 0x73, + 0x68, 0x65, 0x73, 0x1a, 0x10, 0x2e, 0x74, 0x78, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x54, 0x78, 0x48, + 0x61, 0x73, 0x68, 0x65, 0x73, 0x12, 0x2b, 0x0a, 0x03, 0x41, 0x64, 0x64, 0x12, 0x12, 0x2e, 0x74, + 0x78, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x10, 0x2e, 0x74, 0x78, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x41, 0x64, 0x64, 0x52, 0x65, 0x70, + 0x6c, 0x79, 0x12, 0x46, 0x0a, 0x0c, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x12, 0x1b, 0x2e, 0x74, 0x78, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x54, 0x72, 0x61, 0x6e, + 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x19, 0x2e, 0x74, 0x78, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x2b, 0x0a, 0x03, 0x41, 0x6c, + 0x6c, 0x12, 0x12, 0x2e, 0x74, 0x78, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x41, 0x6c, 0x6c, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x10, 0x2e, 0x74, 0x78, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x41, + 0x6c, 0x6c, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x33, 0x0a, 0x05, 0x4f, 0x6e, 0x41, 0x64, 0x64, + 0x12, 0x14, 0x2e, 0x74, 0x78, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x4f, 0x6e, 0x41, 0x64, 0x64, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x74, 0x78, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, + 0x4f, 0x6e, 0x41, 0x64, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x30, 0x01, 0x12, 0x34, 0x0a, 0x06, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x15, 0x2e, 0x74, 0x78, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, + 0x74, 0x78, 0x70, 0x6f, 0x6f, 0x6c, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x70, + 0x6c, 0x79, 0x42, 0x11, 0x5a, 0x0f, 0x2e, 0x2f, 0x74, 0x78, 0x70, 0x6f, 0x6f, 0x6c, 0x3b, 0x74, + 0x78, 0x70, 0x6f, 0x6f, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -688,7 +790,7 @@ func file_txpool_txpool_proto_rawDescGZIP() []byte { } var file_txpool_txpool_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_txpool_txpool_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_txpool_txpool_proto_msgTypes = make([]protoimpl.MessageInfo, 12) var file_txpool_txpool_proto_goTypes = []interface{}{ (ImportResult)(0), // 0: txpool.ImportResult (AllReply_Type)(0), // 1: txpool.AllReply.Type @@ -701,31 +803,35 @@ var file_txpool_txpool_proto_goTypes = []interface{}{ (*OnAddReply)(nil), // 8: txpool.OnAddReply (*AllRequest)(nil), // 9: txpool.AllRequest (*AllReply)(nil), // 10: txpool.AllReply - (*AllReply_Tx)(nil), // 11: txpool.AllReply.Tx - (*types.H256)(nil), // 12: types.H256 - (*emptypb.Empty)(nil), // 13: google.protobuf.Empty - (*types.VersionReply)(nil), // 14: types.VersionReply + (*StatusRequest)(nil), // 11: txpool.StatusRequest + (*StatusReply)(nil), // 12: txpool.StatusReply + (*AllReply_Tx)(nil), // 13: txpool.AllReply.Tx + (*types.H256)(nil), // 14: types.H256 + (*emptypb.Empty)(nil), // 15: google.protobuf.Empty + (*types.VersionReply)(nil), // 16: types.VersionReply } var file_txpool_txpool_proto_depIdxs = []int32{ - 12, // 0: txpool.TxHashes.hashes:type_name -> types.H256 + 14, // 0: txpool.TxHashes.hashes:type_name -> types.H256 0, // 1: txpool.AddReply.imported:type_name -> txpool.ImportResult - 12, // 2: txpool.TransactionsRequest.hashes:type_name -> types.H256 - 11, // 3: txpool.AllReply.txs:type_name -> txpool.AllReply.Tx + 14, // 2: txpool.TransactionsRequest.hashes:type_name -> types.H256 + 13, // 3: txpool.AllReply.txs:type_name -> txpool.AllReply.Tx 1, // 4: txpool.AllReply.Tx.type:type_name -> txpool.AllReply.Type - 13, // 5: txpool.Txpool.Version:input_type -> google.protobuf.Empty + 15, // 5: txpool.Txpool.Version:input_type -> google.protobuf.Empty 2, // 6: txpool.Txpool.FindUnknown:input_type -> txpool.TxHashes 3, // 7: txpool.Txpool.Add:input_type -> txpool.AddRequest 5, // 8: txpool.Txpool.Transactions:input_type -> txpool.TransactionsRequest 9, // 9: txpool.Txpool.All:input_type -> txpool.AllRequest 7, // 10: txpool.Txpool.OnAdd:input_type -> txpool.OnAddRequest - 14, // 11: txpool.Txpool.Version:output_type -> types.VersionReply - 2, // 12: txpool.Txpool.FindUnknown:output_type -> txpool.TxHashes - 4, // 13: txpool.Txpool.Add:output_type -> txpool.AddReply - 6, // 14: txpool.Txpool.Transactions:output_type -> txpool.TransactionsReply - 10, // 15: txpool.Txpool.All:output_type -> txpool.AllReply - 8, // 16: txpool.Txpool.OnAdd:output_type -> txpool.OnAddReply - 11, // [11:17] is the sub-list for method output_type - 5, // [5:11] is the sub-list for method input_type + 11, // 11: txpool.Txpool.Status:input_type -> txpool.StatusRequest + 16, // 12: txpool.Txpool.Version:output_type -> types.VersionReply + 2, // 13: txpool.Txpool.FindUnknown:output_type -> txpool.TxHashes + 4, // 14: txpool.Txpool.Add:output_type -> txpool.AddReply + 6, // 15: txpool.Txpool.Transactions:output_type -> txpool.TransactionsReply + 10, // 16: txpool.Txpool.All:output_type -> txpool.AllReply + 8, // 17: txpool.Txpool.OnAdd:output_type -> txpool.OnAddReply + 12, // 18: txpool.Txpool.Status:output_type -> txpool.StatusReply + 12, // [12:19] is the sub-list for method output_type + 5, // [5:12] is the sub-list for method input_type 5, // [5:5] is the sub-list for extension type_name 5, // [5:5] is the sub-list for extension extendee 0, // [0:5] is the sub-list for field type_name @@ -846,6 +952,30 @@ func file_txpool_txpool_proto_init() { } } file_txpool_txpool_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StatusRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_txpool_txpool_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StatusReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_txpool_txpool_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AllReply_Tx); i { case 0: return &v.state @@ -864,7 +994,7 @@ func file_txpool_txpool_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_txpool_txpool_proto_rawDesc, NumEnums: 2, - NumMessages: 10, + NumMessages: 12, NumExtensions: 0, NumServices: 1, }, diff --git a/gointerfaces/txpool/txpool_grpc.pb.go b/gointerfaces/txpool/txpool_grpc.pb.go index aedeaf8b7..1156b3ec6 100644 --- a/gointerfaces/txpool/txpool_grpc.pb.go +++ b/gointerfaces/txpool/txpool_grpc.pb.go @@ -33,6 +33,8 @@ type TxpoolClient interface { All(ctx context.Context, in *AllRequest, opts ...grpc.CallOption) (*AllReply, error) // subscribe to new transactions add event OnAdd(ctx context.Context, in *OnAddRequest, opts ...grpc.CallOption) (Txpool_OnAddClient, error) + // returns high level status + Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusReply, error) } type txpoolClient struct { @@ -120,6 +122,15 @@ func (x *txpoolOnAddClient) Recv() (*OnAddReply, error) { return m, nil } +func (c *txpoolClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusReply, error) { + out := new(StatusReply) + err := c.cc.Invoke(ctx, "/txpool.Txpool/Status", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // TxpoolServer is the server API for Txpool service. // All implementations must embed UnimplementedTxpoolServer // for forward compatibility @@ -137,6 +148,8 @@ type TxpoolServer interface { All(context.Context, *AllRequest) (*AllReply, error) // subscribe to new transactions add event OnAdd(*OnAddRequest, Txpool_OnAddServer) error + // returns high level status + Status(context.Context, *StatusRequest) (*StatusReply, error) mustEmbedUnimplementedTxpoolServer() } @@ -162,6 +175,9 @@ func (UnimplementedTxpoolServer) All(context.Context, *AllRequest) (*AllReply, e func (UnimplementedTxpoolServer) OnAdd(*OnAddRequest, Txpool_OnAddServer) error { return status.Errorf(codes.Unimplemented, "method OnAdd not implemented") } +func (UnimplementedTxpoolServer) Status(context.Context, *StatusRequest) (*StatusReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method Status not implemented") +} func (UnimplementedTxpoolServer) mustEmbedUnimplementedTxpoolServer() {} // UnsafeTxpoolServer may be embedded to opt out of forward compatibility for this service. @@ -286,6 +302,24 @@ func (x *txpoolOnAddServer) Send(m *OnAddReply) error { return x.ServerStream.SendMsg(m) } +func _Txpool_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StatusRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TxpoolServer).Status(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/txpool.Txpool/Status", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TxpoolServer).Status(ctx, req.(*StatusRequest)) + } + return interceptor(ctx, in, info, handler) +} + // Txpool_ServiceDesc is the grpc.ServiceDesc for Txpool service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -313,6 +347,10 @@ var Txpool_ServiceDesc = grpc.ServiceDesc{ MethodName: "All", Handler: _Txpool_All_Handler, }, + { + MethodName: "Status", + Handler: _Txpool_Status_Handler, + }, }, Streams: []grpc.StreamDesc{ { diff --git a/interfaces/Cargo.toml b/interfaces/Cargo.toml index 9d9ea6848..daa3cb58e 100644 --- a/interfaces/Cargo.toml +++ b/interfaces/Cargo.toml @@ -15,13 +15,13 @@ db = ["once_cell", "serde", "toml"] [dependencies] arrayref = "0.3" -ethereum-types = { version = "0.11", default-features = false } +ethereum-types = { version = "0.12", default-features = false } once_cell = { version = "1", optional = true } -prost = "0.7" +prost = "0.8" serde = { version = "1", features = ["derive"], optional = true } toml = { version = "0.5", optional = true } -tonic = "0.4" +tonic = "0.5" [build-dependencies] -prost-build = "0.7" -tonic-build = "0.4" +prost-build = "0.8" +tonic-build = "0.5" diff --git a/interfaces/txpool/txpool.proto b/interfaces/txpool/txpool.proto index 61bce1b0c..73bc99fdb 100644 --- a/interfaces/txpool/txpool.proto +++ b/interfaces/txpool/txpool.proto @@ -44,6 +44,12 @@ message AllReply { repeated Tx txs = 1; } +message StatusRequest {} +message StatusReply { + uint32 pendingCount = 1; + uint32 queuedCount = 2; +} + service Txpool { // Version returns the service version number rpc Version(google.protobuf.Empty) returns (types.VersionReply); @@ -58,4 +64,6 @@ service Txpool { rpc All(AllRequest) returns (AllReply); // subscribe to new transactions add event rpc OnAdd(OnAddRequest) returns (stream OnAddReply); + // returns high level status + rpc Status(StatusRequest) returns (StatusReply); }