From 6604039d39e3395e7738fc88f9d9106824e99429 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 7 Feb 2026 12:04:15 +0000 Subject: [PATCH 1/6] Initial plan From 0ee2be5136bb119d322e8ffb997a4302f95bdb03 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 7 Feb 2026 12:14:53 +0000 Subject: [PATCH 2/6] Replace legacy SendMsg/RecvMsg with type-safe Send/Recv methods - Add payload and msg_type fields to ordering.Metadata proto - Regenerate proto files - Add toMetadata/fromMetadata conversion methods in encoding.go - Remove custom Codec, ContentSubtype, and init() codec registration - Update server.go to use srv.Send/srv.Recv - Update channel.go to use stream.Send/stream.Recv - Update channel.getStream() to return typed stream - Remove grpc.CallContentSubtype from mgr.go - Remove codec registration from test init() functions Co-authored-by: meling <810999+meling@users.noreply.github.com> --- channel.go | 23 +++++-- channel_test.go | 15 ++-- config_test.go | 7 -- encoding.go | 129 ++++++++++------------------------- mgr.go | 3 - mgr_test.go | 10 +-- ordering/ordering.pb.go | 39 ++++++++++- ordering/ordering.proto | 2 + ordering/ordering_grpc.pb.go | 2 +- rpc_test.go | 6 -- server.go | 12 +++- server_test.go | 7 -- 12 files changed, 109 insertions(+), 146 deletions(-) diff --git a/channel.go b/channel.go index 6e032bcf9..7db8aa244 100644 --- a/channel.go +++ b/channel.go @@ -155,7 +155,7 @@ func (c *channel) ensureConnectedNodeStream() (err error) { } // getStream returns the current stream, or nil if no stream is available. -func (c *channel) getStream() grpc.ClientStream { +func (c *channel) getStream() ordering.Gorums_NodeStreamClient { c.streamMut.Lock() defer c.streamMut.Unlock() return c.gorumsStream @@ -280,14 +280,21 @@ func (c *channel) receiver() { } } - resp := newMessage(responseType) - if err := stream.RecvMsg(resp); err != nil { + md, err := stream.Recv() + if err != nil { c.setLastErr(err) c.cancelPendingMsgs(err) c.clearStream() } else { - err := resp.GetStatus().Err() - c.routeResponse(resp.GetMessageID(), NodeResponse[proto.Message]{NodeID: c.id, Value: resp.GetProtoMessage(), Err: err}) + resp, err := fromMetadata(md) + if err != nil { + c.setLastErr(err) + c.cancelPendingMsgs(err) + c.clearStream() + } else { + err := resp.GetStatus().Err() + c.routeResponse(resp.GetMessageID(), NodeResponse[proto.Message]{NodeID: c.id, Value: resp.GetProtoMessage(), Err: err}) + } } select { @@ -354,7 +361,11 @@ func (c *channel) sendMsg(req request) (err error) { } }() - if err = stream.SendMsg(req.msg); err != nil { + md, err := req.msg.toMetadata() + if err != nil { + return err + } + if err = stream.Send(md); err != nil { c.setLastErr(err) c.clearStream() } diff --git a/channel_test.go b/channel_test.go index 30bccdffc..b222f57e6 100644 --- a/channel_test.go +++ b/channel_test.go @@ -11,7 +11,6 @@ import ( "github.com/relab/gorums/internal/testutils/mock" "github.com/relab/gorums/ordering" - "google.golang.org/grpc" "google.golang.org/protobuf/proto" pb "google.golang.org/protobuf/types/known/wrapperspb" ) @@ -114,7 +113,7 @@ func routerExists(node *Node, msgID uint64) bool { return exists } -func getStream(node *Node) grpc.ClientStream { +func getStream(node *Node) ordering.Gorums_NodeStreamClient { return node.channel.getStream() } @@ -324,7 +323,7 @@ func TestChannelEnsureStream(t *testing.T) { } // Helper to verify stream expectations - cmpStream := func(t *testing.T, first, second grpc.ClientStream, wantSame bool) { + cmpStream := func(t *testing.T, first, second ordering.Gorums_NodeStreamClient, wantSame bool) { t.Helper() // If second is nil, skip equality check (covered by UnconnectedNodeHasNoStream action) if second == nil { @@ -342,13 +341,13 @@ func TestChannelEnsureStream(t *testing.T) { tests := []struct { name string setup func(t *testing.T) *Node - action func(node *Node) (first, second grpc.ClientStream) + action func(node *Node) (first, second ordering.Gorums_NodeStreamClient) wantSame bool }{ { name: "UnconnectedNodeHasNoStream", setup: func(t *testing.T) *Node { return testNodeWithoutServer(t) }, - action: func(node *Node) (grpc.ClientStream, grpc.ClientStream) { + action: func(node *Node) (ordering.Gorums_NodeStreamClient, ordering.Gorums_NodeStreamClient) { if err := node.channel.ensureStream(); err == nil { t.Error("ensureStream succeeded unexpectedly") } @@ -361,7 +360,7 @@ func TestChannelEnsureStream(t *testing.T) { { name: "CreatesStreamWhenConnected", setup: newNodeWithoutStream, - action: func(node *Node) (grpc.ClientStream, grpc.ClientStream) { + action: func(node *Node) (ordering.Gorums_NodeStreamClient, ordering.Gorums_NodeStreamClient) { if err := node.channel.ensureStream(); err != nil { t.Errorf("ensureStream failed: %v", err) } @@ -371,7 +370,7 @@ func TestChannelEnsureStream(t *testing.T) { { name: "RepeatedCallsReturnSameStream", setup: newNodeWithoutStream, - action: func(node *Node) (grpc.ClientStream, grpc.ClientStream) { + action: func(node *Node) (ordering.Gorums_NodeStreamClient, ordering.Gorums_NodeStreamClient) { if err := node.channel.ensureStream(); err != nil { t.Errorf("first ensureStream failed: %v", err) } @@ -386,7 +385,7 @@ func TestChannelEnsureStream(t *testing.T) { { name: "StreamDisconnectionCreatesNewStream", setup: newNodeWithoutStream, - action: func(node *Node) (grpc.ClientStream, grpc.ClientStream) { + action: func(node *Node) (ordering.Gorums_NodeStreamClient, ordering.Gorums_NodeStreamClient) { if err := node.channel.ensureStream(); err != nil { t.Errorf("initial ensureStream failed: %v", err) } diff --git a/config_test.go b/config_test.go index b14c97e22..99e67effe 100644 --- a/config_test.go +++ b/config_test.go @@ -7,16 +7,9 @@ import ( "github.com/relab/gorums" "github.com/relab/gorums/internal/testutils/mock" - "google.golang.org/grpc/encoding" pb "google.golang.org/protobuf/types/known/wrapperspb" ) -func init() { - if encoding.GetCodec(gorums.ContentSubtype) == nil { - encoding.RegisterCodec(gorums.NewCodec()) - } -} - var ( nodes = []string{"127.0.0.1:9081", "127.0.0.1:9082", "127.0.0.1:9083"} nodeMap = map[uint32]testNode{ diff --git a/encoding.go b/encoding.go index 39e8b5e59..a6c1f278f 100644 --- a/encoding.go +++ b/encoding.go @@ -5,22 +5,13 @@ import ( "github.com/relab/gorums/ordering" "google.golang.org/grpc/codes" - "google.golang.org/grpc/encoding" "google.golang.org/grpc/status" - "google.golang.org/protobuf/encoding/protowire" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/reflect/protoregistry" ) -func init() { - encoding.RegisterCodec(NewCodec()) -} - -// ContentSubtype is the subtype used by gorums when sending messages via gRPC. -const ContentSubtype = "gorums" - -type gorumsMsgType uint8 +type gorumsMsgType uint32 const ( requestType gorumsMsgType = iota + 1 @@ -36,12 +27,6 @@ type Message struct { msgType gorumsMsgType } -// newMessage creates a new Message struct for unmarshaling. -// msgType specifies the message type to be unmarshaled. -func newMessage(msgType gorumsMsgType) *Message { - return &Message{metadata: &ordering.Metadata{}, msgType: msgType} -} - // NewRequestMessage creates a new Gorums Message for the given metadata and request message. // // This function should be used by generated code and tests only. @@ -120,85 +105,39 @@ func (m *Message) setError(err error) { m.metadata.SetStatus(errStatus.Proto()) } -// Codec is the gRPC codec used by gorums. -type Codec struct { - marshaler proto.MarshalOptions - unmarshaler proto.UnmarshalOptions -} - -// NewCodec returns a new Codec. -func NewCodec() *Codec { - return &Codec{ - marshaler: proto.MarshalOptions{AllowPartial: true}, - unmarshaler: proto.UnmarshalOptions{AllowPartial: true}, - } -} - -// Name returns the name of the Codec. -func (Codec) Name() string { - return ContentSubtype -} - -func (Codec) String() string { - return ContentSubtype -} - -// Marshal marshals the message m into a byte slice. -func (c Codec) Marshal(m any) (b []byte, err error) { - switch msg := m.(type) { - case *Message: - return c.gorumsMarshal(msg) - case proto.Message: - return c.marshaler.Marshal(msg) - default: - return nil, fmt.Errorf("gorums: cannot marshal message of type '%T'", m) +// toMetadata serializes the application message into the metadata's payload +// field and returns the metadata, ready for sending via the type-safe Send method. +func (m *Message) toMetadata() (*ordering.Metadata, error) { + md := m.metadata + md.SetMsgType(uint32(m.msgType)) + if m.message != nil { + b, err := proto.MarshalOptions{AllowPartial: true}.Marshal(m.message) + if err != nil { + return nil, fmt.Errorf("gorums: failed to marshal payload: %w", err) + } + md.SetPayload(b) } + return md, nil } -// gorumsMarshal marshals a metadata and a data message into a single byte slice. -func (c Codec) gorumsMarshal(msg *Message) (b []byte, err error) { - mdSize := c.marshaler.Size(msg.metadata) - b = protowire.AppendVarint(b, uint64(mdSize)) - b, err = c.marshaler.MarshalAppend(b, msg.metadata) - if err != nil { - return nil, err +// fromMetadata reconstructs a Message from a received Metadata by deserializing +// the payload bytes into the appropriate protobuf message type, determined by +// the method descriptor and message type (request or response) in the metadata. +func fromMetadata(md *ordering.Metadata) (*Message, error) { + msg := &Message{ + metadata: md, + msgType: gorumsMsgType(md.GetMsgType()), } - msgSize := c.marshaler.Size(msg.message) - b = protowire.AppendVarint(b, uint64(msgSize)) - b, err = c.marshaler.MarshalAppend(b, msg.message) - if err != nil { - return nil, err - } - return b, nil -} - -// Unmarshal unmarshals a byte slice into m. -func (c Codec) Unmarshal(b []byte, m any) (err error) { - switch msg := m.(type) { - case *Message: - return c.gorumsUnmarshal(b, msg) - case proto.Message: - return c.unmarshaler.Unmarshal(b, msg) - default: - return fmt.Errorf("gorums: cannot unmarshal message of type '%T'", m) - } -} - -// gorumsUnmarshal extracts metadata and message data from b and places the result in msg. -func (c Codec) gorumsUnmarshal(b []byte, msg *Message) (err error) { - // unmarshal metadata - mdBuf, mdLen := protowire.ConsumeBytes(b) - err = c.unmarshaler.Unmarshal(mdBuf, msg.metadata) - if err != nil { - return fmt.Errorf("gorums: could not unmarshal metadata: %w", err) + method := msg.GetMethod() + if method == "" || method == "nil" { + return msg, nil } // get method descriptor from registry - desc, err := protoregistry.GlobalFiles.FindDescriptorByName(protoreflect.FullName(msg.GetMethod())) + desc, err := protoregistry.GlobalFiles.FindDescriptorByName(protoreflect.FullName(method)) if err != nil { - // err is a NotFound error with no method name information; return a more informative error - return fmt.Errorf("gorums: could not find method descriptor for %s", msg.GetMethod()) + return nil, fmt.Errorf("gorums: could not find method descriptor for %s", method) } methodDesc := desc.(protoreflect.MethodDescriptor) @@ -210,18 +149,22 @@ func (c Codec) gorumsUnmarshal(b []byte, msg *Message) (err error) { case responseType: messageName = methodDesc.Output().FullName() default: - return fmt.Errorf("gorums: unknown message type %d", msg.msgType) + return nil, fmt.Errorf("gorums: unknown message type %d", msg.msgType) } - // now get the message type from the types registry + // get the message type from the types registry msgType, err := protoregistry.GlobalTypes.FindMessageByName(messageName) if err != nil { - // err is a NotFound error with no message name information; return a more informative error - return fmt.Errorf("gorums: could not find message type %s", messageName) + return nil, fmt.Errorf("gorums: could not find message type %s", messageName) } msg.message = msgType.New().Interface() - // unmarshal message - msgBuf, _ := protowire.ConsumeBytes(b[mdLen:]) - return c.unmarshaler.Unmarshal(msgBuf, msg.message) + // unmarshal payload into the message + payload := md.GetPayload() + if len(payload) > 0 { + if err := (proto.UnmarshalOptions{AllowPartial: true}).Unmarshal(payload, msg.message); err != nil { + return nil, fmt.Errorf("gorums: failed to unmarshal payload: %w", err) + } + } + return msg, nil } diff --git a/mgr.go b/mgr.go index 3f407a149..18b0996bc 100644 --- a/mgr.go +++ b/mgr.go @@ -37,9 +37,6 @@ func NewManager(opts ...ManagerOption) *Manager { if m.opts.logger != nil { m.logger = m.opts.logger } - m.opts.grpcDialOpts = append(m.opts.grpcDialOpts, grpc.WithDefaultCallOptions( - grpc.CallContentSubtype(ContentSubtype), - )) if m.opts.backoff != backoff.DefaultConfig { m.opts.grpcDialOpts = append(m.opts.grpcDialOpts, grpc.WithConnectParams( grpc.ConnectParams{Backoff: m.opts.backoff}, diff --git a/mgr_test.go b/mgr_test.go index a012c2168..843d5c55c 100644 --- a/mgr_test.go +++ b/mgr_test.go @@ -5,16 +5,8 @@ import ( "log" "strings" "testing" - - "google.golang.org/grpc/encoding" ) -func init() { - if encoding.GetCodec(ContentSubtype) == nil { - encoding.RegisterCodec(NewCodec()) - } -} - func TestManagerLogging(t *testing.T) { var ( buf bytes.Buffer @@ -23,7 +15,7 @@ func TestManagerLogging(t *testing.T) { mgr := NewManager(InsecureDialOptions(t), WithLogger(logger)) t.Cleanup(Closer(t, mgr)) - want := "logger: mgr.go:49: ready" + want := "logger: mgr.go:46: ready" if strings.TrimSpace(buf.String()) != want { t.Errorf("logger: got %q, want %q", buf.String(), want) } diff --git a/ordering/ordering.pb.go b/ordering/ordering.pb.go index bd60796da..d4c8a01af 100644 --- a/ordering/ordering.pb.go +++ b/ordering/ordering.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v6.33.4 +// protoc v5.29.3 // source: ordering/ordering.proto package ordering @@ -29,6 +29,8 @@ type Metadata struct { xxx_hidden_Method string `protobuf:"bytes,2,opt,name=method"` xxx_hidden_Status *status.Status `protobuf:"bytes,3,opt,name=status"` xxx_hidden_Entry *[]*MetadataEntry `protobuf:"bytes,4,rep,name=entry"` + xxx_hidden_Payload []byte `protobuf:"bytes,5,opt,name=payload"` + xxx_hidden_MsgType uint32 `protobuf:"varint,6,opt,name=msg_type,json=msgType"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -88,6 +90,20 @@ func (x *Metadata) GetEntry() []*MetadataEntry { return nil } +func (x *Metadata) GetPayload() []byte { + if x != nil { + return x.xxx_hidden_Payload + } + return nil +} + +func (x *Metadata) GetMsgType() uint32 { + if x != nil { + return x.xxx_hidden_MsgType + } + return 0 +} + func (x *Metadata) SetMessageSeqNo(v uint64) { x.xxx_hidden_MessageSeqNo = v } @@ -104,6 +120,17 @@ func (x *Metadata) SetEntry(v []*MetadataEntry) { x.xxx_hidden_Entry = &v } +func (x *Metadata) SetPayload(v []byte) { + if v == nil { + v = []byte{} + } + x.xxx_hidden_Payload = v +} + +func (x *Metadata) SetMsgType(v uint32) { + x.xxx_hidden_MsgType = v +} + func (x *Metadata) HasStatus() bool { if x == nil { return false @@ -122,6 +149,8 @@ type Metadata_builder struct { Method string Status *status.Status Entry []*MetadataEntry + Payload []byte + MsgType uint32 } func (b0 Metadata_builder) Build() *Metadata { @@ -132,6 +161,8 @@ func (b0 Metadata_builder) Build() *Metadata { x.xxx_hidden_Method = b.Method x.xxx_hidden_Status = b.Status x.xxx_hidden_Entry = &b.Entry + x.xxx_hidden_Payload = b.Payload + x.xxx_hidden_MsgType = b.MsgType return m0 } @@ -211,12 +242,14 @@ var File_ordering_ordering_proto protoreflect.FileDescriptor const file_ordering_ordering_proto_rawDesc = "" + "\n" + - "\x17ordering/ordering.proto\x12\bordering\x1a\x17google/rpc/status.proto\"\xa3\x01\n" + + "\x17ordering/ordering.proto\x12\bordering\x1a\x17google/rpc/status.proto\"\xd8\x01\n" + "\bMetadata\x12$\n" + "\x0emessage_seq_no\x18\x01 \x01(\x04R\fmessageSeqNo\x12\x16\n" + "\x06method\x18\x02 \x01(\tR\x06method\x12*\n" + "\x06status\x18\x03 \x01(\v2\x12.google.rpc.StatusR\x06status\x12-\n" + - "\x05entry\x18\x04 \x03(\v2\x17.ordering.MetadataEntryR\x05entry\"7\n" + + "\x05entry\x18\x04 \x03(\v2\x17.ordering.MetadataEntryR\x05entry\x12\x18\n" + + "\apayload\x18\x05 \x01(\fR\apayload\x12\x19\n" + + "\bmsg_type\x18\x06 \x01(\rR\amsgType\"7\n" + "\rMetadataEntry\x12\x10\n" + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + "\x05value\x18\x02 \x01(\tR\x05value2B\n" + diff --git a/ordering/ordering.proto b/ordering/ordering.proto index 34447afac..bb36bf078 100644 --- a/ordering/ordering.proto +++ b/ordering/ordering.proto @@ -21,6 +21,8 @@ message Metadata { string method = 2; // method name to invoke on the server google.rpc.Status status = 3; // status of an invocation (for responses) repeated MetadataEntry entry = 4; // per message client-generated metadata + bytes payload = 5; // serialized application-specific message + uint32 msg_type = 6; // message type: 1 = request, 2 = response } // MetadataEntry is a key-value pair for Metadata entries. diff --git a/ordering/ordering_grpc.pb.go b/ordering/ordering_grpc.pb.go index a1b79e9f0..7e52ed9f4 100644 --- a/ordering/ordering_grpc.pb.go +++ b/ordering/ordering_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.6.0 -// - protoc v6.33.4 +// - protoc v5.29.3 // source: ordering/ordering.proto package ordering diff --git a/rpc_test.go b/rpc_test.go index da87997ef..d1f4b4e75 100644 --- a/rpc_test.go +++ b/rpc_test.go @@ -8,15 +8,9 @@ import ( "github.com/relab/gorums" "github.com/relab/gorums/internal/testutils/mock" - "google.golang.org/grpc/encoding" pb "google.golang.org/protobuf/types/known/wrapperspb" ) -func init() { - if encoding.GetCodec(gorums.ContentSubtype) == nil { - encoding.RegisterCodec(gorums.NewCodec()) - } -} func TestRPCCallSuccess(t *testing.T) { node := gorums.TestNode(t, gorums.DefaultTestServer) diff --git a/server.go b/server.go index 497028476..752b13753 100644 --- a/server.go +++ b/server.go @@ -49,10 +49,13 @@ func (s *orderingServer) NodeStream(srv ordering.Gorums_NodeStreamServer) error case <-ctx.Done(): return case msg := <-finished: - err := srv.SendMsg(msg) + md, err := msg.toMetadata() if err != nil { return } + if err := srv.Send(md); err != nil { + return + } } } }() @@ -62,8 +65,11 @@ func (s *orderingServer) NodeStream(srv ordering.Gorums_NodeStreamServer) error defer mut.Unlock() for { - req := newMessage(requestType) - err := srv.RecvMsg(req) + md, err := srv.Recv() + if err != nil { + return err + } + req, err := fromMetadata(md) if err != nil { return err } diff --git a/server_test.go b/server_test.go index 49626797c..546fac873 100644 --- a/server_test.go +++ b/server_test.go @@ -8,18 +8,11 @@ import ( "github.com/relab/gorums" "github.com/relab/gorums/internal/testutils/mock" - "google.golang.org/grpc/encoding" "google.golang.org/grpc/metadata" "google.golang.org/protobuf/proto" pb "google.golang.org/protobuf/types/known/wrapperspb" ) -func init() { - if encoding.GetCodec(gorums.ContentSubtype) == nil { - encoding.RegisterCodec(gorums.NewCodec()) - } -} - func TestServerCallback(t *testing.T) { var message string signal := make(chan struct{}) From c727ae7a04533bfb925078149aeb0c6bc4471760 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 7 Feb 2026 12:16:02 +0000 Subject: [PATCH 3/6] Address code review: keep gorumsMsgType as uint8, make logging test robust Co-authored-by: meling <810999+meling@users.noreply.github.com> --- encoding.go | 2 +- mgr_test.go | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/encoding.go b/encoding.go index a6c1f278f..635288e53 100644 --- a/encoding.go +++ b/encoding.go @@ -11,7 +11,7 @@ import ( "google.golang.org/protobuf/reflect/protoregistry" ) -type gorumsMsgType uint32 +type gorumsMsgType uint8 const ( requestType gorumsMsgType = iota + 1 diff --git a/mgr_test.go b/mgr_test.go index 843d5c55c..c27fa3631 100644 --- a/mgr_test.go +++ b/mgr_test.go @@ -15,8 +15,10 @@ func TestManagerLogging(t *testing.T) { mgr := NewManager(InsecureDialOptions(t), WithLogger(logger)) t.Cleanup(Closer(t, mgr)) - want := "logger: mgr.go:46: ready" - if strings.TrimSpace(buf.String()) != want { - t.Errorf("logger: got %q, want %q", buf.String(), want) + got := strings.TrimSpace(buf.String()) + wantPrefix := "logger: mgr.go:" + wantSuffix := ": ready" + if !strings.HasPrefix(got, wantPrefix) || !strings.HasSuffix(got, wantSuffix) { + t.Errorf("logger: got %q, want %q%q", got, wantPrefix, wantSuffix) } } From 33bc4a989dd1f244288ecacc155fd1d4b2e07023 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 7 Feb 2026 12:17:17 +0000 Subject: [PATCH 4/6] Final cleanup Co-authored-by: meling <810999+meling@users.noreply.github.com> --- cmd/protoc-gen-gorums/dev/zorums.pb.go | 290 ------------------ .../dev/zorums_multicast_gorums.pb.go | 42 --- .../dev/zorums_quorumcall_gorums.pb.go | 68 ---- .../dev/zorums_rpc_gorums.pb.go | 28 -- .../dev/zorums_server_gorums.pb.go | 117 ------- .../dev/zorums_types_gorums.pb.go | 31 -- .../dev/zorums_unicast_gorums.pb.go | 34 -- 7 files changed, 610 deletions(-) delete mode 100644 cmd/protoc-gen-gorums/dev/zorums.pb.go delete mode 100644 cmd/protoc-gen-gorums/dev/zorums_multicast_gorums.pb.go delete mode 100644 cmd/protoc-gen-gorums/dev/zorums_quorumcall_gorums.pb.go delete mode 100644 cmd/protoc-gen-gorums/dev/zorums_rpc_gorums.pb.go delete mode 100644 cmd/protoc-gen-gorums/dev/zorums_server_gorums.pb.go delete mode 100644 cmd/protoc-gen-gorums/dev/zorums_types_gorums.pb.go delete mode 100644 cmd/protoc-gen-gorums/dev/zorums_unicast_gorums.pb.go diff --git a/cmd/protoc-gen-gorums/dev/zorums.pb.go b/cmd/protoc-gen-gorums/dev/zorums.pb.go deleted file mode 100644 index a5944b08b..000000000 --- a/cmd/protoc-gen-gorums/dev/zorums.pb.go +++ /dev/null @@ -1,290 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11 -// protoc v6.33.4 -// source: zorums.proto - -package dev - -import ( - _ "github.com/relab/gorums" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - emptypb "google.golang.org/protobuf/types/known/emptypb" - reflect "reflect" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Request struct { - state protoimpl.MessageState `protogen:"opaque.v1"` - xxx_hidden_Value string `protobuf:"bytes,1,opt,name=Value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Request) Reset() { - *x = Request{} - mi := &file_zorums_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Request) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Request) ProtoMessage() {} - -func (x *Request) ProtoReflect() protoreflect.Message { - mi := &file_zorums_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -func (x *Request) GetValue() string { - if x != nil { - return x.xxx_hidden_Value - } - return "" -} - -func (x *Request) SetValue(v string) { - x.xxx_hidden_Value = v -} - -type Request_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - Value string -} - -func (b0 Request_builder) Build() *Request { - m0 := &Request{} - b, x := &b0, m0 - _, _ = b, x - x.xxx_hidden_Value = b.Value - return m0 -} - -type Response struct { - state protoimpl.MessageState `protogen:"opaque.v1"` - xxx_hidden_Result int64 `protobuf:"varint,1,opt,name=Result"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Response) Reset() { - *x = Response{} - mi := &file_zorums_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Response) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Response) ProtoMessage() {} - -func (x *Response) ProtoReflect() protoreflect.Message { - mi := &file_zorums_proto_msgTypes[1] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -func (x *Response) GetResult() int64 { - if x != nil { - return x.xxx_hidden_Result - } - return 0 -} - -func (x *Response) SetResult(v int64) { - x.xxx_hidden_Result = v -} - -type Response_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - Result int64 -} - -func (b0 Response_builder) Build() *Response { - m0 := &Response{} - b, x := &b0, m0 - _, _ = b, x - x.xxx_hidden_Result = b.Result - return m0 -} - -type MyResponse struct { - state protoimpl.MessageState `protogen:"opaque.v1"` - xxx_hidden_Value string `protobuf:"bytes,1,opt,name=Value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *MyResponse) Reset() { - *x = MyResponse{} - mi := &file_zorums_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *MyResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MyResponse) ProtoMessage() {} - -func (x *MyResponse) ProtoReflect() protoreflect.Message { - mi := &file_zorums_proto_msgTypes[2] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -func (x *MyResponse) GetValue() string { - if x != nil { - return x.xxx_hidden_Value - } - return "" -} - -func (x *MyResponse) SetValue(v string) { - x.xxx_hidden_Value = v -} - -type MyResponse_builder struct { - _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. - - Value string -} - -func (b0 MyResponse_builder) Build() *MyResponse { - m0 := &MyResponse{} - b, x := &b0, m0 - _, _ = b, x - x.xxx_hidden_Value = b.Value - return m0 -} - -var File_zorums_proto protoreflect.FileDescriptor - -const file_zorums_proto_rawDesc = "" + - "\n" + - "\fzorums.proto\x12\x03dev\x1a\fgorums.proto\x1a\x1bgoogle/protobuf/empty.proto\"\x1f\n" + - "\aRequest\x12\x14\n" + - "\x05Value\x18\x01 \x01(\tR\x05Value\"\"\n" + - "\bResponse\x12\x16\n" + - "\x06Result\x18\x01 \x01(\x03R\x06Result\"\"\n" + - "\n" + - "MyResponse\x12\x14\n" + - "\x05Value\x18\x01 \x01(\tR\x05Value2\x81\x06\n" + - "\rZorumsService\x12)\n" + - "\bGRPCCall\x12\f.dev.Request\x1a\r.dev.Response\"\x00\x12/\n" + - "\n" + - "QuorumCall\x12\f.dev.Request\x1a\r.dev.Response\"\x04\xa0\xb5\x18\x01\x12>\n" + - "\x0fQuorumCallEmpty\x12\x16.google.protobuf.Empty\x1a\r.dev.Response\"\x04\xa0\xb5\x18\x01\x12>\n" + - "\x10QuorumCallEmpty2\x12\f.dev.Request\x1a\x16.google.protobuf.Empty\"\x04\xa0\xb5\x18\x01\x12.\n" + - "\tMulticast\x12\f.dev.Request\x1a\r.dev.Response\"\x04\x98\xb5\x18\x01\x12/\n" + - "\n" + - "Multicast2\x12\f.dev.Request\x1a\r.dev.Response\"\x04\x98\xb5\x18\x01\x128\n" + - "\n" + - "Multicast3\x12\f.dev.Request\x1a\x16.google.protobuf.Empty\"\x04\x98\xb5\x18\x01\x12B\n" + - "\n" + - "Multicast4\x12\x16.google.protobuf.Empty\x1a\x16.google.protobuf.Empty\"\x04\x98\xb5\x18\x01\x127\n" + - "\x10QuorumCallStream\x12\f.dev.Request\x1a\r.dev.Response\"\x04\xa0\xb5\x18\x010\x01\x12I\n" + - "\x19QuorumCallStreamWithEmpty\x12\f.dev.Request\x1a\x16.google.protobuf.Empty\"\x04\xa0\xb5\x18\x010\x01\x12K\n" + - "\x1aQuorumCallStreamWithEmpty2\x12\x16.google.protobuf.Empty\x1a\r.dev.Response\"\x04\xa0\xb5\x18\x010\x01\x12,\n" + - "\aUnicast\x12\f.dev.Request\x1a\r.dev.Response\"\x04\x90\xb5\x18\x01\x126\n" + - "\bUnicast2\x12\f.dev.Request\x1a\x16.google.protobuf.Empty\"\x04\x90\xb5\x18\x01B Z\x19cmd/protoc-gen-gorums/dev\x92\x03\x02\b\x02b\beditionsp\xe8\a" - -var file_zorums_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_zorums_proto_goTypes = []any{ - (*Request)(nil), // 0: dev.Request - (*Response)(nil), // 1: dev.Response - (*MyResponse)(nil), // 2: dev.MyResponse - (*emptypb.Empty)(nil), // 3: google.protobuf.Empty -} -var file_zorums_proto_depIdxs = []int32{ - 0, // 0: dev.ZorumsService.GRPCCall:input_type -> dev.Request - 0, // 1: dev.ZorumsService.QuorumCall:input_type -> dev.Request - 3, // 2: dev.ZorumsService.QuorumCallEmpty:input_type -> google.protobuf.Empty - 0, // 3: dev.ZorumsService.QuorumCallEmpty2:input_type -> dev.Request - 0, // 4: dev.ZorumsService.Multicast:input_type -> dev.Request - 0, // 5: dev.ZorumsService.Multicast2:input_type -> dev.Request - 0, // 6: dev.ZorumsService.Multicast3:input_type -> dev.Request - 3, // 7: dev.ZorumsService.Multicast4:input_type -> google.protobuf.Empty - 0, // 8: dev.ZorumsService.QuorumCallStream:input_type -> dev.Request - 0, // 9: dev.ZorumsService.QuorumCallStreamWithEmpty:input_type -> dev.Request - 3, // 10: dev.ZorumsService.QuorumCallStreamWithEmpty2:input_type -> google.protobuf.Empty - 0, // 11: dev.ZorumsService.Unicast:input_type -> dev.Request - 0, // 12: dev.ZorumsService.Unicast2:input_type -> dev.Request - 1, // 13: dev.ZorumsService.GRPCCall:output_type -> dev.Response - 1, // 14: dev.ZorumsService.QuorumCall:output_type -> dev.Response - 1, // 15: dev.ZorumsService.QuorumCallEmpty:output_type -> dev.Response - 3, // 16: dev.ZorumsService.QuorumCallEmpty2:output_type -> google.protobuf.Empty - 1, // 17: dev.ZorumsService.Multicast:output_type -> dev.Response - 1, // 18: dev.ZorumsService.Multicast2:output_type -> dev.Response - 3, // 19: dev.ZorumsService.Multicast3:output_type -> google.protobuf.Empty - 3, // 20: dev.ZorumsService.Multicast4:output_type -> google.protobuf.Empty - 1, // 21: dev.ZorumsService.QuorumCallStream:output_type -> dev.Response - 3, // 22: dev.ZorumsService.QuorumCallStreamWithEmpty:output_type -> google.protobuf.Empty - 1, // 23: dev.ZorumsService.QuorumCallStreamWithEmpty2:output_type -> dev.Response - 1, // 24: dev.ZorumsService.Unicast:output_type -> dev.Response - 3, // 25: dev.ZorumsService.Unicast2:output_type -> google.protobuf.Empty - 13, // [13:26] is the sub-list for method output_type - 0, // [0:13] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_zorums_proto_init() } -func file_zorums_proto_init() { - if File_zorums_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_zorums_proto_rawDesc), len(file_zorums_proto_rawDesc)), - NumEnums: 0, - NumMessages: 3, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_zorums_proto_goTypes, - DependencyIndexes: file_zorums_proto_depIdxs, - MessageInfos: file_zorums_proto_msgTypes, - }.Build() - File_zorums_proto = out.File - file_zorums_proto_goTypes = nil - file_zorums_proto_depIdxs = nil -} diff --git a/cmd/protoc-gen-gorums/dev/zorums_multicast_gorums.pb.go b/cmd/protoc-gen-gorums/dev/zorums_multicast_gorums.pb.go deleted file mode 100644 index d05250d93..000000000 --- a/cmd/protoc-gen-gorums/dev/zorums_multicast_gorums.pb.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by protoc-gen-gorums. DO NOT EDIT. -// versions: -// protoc-gen-gorums v0.11.0-devel -// protoc v6.33.4 -// source: zorums.proto - -package dev - -import ( - gorums "github.com/relab/gorums" - emptypb "google.golang.org/protobuf/types/known/emptypb" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = gorums.EnforceVersion(11 - gorums.MinVersion) - // Verify that the gorums runtime is sufficiently up-to-date. - _ = gorums.EnforceVersion(gorums.MaxVersion - 11) -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ emptypb.Empty - -// Multicast plain. Response type is not needed here. -func Multicast(ctx *ConfigContext, in *Request, opts ...gorums.CallOption) error { - return gorums.Multicast(ctx, in, "dev.ZorumsService.Multicast", opts...) -} - -// Multicast2 is testing whether multiple streams work. -func Multicast2(ctx *ConfigContext, in *Request, opts ...gorums.CallOption) error { - return gorums.Multicast(ctx, in, "dev.ZorumsService.Multicast2", opts...) -} - -// Multicast3 is testing imported message type. -func Multicast3(ctx *ConfigContext, in *Request, opts ...gorums.CallOption) error { - return gorums.Multicast(ctx, in, "dev.ZorumsService.Multicast3", opts...) -} - -// Multicast4 is testing imported message type. -func Multicast4(ctx *ConfigContext, in *emptypb.Empty, opts ...gorums.CallOption) error { - return gorums.Multicast(ctx, in, "dev.ZorumsService.Multicast4", opts...) -} diff --git a/cmd/protoc-gen-gorums/dev/zorums_quorumcall_gorums.pb.go b/cmd/protoc-gen-gorums/dev/zorums_quorumcall_gorums.pb.go deleted file mode 100644 index 394670b51..000000000 --- a/cmd/protoc-gen-gorums/dev/zorums_quorumcall_gorums.pb.go +++ /dev/null @@ -1,68 +0,0 @@ -// Code generated by protoc-gen-gorums. DO NOT EDIT. -// versions: -// protoc-gen-gorums v0.11.0-devel -// protoc v6.33.4 -// source: zorums.proto - -package dev - -import ( - gorums "github.com/relab/gorums" - emptypb "google.golang.org/protobuf/types/known/emptypb" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = gorums.EnforceVersion(11 - gorums.MinVersion) - // Verify that the gorums runtime is sufficiently up-to-date. - _ = gorums.EnforceVersion(gorums.MaxVersion - 11) -) - -// QuorumCall plain. -func QuorumCall(ctx *ConfigContext, in *Request, opts ...gorums.CallOption) *gorums.Responses[*Response] { - return gorums.QuorumCall[*Request, *Response]( - ctx, in, "dev.ZorumsService.QuorumCall", - opts..., - ) -} - -// QuorumCallEmpty for testing imported message type. -func QuorumCallEmpty(ctx *ConfigContext, in *emptypb.Empty, opts ...gorums.CallOption) *gorums.Responses[*Response] { - return gorums.QuorumCall[*emptypb.Empty, *Response]( - ctx, in, "dev.ZorumsService.QuorumCallEmpty", - opts..., - ) -} - -// QuorumCallEmpty2 for testing imported message type. -func QuorumCallEmpty2(ctx *ConfigContext, in *Request, opts ...gorums.CallOption) *gorums.Responses[*emptypb.Empty] { - return gorums.QuorumCall[*Request, *emptypb.Empty]( - ctx, in, "dev.ZorumsService.QuorumCallEmpty2", - opts..., - ) -} - -// QuorumCallStream plain. -func QuorumCallStream(ctx *ConfigContext, in *Request, opts ...gorums.CallOption) *gorums.Responses[*Response] { - return gorums.QuorumCallStream[*Request, *Response]( - ctx, in, "dev.ZorumsService.QuorumCallStream", - opts..., - ) -} - -// QuorumCallStreamWithEmpty for testing imported message type. -func QuorumCallStreamWithEmpty(ctx *ConfigContext, in *Request, opts ...gorums.CallOption) *gorums.Responses[*emptypb.Empty] { - return gorums.QuorumCallStream[*Request, *emptypb.Empty]( - ctx, in, "dev.ZorumsService.QuorumCallStreamWithEmpty", - opts..., - ) -} - -// QuorumCallStreamWithEmpty2 for testing imported message type; with same return -// type as QuorumCallStream: Response. -func QuorumCallStreamWithEmpty2(ctx *ConfigContext, in *emptypb.Empty, opts ...gorums.CallOption) *gorums.Responses[*Response] { - return gorums.QuorumCallStream[*emptypb.Empty, *Response]( - ctx, in, "dev.ZorumsService.QuorumCallStreamWithEmpty2", - opts..., - ) -} diff --git a/cmd/protoc-gen-gorums/dev/zorums_rpc_gorums.pb.go b/cmd/protoc-gen-gorums/dev/zorums_rpc_gorums.pb.go deleted file mode 100644 index 7537022c5..000000000 --- a/cmd/protoc-gen-gorums/dev/zorums_rpc_gorums.pb.go +++ /dev/null @@ -1,28 +0,0 @@ -// Code generated by protoc-gen-gorums. DO NOT EDIT. -// versions: -// protoc-gen-gorums v0.11.0-devel -// protoc v6.33.4 -// source: zorums.proto - -package dev - -import ( - gorums "github.com/relab/gorums" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = gorums.EnforceVersion(11 - gorums.MinVersion) - // Verify that the gorums runtime is sufficiently up-to-date. - _ = gorums.EnforceVersion(gorums.MaxVersion - 11) -) - -// GRPCCall plain gRPC call; testing that Gorums can ignore these, but that -// they are added to the _grpc.pb.go generated file. -func GRPCCall(ctx *NodeContext, in *Request) (resp *Response, err error) { - res, err := gorums.RPCCall(ctx, in, "dev.ZorumsService.GRPCCall") - if err != nil { - return nil, err - } - return res.(*Response), err -} diff --git a/cmd/protoc-gen-gorums/dev/zorums_server_gorums.pb.go b/cmd/protoc-gen-gorums/dev/zorums_server_gorums.pb.go deleted file mode 100644 index 987597727..000000000 --- a/cmd/protoc-gen-gorums/dev/zorums_server_gorums.pb.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by protoc-gen-gorums. DO NOT EDIT. -// versions: -// protoc-gen-gorums v0.11.0-devel -// protoc v6.33.4 -// source: zorums.proto - -package dev - -import ( - gorums "github.com/relab/gorums" - proto "google.golang.org/protobuf/proto" - emptypb "google.golang.org/protobuf/types/known/emptypb" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = gorums.EnforceVersion(11 - gorums.MinVersion) - // Verify that the gorums runtime is sufficiently up-to-date. - _ = gorums.EnforceVersion(gorums.MaxVersion - 11) -) - -// ZorumsService is the server-side API for the ZorumsService Service -type ZorumsServiceServer interface { - GRPCCall(ctx gorums.ServerCtx, request *Request) (response *Response, err error) - QuorumCall(ctx gorums.ServerCtx, request *Request) (response *Response, err error) - QuorumCallEmpty(ctx gorums.ServerCtx, request *emptypb.Empty) (response *Response, err error) - QuorumCallEmpty2(ctx gorums.ServerCtx, request *Request) (response *emptypb.Empty, err error) - Multicast(ctx gorums.ServerCtx, request *Request) - Multicast2(ctx gorums.ServerCtx, request *Request) - Multicast3(ctx gorums.ServerCtx, request *Request) - Multicast4(ctx gorums.ServerCtx, request *emptypb.Empty) - QuorumCallStream(ctx gorums.ServerCtx, request *Request, send func(response *Response) error) error - QuorumCallStreamWithEmpty(ctx gorums.ServerCtx, request *Request, send func(response *emptypb.Empty) error) error - QuorumCallStreamWithEmpty2(ctx gorums.ServerCtx, request *emptypb.Empty, send func(response *Response) error) error - Unicast(ctx gorums.ServerCtx, request *Request) - Unicast2(ctx gorums.ServerCtx, request *Request) -} - -func RegisterZorumsServiceServer(srv *gorums.Server, impl ZorumsServiceServer) { - srv.RegisterHandler("dev.ZorumsService.GRPCCall", func(ctx gorums.ServerCtx, in *gorums.Message) (*gorums.Message, error) { - req := gorums.AsProto[*Request](in) - resp, err := impl.GRPCCall(ctx, req) - return gorums.NewResponseMessage(in.GetMetadata(), resp), err - }) - srv.RegisterHandler("dev.ZorumsService.QuorumCall", func(ctx gorums.ServerCtx, in *gorums.Message) (*gorums.Message, error) { - req := gorums.AsProto[*Request](in) - resp, err := impl.QuorumCall(ctx, req) - return gorums.NewResponseMessage(in.GetMetadata(), resp), err - }) - srv.RegisterHandler("dev.ZorumsService.QuorumCallEmpty", func(ctx gorums.ServerCtx, in *gorums.Message) (*gorums.Message, error) { - req := gorums.AsProto[*emptypb.Empty](in) - resp, err := impl.QuorumCallEmpty(ctx, req) - return gorums.NewResponseMessage(in.GetMetadata(), resp), err - }) - srv.RegisterHandler("dev.ZorumsService.QuorumCallEmpty2", func(ctx gorums.ServerCtx, in *gorums.Message) (*gorums.Message, error) { - req := gorums.AsProto[*Request](in) - resp, err := impl.QuorumCallEmpty2(ctx, req) - return gorums.NewResponseMessage(in.GetMetadata(), resp), err - }) - srv.RegisterHandler("dev.ZorumsService.Multicast", func(ctx gorums.ServerCtx, in *gorums.Message) (*gorums.Message, error) { - req := gorums.AsProto[*Request](in) - impl.Multicast(ctx, req) - return nil, nil - }) - srv.RegisterHandler("dev.ZorumsService.Multicast2", func(ctx gorums.ServerCtx, in *gorums.Message) (*gorums.Message, error) { - req := gorums.AsProto[*Request](in) - impl.Multicast2(ctx, req) - return nil, nil - }) - srv.RegisterHandler("dev.ZorumsService.Multicast3", func(ctx gorums.ServerCtx, in *gorums.Message) (*gorums.Message, error) { - req := gorums.AsProto[*Request](in) - impl.Multicast3(ctx, req) - return nil, nil - }) - srv.RegisterHandler("dev.ZorumsService.Multicast4", func(ctx gorums.ServerCtx, in *gorums.Message) (*gorums.Message, error) { - req := gorums.AsProto[*emptypb.Empty](in) - impl.Multicast4(ctx, req) - return nil, nil - }) - srv.RegisterHandler("dev.ZorumsService.QuorumCallStream", func(ctx gorums.ServerCtx, in *gorums.Message) (*gorums.Message, error) { - req := gorums.AsProto[*Request](in) - err := impl.QuorumCallStream(ctx, req, func(resp *Response) error { - // create a copy of the metadata, to avoid a data race between NewResponseMessage and SendMsg - md := proto.CloneOf(in.GetMetadata()) - return ctx.SendMessage(gorums.NewResponseMessage(md, resp)) - }) - return nil, err - }) - srv.RegisterHandler("dev.ZorumsService.QuorumCallStreamWithEmpty", func(ctx gorums.ServerCtx, in *gorums.Message) (*gorums.Message, error) { - req := gorums.AsProto[*Request](in) - err := impl.QuorumCallStreamWithEmpty(ctx, req, func(resp *emptypb.Empty) error { - // create a copy of the metadata, to avoid a data race between NewResponseMessage and SendMsg - md := proto.CloneOf(in.GetMetadata()) - return ctx.SendMessage(gorums.NewResponseMessage(md, resp)) - }) - return nil, err - }) - srv.RegisterHandler("dev.ZorumsService.QuorumCallStreamWithEmpty2", func(ctx gorums.ServerCtx, in *gorums.Message) (*gorums.Message, error) { - req := gorums.AsProto[*emptypb.Empty](in) - err := impl.QuorumCallStreamWithEmpty2(ctx, req, func(resp *Response) error { - // create a copy of the metadata, to avoid a data race between NewResponseMessage and SendMsg - md := proto.CloneOf(in.GetMetadata()) - return ctx.SendMessage(gorums.NewResponseMessage(md, resp)) - }) - return nil, err - }) - srv.RegisterHandler("dev.ZorumsService.Unicast", func(ctx gorums.ServerCtx, in *gorums.Message) (*gorums.Message, error) { - req := gorums.AsProto[*Request](in) - impl.Unicast(ctx, req) - return nil, nil - }) - srv.RegisterHandler("dev.ZorumsService.Unicast2", func(ctx gorums.ServerCtx, in *gorums.Message) (*gorums.Message, error) { - req := gorums.AsProto[*Request](in) - impl.Unicast2(ctx, req) - return nil, nil - }) -} diff --git a/cmd/protoc-gen-gorums/dev/zorums_types_gorums.pb.go b/cmd/protoc-gen-gorums/dev/zorums_types_gorums.pb.go deleted file mode 100644 index 35babf1d6..000000000 --- a/cmd/protoc-gen-gorums/dev/zorums_types_gorums.pb.go +++ /dev/null @@ -1,31 +0,0 @@ -// Code generated by protoc-gen-gorums. DO NOT EDIT. -// versions: -// protoc-gen-gorums v0.11.0-devel -// protoc v6.33.4 -// source: zorums.proto - -package dev - -import ( - gorums "github.com/relab/gorums" - emptypb "google.golang.org/protobuf/types/known/emptypb" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = gorums.EnforceVersion(11 - gorums.MinVersion) - // Verify that the gorums runtime is sufficiently up-to-date. - _ = gorums.EnforceVersion(gorums.MaxVersion - 11) -) - -// AsyncEmpty is a future for async quorum calls returning *emptypb.Empty. -type AsyncEmpty = *gorums.Async[*emptypb.Empty] - -// AsyncResponse is a future for async quorum calls returning *Response. -type AsyncResponse = *gorums.Async[*Response] - -// CorrectableEmpty is a correctable object for quorum calls returning *emptypb.Empty. -type CorrectableEmpty = *gorums.Correctable[*emptypb.Empty] - -// CorrectableResponse is a correctable object for quorum calls returning *Response. -type CorrectableResponse = *gorums.Correctable[*Response] diff --git a/cmd/protoc-gen-gorums/dev/zorums_unicast_gorums.pb.go b/cmd/protoc-gen-gorums/dev/zorums_unicast_gorums.pb.go deleted file mode 100644 index 1453ed0cb..000000000 --- a/cmd/protoc-gen-gorums/dev/zorums_unicast_gorums.pb.go +++ /dev/null @@ -1,34 +0,0 @@ -// Code generated by protoc-gen-gorums. DO NOT EDIT. -// versions: -// protoc-gen-gorums v0.11.0-devel -// protoc v6.33.4 -// source: zorums.proto - -package dev - -import ( - gorums "github.com/relab/gorums" - emptypb "google.golang.org/protobuf/types/known/emptypb" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = gorums.EnforceVersion(11 - gorums.MinVersion) - // Verify that the gorums runtime is sufficiently up-to-date. - _ = gorums.EnforceVersion(gorums.MaxVersion - 11) -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ emptypb.Empty - -// Unicast is a unicast call invoked on the node in ctx. -// No reply is returned to the client. -func Unicast(ctx *NodeContext, in *Request, opts ...gorums.CallOption) error { - return gorums.Unicast(ctx, in, "dev.ZorumsService.Unicast", opts...) -} - -// Unicast2 is a unicast call invoked on the node in ctx. -// No reply is returned to the client. -func Unicast2(ctx *NodeContext, in *Request, opts ...gorums.CallOption) error { - return gorums.Unicast(ctx, in, "dev.ZorumsService.Unicast2", opts...) -} From 344c305cad940a0359e2cb977a8126ae46f87c35 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 7 Feb 2026 12:18:27 +0000 Subject: [PATCH 5/6] Restore accidentally deleted generated dev files Co-authored-by: meling <810999+meling@users.noreply.github.com> --- cmd/protoc-gen-gorums/dev/zorums.pb.go | 290 ++++++++++++++++++ .../dev/zorums_multicast_gorums.pb.go | 42 +++ .../dev/zorums_quorumcall_gorums.pb.go | 68 ++++ .../dev/zorums_rpc_gorums.pb.go | 28 ++ .../dev/zorums_server_gorums.pb.go | 117 +++++++ .../dev/zorums_types_gorums.pb.go | 31 ++ .../dev/zorums_unicast_gorums.pb.go | 34 ++ 7 files changed, 610 insertions(+) create mode 100644 cmd/protoc-gen-gorums/dev/zorums.pb.go create mode 100644 cmd/protoc-gen-gorums/dev/zorums_multicast_gorums.pb.go create mode 100644 cmd/protoc-gen-gorums/dev/zorums_quorumcall_gorums.pb.go create mode 100644 cmd/protoc-gen-gorums/dev/zorums_rpc_gorums.pb.go create mode 100644 cmd/protoc-gen-gorums/dev/zorums_server_gorums.pb.go create mode 100644 cmd/protoc-gen-gorums/dev/zorums_types_gorums.pb.go create mode 100644 cmd/protoc-gen-gorums/dev/zorums_unicast_gorums.pb.go diff --git a/cmd/protoc-gen-gorums/dev/zorums.pb.go b/cmd/protoc-gen-gorums/dev/zorums.pb.go new file mode 100644 index 000000000..a5944b08b --- /dev/null +++ b/cmd/protoc-gen-gorums/dev/zorums.pb.go @@ -0,0 +1,290 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.11 +// protoc v6.33.4 +// source: zorums.proto + +package dev + +import ( + _ "github.com/relab/gorums" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + emptypb "google.golang.org/protobuf/types/known/emptypb" + reflect "reflect" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Request struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Value string `protobuf:"bytes,1,opt,name=Value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Request) Reset() { + *x = Request{} + mi := &file_zorums_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Request) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Request) ProtoMessage() {} + +func (x *Request) ProtoReflect() protoreflect.Message { + mi := &file_zorums_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Request) GetValue() string { + if x != nil { + return x.xxx_hidden_Value + } + return "" +} + +func (x *Request) SetValue(v string) { + x.xxx_hidden_Value = v +} + +type Request_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Value string +} + +func (b0 Request_builder) Build() *Request { + m0 := &Request{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Value = b.Value + return m0 +} + +type Response struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Result int64 `protobuf:"varint,1,opt,name=Result"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Response) Reset() { + *x = Response{} + mi := &file_zorums_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Response) ProtoMessage() {} + +func (x *Response) ProtoReflect() protoreflect.Message { + mi := &file_zorums_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *Response) GetResult() int64 { + if x != nil { + return x.xxx_hidden_Result + } + return 0 +} + +func (x *Response) SetResult(v int64) { + x.xxx_hidden_Result = v +} + +type Response_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Result int64 +} + +func (b0 Response_builder) Build() *Response { + m0 := &Response{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Result = b.Result + return m0 +} + +type MyResponse struct { + state protoimpl.MessageState `protogen:"opaque.v1"` + xxx_hidden_Value string `protobuf:"bytes,1,opt,name=Value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MyResponse) Reset() { + *x = MyResponse{} + mi := &file_zorums_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MyResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MyResponse) ProtoMessage() {} + +func (x *MyResponse) ProtoReflect() protoreflect.Message { + mi := &file_zorums_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +func (x *MyResponse) GetValue() string { + if x != nil { + return x.xxx_hidden_Value + } + return "" +} + +func (x *MyResponse) SetValue(v string) { + x.xxx_hidden_Value = v +} + +type MyResponse_builder struct { + _ [0]func() // Prevents comparability and use of unkeyed literals for the builder. + + Value string +} + +func (b0 MyResponse_builder) Build() *MyResponse { + m0 := &MyResponse{} + b, x := &b0, m0 + _, _ = b, x + x.xxx_hidden_Value = b.Value + return m0 +} + +var File_zorums_proto protoreflect.FileDescriptor + +const file_zorums_proto_rawDesc = "" + + "\n" + + "\fzorums.proto\x12\x03dev\x1a\fgorums.proto\x1a\x1bgoogle/protobuf/empty.proto\"\x1f\n" + + "\aRequest\x12\x14\n" + + "\x05Value\x18\x01 \x01(\tR\x05Value\"\"\n" + + "\bResponse\x12\x16\n" + + "\x06Result\x18\x01 \x01(\x03R\x06Result\"\"\n" + + "\n" + + "MyResponse\x12\x14\n" + + "\x05Value\x18\x01 \x01(\tR\x05Value2\x81\x06\n" + + "\rZorumsService\x12)\n" + + "\bGRPCCall\x12\f.dev.Request\x1a\r.dev.Response\"\x00\x12/\n" + + "\n" + + "QuorumCall\x12\f.dev.Request\x1a\r.dev.Response\"\x04\xa0\xb5\x18\x01\x12>\n" + + "\x0fQuorumCallEmpty\x12\x16.google.protobuf.Empty\x1a\r.dev.Response\"\x04\xa0\xb5\x18\x01\x12>\n" + + "\x10QuorumCallEmpty2\x12\f.dev.Request\x1a\x16.google.protobuf.Empty\"\x04\xa0\xb5\x18\x01\x12.\n" + + "\tMulticast\x12\f.dev.Request\x1a\r.dev.Response\"\x04\x98\xb5\x18\x01\x12/\n" + + "\n" + + "Multicast2\x12\f.dev.Request\x1a\r.dev.Response\"\x04\x98\xb5\x18\x01\x128\n" + + "\n" + + "Multicast3\x12\f.dev.Request\x1a\x16.google.protobuf.Empty\"\x04\x98\xb5\x18\x01\x12B\n" + + "\n" + + "Multicast4\x12\x16.google.protobuf.Empty\x1a\x16.google.protobuf.Empty\"\x04\x98\xb5\x18\x01\x127\n" + + "\x10QuorumCallStream\x12\f.dev.Request\x1a\r.dev.Response\"\x04\xa0\xb5\x18\x010\x01\x12I\n" + + "\x19QuorumCallStreamWithEmpty\x12\f.dev.Request\x1a\x16.google.protobuf.Empty\"\x04\xa0\xb5\x18\x010\x01\x12K\n" + + "\x1aQuorumCallStreamWithEmpty2\x12\x16.google.protobuf.Empty\x1a\r.dev.Response\"\x04\xa0\xb5\x18\x010\x01\x12,\n" + + "\aUnicast\x12\f.dev.Request\x1a\r.dev.Response\"\x04\x90\xb5\x18\x01\x126\n" + + "\bUnicast2\x12\f.dev.Request\x1a\x16.google.protobuf.Empty\"\x04\x90\xb5\x18\x01B Z\x19cmd/protoc-gen-gorums/dev\x92\x03\x02\b\x02b\beditionsp\xe8\a" + +var file_zorums_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_zorums_proto_goTypes = []any{ + (*Request)(nil), // 0: dev.Request + (*Response)(nil), // 1: dev.Response + (*MyResponse)(nil), // 2: dev.MyResponse + (*emptypb.Empty)(nil), // 3: google.protobuf.Empty +} +var file_zorums_proto_depIdxs = []int32{ + 0, // 0: dev.ZorumsService.GRPCCall:input_type -> dev.Request + 0, // 1: dev.ZorumsService.QuorumCall:input_type -> dev.Request + 3, // 2: dev.ZorumsService.QuorumCallEmpty:input_type -> google.protobuf.Empty + 0, // 3: dev.ZorumsService.QuorumCallEmpty2:input_type -> dev.Request + 0, // 4: dev.ZorumsService.Multicast:input_type -> dev.Request + 0, // 5: dev.ZorumsService.Multicast2:input_type -> dev.Request + 0, // 6: dev.ZorumsService.Multicast3:input_type -> dev.Request + 3, // 7: dev.ZorumsService.Multicast4:input_type -> google.protobuf.Empty + 0, // 8: dev.ZorumsService.QuorumCallStream:input_type -> dev.Request + 0, // 9: dev.ZorumsService.QuorumCallStreamWithEmpty:input_type -> dev.Request + 3, // 10: dev.ZorumsService.QuorumCallStreamWithEmpty2:input_type -> google.protobuf.Empty + 0, // 11: dev.ZorumsService.Unicast:input_type -> dev.Request + 0, // 12: dev.ZorumsService.Unicast2:input_type -> dev.Request + 1, // 13: dev.ZorumsService.GRPCCall:output_type -> dev.Response + 1, // 14: dev.ZorumsService.QuorumCall:output_type -> dev.Response + 1, // 15: dev.ZorumsService.QuorumCallEmpty:output_type -> dev.Response + 3, // 16: dev.ZorumsService.QuorumCallEmpty2:output_type -> google.protobuf.Empty + 1, // 17: dev.ZorumsService.Multicast:output_type -> dev.Response + 1, // 18: dev.ZorumsService.Multicast2:output_type -> dev.Response + 3, // 19: dev.ZorumsService.Multicast3:output_type -> google.protobuf.Empty + 3, // 20: dev.ZorumsService.Multicast4:output_type -> google.protobuf.Empty + 1, // 21: dev.ZorumsService.QuorumCallStream:output_type -> dev.Response + 3, // 22: dev.ZorumsService.QuorumCallStreamWithEmpty:output_type -> google.protobuf.Empty + 1, // 23: dev.ZorumsService.QuorumCallStreamWithEmpty2:output_type -> dev.Response + 1, // 24: dev.ZorumsService.Unicast:output_type -> dev.Response + 3, // 25: dev.ZorumsService.Unicast2:output_type -> google.protobuf.Empty + 13, // [13:26] is the sub-list for method output_type + 0, // [0:13] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_zorums_proto_init() } +func file_zorums_proto_init() { + if File_zorums_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_zorums_proto_rawDesc), len(file_zorums_proto_rawDesc)), + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_zorums_proto_goTypes, + DependencyIndexes: file_zorums_proto_depIdxs, + MessageInfos: file_zorums_proto_msgTypes, + }.Build() + File_zorums_proto = out.File + file_zorums_proto_goTypes = nil + file_zorums_proto_depIdxs = nil +} diff --git a/cmd/protoc-gen-gorums/dev/zorums_multicast_gorums.pb.go b/cmd/protoc-gen-gorums/dev/zorums_multicast_gorums.pb.go new file mode 100644 index 000000000..d05250d93 --- /dev/null +++ b/cmd/protoc-gen-gorums/dev/zorums_multicast_gorums.pb.go @@ -0,0 +1,42 @@ +// Code generated by protoc-gen-gorums. DO NOT EDIT. +// versions: +// protoc-gen-gorums v0.11.0-devel +// protoc v6.33.4 +// source: zorums.proto + +package dev + +import ( + gorums "github.com/relab/gorums" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = gorums.EnforceVersion(11 - gorums.MinVersion) + // Verify that the gorums runtime is sufficiently up-to-date. + _ = gorums.EnforceVersion(gorums.MaxVersion - 11) +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ emptypb.Empty + +// Multicast plain. Response type is not needed here. +func Multicast(ctx *ConfigContext, in *Request, opts ...gorums.CallOption) error { + return gorums.Multicast(ctx, in, "dev.ZorumsService.Multicast", opts...) +} + +// Multicast2 is testing whether multiple streams work. +func Multicast2(ctx *ConfigContext, in *Request, opts ...gorums.CallOption) error { + return gorums.Multicast(ctx, in, "dev.ZorumsService.Multicast2", opts...) +} + +// Multicast3 is testing imported message type. +func Multicast3(ctx *ConfigContext, in *Request, opts ...gorums.CallOption) error { + return gorums.Multicast(ctx, in, "dev.ZorumsService.Multicast3", opts...) +} + +// Multicast4 is testing imported message type. +func Multicast4(ctx *ConfigContext, in *emptypb.Empty, opts ...gorums.CallOption) error { + return gorums.Multicast(ctx, in, "dev.ZorumsService.Multicast4", opts...) +} diff --git a/cmd/protoc-gen-gorums/dev/zorums_quorumcall_gorums.pb.go b/cmd/protoc-gen-gorums/dev/zorums_quorumcall_gorums.pb.go new file mode 100644 index 000000000..394670b51 --- /dev/null +++ b/cmd/protoc-gen-gorums/dev/zorums_quorumcall_gorums.pb.go @@ -0,0 +1,68 @@ +// Code generated by protoc-gen-gorums. DO NOT EDIT. +// versions: +// protoc-gen-gorums v0.11.0-devel +// protoc v6.33.4 +// source: zorums.proto + +package dev + +import ( + gorums "github.com/relab/gorums" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = gorums.EnforceVersion(11 - gorums.MinVersion) + // Verify that the gorums runtime is sufficiently up-to-date. + _ = gorums.EnforceVersion(gorums.MaxVersion - 11) +) + +// QuorumCall plain. +func QuorumCall(ctx *ConfigContext, in *Request, opts ...gorums.CallOption) *gorums.Responses[*Response] { + return gorums.QuorumCall[*Request, *Response]( + ctx, in, "dev.ZorumsService.QuorumCall", + opts..., + ) +} + +// QuorumCallEmpty for testing imported message type. +func QuorumCallEmpty(ctx *ConfigContext, in *emptypb.Empty, opts ...gorums.CallOption) *gorums.Responses[*Response] { + return gorums.QuorumCall[*emptypb.Empty, *Response]( + ctx, in, "dev.ZorumsService.QuorumCallEmpty", + opts..., + ) +} + +// QuorumCallEmpty2 for testing imported message type. +func QuorumCallEmpty2(ctx *ConfigContext, in *Request, opts ...gorums.CallOption) *gorums.Responses[*emptypb.Empty] { + return gorums.QuorumCall[*Request, *emptypb.Empty]( + ctx, in, "dev.ZorumsService.QuorumCallEmpty2", + opts..., + ) +} + +// QuorumCallStream plain. +func QuorumCallStream(ctx *ConfigContext, in *Request, opts ...gorums.CallOption) *gorums.Responses[*Response] { + return gorums.QuorumCallStream[*Request, *Response]( + ctx, in, "dev.ZorumsService.QuorumCallStream", + opts..., + ) +} + +// QuorumCallStreamWithEmpty for testing imported message type. +func QuorumCallStreamWithEmpty(ctx *ConfigContext, in *Request, opts ...gorums.CallOption) *gorums.Responses[*emptypb.Empty] { + return gorums.QuorumCallStream[*Request, *emptypb.Empty]( + ctx, in, "dev.ZorumsService.QuorumCallStreamWithEmpty", + opts..., + ) +} + +// QuorumCallStreamWithEmpty2 for testing imported message type; with same return +// type as QuorumCallStream: Response. +func QuorumCallStreamWithEmpty2(ctx *ConfigContext, in *emptypb.Empty, opts ...gorums.CallOption) *gorums.Responses[*Response] { + return gorums.QuorumCallStream[*emptypb.Empty, *Response]( + ctx, in, "dev.ZorumsService.QuorumCallStreamWithEmpty2", + opts..., + ) +} diff --git a/cmd/protoc-gen-gorums/dev/zorums_rpc_gorums.pb.go b/cmd/protoc-gen-gorums/dev/zorums_rpc_gorums.pb.go new file mode 100644 index 000000000..7537022c5 --- /dev/null +++ b/cmd/protoc-gen-gorums/dev/zorums_rpc_gorums.pb.go @@ -0,0 +1,28 @@ +// Code generated by protoc-gen-gorums. DO NOT EDIT. +// versions: +// protoc-gen-gorums v0.11.0-devel +// protoc v6.33.4 +// source: zorums.proto + +package dev + +import ( + gorums "github.com/relab/gorums" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = gorums.EnforceVersion(11 - gorums.MinVersion) + // Verify that the gorums runtime is sufficiently up-to-date. + _ = gorums.EnforceVersion(gorums.MaxVersion - 11) +) + +// GRPCCall plain gRPC call; testing that Gorums can ignore these, but that +// they are added to the _grpc.pb.go generated file. +func GRPCCall(ctx *NodeContext, in *Request) (resp *Response, err error) { + res, err := gorums.RPCCall(ctx, in, "dev.ZorumsService.GRPCCall") + if err != nil { + return nil, err + } + return res.(*Response), err +} diff --git a/cmd/protoc-gen-gorums/dev/zorums_server_gorums.pb.go b/cmd/protoc-gen-gorums/dev/zorums_server_gorums.pb.go new file mode 100644 index 000000000..987597727 --- /dev/null +++ b/cmd/protoc-gen-gorums/dev/zorums_server_gorums.pb.go @@ -0,0 +1,117 @@ +// Code generated by protoc-gen-gorums. DO NOT EDIT. +// versions: +// protoc-gen-gorums v0.11.0-devel +// protoc v6.33.4 +// source: zorums.proto + +package dev + +import ( + gorums "github.com/relab/gorums" + proto "google.golang.org/protobuf/proto" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = gorums.EnforceVersion(11 - gorums.MinVersion) + // Verify that the gorums runtime is sufficiently up-to-date. + _ = gorums.EnforceVersion(gorums.MaxVersion - 11) +) + +// ZorumsService is the server-side API for the ZorumsService Service +type ZorumsServiceServer interface { + GRPCCall(ctx gorums.ServerCtx, request *Request) (response *Response, err error) + QuorumCall(ctx gorums.ServerCtx, request *Request) (response *Response, err error) + QuorumCallEmpty(ctx gorums.ServerCtx, request *emptypb.Empty) (response *Response, err error) + QuorumCallEmpty2(ctx gorums.ServerCtx, request *Request) (response *emptypb.Empty, err error) + Multicast(ctx gorums.ServerCtx, request *Request) + Multicast2(ctx gorums.ServerCtx, request *Request) + Multicast3(ctx gorums.ServerCtx, request *Request) + Multicast4(ctx gorums.ServerCtx, request *emptypb.Empty) + QuorumCallStream(ctx gorums.ServerCtx, request *Request, send func(response *Response) error) error + QuorumCallStreamWithEmpty(ctx gorums.ServerCtx, request *Request, send func(response *emptypb.Empty) error) error + QuorumCallStreamWithEmpty2(ctx gorums.ServerCtx, request *emptypb.Empty, send func(response *Response) error) error + Unicast(ctx gorums.ServerCtx, request *Request) + Unicast2(ctx gorums.ServerCtx, request *Request) +} + +func RegisterZorumsServiceServer(srv *gorums.Server, impl ZorumsServiceServer) { + srv.RegisterHandler("dev.ZorumsService.GRPCCall", func(ctx gorums.ServerCtx, in *gorums.Message) (*gorums.Message, error) { + req := gorums.AsProto[*Request](in) + resp, err := impl.GRPCCall(ctx, req) + return gorums.NewResponseMessage(in.GetMetadata(), resp), err + }) + srv.RegisterHandler("dev.ZorumsService.QuorumCall", func(ctx gorums.ServerCtx, in *gorums.Message) (*gorums.Message, error) { + req := gorums.AsProto[*Request](in) + resp, err := impl.QuorumCall(ctx, req) + return gorums.NewResponseMessage(in.GetMetadata(), resp), err + }) + srv.RegisterHandler("dev.ZorumsService.QuorumCallEmpty", func(ctx gorums.ServerCtx, in *gorums.Message) (*gorums.Message, error) { + req := gorums.AsProto[*emptypb.Empty](in) + resp, err := impl.QuorumCallEmpty(ctx, req) + return gorums.NewResponseMessage(in.GetMetadata(), resp), err + }) + srv.RegisterHandler("dev.ZorumsService.QuorumCallEmpty2", func(ctx gorums.ServerCtx, in *gorums.Message) (*gorums.Message, error) { + req := gorums.AsProto[*Request](in) + resp, err := impl.QuorumCallEmpty2(ctx, req) + return gorums.NewResponseMessage(in.GetMetadata(), resp), err + }) + srv.RegisterHandler("dev.ZorumsService.Multicast", func(ctx gorums.ServerCtx, in *gorums.Message) (*gorums.Message, error) { + req := gorums.AsProto[*Request](in) + impl.Multicast(ctx, req) + return nil, nil + }) + srv.RegisterHandler("dev.ZorumsService.Multicast2", func(ctx gorums.ServerCtx, in *gorums.Message) (*gorums.Message, error) { + req := gorums.AsProto[*Request](in) + impl.Multicast2(ctx, req) + return nil, nil + }) + srv.RegisterHandler("dev.ZorumsService.Multicast3", func(ctx gorums.ServerCtx, in *gorums.Message) (*gorums.Message, error) { + req := gorums.AsProto[*Request](in) + impl.Multicast3(ctx, req) + return nil, nil + }) + srv.RegisterHandler("dev.ZorumsService.Multicast4", func(ctx gorums.ServerCtx, in *gorums.Message) (*gorums.Message, error) { + req := gorums.AsProto[*emptypb.Empty](in) + impl.Multicast4(ctx, req) + return nil, nil + }) + srv.RegisterHandler("dev.ZorumsService.QuorumCallStream", func(ctx gorums.ServerCtx, in *gorums.Message) (*gorums.Message, error) { + req := gorums.AsProto[*Request](in) + err := impl.QuorumCallStream(ctx, req, func(resp *Response) error { + // create a copy of the metadata, to avoid a data race between NewResponseMessage and SendMsg + md := proto.CloneOf(in.GetMetadata()) + return ctx.SendMessage(gorums.NewResponseMessage(md, resp)) + }) + return nil, err + }) + srv.RegisterHandler("dev.ZorumsService.QuorumCallStreamWithEmpty", func(ctx gorums.ServerCtx, in *gorums.Message) (*gorums.Message, error) { + req := gorums.AsProto[*Request](in) + err := impl.QuorumCallStreamWithEmpty(ctx, req, func(resp *emptypb.Empty) error { + // create a copy of the metadata, to avoid a data race between NewResponseMessage and SendMsg + md := proto.CloneOf(in.GetMetadata()) + return ctx.SendMessage(gorums.NewResponseMessage(md, resp)) + }) + return nil, err + }) + srv.RegisterHandler("dev.ZorumsService.QuorumCallStreamWithEmpty2", func(ctx gorums.ServerCtx, in *gorums.Message) (*gorums.Message, error) { + req := gorums.AsProto[*emptypb.Empty](in) + err := impl.QuorumCallStreamWithEmpty2(ctx, req, func(resp *Response) error { + // create a copy of the metadata, to avoid a data race between NewResponseMessage and SendMsg + md := proto.CloneOf(in.GetMetadata()) + return ctx.SendMessage(gorums.NewResponseMessage(md, resp)) + }) + return nil, err + }) + srv.RegisterHandler("dev.ZorumsService.Unicast", func(ctx gorums.ServerCtx, in *gorums.Message) (*gorums.Message, error) { + req := gorums.AsProto[*Request](in) + impl.Unicast(ctx, req) + return nil, nil + }) + srv.RegisterHandler("dev.ZorumsService.Unicast2", func(ctx gorums.ServerCtx, in *gorums.Message) (*gorums.Message, error) { + req := gorums.AsProto[*Request](in) + impl.Unicast2(ctx, req) + return nil, nil + }) +} diff --git a/cmd/protoc-gen-gorums/dev/zorums_types_gorums.pb.go b/cmd/protoc-gen-gorums/dev/zorums_types_gorums.pb.go new file mode 100644 index 000000000..35babf1d6 --- /dev/null +++ b/cmd/protoc-gen-gorums/dev/zorums_types_gorums.pb.go @@ -0,0 +1,31 @@ +// Code generated by protoc-gen-gorums. DO NOT EDIT. +// versions: +// protoc-gen-gorums v0.11.0-devel +// protoc v6.33.4 +// source: zorums.proto + +package dev + +import ( + gorums "github.com/relab/gorums" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = gorums.EnforceVersion(11 - gorums.MinVersion) + // Verify that the gorums runtime is sufficiently up-to-date. + _ = gorums.EnforceVersion(gorums.MaxVersion - 11) +) + +// AsyncEmpty is a future for async quorum calls returning *emptypb.Empty. +type AsyncEmpty = *gorums.Async[*emptypb.Empty] + +// AsyncResponse is a future for async quorum calls returning *Response. +type AsyncResponse = *gorums.Async[*Response] + +// CorrectableEmpty is a correctable object for quorum calls returning *emptypb.Empty. +type CorrectableEmpty = *gorums.Correctable[*emptypb.Empty] + +// CorrectableResponse is a correctable object for quorum calls returning *Response. +type CorrectableResponse = *gorums.Correctable[*Response] diff --git a/cmd/protoc-gen-gorums/dev/zorums_unicast_gorums.pb.go b/cmd/protoc-gen-gorums/dev/zorums_unicast_gorums.pb.go new file mode 100644 index 000000000..1453ed0cb --- /dev/null +++ b/cmd/protoc-gen-gorums/dev/zorums_unicast_gorums.pb.go @@ -0,0 +1,34 @@ +// Code generated by protoc-gen-gorums. DO NOT EDIT. +// versions: +// protoc-gen-gorums v0.11.0-devel +// protoc v6.33.4 +// source: zorums.proto + +package dev + +import ( + gorums "github.com/relab/gorums" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = gorums.EnforceVersion(11 - gorums.MinVersion) + // Verify that the gorums runtime is sufficiently up-to-date. + _ = gorums.EnforceVersion(gorums.MaxVersion - 11) +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ emptypb.Empty + +// Unicast is a unicast call invoked on the node in ctx. +// No reply is returned to the client. +func Unicast(ctx *NodeContext, in *Request, opts ...gorums.CallOption) error { + return gorums.Unicast(ctx, in, "dev.ZorumsService.Unicast", opts...) +} + +// Unicast2 is a unicast call invoked on the node in ctx. +// No reply is returned to the client. +func Unicast2(ctx *NodeContext, in *Request, opts ...gorums.CallOption) error { + return gorums.Unicast(ctx, in, "dev.ZorumsService.Unicast2", opts...) +} From 27c452b4f789bd97c0792120630f46b31e340dc3 Mon Sep 17 00:00:00 2001 From: Hein Meling Date: Sat, 7 Feb 2026 14:11:58 +0100 Subject: [PATCH 6/6] chore: recompile with latest protoc compiler --- ordering/ordering.pb.go | 2 +- ordering/ordering_grpc.pb.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ordering/ordering.pb.go b/ordering/ordering.pb.go index d4c8a01af..7a354893b 100644 --- a/ordering/ordering.pb.go +++ b/ordering/ordering.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v5.29.3 +// protoc v6.33.4 // source: ordering/ordering.proto package ordering diff --git a/ordering/ordering_grpc.pb.go b/ordering/ordering_grpc.pb.go index 7e52ed9f4..a1b79e9f0 100644 --- a/ordering/ordering_grpc.pb.go +++ b/ordering/ordering_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.6.0 -// - protoc v5.29.3 +// - protoc v6.33.4 // source: ordering/ordering.proto package ordering